@reltio/components 1.4.2215 → 1.4.2217
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/AttributeVerificationStatus/AttributeVerificationStatus.d.ts +8 -0
- package/AttributeVerificationStatus/AttributeVerificationStatus.js +22 -0
- package/AttributeVerificationStatus/AttributeVerificationStatus.module.css.js +9 -0
- package/AttributeVerificationStatus/helpers.d.ts +8 -0
- package/AttributeVerificationStatus/helpers.js +56 -0
- package/CollaborationButton/CollaborationButton.d.ts +4 -0
- package/CollaborationButton/CollaborationButton.js +12 -0
- package/CollaborationButton/CollaborationButton.module.css.js +9 -0
- package/CollaborationButton/index.d.ts +1 -0
- package/CollaborationButton/index.js +1 -0
- package/ProfileResizablePanes/ProfileResizablePanes.js +2 -1
- package/ProfileResizablePanes/ProfileResizablePanes.spec.js +3 -3
- package/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +8 -2
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +10 -3
- package/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.module.css.js +9 -0
- package/VerificationButton/VerificationButton.d.ts +13 -0
- package/VerificationButton/VerificationButton.js +150 -0
- package/VerificationButton/VerificationButton.module.css.js +9 -0
- package/cjs/AttributeVerificationStatus/AttributeVerificationStatus.d.ts +8 -0
- package/cjs/AttributeVerificationStatus/AttributeVerificationStatus.js +52 -0
- package/cjs/AttributeVerificationStatus/AttributeVerificationStatus.module.css.js +9 -0
- package/cjs/AttributeVerificationStatus/helpers.d.ts +8 -0
- package/cjs/AttributeVerificationStatus/helpers.js +64 -0
- package/cjs/CollaborationButton/CollaborationButton.d.ts +4 -0
- package/cjs/CollaborationButton/CollaborationButton.js +19 -0
- package/cjs/CollaborationButton/CollaborationButton.module.css.js +9 -0
- package/cjs/CollaborationButton/index.d.ts +1 -0
- package/cjs/CollaborationButton/index.js +5 -0
- package/cjs/ProfileResizablePanes/ProfileResizablePanes.js +2 -1
- package/cjs/ProfileResizablePanes/ProfileResizablePanes.spec.js +3 -3
- package/cjs/ReadOnlyAttributesPager/components/MultiLineRenderer/MultiLineRenderer.js +7 -1
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +15 -8
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.module.css.js +9 -0
- package/cjs/VerificationButton/VerificationButton.d.ts +13 -0
- package/cjs/VerificationButton/VerificationButton.js +180 -0
- package/cjs/VerificationButton/VerificationButton.module.css.js +9 -0
- package/cjs/contexts/AttributesVerificationContext/helpers.d.ts +17 -0
- package/cjs/contexts/AttributesVerificationContext/helpers.js +137 -0
- package/cjs/contexts/AttributesVerificationContext/index.d.ts +19 -0
- package/cjs/contexts/AttributesVerificationContext/index.js +72 -0
- package/cjs/contexts/MdmModuleContext/context.d.ts +8 -0
- package/cjs/contexts/MdmModuleContext/hooks.d.ts +4 -0
- package/cjs/features/workflow/WorkflowComments/WorkflowComments.d.ts +3 -2
- package/cjs/features/workflow/WorkflowComments/WorkflowComments.js +3 -2
- package/cjs/features/workflow/hooks/useWorkflowComments.d.ts +4 -2
- package/cjs/features/workflow/hooks/useWorkflowComments.js +3 -2
- package/cjs/icons/VerificationInvalidIcon.d.ts +3 -0
- package/cjs/icons/VerificationInvalidIcon.js +22 -0
- package/cjs/icons/VerificationMaybeIcon.d.ts +3 -0
- package/cjs/icons/VerificationMaybeIcon.js +22 -0
- package/cjs/icons/VerificationOutdatedIcon.d.ts +3 -0
- package/cjs/icons/VerificationOutdatedIcon.js +22 -0
- package/cjs/icons/VerificationValidIcon.d.ts +3 -0
- package/cjs/icons/VerificationValidIcon.js +22 -0
- package/cjs/icons/VerifyAllIcon.d.ts +3 -0
- package/cjs/icons/VerifyAllIcon.js +26 -0
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +6 -4
- package/contexts/AttributesVerificationContext/helpers.d.ts +17 -0
- package/contexts/AttributesVerificationContext/helpers.js +126 -0
- package/contexts/AttributesVerificationContext/index.d.ts +19 -0
- package/contexts/AttributesVerificationContext/index.js +45 -0
- package/contexts/MdmModuleContext/context.d.ts +8 -0
- package/contexts/MdmModuleContext/hooks.d.ts +4 -0
- package/features/workflow/WorkflowComments/WorkflowComments.d.ts +3 -2
- package/features/workflow/WorkflowComments/WorkflowComments.js +3 -2
- package/features/workflow/hooks/useWorkflowComments.d.ts +4 -2
- package/features/workflow/hooks/useWorkflowComments.js +3 -2
- package/icons/VerificationInvalidIcon.d.ts +3 -0
- package/icons/VerificationInvalidIcon.js +17 -0
- package/icons/VerificationMaybeIcon.d.ts +3 -0
- package/icons/VerificationMaybeIcon.js +17 -0
- package/icons/VerificationOutdatedIcon.d.ts +3 -0
- package/icons/VerificationOutdatedIcon.js +17 -0
- package/icons/VerificationValidIcon.d.ts +3 -0
- package/icons/VerificationValidIcon.js +17 -0
- package/icons/VerifyAllIcon.d.ts +3 -0
- package/icons/VerifyAllIcon.js +21 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +2 -2
- package/ReadOnlyComplexAttribute/styles.d.ts +0 -1
- package/ReadOnlyComplexAttribute/styles.js +0 -22
- package/cjs/ReadOnlyComplexAttribute/styles.d.ts +0 -1
- package/cjs/ReadOnlyComplexAttribute/styles.js +0 -25
|
@@ -130,6 +130,10 @@ export type MdmModuleActionsContextProps = Partial<{
|
|
|
130
130
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
131
131
|
resetHiddenAttributes: (uri: string) => void;
|
|
132
132
|
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
133
|
+
updateEntityAttributeValues: (payload: {
|
|
134
|
+
updatedEntity: Entity;
|
|
135
|
+
attributeTypeUris: string[];
|
|
136
|
+
}) => void;
|
|
133
137
|
}>;
|
|
134
138
|
export type MdmModuleListenersContextProps = Partial<{
|
|
135
139
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -206,6 +210,10 @@ export declare const MdmModuleActionsContext: import("@fluentui/react-context-se
|
|
|
206
210
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
207
211
|
resetHiddenAttributes: (uri: string) => void;
|
|
208
212
|
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
213
|
+
updateEntityAttributeValues: (payload: {
|
|
214
|
+
updatedEntity: Entity;
|
|
215
|
+
attributeTypeUris: string[];
|
|
216
|
+
}) => void;
|
|
209
217
|
}>>;
|
|
210
218
|
export declare const MdmModuleValuesContext: import("@fluentui/react-context-selector").Context<Partial<{
|
|
211
219
|
autoCloseInterval: number;
|
|
@@ -143,6 +143,10 @@ export declare const useMdmAction: <T extends keyof MdmModuleActionsContextProps
|
|
|
143
143
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
144
144
|
resetHiddenAttributes: (uri: string) => void;
|
|
145
145
|
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
146
|
+
updateEntityAttributeValues: (payload: {
|
|
147
|
+
updatedEntity: import("@reltio/mdm-sdk").Entity;
|
|
148
|
+
attributeTypeUris: string[];
|
|
149
|
+
}) => void;
|
|
146
150
|
}>[T];
|
|
147
151
|
export declare const useMdmListener: <T extends keyof MdmModuleListenersContextProps>(listener: T) => Partial<{
|
|
148
152
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WorkflowAction, WorkflowComment } from '@reltio/mdm-sdk';
|
|
2
|
+
import { WorkflowAction, WorkflowComment, WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
3
3
|
import { TaskAction } from '../types';
|
|
4
4
|
type Props = {
|
|
5
5
|
actionRequestIsInProgress?: boolean;
|
|
@@ -14,6 +14,7 @@ type Props = {
|
|
|
14
14
|
container?: string;
|
|
15
15
|
commentsContainer?: string;
|
|
16
16
|
};
|
|
17
|
+
onCommentWrite?: (taskFields: Pick<WorkflowTaskData, 'processInstanceComments'>) => void;
|
|
17
18
|
};
|
|
18
|
-
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction, showActionButtons, alwaysExpanded, classes }: Props) => React.JSX.Element;
|
|
19
|
+
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction, showActionButtons, alwaysExpanded, classes, onCommentWrite }: Props) => React.JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -40,13 +40,14 @@ var SmallIconButton_1 = require("../../../SmallIconButton");
|
|
|
40
40
|
var WorkflowActionButtons_1 = require("../WorkflowActionButtons");
|
|
41
41
|
var WorkflowComments_module_css_1 = __importDefault(require("./WorkflowComments.module.css"));
|
|
42
42
|
var WorkflowComments = function (_a) {
|
|
43
|
-
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction, _b = _a.showActionButtons, showActionButtons = _b === void 0 ? true : _b, _c = _a.alwaysExpanded, alwaysExpanded = _c === void 0 ? false : _c, classes = _a.classes;
|
|
43
|
+
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction, _b = _a.showActionButtons, showActionButtons = _b === void 0 ? true : _b, _c = _a.alwaysExpanded, alwaysExpanded = _c === void 0 ? false : _c, classes = _a.classes, onCommentWrite = _a.onCommentWrite;
|
|
44
44
|
var _d = (0, react_1.useState)(false), expanded = _d[0], setExpanded = _d[1];
|
|
45
45
|
var _e = (0, react_1.useState)(''), comment = _e[0], setComment = _e[1];
|
|
46
46
|
var _f = (0, useWorkflowComments_1.useWorkflowComments)({
|
|
47
47
|
processInstanceComments: processInstanceComments,
|
|
48
48
|
taskId: taskId,
|
|
49
|
-
isOpen: isTaskOpen
|
|
49
|
+
isOpen: isTaskOpen,
|
|
50
|
+
onCommentWrite: onCommentWrite
|
|
50
51
|
}), comments = _f.comments, writeComment = _f.writeComment, readOnly = _f.readOnly;
|
|
51
52
|
var sendComment = (0, react_1.useCallback)(function () {
|
|
52
53
|
writeComment(comment);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
2
|
-
type Props = Pick<WorkflowTaskData, 'processInstanceComments' | 'taskId' | 'isOpen'
|
|
3
|
-
|
|
2
|
+
type Props = Pick<WorkflowTaskData, 'processInstanceComments' | 'taskId' | 'isOpen'> & {
|
|
3
|
+
onCommentWrite?: (taskFields: Pick<WorkflowTaskData, 'processInstanceComments'>) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const useWorkflowComments: ({ processInstanceComments, taskId, isOpen, onCommentWrite }: Props) => {
|
|
4
6
|
comments: any[];
|
|
5
7
|
requestIsInProgress: boolean;
|
|
6
8
|
writeComment: (comment: any) => void;
|
|
@@ -10,7 +10,7 @@ var common_1 = require("../helpers/common");
|
|
|
10
10
|
var useWorkflowCheckPermission_1 = require("./useWorkflowCheckPermission");
|
|
11
11
|
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
|
|
12
12
|
var useWorkflowComments = function (_a) {
|
|
13
|
-
var processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isOpen = _a.isOpen;
|
|
13
|
+
var processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isOpen = _a.isOpen, onCommentWrite = _a.onCommentWrite;
|
|
14
14
|
var updateTaskState = ((0, react_1.useContext)(WorkflowTasksContext_1.WorkflowTasksContext) || {}).updateTaskState;
|
|
15
15
|
var workflowPath = (0, MdmModuleContext_1.useMdmWorkflowPath)();
|
|
16
16
|
var environment = (0, MdmModuleContext_1.useMdmWorkflowEnvironmentUrl)();
|
|
@@ -44,11 +44,12 @@ var useWorkflowComments = function (_a) {
|
|
|
44
44
|
var processInstanceComments = _a.processInstanceComments;
|
|
45
45
|
setComments(processInstanceComments || []);
|
|
46
46
|
updateTaskState === null || updateTaskState === void 0 ? void 0 : updateTaskState(taskId, { processInstanceComments: processInstanceComments });
|
|
47
|
+
onCommentWrite === null || onCommentWrite === void 0 ? void 0 : onCommentWrite({ processInstanceComments: processInstanceComments });
|
|
47
48
|
})
|
|
48
49
|
.catch(errors_1.showWorkflowError)
|
|
49
50
|
.finally(function () { return setRequestIsInProgress(false); });
|
|
50
51
|
}
|
|
51
|
-
}, [environment, taskId, tenant, workflowPath, safePromise, updateTaskState, canUpdateTask]);
|
|
52
|
+
}, [environment, taskId, tenant, workflowPath, safePromise, updateTaskState, canUpdateTask, onCommentWrite]);
|
|
52
53
|
return { comments: comments, requestIsInProgress: requestIsInProgress, writeComment: writeComment, readOnly: !canUpdateTask };
|
|
53
54
|
};
|
|
54
55
|
exports.useWorkflowComments = useWorkflowComments;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var VerificationInvalidIcon = function (props) {
|
|
19
|
+
return (react_1.default.createElement("svg", __assign({ width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-reltio-id": "SvgVerificationInvalidIcon" }, props),
|
|
20
|
+
react_1.default.createElement("path", { d: "M6.66667 0C2.98 0 0 2.98 0 6.66667C0 10.3533 2.98 13.3333 6.66667 13.3333C10.3533 13.3333 13.3333 10.3533 13.3333 6.66667C13.3333 2.98 10.3533 0 6.66667 0ZM10 9.06L9.06 10L6.66667 7.60667L4.27333 10L3.33333 9.06L5.72667 6.66667L3.33333 4.27333L4.27333 3.33333L6.66667 5.72667L9.06 3.33333L10 4.27333L7.60667 6.66667L10 9.06Z", fill: "#EB5757" })));
|
|
21
|
+
};
|
|
22
|
+
exports.default = VerificationInvalidIcon;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var VerificationMaybeIcon = function (props) {
|
|
19
|
+
return (react_1.default.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "data-reltio-id": "SvgMaybeIcon" }, props),
|
|
20
|
+
react_1.default.createElement("path", { d: "M6.66667 0C2.98667 0 0 2.98667 0 6.66667C0 10.3467 2.98667 13.3333 6.66667 13.3333C10.3467 13.3333 13.3333 10.3467 13.3333 6.66667C13.3333 2.98667 10.3467 0 6.66667 0ZM7.33333 11.3333H6V10H7.33333V11.3333ZM8.71333 6.16667L8.11333 6.78C7.63333 7.26667 7.33333 7.66667 7.33333 8.66667H6V8.33333C6 7.6 6.3 6.93333 6.78 6.44667L7.60667 5.60667C7.85333 5.36667 8 5.03333 8 4.66667C8 3.93333 7.4 3.33333 6.66667 3.33333C5.93333 3.33333 5.33333 3.93333 5.33333 4.66667H4C4 3.19333 5.19333 2 6.66667 2C8.14 2 9.33333 3.19333 9.33333 4.66667C9.33333 5.25333 9.09333 5.78667 8.71333 6.16667Z", fill: "#F9A825" })));
|
|
21
|
+
};
|
|
22
|
+
exports.default = VerificationMaybeIcon;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var VerificationOutdatedIcon = function (props) {
|
|
19
|
+
return (react_1.default.createElement("svg", __assign({ width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-reltio-id": "SvgVerificationOutdatedIcon" }, props),
|
|
20
|
+
react_1.default.createElement("path", { d: "M6.66667 0C2.98667 0 0 2.98667 0 6.66667C0 10.3467 2.98667 13.3333 6.66667 13.3333C10.3467 13.3333 13.3333 10.3467 13.3333 6.66667C13.3333 2.98667 10.3467 0 6.66667 0ZM7.33333 10H6V8.66667H7.33333V10ZM7.33333 7.33333H6V3.33333H7.33333V7.33333Z", fill: "#F2C94C" })));
|
|
21
|
+
};
|
|
22
|
+
exports.default = VerificationOutdatedIcon;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var VerificationValidIcon = function (props) {
|
|
19
|
+
return (react_1.default.createElement("svg", __assign({ width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-reltio-id": "SvgVerificationValidIcon" }, props),
|
|
20
|
+
react_1.default.createElement("path", { d: "M6.66667 0C2.98667 0 0 2.98667 0 6.66667C0 10.3467 2.98667 13.3333 6.66667 13.3333C10.3467 13.3333 13.3333 10.3467 13.3333 6.66667C13.3333 2.98667 10.3467 0 6.66667 0ZM5.33333 10L2 6.66667L2.94 5.72667L5.33333 8.11333L10.3933 3.05333L11.3333 4L5.33333 10Z", fill: "#27AE60" })));
|
|
21
|
+
};
|
|
22
|
+
exports.default = VerificationValidIcon;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var VerifyAllIcon = function (props) {
|
|
19
|
+
return (react_1.default.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "none", "data-reltio-id": "SvgVerifyAllIcon" }, props),
|
|
20
|
+
react_1.default.createElement("g", { clipPath: "url(#clip0_196_3459)" },
|
|
21
|
+
react_1.default.createElement("path", { d: "M1.86621 14.2667H4.59961V15.5997H1.86621C1.13305 15.5996 0.533238 14.9999 0.533203 14.2667V11.5333H1.86621V14.2667ZM15.5996 14.2667C15.5996 15 14.9999 15.5997 14.2666 15.5997H11.5332V14.2667H14.2666V11.5333H15.5996V14.2667ZM11.457 10.422C10.7145 11.7829 9.4738 12.8381 8 13.2003C6.52622 12.838 5.28531 11.783 4.54297 10.422H11.457ZM12.2002 4.74524V7.5636C12.2002 7.93658 12.1627 8.30597 12.0928 8.66711H15.4668V9.53333H0.533203V8.66711H3.9082C3.83828 8.30596 3.80078 7.93659 3.80078 7.5636V4.74524L8 2.86633L12.2002 4.74524ZM4.59961 1.86633H1.86621V4.59973H0.533203V1.86633C0.533381 1.13326 1.13313 0.533503 1.86621 0.533325H4.59961V1.86633ZM14.2666 0.533325C14.9998 0.53336 15.5994 1.13317 15.5996 1.86633V4.59973H14.2666V1.86633H11.5332V0.533325H14.2666Z", fill: "black", fillOpacity: "0.54" })),
|
|
22
|
+
react_1.default.createElement("defs", null,
|
|
23
|
+
react_1.default.createElement("clipPath", { id: "clip0_196_3459" },
|
|
24
|
+
react_1.default.createElement("rect", { width: "16", height: "16", fill: "white" })))));
|
|
25
|
+
};
|
|
26
|
+
exports.default = VerifyAllIcon;
|
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 { CollaborationButton } from './CollaborationButton';
|
|
199
200
|
export { withTooltip } from './HOCs/withTooltip';
|
|
200
201
|
export { withAsyncMount } from './HOCs/withAsyncMount';
|
|
201
202
|
export { withDragHandle } from './HOCs/withDragHandle';
|
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 = void 0;
|
|
21
|
+
exports.EntityContext = 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.RequestedData = exports.FacetContainer = exports.FacetsSelector = exports.FacetGroupTitle = exports.QuickFiltersEntityTypeFacet = exports.FacetGroup = exports.QuickFiltersFacetPanel = exports.AdvancedSearchFabButton = exports.QuickFiltersDrawer = void 0;
|
|
22
|
+
exports.useSafePromise = 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 = void 0;
|
|
23
|
+
exports.getAttributeHeight = exports.getNestedPathByColumnId = 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.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 = 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 = 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 CollaborationButton_1 = require("./CollaborationButton");
|
|
433
|
+
Object.defineProperty(exports, "CollaborationButton", { enumerable: true, get: function () { return CollaborationButton_1.CollaborationButton; } });
|
|
432
434
|
// HOCs
|
|
433
435
|
var withTooltip_1 = require("./HOCs/withTooltip");
|
|
434
436
|
Object.defineProperty(exports, "withTooltip", { enumerable: true, get: function () { return withTooltip_1.withTooltip; } });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AttributeType, AttributeVerificationConfig, NestedAttributeValue, InputVerificationAttribute } from '@reltio/mdm-sdk';
|
|
2
|
+
export declare enum VerificationStatus {
|
|
3
|
+
VALID = "valid",
|
|
4
|
+
INVALID = "invalid",
|
|
5
|
+
OUTDATED = "outdated",
|
|
6
|
+
MAYBE = "maybe",
|
|
7
|
+
ACCEPT_ALL = "accept_all"
|
|
8
|
+
}
|
|
9
|
+
export declare const getIsVerificationAttribute: (attributeType: AttributeType, attributeVerificationConfig: AttributeVerificationConfig[]) => boolean;
|
|
10
|
+
export declare const getVerificationStatus: (attributeType: AttributeType, attributeValue: NestedAttributeValue, attributeVerificationConfig: AttributeVerificationConfig[]) => {
|
|
11
|
+
status: VerificationStatus;
|
|
12
|
+
lastVerifiedTime: number | null;
|
|
13
|
+
verificationType: InputVerificationAttribute;
|
|
14
|
+
} | null;
|
|
15
|
+
export declare const getVerificationType: (attributeType: AttributeType, attributeVerificationConfig: AttributeVerificationConfig[]) => InputVerificationAttribute;
|
|
16
|
+
export declare const getAllVerificationAttributeTypeUris: (attributeVerificationConfig: AttributeVerificationConfig[], entityTypeUri: string) => string[];
|
|
17
|
+
export declare const getAllVerificationTypes: (attributeVerificationConfig: AttributeVerificationConfig[]) => InputVerificationAttribute[];
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import moment from 'moment';
|
|
2
|
+
import { isNil, uniq } from 'ramda';
|
|
3
|
+
import { getParentUri, getOvAttributeValuesByPathWithUri, InputVerificationAttribute, OutputVerificationAttribute, getAttributeTypeUriByValueUri, getEntityUriFromAttributeUri } from '@reltio/mdm-sdk';
|
|
4
|
+
export var VerificationStatus;
|
|
5
|
+
(function (VerificationStatus) {
|
|
6
|
+
VerificationStatus["VALID"] = "valid";
|
|
7
|
+
VerificationStatus["INVALID"] = "invalid";
|
|
8
|
+
VerificationStatus["OUTDATED"] = "outdated";
|
|
9
|
+
VerificationStatus["MAYBE"] = "maybe";
|
|
10
|
+
VerificationStatus["ACCEPT_ALL"] = "accept_all";
|
|
11
|
+
})(VerificationStatus || (VerificationStatus = {}));
|
|
12
|
+
var findValueByAttributeUri = function (attributeValue, attributeUri) {
|
|
13
|
+
var _a;
|
|
14
|
+
var entityTypeUri = getEntityUriFromAttributeUri(attributeUri);
|
|
15
|
+
var currentValueUriPath = getAttributeTypeUriByValueUri(attributeValue.uri, entityTypeUri);
|
|
16
|
+
if (!attributeUri.startsWith("".concat(currentValueUriPath, "/attributes/"))) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
var attrPath = attributeUri.replace("".concat(currentValueUriPath, "/attributes/"), '').split('/attributes/');
|
|
20
|
+
return ((_a = getOvAttributeValuesByPathWithUri(attrPath, attributeValue.value)) === null || _a === void 0 ? void 0 : _a[0]) || undefined;
|
|
21
|
+
};
|
|
22
|
+
var findAttributeConfig = function (attributeVerificationConfig, attributeType) {
|
|
23
|
+
return attributeVerificationConfig.find(function (config) {
|
|
24
|
+
return config.inputMapping.some(function (mapping) { return getParentUri(mapping.attribute) === attributeType.uri; });
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
var findMappingByVerificationAttribute = function (config, verificationAttributes) {
|
|
28
|
+
return config.outputMapping.find(function (mapping) { return verificationAttributes.includes(mapping.verificationAttribute); });
|
|
29
|
+
};
|
|
30
|
+
export var getIsVerificationAttribute = function (attributeType, attributeVerificationConfig) {
|
|
31
|
+
return attributeVerificationConfig.some(function (config) {
|
|
32
|
+
return config.inputMapping.some(function (mapping) {
|
|
33
|
+
return getParentUri(mapping.attribute) === attributeType.uri &&
|
|
34
|
+
Object.keys(InputVerificationAttribute).includes(mapping.verificationAttribute);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var isStatusOutdated = function (dateValue, config) {
|
|
39
|
+
if (isNil(dateValue)) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
var verifDate = moment(dateValue);
|
|
43
|
+
if (!(verifDate === null || verifDate === void 0 ? void 0 : verifDate.isValid())) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
var currentDate = moment();
|
|
47
|
+
var maxVerificationAge = config.params.maxVerificationAge;
|
|
48
|
+
var ageInDays = currentDate.diff(verifDate, 'days');
|
|
49
|
+
return ageInDays > maxVerificationAge;
|
|
50
|
+
};
|
|
51
|
+
export var getVerificationStatus = function (attributeType, attributeValue, attributeVerificationConfig) {
|
|
52
|
+
var config = findAttributeConfig(attributeVerificationConfig, attributeType);
|
|
53
|
+
if (!config) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
var inputMapping = config.inputMapping.find(function (mapping) { return getParentUri(mapping.attribute) === attributeType.uri; });
|
|
57
|
+
var statusMapping = findMappingByVerificationAttribute(config, [
|
|
58
|
+
OutputVerificationAttribute.Status,
|
|
59
|
+
OutputVerificationAttribute.IsValid
|
|
60
|
+
]);
|
|
61
|
+
if (!statusMapping) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
var statusValue = findValueByAttributeUri(attributeValue, statusMapping.attribute);
|
|
65
|
+
var valueStatus = statusValue === null || statusValue === void 0 ? void 0 : statusValue.value;
|
|
66
|
+
var dateMapping = findMappingByVerificationAttribute(config, [OutputVerificationAttribute.VerifiedOn]);
|
|
67
|
+
if (!dateMapping) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
var dateValue = findValueByAttributeUri(attributeValue, dateMapping.attribute);
|
|
71
|
+
if (!dateValue || !statusValue) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
var verificationStatus = (function () {
|
|
75
|
+
switch (valueStatus) {
|
|
76
|
+
case 'Invalid':
|
|
77
|
+
case 'No':
|
|
78
|
+
return VerificationStatus.INVALID;
|
|
79
|
+
case 'Valid':
|
|
80
|
+
case 'Yes': {
|
|
81
|
+
var isStatusOutdatedResult = isStatusOutdated(dateValue === null || dateValue === void 0 ? void 0 : dateValue.value, config);
|
|
82
|
+
if (isNil(isStatusOutdatedResult)) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
if (isStatusOutdatedResult) {
|
|
86
|
+
return VerificationStatus.OUTDATED;
|
|
87
|
+
}
|
|
88
|
+
return VerificationStatus.VALID;
|
|
89
|
+
}
|
|
90
|
+
case 'Maybe':
|
|
91
|
+
case 'Unknown':
|
|
92
|
+
return VerificationStatus.MAYBE;
|
|
93
|
+
case 'Accept_All':
|
|
94
|
+
return VerificationStatus.ACCEPT_ALL;
|
|
95
|
+
default: {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
})();
|
|
100
|
+
if (verificationStatus === null) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
status: verificationStatus,
|
|
105
|
+
lastVerifiedTime: dateValue === null || dateValue === void 0 ? void 0 : dateValue.value,
|
|
106
|
+
verificationType: inputMapping.verificationAttribute
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
export var getVerificationType = function (attributeType, attributeVerificationConfig) {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
var config = findAttributeConfig(attributeVerificationConfig, attributeType);
|
|
112
|
+
return ((_b = (_a = config === null || config === void 0 ? void 0 : config.inputMapping) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.verificationAttribute) || null;
|
|
113
|
+
};
|
|
114
|
+
export var getAllVerificationAttributeTypeUris = function (attributeVerificationConfig, entityTypeUri) {
|
|
115
|
+
return attributeVerificationConfig.flatMap(function (config) {
|
|
116
|
+
return config.inputMapping
|
|
117
|
+
.filter(function (mapping) { return mapping.attribute.startsWith(entityTypeUri + '/'); })
|
|
118
|
+
.filter(function (mapping) { return Object.keys(InputVerificationAttribute).includes(mapping.verificationAttribute); })
|
|
119
|
+
.map(function (mapping) { return getParentUri(mapping.attribute); });
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
export var getAllVerificationTypes = function (attributeVerificationConfig) {
|
|
123
|
+
return uniq(attributeVerificationConfig.flatMap(function (config) {
|
|
124
|
+
return config.inputMapping.map(function (mapping) { return mapping.verificationAttribute; });
|
|
125
|
+
}));
|
|
126
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType, InputVerificationAttribute, NestedAttributeValue } from '@reltio/mdm-sdk';
|
|
3
|
+
import { VerificationStatus } from './helpers';
|
|
4
|
+
type AttributesVerificationContextValue = {
|
|
5
|
+
isVerificationAttribute: (attributeType: AttributeType) => boolean;
|
|
6
|
+
getVerificationStatus: (attributeType: AttributeType, attributeValue: NestedAttributeValue) => {
|
|
7
|
+
status: VerificationStatus;
|
|
8
|
+
lastVerifiedTime: number | null;
|
|
9
|
+
verificationType: InputVerificationAttribute;
|
|
10
|
+
} | null;
|
|
11
|
+
getVerificationType: (attributeType: AttributeType) => InputVerificationAttribute | null;
|
|
12
|
+
verificationAttributeTypeUris: string[];
|
|
13
|
+
getAllVerificationTypes: () => InputVerificationAttribute[];
|
|
14
|
+
};
|
|
15
|
+
export declare const AttributesVerificationContext: import("@fluentui/react-context-selector").Context<AttributesVerificationContextValue>;
|
|
16
|
+
export declare const AttributesVerificationProvider: ({ children }: {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}) => React.JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import { createContext } from '@fluentui/react-context-selector';
|
|
3
|
+
import { getEntityType } from '@reltio/mdm-sdk';
|
|
4
|
+
import { useMdmEntity, useMdmMetadata } from '../MdmModuleContext';
|
|
5
|
+
import { getIsVerificationAttribute, getVerificationStatus as getVerificationStatusHelper, getVerificationType as getVerificationTypeHelper, getAllVerificationAttributeTypeUris, getAllVerificationTypes as getAllVerificationTypesHelper } from './helpers';
|
|
6
|
+
export var AttributesVerificationContext = createContext(null);
|
|
7
|
+
export var AttributesVerificationProvider = function (_a) {
|
|
8
|
+
var children = _a.children;
|
|
9
|
+
var metadata = useMdmMetadata();
|
|
10
|
+
var currentEntity = useMdmEntity();
|
|
11
|
+
var attributeVerificationConfig = useMemo(function () {
|
|
12
|
+
var _a;
|
|
13
|
+
var entityType = (currentEntity === null || currentEntity === void 0 ? void 0 : currentEntity.type) && metadata && getEntityType(metadata, currentEntity.type);
|
|
14
|
+
return ((_a = entityType === null || entityType === void 0 ? void 0 : entityType.cleanseConfig) === null || _a === void 0 ? void 0 : _a.attributeVerificationConfig) || [];
|
|
15
|
+
}, [currentEntity === null || currentEntity === void 0 ? void 0 : currentEntity.type, metadata]);
|
|
16
|
+
var verificationAttributeTypeUris = useMemo(function () {
|
|
17
|
+
return getAllVerificationAttributeTypeUris(attributeVerificationConfig, currentEntity === null || currentEntity === void 0 ? void 0 : currentEntity.type);
|
|
18
|
+
}, [attributeVerificationConfig, currentEntity === null || currentEntity === void 0 ? void 0 : currentEntity.type]);
|
|
19
|
+
var isVerificationAttribute = useCallback(function (attributeType) {
|
|
20
|
+
return getIsVerificationAttribute(attributeType, attributeVerificationConfig);
|
|
21
|
+
}, [attributeVerificationConfig]);
|
|
22
|
+
var getVerificationStatus = useCallback(function (attributeType, attributeValue) {
|
|
23
|
+
return getVerificationStatusHelper(attributeType, attributeValue, attributeVerificationConfig);
|
|
24
|
+
}, [attributeVerificationConfig]);
|
|
25
|
+
var getVerificationType = useCallback(function (attributeType) {
|
|
26
|
+
return getVerificationTypeHelper(attributeType, attributeVerificationConfig);
|
|
27
|
+
}, [attributeVerificationConfig]);
|
|
28
|
+
var getAllVerificationTypes = useCallback(function () {
|
|
29
|
+
return getAllVerificationTypesHelper(attributeVerificationConfig);
|
|
30
|
+
}, [attributeVerificationConfig]);
|
|
31
|
+
var contextValue = useMemo(function () { return ({
|
|
32
|
+
isVerificationAttribute: isVerificationAttribute,
|
|
33
|
+
getVerificationStatus: getVerificationStatus,
|
|
34
|
+
getVerificationType: getVerificationType,
|
|
35
|
+
verificationAttributeTypeUris: verificationAttributeTypeUris,
|
|
36
|
+
getAllVerificationTypes: getAllVerificationTypes
|
|
37
|
+
}); }, [
|
|
38
|
+
isVerificationAttribute,
|
|
39
|
+
getVerificationStatus,
|
|
40
|
+
getVerificationType,
|
|
41
|
+
verificationAttributeTypeUris,
|
|
42
|
+
getAllVerificationTypes
|
|
43
|
+
]);
|
|
44
|
+
return (React.createElement(AttributesVerificationContext.Provider, { value: contextValue }, children));
|
|
45
|
+
};
|
|
@@ -130,6 +130,10 @@ export type MdmModuleActionsContextProps = Partial<{
|
|
|
130
130
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
131
131
|
resetHiddenAttributes: (uri: string) => void;
|
|
132
132
|
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
133
|
+
updateEntityAttributeValues: (payload: {
|
|
134
|
+
updatedEntity: Entity;
|
|
135
|
+
attributeTypeUris: string[];
|
|
136
|
+
}) => void;
|
|
133
137
|
}>;
|
|
134
138
|
export type MdmModuleListenersContextProps = Partial<{
|
|
135
139
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -206,6 +210,10 @@ export declare const MdmModuleActionsContext: import("@fluentui/react-context-se
|
|
|
206
210
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
207
211
|
resetHiddenAttributes: (uri: string) => void;
|
|
208
212
|
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
213
|
+
updateEntityAttributeValues: (payload: {
|
|
214
|
+
updatedEntity: Entity;
|
|
215
|
+
attributeTypeUris: string[];
|
|
216
|
+
}) => void;
|
|
209
217
|
}>>;
|
|
210
218
|
export declare const MdmModuleValuesContext: import("@fluentui/react-context-selector").Context<Partial<{
|
|
211
219
|
autoCloseInterval: number;
|
|
@@ -143,6 +143,10 @@ export declare const useMdmAction: <T extends keyof MdmModuleActionsContextProps
|
|
|
143
143
|
updateHiddenAttributes: (uri: string, hiddenAttributes: string[]) => void;
|
|
144
144
|
resetHiddenAttributes: (uri: string) => void;
|
|
145
145
|
updateControlAttributes: (controlAttributes: string[]) => void;
|
|
146
|
+
updateEntityAttributeValues: (payload: {
|
|
147
|
+
updatedEntity: import("@reltio/mdm-sdk").Entity;
|
|
148
|
+
attributeTypeUris: string[];
|
|
149
|
+
}) => void;
|
|
146
150
|
}>[T];
|
|
147
151
|
export declare const useMdmListener: <T extends keyof MdmModuleListenersContextProps>(listener: T) => Partial<{
|
|
148
152
|
expandInvalidRelatonsListener: (callback: () => void) => (action: any) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WorkflowAction, WorkflowComment } from '@reltio/mdm-sdk';
|
|
2
|
+
import { WorkflowAction, WorkflowComment, WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
3
3
|
import { TaskAction } from '../types';
|
|
4
4
|
type Props = {
|
|
5
5
|
actionRequestIsInProgress?: boolean;
|
|
@@ -14,6 +14,7 @@ type Props = {
|
|
|
14
14
|
container?: string;
|
|
15
15
|
commentsContainer?: string;
|
|
16
16
|
};
|
|
17
|
+
onCommentWrite?: (taskFields: Pick<WorkflowTaskData, 'processInstanceComments'>) => void;
|
|
17
18
|
};
|
|
18
|
-
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction, showActionButtons, alwaysExpanded, classes }: Props) => React.JSX.Element;
|
|
19
|
+
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction, showActionButtons, alwaysExpanded, classes, onCommentWrite }: Props) => React.JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -11,13 +11,14 @@ import { SmallIconButton } from '../../../SmallIconButton';
|
|
|
11
11
|
import { WorkflowActionButtons } from '../WorkflowActionButtons';
|
|
12
12
|
import styles from './WorkflowComments.module.css';
|
|
13
13
|
export var WorkflowComments = function (_a) {
|
|
14
|
-
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction, _b = _a.showActionButtons, showActionButtons = _b === void 0 ? true : _b, _c = _a.alwaysExpanded, alwaysExpanded = _c === void 0 ? false : _c, classes = _a.classes;
|
|
14
|
+
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction, _b = _a.showActionButtons, showActionButtons = _b === void 0 ? true : _b, _c = _a.alwaysExpanded, alwaysExpanded = _c === void 0 ? false : _c, classes = _a.classes, onCommentWrite = _a.onCommentWrite;
|
|
15
15
|
var _d = useState(false), expanded = _d[0], setExpanded = _d[1];
|
|
16
16
|
var _e = useState(''), comment = _e[0], setComment = _e[1];
|
|
17
17
|
var _f = useWorkflowComments({
|
|
18
18
|
processInstanceComments: processInstanceComments,
|
|
19
19
|
taskId: taskId,
|
|
20
|
-
isOpen: isTaskOpen
|
|
20
|
+
isOpen: isTaskOpen,
|
|
21
|
+
onCommentWrite: onCommentWrite
|
|
21
22
|
}), comments = _f.comments, writeComment = _f.writeComment, readOnly = _f.readOnly;
|
|
22
23
|
var sendComment = useCallback(function () {
|
|
23
24
|
writeComment(comment);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
2
|
-
type Props = Pick<WorkflowTaskData, 'processInstanceComments' | 'taskId' | 'isOpen'
|
|
3
|
-
|
|
2
|
+
type Props = Pick<WorkflowTaskData, 'processInstanceComments' | 'taskId' | 'isOpen'> & {
|
|
3
|
+
onCommentWrite?: (taskFields: Pick<WorkflowTaskData, 'processInstanceComments'>) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const useWorkflowComments: ({ processInstanceComments, taskId, isOpen, onCommentWrite }: Props) => {
|
|
4
6
|
comments: any[];
|
|
5
7
|
requestIsInProgress: boolean;
|
|
6
8
|
writeComment: (comment: any) => void;
|