Merge branch 'ent-7857-12238-No-se-visualiza-Odómetro-en-Dashboard' into 'develop'

Ent 7857 12238 no se visualiza odómetro en dashboard

See merge request artica/pandorafms!4342
This commit is contained in:
Daniel Rodriguez 2021-08-06 08:31:29 +00:00
commit cd500fe67b
5 changed files with 16 additions and 3 deletions

View File

@ -1144,6 +1144,11 @@ function dashboardLoadVC(settings) {
return item;
});
settings.items.map(function(item) {
item["cellId"] = settings.cellId;
return item;
});
createVisualConsole(
container,
settings.props,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -64,6 +64,7 @@ export interface ItemProps extends Position, Size {
aclGroupId: number | null;
cacheExpiration: number | null;
colorStatus: string;
cellId: number | null;
}
export interface ItemClickEvent {
@ -140,6 +141,7 @@ export function itemBasePropsDecoder(data: AnyObject): ItemProps | never {
aclGroupId: parseIntOr(data.aclGroupId, null),
cacheExpiration: parseIntOr(data.cacheExpiration, null),
colorStatus: notEmptyStringOr(data.colorStatus, "#CCC"),
cellId: parseIntOr(data.cellId, null),
...sizePropsDecoder(data), // Object spread. It will merge the properties of the two objects.
...positionPropsDecoder(data) // Object spread. It will merge the properties of the two objects.
};

View File

@ -115,6 +115,12 @@ export default class Odometer extends Item<OdometerProps> {
"visual-console-container"
) as HTMLElement;
if (backgroundColor === null) {
backgroundColor = document.getElementById(
`visual-console-container-${this.props.cellId}`
) as HTMLElement;
}
if (backgroundColor.style.backgroundColor == "") {
backgroundColor.style.backgroundColor = "#fff";
}