Skip to content

Commit e054784

Browse files
committed
fix: previous update changed some package versions
1 parent ce9ad41 commit e054784

File tree

5 files changed

+112
-109
lines changed

5 files changed

+112
-109
lines changed

apps/back-office/src/app/dashboard/pages/dashboard/dashboard.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ <h1 class="!m-0 overflow-hidden text-ellipsis">
208208
<!-- Widgets -->
209209
<safe-widget-grid
210210
[loading]="loading"
211-
[widgets]="tiles"
211+
[widgets]="widgets"
212212
[canUpdate]="dashboard?.canUpdate || false"
213213
(move)="onMove($event)"
214214
(edit)="onEditTile($event)"

apps/back-office/src/app/dashboard/pages/dashboard/dashboard.component.ts

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -67,38 +67,53 @@ export class DashboardComponent
6767
extends SafeUnsubscribeComponent
6868
implements OnInit, OnDestroy
6969
{
70+
/** Change step event ( in workflow ) */
71+
@Output() changeStep: EventEmitter<number> = new EventEmitter();
72+
/** Widget grid reference */
73+
@ViewChild(SafeWidgetGridComponent)
74+
widgetGridComponent!: SafeWidgetGridComponent;
75+
/** Is dashboard in fullscreen mode */
7076
public isFullScreen = false;
71-
// === DATA ===
77+
/** Dashboard id */
7278
public id = '';
79+
/** Application id */
7380
public applicationId?: string;
81+
/** Is dashboard loading */
7482
public loading = true;
75-
public tiles: any[] = [];
83+
/** List of widgets */
84+
public widgets: any[] = [];
85+
/** Current dashboard */
7686
public dashboard?: Dashboard;
87+
/** Show dashboard filter */
7788
public showFilter!: boolean;
78-
79-
// === GRID ===
80-
private generatedTiles = 0;
81-
82-
// === DASHBOARD NAME EDITION ===
89+
/** User can update dashboard */
8390
public canUpdate = false;
91+
/** Dashboard name edition is active */
8492
public formActive = false;
85-
86-
// === STEP CHANGE FOR WORKFLOW ===
87-
@Output() changeStep: EventEmitter<number> = new EventEmitter();
88-
89-
// === DUP APP SELECTION ===
93+
/** Show application menu */
9094
public showAppMenu = false;
95+
/** List of available applications */
9196
public applications: Application[] = [];
92-
93-
@ViewChild(SafeWidgetGridComponent)
94-
widgetGridComponent!: SafeWidgetGridComponent;
95-
96-
// === CONTEXT ===
97+
/** Contextual reference data elements */
9798
public refDataElements: any[] = [];
99+
/** Contextual records query */
98100
public recordsQuery!: QueryRef<GetResourceRecordsQueryResponse>;
101+
/** Contextual template id */
99102
public contextId = new FormControl<string | number | null>(null);
103+
/** Field of contextual reference data */
100104
public refDataValueField = '';
105+
/** Contextual record */
101106
public contextRecord: Record | null = null;
107+
/** Configured dashboard quick actions */
108+
public buttonActions: ButtonActionT[] = [];
109+
110+
/** @returns get newest widget id from existing ids */
111+
get newestId(): number {
112+
const widgets = this.widgets?.slice() || [];
113+
return widgets.length === 0
114+
? 0
115+
: Math.max(...widgets.map((x: any) => x.id)) + 1;
116+
}
102117

103118
/** @returns type of context element */
104119
get contextType() {
@@ -109,10 +124,6 @@ export class DashboardComponent
109124
}
110125
}
111126

