|
|
@ -35,7 +35,7 @@ import { fromEvent, merge } from 'rxjs'; |
|
|
import { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators'; |
|
|
import { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators'; |
|
|
import { TranslateService } from '@ngx-translate/core'; |
|
|
import { TranslateService } from '@ngx-translate/core'; |
|
|
import { DialogService } from '@core/services/dialog.service'; |
|
|
import { DialogService } from '@core/services/dialog.service'; |
|
|
import { deepClone } from '@core/utils'; |
|
|
import { deepClone, isUndefined } from '@core/utils'; |
|
|
import { |
|
|
import { |
|
|
DashboardStateDialogComponent, |
|
|
DashboardStateDialogComponent, |
|
|
DashboardStateDialogData |
|
|
DashboardStateDialogData |
|
|
@ -198,8 +198,9 @@ export class ManageDashboardStatesDialogComponent extends |
|
|
root: state.root, |
|
|
root: state.root, |
|
|
layouts: state.layouts |
|
|
layouts: state.layouts |
|
|
}; |
|
|
}; |
|
|
if (prevStateId) { |
|
|
if (prevStateId && prevStateId !== state.id) { |
|
|
this.states[prevStateId] = newState; |
|
|
delete this.states[prevStateId]; |
|
|
|
|
|
this.states[state.id] = newState; |
|
|
} else { |
|
|
} else { |
|
|
this.states[state.id] = newState; |
|
|
this.states[state.id] = newState; |
|
|
} |
|
|
} |
|
|
@ -210,6 +211,19 @@ export class ManageDashboardStatesDialogComponent extends |
|
|
otherState.root = false; |
|
|
otherState.root = false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
let rootFound = false; |
|
|
|
|
|
for (const id of Object.keys(this.states)) { |
|
|
|
|
|
const otherState = this.states[id]; |
|
|
|
|
|
if (otherState.root) { |
|
|
|
|
|
rootFound = true; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (!rootFound) { |
|
|
|
|
|
const firstStateId = Object.keys(this.states)[0]; |
|
|
|
|
|
this.states[firstStateId].root = true; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
this.onStatesUpdated(); |
|
|
this.onStatesUpdated(); |
|
|
} |
|
|
} |
|
|
|