mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 09:38:48 +02:00
Align posted dashboard data to new data denormalized format
This commit is contained in:
@@ -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'];
|
||||
|
||||
@@ -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(),
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ class IboDashboard extends HTMLElement {
|
||||
id: this.sId,
|
||||
title: sDashboardTitle,
|
||||
refresh: sDashboardRefreshRate,
|
||||
dashlets_list: aSerializedGrid,
|
||||
pos_dashlets: aSerializedGrid,
|
||||
_token: ":)"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user