@reltio/components 1.4.2281 → 1.4.2282
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ExportDialog/ExportDialog.d.ts +1 -1
- package/ExportDialog/ExportDialog.js +8 -3
- package/ExportDialog/ExportDialog.module.css.js +2 -2
- package/ExportDialog/ExportDialog.test.js +51 -3
- package/cjs/ExportDialog/ExportDialog.d.ts +1 -1
- package/cjs/ExportDialog/ExportDialog.js +8 -3
- package/cjs/ExportDialog/ExportDialog.module.css.js +2 -2
- package/cjs/ExportDialog/ExportDialog.test.js +51 -3
- package/cjs/hooks/useExportController/useExportController.d.ts +1 -1
- package/cjs/hooks/useInternalExport/useInternalExport.d.ts +2 -0
- package/cjs/hooks/useInternalExport/useInternalExport.js +12 -2
- package/hooks/useExportController/useExportController.d.ts +1 -1
- package/hooks/useInternalExport/useInternalExport.d.ts +2 -0
- package/hooks/useInternalExport/useInternalExport.js +12 -2
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@ type Props = {
|
|
|
8
8
|
filter?: string;
|
|
9
9
|
activityFilter: ActivityFilter;
|
|
10
10
|
isSearchByOv: boolean;
|
|
11
|
-
onExternalExport: () => void;
|
|
11
|
+
onExternalExport: (exportOvOnly?: boolean) => void;
|
|
12
12
|
onLoadingChange?: (loading: boolean) => void;
|
|
13
13
|
};
|
|
14
14
|
export declare const ExportDialog: ({ open, onClose, columnsByEntityType, profilesCount, onExternalExport, onLoadingChange, filter, activityFilter, isSearchByOv }: Props) => React.JSX.Element;
|
|
@@ -43,6 +43,8 @@ import Button from '@mui/material/Button';
|
|
|
43
43
|
import DialogContent from '@mui/material/DialogContent';
|
|
44
44
|
import Typography from '@mui/material/Typography';
|
|
45
45
|
import TextField from '@mui/material/TextField';
|
|
46
|
+
import Checkbox from '@mui/material/Checkbox';
|
|
47
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
46
48
|
import { DropDownSelector } from '../DropDownSelector';
|
|
47
49
|
import { useInternalExport } from '../hooks/useInternalExport';
|
|
48
50
|
import { SnackbarContext } from '../contexts/SnackbarContext';
|
|
@@ -61,7 +63,7 @@ export var ExportDialog = function (_a) {
|
|
|
61
63
|
filter: filter,
|
|
62
64
|
activityFilter: activityFilter,
|
|
63
65
|
isSearchByOv: isSearchByOv
|
|
64
|
-
}), exportName = _c.exportName, onChangeExportName = _c.onChangeExportName, fileFormat = _c.fileFormat, onChangeFileFormat = _c.onChangeFileFormat, formatOptions = _c.formatOptions, onExport = _c.onExport, entityTypesDetails = _c.entityTypesDetails;
|
|
66
|
+
}), exportName = _c.exportName, onChangeExportName = _c.onChangeExportName, fileFormat = _c.fileFormat, onChangeFileFormat = _c.onChangeFileFormat, formatOptions = _c.formatOptions, onExport = _c.onExport, entityTypesDetails = _c.entityTypesDetails, exportOvOnly = _c.exportOvOnly, onChangeExportOvOnly = _c.onChangeExportOvOnly;
|
|
65
67
|
var handleConfirm = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
68
|
var result, failedCount, successfulCount, failedJobsString, errorMessage, error;
|
|
67
69
|
var _a, _b;
|
|
@@ -113,8 +115,8 @@ export var ExportDialog = function (_a) {
|
|
|
113
115
|
}); }, [onClose, onExport, showSnackbarMessage, openConsoleApp, onLoadingChange]);
|
|
114
116
|
var handleExternalExport = useCallback(function () {
|
|
115
117
|
onClose();
|
|
116
|
-
onExternalExport();
|
|
117
|
-
}, [onExternalExport, onClose]);
|
|
118
|
+
onExternalExport(exportOvOnly);
|
|
119
|
+
}, [onExternalExport, onClose, exportOvOnly]);
|
|
118
120
|
var renderDetails = useMemo(function () { return (React.createElement(React.Fragment, null, Object.values(entityTypesDetails).map(function (data, index) { return (React.createElement("span", { key: index },
|
|
119
121
|
React.createElement("span", { className: styles.attributesCount }, data.label),
|
|
120
122
|
i18n.text('(${selected}/${total} attributes)', {
|
|
@@ -135,6 +137,9 @@ export var ExportDialog = function (_a) {
|
|
|
135
137
|
React.createElement(Typography, { variant: "body2", color: "textSecondary" }, renderDetails)),
|
|
136
138
|
React.createElement(Typography, { variant: "subtitle2", className: styles.subtitle }, i18n.text('Export options')),
|
|
137
139
|
React.createElement(DropDownSelector, { height: 44, value: fileFormat, onChange: onChangeFileFormat, label: i18n.text('File format'), options: formatOptions }),
|
|
140
|
+
React.createElement("div", { className: styles.exportOvOnlyWrapper },
|
|
141
|
+
React.createElement(FormControlLabel, { className: styles.exportOvOnlyLabel, control: React.createElement(Checkbox, { checked: exportOvOnly, onChange: onChangeExportOvOnly, color: "primary", size: "small" }), label: React.createElement(Typography, { variant: "body2" }, i18n.text('Export Operational Values (OV) only')) }),
|
|
142
|
+
React.createElement(Typography, { variant: "body2", color: "textSecondary", className: styles.exportOvOnlyHelper }, i18n.text('Only those attribute values that are selected by the survivorship rules will be exported'))),
|
|
138
143
|
React.createElement("div", { className: styles.externalExportWrapper },
|
|
139
144
|
React.createElement(Typography, { component: "span", variant: "body2" }, i18n.text('Want more export options?')),
|
|
140
145
|
React.createElement(Button, { onClick: handleExternalExport, color: "primary" }, i18n.text('Go to export application')))),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const styles = {"dialog":"ExportDialog-dialog--lQGKH","dialogTitle":"ExportDialog-dialogTitle--xpDLc","dialogContent":"ExportDialog-dialogContent--r--OS","dialogActions":"ExportDialog-dialogActions--jfCax","subtitle":"ExportDialog-subtitle--rwHDK","summary":"ExportDialog-summary--TlOEd","externalExportWrapper":"ExportDialog-externalExportWrapper--vaAXD","totalCaption":"ExportDialog-totalCaption--DpfR-","totalNumber":"ExportDialog-totalNumber--emHu3","attributesCount":"ExportDialog-attributesCount--NRt8X"};
|
|
1
|
+
const styles = {"dialog":"ExportDialog-dialog--lQGKH","dialogTitle":"ExportDialog-dialogTitle--xpDLc","dialogContent":"ExportDialog-dialogContent--r--OS","dialogActions":"ExportDialog-dialogActions--jfCax","subtitle":"ExportDialog-subtitle--rwHDK","summary":"ExportDialog-summary--TlOEd","externalExportWrapper":"ExportDialog-externalExportWrapper--vaAXD","exportOvOnlyWrapper":"ExportDialog-exportOvOnlyWrapper--S2RIC","exportOvOnlyLabel":"ExportDialog-exportOvOnlyLabel--ISC6S","exportOvOnlyHelper":"ExportDialog-exportOvOnlyHelper--Kj7kC","totalCaption":"ExportDialog-totalCaption--DpfR-","totalNumber":"ExportDialog-totalNumber--emHu3","attributesCount":"ExportDialog-attributesCount--NRt8X"};
|
|
2
2
|
if (typeof document !== 'undefined') {
|
|
3
3
|
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
4
|
const style = document.createElement('style');
|
|
5
5
|
style.type = 'text/css'
|
|
6
|
-
style.innerHTML = `.ExportDialog-dialog--lQGKH{width:600px}.ExportDialog-dialogTitle--xpDLc{padding:16px 16px 4px}.ExportDialog-dialogContent--r--OS{padding:20px 16px}.ExportDialog-dialogActions--jfCax{padding:8px}.ExportDialog-subtitle--rwHDK{margin:24px 0 6px}.ExportDialog-summary--TlOEd{background-color:#fafafa;border-radius:4px;padding:12px 16px}.ExportDialog-externalExportWrapper--vaAXD{padding:16px 0}.ExportDialog-totalCaption--DpfR-{font-size:18px;padding-bottom:8px}.ExportDialog-totalNumber--emHu3{font-size:20px;font-weight:500}.ExportDialog-attributesCount--NRt8X,.ExportDialog-totalNumber--emHu3{color:rgba(0,0,0,.87);margin-right:5px}`;
|
|
6
|
+
style.innerHTML = `.ExportDialog-dialog--lQGKH{width:600px}.ExportDialog-dialogTitle--xpDLc{padding:16px 16px 4px}.ExportDialog-dialogContent--r--OS{padding:20px 16px}.ExportDialog-dialogActions--jfCax{padding:8px}.ExportDialog-subtitle--rwHDK{margin:24px 0 6px}.ExportDialog-summary--TlOEd{background-color:#fafafa;border-radius:4px;padding:12px 16px}.ExportDialog-externalExportWrapper--vaAXD{padding:16px 0}.ExportDialog-exportOvOnlyWrapper--S2RIC{margin-top:16px}.ExportDialog-exportOvOnlyLabel--ISC6S{margin:0}.ExportDialog-exportOvOnlyHelper--Kj7kC{margin:4px 0 0 32px}.ExportDialog-totalCaption--DpfR-{font-size:18px;padding-bottom:8px}.ExportDialog-totalNumber--emHu3{font-size:20px;font-weight:500}.ExportDialog-attributesCount--NRt8X,.ExportDialog-totalNumber--emHu3{color:rgba(0,0,0,.87);margin-right:5px}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
export default styles;
|
|
@@ -168,6 +168,9 @@ describe('ExportDialog tests', function () {
|
|
|
168
168
|
expect(screen.getByText('Export options')).toBeInTheDocument();
|
|
169
169
|
expect(screen.getByText('File format')).toBeInTheDocument();
|
|
170
170
|
expect(screen.getByText('CSV Flattened')).toBeInTheDocument();
|
|
171
|
+
expect(screen.getByText('Export Operational Values (OV) only')).toBeInTheDocument();
|
|
172
|
+
expect(screen.getByText('Only those attribute values that are selected by the survivorship rules will be exported')).toBeInTheDocument();
|
|
173
|
+
expect(screen.getByRole('checkbox', { name: 'Export Operational Values (OV) only' })).not.toBeChecked();
|
|
171
174
|
expect(screen.getByText('Want more export options?')).toBeInTheDocument();
|
|
172
175
|
expect(screen.getByRole('button', { name: 'Go to export application' })).toBeInTheDocument();
|
|
173
176
|
expect(screen.getByRole('button', { name: 'Cancel' })).toBeInTheDocument();
|
|
@@ -197,7 +200,24 @@ describe('ExportDialog tests', function () {
|
|
|
197
200
|
return [4 /*yield*/, user.click(screen.getByRole('button', { name: 'Go to export application' }))];
|
|
198
201
|
case 1:
|
|
199
202
|
_a.sent();
|
|
200
|
-
expect(defaultProps.onExternalExport).
|
|
203
|
+
expect(defaultProps.onExternalExport).toHaveBeenCalledWith(false);
|
|
204
|
+
return [2 /*return*/];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}); });
|
|
208
|
+
it('should pass exportOvOnly true to onExternalExport when OV checkbox is checked', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
209
|
+
var user;
|
|
210
|
+
return __generator(this, function (_a) {
|
|
211
|
+
switch (_a.label) {
|
|
212
|
+
case 0:
|
|
213
|
+
user = setUp().user;
|
|
214
|
+
return [4 /*yield*/, user.click(screen.getByRole('checkbox', { name: 'Export Operational Values (OV) only' }))];
|
|
215
|
+
case 1:
|
|
216
|
+
_a.sent();
|
|
217
|
+
return [4 /*yield*/, user.click(screen.getByRole('button', { name: 'Go to export application' }))];
|
|
218
|
+
case 2:
|
|
219
|
+
_a.sent();
|
|
220
|
+
expect(defaultProps.onExternalExport).toHaveBeenCalledWith(true);
|
|
201
221
|
return [2 /*return*/];
|
|
202
222
|
}
|
|
203
223
|
});
|
|
@@ -229,7 +249,8 @@ describe('ExportDialog tests', function () {
|
|
|
229
249
|
},
|
|
230
250
|
includeType: ['configuration/entityTypes/HCP'],
|
|
231
251
|
headerOrder: ExportHeaderOrder.Select,
|
|
232
|
-
filter: defaultProps.filter
|
|
252
|
+
filter: defaultProps.filter,
|
|
253
|
+
ovOnly: false
|
|
233
254
|
}));
|
|
234
255
|
expect(exportData).toHaveBeenCalledWith(expect.objectContaining({
|
|
235
256
|
exportPath: '/nui/export',
|
|
@@ -244,7 +265,8 @@ describe('ExportDialog tests', function () {
|
|
|
244
265
|
},
|
|
245
266
|
includeType: ['configuration/entityTypes/HCO'],
|
|
246
267
|
headerOrder: ExportHeaderOrder.Default,
|
|
247
|
-
filter: defaultProps.filter
|
|
268
|
+
filter: defaultProps.filter,
|
|
269
|
+
ovOnly: false
|
|
248
270
|
}));
|
|
249
271
|
expect(defaultProps.onLoadingChange).toHaveBeenCalledWith(false);
|
|
250
272
|
expect(defaultProps.onClose).toHaveBeenCalled();
|
|
@@ -259,6 +281,32 @@ describe('ExportDialog tests', function () {
|
|
|
259
281
|
}
|
|
260
282
|
});
|
|
261
283
|
}); });
|
|
284
|
+
it('should pass ovOnly true to all export jobs when Export OV Only is checked', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
285
|
+
var user;
|
|
286
|
+
return __generator(this, function (_a) {
|
|
287
|
+
switch (_a.label) {
|
|
288
|
+
case 0:
|
|
289
|
+
user = setUp().user;
|
|
290
|
+
return [4 /*yield*/, user.click(screen.getByRole('checkbox', { name: 'Export Operational Values (OV) only' }))];
|
|
291
|
+
case 1:
|
|
292
|
+
_a.sent();
|
|
293
|
+
return [4 /*yield*/, user.click(screen.getByRole('button', { name: 'Export' }))];
|
|
294
|
+
case 2:
|
|
295
|
+
_a.sent();
|
|
296
|
+
expect(exportData).toHaveBeenCalledTimes(2);
|
|
297
|
+
expect(exportData).toHaveBeenCalledWith(expect.objectContaining({ ovOnly: true }));
|
|
298
|
+
expect(exportData).toHaveBeenNthCalledWith(1, expect.objectContaining({
|
|
299
|
+
includeType: ['configuration/entityTypes/HCP'],
|
|
300
|
+
ovOnly: true
|
|
301
|
+
}));
|
|
302
|
+
expect(exportData).toHaveBeenNthCalledWith(2, expect.objectContaining({
|
|
303
|
+
includeType: ['configuration/entityTypes/HCO'],
|
|
304
|
+
ovOnly: true
|
|
305
|
+
}));
|
|
306
|
+
return [2 /*return*/];
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}); });
|
|
262
310
|
it('should show error message when some export jobs failed', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
263
311
|
var user, errorMessage;
|
|
264
312
|
return __generator(this, function (_a) {
|
|
@@ -8,7 +8,7 @@ type Props = {
|
|
|
8
8
|
filter?: string;
|
|
9
9
|
activityFilter: ActivityFilter;
|
|
10
10
|
isSearchByOv: boolean;
|
|
11
|
-
onExternalExport: () => void;
|
|
11
|
+
onExternalExport: (exportOvOnly?: boolean) => void;
|
|
12
12
|
onLoadingChange?: (loading: boolean) => void;
|
|
13
13
|
};
|
|
14
14
|
export declare const ExportDialog: ({ open, onClose, columnsByEntityType, profilesCount, onExternalExport, onLoadingChange, filter, activityFilter, isSearchByOv }: Props) => React.JSX.Element;
|
|
@@ -72,6 +72,8 @@ var Button_1 = __importDefault(require("@mui/material/Button"));
|
|
|
72
72
|
var DialogContent_1 = __importDefault(require("@mui/material/DialogContent"));
|
|
73
73
|
var Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
74
74
|
var TextField_1 = __importDefault(require("@mui/material/TextField"));
|
|
75
|
+
var Checkbox_1 = __importDefault(require("@mui/material/Checkbox"));
|
|
76
|
+
var FormControlLabel_1 = __importDefault(require("@mui/material/FormControlLabel"));
|
|
75
77
|
var DropDownSelector_1 = require("../DropDownSelector");
|
|
76
78
|
var useInternalExport_1 = require("../hooks/useInternalExport");
|
|
77
79
|
var SnackbarContext_1 = require("../contexts/SnackbarContext");
|
|
@@ -90,7 +92,7 @@ var ExportDialog = function (_a) {
|
|
|
90
92
|
filter: filter,
|
|
91
93
|
activityFilter: activityFilter,
|
|
92
94
|
isSearchByOv: isSearchByOv
|
|
93
|
-
}), exportName = _c.exportName, onChangeExportName = _c.onChangeExportName, fileFormat = _c.fileFormat, onChangeFileFormat = _c.onChangeFileFormat, formatOptions = _c.formatOptions, onExport = _c.onExport, entityTypesDetails = _c.entityTypesDetails;
|
|
95
|
+
}), exportName = _c.exportName, onChangeExportName = _c.onChangeExportName, fileFormat = _c.fileFormat, onChangeFileFormat = _c.onChangeFileFormat, formatOptions = _c.formatOptions, onExport = _c.onExport, entityTypesDetails = _c.entityTypesDetails, exportOvOnly = _c.exportOvOnly, onChangeExportOvOnly = _c.onChangeExportOvOnly;
|
|
94
96
|
var handleConfirm = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
97
|
var result, failedCount, successfulCount, failedJobsString, errorMessage, error;
|
|
96
98
|
var _a, _b;
|
|
@@ -142,8 +144,8 @@ var ExportDialog = function (_a) {
|
|
|
142
144
|
}); }, [onClose, onExport, showSnackbarMessage, openConsoleApp, onLoadingChange]);
|
|
143
145
|
var handleExternalExport = (0, react_1.useCallback)(function () {
|
|
144
146
|
onClose();
|
|
145
|
-
onExternalExport();
|
|
146
|
-
}, [onExternalExport, onClose]);
|
|
147
|
+
onExternalExport(exportOvOnly);
|
|
148
|
+
}, [onExternalExport, onClose, exportOvOnly]);
|
|
147
149
|
var renderDetails = (0, react_1.useMemo)(function () { return (react_1.default.createElement(react_1.default.Fragment, null, Object.values(entityTypesDetails).map(function (data, index) { return (react_1.default.createElement("span", { key: index },
|
|
148
150
|
react_1.default.createElement("span", { className: ExportDialog_module_css_1.default.attributesCount }, data.label),
|
|
149
151
|
ui_i18n_1.default.text('(${selected}/${total} attributes)', {
|
|
@@ -164,6 +166,9 @@ var ExportDialog = function (_a) {
|
|
|
164
166
|
react_1.default.createElement(Typography_1.default, { variant: "body2", color: "textSecondary" }, renderDetails)),
|
|
165
167
|
react_1.default.createElement(Typography_1.default, { variant: "subtitle2", className: ExportDialog_module_css_1.default.subtitle }, ui_i18n_1.default.text('Export options')),
|
|
166
168
|
react_1.default.createElement(DropDownSelector_1.DropDownSelector, { height: 44, value: fileFormat, onChange: onChangeFileFormat, label: ui_i18n_1.default.text('File format'), options: formatOptions }),
|
|
169
|
+
react_1.default.createElement("div", { className: ExportDialog_module_css_1.default.exportOvOnlyWrapper },
|
|
170
|
+
react_1.default.createElement(FormControlLabel_1.default, { className: ExportDialog_module_css_1.default.exportOvOnlyLabel, control: react_1.default.createElement(Checkbox_1.default, { checked: exportOvOnly, onChange: onChangeExportOvOnly, color: "primary", size: "small" }), label: react_1.default.createElement(Typography_1.default, { variant: "body2" }, ui_i18n_1.default.text('Export Operational Values (OV) only')) }),
|
|
171
|
+
react_1.default.createElement(Typography_1.default, { variant: "body2", color: "textSecondary", className: ExportDialog_module_css_1.default.exportOvOnlyHelper }, ui_i18n_1.default.text('Only those attribute values that are selected by the survivorship rules will be exported'))),
|
|
167
172
|
react_1.default.createElement("div", { className: ExportDialog_module_css_1.default.externalExportWrapper },
|
|
168
173
|
react_1.default.createElement(Typography_1.default, { component: "span", variant: "body2" }, ui_i18n_1.default.text('Want more export options?')),
|
|
169
174
|
react_1.default.createElement(Button_1.default, { onClick: handleExternalExport, color: "primary" }, ui_i18n_1.default.text('Go to export application')))),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const styles = {"dialog":"ExportDialog-dialog--lQGKH","dialogTitle":"ExportDialog-dialogTitle--xpDLc","dialogContent":"ExportDialog-dialogContent--r--OS","dialogActions":"ExportDialog-dialogActions--jfCax","subtitle":"ExportDialog-subtitle--rwHDK","summary":"ExportDialog-summary--TlOEd","externalExportWrapper":"ExportDialog-externalExportWrapper--vaAXD","totalCaption":"ExportDialog-totalCaption--DpfR-","totalNumber":"ExportDialog-totalNumber--emHu3","attributesCount":"ExportDialog-attributesCount--NRt8X"};
|
|
1
|
+
const styles = {"dialog":"ExportDialog-dialog--lQGKH","dialogTitle":"ExportDialog-dialogTitle--xpDLc","dialogContent":"ExportDialog-dialogContent--r--OS","dialogActions":"ExportDialog-dialogActions--jfCax","subtitle":"ExportDialog-subtitle--rwHDK","summary":"ExportDialog-summary--TlOEd","externalExportWrapper":"ExportDialog-externalExportWrapper--vaAXD","exportOvOnlyWrapper":"ExportDialog-exportOvOnlyWrapper--S2RIC","exportOvOnlyLabel":"ExportDialog-exportOvOnlyLabel--ISC6S","exportOvOnlyHelper":"ExportDialog-exportOvOnlyHelper--Kj7kC","totalCaption":"ExportDialog-totalCaption--DpfR-","totalNumber":"ExportDialog-totalNumber--emHu3","attributesCount":"ExportDialog-attributesCount--NRt8X"};
|
|
2
2
|
if (typeof document !== 'undefined') {
|
|
3
3
|
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
4
|
const style = document.createElement('style');
|
|
5
5
|
style.type = 'text/css'
|
|
6
|
-
style.innerHTML = `.ExportDialog-dialog--lQGKH{width:600px}.ExportDialog-dialogTitle--xpDLc{padding:16px 16px 4px}.ExportDialog-dialogContent--r--OS{padding:20px 16px}.ExportDialog-dialogActions--jfCax{padding:8px}.ExportDialog-subtitle--rwHDK{margin:24px 0 6px}.ExportDialog-summary--TlOEd{background-color:#fafafa;border-radius:4px;padding:12px 16px}.ExportDialog-externalExportWrapper--vaAXD{padding:16px 0}.ExportDialog-totalCaption--DpfR-{font-size:18px;padding-bottom:8px}.ExportDialog-totalNumber--emHu3{font-size:20px;font-weight:500}.ExportDialog-attributesCount--NRt8X,.ExportDialog-totalNumber--emHu3{color:rgba(0,0,0,.87);margin-right:5px}`;
|
|
6
|
+
style.innerHTML = `.ExportDialog-dialog--lQGKH{width:600px}.ExportDialog-dialogTitle--xpDLc{padding:16px 16px 4px}.ExportDialog-dialogContent--r--OS{padding:20px 16px}.ExportDialog-dialogActions--jfCax{padding:8px}.ExportDialog-subtitle--rwHDK{margin:24px 0 6px}.ExportDialog-summary--TlOEd{background-color:#fafafa;border-radius:4px;padding:12px 16px}.ExportDialog-externalExportWrapper--vaAXD{padding:16px 0}.ExportDialog-exportOvOnlyWrapper--S2RIC{margin-top:16px}.ExportDialog-exportOvOnlyLabel--ISC6S{margin:0}.ExportDialog-exportOvOnlyHelper--Kj7kC{margin:4px 0 0 32px}.ExportDialog-totalCaption--DpfR-{font-size:18px;padding-bottom:8px}.ExportDialog-totalNumber--emHu3{font-size:20px;font-weight:500}.ExportDialog-attributesCount--NRt8X,.ExportDialog-totalNumber--emHu3{color:rgba(0,0,0,.87);margin-right:5px}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
module.exports = styles;
|
|
@@ -173,6 +173,9 @@ describe('ExportDialog tests', function () {
|
|
|
173
173
|
expect(react_2.screen.getByText('Export options')).toBeInTheDocument();
|
|
174
174
|
expect(react_2.screen.getByText('File format')).toBeInTheDocument();
|
|
175
175
|
expect(react_2.screen.getByText('CSV Flattened')).toBeInTheDocument();
|
|
176
|
+
expect(react_2.screen.getByText('Export Operational Values (OV) only')).toBeInTheDocument();
|
|
177
|
+
expect(react_2.screen.getByText('Only those attribute values that are selected by the survivorship rules will be exported')).toBeInTheDocument();
|
|
178
|
+
expect(react_2.screen.getByRole('checkbox', { name: 'Export Operational Values (OV) only' })).not.toBeChecked();
|
|
176
179
|
expect(react_2.screen.getByText('Want more export options?')).toBeInTheDocument();
|
|
177
180
|
expect(react_2.screen.getByRole('button', { name: 'Go to export application' })).toBeInTheDocument();
|
|
178
181
|
expect(react_2.screen.getByRole('button', { name: 'Cancel' })).toBeInTheDocument();
|
|
@@ -202,7 +205,24 @@ describe('ExportDialog tests', function () {
|
|
|
202
205
|
return [4 /*yield*/, user.click(react_2.screen.getByRole('button', { name: 'Go to export application' }))];
|
|
203
206
|
case 1:
|
|
204
207
|
_a.sent();
|
|
205
|
-
expect(defaultProps.onExternalExport).
|
|
208
|
+
expect(defaultProps.onExternalExport).toHaveBeenCalledWith(false);
|
|
209
|
+
return [2 /*return*/];
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}); });
|
|
213
|
+
it('should pass exportOvOnly true to onExternalExport when OV checkbox is checked', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
214
|
+
var user;
|
|
215
|
+
return __generator(this, function (_a) {
|
|
216
|
+
switch (_a.label) {
|
|
217
|
+
case 0:
|
|
218
|
+
user = setUp().user;
|
|
219
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('checkbox', { name: 'Export Operational Values (OV) only' }))];
|
|
220
|
+
case 1:
|
|
221
|
+
_a.sent();
|
|
222
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('button', { name: 'Go to export application' }))];
|
|
223
|
+
case 2:
|
|
224
|
+
_a.sent();
|
|
225
|
+
expect(defaultProps.onExternalExport).toHaveBeenCalledWith(true);
|
|
206
226
|
return [2 /*return*/];
|
|
207
227
|
}
|
|
208
228
|
});
|
|
@@ -234,7 +254,8 @@ describe('ExportDialog tests', function () {
|
|
|
234
254
|
},
|
|
235
255
|
includeType: ['configuration/entityTypes/HCP'],
|
|
236
256
|
headerOrder: mdm_sdk_1.ExportHeaderOrder.Select,
|
|
237
|
-
filter: defaultProps.filter
|
|
257
|
+
filter: defaultProps.filter,
|
|
258
|
+
ovOnly: false
|
|
238
259
|
}));
|
|
239
260
|
expect(mdm_sdk_1.exportData).toHaveBeenCalledWith(expect.objectContaining({
|
|
240
261
|
exportPath: '/nui/export',
|
|
@@ -249,7 +270,8 @@ describe('ExportDialog tests', function () {
|
|
|
249
270
|
},
|
|
250
271
|
includeType: ['configuration/entityTypes/HCO'],
|
|
251
272
|
headerOrder: mdm_sdk_1.ExportHeaderOrder.Default,
|
|
252
|
-
filter: defaultProps.filter
|
|
273
|
+
filter: defaultProps.filter,
|
|
274
|
+
ovOnly: false
|
|
253
275
|
}));
|
|
254
276
|
expect(defaultProps.onLoadingChange).toHaveBeenCalledWith(false);
|
|
255
277
|
expect(defaultProps.onClose).toHaveBeenCalled();
|
|
@@ -264,6 +286,32 @@ describe('ExportDialog tests', function () {
|
|
|
264
286
|
}
|
|
265
287
|
});
|
|
266
288
|
}); });
|
|
289
|
+
it('should pass ovOnly true to all export jobs when Export OV Only is checked', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
290
|
+
var user;
|
|
291
|
+
return __generator(this, function (_a) {
|
|
292
|
+
switch (_a.label) {
|
|
293
|
+
case 0:
|
|
294
|
+
user = setUp().user;
|
|
295
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('checkbox', { name: 'Export Operational Values (OV) only' }))];
|
|
296
|
+
case 1:
|
|
297
|
+
_a.sent();
|
|
298
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('button', { name: 'Export' }))];
|
|
299
|
+
case 2:
|
|
300
|
+
_a.sent();
|
|
301
|
+
expect(mdm_sdk_1.exportData).toHaveBeenCalledTimes(2);
|
|
302
|
+
expect(mdm_sdk_1.exportData).toHaveBeenCalledWith(expect.objectContaining({ ovOnly: true }));
|
|
303
|
+
expect(mdm_sdk_1.exportData).toHaveBeenNthCalledWith(1, expect.objectContaining({
|
|
304
|
+
includeType: ['configuration/entityTypes/HCP'],
|
|
305
|
+
ovOnly: true
|
|
306
|
+
}));
|
|
307
|
+
expect(mdm_sdk_1.exportData).toHaveBeenNthCalledWith(2, expect.objectContaining({
|
|
308
|
+
includeType: ['configuration/entityTypes/HCO'],
|
|
309
|
+
ovOnly: true
|
|
310
|
+
}));
|
|
311
|
+
return [2 /*return*/];
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
}); });
|
|
267
315
|
it('should show error message when some export jobs failed', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
268
316
|
var user, errorMessage;
|
|
269
317
|
return __generator(this, function (_a) {
|
|
@@ -2,7 +2,7 @@ type Props = {
|
|
|
2
2
|
canExport: boolean;
|
|
3
3
|
internalExportEnabled: boolean;
|
|
4
4
|
onInternalExport: () => void;
|
|
5
|
-
onExternalExport: () => void;
|
|
5
|
+
onExternalExport: (exportOvOnly?: boolean) => void;
|
|
6
6
|
};
|
|
7
7
|
export declare const useExportController: ({ canExport, internalExportEnabled, onInternalExport, onExternalExport }: Props) => {
|
|
8
8
|
hasExport: boolean;
|
|
@@ -27,6 +27,8 @@ export declare const useInternalExport: ({ columnsByEntityType, dialogOpen, filt
|
|
|
27
27
|
onChangeFileFormat: (value: ExportFormatOption) => void;
|
|
28
28
|
formatOptions: ExportFormatOption[];
|
|
29
29
|
entityTypesDetails: EntityTypeSummary;
|
|
30
|
+
exportOvOnly: boolean;
|
|
31
|
+
onChangeExportOvOnly: (_: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
30
32
|
onExport: () => Promise<{
|
|
31
33
|
failedJobs: string[];
|
|
32
34
|
total: number;
|
|
@@ -79,6 +79,7 @@ var useInternalExport = function (_a) {
|
|
|
79
79
|
}, []);
|
|
80
80
|
var _b = (0, react_1.useState)(''), exportName = _b[0], setExportName = _b[1];
|
|
81
81
|
var _c = (0, react_1.useState)(), fileFormat = _c[0], setFileFormat = _c[1];
|
|
82
|
+
var _d = (0, react_1.useState)(false), exportOvOnly = _d[0], setExportOvOnly = _d[1];
|
|
82
83
|
var formatOptions = (0, react_1.useMemo)(function () {
|
|
83
84
|
return [
|
|
84
85
|
defaultFormat,
|
|
@@ -118,6 +119,9 @@ var useInternalExport = function (_a) {
|
|
|
118
119
|
var handleChangeFileFormat = (0, react_1.useCallback)(function (value) {
|
|
119
120
|
setFileFormat(value);
|
|
120
121
|
}, []);
|
|
122
|
+
var handleChangeExportOvOnly = (0, react_1.useCallback)(function (_, checked) {
|
|
123
|
+
setExportOvOnly(checked);
|
|
124
|
+
}, []);
|
|
121
125
|
var formatDateTime = (0, react_1.useCallback)(function (dateTime) {
|
|
122
126
|
var date = dateTime
|
|
123
127
|
.toLocaleDateString('en-US', { month: '2-digit', day: '2-digit', year: 'numeric' })
|
|
@@ -132,6 +136,7 @@ var useInternalExport = function (_a) {
|
|
|
132
136
|
var defaultName = "".concat(defaultExportName, " ").concat(formatDateTime(now));
|
|
133
137
|
setExportName(defaultName);
|
|
134
138
|
setFileFormat(defaultFormat);
|
|
139
|
+
setExportOvOnly(false);
|
|
135
140
|
}
|
|
136
141
|
}, [dialogOpen, defaultFormat, formatDateTime, defaultExportName]);
|
|
137
142
|
var handleExport = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -156,7 +161,8 @@ var useInternalExport = function (_a) {
|
|
|
156
161
|
options: options,
|
|
157
162
|
includeType: [entityTypeUri],
|
|
158
163
|
headerOrder: headerOrder,
|
|
159
|
-
filter: filter
|
|
164
|
+
filter: filter,
|
|
165
|
+
ovOnly: exportOvOnly
|
|
160
166
|
}));
|
|
161
167
|
jobEntityTypes.push([entityTypeUri]);
|
|
162
168
|
});
|
|
@@ -168,7 +174,8 @@ var useInternalExport = function (_a) {
|
|
|
168
174
|
options: options,
|
|
169
175
|
includeType: typesWithAllColumns,
|
|
170
176
|
headerOrder: mdm_sdk_1.ExportHeaderOrder.Default,
|
|
171
|
-
filter: filter
|
|
177
|
+
filter: filter,
|
|
178
|
+
ovOnly: exportOvOnly
|
|
172
179
|
}));
|
|
173
180
|
jobEntityTypes.push(typesWithAllColumns);
|
|
174
181
|
}
|
|
@@ -188,6 +195,7 @@ var useInternalExport = function (_a) {
|
|
|
188
195
|
filter,
|
|
189
196
|
activityFilter,
|
|
190
197
|
isSearchByOv,
|
|
198
|
+
exportOvOnly,
|
|
191
199
|
entityTypes,
|
|
192
200
|
columnsByEntityType,
|
|
193
201
|
entityTypesDetails,
|
|
@@ -201,6 +209,8 @@ var useInternalExport = function (_a) {
|
|
|
201
209
|
onChangeFileFormat: handleChangeFileFormat,
|
|
202
210
|
formatOptions: formatOptions,
|
|
203
211
|
entityTypesDetails: entityTypesDetails,
|
|
212
|
+
exportOvOnly: exportOvOnly,
|
|
213
|
+
onChangeExportOvOnly: handleChangeExportOvOnly,
|
|
204
214
|
onExport: handleExport
|
|
205
215
|
};
|
|
206
216
|
};
|
|
@@ -2,7 +2,7 @@ type Props = {
|
|
|
2
2
|
canExport: boolean;
|
|
3
3
|
internalExportEnabled: boolean;
|
|
4
4
|
onInternalExport: () => void;
|
|
5
|
-
onExternalExport: () => void;
|
|
5
|
+
onExternalExport: (exportOvOnly?: boolean) => void;
|
|
6
6
|
};
|
|
7
7
|
export declare const useExportController: ({ canExport, internalExportEnabled, onInternalExport, onExternalExport }: Props) => {
|
|
8
8
|
hasExport: boolean;
|
|
@@ -27,6 +27,8 @@ export declare const useInternalExport: ({ columnsByEntityType, dialogOpen, filt
|
|
|
27
27
|
onChangeFileFormat: (value: ExportFormatOption) => void;
|
|
28
28
|
formatOptions: ExportFormatOption[];
|
|
29
29
|
entityTypesDetails: EntityTypeSummary;
|
|
30
|
+
exportOvOnly: boolean;
|
|
31
|
+
onChangeExportOvOnly: (_: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
30
32
|
onExport: () => Promise<{
|
|
31
33
|
failedJobs: string[];
|
|
32
34
|
total: number;
|
|
@@ -73,6 +73,7 @@ export var useInternalExport = function (_a) {
|
|
|
73
73
|
}, []);
|
|
74
74
|
var _b = useState(''), exportName = _b[0], setExportName = _b[1];
|
|
75
75
|
var _c = useState(), fileFormat = _c[0], setFileFormat = _c[1];
|
|
76
|
+
var _d = useState(false), exportOvOnly = _d[0], setExportOvOnly = _d[1];
|
|
76
77
|
var formatOptions = useMemo(function () {
|
|
77
78
|
return [
|
|
78
79
|
defaultFormat,
|
|
@@ -112,6 +113,9 @@ export var useInternalExport = function (_a) {
|
|
|
112
113
|
var handleChangeFileFormat = useCallback(function (value) {
|
|
113
114
|
setFileFormat(value);
|
|
114
115
|
}, []);
|
|
116
|
+
var handleChangeExportOvOnly = useCallback(function (_, checked) {
|
|
117
|
+
setExportOvOnly(checked);
|
|
118
|
+
}, []);
|
|
115
119
|
var formatDateTime = useCallback(function (dateTime) {
|
|
116
120
|
var date = dateTime
|
|
117
121
|
.toLocaleDateString('en-US', { month: '2-digit', day: '2-digit', year: 'numeric' })
|
|
@@ -126,6 +130,7 @@ export var useInternalExport = function (_a) {
|
|
|
126
130
|
var defaultName = "".concat(defaultExportName, " ").concat(formatDateTime(now));
|
|
127
131
|
setExportName(defaultName);
|
|
128
132
|
setFileFormat(defaultFormat);
|
|
133
|
+
setExportOvOnly(false);
|
|
129
134
|
}
|
|
130
135
|
}, [dialogOpen, defaultFormat, formatDateTime, defaultExportName]);
|
|
131
136
|
var handleExport = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -150,7 +155,8 @@ export var useInternalExport = function (_a) {
|
|
|
150
155
|
options: options,
|
|
151
156
|
includeType: [entityTypeUri],
|
|
152
157
|
headerOrder: headerOrder,
|
|
153
|
-
filter: filter
|
|
158
|
+
filter: filter,
|
|
159
|
+
ovOnly: exportOvOnly
|
|
154
160
|
}));
|
|
155
161
|
jobEntityTypes.push([entityTypeUri]);
|
|
156
162
|
});
|
|
@@ -162,7 +168,8 @@ export var useInternalExport = function (_a) {
|
|
|
162
168
|
options: options,
|
|
163
169
|
includeType: typesWithAllColumns,
|
|
164
170
|
headerOrder: ExportHeaderOrder.Default,
|
|
165
|
-
filter: filter
|
|
171
|
+
filter: filter,
|
|
172
|
+
ovOnly: exportOvOnly
|
|
166
173
|
}));
|
|
167
174
|
jobEntityTypes.push(typesWithAllColumns);
|
|
168
175
|
}
|
|
@@ -182,6 +189,7 @@ export var useInternalExport = function (_a) {
|
|
|
182
189
|
filter,
|
|
183
190
|
activityFilter,
|
|
184
191
|
isSearchByOv,
|
|
192
|
+
exportOvOnly,
|
|
185
193
|
entityTypes,
|
|
186
194
|
columnsByEntityType,
|
|
187
195
|
entityTypesDetails,
|
|
@@ -195,6 +203,8 @@ export var useInternalExport = function (_a) {
|
|
|
195
203
|
onChangeFileFormat: handleChangeFileFormat,
|
|
196
204
|
formatOptions: formatOptions,
|
|
197
205
|
entityTypesDetails: entityTypesDetails,
|
|
206
|
+
exportOvOnly: exportOvOnly,
|
|
207
|
+
onChangeExportOvOnly: handleChangeExportOvOnly,
|
|
198
208
|
onExport: handleExport
|
|
199
209
|
};
|
|
200
210
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2282",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
12
12
|
"@googlemaps/markerclusterer": "^2.5.3",
|
|
13
13
|
"@react-sigma/core": "3.4.0",
|
|
14
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
14
|
+
"@reltio/mdm-sdk": "^1.4.2056",
|
|
15
15
|
"@vis.gl/react-google-maps": "^1.3.0",
|
|
16
16
|
"d3-cloud": "^1.2.5",
|
|
17
17
|
"d3-geo": "^2.0.1",
|