@reltio/components 1.4.2202 → 1.4.2204
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/activity-log/RecordUpdates/RecordUpdates.d.ts +1 -0
- package/cjs/features/activity-log/RecordUpdates/RecordUpdates.js +2 -3
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.d.ts +1 -1
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +13 -9
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.module.css.js +9 -0
- package/cjs/features/activity-log/types.d.ts +5 -0
- package/cjs/features/activity-log/types.js +7 -1
- 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/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → 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/activity-log/RecordUpdates/RecordUpdates.d.ts +1 -0
- package/features/activity-log/RecordUpdates/RecordUpdates.js +2 -3
- package/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.d.ts +1 -1
- package/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +14 -10
- package/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.module.css.js +9 -0
- package/features/activity-log/types.d.ts +5 -0
- package/features/activity-log/types.js +6 -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/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → 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/activity-log/RecordUpdates/components/DeltaField/styles.d.ts +0 -1
- package/cjs/features/activity-log/RecordUpdates/components/DeltaField/styles.js +0 -36
- package/features/activity-log/RecordUpdates/components/DeltaField/styles.d.ts +0 -1
- package/features/activity-log/RecordUpdates/components/DeltaField/styles.js +0 -33
- /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
|
@@ -14,6 +14,7 @@ var DCREntityUriLink_1 = require("../../../DCREntityUriLink/DCREntityUriLink");
|
|
|
14
14
|
var ChangeItemRow_1 = require("../ChangeItemRow/ChangeItemRow");
|
|
15
15
|
var AttributesChangesContext_1 = require("../../../AttributesChanges/AttributesChangesContext");
|
|
16
16
|
var common_1 = require("../../../helpers/common");
|
|
17
|
+
var helpers_1 = require("../../helpers/helpers");
|
|
17
18
|
var EntityChangesGroup_module_css_1 = __importDefault(require("./EntityChangesGroup.module.css"));
|
|
18
19
|
var EntityChangesGroup = function (_a) {
|
|
19
20
|
var task = _a.task, dcr = _a.dcr, entityInfo = _a.entityInfo, relationsInfo = _a.relationsInfo;
|
|
@@ -30,6 +31,8 @@ var EntityChangesGroup = function (_a) {
|
|
|
30
31
|
content: EntityChangesGroup_module_css_1.default.accordionContent
|
|
31
32
|
} },
|
|
32
33
|
react_1.default.createElement(DCREntityUriLink_1.DCREntityUriLink, { entityInfo: entityInfo, changes: changes, dcrUri: dcrUri, className: EntityChangesGroup_module_css_1.default.entityTitle })),
|
|
33
|
-
react_1.default.createElement(AccordionDetails_1.default, { className: EntityChangesGroup_module_css_1.default.attributesList }, changesList.map(function (item, index) {
|
|
34
|
+
react_1.default.createElement(AccordionDetails_1.default, { className: EntityChangesGroup_module_css_1.default.attributesList }, changesList.map(function (item, index) {
|
|
35
|
+
return (0, helpers_1.isDiffChange)(item) ? (react_1.default.createElement(ChangeItemRow_1.ChangeItemRow, { key: "change-".concat(index), change: item, entityInfo: entityInfo })) : (react_1.default.createElement("div", { key: "title-".concat(index), className: EntityChangesGroup_module_css_1.default.titleChangeItem }, item.label));
|
|
36
|
+
})))));
|
|
34
37
|
};
|
|
35
38
|
exports.EntityChangesGroup = EntityChangesGroup;
|
|
@@ -1,9 +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"};
|
|
1
|
+
const styles = {"entityGroup":"EntityChangesGroup-entityGroup--KmWaa","entityHeader":"EntityChangesGroup-entityHeader--hf8-J","entityTitle":"EntityChangesGroup-entityTitle--caeZE","accordionContent":"EntityChangesGroup-accordionContent--N7C6Y","attributesList":"EntityChangesGroup-attributesList--7Tmk6","titleChangeItem":"EntityChangesGroup-titleChangeItem--4s7tA","skeletonEntityGroupDisabled":"EntityChangesGroup-skeletonEntityGroupDisabled--qFGAK"};
|
|
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 = `.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;
|
|
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;min-width:750px;padding:16px}.EntityChangesGroup-titleChangeItem--4s7tA{color:var(--mui-palette-text-primary);font-size:14px;font-weight:600;margin:0 0 12px}.EntityChangesGroup-skeletonEntityGroupDisabled--qFGAK.Mui-disabled{background-color:#f7f7f7}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
module.exports = styles;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.StatusChips = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
10
|
+
var Chip_1 = __importDefault(require("@mui/material/Chip"));
|
|
11
|
+
var StatusChips_module_css_1 = __importDefault(require("./StatusChips.module.css"));
|
|
12
|
+
var StatusChips = function (_a) {
|
|
13
|
+
var showUpdatedChip = _a.showUpdatedChip, showRejectedChip = _a.showRejectedChip;
|
|
14
|
+
if (!showUpdatedChip && !showRejectedChip) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
var label = showUpdatedChip ? ui_i18n_1.default.text('Updated') : ui_i18n_1.default.text('Rejected');
|
|
18
|
+
var chipClass = showUpdatedChip ? StatusChips_module_css_1.default.updatedChip : StatusChips_module_css_1.default.rejectedChip;
|
|
19
|
+
return (react_1.default.createElement(Chip_1.default, { label: label, size: "small", color: "primary", variant: "outlined", className: (0, classnames_1.default)(StatusChips_module_css_1.default.statusChip, chipClass), "data-testid": "status-chips" }));
|
|
20
|
+
};
|
|
21
|
+
exports.StatusChips = StatusChips;
|
package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.module.css.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"statusChip":"StatusChips-statusChip--ws380","updatedChip":"StatusChips-updatedChip--5mTfA","rejectedChip":"StatusChips-rejectedChip--EHx3y"};
|
|
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 = `.StatusChips-statusChip--ws380{color:#fff;font-size:10px;height:20px}.StatusChips-updatedChip--5mTfA{background:#2f80ed;border:1px solid rgba(0,114,206,.3)}.StatusChips-rejectedChip--EHx3y{background:#eb5757;border:1px solid rgba(235,87,87,.3)}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
module.exports = styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StatusChips } from './StatusChips';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatusChips = void 0;
|
|
4
|
+
var StatusChips_1 = require("./StatusChips");
|
|
5
|
+
Object.defineProperty(exports, "StatusChips", { enumerable: true, get: function () { return StatusChips_1.StatusChips; } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SimpleAttributeValue, PrimitiveValue } from '@reltio/mdm-sdk';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { SimpleAttributeValue, PrimitiveValue } from '@reltio/mdm-sdk';
|
|
3
3
|
export type LineDataValue = SimpleAttributeValue | {
|
|
4
4
|
value: string[] | PrimitiveValue;
|
|
5
5
|
};
|
|
@@ -12,6 +12,9 @@ type ChangeRequestEditorContextType = {
|
|
|
12
12
|
getLineData: (lineId: string) => LineData | undefined;
|
|
13
13
|
rejectChange: (lineIds: string[]) => void;
|
|
14
14
|
revertChangeUpdateOrReject: (lineIds: string[]) => void;
|
|
15
|
+
getIsParentLineRejected: (lineId: string) => boolean;
|
|
16
|
+
getIsLineRejected: (lineId: string) => boolean;
|
|
17
|
+
getIsLineUpdated: (lineId: string) => boolean;
|
|
15
18
|
};
|
|
16
19
|
export declare const ChangeRequestEditorContext: import("@fluentui/react-context-selector").Context<ChangeRequestEditorContextType>;
|
|
17
20
|
export declare const ChangeRequestEditorProvider: ({ children }: {
|
|
@@ -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 = {},
|
|
@@ -12,9 +12,8 @@ export var RecordUpdates = function (_a) {
|
|
|
12
12
|
itemsId: recordId,
|
|
13
13
|
items: updates
|
|
14
14
|
}), onExpand = _b.onExpand, collapsedItemsCount = _b.collapsedItemsCount, itemsToShow = _b.itemsToShow;
|
|
15
|
+
var DeltaFieldComponent = isSegment ? SegmentDeltaField : DeltaField;
|
|
15
16
|
return (React.createElement(React.Fragment, null,
|
|
16
|
-
itemsToShow.map(function (update, index) {
|
|
17
|
-
return isSegment ? React.createElement(SegmentDeltaField, { key: index, delta: update }) : React.createElement(DeltaField, { key: index, delta: update });
|
|
18
|
-
}),
|
|
17
|
+
itemsToShow.map(function (update, index) { return (React.createElement(DeltaFieldComponent, { key: index, delta: update })); }),
|
|
19
18
|
collapsedItemsCount ? (React.createElement(MoreItemsLink, { itemsCount: collapsedItemsCount, itemsLabel: collapsedItemsCount === 1 ? i18n.text('update') : i18n.text('updates'), onClick: onExpand, className: styles.moreLabel })) : null));
|
|
20
19
|
};
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import { findAttributeTypeByUri } from '@reltio/mdm-sdk';
|
|
3
|
+
import { findAttributeTypeByUri, findMemberTypeByUri } from '@reltio/mdm-sdk';
|
|
4
|
+
import { EntityUriLink } from '../../../../../EntityUriLink';
|
|
4
5
|
import Chip from '@mui/material/Chip';
|
|
5
6
|
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
|
|
6
|
-
import { DeltaTypes } from '../../../types';
|
|
7
|
+
import { DeltaTypes, MemberDeltaTypes } from '../../../types';
|
|
7
8
|
import { stringifyDeltaValue } from '../../../utils/activities';
|
|
8
9
|
import { useMdmMetadata, useMdmAttributesPresentation } from '../../../../../contexts/MdmModuleContext';
|
|
9
10
|
import { Field } from '../../../Field';
|
|
10
|
-
import
|
|
11
|
+
import styles from './DeltaField.module.css';
|
|
11
12
|
export var DeltaField = function (_a) {
|
|
12
13
|
var _b, _c;
|
|
13
14
|
var delta = _a.delta;
|
|
14
|
-
var styles = useStyles();
|
|
15
15
|
var metadata = useMdmMetadata();
|
|
16
16
|
var attributesPresentation = useMdmAttributesPresentation();
|
|
17
|
-
var
|
|
17
|
+
var isMemberDelta = delta.type in MemberDeltaTypes;
|
|
18
|
+
var attributeType = !isMemberDelta ? findAttributeTypeByUri(metadata, delta.attributeType) : undefined;
|
|
19
|
+
var memberType = isMemberDelta ? findMemberTypeByUri(metadata, delta.attributeType) : undefined;
|
|
20
|
+
var fieldType = isMemberDelta ? memberType : attributeType;
|
|
21
|
+
var fieldName = (fieldType === null || fieldType === void 0 ? void 0 : fieldType.label) || (fieldType === null || fieldType === void 0 ? void 0 : fieldType.name);
|
|
18
22
|
var newValue = (_b = delta.newValue) === null || _b === void 0 ? void 0 : _b.value;
|
|
19
23
|
var oldValue = (_c = delta.oldValue) === null || _c === void 0 ? void 0 : _c.value;
|
|
20
24
|
var value = oldValue || newValue;
|
|
21
|
-
var deltaLabel = DeltaTypes[delta.type];
|
|
22
|
-
var converter = function (
|
|
23
|
-
return
|
|
25
|
+
var deltaLabel = (isMemberDelta ? MemberDeltaTypes : DeltaTypes)[delta.type];
|
|
26
|
+
var converter = function (deltaValue) {
|
|
27
|
+
return isMemberDelta ? (React.createElement(EntityUriLink, { value: 'entities/' + deltaValue, className: styles.entityLink }, deltaValue)) : (stringifyDeltaValue(deltaValue, delta.attributeType, metadata, attributesPresentation));
|
|
24
28
|
};
|
|
25
|
-
return (React.createElement(Field, { fieldName:
|
|
29
|
+
return (React.createElement(Field, { fieldName: fieldName, "data-reltio-id": "delta-field" },
|
|
26
30
|
React.createElement("span", null,
|
|
27
31
|
value && converter(value),
|
|
28
32
|
newValue && oldValue && (React.createElement(React.Fragment, null,
|
|
29
33
|
React.createElement(ArrowForwardIcon, { className: styles.arrow }),
|
|
30
34
|
converter(newValue)))),
|
|
31
|
-
deltaLabel && (React.createElement(Chip, { variant: "outlined", label: deltaLabel, className: classnames(styles.chip, deltaLabel) }))));
|
|
35
|
+
deltaLabel && (React.createElement(Chip, { variant: "outlined", label: deltaLabel, className: classnames(styles.chip, styles[deltaLabel]) }))));
|
|
32
36
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"arrow":"DeltaField-arrow--5hkJ-","chip":"DeltaField-chip--OIM5S","edited":"DeltaField-edited--P1M7q","added":"DeltaField-added--HNmW4","deleted":"DeltaField-deleted--oKqex","entityLink":"DeltaField-entityLink--lGSiY"};
|
|
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 = `.DeltaField-arrow--5hkJ-{color:var(--mui-palette-text-primary);font-size:12px;margin:0 8px}.DeltaField-chip--OIM5S{flex-shrink:0;font-size:10px;font-weight:500;height:20px;line-height:16px;margin-left:9px;text-transform:capitalize;width:53px}.DeltaField-chip--OIM5S.DeltaField-edited--P1M7q{border-color:#6973c2;color:#6973c2}.DeltaField-chip--OIM5S.DeltaField-added--HNmW4{border-color:#75c378;color:#75c378}.DeltaField-chip--OIM5S.DeltaField-deleted--oKqex{border-color:#f97061;color:#f97061}.DeltaField-chip--OIM5S span{padding:0}.DeltaField-entityLink--lGSiY{color:var(--mui-palette-primary-main);text-decoration:none}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -61,6 +61,11 @@ export declare enum DeltaTypes {
|
|
|
61
61
|
ATTRIBUTE_ADDED = "added",
|
|
62
62
|
ATTRIBUTE_REMOVED = "deleted"
|
|
63
63
|
}
|
|
64
|
+
export declare enum MemberDeltaTypes {
|
|
65
|
+
MEMBER_CHANGED = "edited",
|
|
66
|
+
MEMBER_ADDED = "added",
|
|
67
|
+
MEMBER_REMOVED = "deleted"
|
|
68
|
+
}
|
|
64
69
|
export type ActivityDelta = {
|
|
65
70
|
type: string;
|
|
66
71
|
attributeType: string;
|