UI: Refactoring and update translate
This commit is contained in:
parent
e8371389ad
commit
fb3628467e
@ -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"
|
||||||
|
|||||||
@ -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);
|
||||||
|
|
||||||
|
|||||||
@ -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…
x
Reference in New Issue
Block a user