@reltio/components 1.4.2203 → 1.4.2205
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/RolesInput/RolesInput.d.ts +2 -1
- package/RolesInput/RolesInput.js +2 -2
- package/TagsInput/TagsInput.d.ts +2 -1
- package/TagsInput/TagsInput.js +2 -2
- package/cjs/RolesInput/RolesInput.d.ts +2 -1
- package/cjs/RolesInput/RolesInput.js +2 -2
- package/cjs/TagsInput/TagsInput.d.ts +2 -1
- package/cjs/TagsInput/TagsInput.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +2 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts +4 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +28 -18
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.module.css.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.js +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → ChangeItemLabel}/ChangeItemLabel.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/ChangeItemLabel.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +3 -3
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +20 -8
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js +2 -2
- package/{features/workflow/ChangeRequestEditor/components/ChangeItemEditor → cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditor}/DCRValueEditor.d.ts +2 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → DCRValueEditor}/DCRValueEditor.js +6 -5
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditor/DCRValueEditor.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditor/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditor/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → DCRValueEditorFactory}/DCRValueEditorFactory.d.ts +2 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → DCRValueEditorFactory}/DCRValueEditorFactory.js +4 -4
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +4 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.module.css.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.d.ts +7 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.js +21 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/context/index.d.ts +4 -1
- package/cjs/features/workflow/ChangeRequestEditor/context/index.js +30 -4
- package/cjs/features/workflow/ChangeRequestEditor/helpers/helpers.d.ts +2 -1
- package/cjs/features/workflow/ChangeRequestEditor/helpers/helpers.js +5 -1
- package/cjs/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.d.ts +16 -0
- package/cjs/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.js +42 -0
- package/cjs/features/workflow/OperationChip/OperationChip.js +1 -1
- package/cjs/features/workflow/OperationChip/OperationChip.module.css.js +2 -2
- 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.module.css.js +1 -1
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRSummaryInfo/DCRSummaryInfo.module.css.js +1 -1
- package/cjs/features/workflow/helpers/attributes.js +6 -4
- package/cjs/features/workflow/helpers/common.d.ts +1 -1
- package/cjs/features/workflow/helpers/common.js +3 -3
- package/cjs/features/workflow/helpers/common.test.js +4 -4
- package/cjs/features/workflow/helpers/merge.js +3 -1
- package/cjs/features/workflow/helpers/merge.test.js +79 -0
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +2 -1
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts +4 -1
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +28 -18
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.module.css.js +2 -2
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.js +1 -1
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → ChangeItemLabel}/ChangeItemLabel.js +1 -1
- package/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/ChangeItemLabel.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +3 -3
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +20 -8
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js +2 -2
- package/{cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor → features/workflow/ChangeRequestEditor/components/DCRValueEditor}/DCRValueEditor.d.ts +2 -1
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → DCRValueEditor}/DCRValueEditor.js +5 -4
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditor/DCRValueEditor.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditor/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditor/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → DCRValueEditorFactory}/DCRValueEditorFactory.d.ts +2 -1
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → DCRValueEditorFactory}/DCRValueEditorFactory.js +4 -4
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +4 -1
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.module.css.js +2 -2
- package/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.d.ts +7 -0
- package/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.js +14 -0
- package/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/StatusChips/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/StatusChips/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/context/index.d.ts +4 -1
- package/features/workflow/ChangeRequestEditor/context/index.js +30 -4
- package/features/workflow/ChangeRequestEditor/helpers/helpers.d.ts +2 -1
- package/features/workflow/ChangeRequestEditor/helpers/helpers.js +4 -1
- package/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.d.ts +16 -0
- package/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.js +38 -0
- package/features/workflow/OperationChip/OperationChip.js +1 -1
- package/features/workflow/OperationChip/OperationChip.module.css.js +2 -2
- package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +2 -2
- package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.module.css.js +1 -1
- package/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.module.css.js +1 -1
- package/features/workflow/ReviewDCRDialog/components/DCRSummaryInfo/DCRSummaryInfo.module.css.js +1 -1
- package/features/workflow/helpers/attributes.js +6 -4
- package/features/workflow/helpers/common.d.ts +1 -1
- package/features/workflow/helpers/common.js +3 -3
- package/features/workflow/helpers/common.test.js +4 -4
- package/features/workflow/helpers/merge.js +4 -2
- package/features/workflow/helpers/merge.test.js +79 -0
- package/package.json +2 -2
- /package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → ChangeItemLabel}/ChangeItemLabel.d.ts +0 -0
- /package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → ChangeItemLabel}/ChangeItemLabel.d.ts +0 -0
|
@@ -24,13 +24,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ChangeRequestEditorProvider = exports.ChangeRequestEditorContext = void 0;
|
|
27
|
-
var react_context_selector_1 = require("@fluentui/react-context-selector");
|
|
28
27
|
var react_1 = __importStar(require("react"));
|
|
28
|
+
var ramda_1 = require("ramda");
|
|
29
|
+
var react_context_selector_1 = require("@fluentui/react-context-selector");
|
|
29
30
|
exports.ChangeRequestEditorContext = (0, react_context_selector_1.createContext)({
|
|
30
31
|
updateChange: undefined,
|
|
31
32
|
getLineData: undefined,
|
|
32
33
|
rejectChange: undefined,
|
|
33
|
-
revertChangeUpdateOrReject: undefined
|
|
34
|
+
revertChangeUpdateOrReject: undefined,
|
|
35
|
+
getIsParentLineRejected: undefined,
|
|
36
|
+
getIsLineRejected: undefined,
|
|
37
|
+
getIsLineUpdated: undefined
|
|
34
38
|
});
|
|
35
39
|
var ChangeRequestEditorProvider = function (_a) {
|
|
36
40
|
var children = _a.children;
|
|
@@ -57,7 +61,11 @@ var ChangeRequestEditorProvider = function (_a) {
|
|
|
57
61
|
setLineDataMap(function (prevMap) {
|
|
58
62
|
var newMap = new Map(prevMap);
|
|
59
63
|
lineIds.forEach(function (id) {
|
|
60
|
-
newMap.
|
|
64
|
+
newMap.forEach(function (_, key) {
|
|
65
|
+
if (key.startsWith("".concat(id, "/")) || key === id) {
|
|
66
|
+
newMap.delete(key);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
61
69
|
});
|
|
62
70
|
return newMap;
|
|
63
71
|
});
|
|
@@ -65,11 +73,29 @@ var ChangeRequestEditorProvider = function (_a) {
|
|
|
65
73
|
var getLineData = (0, react_1.useCallback)(function (lineId) {
|
|
66
74
|
return lineDataMap.get(lineId);
|
|
67
75
|
}, [lineDataMap]);
|
|
76
|
+
var getIsLineRejected = (0, react_1.useCallback)(function (lineId) {
|
|
77
|
+
var _a;
|
|
78
|
+
return ((_a = lineDataMap.get(lineId)) === null || _a === void 0 ? void 0 : _a.isRejected) || false;
|
|
79
|
+
}, [lineDataMap]);
|
|
80
|
+
var getIsParentLineRejected = (0, react_1.useCallback)(function (lineId) {
|
|
81
|
+
var lineIdParts = (lineId || '').split('/');
|
|
82
|
+
var possibleRejectedIds = Array.from({ length: lineIdParts.length - 1 }).reduce(function (ids, _, index) {
|
|
83
|
+
return ids.concat(lineIdParts.slice(0, index + 1).join('/'));
|
|
84
|
+
}, []);
|
|
85
|
+
return possibleRejectedIds.some(function (lineId) { var _a; return (_a = lineDataMap.get(lineId)) === null || _a === void 0 ? void 0 : _a.isRejected; });
|
|
86
|
+
}, [lineDataMap]);
|
|
87
|
+
var getIsLineUpdated = (0, react_1.useCallback)(function (lineId) {
|
|
88
|
+
var _a;
|
|
89
|
+
return !(0, ramda_1.isNil)((_a = lineDataMap.get(lineId)) === null || _a === void 0 ? void 0 : _a.value);
|
|
90
|
+
}, [lineDataMap]);
|
|
68
91
|
var contextValue = {
|
|
69
92
|
updateChange: updateChange,
|
|
70
93
|
getLineData: getLineData,
|
|
71
94
|
rejectChange: rejectChange,
|
|
72
|
-
revertChangeUpdateOrReject: revertChangeUpdateOrReject
|
|
95
|
+
revertChangeUpdateOrReject: revertChangeUpdateOrReject,
|
|
96
|
+
getIsParentLineRejected: getIsParentLineRejected,
|
|
97
|
+
getIsLineRejected: getIsLineRejected,
|
|
98
|
+
getIsLineUpdated: getIsLineUpdated
|
|
73
99
|
};
|
|
74
100
|
return react_1.default.createElement(exports.ChangeRequestEditorContext.Provider, { value: contextValue }, children);
|
|
75
101
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DCRChanges, GroupedObjectsInfo, EnrichedDCRChanges } from '@reltio/mdm-sdk';
|
|
2
|
-
import { Diff } from '../../types';
|
|
2
|
+
import { Diff, Title } from '../../types';
|
|
3
3
|
export declare const isEditableChange: (change: Diff, entityInfo: GroupedObjectsInfo["entity"]) => boolean;
|
|
4
4
|
export declare const addLineIdToValue: (data: DCRChanges) => EnrichedDCRChanges;
|
|
5
|
+
export declare const isDiffChange: (change: Diff | Title) => change is Diff;
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.addLineIdToValue = exports.isEditableChange = void 0;
|
|
14
|
+
exports.isDiffChange = exports.addLineIdToValue = exports.isEditableChange = void 0;
|
|
15
15
|
var ramda_1 = require("ramda");
|
|
16
16
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
17
17
|
var isEditableChange = function (change, entityInfo) {
|
|
@@ -103,3 +103,7 @@ var addLineIdToValue = function (data) {
|
|
|
103
103
|
return enrichedData;
|
|
104
104
|
};
|
|
105
105
|
exports.addLineIdToValue = addLineIdToValue;
|
|
106
|
+
var isDiffChange = function (change) {
|
|
107
|
+
return (0, ramda_1.has)('level', change);
|
|
108
|
+
};
|
|
109
|
+
exports.isDiffChange = isDiffChange;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PrimitiveValue, SimpleAttributeValue } from '@reltio/mdm-sdk';
|
|
2
|
+
import { Diff } from '../../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
change: Diff;
|
|
5
|
+
};
|
|
6
|
+
export declare const useChangeRequestEditor: ({ change }: Props) => {
|
|
7
|
+
handleChange: (newValue: SimpleAttributeValue | string[] | PrimitiveValue) => void;
|
|
8
|
+
handleReject: () => void;
|
|
9
|
+
handleRevert: () => void;
|
|
10
|
+
lineData: import("../context").LineData;
|
|
11
|
+
isLineRejected: boolean;
|
|
12
|
+
isParentLineRejected: boolean;
|
|
13
|
+
isUpdated: boolean;
|
|
14
|
+
hasChangeId: boolean;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useChangeRequestEditor = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var react_context_selector_1 = require("@fluentui/react-context-selector");
|
|
6
|
+
var context_1 = require("../context");
|
|
7
|
+
var merge_1 = require("../../helpers/merge");
|
|
8
|
+
var emptyLineIds = [];
|
|
9
|
+
var useChangeRequestEditor = function (_a) {
|
|
10
|
+
var change = _a.change;
|
|
11
|
+
var lineIds = change.lineIds || (0, merge_1.extractLineIds)(change === null || change === void 0 ? void 0 : change.newValue) || emptyLineIds;
|
|
12
|
+
var lineData = (0, react_context_selector_1.useContextSelector)(context_1.ChangeRequestEditorContext, function (context) { return context.getLineData(lineIds[0]); });
|
|
13
|
+
var updateChange = (0, react_context_selector_1.useContextSelector)(context_1.ChangeRequestEditorContext, function (context) { return context.updateChange; });
|
|
14
|
+
var rejectChange = (0, react_context_selector_1.useContextSelector)(context_1.ChangeRequestEditorContext, function (context) { return context.rejectChange; });
|
|
15
|
+
var revertChangeUpdateOrReject = (0, react_context_selector_1.useContextSelector)(context_1.ChangeRequestEditorContext, function (context) { return context.revertChangeUpdateOrReject; });
|
|
16
|
+
var isParentLineRejected = (0, react_context_selector_1.useContextSelector)(context_1.ChangeRequestEditorContext, function (context) {
|
|
17
|
+
return context.getIsParentLineRejected(lineIds[0]);
|
|
18
|
+
});
|
|
19
|
+
var isUpdated = (0, react_context_selector_1.useContextSelector)(context_1.ChangeRequestEditorContext, function (context) { return context.getIsLineUpdated(lineIds[0]); });
|
|
20
|
+
var isLineRejected = lineData === null || lineData === void 0 ? void 0 : lineData.isRejected;
|
|
21
|
+
var hasChangeId = lineIds.length > 0;
|
|
22
|
+
var handleChange = (0, react_1.useCallback)(function (newValue) {
|
|
23
|
+
updateChange(lineIds, typeof newValue === 'object' && 'value' in newValue ? newValue : { value: newValue });
|
|
24
|
+
}, [lineIds, updateChange]);
|
|
25
|
+
var handleReject = (0, react_1.useCallback)(function () {
|
|
26
|
+
rejectChange(lineIds);
|
|
27
|
+
}, [rejectChange, lineIds]);
|
|
28
|
+
var handleRevert = (0, react_1.useCallback)(function () {
|
|
29
|
+
revertChangeUpdateOrReject(lineIds);
|
|
30
|
+
}, [revertChangeUpdateOrReject, lineIds]);
|
|
31
|
+
return {
|
|
32
|
+
handleChange: handleChange,
|
|
33
|
+
handleReject: handleReject,
|
|
34
|
+
handleRevert: handleRevert,
|
|
35
|
+
lineData: lineData,
|
|
36
|
+
isLineRejected: isLineRejected,
|
|
37
|
+
isParentLineRejected: isParentLineRejected,
|
|
38
|
+
isUpdated: isUpdated,
|
|
39
|
+
hasChangeId: hasChangeId
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.useChangeRequestEditor = useChangeRequestEditor;
|
|
@@ -11,6 +11,6 @@ var common_1 = require("../helpers/common");
|
|
|
11
11
|
var OperationChip_module_css_1 = __importDefault(require("./OperationChip.module.css"));
|
|
12
12
|
var OperationChip = function (_a) {
|
|
13
13
|
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;
|
|
14
|
-
return (react_1.default.createElement(Chip_1.default, { variant: variant, label: (0, common_1.getOperationLabel)(operation), size: size, className: (0, classnames_1.default)(OperationChip_module_css_1.default.chip, OperationChip_module_css_1.default[operation], className) }));
|
|
14
|
+
return (react_1.default.createElement(Chip_1.default, { variant: variant, label: (0, common_1.getOperationLabel)(operation), size: size, className: (0, classnames_1.default)(OperationChip_module_css_1.default.chip, OperationChip_module_css_1.default[operation], className), classes: { label: OperationChip_module_css_1.default.label } }));
|
|
15
15
|
};
|
|
16
16
|
exports.OperationChip = OperationChip;
|
|
@@ -1,9 +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"};
|
|
1
|
+
const styles = {"chip":"OperationChip-chip--1GvDu","label":"OperationChip-label--OCDk2","edited":"OperationChip-edited--szKT3","added":"OperationChip-added--LBI82","deleted":"OperationChip-deleted--3-a9r","ignored":"OperationChip-ignored--xwl3i"};
|
|
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 = `.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
|
|
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}.OperationChip-label--OCDk2:first-letter{text-transform:uppercase}.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
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
module.exports = styles;
|
|
@@ -41,7 +41,7 @@ var ReviewDCRDialog = function (_a) {
|
|
|
41
41
|
react_1.default.createElement("div", { className: ReviewDCRDialog_module_css_1.default.titleContent },
|
|
42
42
|
react_1.default.createElement(Typography_1.default, { variant: "h6", className: ReviewDCRDialog_module_css_1.default.titleText }, ui_i18n_1.default.text('Review DCR')),
|
|
43
43
|
react_1.default.createElement(WorkflowActionButtons_1.WorkflowActionButtons, { workflowActions: workflowActions, actionRequestIsInProgress: actionRequestIsInProgress, preferredAction: task.preferredAction })),
|
|
44
|
-
react_1.default.createElement(SmallIconButton_1.
|
|
44
|
+
react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, { tooltipTitle: ui_i18n_1.default.text('Close'), "aria-label": ui_i18n_1.default.text('Close'), icon: Close_1.default, onClick: onClose, className: ReviewDCRDialog_module_css_1.default.closeButton, size: "L" })),
|
|
45
45
|
react_1.default.createElement(DialogContent_1.default, { classes: { root: ReviewDCRDialog_module_css_1.default.content } },
|
|
46
46
|
react_1.default.createElement("div", { className: ReviewDCRDialog_module_css_1.default.leftSection },
|
|
47
47
|
react_1.default.createElement(ProfileBand_1.ProfileBand, { entity: entity, className: ReviewDCRDialog_module_css_1.default.profileBandRoot, classes: { profileBand: ReviewDCRDialog_module_css_1.default.profileBand } }),
|
|
@@ -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: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%}`;
|
|
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;height:37px;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
|
module.exports = styles;
|
|
@@ -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
|
|
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-changeLabel--tDXS6:first-letter{text-transform:uppercase}.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
|
module.exports = styles;
|
package/cjs/features/workflow/ReviewDCRDialog/components/DCRSummaryInfo/DCRSummaryInfo.module.css.js
CHANGED
|
@@ -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 = `.DCRSummaryInfo-requestSummary--FUaA0{align-items:flex-start;background-color:rgba(0,0,0,.03);border-radius:8px;display:flex;justify-content:space-between;padding:16px 8px 12px}.DCRSummaryInfo-summaryLeft--Y79jA{align-items:flex-start;display:flex;gap:16px}.DCRSummaryInfo-summaryIcon--VlZsg{padding-top:4px}.DCRSummaryInfo-summaryContent--BdPl7{display:flex;flex-direction:column;gap:3px}.DCRSummaryInfo-summaryTitle--77exU{font-size:16px;font-weight:500;margin:0}.DCRSummaryInfo-summaryDetails--u5ije{display:flex;flex-wrap:wrap;font-size:12px;gap:8px}.DCRSummaryInfo-summaryItem--DbTdR{color:var(--mui-palette-text-primary);font-size:13px;margin:0}.DCRSummaryInfo-summaryItemName--l7hYO{color:var(--mui-palette-text-secondary)}.DCRSummaryInfo-summaryItemDate--EQpJ0{margin-left:-4px}.DCRSummaryInfo-summaryRight--9pEaH{align-items:center;display:flex;padding:3px 9px}`;
|
|
6
|
+
style.innerHTML = `.DCRSummaryInfo-requestSummary--FUaA0{align-items:flex-start;background-color:rgba(0,0,0,.03);border-radius:8px 8px 0 0;display:flex;justify-content:space-between;padding:16px 8px 12px}.DCRSummaryInfo-summaryLeft--Y79jA{align-items:flex-start;display:flex;gap:16px}.DCRSummaryInfo-summaryIcon--VlZsg{padding-top:4px}.DCRSummaryInfo-summaryContent--BdPl7{display:flex;flex-direction:column;gap:3px}.DCRSummaryInfo-summaryTitle--77exU{font-size:16px;font-weight:500;margin:0}.DCRSummaryInfo-summaryDetails--u5ije{display:flex;flex-wrap:wrap;font-size:12px;gap:8px}.DCRSummaryInfo-summaryItem--DbTdR{color:var(--mui-palette-text-primary);font-size:13px;margin:0}.DCRSummaryInfo-summaryItemName--l7hYO{color:var(--mui-palette-text-secondary)}.DCRSummaryInfo-summaryItemDate--EQpJ0{margin-left:-4px}.DCRSummaryInfo-summaryRight--9pEaH{align-items:center;display:flex;padding:3px 9px}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
module.exports = styles;
|
|
@@ -92,13 +92,15 @@ var getReferenceAttributeChange = function (metadata, attributeType, attributeVa
|
|
|
92
92
|
];
|
|
93
93
|
};
|
|
94
94
|
var getDiffParameters = function (_a) {
|
|
95
|
-
var newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type;
|
|
96
|
-
return type === mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE
|
|
95
|
+
var newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type, newPinOrIgnoreValue = _a.newPinOrIgnoreValue;
|
|
96
|
+
return type === mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE
|
|
97
|
+
? { type: type, newValue: newValue, oldValue: oldValue, newPinOrIgnoreValue: newPinOrIgnoreValue }
|
|
98
|
+
: { type: type, newValue: oldValue || newValue, newPinOrIgnoreValue: newPinOrIgnoreValue };
|
|
97
99
|
};
|
|
98
100
|
var getSimpleAttributeChange = function (attributeType, attributeValue, level, isReferenceSubAttribute) {
|
|
99
101
|
if (isReferenceSubAttribute === void 0) { isReferenceSubAttribute = false; }
|
|
100
|
-
var _a = getDiffParameters(attributeValue), newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type;
|
|
101
|
-
var operation = (0, common_1.getOperationType)(type,
|
|
102
|
+
var _a = getDiffParameters(attributeValue), newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type, newPinOrIgnoreValue = _a.newPinOrIgnoreValue;
|
|
103
|
+
var operation = (0, common_1.getOperationType)(type, newPinOrIgnoreValue);
|
|
102
104
|
var label = (attributeType === null || attributeType === void 0 ? void 0 : attributeType.label) || (attributeType === null || attributeType === void 0 ? void 0 : attributeType.name);
|
|
103
105
|
return {
|
|
104
106
|
attributeType: attributeType,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AttributeType, DCRAttributeValue, DCRObjectsInfo, DCROperationTypes, DCRValue, Metadata, WorkflowDefinition, WorkflowTaskData } from '@reltio/mdm-sdk';
|
|
2
|
-
export declare const getOperationType: (type: string,
|
|
2
|
+
export declare const getOperationType: (type: string, newPinOrIgnoreValue?: boolean) => DCROperationTypes;
|
|
3
3
|
export declare const getOperationLabel: (operation: DCROperationTypes) => string;
|
|
4
4
|
export declare const getAttributeDescription: (attrType: AttributeType, value: DCRAttributeValue, currentEntityUri: string, objectsInfo?: DCRObjectsInfo) => {
|
|
5
5
|
objectUri: string;
|
|
@@ -7,7 +7,7 @@ exports.prepareRolesOrTagsValue = exports.findWorkflowDefinitionByType = exports
|
|
|
7
7
|
var ramda_1 = require("ramda");
|
|
8
8
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
9
9
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
10
|
-
var getOperationType = function (type,
|
|
10
|
+
var getOperationType = function (type, newPinOrIgnoreValue) {
|
|
11
11
|
switch (type) {
|
|
12
12
|
case mdm_sdk_1.DCRTypes.CREATE_RELATIONSHIP:
|
|
13
13
|
case mdm_sdk_1.DCRTypes.INSERT_ATTRIBUTE:
|
|
@@ -20,9 +20,9 @@ var getOperationType = function (type, oldValue) {
|
|
|
20
20
|
case mdm_sdk_1.DCRTypes.DELETE_RELATIONSHIP:
|
|
21
21
|
return mdm_sdk_1.DCROperationTypes.DELETED;
|
|
22
22
|
case mdm_sdk_1.DCRTypes.PIN_ATTRIBUTE:
|
|
23
|
-
return
|
|
23
|
+
return newPinOrIgnoreValue ? mdm_sdk_1.DCROperationTypes.PINNED : mdm_sdk_1.DCROperationTypes.PIN_DELETED;
|
|
24
24
|
case mdm_sdk_1.DCRTypes.IGNORE_ATTRIBUTE:
|
|
25
|
-
return
|
|
25
|
+
return newPinOrIgnoreValue ? mdm_sdk_1.DCROperationTypes.IGNORED : mdm_sdk_1.DCROperationTypes.IGNORE_DELETED;
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
exports.getOperationType = getOperationType;
|
|
@@ -11,10 +11,10 @@ describe('common helpers', function () {
|
|
|
11
11
|
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE)).toBe(mdm_sdk_1.DCROperationTypes.EDITED);
|
|
12
12
|
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.DELETE_ATTRIBUTE)).toBe(mdm_sdk_1.DCROperationTypes.DELETED);
|
|
13
13
|
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.DELETE_RELATIONSHIP)).toBe(mdm_sdk_1.DCROperationTypes.DELETED);
|
|
14
|
-
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.PIN_ATTRIBUTE,
|
|
15
|
-
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.PIN_ATTRIBUTE,
|
|
16
|
-
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.IGNORE_ATTRIBUTE,
|
|
17
|
-
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.IGNORE_ATTRIBUTE,
|
|
14
|
+
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.PIN_ATTRIBUTE, true)).toBe(mdm_sdk_1.DCROperationTypes.PINNED);
|
|
15
|
+
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.PIN_ATTRIBUTE, false)).toBe(mdm_sdk_1.DCROperationTypes.PIN_DELETED);
|
|
16
|
+
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.IGNORE_ATTRIBUTE, true)).toBe(mdm_sdk_1.DCROperationTypes.IGNORED);
|
|
17
|
+
expect((0, common_1.getOperationType)(mdm_sdk_1.DCRTypes.IGNORE_ATTRIBUTE, false)).toBe(mdm_sdk_1.DCROperationTypes.IGNORE_DELETED);
|
|
18
18
|
});
|
|
19
19
|
it('getOperationLabel behaviour', function () {
|
|
20
20
|
expect((0, common_1.getOperationLabel)(mdm_sdk_1.DCROperationTypes.ADDED)).toBe('added');
|
|
@@ -112,7 +112,9 @@ var prepareAttribute = function (container, change) {
|
|
|
112
112
|
for (var i = 0; i < pathArray.length - 1; i = i + 2) {
|
|
113
113
|
var key = pathArray[i];
|
|
114
114
|
var id = pathArray[i + 1];
|
|
115
|
-
var currentValue =
|
|
115
|
+
var currentValue = i === pathArray.length - 2
|
|
116
|
+
? (holder[key] || []).find((0, ramda_1.both)((0, ramda_1.propEq)('id', id), (0, ramda_1.pathEq)(['value', 'type'], change === null || change === void 0 ? void 0 : change.type)))
|
|
117
|
+
: (holder[key] || []).find((0, ramda_1.propEq)('id', id));
|
|
116
118
|
if (!(0, ramda_1.isNil)(currentValue)) {
|
|
117
119
|
var newLineIds = (0, exports.extractLineIds)(change.newValue);
|
|
118
120
|
var oldLineIds = (0, exports.extractLineIds)(change.oldValue);
|
|
@@ -157,6 +157,85 @@ describe('mergeChanges tests', function () {
|
|
|
157
157
|
];
|
|
158
158
|
expect((0, merge_1.mergeChanges)(metadata_test_data_1.metadata, changes, objectInfo, [])).toMatchObject([mergedChanges, []]);
|
|
159
159
|
});
|
|
160
|
+
it('should not merge changes with the same paths, but different types', function () {
|
|
161
|
+
var _a;
|
|
162
|
+
var changes = (_a = {},
|
|
163
|
+
_a[entityUri] = [
|
|
164
|
+
{
|
|
165
|
+
attributePath: 'Identifiers/2BNyTheu/Type/2BNyU2yC',
|
|
166
|
+
attributeType: 'configuration/entityTypes/HCA/attributes/Identifiers/attributes/Type',
|
|
167
|
+
id: '58dpOzAR',
|
|
168
|
+
newPinOrIgnoreValue: false,
|
|
169
|
+
oldValue: {
|
|
170
|
+
value: 'ValueOld'
|
|
171
|
+
},
|
|
172
|
+
newValue: {
|
|
173
|
+
value: 'ValueNew'
|
|
174
|
+
},
|
|
175
|
+
type: mdm_sdk_1.DCRTypes.UPDATE_ATTRIBUTE
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
attributePath: 'Identifiers/2BNyTheu/Type/2BNyU2yC',
|
|
179
|
+
attributeType: 'configuration/entityTypes/HCA/attributes/Identifiers/attributes/Type',
|
|
180
|
+
id: '58dpP3Qh',
|
|
181
|
+
newPinOrIgnoreValue: true,
|
|
182
|
+
oldValue: {
|
|
183
|
+
value: 'ValueOld'
|
|
184
|
+
},
|
|
185
|
+
newValue: {
|
|
186
|
+
value: 'ValueOld'
|
|
187
|
+
},
|
|
188
|
+
type: mdm_sdk_1.DCRTypes.IGNORE_ATTRIBUTE
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
_a);
|
|
192
|
+
var mergedChanges = [
|
|
193
|
+
{
|
|
194
|
+
level: 0,
|
|
195
|
+
label: 'Customer Identity',
|
|
196
|
+
attributeType: metadata_test_data_1.metadata.entityTypes[0].attributes[3],
|
|
197
|
+
attributeValue: {
|
|
198
|
+
id: '2BNyTheu',
|
|
199
|
+
value: {
|
|
200
|
+
Type: [
|
|
201
|
+
{
|
|
202
|
+
id: '2BNyU2yC',
|
|
203
|
+
value: changes[entityUri][0]
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: '2BNyU2yC',
|
|
207
|
+
value: changes[entityUri][1]
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
attributeType: metadata_test_data_1.metadata.entityTypes[0].attributes[3].attributes[0],
|
|
215
|
+
newValue: {
|
|
216
|
+
value: 'ValueNew'
|
|
217
|
+
},
|
|
218
|
+
oldValue: {
|
|
219
|
+
value: 'ValueOld'
|
|
220
|
+
},
|
|
221
|
+
operation: 'edited',
|
|
222
|
+
label: 'Identity Type',
|
|
223
|
+
level: 1,
|
|
224
|
+
isReferenceSubAttribute: false
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
attributeType: metadata_test_data_1.metadata.entityTypes[0].attributes[3].attributes[0],
|
|
228
|
+
newValue: {
|
|
229
|
+
value: 'ValueOld'
|
|
230
|
+
},
|
|
231
|
+
operation: 'ignored',
|
|
232
|
+
label: 'Identity Type',
|
|
233
|
+
level: 1,
|
|
234
|
+
isReferenceSubAttribute: false
|
|
235
|
+
}
|
|
236
|
+
];
|
|
237
|
+
expect((0, merge_1.mergeChanges)(metadata_test_data_1.metadata, changes, objectInfo, [])).toMatchObject([mergedChanges, []]);
|
|
238
|
+
});
|
|
160
239
|
it('should merge special attributes', function () {
|
|
161
240
|
var _a;
|
|
162
241
|
var changes = (_a = {},
|
|
@@ -5,6 +5,7 @@ import Typography from '@mui/material/Typography';
|
|
|
5
5
|
import { addLineIdToValue } from './helpers/helpers';
|
|
6
6
|
import SvgSuggestedChanges from '../../../icons/SuggestedChanges';
|
|
7
7
|
import { EntityChangesGroup, SkeletonEntityChangesGroupLoader } from './components/EntityChangesGroup';
|
|
8
|
+
import { ChangeRequestEditorProvider } from './context';
|
|
8
9
|
import styles from './ChangeRequestEditor.module.css';
|
|
9
10
|
export var ChangeRequestEditor = function (_a) {
|
|
10
11
|
var dcr = _a.dcr, task = _a.task, groupedObjects = _a.groupedObjects;
|
|
@@ -22,5 +23,5 @@ export var ChangeRequestEditor = function (_a) {
|
|
|
22
23
|
React.createElement("div", { className: styles.suggestedChangesIcon },
|
|
23
24
|
React.createElement(SvgSuggestedChanges, null)),
|
|
24
25
|
React.createElement(Typography, { variant: "h6", className: styles.suggestedChangesTitle }, i18n.text('Suggested changes'))),
|
|
25
|
-
dcrLoaded ? (groupedObjects.map(function (object, index) { return (React.createElement(EntityChangesGroup, { key: "entity-".concat(index), entityInfo: object.entity, relationsInfo: object.relations, task: task, dcr: enrichedDCR })); })) : (React.createElement(SkeletonEntityChangesGroupLoader, null))));
|
|
26
|
+
dcrLoaded ? (React.createElement(ChangeRequestEditorProvider, null, groupedObjects.map(function (object, index) { return (React.createElement(EntityChangesGroup, { key: "entity-".concat(index), entityInfo: object.entity, relationsInfo: object.relations, task: task, dcr: enrichedDCR })); }))) : (React.createElement(SkeletonEntityChangesGroupLoader, null))));
|
|
26
27
|
};
|
package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { Diff } from '../../../types';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
change: Diff;
|
|
5
5
|
editable?: boolean;
|
|
6
|
+
classes?: {
|
|
7
|
+
rejectButton?: string;
|
|
8
|
+
};
|
|
6
9
|
};
|
|
7
|
-
export declare const ChangeItemEditor: ({ change, editable }: Props) => React.JSX.Element;
|
|
10
|
+
export declare const ChangeItemEditor: ({ change, editable, classes }: Props) => React.JSX.Element;
|
|
8
11
|
export {};
|
package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
1
2
|
import { isNil } from 'ramda';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import ReplayIcon from '@mui/icons-material/Replay';
|
|
5
|
+
import Button from '@mui/material/Button';
|
|
6
|
+
import i18n from 'ui-i18n';
|
|
4
7
|
import { DCROperationTypes, EntityAttrTypes, getAttributeValue } from '@reltio/mdm-sdk';
|
|
5
8
|
import { useMdmMetadata } from '../../../../../contexts/MdmModuleContext';
|
|
6
9
|
import { DataTypeValue } from '../../../../../DataTypeValue';
|
|
7
10
|
import { getDataTypeDefinition, prepareRolesOrTagsValue } from '../../../helpers/common';
|
|
8
11
|
import { OperationChip } from '../../../OperationChip';
|
|
9
12
|
import { RelationEntityLink } from '../../../RelationEntityLink';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
13
|
+
import { ChangeItemLabel } from '../ChangeItemLabel';
|
|
14
|
+
import { DCRValueEditor } from '../DCRValueEditor';
|
|
15
|
+
import { StatusChips } from '../StatusChips';
|
|
16
|
+
import { SmallIconButton } from '../../../../../SmallIconButton';
|
|
17
|
+
import { useChangeRequestEditor } from '../../hooks/useChangeRequestEditor';
|
|
14
18
|
import styles from './ChangeItemEditor.module.css';
|
|
15
19
|
export var ChangeItemEditor = function (_a) {
|
|
16
20
|
var _b, _c, _d;
|
|
17
|
-
var change = _a.change, _e = _a.editable, editable = _e === void 0 ? true : _e;
|
|
21
|
+
var change = _a.change, _e = _a.editable, editable = _e === void 0 ? true : _e, classes = _a.classes;
|
|
18
22
|
var metadata = useMdmMetadata();
|
|
19
|
-
var
|
|
20
|
-
var lineData = useContextSelector(ChangeRequestEditorContext, function (context) { return lineIds && context.getLineData(lineIds[0]); });
|
|
21
|
-
var updateChange = useContextSelector(ChangeRequestEditorContext, function (context) { return context.updateChange; });
|
|
22
|
-
var onValueChange = useCallback(function (newValue) {
|
|
23
|
-
updateChange(lineIds, typeof newValue === 'object' && 'value' in newValue ? newValue : { value: newValue });
|
|
24
|
-
}, [lineIds, updateChange]);
|
|
23
|
+
var _f = useChangeRequestEditor({ change: change }), handleChange = _f.handleChange, handleReject = _f.handleReject, handleRevert = _f.handleRevert, lineData = _f.lineData, isLineRejected = _f.isLineRejected, isParentLineRejected = _f.isParentLineRejected, isUpdated = _f.isUpdated, hasChangeId = _f.hasChangeId;
|
|
25
24
|
var isUpdateOperation = change.operation === DCROperationTypes.EDITED;
|
|
26
25
|
var isAddOperation = change.operation === DCROperationTypes.ADDED;
|
|
27
26
|
var hasAnyValue = Boolean(change.oldValue || change.newValue);
|
|
28
27
|
var oldValue = getAttributeValue(change.oldValue);
|
|
29
|
-
var
|
|
28
|
+
var currentNewValue = !isNil(lineData === null || lineData === void 0 ? void 0 : lineData.value) && !isParentLineRejected ? lineData.value : change.newValue;
|
|
29
|
+
var newValue = getAttributeValue(currentNewValue);
|
|
30
30
|
var hasNewValue = !isNil(newValue);
|
|
31
31
|
var dataTypeDefinition = useMemo(function () {
|
|
32
32
|
return change.attributeType && getDataTypeDefinition(change.attributeType, newValue || oldValue);
|
|
@@ -40,12 +40,22 @@ export var ChangeItemEditor = function (_a) {
|
|
|
40
40
|
? prepareRolesOrTagsValue(metadata, newValue, change.attributeType.uri)
|
|
41
41
|
: newValue;
|
|
42
42
|
}, [isRolesOrTags, metadata, newValue, (_d = change.attributeType) === null || _d === void 0 ? void 0 : _d.uri]);
|
|
43
|
-
|
|
43
|
+
var showUndoButton = (isUpdated || isLineRejected) && !isParentLineRejected;
|
|
44
|
+
var showRejectButton = !isLineRejected &&
|
|
45
|
+
!isUpdated &&
|
|
46
|
+
!isParentLineRejected &&
|
|
47
|
+
hasChangeId &&
|
|
48
|
+
!(change.isReferenceSubAttribute && !editable);
|
|
49
|
+
var showStatusChips = !isParentLineRejected;
|
|
50
|
+
var isRejected = isLineRejected || isParentLineRejected;
|
|
51
|
+
return (React.createElement("div", { className: styles.attributeRow, "data-reltio-id": "change-item-editor" },
|
|
44
52
|
React.createElement(ChangeItemLabel, { change: change, className: styles.labelColumn, showLabel: !isUpdateOperation }),
|
|
45
53
|
React.createElement("div", { className: styles.valueColumn },
|
|
46
54
|
React.createElement(RelationEntityLink, { attributeOrRelationType: change.attributeType || change.relationType, attributeValue: change.attributeValue, className: styles.relationEntityLink }),
|
|
47
|
-
shouldShowValueEditor ? (React.createElement(DCRValueEditor, { attributeType: change.attributeType, value:
|
|
55
|
+
shouldShowValueEditor ? (React.createElement(DCRValueEditor, { attributeType: change.attributeType, value: currentNewValue, onChange: handleChange, disabled: !editable || isRejected })) : (hasNewValue && (React.createElement("div", { className: styles.value },
|
|
48
56
|
React.createElement(DataTypeValue, { value: preparedValue, dataTypeDefinition: dataTypeDefinition }))))),
|
|
49
|
-
React.createElement("div", { className: styles.revertColumn }),
|
|
50
|
-
React.createElement("div", { className: styles.operationColumn }, shouldShowOperationChip && (React.createElement(OperationChip, { operation: change.operation, size: "small", variant: "outlined" })))
|
|
57
|
+
React.createElement("div", { className: styles.revertColumn }, showUndoButton && (React.createElement(SmallIconButton, { icon: ReplayIcon, onClick: handleRevert, className: styles.revertButton, title: i18n.text('Undo'), size: "S" }))),
|
|
58
|
+
React.createElement("div", { className: styles.operationColumn }, shouldShowOperationChip && (React.createElement(OperationChip, { operation: change.operation, size: "small", variant: "outlined" }))),
|
|
59
|
+
React.createElement("div", { className: styles.statusColumn }, showStatusChips && React.createElement(StatusChips, { showUpdatedChip: isUpdated, showRejectedChip: isLineRejected })),
|
|
60
|
+
React.createElement("div", { className: styles.rejectColumn }, showRejectButton && (React.createElement(Button, { onClick: handleReject, className: classnames(styles.rejectButton, classes === null || classes === void 0 ? void 0 : classes.rejectButton), title: i18n.text('Reject'), size: "medium" }, i18n.text('Reject'))))));
|
|
51
61
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const styles = {"attributeRow":"ChangeItemEditor-attributeRow--bITG5","labelColumn":"ChangeItemEditor-labelColumn--6B4w4","
|
|
1
|
+
const styles = {"attributeRow":"ChangeItemEditor-attributeRow--bITG5","labelColumn":"ChangeItemEditor-labelColumn--6B4w4","valueColumn":"ChangeItemEditor-valueColumn--q9456","revertColumn":"ChangeItemEditor-revertColumn--T5mVE","operationColumn":"ChangeItemEditor-operationColumn--me-4D","statusColumn":"ChangeItemEditor-statusColumn--GEF2N","rejectColumn":"ChangeItemEditor-rejectColumn--ap8hp","previousValue":"ChangeItemEditor-previousValue--lTOVp","previousValueText":"ChangeItemEditor-previousValueText--gAnge","arrow":"ChangeItemEditor-arrow--IXZ6i","value":"ChangeItemEditor-value--GxSUf","columnSkeleton":"ChangeItemEditor-columnSkeleton---iGmr","relationEntityLink":"ChangeItemEditor-relationEntityLink--Vr7Z-","rejectButton":"ChangeItemEditor-rejectButton--cEIBC","revertButton":"ChangeItemEditor-revertButton--hSt3m"};
|
|
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 = `.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-
|
|
6
|
+
style.innerHTML = `.ChangeItemEditor-attributeRow--bITG5{align-items:center;display:flex;font-size:16px;gap:16px;max-width:1000px;min-height:37px}.ChangeItemEditor-labelColumn--6B4w4{box-sizing:border-box;min-height:21px;width:170px}.ChangeItemEditor-valueColumn--q9456{display:flex;flex:1;flex-direction:column;gap:4px}.ChangeItemEditor-revertColumn--T5mVE{align-items:flex-start;display:flex;margin-left:-8px;width:16px}.ChangeItemEditor-operationColumn--me-4D{align-items:flex-start;display:flex;width:84px}.ChangeItemEditor-statusColumn--GEF2N{align-items:flex-start;display:flex;width:57px}.ChangeItemEditor-rejectColumn--ap8hp{align-items:flex-start;display:flex;width:80px}.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-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}.ChangeItemEditor-rejectButton--cEIBC{background-color:#eb5757;border-radius:8px;color:#fff}.ChangeItemEditor-rejectButton--cEIBC:hover{background-color:rgba(235,87,87,.8)}.ChangeItemEditor-revertButton--hSt3m{color:var(--mui-palette-text-secondary)}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
export default styles;
|
package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.js
CHANGED
|
@@ -4,7 +4,7 @@ import EastIcon from '@mui/icons-material/East';
|
|
|
4
4
|
import { DCROperationTypes, getAttributeValue } from '@reltio/mdm-sdk';
|
|
5
5
|
import { getDataTypeDefinition } from '../../../helpers/common';
|
|
6
6
|
import { DataTypeValue } from '../../../../../DataTypeValue';
|
|
7
|
-
import { ChangeItemLabel } from '
|
|
7
|
+
import { ChangeItemLabel } from '../ChangeItemLabel';
|
|
8
8
|
import styles from './ChangeItemEditor.module.css';
|
|
9
9
|
export var ChangeItemOldValue = function (_a) {
|
|
10
10
|
var change = _a.change;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { useCssVariableStyles } from '../../../../../hooks/useCssVariableStyles';
|
|
4
|
-
import styles from './
|
|
4
|
+
import styles from './ChangeItemLabel.module.css';
|
|
5
5
|
export var ChangeItemLabel = function (_a) {
|
|
6
6
|
var change = _a.change, className = _a.className, _b = _a.showLabel, showLabel = _b === void 0 ? true : _b;
|
|
7
7
|
var _c = change.level, level = _c === void 0 ? 0 : _c, label = change.label;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"changeLabel":"ChangeItemLabel-changeLabel--L-2ks"};
|
|
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 = `.ChangeItemLabel-changeLabel--L-2ks{color:var(--mui-palette-text-secondary);font-size:14px;font-weight:400;letter-spacing:.24px;padding-left:calc(var(--level, 0)*16px)}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChangeItemLabel } from './ChangeItemLabel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChangeItemLabel } from './ChangeItemLabel';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { GroupedObjectsInfo } from '@reltio/mdm-sdk';
|
|
3
|
-
import { Diff
|
|
3
|
+
import { Diff } from '../../../types';
|
|
4
4
|
type Props = {
|
|
5
|
-
|
|
5
|
+
change: Diff;
|
|
6
6
|
entityInfo: GroupedObjectsInfo['entity'];
|
|
7
7
|
};
|
|
8
|
-
export declare const ChangeItemRow: ({
|
|
8
|
+
export declare const ChangeItemRow: ({ change, entityInfo }: Props) => React.JSX.Element;
|
|
9
9
|
export {};
|