branding/shared/lazy/add-branding-modal/add-branding-modal.component.ts
selector | c8y-add-branding-modal |
standalone | true |
imports |
CoreModule
NgIf
ReactiveFormsModule
|
templateUrl | ./add-branding-modal.component.html |
Properties |
Methods |
Inputs |
constructor(branding: StoreBrandingService, formBuilder: FormBuilder)
|
|||||||||
Parameters :
|
duplicateBranding |
Type : boolean
|
Default value : false
|
cancel |
cancel()
|
Returns :
void
|
Async getExistingBrandingVersions |
getExistingBrandingVersions()
|
Returns :
any
|
initForm |
initForm()
|
Returns :
any
|
save |
save()
|
Returns :
void
|
form |
Type : ReturnType<>
|
loading |
Default value : true
|
namesAlreadyTaken |
Type : string[]
|
Default value : []
|
result |
Default value : new Promise<ReturnType<typeof this.initForm>['value']>((resolve, reject) => {
this._resovle = resolve;
this._reject = reject;
})
|
<c8y-modal
[title]="duplicateBranding ? 'Duplicate Branding' : 'Create Branding'"
[headerClasses]="'dialog-header'"
(onDismiss)="cancel()"
(onClose)="save()"
[disabled]="form.invalid"
[labels]="{ cancel: 'Cancel', ok: 'Save' }"
>
<ng-container c8y-modal-title>
<span [c8yIcon]="'palette'"></span>
</ng-container>
<div [formGroup]="form" class="p-24">
<c8y-form-group>
<label
for="brandingName"
translate
>
Branding name
</label>
<input
class="form-control"
name="brandingName"
id="brandingName"
type="text"
formControlName="brandingName"
placeholder="{{'e.g. {{ example }}' | translate : { example: 'main-branding' } }}"
/>
<c8y-messages [helpMessage]="'Upper case letters not allowed' | translate">
<c8y-message *ngFor="let message of messages"
[name]="message.name"
[text]="message.text | translate"
></c8y-message>
</c8y-messages>
</c8y-form-group>
</div>
</c8y-modal>