@reltio/components 1.4.2199 → 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/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/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/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/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
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"chip":"OperationChip-chip--1GvDu","edited":"OperationChip-edited--szKT3","added":"OperationChip-added--LBI82","deleted":"OperationChip-deleted--3-a9r","ignored":"OperationChip-ignored--xwl3i"};
|
|
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 = `.OperationChip-chip--1GvDu{border-color:var(--mui-palette-primary-main);color:var(--mui-palette-primary-main);flex-shrink:0;font-size:10px;font-weight:500;height:20px;letter-spacing:0;line-height:16px;text-transform:capitalize}.OperationChip-chip--1GvDu.OperationChip-edited--szKT3{border-color:#cc7500;color:#cc7500}.OperationChip-chip--1GvDu.OperationChip-added--LBI82{border-color:#599e0e;color:#599e0e}.OperationChip-chip--1GvDu.OperationChip-deleted--3-a9r{border-color:#cf0e26;color:#cf0e26}.OperationChip-chip--1GvDu.OperationChip-ignored--xwl3i{border-color:#3075c9;color:#3075c9}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OperationChip } from './OperationChip';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OperationChip } from './OperationChip';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType, DCRAttributeValue, TRelationType } from '@reltio/mdm-sdk';
|
|
3
|
+
type Props = {
|
|
4
|
+
attributeOrRelationType: AttributeType | TRelationType;
|
|
5
|
+
attributeValue: DCRAttributeValue;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const RelationEntityLink: ({ attributeOrRelationType, attributeValue, className }: Props) => React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { useCallback, useContext } from 'react';
|
|
2
|
+
import { isNil } from 'ramda';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { getLabel, isReference } from '@reltio/mdm-sdk';
|
|
5
|
+
import { getAttributeDescription } from '../helpers/common';
|
|
6
|
+
import { EntityUriLink } from '../../../EntityUriLink';
|
|
7
|
+
import { useMdmEntityUri } from '../../../contexts/MdmModuleContext';
|
|
8
|
+
import { AttributesChangesContext } from '../AttributesChanges/AttributesChangesContext';
|
|
9
|
+
import styles from './RelationEntityLink.module.css';
|
|
10
|
+
export var RelationEntityLink = function (_a) {
|
|
11
|
+
var _b, _c;
|
|
12
|
+
var _d;
|
|
13
|
+
var attributeOrRelationType = _a.attributeOrRelationType, attributeValue = _a.attributeValue, className = _a.className;
|
|
14
|
+
var objectsInfo = useContext(AttributesChangesContext);
|
|
15
|
+
var entityUri = useMdmEntityUri();
|
|
16
|
+
var getLinkDescription = useCallback(function () {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
if (isReference(attributeOrRelationType)) {
|
|
19
|
+
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;
|
|
20
|
+
return getAttributeDescription(attributeOrRelationType, value || attributeValue, entityUri, objectsInfo);
|
|
21
|
+
}
|
|
22
|
+
else if ('endObject' in attributeOrRelationType) {
|
|
23
|
+
var _d = attributeValue, endObjectUri = _d.endObjectUri, endObjectLabel = _d.endObjectLabel;
|
|
24
|
+
return {
|
|
25
|
+
objectUri: endObjectUri,
|
|
26
|
+
objectLabel: endObjectLabel
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}, [attributeOrRelationType, attributeValue, entityUri, objectsInfo]);
|
|
30
|
+
var _e = getLinkDescription() || {}, objectUri = _e.objectUri, objectLabel = _e.objectLabel;
|
|
31
|
+
if (isNil(objectUri) || isNil(objectLabel)) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
var isNotExist = ((_d = objectsInfo[objectUri]) === null || _d === void 0 ? void 0 : _d.isExist) === false;
|
|
35
|
+
return (React.createElement(EntityUriLink, { value: objectUri, className: classnames(styles.linkContainer, (_b = {}, _b[styles.disabledLink] = isNotExist, _b), className) },
|
|
36
|
+
React.createElement("span", { className: classnames(styles.linkLabel, (_c = {}, _c[styles.label] = isNotExist, _c)) }, getLabel(objectLabel))));
|
|
37
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"linkContainer":"RelationEntityLink-linkContainer--lrgwy","linkLabel":"RelationEntityLink-linkLabel--1-dRa","disabledLink":"RelationEntityLink-disabledLink--r8PS0","label":"RelationEntityLink-label--0---g"};
|
|
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 = `.RelationEntityLink-linkContainer--lrgwy{cursor:pointer;font-size:12px;margin-left:4px;text-decoration:none}.RelationEntityLink-linkLabel--1-dRa{color:var(--mui-palette-primary-main);letter-spacing:0;line-height:16px;white-space:break-spaces}.RelationEntityLink-disabledLink--r8PS0{cursor:default;pointer-events:none}.RelationEntityLink-label--0---g{color:var(--mui-palette-text-primary)}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RelationEntityLink } from './RelationEntityLink';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RelationEntityLink } from './RelationEntityLink';
|
|
@@ -48,7 +48,7 @@ export var ReviewDCRDialog = function (_a) {
|
|
|
48
48
|
React.createElement("div", { className: styles.editableItem },
|
|
49
49
|
React.createElement(AssigneeSelector, { taskId: task.taskId, assignee: task.assignee, isTaskOpen: task.isOpen })))),
|
|
50
50
|
React.createElement("div", { className: styles.changesSection },
|
|
51
|
-
React.createElement(ChangeRequestEditor, { dcr: dcr, task: task }))),
|
|
51
|
+
React.createElement(ChangeRequestEditor, { dcr: dcr, task: task, groupedObjects: groupedObjects }))),
|
|
52
52
|
canViewComments && (React.createElement(WorkflowComments, { workflowActions: workflowActions, actionRequestIsInProgress: actionRequestIsInProgress, preferredAction: task.preferredAction, taskId: task.taskId, processInstanceComments: task.processInstanceComments, isTaskOpen: task.isOpen, showActionButtons: false, alwaysExpanded: true, classes: {
|
|
53
53
|
container: styles.commentsRootContainer,
|
|
54
54
|
commentsContainer: styles.commentsContainer
|
|
@@ -3,7 +3,7 @@ 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 = `.ReviewDCRDialog-dialogTitle--xCXtj{align-items:center;border-bottom:1px solid #e0e0e0;display:flex;justify-content:space-between;padding:12px 16px 8px}.ReviewDCRDialog-titleContent--Hh2KH{align-items:center;display:flex;flex:1;justify-content:space-between;position:relative}.ReviewDCRDialog-titleText--ME8s4{flex:1;margin:0;padding-left:48px}.ReviewDCRDialog-closeButton--YMAEf{color:#666;left:15px;position:absolute}.ReviewDCRDialog-closeButton--YMAEf:hover{background-color:
|
|
6
|
+
style.innerHTML = `.ReviewDCRDialog-dialogTitle--xCXtj{align-items:center;border-bottom:1px solid #e0e0e0;display:flex;justify-content:space-between;padding:12px 16px 8px}.ReviewDCRDialog-titleContent--Hh2KH{align-items:center;display:flex;flex:1;justify-content:space-between;position:relative}.ReviewDCRDialog-titleText--ME8s4{flex:1;margin:0;padding-left:48px}.ReviewDCRDialog-closeButton--YMAEf{color:#666;left:15px;position:absolute}.ReviewDCRDialog-closeButton--YMAEf:hover{background-color:var(--mui-palette-action-hover);color:var(--mui-palette-text-primary)}.ReviewDCRDialog-content--qvUva{display:flex;min-height:400px;padding:0!important;width:100%}.ReviewDCRDialog-leftSection--5MELW{border-right:1px solid #e0e0e0;display:flex;flex-direction:column;padding:0 16px;width:100%}.ReviewDCRDialog-profileBand--7r6Xy{margin-left:-16px}.ReviewDCRDialog-profileBandRoot--G7p1m{box-shadow:none;margin-bottom:0}.ReviewDCRDialog-editableSection--v-D7a{border:1px solid #d9d9d9;border-radius:0 0 8px 8px;margin-bottom:16px;padding:8px 16px 14px}.ReviewDCRDialog-editableGrid--auc-d{display:grid;gap:24px;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));margin-bottom:12px}.ReviewDCRDialog-editableItem--isGwv{display:flex;flex-direction:column}.ReviewDCRDialog-priorityField--LQ1n3{min-width:200px}.ReviewDCRDialog-changesSection--qj2OK{flex-grow:1;margin-bottom:16px;position:relative}.ReviewDCRDialog-commentsRootContainer--g2f7m{margin:10px 0 16px 10px;min-width:323px;width:323px}.ReviewDCRDialog-commentsContainer--OApOx{flex-grow:1;max-height:100%}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
export default styles;
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import Skeleton from '@mui/material/Skeleton';
|
|
4
|
-
import i18n from 'ui-i18n';
|
|
5
|
-
import { DCROperationTypes } from '@reltio/mdm-sdk';
|
|
6
4
|
import { useMdmMetadata } from '../../../../../contexts/MdmModuleContext';
|
|
7
5
|
import { calculateDCRChanges } from '../../helpers';
|
|
6
|
+
import { getOperationLabel } from '../../../helpers/common';
|
|
8
7
|
import styles from './DCRChangesSummary.module.css';
|
|
9
|
-
var getOperationLabel = function (operation) {
|
|
10
|
-
var _a;
|
|
11
|
-
var labels = (_a = {},
|
|
12
|
-
_a[DCROperationTypes.ADDED] = i18n.text('Added'),
|
|
13
|
-
_a[DCROperationTypes.EDITED] = i18n.text('Edited'),
|
|
14
|
-
_a[DCROperationTypes.DELETED] = i18n.text('Deleted'),
|
|
15
|
-
_a[DCROperationTypes.PINNED] = i18n.text('Pinned'),
|
|
16
|
-
_a[DCROperationTypes.PIN_DELETED] = i18n.text('Pin deleted'),
|
|
17
|
-
_a[DCROperationTypes.IGNORED] = i18n.text('Ignored'),
|
|
18
|
-
_a[DCROperationTypes.IGNORE_DELETED] = i18n.text('Ignore deleted'),
|
|
19
|
-
_a);
|
|
20
|
-
return labels[operation] || operation || '';
|
|
21
|
-
};
|
|
22
8
|
var ChangeItem = function (_a) {
|
|
23
9
|
var count = _a.count, operation = _a.operation;
|
|
24
10
|
return count > 0 && (React.createElement("div", { className: styles.changeItem },
|
|
@@ -32,7 +18,7 @@ export var DCRChangesSummary = function (_a) {
|
|
|
32
18
|
var changes = _a.changes, groupedObjects = _a.groupedObjects;
|
|
33
19
|
var metadata = useMdmMetadata();
|
|
34
20
|
var dcrChanges = useMemo(function () { return (changes ? calculateDCRChanges(metadata, changes, groupedObjects) : null); }, [metadata, changes, groupedObjects]);
|
|
35
|
-
var changesLoaded = !!dcrChanges;
|
|
21
|
+
var changesLoaded = !!dcrChanges && groupedObjects.length > 0;
|
|
36
22
|
return (React.createElement("div", { className: styles.changesSummary, "data-reltio-id": "dcr-changes-summary" },
|
|
37
23
|
!changesLoaded && React.createElement(LoadingSkeleton, null),
|
|
38
24
|
changesLoaded &&
|
|
@@ -3,7 +3,7 @@ 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 = `.DCRChangesSummary-changesSummary--31gR-{align-items:center;display:flex;gap:22px}.DCRChangesSummary-changeItem---XfYP{align-items:center;display:flex;flex-direction:column;gap:4px;position:relative}.DCRChangesSummary-changeItem---XfYP:not(:last-child):after{background-color:#d9d9d9;bottom:2px;content:"";height:20px;position:absolute;right:-12px;top:2px;width:1px}.DCRChangesSummary-changeNumber--vZxc4{font-size:16px;font-weight:500;line-height:1}.DCRChangesSummary-changeLabel--tDXS6{color:var(--mui-palette-text-primary);font-size:13px}.DCRChangesSummary-edited--KFivZ{color:#eb9d08}.DCRChangesSummary-added--KGdGw{color:#599e0e}.DCRChangesSummary-deleted--TWgS5{color:#eb5757}.DCRChangesSummary-ignored--Q2Q8R{color:var(--mui-palette-primary-light)}`;
|
|
6
|
+
style.innerHTML = `.DCRChangesSummary-changesSummary--31gR-{align-items:center;display:flex;gap:22px}.DCRChangesSummary-changeItem---XfYP{align-items:center;display:flex;flex-direction:column;gap:4px;position:relative}.DCRChangesSummary-changeItem---XfYP:not(:last-child):after{background-color:#d9d9d9;bottom:2px;content:"";height:20px;position:absolute;right:-12px;top:2px;width:1px}.DCRChangesSummary-changeNumber--vZxc4{font-size:16px;font-weight:500;line-height:1}.DCRChangesSummary-changeLabel--tDXS6{color:var(--mui-palette-text-primary);font-size:13px;text-transform:capitalize}.DCRChangesSummary-edited--KFivZ{color:#eb9d08}.DCRChangesSummary-added--KGdGw{color:#599e0e}.DCRChangesSummary-deleted--TWgS5{color:#eb5757}.DCRChangesSummary-ignored--Q2Q8R{color:var(--mui-palette-primary-light)}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
export default styles;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeChanges } from '../../
|
|
1
|
+
import { mergeChanges } from '../../helpers/merge';
|
|
2
2
|
export var calculateDCRChanges = function (metadata, changes, groupedObjects) {
|
|
3
3
|
var mergedChanges = groupedObjects.reduce(function (mergedChanges, object) {
|
|
4
4
|
var _a = mergeChanges(metadata, changes, object.entity, object.relations), mergedEntityChanges = _a[0], mergedRelationsChanges = _a[1];
|