@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
93 lines (92 loc) • 3.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScheduleSettingsSummary = exports.getScheduleSettingsValues = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const Tag_1 = require("../../../../components/Tag");
const Enums_1 = require("../../../../AdaptableState/Common/Enums");
const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
const getScheduleSettingsValues = (data) => {
if (data.ScheduleType === Enums_1.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 === Enums_1.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 === Enums_1.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 === Enums_1.ScheduleType.OpenFin) {
const report = data;
return [
{
label: 'Report',
value: report?.OpenFinReport.ReportName || 'Not Specified',
},
];
}
return [];
};
exports.getScheduleSettingsValues = getScheduleSettingsValues;
const ScheduleSettingsSummary = () => {
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
return (React.createElement(React.Fragment, null, (0, exports.getScheduleSettingsValues)(data).map((description, index) => (React.createElement(OnePageAdaptableWizard_1.SummaryText, { key: index },
description.label,
": ",
React.createElement(Tag_1.Tag, null, description.value))))));
};
exports.ScheduleSettingsSummary = ScheduleSettingsSummary;