Align posted dashboard data to new data denormalized format

This commit is contained in:
Stephen Abello
2026-01-14 11:15:15 +01:00
parent 410dc152d7
commit d248524cc8
4 changed files with 11 additions and 5 deletions

View File

@@ -51,7 +51,10 @@ class IboGridSlot extends HTMLElement {
const aDashletData = oDashlet ? oDashlet.Serialize() : {};
return {...aSlotData, ...aDashletData};
return {
...aSlotData,
dashlet: {...aDashletData}
};
}
static observedAttributes = ['gs-x', 'gs-y', 'gs-w', 'gs-h'];

View File

@@ -146,7 +146,10 @@ class IboGrid extends HTMLElement {
Serialize() {
const aSlots = this.getSlots();
return aSlots.map(oSlot => {
return oSlot.Serialize();
const sDashletId = oSlot.oDashlet.sDashletId;
return {
[sDashletId]: oSlot.Serialize(),
};
});
}
}

View File

@@ -255,7 +255,7 @@ class IboDashboard extends HTMLElement {
id: this.sId,
title: sDashboardTitle,
refresh: sDashboardRefreshRate,
dashlets_list: aSerializedGrid,
pos_dashlets: aSerializedGrid,
_token: ":)"
};
}

View File

@@ -53,8 +53,8 @@ class IboDashlet extends HTMLElement {
// TODO 3.3 Should we use getters ?
const aDashletData = {
id: this.sDashletId,
class: this.sType,
dashlet: JSON.parse(this.formData),
type: this.sType,
properties: JSON.parse(this.formData),
};
return aDashletData;