Browse Source

fixes after review

pull/6374/head
Dmitriymush 4 years ago
parent
commit
97657284a8
  1. 8
      ui-ngx/src/app/core/services/dashboard-utils.service.ts
  2. 3
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts
  3. 2
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts
  4. 3
      ui-ngx/src/app/shared/models/dashboard.models.ts

8
ui-ngx/src/app/core/services/dashboard-utils.service.ts

@ -287,10 +287,14 @@ export class DashboardUtilsService {
let addedCount = 0; let addedCount = 0;
let removedCount = 0; let removedCount = 0;
for (const l of Object.keys(state.layouts)) { for (const l of Object.keys(state.layouts)) {
removedCount++; if (!newLayouts[l]) {
removedCount++;
}
} }
for (const l of Object.keys(newLayouts)) { for (const l of Object.keys(newLayouts)) {
addedCount++; if (!state.layouts[l]) {
addedCount++;
}
} }
state.layouts = newLayouts; state.layouts = newLayouts;
const layoutsCount = Object.keys(state.layouts).length; const layoutsCount = Object.keys(state.layouts).length;

3
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts

@ -43,7 +43,8 @@ import {
DashboardLayoutsInfo, DashboardLayoutsInfo,
DashboardState, DashboardState,
DashboardStateLayouts, DashboardStateLayouts,
GridSettings, LayoutDimension, GridSettings,
LayoutDimension,
WidgetLayout WidgetLayout
} from '@app/shared/models/dashboard.models'; } from '@app/shared/models/dashboard.models';
import { WINDOW } from '@core/services/window.service'; import { WINDOW } from '@core/services/window.service';

2
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts

@ -73,7 +73,7 @@ export interface DashboardPageLayout {
layoutCtx: DashboardPageLayoutContext; layoutCtx: DashboardPageLayoutContext;
} }
export declare type DashboardPageLayouts = {[key in DashboardLayoutId ]: DashboardPageLayout }; export declare type DashboardPageLayouts = {[key in DashboardLayoutId]: DashboardPageLayout};
export class LayoutWidgetsArray implements Iterable<Widget> { export class LayoutWidgetsArray implements Iterable<Widget> {

3
ui-ngx/src/app/shared/models/dashboard.models.ts

@ -81,8 +81,7 @@ export declare type DashboardLayoutId = 'main' | 'right';
export declare type LayoutType = 'percentage' | 'fixed'; export declare type LayoutType = 'percentage' | 'fixed';
// export declare type DashboardStateLayouts = {[key in DashboardLayoutId | 'layoutDimension']?: DashboardLayout & LayoutDimension }; export declare type DashboardStateLayouts = {[key in DashboardLayoutId]?: DashboardLayout};
export declare type DashboardStateLayouts = {[key in DashboardLayoutId]?: DashboardLayout };
export declare type DashboardLayoutsInfo = {[key in DashboardLayoutId]?: DashboardLayoutInfo}; export declare type DashboardLayoutsInfo = {[key in DashboardLayoutId]?: DashboardLayoutInfo};

Loading…
Cancel
Save