File

translation-editor/lazy/translation-editor/translation-editor.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods

Constructor

constructor(translationStore: TranslationStoreService, modalService: BsModalService, alert: AlertService, appState: AppStateService, translate: TranslateService)
Parameters :
Name Type Optional
translationStore TranslationStoreService No
modalService BsModalService No
alert AlertService No
appState AppStateService No
translate TranslateService No

Methods

Async addEntry
addEntry()
Returns : any
Async ngOnInit
ngOnInit()
Returns : any
Async refresh
refresh()
Returns : any
refreshColumns
refreshColumns()
Returns : void
Async saveTranslations
saveTranslations()
Returns : any
valueChanged
valueChanged()
Returns : void

Properties

actionControls
Type : ActionControl[]
Default value : [ { type: BuiltInActionType.Delete, callback: item => { this.items = this.items.filter(i => i.key !== item.key); } } ]
availableLangs
Type : literal type[]
Default value : []
columns
Type : Column[]
Default value : []
displayOptions
Type : DisplayOptions
Default value : { bordered: false, striped: true, filter: true, gridHeader: true, hover: true }
isHavingChanges
Default value : false
isLoading
Default value : true
items
Type : Awaited<ReturnType<>>
Default value : new Array<any>()
pagination
Type : Pagination
Default value : { pageSize: 10, currentPage: 1 }
<c8y-title translate>Localization</c8y-title>

<ng-container *ngIf="!isLoading; else loading">
  <c8y-action-bar-item placement="right">
    <button
      class="btn btn-link"
      (click)="addEntry()"
      data-cy="c8y-translation-editor--add-translation"
    >
      <i c8yIcon="plus-circle"></i>
      <span translate>Add translation</span>
    </button>
  </c8y-action-bar-item>

  <c8y-action-bar-item placement="right">
    <button
      class="btn btn-link"
      (click)="saveTranslations()"
      data-cy="c8y-translation-editor--save-and-apply"
    >
      <i c8yIcon="save"></i>
      <span translate>Save & apply</span>
    </button>
  </c8y-action-bar-item>

  <c8y-data-grid
    class="content-fullpage d-flex d-col"
    [title]="'Translations' | translate"
    [columns]="columns"
    [actionControls]="actionControls"
    [pagination]="pagination"
    [displayOptions]="displayOptions"
    (onReload)="refresh()"
    [rows]="items"
  ></c8y-data-grid>
</ng-container>

<ng-template #loading>
  <c8y-loading></c8y-loading>
</ng-template>

results matching ""

    No results matching ""