UI: Refactoring and update translate
This commit is contained in:
parent
e8371389ad
commit
fb3628467e
@ -109,9 +109,9 @@
|
||||
</button>
|
||||
<button mat-icon-button [disabled]="isLoading$ | async"
|
||||
type="button"
|
||||
matTooltip="{{ 'filter.duplicate-filter-action' | translate }}"
|
||||
matTooltip="{{ 'dashboard.duplicate-state-action' | translate }}"
|
||||
matTooltipPosition="above"
|
||||
(click)="duplicateFilter($event, state)">
|
||||
(click)="duplicateState($event, state)">
|
||||
<mat-icon>content_copy</mat-icon>
|
||||
</button>
|
||||
<button [fxShow]="!state.root" mat-icon-button [disabled]="isLoading$ | async"
|
||||
|
||||
@ -245,15 +245,15 @@ export class ManageDashboardStatesDialogComponent
|
||||
this.onStatesUpdated();
|
||||
}
|
||||
|
||||
duplicateFilter($event: Event, state: DashboardStateInfo) {
|
||||
duplicateState($event: Event, state: DashboardStateInfo) {
|
||||
const originalState = state;
|
||||
const newFilterName = this.getNextDuplicatedName(state.name);
|
||||
if (newFilterName) {
|
||||
const newStateName = this.getNextDuplicatedName(state.name);
|
||||
if (newStateName) {
|
||||
const duplicatedStates = deepClone(originalState);
|
||||
const duplicatedWidgets = deepClone(this.widgets);
|
||||
const widgets = {};
|
||||
duplicatedStates.id = newFilterName.toLowerCase().replace(/\W/g, '_');
|
||||
duplicatedStates.name = newFilterName;
|
||||
duplicatedStates.id = newStateName.toLowerCase().replace(/\W/g, '_');
|
||||
duplicatedStates.name = newStateName;
|
||||
duplicatedStates.root = false;
|
||||
this.stateNames.add(duplicatedStates.name);
|
||||
|
||||
|
||||
@ -1188,7 +1188,8 @@
|
||||
"assign-dashboard-to-edge": "Assign Dashboard(s) To 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",
|
||||
"edit-mode": "Edit mode"
|
||||
"edit-mode": "Edit mode",
|
||||
"duplicate-state-action": "Duplicate state"
|
||||
},
|
||||
"datakey": {
|
||||
"settings": "Settings",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user