112-
// === BUTTON ACTIONS ===
113-
public buttonActions: ButtonActionT[] = [];
114-
115-
// === ROUTE ===
116127
/** @returns is dashboard a step or a page */
117128
get isStep(): boolean {
118129
return this.router.url.includes('/workflow/');
@@ -136,7 +147,6 @@ export class DashboardComponent
136147
* @param refDataService Shared reference data service
137148
* @param renderer Angular renderer
138149
* @param elementRef Angular element ref
139-
* @param translate Translate service
140150
* @param layoutService Shared layout service
141151
*/
142152
constructor(
@@ -155,7 +165,6 @@ export class DashboardComponent
155165
private refDataService: SafeReferenceDataService,
156166
private renderer: Renderer2,
157167
private elementRef: ElementRef,
158-
private translate: TranslateService,
159168
private layoutService: SafeLayoutService
160169
) {
161170
super();
@@ -308,13 +317,9 @@ export class DashboardComponent
308317
: this.dashboard?.step?.canUpdate) || false;
309318

310319
this.dashboardService.openDashboard(this.dashboard);
311-
this.tiles = this.dashboard.structure
320+
this.widgets = this.dashboard.structure
312321
? [...this.dashboard.structure.filter((x: any) => x !== null)]
313322
: [];
314-
this.generatedTiles =
315-
this.tiles.length === 0
316-
? 0
317-
: Math.max(...this.tiles.map((x) => x && x?.id)) + 1;
318323
this.applicationId = this.dashboard.page
319324
? this.dashboard.page.application?.id
320325
: this.dashboard.step
@@ -391,14 +396,13 @@ export class DashboardComponent
391396
* @param e add event
392397
*/
393398
onAdd(e: any): void {
394-
const tile = JSON.parse(JSON.stringify(e));
395-
tile.id = this.generatedTiles;
396-
this.generatedTiles += 1;
397-
this.tiles = [...this.tiles, tile];
399+
const widget = JSON.parse(JSON.stringify(e));
400+
widget.id = this.newestId;
401+
this.widgets = [...this.widgets, widget];
398402
this.autoSaveChanges();
399403
// scroll to the element once it is created
400404
setTimeout(() => {
401-
const el = document.getElementById(`widget-${tile.id}`);
405+
const el = document.getElementById(`widget-${widget.id}`);
402406
el?.scrollIntoView({ behavior: 'smooth' });
403407
});
404408
}
@@ -410,17 +414,17 @@ export class DashboardComponent
410414
*/
411415
onEditTile(e: any): void {
412416
// make sure that we save the default layout.
413-
const index = this.tiles.findIndex((v: any) => v.id === e.id);
414-
const options = this.tiles[index]?.settings?.defaultLayout
417+
const index = this.widgets.findIndex((v: any) => v.id === e.id);
418+
const options = this.widgets[index]?.settings?.defaultLayout
415419
? {
416420
...e.options,
417-
defaultLayout: this.tiles[index].settings.defaultLayout,
421+
defaultLayout: this.widgets[index].settings.defaultLayout,
418422
}
419423
: e.options;
420424
if (options) {
421425
switch (e.type) {
422426
case 'display': {
423-
this.tiles = this.tiles.map((x) => {
427+
this.widgets = this.widgets.map((x) => {
424428
if (x.id === e.id) {
425429
x.defaultCols = options.cols;
426430
x.defaultRows = options.rows;
@@ -431,7 +435,7 @@ export class DashboardComponent
431435
break;
432436
}
433437
case 'data': {
434-
this.tiles = this.tiles.map((x) => {
438+
this.widgets = this.widgets.map((x) => {
435439
if (x.id === e.id) {
436440
x = { ...x, settings: options };
437441
}
@@ -453,7 +457,7 @@ export class DashboardComponent
453457
* @param e delete event
454458
*/
455459
onDeleteTile(e: any): void {
456-
this.tiles = this.tiles.filter((x) => x.id !== e.id);
460+
this.widgets = this.widgets.filter((x) => x.id !== e.id);
457461
this.autoSaveChanges();
458462
}
459463

@@ -480,10 +484,10 @@ export class DashboardComponent
480484
*/
481485
onMove(e: any): void {
482486
// Duplicates array, some times the arrays is write protected
483-
this.tiles = this.tiles.slice();
484-
[this.tiles[e.oldIndex], this.tiles[e.newIndex]] = [
485-
this.tiles[e.newIndex],
486-
this.tiles[e.oldIndex],
487+
this.widgets = this.widgets.slice();
488+
[this.widgets[e.oldIndex], this.widgets[e.newIndex]] = [
489+
this.widgets[e.newIndex],
490+
this.widgets[e.oldIndex],
487491
];
488492
this.autoSaveChanges();
489493
}
@@ -495,7 +499,7 @@ export class DashboardComponent
495499
mutation: EDIT_DASHBOARD,
496500
variables: {
497501
id: this.id,
498-
structure: this.tiles,
502+
structure: this.widgets,
499503
},
500504
})
501505
.subscribe({
@@ -523,7 +527,7 @@ export class DashboardComponent
523527
);
524528
this.dashboardService.openDashboard({
525529
...this.dashboard,
526-
structure: this.tiles,
530+
structure: this.widgets,
527531
});
528532
}
529533
},

libs/safe/src/lib/components/ui/core-grid/grid/grid.constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export const PAGER_SETTINGS: PagerSettings = {
1919
info: true,
2020
pageSizes: [10, 25, 50, 100],
2121
previousNext: true,
22-
responsive: true,
2322
};
2423

2524
/** Settings for selection */

package-lock.json

Lines changed: 39 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,35 @@
3434
"@ngx-translate/core": "^14.0.0",
3535
"@ngx-translate/http-loader": "^7.0.0",
3636
"@nrwl/angular": "15.7.2",
37-
"@progress/kendo-angular-buttons": "^11.2.0",
38-
"@progress/kendo-angular-common": "^11.2.0",
39-
"@progress/kendo-angular-dateinputs": "^11.2.0",
40-
"@progress/kendo-angular-dialog": "^11.2.0",
41-
"@progress/kendo-angular-dropdowns": "^11.2.0",
42-
"@progress/kendo-angular-excel-export": "^11.2.0",
43-
"@progress/kendo-angular-grid": "^11.2.0",
44-
"@progress/kendo-angular-icons": "^11.2.0",
45-
"@progress/kendo-angular-indicators": "^11.2.0",
46-
"@progress/kendo-angular-inputs": "^11.2.0",
47-
"@progress/kendo-angular-intl": "^11.2.0",
48-
"@progress/kendo-angular-l10n": "^11.2.0",
49-
"@progress/kendo-angular-label": "^11.2.0",
37+
"@progress/kendo-angular-buttons": "11",
38+
"@progress/kendo-angular-common": "11",
39+
"@progress/kendo-angular-dateinputs": "11",
40+
"@progress/kendo-angular-dialog": "11",
41+
"@progress/kendo-angular-dropdowns": "11",
42+
"@progress/kendo-angular-excel-export": "11",
43+
"@progress/kendo-angular-grid": "11",
44+
"@progress/kendo-angular-icons": "11",
45+
"@progress/kendo-angular-indicators": "11",
46+
"@progress/kendo-angular-inputs": "11",
47+
"@progress/kendo-angular-intl": "11",
48+
"@progress/kendo-angular-l10n": "11",
49+
"@progress/kendo-angular-label": "11",
5050
"@progress/kendo-angular-layout": "11",
51-
"@progress/kendo-angular-listbox": "^11.2.0",
52-
"@progress/kendo-angular-listview": "^11.2.0",
53-
"@progress/kendo-angular-pdf-export": "^11.2.0",
54-
"@progress/kendo-angular-popup": "^11.2.0",
55-
"@progress/kendo-angular-progressbar": "^11.2.0",
56-
"@progress/kendo-angular-scheduler": "^11.2.0",
57-
"@progress/kendo-angular-toolbar": "^11.2.0",
58-
"@progress/kendo-angular-treeview": "^11.2.0",
59-
"@progress/kendo-angular-upload": "^11.2.0",
51+
"@progress/kendo-angular-listbox": "11",
52+
"@progress/kendo-angular-listview": "11",
53+
"@progress/kendo-angular-pdf-export": "11",
54+
"@progress/kendo-angular-popup": "11",
55+
"@progress/kendo-angular-progressbar": "11",
56+
"@progress/kendo-angular-scheduler": "11",
57+
"@progress/kendo-angular-toolbar": "11",
58+
"@progress/kendo-angular-treeview": "11",
59+
"@progress/kendo-angular-upload": "11",
6060
"@progress/kendo-data-query": "^1.6.0",
6161
"@progress/kendo-date-math": "^1.5.10",
6262
"@progress/kendo-drawing": "^1.17.3",
6363
"@progress/kendo-licensing": "^1.3.0",
6464
"@progress/kendo-recurrence": "^1.0.3",
65-
"@progress/kendo-theme-default": "^6.0.3",
65+
"@progress/kendo-theme-default": "6.6.0",
6666
"@sentry/angular-ivy": "^7.60.0",
6767
"@storybook/addon-console": "^1.2.3",
6868
"@tinymce/tinymce-angular": "^7.0.0",

0 commit comments

Comments
 (0)