@reltio/components 1.4.2198 → 1.4.2200
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/ModeSwitcherSelect/ModeSwitcherSelect.d.ts +1 -0
- package/ModeSwitcherSelect/ModeSwitcherSelect.js +3 -3
- package/RolesEditor/RolesEditor.js +5 -20
- package/RolesEditor/RolesEditor.module.css.js +2 -2
- package/RolesInput/RolesInput.d.ts +8 -0
- package/RolesInput/RolesInput.js +31 -0
- package/RolesInput/RolesInput.module.css.js +9 -0
- package/TagsEditor/TagsEditor.js +4 -67
- package/TagsInput/TagsInput.d.ts +8 -0
- package/TagsInput/TagsInput.js +71 -0
- package/cjs/ModeSwitcherSelect/ModeSwitcherSelect.d.ts +1 -0
- package/cjs/ModeSwitcherSelect/ModeSwitcherSelect.js +3 -3
- package/cjs/RolesEditor/RolesEditor.js +2 -17
- package/cjs/RolesEditor/RolesEditor.module.css.js +2 -2
- package/cjs/RolesInput/RolesInput.d.ts +8 -0
- package/cjs/RolesInput/RolesInput.js +61 -0
- package/cjs/RolesInput/RolesInput.module.css.js +9 -0
- package/cjs/TagsEditor/TagsEditor.js +2 -65
- package/cjs/TagsInput/TagsInput.d.ts +8 -0
- package/cjs/TagsInput/TagsInput.js +98 -0
- package/cjs/features/workflow/AttributesChanges/AttributesChanges.js +9 -48
- package/cjs/features/workflow/AttributesChanges/AttributesChanges.module.css.js +9 -0
- package/cjs/features/workflow/AttributesChanges/components/ChangeView/ChangeView.js +7 -9
- package/cjs/features/workflow/AttributesChanges/components/ChangeView/ChangeView.module.css.js +9 -0
- package/cjs/features/workflow/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +1 -1
- package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +2 -2
- package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.js +19 -40
- package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.module.css.js +9 -0
- package/cjs/features/workflow/AttributesChanges/useCollapsibleList.d.ts +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.d.ts +3 -2
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +11 -6
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.module.css.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts +10 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +72 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemLabel.d.ts +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemLabel.js +19 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.d.ts +7 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.js +32 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.d.ts +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.js +44 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.d.ts +12 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.js +38 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/SkeletonChangeItemEditorLoader.d.ts +2 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/SkeletonChangeItemEditorLoader.js +20 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/index.d.ts +3 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/index.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +10 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +27 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +10 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +61 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.d.ts +2 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.js +23 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/index.d.ts +2 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/index.js +7 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers.d.ts +3 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers.js +16 -0
- package/cjs/features/workflow/DCREntityUriLink/DCREntityUriLink.d.ts +10 -0
- package/cjs/features/workflow/DCREntityUriLink/DCREntityUriLink.js +21 -0
- package/cjs/features/workflow/DCREntityUriLink/DCREntityUriLink.module.css.js +9 -0
- package/cjs/features/workflow/OperationChip/OperationChip.d.ts +10 -0
- package/cjs/features/workflow/OperationChip/OperationChip.js +16 -0
- package/cjs/features/workflow/OperationChip/OperationChip.module.css.js +9 -0
- package/cjs/features/workflow/OperationChip/index.d.ts +1 -0
- package/cjs/features/workflow/OperationChip/index.js +5 -0
- package/cjs/features/workflow/RelationEntityLink/RelationEntityLink.d.ts +9 -0
- package/cjs/features/workflow/RelationEntityLink/RelationEntityLink.js +67 -0
- package/cjs/features/workflow/RelationEntityLink/RelationEntityLink.module.css.js +9 -0
- package/cjs/features/workflow/RelationEntityLink/index.d.ts +1 -0
- package/cjs/features/workflow/RelationEntityLink/index.js +5 -0
- package/cjs/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +1 -1
- package/cjs/features/workflow/ReviewDCRDialog/ReviewDCRDialog.module.css.js +1 -1
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.js +3 -17
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.module.css.js +1 -1
- package/cjs/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.js +1 -1
- package/cjs/features/workflow/WorkflowComments/components/Comment/Comment.js +9 -10
- package/cjs/features/workflow/WorkflowComments/components/Comment/Comment.module.css.js +9 -0
- package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/attributes.js +13 -10
- package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/attributes.test.js +19 -9
- package/cjs/features/workflow/helpers/common.d.ts +2 -1
- package/cjs/features/workflow/helpers/common.js +6 -1
- package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/merge.js +3 -4
- package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/merge.test.js +5 -3
- package/cjs/features/workflow/hooks/useChangesList.d.ts +9 -0
- package/cjs/features/workflow/hooks/useChangesList.js +24 -0
- package/cjs/features/workflow/types.d.ts +16 -0
- package/cjs/hooks/useCssVariableStyles/useCssVariableStyles.js +1 -1
- package/cjs/icons/SuggestedChanges.d.ts +3 -0
- package/cjs/icons/SuggestedChanges.js +27 -0
- package/features/workflow/AttributesChanges/AttributesChanges.js +7 -23
- package/features/workflow/AttributesChanges/AttributesChanges.module.css.js +9 -0
- package/features/workflow/AttributesChanges/components/ChangeView/ChangeView.js +3 -5
- package/features/workflow/AttributesChanges/components/ChangeView/ChangeView.module.css.js +9 -0
- package/features/workflow/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +1 -1
- package/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +2 -2
- package/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.js +22 -43
- package/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.module.css.js +9 -0
- package/features/workflow/AttributesChanges/useCollapsibleList.d.ts +1 -1
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.d.ts +3 -2
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +11 -6
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.module.css.js +2 -2
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts +10 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +42 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemLabel.d.ts +9 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemLabel.js +12 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.d.ts +7 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.js +25 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.d.ts +9 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.js +14 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.d.ts +12 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.js +32 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/SkeletonChangeItemEditorLoader.d.ts +2 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/SkeletonChangeItemEditorLoader.js +13 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/index.d.ts +3 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/index.js +3 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +10 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +20 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +10 -0
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +31 -0
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.d.ts +2 -0
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.js +16 -0
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/index.d.ts +2 -0
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/index.js +2 -0
- package/features/workflow/ChangeRequestEditor/helpers.d.ts +3 -0
- package/features/workflow/ChangeRequestEditor/helpers.js +12 -0
- package/features/workflow/DCREntityUriLink/DCREntityUriLink.d.ts +10 -0
- package/features/workflow/DCREntityUriLink/DCREntityUriLink.js +14 -0
- package/features/workflow/DCREntityUriLink/DCREntityUriLink.module.css.js +9 -0
- package/features/workflow/OperationChip/OperationChip.d.ts +10 -0
- package/features/workflow/OperationChip/OperationChip.js +9 -0
- package/features/workflow/OperationChip/OperationChip.module.css.js +9 -0
- package/features/workflow/OperationChip/index.d.ts +1 -0
- package/features/workflow/OperationChip/index.js +1 -0
- package/features/workflow/RelationEntityLink/RelationEntityLink.d.ts +9 -0
- package/features/workflow/RelationEntityLink/RelationEntityLink.js +37 -0
- package/features/workflow/RelationEntityLink/RelationEntityLink.module.css.js +9 -0
- package/features/workflow/RelationEntityLink/index.d.ts +1 -0
- package/features/workflow/RelationEntityLink/index.js +1 -0
- package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +1 -1
- package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.module.css.js +1 -1
- package/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.js +2 -16
- package/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.module.css.js +1 -1
- package/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.js +1 -1
- package/features/workflow/WorkflowComments/components/Comment/Comment.js +1 -2
- package/features/workflow/WorkflowComments/components/Comment/Comment.module.css.js +9 -0
- package/features/workflow/{AttributesChanges/helpers → helpers}/attributes.js +13 -10
- package/features/workflow/{AttributesChanges/helpers → helpers}/attributes.test.js +19 -9
- package/features/workflow/helpers/common.d.ts +2 -1
- package/features/workflow/helpers/common.js +6 -2
- package/features/workflow/{AttributesChanges/helpers → helpers}/merge.js +4 -5
- package/features/workflow/{AttributesChanges/helpers → helpers}/merge.test.js +5 -3
- package/features/workflow/hooks/useChangesList.d.ts +9 -0
- package/features/workflow/hooks/useChangesList.js +17 -0
- package/features/workflow/types.d.ts +16 -0
- package/hooks/useCssVariableStyles/useCssVariableStyles.js +1 -1
- package/icons/SuggestedChanges.d.ts +3 -0
- package/icons/SuggestedChanges.js +22 -0
- package/package.json +2 -2
- package/cjs/features/workflow/AttributesChanges/components/ChangeView/styles.d.ts +0 -1
- package/cjs/features/workflow/AttributesChanges/components/ChangeView/styles.js +0 -49
- package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/styles.d.ts +0 -5
- package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/styles.js +0 -31
- package/cjs/features/workflow/AttributesChanges/styles.d.ts +0 -1
- package/cjs/features/workflow/AttributesChanges/styles.js +0 -28
- package/cjs/features/workflow/AttributesChanges/types.d.ts +0 -14
- package/cjs/features/workflow/AttributesChanges/types.js +0 -2
- package/cjs/features/workflow/WorkflowComments/components/Comment/styles.d.ts +0 -1
- package/cjs/features/workflow/WorkflowComments/components/Comment/styles.js +0 -49
- package/features/workflow/AttributesChanges/components/ChangeView/styles.d.ts +0 -1
- package/features/workflow/AttributesChanges/components/ChangeView/styles.js +0 -46
- package/features/workflow/AttributesChanges/components/DiffRenderer/styles.d.ts +0 -5
- package/features/workflow/AttributesChanges/components/DiffRenderer/styles.js +0 -28
- package/features/workflow/AttributesChanges/styles.d.ts +0 -1
- package/features/workflow/AttributesChanges/styles.js +0 -25
- package/features/workflow/AttributesChanges/types.d.ts +0 -14
- package/features/workflow/AttributesChanges/types.js +0 -1
- package/features/workflow/WorkflowComments/components/Comment/styles.d.ts +0 -1
- package/features/workflow/WorkflowComments/components/Comment/styles.js +0 -46
- /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/attributes.d.ts +0 -0
- /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/attributes.test.d.ts +0 -0
- /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/merge.d.ts +0 -0
- /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/merge.test.d.ts +0 -0
- /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/metadata.test-data.d.ts +0 -0
- /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/metadata.test-data.js +0 -0
- /package/features/workflow/{AttributesChanges/helpers → helpers}/attributes.d.ts +0 -0
- /package/features/workflow/{AttributesChanges/helpers → helpers}/attributes.test.d.ts +0 -0
- /package/features/workflow/{AttributesChanges/helpers → helpers}/merge.d.ts +0 -0
- /package/features/workflow/{AttributesChanges/helpers → helpers}/merge.test.d.ts +0 -0
- /package/features/workflow/{AttributesChanges/helpers → helpers}/metadata.test-data.d.ts +0 -0
- /package/features/workflow/{AttributesChanges/helpers → helpers}/metadata.test-data.js +0 -0
|
@@ -1,52 +1,31 @@
|
|
|
1
|
-
import React, { useCallback,
|
|
2
|
-
import {
|
|
3
|
-
import classnames from 'classnames';
|
|
4
|
-
import { getAttributeValue, getLabel, isReference } from '@reltio/mdm-sdk';
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import { EntityAttrTypes, getAttributeValue } from '@reltio/mdm-sdk';
|
|
5
3
|
import { ChangeView } from '../ChangeView';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { getDataTypeDefinition, prepareRolesOrTagsValue } from '../../../helpers/common';
|
|
5
|
+
import { useCssVariableStyles } from '../../../../../hooks/useCssVariableStyles';
|
|
6
|
+
import { useMdmMetadata } from '../../../../../contexts/MdmModuleContext';
|
|
8
7
|
import { DataTypeValue } from '../../../../../DataTypeValue';
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import { useStyles } from './styles';
|
|
8
|
+
import { RelationEntityLink } from '../../../RelationEntityLink';
|
|
9
|
+
import styles from './DiffRenderer.module.css';
|
|
12
10
|
export var DiffRenderer = function (_a) {
|
|
13
|
-
var label = _a.label, level = _a.level, attributeType = _a.attributeType, attributeValue = _a.attributeValue, oldValue = _a.oldValue, newValue = _a.newValue, operation = _a.operation;
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
var _a, _b, _c;
|
|
19
|
-
if (isReference(attributeType)) {
|
|
20
|
-
var value = (_b = (_a = attributeValue.value) === null || _a === void 0 ? void 0 : _a.newValue) !== null && _b !== void 0 ? _b : (_c = attributeValue.value) === null || _c === void 0 ? void 0 : _c.oldValue;
|
|
21
|
-
return getAttributeDescription(attributeType, value || attributeValue, entityUri, objectsInfo);
|
|
22
|
-
}
|
|
23
|
-
else if ('endObject' in attributeType) {
|
|
24
|
-
var _d = attributeValue, endObjectUri = _d.endObjectUri, endObjectLabel = _d.endObjectLabel;
|
|
25
|
-
return {
|
|
26
|
-
objectUri: endObjectUri,
|
|
27
|
-
objectLabel: endObjectLabel
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}, [attributeType, attributeValue, entityUri, objectsInfo]);
|
|
31
|
-
var renderLink = useCallback(function () {
|
|
32
|
-
var _a, _b;
|
|
33
|
-
var _c;
|
|
34
|
-
var _d = getLinkDescription() || {}, objectUri = _d.objectUri, objectLabel = _d.objectLabel;
|
|
35
|
-
if (!isNil(objectUri) && !isNil(objectLabel)) {
|
|
36
|
-
var isNotExist = ((_c = objectsInfo[objectUri]) === null || _c === void 0 ? void 0 : _c.isExist) === false;
|
|
37
|
-
return (React.createElement(EntityUriLink, { value: objectUri, className: classnames(styles.linkContainer, (_a = {}, _a[styles.disabledLink] = isNotExist, _a)) },
|
|
38
|
-
React.createElement("span", { className: classnames(styles.linkLabel, (_b = {}, _b[styles.label] = isNotExist, _b)) }, getLabel(objectLabel))));
|
|
39
|
-
}
|
|
40
|
-
return null;
|
|
41
|
-
}, [getLinkDescription, objectsInfo, styles]);
|
|
11
|
+
var label = _a.label, level = _a.level, attributeType = _a.attributeType, relationType = _a.relationType, attributeValue = _a.attributeValue, oldValue = _a.oldValue, newValue = _a.newValue, operation = _a.operation;
|
|
12
|
+
var variableStyles = useCssVariableStyles({
|
|
13
|
+
'--level': level
|
|
14
|
+
});
|
|
15
|
+
var metadata = useMdmMetadata();
|
|
42
16
|
var changeLabel = useMemo(function () {
|
|
43
17
|
return (React.createElement("span", null,
|
|
44
18
|
label,
|
|
45
|
-
|
|
46
|
-
}, [label,
|
|
19
|
+
React.createElement(RelationEntityLink, { attributeOrRelationType: attributeType || relationType, attributeValue: attributeValue })));
|
|
20
|
+
}, [label, attributeType, relationType, attributeValue]);
|
|
47
21
|
var renderValue = useCallback(function (value) {
|
|
48
22
|
var attrValue = getAttributeValue(value);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
23
|
+
var isRolesOrTags = attributeType.uri === EntityAttrTypes.roles.uri || attributeType.uri === EntityAttrTypes.tags.uri;
|
|
24
|
+
var preparedValue = isRolesOrTags
|
|
25
|
+
? prepareRolesOrTagsValue(metadata, attrValue, attributeType.uri)
|
|
26
|
+
: attrValue;
|
|
27
|
+
return (React.createElement(DataTypeValue, { value: preparedValue, dataTypeDefinition: getDataTypeDefinition(attributeType, attrValue) }));
|
|
28
|
+
}, [attributeType, metadata]);
|
|
29
|
+
return (React.createElement("div", { className: styles.change, style: variableStyles },
|
|
30
|
+
React.createElement(ChangeView, { label: changeLabel, oldValue: oldValue && renderValue(oldValue), newValue: newValue && renderValue(newValue), operation: operation })));
|
|
52
31
|
};
|
package/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.module.css.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"change":"DiffRenderer-change--ep0bt"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.DiffRenderer-change--ep0bt{margin-left:calc(var(--level, 0)*16px)}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ChangeRequest, WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
2
|
+
import { ChangeRequest, WorkflowTaskData, GroupedObjectsInfo } from '@reltio/mdm-sdk';
|
|
3
3
|
type Props = {
|
|
4
4
|
dcr: ChangeRequest;
|
|
5
5
|
task: WorkflowTaskData;
|
|
6
|
+
groupedObjects: GroupedObjectsInfo[];
|
|
6
7
|
};
|
|
7
|
-
export declare const ChangeRequestEditor: ({ dcr, task
|
|
8
|
+
export declare const ChangeRequestEditor: ({ dcr, task, groupedObjects }: Props) => React.JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import i18n from 'ui-i18n';
|
|
3
|
+
import Typography from '@mui/material/Typography';
|
|
4
|
+
import SvgSuggestedChanges from '../../../icons/SuggestedChanges';
|
|
5
|
+
import { EntityChangesGroup, SkeletonEntityChangesGroupLoader } from './components/EntityChangesGroup';
|
|
3
6
|
import styles from './ChangeRequestEditor.module.css';
|
|
4
7
|
export var ChangeRequestEditor = function (_a) {
|
|
5
|
-
var dcr = _a.dcr,
|
|
6
|
-
var dcrLoaded = !!dcr;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
var dcr = _a.dcr, task = _a.task, groupedObjects = _a.groupedObjects;
|
|
9
|
+
var dcrLoaded = !!dcr && groupedObjects.length > 0;
|
|
10
|
+
return (React.createElement("div", { className: styles.container },
|
|
11
|
+
React.createElement("div", { className: styles.header },
|
|
12
|
+
React.createElement("div", { className: styles.suggestedChangesIcon },
|
|
13
|
+
React.createElement(SvgSuggestedChanges, null)),
|
|
14
|
+
React.createElement(Typography, { variant: "h6", className: styles.suggestedChangesTitle }, i18n.text('Suggested changes'))),
|
|
15
|
+
dcrLoaded ? (groupedObjects.map(function (object, index) { return (React.createElement(EntityChangesGroup, { key: "entity-".concat(index), entityInfo: object.entity, relationsInfo: object.relations, task: task, dcr: dcr })); })) : (React.createElement(SkeletonEntityChangesGroupLoader, null))));
|
|
11
16
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const styles = {"container":"ChangeRequestEditor-container--pOvfN"};
|
|
1
|
+
const styles = {"container":"ChangeRequestEditor-container--pOvfN","suggestedChangesTitle":"ChangeRequestEditor-suggestedChangesTitle--Vln-y","header":"ChangeRequestEditor-header--ZS-Cs","showBorderOnScroll":"ChangeRequestEditor-showBorderOnScroll--CiFhA","suggestedChangesIcon":"ChangeRequestEditor-suggestedChangesIcon--pIDL-"};
|
|
2
2
|
if (typeof document !== 'undefined') {
|
|
3
3
|
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
4
|
const style = document.createElement('style');
|
|
5
5
|
style.type = 'text/css'
|
|
6
|
-
style.innerHTML = `.ChangeRequestEditor-container--pOvfN{border:1px solid rgba(0,0,0,.
|
|
6
|
+
style.innerHTML = `.ChangeRequestEditor-container--pOvfN{background-color:#fff;border:1px solid rgba(0,0,0,.12);border-radius:8px;bottom:0;display:flex;flex-direction:column;gap:16px;left:0;overflow:auto;padding-bottom:16px;position:absolute;right:0;top:0;scroll-timeline-name:--changes-scroll;scroll-timeline-axis:block}.ChangeRequestEditor-suggestedChangesTitle--Vln-y{color:var(--mui-palette-text-primary);font-size:16px;font-weight:500}.ChangeRequestEditor-header--ZS-Cs{align-items:center;animation:ChangeRequestEditor-showBorderOnScroll--CiFhA 1s linear both;background:#fff;border-bottom:1px solid transparent;box-shadow:none;display:flex;gap:16px;margin-bottom:-16px;padding:16px;position:sticky;top:0;z-index:1;animation-timeline:--changes-scroll;animation-range:0 16px}.ChangeRequestEditor-suggestedChangesIcon--pIDL-{height:32px;width:32px}@keyframes ChangeRequestEditor-showBorderOnScroll--CiFhA{0%{border-bottom-color:transparent;box-shadow:none}to{border-bottom-color:rgba(0,0,0,.12);box-shadow:0 2px 6px rgba(0,0,0,.06)}}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
export default styles;
|
package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DCRValue } from '@reltio/mdm-sdk';
|
|
3
|
+
import { Diff } from '../../../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
change: Diff;
|
|
6
|
+
onValueChange: (id: string, newValue: DCRValue) => void;
|
|
7
|
+
editable?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const ChangeItemEditor: ({ change, onValueChange, editable }: Props) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { isNil } from 'ramda';
|
|
3
|
+
import { DCROperationTypes, EntityAttrTypes, getAttributeValue } from '@reltio/mdm-sdk';
|
|
4
|
+
import { getDataTypeDefinition, prepareRolesOrTagsValue } from '../../../helpers/common';
|
|
5
|
+
import { OperationChip } from '../../../OperationChip';
|
|
6
|
+
import { DataTypeValue } from '../../../../../DataTypeValue';
|
|
7
|
+
import { RelationEntityLink } from '../../../RelationEntityLink';
|
|
8
|
+
import { ChangeItemLabel } from './ChangeItemLabel';
|
|
9
|
+
import { DCRValueEditor } from './DCRValueEditor';
|
|
10
|
+
import { useMdmMetadata } from '../../../../../contexts/MdmModuleContext';
|
|
11
|
+
import styles from './ChangeItemEditor.module.css';
|
|
12
|
+
export var ChangeItemEditor = function (_a) {
|
|
13
|
+
var _b, _c, _d;
|
|
14
|
+
var change = _a.change, onValueChange = _a.onValueChange, _e = _a.editable, editable = _e === void 0 ? true : _e;
|
|
15
|
+
var metadata = useMdmMetadata();
|
|
16
|
+
var isUpdateOperation = change.operation === DCROperationTypes.EDITED;
|
|
17
|
+
var isAddOperation = change.operation === DCROperationTypes.ADDED;
|
|
18
|
+
var hasAnyValue = Boolean(change.oldValue || change.newValue);
|
|
19
|
+
var oldValue = getAttributeValue(change.oldValue);
|
|
20
|
+
var newValue = getAttributeValue(change.newValue);
|
|
21
|
+
var hasNewValue = !isNil(newValue);
|
|
22
|
+
var dataTypeDefinition = useMemo(function () {
|
|
23
|
+
return change.attributeType && getDataTypeDefinition(change.attributeType, newValue || oldValue);
|
|
24
|
+
}, [change.attributeType, newValue, oldValue]);
|
|
25
|
+
var shouldShowValueEditor = (isUpdateOperation || isAddOperation) && editable;
|
|
26
|
+
var shouldShowOperationChip = hasAnyValue && change.operation;
|
|
27
|
+
var isRolesOrTags = ((_b = change === null || change === void 0 ? void 0 : change.attributeType) === null || _b === void 0 ? void 0 : _b.uri) === EntityAttrTypes.roles.uri ||
|
|
28
|
+
((_c = change === null || change === void 0 ? void 0 : change.attributeType) === null || _c === void 0 ? void 0 : _c.uri) === EntityAttrTypes.tags.uri;
|
|
29
|
+
var preparedValue = useMemo(function () {
|
|
30
|
+
return isRolesOrTags
|
|
31
|
+
? prepareRolesOrTagsValue(metadata, newValue, change.attributeType.uri)
|
|
32
|
+
: newValue;
|
|
33
|
+
}, [isRolesOrTags, metadata, newValue, (_d = change.attributeType) === null || _d === void 0 ? void 0 : _d.uri]);
|
|
34
|
+
return (React.createElement("div", { className: styles.attributeRow },
|
|
35
|
+
React.createElement(ChangeItemLabel, { change: change, className: styles.labelColumn, showLabel: !isUpdateOperation }),
|
|
36
|
+
React.createElement("div", { className: styles.valueColumn },
|
|
37
|
+
React.createElement(RelationEntityLink, { attributeOrRelationType: change.attributeType || change.relationType, attributeValue: change.attributeValue, className: styles.relationEntityLink }),
|
|
38
|
+
shouldShowValueEditor ? (React.createElement(DCRValueEditor, { attributeType: change.attributeType, value: change.newValue, onChange: onValueChange })) : (hasNewValue && (React.createElement("div", { className: styles.value },
|
|
39
|
+
React.createElement(DataTypeValue, { value: preparedValue, dataTypeDefinition: dataTypeDefinition }))))),
|
|
40
|
+
React.createElement("div", { className: styles.revertColumn }),
|
|
41
|
+
React.createElement("div", { className: styles.operationColumn }, shouldShowOperationChip && (React.createElement(OperationChip, { operation: change.operation, size: "small", variant: "outlined" })))));
|
|
42
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"attributeRow":"ChangeItemEditor-attributeRow--bITG5","labelColumn":"ChangeItemEditor-labelColumn--6B4w4","changeLabel":"ChangeItemEditor-changeLabel--C7s6T","valueColumn":"ChangeItemEditor-valueColumn--q9456","revertColumn":"ChangeItemEditor-revertColumn--T5mVE","operationColumn":"ChangeItemEditor-operationColumn--me-4D","previousValue":"ChangeItemEditor-previousValue--lTOVp","previousValueText":"ChangeItemEditor-previousValueText--gAnge","editor":"ChangeItemEditor-editor--hyLPa","arrow":"ChangeItemEditor-arrow--IXZ6i","value":"ChangeItemEditor-value--GxSUf","columnSkeleton":"ChangeItemEditor-columnSkeleton---iGmr","relationEntityLink":"ChangeItemEditor-relationEntityLink--Vr7Z-"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.ChangeItemEditor-attributeRow--bITG5{align-items:center;display:flex;font-size:16px;gap:16px}.ChangeItemEditor-labelColumn--6B4w4{box-sizing:border-box;min-height:21px;width:170px}.ChangeItemEditor-changeLabel--C7s6T{color:var(--mui-palette-text-secondary);font-size:14px;font-weight:400;letter-spacing:.24px;padding-left:calc(var(--level, 0)*16px)}.ChangeItemEditor-valueColumn--q9456{display:flex;flex:1;flex-direction:column;gap:4px}.ChangeItemEditor-revertColumn--T5mVE{margin-left:-9px;width:24px}.ChangeItemEditor-operationColumn--me-4D{width:145px}.ChangeItemEditor-previousValue--lTOVp{align-items:center;display:flex;line-height:16px;padding:6px 12px 7px}.ChangeItemEditor-previousValueText--gAnge{color:var(--mui-palette-text-primary);letter-spacing:.24px}.ChangeItemEditor-editor--hyLPa{min-height:40px}.ChangeItemEditor-arrow--IXZ6i{color:var(--mui-palette-text-secondary);font-weight:700;margin:0 5px}.ChangeItemEditor-value--GxSUf{font-size:16px;padding:8px}.ChangeItemEditor-columnSkeleton---iGmr{transform:none}.ChangeItemEditor-relationEntityLink--Vr7Z-{font-size:16px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemLabel.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Diff } from '../../../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
change: Diff;
|
|
5
|
+
showLabel?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const ChangeItemLabel: ({ change, className, showLabel }: Props) => React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { useCssVariableStyles } from '../../../../../hooks/useCssVariableStyles';
|
|
4
|
+
import styles from './ChangeItemEditor.module.css';
|
|
5
|
+
export var ChangeItemLabel = function (_a) {
|
|
6
|
+
var change = _a.change, className = _a.className, _b = _a.showLabel, showLabel = _b === void 0 ? true : _b;
|
|
7
|
+
var _c = change.level, level = _c === void 0 ? 0 : _c, label = change.label;
|
|
8
|
+
var variableStyles = useCssVariableStyles({
|
|
9
|
+
'--level': level
|
|
10
|
+
});
|
|
11
|
+
return (React.createElement("div", { className: classnames(styles.changeLabel, className), style: variableStyles }, showLabel && label));
|
|
12
|
+
};
|
package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { isNil } from 'ramda';
|
|
3
|
+
import EastIcon from '@mui/icons-material/East';
|
|
4
|
+
import { DCROperationTypes, getAttributeValue } from '@reltio/mdm-sdk';
|
|
5
|
+
import { getDataTypeDefinition } from '../../../helpers/common';
|
|
6
|
+
import { DataTypeValue } from '../../../../../DataTypeValue';
|
|
7
|
+
import { ChangeItemLabel } from './ChangeItemLabel';
|
|
8
|
+
import styles from './ChangeItemEditor.module.css';
|
|
9
|
+
export var ChangeItemOldValue = function (_a) {
|
|
10
|
+
var change = _a.change;
|
|
11
|
+
var isUpdateOperation = change.operation === DCROperationTypes.EDITED;
|
|
12
|
+
var oldValue = getAttributeValue(change.oldValue);
|
|
13
|
+
var newValue = getAttributeValue(change.newValue);
|
|
14
|
+
var dataTypeDefinition = change.attributeType && getDataTypeDefinition(change.attributeType, newValue !== null && newValue !== void 0 ? newValue : oldValue);
|
|
15
|
+
var hasOldValue = !isNil(oldValue);
|
|
16
|
+
return (React.createElement("div", { className: styles.attributeRow },
|
|
17
|
+
React.createElement(ChangeItemLabel, { change: change, className: styles.labelColumn }),
|
|
18
|
+
React.createElement("div", { className: styles.valueColumn }, isUpdateOperation && hasOldValue && (React.createElement("div", { className: styles.previousValue },
|
|
19
|
+
React.createElement("span", { className: styles.previousValueText },
|
|
20
|
+
React.createElement(DataTypeValue, { value: oldValue, dataTypeDefinition: dataTypeDefinition })),
|
|
21
|
+
React.createElement("span", { className: styles.arrow },
|
|
22
|
+
React.createElement(EastIcon, null))))),
|
|
23
|
+
React.createElement("div", { className: styles.revertColumn }),
|
|
24
|
+
React.createElement("div", { className: styles.operationColumn })));
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType, DCRValue, ChangeValue } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
attributeType: AttributeType;
|
|
5
|
+
value: ChangeValue;
|
|
6
|
+
onChange: (id: string, newValue: DCRValue) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const DCRValueEditor: ({ attributeType, value, onChange }: Props) => React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { DCRValueEditorFactory } from './DCRValueEditorFactory';
|
|
3
|
+
import styles from './ChangeItemEditor.module.css';
|
|
4
|
+
export var DCRValueEditor = function (_a) {
|
|
5
|
+
var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange;
|
|
6
|
+
var handleChange = useCallback(function (updatedValue) {
|
|
7
|
+
onChange(attributeType.uri, updatedValue);
|
|
8
|
+
}, [attributeType.uri, onChange]);
|
|
9
|
+
return (React.createElement("div", { className: styles.editor }, DCRValueEditorFactory.build({
|
|
10
|
+
attributeType: attributeType,
|
|
11
|
+
value: value,
|
|
12
|
+
onChange: handleChange
|
|
13
|
+
})));
|
|
14
|
+
};
|
package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType, DCRValue, DataTypeDefinition, ChangeValue } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
attributeType: AttributeType;
|
|
5
|
+
value: ChangeValue;
|
|
6
|
+
onChange: (value: DCRValue) => void;
|
|
7
|
+
dataTypeDefinition?: DataTypeDefinition;
|
|
8
|
+
};
|
|
9
|
+
export declare class DCRValueEditorFactory {
|
|
10
|
+
static build({ attributeType, value, onChange }: Props): React.JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EntityAttrTypes, wrapInArrayIfNeeded, getAttributeValue } from '@reltio/mdm-sdk';
|
|
3
|
+
import { DataTypeValueEditor } from '../../../../../DataTypeValueEditor';
|
|
4
|
+
import { attributeValueToEditorValue } from '../../../../../helpers/attributesView';
|
|
5
|
+
import { getDataTypeDefinition } from '../../../helpers/common';
|
|
6
|
+
import { RolesInput } from '../../../../../RolesInput/RolesInput';
|
|
7
|
+
import { TagsInput } from '../../../../../TagsInput/TagsInput';
|
|
8
|
+
var DCRValueEditorFactory = /** @class */ (function () {
|
|
9
|
+
function DCRValueEditorFactory() {
|
|
10
|
+
}
|
|
11
|
+
DCRValueEditorFactory.build = function (_a) {
|
|
12
|
+
var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange;
|
|
13
|
+
var dcrValue = getAttributeValue(value);
|
|
14
|
+
switch (attributeType.uri) {
|
|
15
|
+
case EntityAttrTypes.roles.uri: {
|
|
16
|
+
return React.createElement(RolesInput, { value: wrapInArrayIfNeeded(dcrValue), onChange: onChange });
|
|
17
|
+
}
|
|
18
|
+
case EntityAttrTypes.tags.uri: {
|
|
19
|
+
return React.createElement(TagsInput, { value: wrapInArrayIfNeeded(dcrValue), onChange: onChange });
|
|
20
|
+
}
|
|
21
|
+
default: {
|
|
22
|
+
var dataTypeDefinition = getDataTypeDefinition(attributeType, dcrValue);
|
|
23
|
+
var editorValue = value && dataTypeDefinition
|
|
24
|
+
? attributeValueToEditorValue(value, dataTypeDefinition)
|
|
25
|
+
: null;
|
|
26
|
+
return (React.createElement(DataTypeValueEditor, { fieldName: attributeType.uri, value: editorValue, dataTypeDefinition: dataTypeDefinition, onChange: onChange, fullWidth: true }));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return DCRValueEditorFactory;
|
|
31
|
+
}());
|
|
32
|
+
export { DCRValueEditorFactory };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Skeleton from '@mui/material/Skeleton';
|
|
3
|
+
import styles from './ChangeItemEditor.module.css';
|
|
4
|
+
export var SkeletonChangeItemEditorLoader = function () {
|
|
5
|
+
return (React.createElement("div", { className: styles.attributeRow },
|
|
6
|
+
React.createElement("div", { className: styles.labelColumn },
|
|
7
|
+
React.createElement(Skeleton, { variant: "text", width: "90%", height: 18, className: styles.columnSkeleton })),
|
|
8
|
+
React.createElement("div", { className: styles.valueColumn },
|
|
9
|
+
React.createElement(Skeleton, { variant: "text", height: 40, className: styles.columnSkeleton })),
|
|
10
|
+
React.createElement("div", { className: styles.revertColumn }),
|
|
11
|
+
React.createElement("div", { className: styles.operationColumn },
|
|
12
|
+
React.createElement(Skeleton, { variant: "rectangular", width: 60, height: 20, className: styles.columnSkeleton }))));
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GroupedObjectsInfo, DCRValue } from '@reltio/mdm-sdk';
|
|
3
|
+
import { Diff, Title } from '../../../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
item: Diff | Title;
|
|
6
|
+
onValueChange: (id: string, newValue: DCRValue) => void;
|
|
7
|
+
entityInfo: GroupedObjectsInfo['entity'];
|
|
8
|
+
};
|
|
9
|
+
export declare const ChangeItemRow: ({ item, onValueChange, entityInfo }: Props) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { has } from 'ramda';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { DCROperationTypes } from '@reltio/mdm-sdk';
|
|
5
|
+
import { isEditableChange } from '../../helpers';
|
|
6
|
+
import { ChangeItemOldValue, ChangeItemEditor } from '../ChangeItemEditor';
|
|
7
|
+
import styles from './ChangeItemRow.module.css';
|
|
8
|
+
export var ChangeItemRow = function (_a) {
|
|
9
|
+
var _b;
|
|
10
|
+
var item = _a.item, onValueChange = _a.onValueChange, entityInfo = _a.entityInfo;
|
|
11
|
+
if (!has('level', item)) {
|
|
12
|
+
return React.createElement("div", { className: styles.title }, item.label);
|
|
13
|
+
}
|
|
14
|
+
var change = item;
|
|
15
|
+
var isEditedOperation = change.operation === DCROperationTypes.EDITED;
|
|
16
|
+
var editable = isEditableChange(change, entityInfo);
|
|
17
|
+
return (React.createElement("div", { className: classnames(styles.changeItemRow, (_b = {}, _b[styles.editableRow] = editable, _b)) },
|
|
18
|
+
isEditedOperation && React.createElement(ChangeItemOldValue, { change: change }),
|
|
19
|
+
React.createElement(ChangeItemEditor, { change: change, onValueChange: onValueChange, editable: editable })));
|
|
20
|
+
};
|
package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"changeItemRow":"ChangeItemRow-changeItemRow--oF9hn","editableRow":"ChangeItemRow-editableRow--ZQzGk","title":"ChangeItemRow-title--G8iV2"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.ChangeItemRow-changeItemRow--oF9hn{display:flex;flex-direction:column;gap:8px}.ChangeItemRow-editableRow--ZQzGk:hover{background:var(--mui-palette-action-hover)}.ChangeItemRow-title--G8iV2{color:var(--mui-palette-text-primary);font-size:14px;font-weight:600;margin:0 0 12px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChangeItemRow } from './ChangeItemRow';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChangeItemRow } from './ChangeItemRow';
|
package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GroupedObjectsInfo, WorkflowTaskData, ChangeRequest } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
task: WorkflowTaskData;
|
|
5
|
+
dcr: ChangeRequest;
|
|
6
|
+
entityInfo: GroupedObjectsInfo['entity'];
|
|
7
|
+
relationsInfo: GroupedObjectsInfo['relations'];
|
|
8
|
+
};
|
|
9
|
+
export declare const EntityChangesGroup: ({ task, dcr, entityInfo, relationsInfo }: Props) => React.JSX.Element;
|
|
10
|
+
export {};
|
package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import Accordion from '@mui/material/Accordion';
|
|
3
|
+
import AccordionSummary from '@mui/material/AccordionSummary';
|
|
4
|
+
import AccordionDetails from '@mui/material/AccordionDetails';
|
|
5
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
6
|
+
import { useChangesList } from '../../../hooks/useChangesList';
|
|
7
|
+
import { DCREntityUriLink } from '../../../DCREntityUriLink/DCREntityUriLink';
|
|
8
|
+
import { ChangeItemRow } from '../ChangeItemRow/ChangeItemRow';
|
|
9
|
+
import { AttributesChangesContext } from '../../../AttributesChanges/AttributesChangesContext';
|
|
10
|
+
import { getDCRUri } from '../../../helpers/common';
|
|
11
|
+
import styles from './EntityChangesGroup.module.css';
|
|
12
|
+
export var EntityChangesGroup = function (_a) {
|
|
13
|
+
var task = _a.task, dcr = _a.dcr, entityInfo = _a.entityInfo, relationsInfo = _a.relationsInfo;
|
|
14
|
+
var dcrUri = getDCRUri(task.objectURIs);
|
|
15
|
+
var _b = dcr || {}, changes = _b.changes, objectsInfo = _b.objectsInfo;
|
|
16
|
+
var changesList = useChangesList({
|
|
17
|
+
changes: changes,
|
|
18
|
+
entityInfo: entityInfo,
|
|
19
|
+
relationsInfo: relationsInfo
|
|
20
|
+
});
|
|
21
|
+
var handleValueChange = useCallback(function () {
|
|
22
|
+
// TODO: Implement value change logic
|
|
23
|
+
}, []);
|
|
24
|
+
return (React.createElement(AttributesChangesContext.Provider, { value: objectsInfo },
|
|
25
|
+
React.createElement(Accordion, { className: styles.entityGroup, defaultExpanded: true, "data-reltio-id": "entity-changes-group" },
|
|
26
|
+
React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null), className: styles.entityHeader, classes: {
|
|
27
|
+
content: styles.accordionContent
|
|
28
|
+
} },
|
|
29
|
+
React.createElement(DCREntityUriLink, { entityInfo: entityInfo, changes: changes, dcrUri: dcrUri, className: styles.entityTitle })),
|
|
30
|
+
React.createElement(AccordionDetails, { className: styles.attributesList }, changesList.map(function (item, index) { return (React.createElement(ChangeItemRow, { key: "".concat('label' in item ? 'title' : 'change', "-").concat(index), item: item, onValueChange: handleValueChange, entityInfo: entityInfo })); })))));
|
|
31
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"entityGroup":"EntityChangesGroup-entityGroup--KmWaa","entityHeader":"EntityChangesGroup-entityHeader--hf8-J","entityTitle":"EntityChangesGroup-entityTitle--caeZE","accordionContent":"EntityChangesGroup-accordionContent--N7C6Y","attributesList":"EntityChangesGroup-attributesList--7Tmk6","skeletonEntityGroupDisabled":"EntityChangesGroup-skeletonEntityGroupDisabled--qFGAK"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.EntityChangesGroup-entityGroup--KmWaa{background-color:#f7f7f7;border:1px solid #f0f0f0;border-radius:8px;box-shadow:none;margin:0 16px}.EntityChangesGroup-entityGroup--KmWaa.Mui-expanded{margin:0 16px}.EntityChangesGroup-entityGroup--KmWaa:before{display:none}.EntityChangesGroup-entityHeader--hf8-J{border-bottom:1px solid #f0f0f0;min-height:auto;padding:8px 16px}.EntityChangesGroup-entityHeader--hf8-J.Mui-expanded{min-height:auto}.EntityChangesGroup-entityTitle--caeZE{font-size:14px}.EntityChangesGroup-accordionContent--N7C6Y,.EntityChangesGroup-accordionContent--N7C6Y.Mui-expanded{margin:0}.EntityChangesGroup-attributesList--7Tmk6{display:flex;flex-direction:column;gap:8px;max-width:1000px;min-width:750px;padding:16px}.EntityChangesGroup-skeletonEntityGroupDisabled--qFGAK.Mui-disabled{background-color:#f7f7f7}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Accordion from '@mui/material/Accordion';
|
|
3
|
+
import AccordionSummary from '@mui/material/AccordionSummary';
|
|
4
|
+
import AccordionDetails from '@mui/material/AccordionDetails';
|
|
5
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
6
|
+
import Skeleton from '@mui/material/Skeleton';
|
|
7
|
+
import { SkeletonChangeItemEditorLoader } from '../ChangeItemEditor';
|
|
8
|
+
import styles from './EntityChangesGroup.module.css';
|
|
9
|
+
export var SkeletonEntityChangesGroupLoader = function () {
|
|
10
|
+
return (React.createElement(Accordion, { className: styles.entityGroup, classes: { disabled: styles.skeletonEntityGroupDisabled }, defaultExpanded: true, disabled: true },
|
|
11
|
+
React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null), className: styles.entityHeader, classes: {
|
|
12
|
+
content: styles.accordionContent
|
|
13
|
+
} },
|
|
14
|
+
React.createElement(Skeleton, { variant: "text", width: "150px", height: 30 })),
|
|
15
|
+
React.createElement(AccordionDetails, { className: styles.attributesList }, Array.from({ length: 3 }).map(function (_, index) { return (React.createElement(SkeletonChangeItemEditorLoader, { key: "change-list-item-loader-".concat(index) })); }))));
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isNil } from 'ramda';
|
|
2
|
+
import { DCROperationTypes, isRelationTypeUri } from '@reltio/mdm-sdk';
|
|
3
|
+
export var isEditableChange = function (change, entityInfo) {
|
|
4
|
+
var _a;
|
|
5
|
+
var currentAttributeTypeUri = (_a = change.attributeType) === null || _a === void 0 ? void 0 : _a.uri;
|
|
6
|
+
var isExistingReferenceEntityChange = entityInfo.isExist &&
|
|
7
|
+
currentAttributeTypeUri &&
|
|
8
|
+
change.isReferenceSubAttribute &&
|
|
9
|
+
change.operation === DCROperationTypes.ADDED &&
|
|
10
|
+
!isRelationTypeUri(currentAttributeTypeUri);
|
|
11
|
+
return !!currentAttributeTypeUri && !isExistingReferenceEntityChange && !isNil(change.newValue);
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DCRChanges, GroupedObjectsInfo } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
entityInfo: GroupedObjectsInfo['entity'];
|
|
5
|
+
changes: DCRChanges;
|
|
6
|
+
dcrUri: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const DCREntityUriLink: ({ entityInfo, changes, dcrUri, className }: Props) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { always, any, ifElse, propOr } from 'ramda';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { getEntityUriForLink, getLabel } from '@reltio/mdm-sdk';
|
|
5
|
+
import { EntityUriLink } from '../../../EntityUriLink';
|
|
6
|
+
import { getEntityUriForChangeRequest, isCreateEntityOperation } from '../helpers/dcr';
|
|
7
|
+
import classes from './DCREntityUriLink.module.css';
|
|
8
|
+
export var DCREntityUriLink = function (_a) {
|
|
9
|
+
var entityInfo = _a.entityInfo, changes = _a.changes, dcrUri = _a.dcrUri, className = _a.className;
|
|
10
|
+
var entityUri = ifElse(any(isCreateEntityOperation), always(getEntityUriForChangeRequest(dcrUri, entityInfo.uri)), always(getEntityUriForLink(entityInfo)))(propOr([], entityInfo.uri, changes));
|
|
11
|
+
var screen = ifElse(any(isCreateEntityOperation), always('dcrReview'), always('profile'))(propOr([], entityInfo.uri, changes));
|
|
12
|
+
return (React.createElement(EntityUriLink, { className: classnames(classes.link, className), value: entityUri, screen: screen },
|
|
13
|
+
React.createElement("div", { className: classes.label }, getLabel(entityInfo.label))));
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"link":"DCREntityUriLink-link--cTnX-","label":"DCREntityUriLink-label--okYmG"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.DCREntityUriLink-link--cTnX-{color:var(--mui-palette-primary-main);cursor:pointer;font-size:12px;text-decoration:none}.DCREntityUriLink-label--okYmG{letter-spacing:0;line-height:16px;white-space:break-spaces}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DCROperationTypes } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
operation: DCROperationTypes;
|
|
5
|
+
className?: string;
|
|
6
|
+
size?: 'small' | 'medium';
|
|
7
|
+
variant?: 'filled' | 'outlined';
|
|
8
|
+
};
|
|
9
|
+
export declare const OperationChip: ({ operation, className, size, variant }: Props) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import Chip from '@mui/material/Chip';
|
|
4
|
+
import { getOperationLabel } from '../helpers/common';
|
|
5
|
+
import styles from './OperationChip.module.css';
|
|
6
|
+
export var OperationChip = function (_a) {
|
|
7
|
+
var operation = _a.operation, className = _a.className, _b = _a.size, size = _b === void 0 ? 'small' : _b, _c = _a.variant, variant = _c === void 0 ? 'outlined' : _c;
|
|
8
|
+
return (React.createElement(Chip, { variant: variant, label: getOperationLabel(operation), size: size, className: classnames(styles.chip, styles[operation], className) }));
|
|
9
|
+
};
|