@reltio/components 1.4.2218 → 1.4.2220
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/AttributeListItem/AttributeListItem.d.ts +1 -0
- package/ExportDialog/ExportDialog.d.ts +15 -0
- package/ExportDialog/ExportDialog.js +144 -0
- package/ExportDialog/ExportDialog.module.css.js +9 -0
- package/ExportDialog/ExportDialog.test.d.ts +1 -0
- package/ExportDialog/ExportDialog.test.js +285 -0
- package/ExportDialog/index.d.ts +1 -0
- package/ExportDialog/index.js +1 -0
- package/FacetContainer/FacetContainer.d.ts +1 -0
- package/FacetContainer/components/ChipsCount/ChipsCount.d.ts +1 -0
- package/HOCs/withTooltip/withTooltip.d.ts +1 -0
- package/HOCs/withTooltip/withTooltip.js +3 -2
- package/InfoIcon/InfoIcon.d.ts +1 -0
- package/OvIcon/OvIcon.d.ts +1 -0
- package/ReltioMap/components/TopRightMapControls/TopRightMapControls.d.ts +1 -0
- package/SimpleMatchRulesBlock/SimpleMatchRulesBlock.d.ts +1 -0
- package/SmallIconButton/index.d.ts +1 -0
- package/TransitiveMatchBlock/TransitiveMatchBlock.d.ts +1 -0
- package/cjs/AttributeListItem/AttributeListItem.d.ts +1 -0
- package/cjs/ExportDialog/ExportDialog.d.ts +15 -0
- package/cjs/ExportDialog/ExportDialog.js +174 -0
- package/cjs/ExportDialog/ExportDialog.module.css.js +9 -0
- package/cjs/ExportDialog/ExportDialog.test.d.ts +1 -0
- package/cjs/ExportDialog/ExportDialog.test.js +290 -0
- package/cjs/ExportDialog/index.d.ts +1 -0
- package/cjs/ExportDialog/index.js +5 -0
- package/cjs/FacetContainer/FacetContainer.d.ts +1 -0
- package/cjs/FacetContainer/components/ChipsCount/ChipsCount.d.ts +1 -0
- package/cjs/HOCs/withTooltip/withTooltip.d.ts +1 -0
- package/cjs/HOCs/withTooltip/withTooltip.js +3 -2
- package/cjs/InfoIcon/InfoIcon.d.ts +1 -0
- package/cjs/OvIcon/OvIcon.d.ts +1 -0
- package/cjs/ReltioMap/components/TopRightMapControls/TopRightMapControls.d.ts +1 -0
- package/cjs/SimpleMatchRulesBlock/SimpleMatchRulesBlock.d.ts +1 -0
- package/cjs/SmallIconButton/index.d.ts +1 -0
- package/cjs/TransitiveMatchBlock/TransitiveMatchBlock.d.ts +1 -0
- package/cjs/contexts/MdmModuleContext/context.d.ts +2 -0
- package/cjs/contexts/MdmModuleContext/hooks.d.ts +1 -0
- package/cjs/contexts/MdmModuleContext/hooks.js +3 -1
- package/cjs/contexts/SnackbarContext/index.d.ts +9 -2
- package/cjs/features/history/HistoryGraph/HistoryGraph.d.ts +1 -0
- package/cjs/features/workflow/ReassignButton/components/ReassignDialog/styles.d.ts +1 -1
- package/cjs/hooks/useExportController/index.d.ts +1 -0
- package/cjs/hooks/useExportController/index.js +5 -0
- package/cjs/hooks/useExportController/useExportController.d.ts +11 -0
- package/cjs/hooks/useExportController/useExportController.js +20 -0
- package/cjs/hooks/useInternalExport/index.d.ts +1 -0
- package/cjs/hooks/useInternalExport/index.js +5 -0
- package/cjs/hooks/useInternalExport/useInternalExport.d.ts +35 -0
- package/cjs/hooks/useInternalExport/useInternalExport.js +205 -0
- package/cjs/hooks/useSnackbar/useSnackbar.d.ts +2 -1
- package/cjs/hooks/useSnackbar/useSnackbar.js +23 -4
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +8 -4
- package/contexts/MdmModuleContext/context.d.ts +2 -0
- package/contexts/MdmModuleContext/hooks.d.ts +1 -0
- package/contexts/MdmModuleContext/hooks.js +1 -0
- package/contexts/SnackbarContext/index.d.ts +9 -2
- package/features/history/HistoryGraph/HistoryGraph.d.ts +1 -0
- package/features/workflow/ReassignButton/components/ReassignDialog/styles.d.ts +1 -1
- package/hooks/useExportController/index.d.ts +1 -0
- package/hooks/useExportController/index.js +1 -0
- package/hooks/useExportController/useExportController.d.ts +11 -0
- package/hooks/useExportController/useExportController.js +16 -0
- package/hooks/useInternalExport/index.d.ts +1 -0
- package/hooks/useInternalExport/index.js +1 -0
- package/hooks/useInternalExport/useInternalExport.d.ts +35 -0
- package/hooks/useInternalExport/useInternalExport.js +198 -0
- package/hooks/useSnackbar/useSnackbar.d.ts +2 -1
- package/hooks/useSnackbar/useSnackbar.js +24 -5
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +2 -2
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export type SnackbarPayload = string | ReactNode | {
|
|
3
|
+
message: string;
|
|
4
|
+
action?: {
|
|
5
|
+
label: string;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const SnackbarContext: React.Context<(payload: SnackbarPayload) => void>;
|
|
@@ -4,6 +4,7 @@ export declare const HistoryCircleWithTooltip: React.ForwardRefExoticComponent<O
|
|
|
4
4
|
tooltipTitle?: import("@mui/material").TooltipProps["title"];
|
|
5
5
|
tooltipPlacement?: import("@mui/material").TooltipProps["placement"];
|
|
6
6
|
showForDisabled?: boolean;
|
|
7
|
+
tooltipClassName?: string;
|
|
7
8
|
} & Omit<{
|
|
8
9
|
x: number;
|
|
9
10
|
y: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"caption" | "disabled" | "title" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"caption" | "disabled" | "title" | "dialogContent" | "currentAssignee" | "dialogText">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useExportController } from './useExportController';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useExportController = void 0;
|
|
4
|
+
var useExportController_1 = require("./useExportController");
|
|
5
|
+
Object.defineProperty(exports, "useExportController", { enumerable: true, get: function () { return useExportController_1.useExportController; } });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
canExport: boolean;
|
|
3
|
+
internalExportEnabled: boolean;
|
|
4
|
+
onInternalExport: () => void;
|
|
5
|
+
onExternalExport: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExportController: ({ canExport, internalExportEnabled, onInternalExport, onExternalExport }: Props) => {
|
|
8
|
+
hasExport: boolean;
|
|
9
|
+
onExport: () => void;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useExportController = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var hooks_1 = require("../../contexts/MdmModuleContext/hooks");
|
|
6
|
+
var useExportController = function (_a) {
|
|
7
|
+
var canExport = _a.canExport, internalExportEnabled = _a.internalExportEnabled, onInternalExport = _a.onInternalExport, onExternalExport = _a.onExternalExport;
|
|
8
|
+
var canUserMakeExport = (0, hooks_1.useMdmCanUserMakeExport)();
|
|
9
|
+
var hasExport = canExport && canUserMakeExport;
|
|
10
|
+
var onExport = (0, react_1.useCallback)(function () {
|
|
11
|
+
if (internalExportEnabled) {
|
|
12
|
+
onInternalExport();
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
onExternalExport();
|
|
16
|
+
}
|
|
17
|
+
}, [internalExportEnabled, onInternalExport, onExternalExport]);
|
|
18
|
+
return { hasExport: hasExport, onExport: onExport };
|
|
19
|
+
};
|
|
20
|
+
exports.useExportController = useExportController;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useInternalExport } from './useInternalExport';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useInternalExport = void 0;
|
|
4
|
+
var useInternalExport_1 = require("./useInternalExport");
|
|
5
|
+
Object.defineProperty(exports, "useInternalExport", { enumerable: true, get: function () { return useInternalExport_1.useInternalExport; } });
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ActivityFilter } from '@reltio/mdm-sdk';
|
|
2
|
+
declare enum ExportFormat {
|
|
3
|
+
CSVFlattened = "csvFlattened",
|
|
4
|
+
CSVExploded = "csvExploded",
|
|
5
|
+
JSON = "json"
|
|
6
|
+
}
|
|
7
|
+
type ExportFormatOption = {
|
|
8
|
+
value: ExportFormat;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
type EntityTypeSummary = Record<string, {
|
|
12
|
+
totalAttributesCount: number;
|
|
13
|
+
selectedAttributesCount: number;
|
|
14
|
+
label: string;
|
|
15
|
+
}>;
|
|
16
|
+
type Props = {
|
|
17
|
+
dialogOpen: boolean;
|
|
18
|
+
columnsByEntityType: Record<string, string[]>;
|
|
19
|
+
filter: string;
|
|
20
|
+
activityFilter: ActivityFilter;
|
|
21
|
+
isSearchByOv: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const useInternalExport: ({ columnsByEntityType, dialogOpen, filter, activityFilter, isSearchByOv }: Props) => {
|
|
24
|
+
exportName: string;
|
|
25
|
+
onChangeExportName: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
26
|
+
fileFormat: ExportFormatOption;
|
|
27
|
+
onChangeFileFormat: (value: ExportFormatOption) => void;
|
|
28
|
+
formatOptions: ExportFormatOption[];
|
|
29
|
+
entityTypesDetails: EntityTypeSummary;
|
|
30
|
+
onExport: () => Promise<{
|
|
31
|
+
failedJobs: string[];
|
|
32
|
+
total: number;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.useInternalExport = void 0;
|
|
54
|
+
var react_1 = require("react");
|
|
55
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
56
|
+
var ramda_1 = require("ramda");
|
|
57
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
58
|
+
var MdmModuleContext_1 = require("../../contexts/MdmModuleContext");
|
|
59
|
+
var ExportFormat;
|
|
60
|
+
(function (ExportFormat) {
|
|
61
|
+
ExportFormat["CSVFlattened"] = "csvFlattened";
|
|
62
|
+
ExportFormat["CSVExploded"] = "csvExploded";
|
|
63
|
+
ExportFormat["JSON"] = "json";
|
|
64
|
+
})(ExportFormat || (ExportFormat = {}));
|
|
65
|
+
var DEFAULT_EXPORT_NAME = 'Untitled Export Job';
|
|
66
|
+
// List of basic attributes:
|
|
67
|
+
// [createdBy, createdTime, updatedBy, updatedTime, uri, type, endDate, analyticsAttributes, label, secondaryLabel]
|
|
68
|
+
var BASIC_ATTRIBUTES_COUNT = 10;
|
|
69
|
+
var useInternalExport = function (_a) {
|
|
70
|
+
var columnsByEntityType = _a.columnsByEntityType, dialogOpen = _a.dialogOpen, filter = _a.filter, activityFilter = _a.activityFilter, isSearchByOv = _a.isSearchByOv;
|
|
71
|
+
var exportPath = (0, MdmModuleContext_1.useMdmExportPath)();
|
|
72
|
+
var tenant = (0, MdmModuleContext_1.useMdmTenant)();
|
|
73
|
+
var metadata = (0, MdmModuleContext_1.useMdmMetadata)();
|
|
74
|
+
var defaultFormat = (0, react_1.useMemo)(function () {
|
|
75
|
+
return {
|
|
76
|
+
value: ExportFormat.CSVFlattened,
|
|
77
|
+
label: ui_i18n_1.default.text('CSV Flattened')
|
|
78
|
+
};
|
|
79
|
+
}, []);
|
|
80
|
+
var _b = (0, react_1.useState)(''), exportName = _b[0], setExportName = _b[1];
|
|
81
|
+
var _c = (0, react_1.useState)(), fileFormat = _c[0], setFileFormat = _c[1];
|
|
82
|
+
var formatOptions = (0, react_1.useMemo)(function () {
|
|
83
|
+
return [
|
|
84
|
+
defaultFormat,
|
|
85
|
+
{
|
|
86
|
+
value: ExportFormat.CSVExploded,
|
|
87
|
+
label: ui_i18n_1.default.text('CSV Exploded')
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
value: ExportFormat.JSON,
|
|
91
|
+
label: ui_i18n_1.default.text('JSON')
|
|
92
|
+
}
|
|
93
|
+
];
|
|
94
|
+
}, [defaultFormat]);
|
|
95
|
+
var entityTypes = (0, react_1.useMemo)(function () { return Object.keys(columnsByEntityType); }, [columnsByEntityType]);
|
|
96
|
+
var entityTypesDetails = (0, react_1.useMemo)(function () {
|
|
97
|
+
return entityTypes.reduce(function (acc, entityTypeUri) {
|
|
98
|
+
var _a, _b, _c, _d, _e;
|
|
99
|
+
var entityType = (0, mdm_sdk_1.getEntityType)(metadata, entityTypeUri);
|
|
100
|
+
var attrCount = (_b = (_a = entityType.attributes) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
101
|
+
var hiddenAttrCount = (0, ramda_1.count)(mdm_sdk_1.isHiddenAttribute, (_c = entityType.attributes) !== null && _c !== void 0 ? _c : []);
|
|
102
|
+
var analyticsAttrCount = (_e = (_d = entityType.analyticsAttributes) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
|
|
103
|
+
var totalAttrCount = attrCount + analyticsAttrCount + BASIC_ATTRIBUTES_COUNT;
|
|
104
|
+
var columnsLength = (0, ramda_1.pipe)((0, ramda_1.prop)(entityTypeUri), (0, ramda_1.map)(mdm_sdk_1.getFirstLevelSearchUri), ramda_1.uniq, ramda_1.length)(columnsByEntityType);
|
|
105
|
+
var defaultCount = totalAttrCount - hiddenAttrCount - analyticsAttrCount;
|
|
106
|
+
var selectedAttrCount = columnsLength > 0 ? columnsLength : defaultCount;
|
|
107
|
+
acc[entityTypeUri] = {
|
|
108
|
+
totalAttributesCount: totalAttrCount,
|
|
109
|
+
selectedAttributesCount: selectedAttrCount,
|
|
110
|
+
label: entityType === null || entityType === void 0 ? void 0 : entityType.label
|
|
111
|
+
};
|
|
112
|
+
return acc;
|
|
113
|
+
}, {});
|
|
114
|
+
}, [columnsByEntityType, entityTypes, metadata]);
|
|
115
|
+
var handleChangeExportName = (0, react_1.useCallback)(function (e) {
|
|
116
|
+
setExportName(e.target.value);
|
|
117
|
+
}, []);
|
|
118
|
+
var handleChangeFileFormat = (0, react_1.useCallback)(function (value) {
|
|
119
|
+
setFileFormat(value);
|
|
120
|
+
}, []);
|
|
121
|
+
var formatDateTime = (0, react_1.useCallback)(function (dateTime) {
|
|
122
|
+
var date = dateTime
|
|
123
|
+
.toLocaleDateString('en-US', { month: '2-digit', day: '2-digit', year: 'numeric' })
|
|
124
|
+
.replace(/\//g, '');
|
|
125
|
+
var time = dateTime.toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit' });
|
|
126
|
+
return "".concat(date, "_").concat(time);
|
|
127
|
+
}, []);
|
|
128
|
+
var defaultExportName = (0, react_1.useMemo)(function () { return ui_i18n_1.default.text(DEFAULT_EXPORT_NAME); }, []);
|
|
129
|
+
(0, react_1.useEffect)(function () {
|
|
130
|
+
if (dialogOpen) {
|
|
131
|
+
var now = new Date();
|
|
132
|
+
var defaultName = "".concat(defaultExportName, " ").concat(formatDateTime(now));
|
|
133
|
+
setExportName(defaultName);
|
|
134
|
+
setFileFormat(defaultFormat);
|
|
135
|
+
}
|
|
136
|
+
}, [dialogOpen, defaultFormat, formatDateTime, defaultExportName]);
|
|
137
|
+
var handleExport = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
138
|
+
var isCsv, baseOptions, tasks, typesWithSomeColumns, typesWithAllColumns, jobEntityTypes, options, results, failedJobs;
|
|
139
|
+
return __generator(this, function (_a) {
|
|
140
|
+
switch (_a.label) {
|
|
141
|
+
case 0:
|
|
142
|
+
if (!exportName || !fileFormat)
|
|
143
|
+
return [2 /*return*/];
|
|
144
|
+
isCsv = [ExportFormat.CSVFlattened, ExportFormat.CSVExploded].includes(fileFormat.value);
|
|
145
|
+
baseOptions = __assign(__assign({ fileFormat: isCsv ? mdm_sdk_1.ExportDataFormat.CSV : mdm_sdk_1.ExportDataFormat.JSON, filter: filter, activeness: activityFilter, options: isSearchByOv ? 'parallelExecution,searchByOv' : 'parallelExecution' }, (fileFormat.value === ExportFormat.CSVExploded ? { exploded: true } : {})), (isCsv ? { dateFormat: 'readable' } : {}));
|
|
146
|
+
tasks = [];
|
|
147
|
+
typesWithSomeColumns = entityTypes.filter(function (uri) { return columnsByEntityType[uri].length > 0; });
|
|
148
|
+
typesWithAllColumns = entityTypes.filter(function (uri) { return columnsByEntityType[uri].length === 0; });
|
|
149
|
+
jobEntityTypes = [];
|
|
150
|
+
typesWithSomeColumns.forEach(function (entityTypeUri) {
|
|
151
|
+
var options = __assign(__assign({}, baseOptions), { select: columnsByEntityType[entityTypeUri].join(','), name: "".concat(exportName, "_").concat(entityTypesDetails[entityTypeUri].label) });
|
|
152
|
+
var headerOrder = isCsv ? mdm_sdk_1.ExportHeaderOrder.Select : mdm_sdk_1.ExportHeaderOrder.Default;
|
|
153
|
+
tasks.push((0, mdm_sdk_1.exportData)({
|
|
154
|
+
exportPath: exportPath,
|
|
155
|
+
tenant: tenant,
|
|
156
|
+
options: options,
|
|
157
|
+
includeType: [entityTypeUri],
|
|
158
|
+
headerOrder: headerOrder
|
|
159
|
+
}));
|
|
160
|
+
jobEntityTypes.push([entityTypeUri]);
|
|
161
|
+
});
|
|
162
|
+
if (typesWithAllColumns.length > 0) {
|
|
163
|
+
options = __assign(__assign({}, baseOptions), { name: "".concat(exportName, "_entities"), sendHidden: false });
|
|
164
|
+
tasks.push((0, mdm_sdk_1.exportData)({
|
|
165
|
+
exportPath: exportPath,
|
|
166
|
+
tenant: tenant,
|
|
167
|
+
options: options,
|
|
168
|
+
includeType: typesWithAllColumns,
|
|
169
|
+
headerOrder: mdm_sdk_1.ExportHeaderOrder.Default
|
|
170
|
+
}));
|
|
171
|
+
jobEntityTypes.push(typesWithAllColumns);
|
|
172
|
+
}
|
|
173
|
+
return [4 /*yield*/, (0, mdm_sdk_1.promiseAllSettled)(tasks)];
|
|
174
|
+
case 1:
|
|
175
|
+
results = _a.sent();
|
|
176
|
+
failedJobs = results.flatMap(function (r, i) { return (r.status === 'rejected' ? jobEntityTypes[i] : []); });
|
|
177
|
+
return [2 /*return*/, {
|
|
178
|
+
failedJobs: failedJobs,
|
|
179
|
+
total: jobEntityTypes.flat().length
|
|
180
|
+
}];
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}); }, [
|
|
184
|
+
exportName,
|
|
185
|
+
fileFormat,
|
|
186
|
+
filter,
|
|
187
|
+
activityFilter,
|
|
188
|
+
isSearchByOv,
|
|
189
|
+
entityTypes,
|
|
190
|
+
columnsByEntityType,
|
|
191
|
+
entityTypesDetails,
|
|
192
|
+
exportPath,
|
|
193
|
+
tenant
|
|
194
|
+
]);
|
|
195
|
+
return {
|
|
196
|
+
exportName: exportName,
|
|
197
|
+
onChangeExportName: handleChangeExportName,
|
|
198
|
+
fileFormat: fileFormat,
|
|
199
|
+
onChangeFileFormat: handleChangeFileFormat,
|
|
200
|
+
formatOptions: formatOptions,
|
|
201
|
+
entityTypesDetails: entityTypesDetails,
|
|
202
|
+
onExport: handleExport
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
exports.useInternalExport = useInternalExport;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SnackbarOrigin } from '@mui/material/Snackbar';
|
|
3
|
+
import { SnackbarPayload } from '../../contexts/SnackbarContext';
|
|
3
4
|
type SnackbarOptions = {
|
|
4
5
|
anchorOrigin?: SnackbarOrigin;
|
|
5
6
|
showDismiss?: boolean;
|
|
@@ -9,6 +10,6 @@ type SnackbarOptions = {
|
|
|
9
10
|
};
|
|
10
11
|
export declare const useSnackbar: ({ anchorOrigin, showDismiss, dismissTitle, autoHideDuration, onDismissClick }?: SnackbarOptions) => {
|
|
11
12
|
SnackbarRenderer: () => React.JSX.Element;
|
|
12
|
-
showSnackbarMessage: (
|
|
13
|
+
showSnackbarMessage: (payload: SnackbarPayload) => void;
|
|
13
14
|
};
|
|
14
15
|
export {};
|
|
@@ -38,9 +38,11 @@ var useSnackbar = function (_a) {
|
|
|
38
38
|
var _b = _a === void 0 ? {} : _a, _c = _b.anchorOrigin, anchorOrigin = _c === void 0 ? { vertical: 'bottom', horizontal: 'center' } : _c, showDismiss = _b.showDismiss, _d = _b.dismissTitle, dismissTitle = _d === void 0 ? ui_i18n_1.default.text('Dismiss') : _d, _e = _b.autoHideDuration, autoHideDuration = _e === void 0 ? FIVE_MINUTES : _e, _f = _b.onDismissClick, onDismissClick = _f === void 0 ? ramda_1.identity : _f;
|
|
39
39
|
var _g = (0, react_1.useState)(false), isOpenSnackbar = _g[0], setIsOpenSnackbar = _g[1];
|
|
40
40
|
var _h = (0, react_1.useState)(''), snackbarMessage = _h[0], setSnackbarMessage = _h[1];
|
|
41
|
+
var _j = (0, react_1.useState)(null), snackbarAction = _j[0], setSnackbarAction = _j[1];
|
|
41
42
|
var closeSnackbar = (0, react_1.useCallback)(function () {
|
|
42
43
|
setIsOpenSnackbar(false);
|
|
43
44
|
setSnackbarMessage('');
|
|
45
|
+
setSnackbarAction(null);
|
|
44
46
|
}, []);
|
|
45
47
|
var handleSnackbarClose = (0, react_1.useCallback)(function (_, reason) {
|
|
46
48
|
if (reason === 'clickaway') {
|
|
@@ -48,15 +50,32 @@ var useSnackbar = function (_a) {
|
|
|
48
50
|
}
|
|
49
51
|
closeSnackbar();
|
|
50
52
|
}, [closeSnackbar]);
|
|
51
|
-
var showSnackbarMessage = (0, react_1.useCallback)(function (
|
|
53
|
+
var showSnackbarMessage = (0, react_1.useCallback)(function (payload) {
|
|
54
|
+
if (typeof payload === 'object' && 'message' in payload && 'action' in payload) {
|
|
55
|
+
setSnackbarMessage(payload.message);
|
|
56
|
+
setSnackbarAction(payload.action);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
setSnackbarMessage(payload);
|
|
60
|
+
setSnackbarAction(null);
|
|
61
|
+
}
|
|
52
62
|
setIsOpenSnackbar(true);
|
|
53
|
-
setSnackbarMessage(message);
|
|
54
63
|
}, []);
|
|
64
|
+
var handleDismissClick = (0, react_1.useCallback)(function () {
|
|
65
|
+
closeSnackbar();
|
|
66
|
+
onDismissClick();
|
|
67
|
+
}, [closeSnackbar, onDismissClick]);
|
|
68
|
+
var handleSnackbarActionClick = (0, react_1.useCallback)(function () {
|
|
69
|
+
closeSnackbar();
|
|
70
|
+
snackbarAction === null || snackbarAction === void 0 ? void 0 : snackbarAction.onClick();
|
|
71
|
+
}, [closeSnackbar, snackbarAction]);
|
|
55
72
|
var SnackbarRenderer = (0, react_1.useCallback)(function () {
|
|
56
73
|
return (react_1.default.createElement(Portal_1.default, { container: document.body },
|
|
57
|
-
react_1.default.createElement(Snackbar_1.default, { open: isOpenSnackbar, anchorOrigin: anchorOrigin, autoHideDuration: autoHideDuration, onClose: handleSnackbarClose, message: snackbarMessage, style: { maxWidth: 500 }, action: showDismiss ? (react_1.default.createElement(
|
|
74
|
+
react_1.default.createElement(Snackbar_1.default, { open: isOpenSnackbar, anchorOrigin: anchorOrigin, autoHideDuration: autoHideDuration, onClose: handleSnackbarClose, message: snackbarMessage, style: { maxWidth: 500 }, action: showDismiss || snackbarAction ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
75
|
+
showDismiss && (react_1.default.createElement(Button_1.default, { color: "primary", onClick: handleDismissClick }, dismissTitle)),
|
|
76
|
+
snackbarAction && (react_1.default.createElement(Button_1.default, { color: "primary", onClick: handleSnackbarActionClick }, snackbarAction.label)))) : undefined })));
|
|
58
77
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
|
-
}, [isOpenSnackbar, closeSnackbar, snackbarMessage]);
|
|
78
|
+
}, [isOpenSnackbar, closeSnackbar, snackbarMessage, snackbarAction]);
|
|
60
79
|
return { SnackbarRenderer: SnackbarRenderer, showSnackbarMessage: showSnackbarMessage };
|
|
61
80
|
};
|
|
62
81
|
exports.useSnackbar = useSnackbar;
|
package/cjs/index.d.ts
CHANGED
|
@@ -196,6 +196,7 @@ export { FacetGroupTitle } from './FacetGroupTitle';
|
|
|
196
196
|
export { FacetsSelector } from './FacetsSelector';
|
|
197
197
|
export { FacetContainer } from './FacetContainer';
|
|
198
198
|
export { RequestedData } from './RequestedData';
|
|
199
|
+
export { ExportDialog } from './ExportDialog';
|
|
199
200
|
export { CollaborationButton } from './CollaborationButton';
|
|
200
201
|
export { withTooltip } from './HOCs/withTooltip';
|
|
201
202
|
export { withAsyncMount } from './HOCs/withAsyncMount';
|
|
@@ -296,6 +297,7 @@ export { useDynamicYAxisWidth } from './hooks/useDynamicYAxisWidth';
|
|
|
296
297
|
export { useDndBasicTableScrollModifier } from './hooks/useDndBasicTableScrollModifier';
|
|
297
298
|
export { useSegmentsLoader } from './hooks/useSegmentsLoader';
|
|
298
299
|
export { useTableColumns } from './hooks/useTableColumns';
|
|
300
|
+
export { useInternalExport } from './hooks/useInternalExport';
|
|
299
301
|
export { buildColumnsFilter, buildColumnsSizeById, columnFilterToMdmFilter, defaultGetRowCellHeight, defaultRenderRowCell } from './helpers/basicTable';
|
|
300
302
|
export { enrichDataWithPercents } from './helpers/charts';
|
|
301
303
|
export { showDefaultErrorMessage, showErrorMessage } from './helpers/errors';
|
package/cjs/index.js
CHANGED
|
@@ -18,10 +18,10 @@ exports.NestedAttribute = exports.MoreAttributesButton = exports.InlineReference
|
|
|
18
18
|
exports.ReactSelectMenuList = exports.ReactSelectLoadMoreButton = exports.ReactSelectDropdownIndicatorWithIconButton = exports.ReactSelectDropdownIndicator = exports.Highlighter = exports.HierarchyNodeTitle = exports.HierarchicalAttributeTooltip = exports.HideOnShrink = exports.ExpandableSearchInput = exports.ErrorPopup = exports.ErrorBoundary = exports.SegmentIdLink = exports.EntityUriLink = exports.EntityTypesSelector = exports.EntityTypeIcon = exports.EntityTypeBadge = exports.EntityAvatar = exports.EMPTY_STATE_VARIANTS = exports.EMPTY_STATE_ICONS = exports.EmptyState = exports.Drawer = exports.DataTypeValue = exports.DataTenantBadge = exports.ConnectionRelationTypeSelector = exports.CollaborationItem = exports.ConfirmationDialog = exports.CommentsContainer = exports.ColoredSourceIcon = exports.CollapseButton = exports.TreeChart = exports.TableWithBars = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleAttributeEditor = exports.SimpleAttribute = exports.RowCellChips = exports.RowCellChipWithTooltip = exports.RowCellAutoSizer = exports.RelationTypeSelector = exports.ReferenceAttributeEditor = exports.ReferenceAttribute = exports.ImageAttributesLine = exports.ReadOnlyAttributesPager = exports.ReadOnlyAttributesList = exports.ReadOnlyAttribute = exports.ReadOnlyAttributeValuesBlock = exports.PieChart = exports.OvIcon = exports.NestedAttributeEditor = void 0;
|
|
19
19
|
exports.LoadingSpinner = exports.Link = exports.LinearLoadIndicator = exports.ImportButton = exports.ReadableSearchQueryBuilder = exports.ReadableSearchQuery = exports.LogicOperatorWithPlaceholder = exports.LogicOperator = exports.TableSkeleton = exports.StepNavigation = exports.TenantLabel = exports.RelevanceScoreBadge = exports.RequiredMark = exports.SettingsMenu = exports.TenantsDropDownSelector = exports.TenantIcon = exports.SourceSystemsSelector = exports.MatchRulesSelector = exports.MultiValueSelector = exports.ProfilesList = exports.NotMatchButton = exports.MergeButton = exports.ProfileMatchCard = exports.ImageGalleryDialog = exports.RelationTypesSelector = exports.ScreenProfileBand = exports.ProfileBandNavigation = exports.EmptyStub = exports.MaskingSwitcher = exports.FileTypeEditor = exports.EmptySearchResult = exports.DropDownEditor = exports.FilterValueEditor = exports.MultiValueChip = exports.TextEditor = exports.DateRangeEditor = exports.NumberEditor = exports.DataTypeValueEditor = exports.DateEditor = exports.ErrorWrapper = exports.ErrorMessage = exports.HIDE = exports.INSERT_RIGHT = exports.INSERT_LEFT = exports.ConfigColumnPopup = exports.ConfigureColumnsPopup = exports.ConnectionEditor = exports.DropDownSelector = exports.ReactSelectOptionWithCheckIcon = exports.ReactSelectMenuWithPopper = void 0;
|
|
20
20
|
exports.DefaultHeadCellRendererWithTooltip = exports.LazyRenderer = exports.MetadataTypesSelector = exports.DateRangeSelector = exports.UpSetChart = exports.GaugeChart = exports.RelationEditor = exports.ReltioMap = exports.Marginator = exports.LightArrowTooltip = exports.ScrollableTabs = exports.VirtualGroupedList = exports.ViewMoreToggle = exports.VerticalHeadingsTable = exports.VerticalDivider = exports.AttributeTitle = exports.Spacer = exports.SimpleDropDownSelector = exports.SidePanelContentHeader = exports.SidePanel = exports.SidePanelEmptyState = exports.SideButtonsPanel = exports.SelectorWithOnlyOptionAutoSelect = exports.SelectionPopup = exports.WhiteSearchInput = exports.SearchInput = exports.ProfileResizablePanes = exports.ResizablePanes = exports.ReltioGridLayout = exports.RCTreeSwitchRenderer = exports.RCTreeLevelLines = exports.RCTree = exports.reactSortableTreeHelpers = exports.ReactSortableTree = exports.MultiSelect = exports.QueryBuilderRowsGroup = exports.QueryBuilderRow = exports.ProfileCard = exports.ProfileBand = exports.PotentialMatchReviewCard = exports.PopupWithArrow = exports.Popper = exports.MultipleInput = exports.ModeSwitcherSelect = exports.ModeSwitcher = exports.TransitiveMatchBlock = exports.SimpleMatchRulesBuilder = exports.SimpleMatchRulesBlock = exports.SimpleMatchRules = exports.MatchRulesBlock = void 0;
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.mockComputedStyles = exports.FakeMouseEvent = exports.rerenderWrapper = exports.mockElementSizes = exports.fixClicksOnResizablePanes = exports.mockBasicTableSizing = exports.getMuiIconsByName = exports.getMuiIconByName = exports.deepFreeze = exports.awaitMockPromises = exports.TestStylesProvider = exports.TestPerspectivesSettingsProvider = exports.getAttrPathFromColumnId = void 0;
|
|
21
|
+
exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.useEntityLoadingIndication = exports.EntityLoadingIndicationProvider = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.usePerspectivesSettings = exports.PerspectivesSettingsContext = exports.PivotingAttributeContext = exports.UsersContext = exports.InitialCollaborationContextValue = exports.CollaborationContextProvider = exports.CollaborationContext = exports.BlockNavigationContext = exports.BlockImageGalleryDialogContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = exports.MdmModuleProvider = exports.withColumnConfigurator = exports.withBlockNavigation = exports.withCollapseButton = exports.withTableContext = exports.withFilterAtBottom = exports.withPercents = exports.withContext = exports.withDateRangeSelector = exports.withDragHandle = exports.withAsyncMount = exports.withTooltip = exports.CollaborationButton = exports.ExportDialog = exports.RequestedData = exports.FacetContainer = exports.FacetsSelector = exports.FacetGroupTitle = exports.QuickFiltersEntityTypeFacet = exports.FacetGroup = exports.QuickFiltersFacetPanel = exports.AdvancedSearchFabButton = exports.QuickFiltersDrawer = void 0;
|
|
22
|
+
exports.useRunOnceAfterValueInitialization = exports.useRelationsLoader = exports.useRelationTypeSelector = exports.usePrevious = exports.useDidUpdateEffect = exports.useCommentsEntitiesMap = exports.useCollaboration = exports.useAsyncMount = exports.useAPI = exports.useActions = exports.useMatchesColumnsData = exports.useScrollToAttributeError = exports.ThemeProvider = exports.ProfileTablesContext = exports.HiddenAttributesContext = exports.BasicTableContext = exports.BasicTableRowCollapseContext = exports.useDeleteUnmaskedAttributeForRelation = exports.useUnmaskedAttributeValue = exports.useUnmaskAttributeValue = exports.useMaskAttributeValue = exports.MaskedAttributesProvider = exports.useReloadData = exports.ReloadDataProvider = exports.useAttributeValueConfigPermissions = exports.ConfigPermissionsContextProvider = exports.ConfigPermissionsContext = exports.useActionsHook = exports.ActionsHookProvider = exports.PageRequestsAbortingContext = exports.DependentLookupAutopopulationContext = exports.FeaturesContext = exports.LabelsContext = exports.UrlGeneratorsContext = exports.isHighlightedAttributeType = exports.isHighlightedErrorType = exports.ScrollType = exports.ScrollToElementProvider = exports.ScrollToElementContext = exports.SearchValueContext = exports.InterceptHandlersContext = exports.HighlightedValuesContext = exports.SnackbarContext = exports.SearchFiltersContext = exports.useReloadFacet = exports.ReloadFacetProvider = exports.useReloadAllFacets = exports.SandboxAPIContext = exports.RelationContext = exports.EntityContext = void 0;
|
|
23
|
+
exports.applyCompactValuesCountConstraint = exports.getAttributeSelectorItems = exports.mergeClasses = exports.isControlOrCommandPressed = exports.getValue = exports.getChecked = exports.showErrorMessage = exports.showDefaultErrorMessage = exports.enrichDataWithPercents = exports.defaultRenderRowCell = exports.defaultGetRowCellHeight = exports.columnFilterToMdmFilter = exports.buildColumnsSizeById = exports.buildColumnsFilter = exports.useInternalExport = exports.useTableColumns = exports.useSegmentsLoader = exports.useDndBasicTableScrollModifier = exports.useDynamicYAxisWidth = exports.useFilterAutoFocus = exports.useSegmentationRequest = exports.resolveMarkers = exports.useMarkers = exports.useMaskedAttribute = exports.useKeyboardNavigation = exports.useDynamicRowCellHeight = exports.useClickableStyle = exports.BasicTableCellRenderer = exports.useBasicTableCellRenderer = exports.useHiddenAttributes = exports.useSavedSearchesRequest = exports.useRequestDCRReview = exports.useAutoFocus = exports.useExpandInvalidRelations = exports.useLayoutResetter = exports.useIsMountedRef = exports.useSnackbar = exports.useSavedStateForEntityType = exports.useReadableSearchState = exports.useEditableConnection = exports.useCustomScripts = exports.useMarkAsNotMatchRequest = exports.useMergeAllRequest = exports.usePagingSimulator = exports.useMatchesLoader = exports.useConfigPermissions = exports.useWhyDidYouUpdate = exports.useUsers = exports.useSavedState = exports.useSafePromise = void 0;
|
|
24
|
+
exports.mockComputedStyles = exports.FakeMouseEvent = exports.rerenderWrapper = exports.mockElementSizes = exports.fixClicksOnResizablePanes = exports.mockBasicTableSizing = exports.getMuiIconsByName = exports.getMuiIconByName = exports.deepFreeze = exports.awaitMockPromises = exports.TestStylesProvider = exports.TestPerspectivesSettingsProvider = exports.getAttrPathFromColumnId = exports.getAttributeHeight = exports.getNestedPathByColumnId = void 0;
|
|
25
25
|
// components
|
|
26
26
|
var ActionButton_1 = require("./ActionButton");
|
|
27
27
|
Object.defineProperty(exports, "ActionButton", { enumerable: true, get: function () { return ActionButton_1.ActionButton; } });
|
|
@@ -429,6 +429,8 @@ var FacetContainer_1 = require("./FacetContainer");
|
|
|
429
429
|
Object.defineProperty(exports, "FacetContainer", { enumerable: true, get: function () { return FacetContainer_1.FacetContainer; } });
|
|
430
430
|
var RequestedData_1 = require("./RequestedData");
|
|
431
431
|
Object.defineProperty(exports, "RequestedData", { enumerable: true, get: function () { return RequestedData_1.RequestedData; } });
|
|
432
|
+
var ExportDialog_1 = require("./ExportDialog");
|
|
433
|
+
Object.defineProperty(exports, "ExportDialog", { enumerable: true, get: function () { return ExportDialog_1.ExportDialog; } });
|
|
432
434
|
var CollaborationButton_1 = require("./CollaborationButton");
|
|
433
435
|
Object.defineProperty(exports, "CollaborationButton", { enumerable: true, get: function () { return CollaborationButton_1.CollaborationButton; } });
|
|
434
436
|
// HOCs
|
|
@@ -657,6 +659,8 @@ var useSegmentsLoader_1 = require("./hooks/useSegmentsLoader");
|
|
|
657
659
|
Object.defineProperty(exports, "useSegmentsLoader", { enumerable: true, get: function () { return useSegmentsLoader_1.useSegmentsLoader; } });
|
|
658
660
|
var useTableColumns_1 = require("./hooks/useTableColumns");
|
|
659
661
|
Object.defineProperty(exports, "useTableColumns", { enumerable: true, get: function () { return useTableColumns_1.useTableColumns; } });
|
|
662
|
+
var useInternalExport_1 = require("./hooks/useInternalExport");
|
|
663
|
+
Object.defineProperty(exports, "useInternalExport", { enumerable: true, get: function () { return useInternalExport_1.useInternalExport; } });
|
|
660
664
|
// helpers
|
|
661
665
|
var basicTable_1 = require("./helpers/basicTable");
|
|
662
666
|
Object.defineProperty(exports, "buildColumnsFilter", { enumerable: true, get: function () { return basicTable_1.buildColumnsFilter; } });
|
|
@@ -59,6 +59,7 @@ export type MdmModuleValuesContextProps = Partial<{
|
|
|
59
59
|
showMasking: boolean;
|
|
60
60
|
reviewDCREnabled: boolean;
|
|
61
61
|
dcrReviewValidation: boolean;
|
|
62
|
+
canUserMakeExport: boolean;
|
|
62
63
|
}>;
|
|
63
64
|
export type MdmModuleActionsContextProps = Partial<{
|
|
64
65
|
openSearch: (payload: SearchState) => void;
|
|
@@ -274,6 +275,7 @@ export declare const MdmModuleValuesContext: import("@fluentui/react-context-sel
|
|
|
274
275
|
showMasking: boolean;
|
|
275
276
|
reviewDCREnabled: boolean;
|
|
276
277
|
dcrReviewValidation: boolean;
|
|
278
|
+
canUserMakeExport: boolean;
|
|
277
279
|
}>>;
|
|
278
280
|
export declare const MdmModuleListenersContext: import("@fluentui/react-context-selector").Context<Partial<{
|
|
279
281
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -158,3 +158,4 @@ export declare const useMdmControlAttributes: () => string[];
|
|
|
158
158
|
export declare const useMdmShowMasking: () => boolean;
|
|
159
159
|
export declare const useMdmReviewDCREnabled: () => boolean;
|
|
160
160
|
export declare const useMdmDcrReviewValidation: () => boolean;
|
|
161
|
+
export declare const useMdmCanUserMakeExport: () => boolean;
|
|
@@ -163,3 +163,4 @@ export var useMdmControlAttributes = function () {
|
|
|
163
163
|
export var useMdmShowMasking = function () { return useMdmModuleValuesContext(function (context) { return context.showMasking; }); };
|
|
164
164
|
export var useMdmReviewDCREnabled = function () { return useMdmModuleValuesContext(function (context) { return context.reviewDCREnabled; }); };
|
|
165
165
|
export var useMdmDcrReviewValidation = function () { return useMdmModuleValuesContext(function (context) { return context.dcrReviewValidation; }); };
|
|
166
|
+
export var useMdmCanUserMakeExport = function () { return useMdmModuleValuesContext(function (context) { return context.canUserMakeExport; }); };
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export type SnackbarPayload = string | ReactNode | {
|
|
3
|
+
message: string;
|
|
4
|
+
action?: {
|
|
5
|
+
label: string;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const SnackbarContext: React.Context<(payload: SnackbarPayload) => void>;
|
|
@@ -4,6 +4,7 @@ export declare const HistoryCircleWithTooltip: React.ForwardRefExoticComponent<O
|
|
|
4
4
|
tooltipTitle?: import("@mui/material").TooltipProps["title"];
|
|
5
5
|
tooltipPlacement?: import("@mui/material").TooltipProps["placement"];
|
|
6
6
|
showForDisabled?: boolean;
|
|
7
|
+
tooltipClassName?: string;
|
|
7
8
|
} & Omit<{
|
|
8
9
|
x: number;
|
|
9
10
|
y: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"caption" | "disabled" | "title" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"caption" | "disabled" | "title" | "dialogContent" | "currentAssignee" | "dialogText">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useExportController } from './useExportController';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useExportController } from './useExportController';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
canExport: boolean;
|
|
3
|
+
internalExportEnabled: boolean;
|
|
4
|
+
onInternalExport: () => void;
|
|
5
|
+
onExternalExport: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const useExportController: ({ canExport, internalExportEnabled, onInternalExport, onExternalExport }: Props) => {
|
|
8
|
+
hasExport: boolean;
|
|
9
|
+
onExport: () => void;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useMdmCanUserMakeExport } from '../../contexts/MdmModuleContext/hooks';
|
|
3
|
+
export var useExportController = function (_a) {
|
|
4
|
+
var canExport = _a.canExport, internalExportEnabled = _a.internalExportEnabled, onInternalExport = _a.onInternalExport, onExternalExport = _a.onExternalExport;
|
|
5
|
+
var canUserMakeExport = useMdmCanUserMakeExport();
|
|
6
|
+
var hasExport = canExport && canUserMakeExport;
|
|
7
|
+
var onExport = useCallback(function () {
|
|
8
|
+
if (internalExportEnabled) {
|
|
9
|
+
onInternalExport();
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
onExternalExport();
|
|
13
|
+
}
|
|
14
|
+
}, [internalExportEnabled, onInternalExport, onExternalExport]);
|
|
15
|
+
return { hasExport: hasExport, onExport: onExport };
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useInternalExport } from './useInternalExport';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useInternalExport } from './useInternalExport';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ActivityFilter } from '@reltio/mdm-sdk';
|
|
2
|
+
declare enum ExportFormat {
|
|
3
|
+
CSVFlattened = "csvFlattened",
|
|
4
|
+
CSVExploded = "csvExploded",
|
|
5
|
+
JSON = "json"
|
|
6
|
+
}
|
|
7
|
+
type ExportFormatOption = {
|
|
8
|
+
value: ExportFormat;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
type EntityTypeSummary = Record<string, {
|
|
12
|
+
totalAttributesCount: number;
|
|
13
|
+
selectedAttributesCount: number;
|
|
14
|
+
label: string;
|
|
15
|
+
}>;
|
|
16
|
+
type Props = {
|
|
17
|
+
dialogOpen: boolean;
|
|
18
|
+
columnsByEntityType: Record<string, string[]>;
|
|
19
|
+
filter: string;
|
|
20
|
+
activityFilter: ActivityFilter;
|
|
21
|
+
isSearchByOv: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const useInternalExport: ({ columnsByEntityType, dialogOpen, filter, activityFilter, isSearchByOv }: Props) => {
|
|
24
|
+
exportName: string;
|
|
25
|
+
onChangeExportName: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
26
|
+
fileFormat: ExportFormatOption;
|
|
27
|
+
onChangeFileFormat: (value: ExportFormatOption) => void;
|
|
28
|
+
formatOptions: ExportFormatOption[];
|
|
29
|
+
entityTypesDetails: EntityTypeSummary;
|
|
30
|
+
onExport: () => Promise<{
|
|
31
|
+
failedJobs: string[];
|
|
32
|
+
total: number;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
export {};
|