branding/shared/data/store-branding.service.ts
Service to load and store the branding of the tenant.
Properties |
|
Methods |
|
constructor(applicationService: ApplicationService, inventory: InventoryService, binary: InventoryBinaryService, zip: ZipService, fetch: FetchClient, brandingVersionService: BrandingVersionService, appState: AppStateService, staticAssets: StaticAssetsService, themeSwitcher: ThemeSwitcherService)
|
||||||||||||||||||||||||||||||
Parameters :
|
Async addBranding | ||||||||||||||||||||
addBranding(version: string, content: BrandingOptionsJson, tags: string[], publicOptionsApp?: IApplication)
|
||||||||||||||||||||
Adds a new branding version to the public options app. The public options app can be optionally provided to avoid another request for it.
Parameters :
Returns :
Promise<literal type>
|
Async deleteAllBrandings | ||||||
deleteAllBrandings(publicOptions?: IApplication)
|
||||||
Deletes the public options app and therefore all brandings. The public options app can be optionally provided to avoid another request for it.
Parameters :
Returns :
Promise<void>
|
Async deleteBrandingVersion | |||||||||
deleteBrandingVersion(version: string, publicOptions?: IApplication)
|
|||||||||
Removes a branding version from the public options app. The public options app can be optionally provided to avoid another request for it.
Parameters :
Returns :
Promise<void>
|
Async getBrandingOptionsForVersion | ||||||
getBrandingOptionsForVersion(version?: string)
|
||||||
Returns the branding options for the provided version. If no branding was found (e.g. status 404), an error is thrown.
Parameters :
Returns :
Promise<BrandingOptionsJson>
|
Async getBrandingZip | ||||||||
getBrandingZip(content: Record
|
||||||||
Returns the blob of a zip file containing the provided branding options (options.json) and the manifest (cumulocity.json).
Parameters :
Returns :
Promise<Blob>
|
Async getMetadataOfBrandingBinaries | ||||||
getMetadataOfBrandingBinaries(versions: BrandVersion[])
|
||||||
Enhances the provided branding versions with metadata from the linked binaries. It will add the owner and lastUpdated fields to the versions. The provided array is altered.
Parameters :
Returns :
Promise<BrandVersion[]>
|
Async getStartedUsingBranding |
getStartedUsingBranding()
|
Will create a the initial branding based on the currently applied CSS variables.
Returns :
Promise<void>
|
getZipForBinary | ||||||||||||
getZipForBinary(binaryId: string, fileName: string)
|
||||||||||||
Parameters :
Returns :
Observable<File>
|
Async loadBrandingVariants | ||||||
loadBrandingVariants(app?: IApplication)
|
||||||
Returns the brandings of the tenant. If no public options app is found, publicOptions will be undefined and variants an empty array. For old brandings (created without versioning) a default version is returned.
Parameters :
Returns :
Promise<literal type>
|
Async markAsActive | |||||||||
markAsActive(brandingVersion: BrandVersion, app?: IApplication)
|
|||||||||
Sets the
Parameters :
Returns :
Promise<void>
|
replaceBrandingAssetsInBrandingOptions | ||||||||||||
replaceBrandingAssetsInBrandingOptions(branding: BrandingOptionsJson, oldAssets: StaticAsset[], newAssets: StaticAsset[])
|
||||||||||||
Replaces the assets in the branding options with the new assets.
Goes through the provided
Parameters :
Returns :
BrandingOptionsJson
|
Async saveBranding | ||||||||||||||||||||
saveBranding(blob: Blob | File, version: string, tags: string[], publicOptionsApp?: IApplication)
|
||||||||||||||||||||
Saves the provided branding as a new version for the public options app. The public options app can be optionally provided to avoid another request for it.
Parameters :
Returns :
Promise<literal type>
|
Async saveExistingBranding | ||||||||||||||||||||
saveExistingBranding(branding: Record
|
||||||||||||||||||||
Saves a new iteration of an already existing branding.
Parameters :
Returns :
Promise<string>
|
Async waitForBrandingToBePresent | ||||||||
waitForBrandingToBePresent(version: string)
|
||||||||
As the branding is not immediately available after creation, this method will wait for the branding to be present.
Parameters :
Returns :
Promise<void>
|
Readonly fileNames |
Default value : {
options: 'options.json',
manifest: 'cumulocity.json',
exportZipName: 'public-options.zip'
} as const
|
Readonly manifestValues |
Default value : {
name: 'public-options',
contextPath: 'public-options',
key: 'public-options-key',
description: 'Application containing static assets used by e.g. branding.',
noAppSwitcher: true,
type: ApplicationType.HOSTED,
availability: ApplicationAvailability.SHARED
} as const satisfies IApplication
|
refreshTriggerBrandingVariants |
Default value : new BehaviorSubject<void>(null)
|