Skip to content

Commit

Permalink
fix: schedule list is missing Dashboard/Widget name
Browse files Browse the repository at this point in the history
Schedule on List schedule dialog is missing Dashboard/Widget name

risk: low
JIRA: F1-930
  • Loading branch information
hackerstanislav committed Nov 19, 2024
1 parent e3c6b47 commit b8ce7d8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const convertInlineExportDefinitionMdObject = (
id,
uri: id,
ref: idRef(id, "exportDefinition"),
title: "",
title: (exportDefinitionOut.requestPayload.metadata as any).title ?? "",
description: "",
tags: [],
requestPayload: request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,14 @@ export function convertAutomation(

const tabularExports = exportDefinitions
?.filter((ed) => isExportDefinitionVisualizationObjectRequestPayload(ed.requestPayload))
.map((ed) => ({ requestPayload: convertExportDefinitionRequestPayload(ed.requestPayload) }));
.map((ed) => ({
requestPayload: convertExportDefinitionRequestPayload(ed.requestPayload, ed.title),
}));
const visualExports = exportDefinitions
?.filter((ed) => isExportDefinitionDashboardRequestPayload(ed.requestPayload))
.map((ed) => ({ requestPayload: convertExportDefinitionRequestPayload(ed.requestPayload) }));
.map((ed) => ({
requestPayload: convertExportDefinitionRequestPayload(ed.requestPayload, ed.title),
}));

const attributes = omitBy(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,29 @@ export const convertExportDefinitionMdObjectDefinition = (
title,
description,
tags,
requestPayload: convertExportDefinitionRequestPayload(requestPayload),
requestPayload: convertExportDefinitionRequestPayload(requestPayload, title),
},
},
};
};

export const convertExportDefinitionRequestPayload = (
exportRequest: IExportDefinitionRequestPayload,
title?: string,
): TabularExportRequest | VisualExportRequest => {
if (isExportDefinitionDashboardRequestPayload(exportRequest)) {
const { filters, dashboard } = exportRequest.content;
const metadataObj = exportRequest.content.filters ? { metadata: { filters } } : {};
const isMetadataFilled = title || exportRequest.content.filters;
const metadataObj = {
...(isMetadataFilled
? {
metadata: {
...(exportRequest.content.filters ? { filters } : {}),
...(title ? { title } : {}),
},
}
: {}),
};

return {
fileName: exportRequest.fileName,
Expand All @@ -63,6 +74,7 @@ export const convertExportDefinitionRequestPayload = (
},
metadata: {
widget,
...(title ? { title } : {}),
},
} as TabularExportRequest;
};
Expand Down

0 comments on commit b8ce7d8

Please sign in to comment.