Compare commits
No commits in common. "04a0736c9a5ae000e21c6f4ef804586a8cd7eccc" and "f3a8cded97bfaa083c68837a73a1063c1a3305c2" have entirely different histories.
04a0736c9a
...
f3a8cded97
5 changed files with 4 additions and 20 deletions
|
|
@ -34,8 +34,6 @@ export class DashboardsDataService {
|
|||
widget.widgetParams,
|
||||
widget.dataLoaderParams,
|
||||
cfg,
|
||||
id,
|
||||
widget.id,
|
||||
);
|
||||
if (loadRes.result) {
|
||||
counter++;
|
||||
|
|
@ -59,8 +57,6 @@ export class DashboardsDataService {
|
|||
widget.widgetParams,
|
||||
widget.dataLoaderParams,
|
||||
cfg,
|
||||
id,
|
||||
widgetId,
|
||||
);
|
||||
if (loadRes.result) return loadRes.result;
|
||||
throw createAppError('CANNOT_LOAD_DATA');
|
||||
|
|
@ -71,8 +67,6 @@ 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));
|
||||
|
|
@ -81,8 +75,6 @@ export class DashboardsDataService {
|
|||
widgetParams,
|
||||
dataLoaderParams,
|
||||
dashboardParams,
|
||||
dashboardId,
|
||||
widgetId,
|
||||
);
|
||||
return renderResult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,15 +14,8 @@ 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,
|
||||
dashboardId,
|
||||
widgetId,
|
||||
);
|
||||
const data = await this.dataLoader.load(dataLoaderParams, dashboardParams);
|
||||
return data.error ? fail(data.error) : success(data.result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,5 @@ export interface WidgetDataLoaderInterface<DLP, DBP, R> {
|
|||
load(
|
||||
dataLoaderParams: DLP,
|
||||
dashboardParams: DBP,
|
||||
dashboardId: string,
|
||||
widgetId: string,
|
||||
): Promise<Result<R, AppError>>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,5 @@ export interface WidgetInterface<WP, DLP, DBP, DLR, R> {
|
|||
widgetParams: WP,
|
||||
dataLoaderParams: DLP,
|
||||
dashboardParams: DBP,
|
||||
dashboardId: string,
|
||||
widgetId: string,
|
||||
): Promise<Result<R, AppError>>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ export class DailyEccmV2ReportTaskRunnerService {
|
|||
widget: Widget,
|
||||
issues: RedmineTypes.Issue[],
|
||||
previousIssues?: RedmineTypes.Issue[],
|
||||
previousMetrics?: Record<string, any>,
|
||||
): Promise<Record<string, any>> {
|
||||
this.logger.log(
|
||||
`Analyzing issues metrics for dashboard ${dashboard.id}, widget ${widget.id}`,
|
||||
|
|
@ -527,6 +528,7 @@ export class DailyEccmV2ReportTaskRunnerService {
|
|||
});
|
||||
const prevData = prevDataResponse.docs[0];
|
||||
const prevIssues = prevData ? prevData.reportIssues : [];
|
||||
const prevMetrics = prevData ? prevData.issuesMetrics : {};
|
||||
if (prevData) {
|
||||
prevData.latest = false;
|
||||
await datasource.insert(prevData);
|
||||
|
|
@ -536,6 +538,7 @@ export class DailyEccmV2ReportTaskRunnerService {
|
|||
widget,
|
||||
issues,
|
||||
prevIssues,
|
||||
prevMetrics,
|
||||
);
|
||||
const item: any = {
|
||||
_id: id,
|
||||
|
|
|
|||
Loading…
Reference in a new issue