File

branding/shared/lazy/add-branding-modal/add-branding-modal.component.ts

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(branding: StoreBrandingService, formBuilder: FormBuilder)
Parameters :
Name Type Optional
branding StoreBrandingService No
formBuilder FormBuilder No

Inputs

duplicateBranding
Type : boolean
Default value : false

Methods

cancel
cancel()
Returns : void
Async getExistingBrandingVersions
getExistingBrandingVersions()
Returns : any
initForm
initForm()
Returns : any
save
save()
Returns : void

Properties

form
Type : ReturnType<>
loading
Default value : true
messages
Default value : [ { name: 'nameAlreadyTaken', text: gettext('The provided name is already taken.') }, { name: 'onlyLowerCaseCharacters', text: gettext('Only lower case characters are allowed.') }, { name: 'shouldStartWithLowerCaseLetterOrNumber', text: gettext('Should start with a lower case letter or a number.') }, { name: 'invalidCharacters', text: gettext('Invalid character "{{ invalidCharacter }}". Only a-z, 0-9 and - are allowed.') } ] as const
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>

results matching ""

    No results matching ""