translation-editor/lazy/translation-editor/translation-editor.component.ts
OnInit
selector | c8y-translation-editor |
standalone | true |
imports |
TitleComponent
DataGridModule
LoadingComponent
NgIf
C8yTranslatePipe
ActionBarItemComponent
IconDirective
C8yTranslateDirective
|
templateUrl | ./translation-editor.component.html |
Properties |
Methods |
|
constructor(translationStore: TranslationStoreService, modalService: BsModalService, alert: AlertService, appState: AppStateService, translate: TranslateService)
|
||||||||||||||||||
Parameters :
|
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
|
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>