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.widgetParams,
|
||||||
widget.dataLoaderParams,
|
widget.dataLoaderParams,
|
||||||
cfg,
|
cfg,
|
||||||
id,
|
|
||||||
widget.id,
|
|
||||||
);
|
);
|
||||||
if (loadRes.result) {
|
if (loadRes.result) {
|
||||||
counter++;
|
counter++;
|
||||||
|
|
@ -59,8 +57,6 @@ export class DashboardsDataService {
|
||||||
widget.widgetParams,
|
widget.widgetParams,
|
||||||
widget.dataLoaderParams,
|
widget.dataLoaderParams,
|
||||||
cfg,
|
cfg,
|
||||||
id,
|
|
||||||
widgetId,
|
|
||||||
);
|
);
|
||||||
if (loadRes.result) return loadRes.result;
|
if (loadRes.result) return loadRes.result;
|
||||||
throw createAppError('CANNOT_LOAD_DATA');
|
throw createAppError('CANNOT_LOAD_DATA');
|
||||||
|
|
@ -71,8 +67,6 @@ export class DashboardsDataService {
|
||||||
widgetParams: DashboardModel.WidgetParams,
|
widgetParams: DashboardModel.WidgetParams,
|
||||||
dataLoaderParams: DashboardModel.DataLoaderParams,
|
dataLoaderParams: DashboardModel.DataLoaderParams,
|
||||||
dashboardParams: DashboardModel.Data,
|
dashboardParams: DashboardModel.Data,
|
||||||
dashboardId: string,
|
|
||||||
widgetId: string,
|
|
||||||
): Promise<Result<any, AppError>> {
|
): Promise<Result<any, AppError>> {
|
||||||
const widgetResult = this.widgetsCollectionService.getWidgetByType(type);
|
const widgetResult = this.widgetsCollectionService.getWidgetByType(type);
|
||||||
if (widgetResult.error) return fail(createAppError(widgetResult.error));
|
if (widgetResult.error) return fail(createAppError(widgetResult.error));
|
||||||
|
|
@ -81,8 +75,6 @@ export class DashboardsDataService {
|
||||||
widgetParams,
|
widgetParams,
|
||||||
dataLoaderParams,
|
dataLoaderParams,
|
||||||
dashboardParams,
|
dashboardParams,
|
||||||
dashboardId,
|
|
||||||
widgetId,
|
|
||||||
);
|
);
|
||||||
return renderResult;
|
return renderResult;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,15 +14,8 @@ export class InteractiveWidget
|
||||||
widgetParams: any,
|
widgetParams: any,
|
||||||
dataLoaderParams: any,
|
dataLoaderParams: any,
|
||||||
dashboardParams: any,
|
dashboardParams: any,
|
||||||
dashboardId: string,
|
|
||||||
widgetId: string,
|
|
||||||
): Promise<Result<any, AppError>> {
|
): Promise<Result<any, AppError>> {
|
||||||
const data = await this.dataLoader.load(
|
const data = await this.dataLoader.load(dataLoaderParams, dashboardParams);
|
||||||
dataLoaderParams,
|
|
||||||
dashboardParams,
|
|
||||||
dashboardId,
|
|
||||||
widgetId,
|
|
||||||
);
|
|
||||||
return data.error ? fail(data.error) : success(data.result);
|
return data.error ? fail(data.error) : success(data.result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,5 @@ export interface WidgetDataLoaderInterface<DLP, DBP, R> {
|
||||||
load(
|
load(
|
||||||
dataLoaderParams: DLP,
|
dataLoaderParams: DLP,
|
||||||
dashboardParams: DBP,
|
dashboardParams: DBP,
|
||||||
dashboardId: string,
|
|
||||||
widgetId: string,
|
|
||||||
): Promise<Result<R, AppError>>;
|
): Promise<Result<R, AppError>>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,5 @@ export interface WidgetInterface<WP, DLP, DBP, DLR, R> {
|
||||||
widgetParams: WP,
|
widgetParams: WP,
|
||||||
dataLoaderParams: DLP,
|
dataLoaderParams: DLP,
|
||||||
dashboardParams: DBP,
|
dashboardParams: DBP,
|
||||||
dashboardId: string,
|
|
||||||
widgetId: string,
|
|
||||||
): Promise<Result<R, AppError>>;
|
): Promise<Result<R, AppError>>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,7 @@ export class DailyEccmV2ReportTaskRunnerService {
|
||||||
widget: Widget,
|
widget: Widget,
|
||||||
issues: RedmineTypes.Issue[],
|
issues: RedmineTypes.Issue[],
|
||||||
previousIssues?: RedmineTypes.Issue[],
|
previousIssues?: RedmineTypes.Issue[],
|
||||||
|
previousMetrics?: Record<string, any>,
|
||||||
): Promise<Record<string, any>> {
|
): Promise<Record<string, any>> {
|
||||||
this.logger.log(
|
this.logger.log(
|
||||||
`Analyzing issues metrics for dashboard ${dashboard.id}, widget ${widget.id}`,
|
`Analyzing issues metrics for dashboard ${dashboard.id}, widget ${widget.id}`,
|
||||||
|
|
@ -527,6 +528,7 @@ export class DailyEccmV2ReportTaskRunnerService {
|
||||||
});
|
});
|
||||||
const prevData = prevDataResponse.docs[0];
|
const prevData = prevDataResponse.docs[0];
|
||||||
const prevIssues = prevData ? prevData.reportIssues : [];
|
const prevIssues = prevData ? prevData.reportIssues : [];
|
||||||
|
const prevMetrics = prevData ? prevData.issuesMetrics : {};
|
||||||
if (prevData) {
|
if (prevData) {
|
||||||
prevData.latest = false;
|
prevData.latest = false;
|
||||||
await datasource.insert(prevData);
|
await datasource.insert(prevData);
|
||||||
|
|
@ -536,6 +538,7 @@ export class DailyEccmV2ReportTaskRunnerService {
|
||||||
widget,
|
widget,
|
||||||
issues,
|
issues,
|
||||||
prevIssues,
|
prevIssues,
|
||||||
|
prevMetrics,
|
||||||
);
|
);
|
||||||
const item: any = {
|
const item: any = {
|
||||||
_id: id,
|
_id: id,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue