Skip to content

Commit

Permalink
fix(widget-load): apply new widget load params
Browse files Browse the repository at this point in the history
Signed-off-by: samuel.park <[email protected]>
  • Loading branch information
piggggggggy committed Dec 17, 2024
1 parent 8933ff8 commit a5a2531
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import type { Sort } from '@cloudforet/core-lib/space-connector/type';

import type { Page } from '@/schema/_common/type';
import type { DashboardVars } from '@/schema/dashboard/_types/dashboard-type';

export interface PrivateWidgetLoadParameters {
widget_id: string;
query?: Record<string, any>;
granularity: string;
start: string;
end: string;
sort?: Sort[];
page?: Page
vars?: DashboardVars;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import type { Sort } from '@cloudforet/core-lib/space-connector/type';

import type { Page } from '@/schema/_common/type';
import type { DashboardVars } from '@/schema/dashboard/_types/dashboard-type';

export interface PublicWidgetLoadParameters {
widget_id: string;
query: Record<string, any>;
granularity: string;
start: string;
end: string;
sort?: Sort[];
page?: Page
vars?: DashboardVars;
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import WorkspaceVariableModel from '@/lib/variable-models/managed-model/resource
import ErrorHandler from '@/common/composables/error/errorHandler';

import { MANAGED_DASHBOARD_VARIABLES_SCHEMA } from '@/services/dashboards/constants/dashboard-managed-variables-schema';
import { migrateLegacyWidgetOptions } from '@/services/dashboards/helpers/widget-migration-helper';



Expand Down Expand Up @@ -361,7 +360,8 @@ export const useDashboardDetailInfoStore = defineStore('dashboard-detail-info',
const res = await fetcher<PublicWidgetListParameters|PrivateWidgetListParameters, ListResponse<WidgetModel>>({
dashboard_id: state.dashboardId,
});
state.dashboardWidgets = migrateLegacyWidgetOptions(res.results || []);
// state.dashboardWidgets = migrateLegacyWidgetOptions(res.results || []);
state.dashboardWidgets = res.results || [];
return;
} catch (e) {
ErrorHandler.handleError(e);
Expand Down

0 comments on commit a5a2531

Please sign in to comment.