Browse Source

UI: Refactoring and update translate

pull/9735/head
Artem Dzhereleiko 3 years ago
parent
commit
fb3628467e
  1. 4
      ui-ngx/src/app/modules/home/components/dashboard-page/states/manage-dashboard-states-dialog.component.html
  2. 10
      ui-ngx/src/app/modules/home/components/dashboard-page/states/manage-dashboard-states-dialog.component.ts
  3. 3
      ui-ngx/src/assets/locale/locale.constant-en_US.json

4
ui-ngx/src/app/modules/home/components/dashboard-page/states/manage-dashboard-states-dialog.component.html

@ -109,9 +109,9 @@
</button> </button>
<button mat-icon-button [disabled]="isLoading$ | async" <button mat-icon-button [disabled]="isLoading$ | async"
type="button" type="button"
matTooltip="{{ 'filter.duplicate-filter-action' | translate }}" matTooltip="{{ 'dashboard.duplicate-state-action' | translate }}"
matTooltipPosition="above" matTooltipPosition="above"
(click)="duplicateFilter($event, state)"> (click)="duplicateState($event, state)">
<mat-icon>content_copy</mat-icon> <mat-icon>content_copy</mat-icon>
</button> </button>
<button [fxShow]="!state.root" mat-icon-button [disabled]="isLoading$ | async" <button [fxShow]="!state.root" mat-icon-button [disabled]="isLoading$ | async"

10
ui-ngx/src/app/modules/home/components/dashboard-page/states/manage-dashboard-states-dialog.component.ts

@ -245,15 +245,15 @@ export class ManageDashboardStatesDialogComponent
this.onStatesUpdated(); this.onStatesUpdated();
} }
duplicateFilter($event: Event, state: DashboardStateInfo) { duplicateState($event: Event, state: DashboardStateInfo) {
const originalState = state; const originalState = state;
const newFilterName = this.getNextDuplicatedName(state.name); const newStateName = this.getNextDuplicatedName(state.name);
if (newFilterName) { if (newStateName) {
const duplicatedStates = deepClone(originalState); const duplicatedStates = deepClone(originalState);
const duplicatedWidgets = deepClone(this.widgets); const duplicatedWidgets = deepClone(this.widgets);
const widgets = {}; const widgets = {};
duplicatedStates.id = newFilterName.toLowerCase().replace(/\W/g, '_'); duplicatedStates.id = newStateName.toLowerCase().replace(/\W/g, '_');
duplicatedStates.name = newFilterName; duplicatedStates.name = newStateName;
duplicatedStates.root = false; duplicatedStates.root = false;
this.stateNames.add(duplicatedStates.name); this.stateNames.add(duplicatedStates.name);

3
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -1188,7 +1188,8 @@
"assign-dashboard-to-edge": "Assign Dashboard(s) To Edge", "assign-dashboard-to-edge": "Assign Dashboard(s) To Edge",
"assign-dashboard-to-edge-text": "Please select the dashboards to assign to the edge", "assign-dashboard-to-edge-text": "Please select the dashboards to assign to the edge",
"non-existent-dashboard-state-error": "Dashboard state with id \"{{ stateId }}\" is not found", "non-existent-dashboard-state-error": "Dashboard state with id \"{{ stateId }}\" is not found",
"edit-mode": "Edit mode" "edit-mode": "Edit mode",
"duplicate-state-action": "Duplicate state"
}, },
"datakey": { "datakey": {
"settings": "Settings", "settings": "Settings",

Loading…
Cancel
Save