Сквозная передача дополнительных аргументов dashboardId и widgetId
This commit is contained in:
parent
f3a8cded97
commit
4a2759a0e1
4 changed files with 20 additions and 1 deletions
|
|
@ -34,6 +34,8 @@ export class DashboardsDataService {
|
|||
widget.widgetParams,
|
||||
widget.dataLoaderParams,
|
||||
cfg,
|
||||
id,
|
||||
widget.id,
|
||||
);
|
||||
if (loadRes.result) {
|
||||
counter++;
|
||||
|
|
@ -57,6 +59,8 @@ export class DashboardsDataService {
|
|||
widget.widgetParams,
|
||||
widget.dataLoaderParams,
|
||||
cfg,
|
||||
id,
|
||||
widgetId,
|
||||
);
|
||||
if (loadRes.result) return loadRes.result;
|
||||
throw createAppError('CANNOT_LOAD_DATA');
|
||||
|
|
@ -67,6 +71,8 @@ export class DashboardsDataService {
|
|||
widgetParams: DashboardModel.WidgetParams,
|
||||
dataLoaderParams: DashboardModel.DataLoaderParams,
|
||||
dashboardParams: DashboardModel.Data,
|
||||
dashboardId: string,
|
||||
widgetId: string,
|
||||
): Promise<Result<any, AppError>> {
|
||||
const widgetResult = this.widgetsCollectionService.getWidgetByType(type);
|
||||
if (widgetResult.error) return fail(createAppError(widgetResult.error));
|
||||
|
|
@ -75,6 +81,8 @@ export class DashboardsDataService {
|
|||
widgetParams,
|
||||
dataLoaderParams,
|
||||
dashboardParams,
|
||||
dashboardId,
|
||||
widgetId,
|
||||
);
|
||||
return renderResult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,15 @@ export class InteractiveWidget
|
|||
widgetParams: any,
|
||||
dataLoaderParams: any,
|
||||
dashboardParams: any,
|
||||
dashboardId: string,
|
||||
widgetId: string,
|
||||
): Promise<Result<any, AppError>> {
|
||||
const data = await this.dataLoader.load(dataLoaderParams, dashboardParams);
|
||||
const data = await this.dataLoader.load(
|
||||
dataLoaderParams,
|
||||
dashboardParams,
|
||||
dashboardId,
|
||||
widgetId,
|
||||
);
|
||||
return data.error ? fail(data.error) : success(data.result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,5 +5,7 @@ export interface WidgetDataLoaderInterface<DLP, DBP, R> {
|
|||
load(
|
||||
dataLoaderParams: DLP,
|
||||
dashboardParams: DBP,
|
||||
dashboardId: string,
|
||||
widgetId: string,
|
||||
): Promise<Result<R, AppError>>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,7 @@ export interface WidgetInterface<WP, DLP, DBP, DLR, R> {
|
|||
widgetParams: WP,
|
||||
dataLoaderParams: DLP,
|
||||
dashboardParams: DBP,
|
||||
dashboardId: string,
|
||||
widgetId: string,
|
||||
): Promise<Result<R, AppError>>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue