@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
87 lines (86 loc) • 2.95 kB
JavaScript
import * as React from 'react';
import { Tag } from '../../../../components/Tag';
import { ScheduleType } from '../../../../AdaptableState/Common/Enums';
import { SummaryText, useOnePageAdaptableWizardContext, } from '../../../Wizard/OnePageAdaptableWizard';
export const getScheduleSettingsValues = (data) => {
if (data.ScheduleType === ScheduleType.Reminder) {
const reminder = data;
return [
{
label: 'Header',
value: reminder?.Header || 'Not Specified',
},
{
label: 'Message',
value: reminder?.Message || 'Not Specified',
},
{
label: 'Message Type',
value: reminder?.MessageType || 'Not Specified',
},
{
label: 'Display Toast Notification',
value: reminder?.DisplayNotification ? 'True' : 'False',
},
{
label: 'Show System Status Message',
value: reminder?.DisplaySystemStatusMessage ? 'True' : 'False',
},
];
}
if (data.ScheduleType === ScheduleType.Report) {
const report = data;
return [
{
label: 'Report Name',
value: report?.ReportName || 'Not Specified',
},
{
label: 'Report Format',
value: report?.ReportFormat || 'Not Specified',
},
{
label: 'Export Destination',
value: report?.ExportDestination || 'Download',
},
];
}
if (data.ScheduleType === ScheduleType.ipushpull) {
const report = data;
return [
{
label: 'Report',
value: report?.IPushPullReport.ReportName || 'Not Specified',
},
{
label: 'Folder',
value: report?.IPushPullReport.Folder || 'Not Specified',
},
{
label: 'Page',
value: report?.IPushPullReport.Page || 'Not Specified',
},
{
label: 'Export As',
value: report?.Transmission || 'Not Specified',
},
];
}
if (data.ScheduleType === ScheduleType.OpenFin) {
const report = data;
return [
{
label: 'Report',
value: report?.OpenFinReport.ReportName || 'Not Specified',
},
];
}
return [];
};
export const ScheduleSettingsSummary = () => {
const { data } = useOnePageAdaptableWizardContext();
return (React.createElement(React.Fragment, null, getScheduleSettingsValues(data).map((description, index) => (React.createElement(SummaryText, { key: index },
description.label,
": ",
React.createElement(Tag, null, description.value))))));
};