UI: Refactoring and update translate

This commit is contained in:
Artem Dzhereleiko 2023-11-30 12:28:29 +02:00
parent e8371389ad
commit fb3628467e
3 changed files with 9 additions and 8 deletions

View File

@ -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"

View File

@ -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);

View File

@ -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",