@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
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
import classnames from 'classnames';
|
|
2
|
-
import { has } from 'ramda';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import { useContextSelector } from '@fluentui/react-context-selector';
|
|
4
4
|
import { DCROperationTypes } from '@reltio/mdm-sdk';
|
|
5
5
|
import { isEditableChange } from '../../helpers/helpers';
|
|
6
|
+
import { ChangeRequestEditorContext } from '../../context';
|
|
6
7
|
import { ChangeItemEditor, ChangeItemOldValue } from '../ChangeItemEditor';
|
|
8
|
+
import { extractLineIds } from '../../../helpers/merge';
|
|
7
9
|
import styles from './ChangeItemRow.module.css';
|
|
8
10
|
export var ChangeItemRow = function (_a) {
|
|
9
11
|
var _b;
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
var change = _a.change, entityInfo = _a.entityInfo;
|
|
13
|
+
var lineIds = change.lineIds || extractLineIds(change === null || change === void 0 ? void 0 : change.newValue);
|
|
14
|
+
var isParentLineRejected = useContextSelector(ChangeRequestEditorContext, function (context) {
|
|
15
|
+
return context.getIsParentLineRejected(lineIds === null || lineIds === void 0 ? void 0 : lineIds[0]);
|
|
16
|
+
});
|
|
17
|
+
var isLineRejected = useContextSelector(ChangeRequestEditorContext, function (context) {
|
|
18
|
+
return context.getIsLineRejected(lineIds === null || lineIds === void 0 ? void 0 : lineIds[0]);
|
|
19
|
+
});
|
|
20
|
+
var isUpdated = useContextSelector(ChangeRequestEditorContext, function (context) {
|
|
21
|
+
return context.getIsLineUpdated(lineIds === null || lineIds === void 0 ? void 0 : lineIds[0]);
|
|
22
|
+
});
|
|
15
23
|
var isEditedOperation = change.operation === DCROperationTypes.EDITED;
|
|
16
24
|
var editable = isEditableChange(change, entityInfo);
|
|
17
|
-
return (React.createElement("div", { className: classnames(styles.changeItemRow, (_b = {},
|
|
25
|
+
return (React.createElement("div", { className: classnames(styles.changeItemRow, (_b = {},
|
|
26
|
+
_b[styles.editableRow] = editable,
|
|
27
|
+
_b[styles.changedRow] = isUpdated,
|
|
28
|
+
_b[styles.rejectedRow] = isLineRejected || isParentLineRejected,
|
|
29
|
+
_b)) },
|
|
18
30
|
isEditedOperation && React.createElement(ChangeItemOldValue, { change: change }),
|
|
19
|
-
React.createElement(ChangeItemEditor, { change: change, editable: editable })));
|
|
31
|
+
React.createElement(ChangeItemEditor, { change: change, editable: editable, classes: { rejectButton: styles.rejectButton } })));
|
|
20
32
|
};
|
package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const styles = {"changeItemRow":"ChangeItemRow-changeItemRow--oF9hn","
|
|
1
|
+
const styles = {"changeItemRow":"ChangeItemRow-changeItemRow--oF9hn","rejectButton":"ChangeItemRow-rejectButton--iNbfM","changedRow":"ChangeItemRow-changedRow--32zBa","rejectedRow":"ChangeItemRow-rejectedRow--RqKQc"};
|
|
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 = `.ChangeItemRow-changeItemRow--oF9hn{display:flex;flex-direction:column;gap:8px}.ChangeItemRow-
|
|
6
|
+
style.innerHTML = `.ChangeItemRow-changeItemRow--oF9hn{display:flex;flex-direction:column;gap:8px;transition:background-color .2s ease}.ChangeItemRow-rejectButton--iNbfM{opacity:0}.ChangeItemRow-changeItemRow--oF9hn:hover{background:var(--mui-palette-action-hover)}.ChangeItemRow-changeItemRow--oF9hn:hover .ChangeItemRow-rejectButton--iNbfM{opacity:1}.ChangeItemRow-changedRow--32zBa{background-color:#e5eff7}.ChangeItemRow-changedRow--32zBa:hover{background-color:rgba(229,239,247,.8)}.ChangeItemRow-rejectedRow--RqKQc{background-color:#f6e7e7}.ChangeItemRow-rejectedRow--RqKQc:hover{background-color:hsla(0,45%,94%,.8)}`;
|
|
7
7
|
head.appendChild(style);
|
|
8
8
|
}
|
|
9
9
|
export default styles;
|
|
@@ -5,6 +5,7 @@ type Props = {
|
|
|
5
5
|
attributeType: AttributeType;
|
|
6
6
|
value: LineDataValue | ChangeValue;
|
|
7
7
|
onChange: (value: SimpleAttributeValue | string[] | PrimitiveValue) => void;
|
|
8
|
+
disabled?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export declare const DCRValueEditor: ({ attributeType, value, onChange }: Props) => React.JSX.Element;
|
|
10
|
+
export declare const DCRValueEditor: ({ attributeType, value, onChange, disabled }: Props) => React.JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DCRValueEditorFactory } from '
|
|
3
|
-
import styles from './
|
|
2
|
+
import { DCRValueEditorFactory } from '../DCRValueEditorFactory';
|
|
3
|
+
import styles from './DCRValueEditor.module.css';
|
|
4
4
|
export var DCRValueEditor = function (_a) {
|
|
5
|
-
var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange;
|
|
5
|
+
var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
6
6
|
return (React.createElement("div", { className: styles.editor }, DCRValueEditorFactory.build({
|
|
7
7
|
attributeType: attributeType,
|
|
8
8
|
value: value,
|
|
9
|
-
onChange: onChange
|
|
9
|
+
onChange: onChange,
|
|
10
|
+
disabled: disabled
|
|
10
11
|
})));
|
|
11
12
|
};
|
package/features/workflow/ChangeRequestEditor/components/DCRValueEditor/DCRValueEditor.module.css.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"editor":"DCRValueEditor-editor--H9Gz7"};
|
|
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 = `.DCRValueEditor-editor--H9Gz7{min-height:40px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DCRValueEditor } from './DCRValueEditor';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DCRValueEditor } from './DCRValueEditor';
|
|
@@ -6,8 +6,9 @@ type Props = {
|
|
|
6
6
|
value: LineDataValue | ChangeValue;
|
|
7
7
|
onChange: (value: SimpleAttributeValue | string[] | PrimitiveValue) => void;
|
|
8
8
|
dataTypeDefinition?: DataTypeDefinition;
|
|
9
|
+
disabled?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare class DCRValueEditorFactory {
|
|
11
|
-
static build({ attributeType, value, onChange }: Props): React.JSX.Element;
|
|
12
|
+
static build({ attributeType, value, onChange, disabled }: Props): React.JSX.Element;
|
|
12
13
|
}
|
|
13
14
|
export {};
|
|
@@ -10,17 +10,17 @@ var DCRValueEditorFactory = /** @class */ (function () {
|
|
|
10
10
|
function DCRValueEditorFactory() {
|
|
11
11
|
}
|
|
12
12
|
DCRValueEditorFactory.build = function (_a) {
|
|
13
|
-
var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange;
|
|
13
|
+
var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
14
14
|
var dcrValue = getAttributeValue(value);
|
|
15
15
|
switch (attributeType.uri) {
|
|
16
16
|
case EntityAttrTypes.roles.uri: {
|
|
17
17
|
var handleChange = function (values) {
|
|
18
18
|
onChange((values === null || values === void 0 ? void 0 : values.map(prop('value'))) || []);
|
|
19
19
|
};
|
|
20
|
-
return React.createElement(RolesInput, { value: wrapInArrayIfNeeded(dcrValue), onChange: handleChange });
|
|
20
|
+
return (React.createElement(RolesInput, { value: wrapInArrayIfNeeded(dcrValue), onChange: handleChange, disabled: disabled }));
|
|
21
21
|
}
|
|
22
22
|
case EntityAttrTypes.tags.uri: {
|
|
23
|
-
return React.createElement(TagsInput, { value: wrapInArrayIfNeeded(dcrValue), onChange: onChange });
|
|
23
|
+
return (React.createElement(TagsInput, { value: wrapInArrayIfNeeded(dcrValue), onChange: onChange, disabled: disabled }));
|
|
24
24
|
}
|
|
25
25
|
default: {
|
|
26
26
|
var dataTypeDefinition = getDataTypeDefinition(attributeType, dcrValue);
|
|
@@ -31,7 +31,7 @@ var DCRValueEditorFactory = /** @class */ (function () {
|
|
|
31
31
|
var valueConvertedToAttributeValue = editorValueToAttributeValue(attributeType, value);
|
|
32
32
|
onChange(valueConvertedToAttributeValue);
|
|
33
33
|
};
|
|
34
|
-
return (React.createElement(DataTypeValueEditor, { fieldName: attributeType.uri, value: editorValue, dataTypeDefinition: dataTypeDefinition, onChange: handleChange, fullWidth: true }));
|
|
34
|
+
return (React.createElement(DataTypeValueEditor, { fieldName: attributeType.uri, value: editorValue, dataTypeDefinition: dataTypeDefinition, onChange: handleChange, fullWidth: true, disabled: disabled }));
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DCRValueEditorFactory } from './DCRValueEditorFactory';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DCRValueEditorFactory } from './DCRValueEditorFactory';
|
package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js
CHANGED
|
@@ -8,6 +8,7 @@ import { DCREntityUriLink } from '../../../DCREntityUriLink/DCREntityUriLink';
|
|
|
8
8
|
import { ChangeItemRow } from '../ChangeItemRow/ChangeItemRow';
|
|
9
9
|
import { AttributesChangesContext } from '../../../AttributesChanges/AttributesChangesContext';
|
|
10
10
|
import { getDCRUri } from '../../../helpers/common';
|
|
11
|
+
import { isDiffChange } from '../../helpers/helpers';
|
|
11
12
|
import styles from './EntityChangesGroup.module.css';
|
|
12
13
|
export var EntityChangesGroup = function (_a) {
|
|
13
14
|
var task = _a.task, dcr = _a.dcr, entityInfo = _a.entityInfo, relationsInfo = _a.relationsInfo;
|
|
@@ -24,5 +25,7 @@ export var EntityChangesGroup = function (_a) {
|
|
|
24
25
|
content: styles.accordionContent
|
|
25
26
|
} },
|
|
26
27
|
React.createElement(DCREntityUriLink, { entityInfo: entityInfo, changes: changes, dcrUri: dcrUri, className: styles.entityTitle })),
|
|
27
|
-
React.createElement(AccordionDetails, { className: styles.attributesList }, changesList.map(function (item, index) {
|
|
28
|
+
React.createElement(AccordionDetails, { className: styles.attributesList }, changesList.map(function (item, index) {
|
|
29
|
+
return isDiffChange(item) ? (React.createElement(ChangeItemRow, { key: "change-".concat(index), change: item, entityInfo: entityInfo })) : (React.createElement("div", { key: "title-".concat(index), className: styles.titleChangeItem }, item.label));
|
|
30
|
+
})))));
|
|
28
31
|
};
|
|
@@ -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
|
export default styles;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import i18n from 'ui-i18n';
|
|
4
|
+
import Chip from '@mui/material/Chip';
|
|
5
|
+
import styles from './StatusChips.module.css';
|
|
6
|
+
export var StatusChips = function (_a) {
|
|
7
|
+
var showUpdatedChip = _a.showUpdatedChip, showRejectedChip = _a.showRejectedChip;
|
|
8
|
+
if (!showUpdatedChip && !showRejectedChip) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
var label = showUpdatedChip ? i18n.text('Updated') : i18n.text('Rejected');
|
|
12
|
+
var chipClass = showUpdatedChip ? styles.updatedChip : styles.rejectedChip;
|
|
13
|
+
return (React.createElement(Chip, { label: label, size: "small", color: "primary", variant: "outlined", className: classnames(styles.statusChip, chipClass), "data-testid": "status-chips" }));
|
|
14
|
+
};
|
package/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
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StatusChips } from './StatusChips';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StatusChips } from './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 }: {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { createContext } from '@fluentui/react-context-selector';
|
|
2
1
|
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import { isNil } from 'ramda';
|
|
3
|
+
import { createContext } from '@fluentui/react-context-selector';
|
|
3
4
|
export var ChangeRequestEditorContext = createContext({
|
|
4
5
|
updateChange: undefined,
|
|
5
6
|
getLineData: undefined,
|
|
6
7
|
rejectChange: undefined,
|
|
7
|
-
revertChangeUpdateOrReject: undefined
|
|
8
|
+
revertChangeUpdateOrReject: undefined,
|
|
9
|
+
getIsParentLineRejected: undefined,
|
|
10
|
+
getIsLineRejected: undefined,
|
|
11
|
+
getIsLineUpdated: undefined
|
|
8
12
|
});
|
|
9
13
|
export var ChangeRequestEditorProvider = function (_a) {
|
|
10
14
|
var children = _a.children;
|
|
@@ -31,7 +35,11 @@ export var ChangeRequestEditorProvider = function (_a) {
|
|
|
31
35
|
setLineDataMap(function (prevMap) {
|
|
32
36
|
var newMap = new Map(prevMap);
|
|
33
37
|
lineIds.forEach(function (id) {
|
|
34
|
-
newMap.
|
|
38
|
+
newMap.forEach(function (_, key) {
|
|
39
|
+
if (key.startsWith("".concat(id, "/")) || key === id) {
|
|
40
|
+
newMap.delete(key);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
35
43
|
});
|
|
36
44
|
return newMap;
|
|
37
45
|
});
|
|
@@ -39,11 +47,29 @@ export var ChangeRequestEditorProvider = function (_a) {
|
|
|
39
47
|
var getLineData = useCallback(function (lineId) {
|
|
40
48
|
return lineDataMap.get(lineId);
|
|
41
49
|
}, [lineDataMap]);
|
|
50
|
+
var getIsLineRejected = useCallback(function (lineId) {
|
|
51
|
+
var _a;
|
|
52
|
+
return ((_a = lineDataMap.get(lineId)) === null || _a === void 0 ? void 0 : _a.isRejected) || false;
|
|
53
|
+
}, [lineDataMap]);
|
|
54
|
+
var getIsParentLineRejected = useCallback(function (lineId) {
|
|
55
|
+
var lineIdParts = (lineId || '').split('/');
|
|
56
|
+
var possibleRejectedIds = Array.from({ length: lineIdParts.length - 1 }).reduce(function (ids, _, index) {
|
|
57
|
+
return ids.concat(lineIdParts.slice(0, index + 1).join('/'));
|
|
58
|
+
}, []);
|
|
59
|
+
return possibleRejectedIds.some(function (lineId) { var _a; return (_a = lineDataMap.get(lineId)) === null || _a === void 0 ? void 0 : _a.isRejected; });
|
|
60
|
+
}, [lineDataMap]);
|
|
61
|
+
var getIsLineUpdated = useCallback(function (lineId) {
|
|
62
|
+
var _a;
|
|
63
|
+
return !isNil((_a = lineDataMap.get(lineId)) === null || _a === void 0 ? void 0 : _a.value);
|
|
64
|
+
}, [lineDataMap]);
|
|
42
65
|
var contextValue = {
|
|
43
66
|
updateChange: updateChange,
|
|
44
67
|
getLineData: getLineData,
|
|
45
68
|
rejectChange: rejectChange,
|
|
46
|
-
revertChangeUpdateOrReject: revertChangeUpdateOrReject
|
|
69
|
+
revertChangeUpdateOrReject: revertChangeUpdateOrReject,
|
|
70
|
+
getIsParentLineRejected: getIsParentLineRejected,
|
|
71
|
+
getIsLineRejected: getIsLineRejected,
|
|
72
|
+
getIsLineUpdated: getIsLineUpdated
|
|
47
73
|
};
|
|
48
74
|
return React.createElement(ChangeRequestEditorContext.Provider, { value: contextValue }, children);
|
|
49
75
|
};
|
|
@@ -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;
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { clone, isNil } from 'ramda';
|
|
12
|
+
import { clone, has, isNil } from 'ramda';
|
|
13
13
|
import { DCROperationTypes, DCRTypes, isRelationTypeUri } from '@reltio/mdm-sdk';
|
|
14
14
|
export var isEditableChange = function (change, entityInfo) {
|
|
15
15
|
var _a;
|
|
@@ -98,3 +98,6 @@ export var addLineIdToValue = function (data) {
|
|
|
98
98
|
}
|
|
99
99
|
return enrichedData;
|
|
100
100
|
};
|
|
101
|
+
export var isDiffChange = function (change) {
|
|
102
|
+
return has('level', change);
|
|
103
|
+
};
|
|
@@ -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,38 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useContextSelector } from '@fluentui/react-context-selector';
|
|
3
|
+
import { ChangeRequestEditorContext } from '../context';
|
|
4
|
+
import { extractLineIds } from '../../helpers/merge';
|
|
5
|
+
var emptyLineIds = [];
|
|
6
|
+
export var useChangeRequestEditor = function (_a) {
|
|
7
|
+
var change = _a.change;
|
|
8
|
+
var lineIds = change.lineIds || extractLineIds(change === null || change === void 0 ? void 0 : change.newValue) || emptyLineIds;
|
|
9
|
+
var lineData = useContextSelector(ChangeRequestEditorContext, function (context) { return context.getLineData(lineIds[0]); });
|
|
10
|
+
var updateChange = useContextSelector(ChangeRequestEditorContext, function (context) { return context.updateChange; });
|
|
11
|
+
var rejectChange = useContextSelector(ChangeRequestEditorContext, function (context) { return context.rejectChange; });
|
|
12
|
+
var revertChangeUpdateOrReject = useContextSelector(ChangeRequestEditorContext, function (context) { return context.revertChangeUpdateOrReject; });
|
|
13
|
+
var isParentLineRejected = useContextSelector(ChangeRequestEditorContext, function (context) {
|
|
14
|
+
return context.getIsParentLineRejected(lineIds[0]);
|
|
15
|
+
});
|
|
16
|
+
var isUpdated = useContextSelector(ChangeRequestEditorContext, function (context) { return context.getIsLineUpdated(lineIds[0]); });
|
|
17
|
+
var isLineRejected = lineData === null || lineData === void 0 ? void 0 : lineData.isRejected;
|
|
18
|
+
var hasChangeId = lineIds.length > 0;
|
|
19
|
+
var handleChange = useCallback(function (newValue) {
|
|
20
|
+
updateChange(lineIds, typeof newValue === 'object' && 'value' in newValue ? newValue : { value: newValue });
|
|
21
|
+
}, [lineIds, updateChange]);
|
|
22
|
+
var handleReject = useCallback(function () {
|
|
23
|
+
rejectChange(lineIds);
|
|
24
|
+
}, [rejectChange, lineIds]);
|
|
25
|
+
var handleRevert = useCallback(function () {
|
|
26
|
+
revertChangeUpdateOrReject(lineIds);
|
|
27
|
+
}, [revertChangeUpdateOrReject, lineIds]);
|
|
28
|
+
return {
|
|
29
|
+
handleChange: handleChange,
|
|
30
|
+
handleReject: handleReject,
|
|
31
|
+
handleRevert: handleRevert,
|
|
32
|
+
lineData: lineData,
|
|
33
|
+
isLineRejected: isLineRejected,
|
|
34
|
+
isParentLineRejected: isParentLineRejected,
|
|
35
|
+
isUpdated: isUpdated,
|
|
36
|
+
hasChangeId: hasChangeId
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -5,5 +5,5 @@ import { getOperationLabel } from '../helpers/common';
|
|
|
5
5
|
import styles from './OperationChip.module.css';
|
|
6
6
|
export var OperationChip = function (_a) {
|
|
7
7
|
var operation = _a.operation, className = _a.className, _b = _a.size, size = _b === void 0 ? 'small' : _b, _c = _a.variant, variant = _c === void 0 ? 'outlined' : _c;
|
|
8
|
-
return (React.createElement(Chip, { variant: variant, label: getOperationLabel(operation), size: size, className: classnames(styles.chip, styles[operation], className) }));
|
|
8
|
+
return (React.createElement(Chip, { variant: variant, label: getOperationLabel(operation), size: size, className: classnames(styles.chip, styles[operation], className), classes: { label: styles.label } }));
|
|
9
9
|
};
|
|
@@ -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
|
export default styles;
|
|
@@ -3,7 +3,7 @@ import Dialog from '@mui/material/Dialog';
|
|
|
3
3
|
import DialogTitle from '@mui/material/DialogTitle';
|
|
4
4
|
import DialogContent from '@mui/material/DialogContent';
|
|
5
5
|
import Typography from '@mui/material/Typography';
|
|
6
|
-
import {
|
|
6
|
+
import { SmallIconButtonWithTooltip } from '../../../SmallIconButton';
|
|
7
7
|
import CloseIcon from '@mui/icons-material/Close';
|
|
8
8
|
import i18n from 'ui-i18n';
|
|
9
9
|
import { useWorkflowCheckPermission } from '../hooks/useWorkflowCheckPermission';
|
|
@@ -35,7 +35,7 @@ export var ReviewDCRDialog = function (_a) {
|
|
|
35
35
|
React.createElement("div", { className: styles.titleContent },
|
|
36
36
|
React.createElement(Typography, { variant: "h6", className: styles.titleText }, i18n.text('Review DCR')),
|
|
37
37
|
React.createElement(WorkflowActionButtons, { workflowActions: workflowActions, actionRequestIsInProgress: actionRequestIsInProgress, preferredAction: task.preferredAction })),
|
|
38
|
-
React.createElement(
|
|
38
|
+
React.createElement(SmallIconButtonWithTooltip, { tooltipTitle: i18n.text('Close'), "aria-label": i18n.text('Close'), icon: CloseIcon, onClick: onClose, className: styles.closeButton, size: "L" })),
|
|
39
39
|
React.createElement(DialogContent, { classes: { root: styles.content } },
|
|
40
40
|
React.createElement("div", { className: styles.leftSection },
|
|
41
41
|
React.createElement(ProfileBand, { entity: entity, className: styles.profileBandRoot, classes: { profileBand: styles.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
|
export default 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
|
export default styles;
|
package/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
|
export default styles;
|
|
@@ -89,13 +89,15 @@ var getReferenceAttributeChange = function (metadata, attributeType, attributeVa
|
|
|
89
89
|
];
|
|
90
90
|
};
|
|
91
91
|
var getDiffParameters = function (_a) {
|
|
92
|
-
var newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type;
|
|
93
|
-
return type === DCRTypes.UPDATE_ATTRIBUTE
|
|
92
|
+
var newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type, newPinOrIgnoreValue = _a.newPinOrIgnoreValue;
|
|
93
|
+
return type === DCRTypes.UPDATE_ATTRIBUTE
|
|
94
|
+
? { type: type, newValue: newValue, oldValue: oldValue, newPinOrIgnoreValue: newPinOrIgnoreValue }
|
|
95
|
+
: { type: type, newValue: oldValue || newValue, newPinOrIgnoreValue: newPinOrIgnoreValue };
|
|
94
96
|
};
|
|
95
97
|
var getSimpleAttributeChange = function (attributeType, attributeValue, level, isReferenceSubAttribute) {
|
|
96
98
|
if (isReferenceSubAttribute === void 0) { isReferenceSubAttribute = false; }
|
|
97
|
-
var _a = getDiffParameters(attributeValue), newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type;
|
|
98
|
-
var operation = getOperationType(type,
|
|
99
|
+
var _a = getDiffParameters(attributeValue), newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type, newPinOrIgnoreValue = _a.newPinOrIgnoreValue;
|
|
100
|
+
var operation = getOperationType(type, newPinOrIgnoreValue);
|
|
99
101
|
var label = (attributeType === null || attributeType === void 0 ? void 0 : attributeType.label) || (attributeType === null || attributeType === void 0 ? void 0 : attributeType.name);
|
|
100
102
|
return {
|
|
101
103
|
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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { allPass, always, equals, evolve, filter, has, identity, isNil, length, nth, pipe, prop, propEq, split, startsWith, unless, when } from 'ramda';
|
|
2
2
|
import i18n from 'ui-i18n';
|
|
3
3
|
import { DataTypes, DCROperationTypes, DCRTypes, EntityAttrTypes, getAttrDataTypeDefinition, getRoleLabel, isUrl } from '@reltio/mdm-sdk';
|
|
4
|
-
export var getOperationType = function (type,
|
|
4
|
+
export var getOperationType = function (type, newPinOrIgnoreValue) {
|
|
5
5
|
switch (type) {
|
|
6
6
|
case DCRTypes.CREATE_RELATIONSHIP:
|
|
7
7
|
case DCRTypes.INSERT_ATTRIBUTE:
|
|
@@ -14,9 +14,9 @@ export var getOperationType = function (type, oldValue) {
|
|
|
14
14
|
case DCRTypes.DELETE_RELATIONSHIP:
|
|
15
15
|
return DCROperationTypes.DELETED;
|
|
16
16
|
case DCRTypes.PIN_ATTRIBUTE:
|
|
17
|
-
return
|
|
17
|
+
return newPinOrIgnoreValue ? DCROperationTypes.PINNED : DCROperationTypes.PIN_DELETED;
|
|
18
18
|
case DCRTypes.IGNORE_ATTRIBUTE:
|
|
19
|
-
return
|
|
19
|
+
return newPinOrIgnoreValue ? DCROperationTypes.IGNORED : DCROperationTypes.IGNORE_DELETED;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
export var getOperationLabel = function (operation) {
|
|
@@ -9,10 +9,10 @@ describe('common helpers', function () {
|
|
|
9
9
|
expect(getOperationType(DCRTypes.UPDATE_ATTRIBUTE)).toBe(DCROperationTypes.EDITED);
|
|
10
10
|
expect(getOperationType(DCRTypes.DELETE_ATTRIBUTE)).toBe(DCROperationTypes.DELETED);
|
|
11
11
|
expect(getOperationType(DCRTypes.DELETE_RELATIONSHIP)).toBe(DCROperationTypes.DELETED);
|
|
12
|
-
expect(getOperationType(DCRTypes.PIN_ATTRIBUTE,
|
|
13
|
-
expect(getOperationType(DCRTypes.PIN_ATTRIBUTE,
|
|
14
|
-
expect(getOperationType(DCRTypes.IGNORE_ATTRIBUTE,
|
|
15
|
-
expect(getOperationType(DCRTypes.IGNORE_ATTRIBUTE,
|
|
12
|
+
expect(getOperationType(DCRTypes.PIN_ATTRIBUTE, true)).toBe(DCROperationTypes.PINNED);
|
|
13
|
+
expect(getOperationType(DCRTypes.PIN_ATTRIBUTE, false)).toBe(DCROperationTypes.PIN_DELETED);
|
|
14
|
+
expect(getOperationType(DCRTypes.IGNORE_ATTRIBUTE, true)).toBe(DCROperationTypes.IGNORED);
|
|
15
|
+
expect(getOperationType(DCRTypes.IGNORE_ATTRIBUTE, false)).toBe(DCROperationTypes.IGNORE_DELETED);
|
|
16
16
|
});
|
|
17
17
|
it('getOperationLabel behaviour', function () {
|
|
18
18
|
expect(getOperationLabel(DCROperationTypes.ADDED)).toBe('added');
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { concat, curry, difference, flatten, isNil, omit, path, pick, pipe, propEq, propOr, reduce } from 'ramda';
|
|
12
|
+
import { both, concat, curry, difference, flatten, isNil, omit, path, pathEq, pick, pipe, propEq, propOr, reduce } from 'ramda';
|
|
13
13
|
import { DCRTypes, EntityAttrTypes, generateTempUri, getRoleLabel, isEmptyValue } from '@reltio/mdm-sdk';
|
|
14
14
|
import { getEntityChanges, getRelationChanges } from './attributes';
|
|
15
15
|
var ATTRIBUTE_DELIMITER = '/';
|
|
@@ -108,7 +108,9 @@ var prepareAttribute = function (container, change) {
|
|
|
108
108
|
for (var i = 0; i < pathArray.length - 1; i = i + 2) {
|
|
109
109
|
var key = pathArray[i];
|
|
110
110
|
var id = pathArray[i + 1];
|
|
111
|
-
var currentValue =
|
|
111
|
+
var currentValue = i === pathArray.length - 2
|
|
112
|
+
? (holder[key] || []).find(both(propEq('id', id), pathEq(['value', 'type'], change === null || change === void 0 ? void 0 : change.type)))
|
|
113
|
+
: (holder[key] || []).find(propEq('id', id));
|
|
112
114
|
if (!isNil(currentValue)) {
|
|
113
115
|
var newLineIds = extractLineIds(change.newValue);
|
|
114
116
|
var oldLineIds = extractLineIds(change.oldValue);
|