Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
FLOW-958 worker updated
Browse files Browse the repository at this point in the history
  • Loading branch information
vikas-cldcvr committed Dec 13, 2023
1 parent 7c493f0 commit c50f7d0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class FDashboard extends FRoot {
/**
* css loaded from scss file
*/
// static styles = [unsafeCSS(globalStyle)];
//static styles: CSSResult[] = [unsafeCSS(globalStyle)];

/**
* @attribute comments baout title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,8 @@ function schedulePolling(wgt: FDashboardWidget) {

if (wgt.pollingConfig) {
widgetRegistry[wgt.id].timer = setInterval(() => {

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
user controlled input
.
void (async () => {
if (wgt.pollingConfig) {
// axios({
// method:'get',
// })
wgt.data = await wgt.pollingConfig.callback();
self.postMessage(wgt);
}
})();
wgt.data = +Math.random().toFixed(2);
self.postMessage(wgt);
}, wgt.pollingConfig.frequency); //frequency
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/flow-dashboard/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export type FDashboardWidgetCore<T> = {
placement: FDashboardWidgetGridPlacement;
data: T;
pollingConfig?: {
callback: () => Promise<T>;
frequency: number; //Frequency in milliseconds
};
};
Expand Down
5 changes: 1 addition & 4 deletions stories/flow-dashboard/f-dashboard.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ for (let index = 0; index < 20; index++) {
data: Math.random() * 100,
dataType: "count",
pollingConfig: {
callback: async () => {
return Math.random() * 100;
},
frequency: 3000
},
id: (Math.random() + 1).toString(36).substring(7),
Expand All @@ -31,7 +28,7 @@ for (let index = 0; index < 20; index++) {
});
}

const Template = (args: any) => {
const Template = () => {
const dashboardConfig: FDashboardConfig = {
widgets
};
Expand Down

0 comments on commit c50f7d0

Please sign in to comment.