@reltio/components 1.4.2243 → 1.4.2245
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/ActivenessDateControl/ActivenessDateControl.d.ts +9 -0
- package/ActivenessDateControl/ActivenessDateControl.js +11 -0
- package/ActivenessDateControl/index.d.ts +1 -0
- package/ActivenessDateControl/index.js +1 -0
- package/EntitySelector/EntitySelector.d.ts +2 -1
- package/EntitySelector/EntitySelector.js +2 -2
- package/EntitySelector/index.d.ts +1 -0
- package/MoreAttributesButton/MoreAttributesButton.d.ts +3 -2
- package/MoreAttributesButton/MoreAttributesButton.js +8 -8
- package/MoreAttributesButton/useMoreAttributesItems.d.ts +4 -4
- package/cjs/ActivenessDateControl/ActivenessDateControl.d.ts +9 -0
- package/cjs/ActivenessDateControl/ActivenessDateControl.js +18 -0
- package/cjs/ActivenessDateControl/index.d.ts +1 -0
- package/cjs/ActivenessDateControl/index.js +5 -0
- package/cjs/EntitySelector/EntitySelector.d.ts +2 -1
- package/cjs/EntitySelector/EntitySelector.js +2 -2
- package/cjs/EntitySelector/index.d.ts +1 -0
- package/cjs/MoreAttributesButton/MoreAttributesButton.d.ts +3 -2
- package/cjs/MoreAttributesButton/MoreAttributesButton.js +8 -8
- package/cjs/MoreAttributesButton/useMoreAttributesItems.d.ts +4 -4
- package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +28 -0
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.js +22 -11
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.module.css.js +9 -0
- package/cjs/features/activity-log/ActivityLog/constants.d.ts +17 -0
- package/cjs/features/activity-log/ActivityLog/constants.js +20 -0
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.d.ts +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +20 -9
- package/cjs/features/workflow/ChangeRequestEditor/components/AddSameAttributeButton/AddSameAttributeButton.d.ts +7 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/AddSameAttributeButton/AddSameAttributeButton.js +67 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/ChangeItemLabel.js +3 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/ChangeItemLabel.module.css.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +31 -9
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRImageEditor/DCRImageEditor.d.ts +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRImageEditor/DCRImageEditor.js +79 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRImageEditor/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRImageEditor/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.d.ts +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.d.ts +11 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.js +41 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EditorStatusChip/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EditorStatusChip/index.js +6 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +134 -5
- package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.js +2 -2
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/ChangeItemEditor.d.ts +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditor/ChangeItemEditor.js +110 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditor/ChangeItemEditor.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/SkeletonChangeItemEditorLoader.js +6 -5
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/index.d.ts +0 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/index.js +1 -3
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/ChangeItemEditorRecentlyAdded.d.ts +8 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/ChangeItemEditorRecentlyAdded.js +89 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemOldValue}/ChangeItemOldValue.d.ts +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemOldValue}/ChangeItemOldValue.js +12 -11
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/ChangeItemOldValue.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.d.ts +11 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.js +34 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/index.js +5 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/editors.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/index.d.ts +4 -0
- package/cjs/features/workflow/ChangeRequestEditor/components/editors/index.js +12 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/addedAttributes.d.ts +11 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/addedAttributes.js +74 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/changesList.d.ts +2 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/changesList.js +157 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/changesList.test.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/changesList.test.js +203 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/helpers.d.ts +6 -3
- package/cjs/features/workflow/ChangeRequestEditor/helpers/helpers.js +22 -3
- package/cjs/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.d.ts +3 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.js +190 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.test.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.test.js +768 -0
- package/cjs/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.d.ts +4 -3
- package/cjs/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.js +9 -1
- package/cjs/features/workflow/ChangeRequestEditor/hooks/useNewAttributesEditor.d.ts +18 -0
- package/cjs/features/workflow/ChangeRequestEditor/hooks/useNewAttributesEditor.js +65 -0
- package/cjs/features/workflow/WorkflowTaskCard/components/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +7 -3
- package/cjs/features/workflow/contexts/AddedAttributesContext/index.d.ts +39 -0
- package/cjs/features/workflow/contexts/AddedAttributesContext/index.js +152 -0
- package/cjs/features/workflow/contexts/ChangeRequestEditorContext/index.d.ts +3 -2
- package/cjs/features/workflow/contexts/ChangeRequestEditorContext/index.js +47 -7
- package/cjs/features/workflow/contexts/ScrollToAddedAttributeContext/index.d.ts +11 -0
- package/cjs/features/workflow/contexts/ScrollToAddedAttributeContext/index.js +78 -0
- package/cjs/features/workflow/helpers/attributes.js +16 -13
- package/cjs/features/workflow/helpers/attributes.test.js +6 -3
- package/cjs/features/workflow/helpers/dcr.d.ts +6 -1
- package/cjs/features/workflow/helpers/dcr.js +123 -19
- package/cjs/features/workflow/helpers/dcr.test.js +171 -0
- package/cjs/features/workflow/helpers/merge.d.ts +3 -0
- package/cjs/features/workflow/helpers/merge.js +32 -20
- package/cjs/features/workflow/helpers/merge.test.js +2 -1
- package/cjs/features/workflow/helpers/moreAttributesScope.d.ts +4 -0
- package/cjs/features/workflow/helpers/moreAttributesScope.js +20 -0
- package/cjs/features/workflow/helpers/validation.js +31 -6
- package/cjs/features/workflow/hooks/useApplyDcrChanges.d.ts +2 -2
- package/cjs/features/workflow/hooks/useApplyDcrChanges.js +80 -63
- package/cjs/features/workflow/types.d.ts +12 -2
- package/features/activity-log/ActivityLog/ActivityLog.test.js +28 -0
- package/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.js +15 -4
- package/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.module.css.js +9 -0
- package/features/activity-log/ActivityLog/constants.d.ts +17 -0
- package/features/activity-log/ActivityLog/constants.js +17 -0
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.d.ts +1 -1
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +20 -9
- package/features/workflow/ChangeRequestEditor/components/AddSameAttributeButton/AddSameAttributeButton.d.ts +7 -0
- package/features/workflow/ChangeRequestEditor/components/AddSameAttributeButton/AddSameAttributeButton.js +37 -0
- package/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/ChangeItemLabel.js +3 -1
- package/features/workflow/ChangeRequestEditor/components/ChangeItemLabel/ChangeItemLabel.module.css.js +2 -2
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +2 -2
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +32 -10
- package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js +2 -2
- package/features/workflow/ChangeRequestEditor/components/DCRImageEditor/DCRImageEditor.d.ts +9 -0
- package/features/workflow/ChangeRequestEditor/components/DCRImageEditor/DCRImageEditor.js +49 -0
- package/features/workflow/ChangeRequestEditor/components/DCRImageEditor/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/DCRImageEditor/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.d.ts +2 -2
- package/features/workflow/ChangeRequestEditor/components/DCRValueEditorFactory/DCRValueEditorFactory.js +2 -2
- package/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.d.ts +11 -0
- package/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.js +34 -0
- package/features/workflow/ChangeRequestEditor/components/EditorStatusChip/EditorStatusChip.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/EditorStatusChip/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/EditorStatusChip/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +1 -1
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +112 -6
- package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.js +1 -1
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/ChangeItemEditor.d.ts +1 -1
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditor/ChangeItemEditor.js +80 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditor/ChangeItemEditor.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/SkeletonChangeItemEditorLoader.js +6 -5
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/index.d.ts +0 -1
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/index.js +0 -1
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/ChangeItemEditorRecentlyAdded.d.ts +8 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/ChangeItemEditorRecentlyAdded.js +59 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemEditorRecentlyAdded/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemOldValue}/ChangeItemOldValue.d.ts +1 -1
- package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemOldValue}/ChangeItemOldValue.js +10 -9
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/ChangeItemOldValue.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.d.ts +11 -0
- package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.js +27 -0
- package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/MoreAttributesEditor.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/index.js +1 -0
- package/features/workflow/ChangeRequestEditor/components/editors/editors.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/components/editors/index.d.ts +4 -0
- package/features/workflow/ChangeRequestEditor/components/editors/index.js +4 -0
- package/features/workflow/ChangeRequestEditor/helpers/addedAttributes.d.ts +11 -0
- package/features/workflow/ChangeRequestEditor/helpers/addedAttributes.js +62 -0
- package/features/workflow/ChangeRequestEditor/helpers/changesList.d.ts +2 -0
- package/features/workflow/ChangeRequestEditor/helpers/changesList.js +153 -0
- package/features/workflow/ChangeRequestEditor/helpers/changesList.test.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/helpers/changesList.test.js +201 -0
- package/features/workflow/ChangeRequestEditor/helpers/helpers.d.ts +6 -3
- package/features/workflow/ChangeRequestEditor/helpers/helpers.js +19 -3
- package/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.d.ts +3 -0
- package/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.js +186 -0
- package/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.test.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/helpers/mergeAddedAttributesWithDCRChanges.test.js +766 -0
- package/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.d.ts +4 -3
- package/features/workflow/ChangeRequestEditor/hooks/useChangeRequestEditor.js +9 -1
- package/features/workflow/ChangeRequestEditor/hooks/useNewAttributesEditor.d.ts +18 -0
- package/features/workflow/ChangeRequestEditor/hooks/useNewAttributesEditor.js +61 -0
- package/features/workflow/WorkflowTaskCard/components/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +7 -3
- package/features/workflow/contexts/AddedAttributesContext/index.d.ts +39 -0
- package/features/workflow/contexts/AddedAttributesContext/index.js +125 -0
- package/features/workflow/contexts/ChangeRequestEditorContext/index.d.ts +3 -2
- package/features/workflow/contexts/ChangeRequestEditorContext/index.js +47 -7
- package/features/workflow/contexts/ScrollToAddedAttributeContext/index.d.ts +11 -0
- package/features/workflow/contexts/ScrollToAddedAttributeContext/index.js +51 -0
- package/features/workflow/helpers/attributes.js +16 -13
- package/features/workflow/helpers/attributes.test.js +6 -3
- package/features/workflow/helpers/dcr.d.ts +6 -1
- package/features/workflow/helpers/dcr.js +122 -19
- package/features/workflow/helpers/dcr.test.js +172 -1
- package/features/workflow/helpers/merge.d.ts +3 -0
- package/features/workflow/helpers/merge.js +30 -19
- package/features/workflow/helpers/merge.test.js +2 -1
- package/features/workflow/helpers/moreAttributesScope.d.ts +4 -0
- package/features/workflow/helpers/moreAttributesScope.js +14 -0
- package/features/workflow/helpers/validation.js +31 -6
- package/features/workflow/hooks/useApplyDcrChanges.d.ts +2 -2
- package/features/workflow/hooks/useApplyDcrChanges.js +83 -66
- package/features/workflow/types.d.ts +12 -2
- package/package.json +2 -2
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/styles.d.ts +0 -1
- package/cjs/features/activity-log/ActivityLog/components/ActivityItem/styles.js +0 -57
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +0 -95
- package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.module.css.js +0 -9
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.d.ts +0 -7
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.js +0 -21
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.module.css.js +0 -9
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/index.d.ts +0 -1
- package/cjs/features/workflow/ChangeRequestEditor/components/StatusChips/index.js +0 -5
- package/features/activity-log/ActivityLog/components/ActivityItem/styles.d.ts +0 -1
- package/features/activity-log/ActivityLog/components/ActivityItem/styles.js +0 -54
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +0 -65
- package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.module.css.js +0 -9
- package/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.d.ts +0 -7
- package/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.js +0 -14
- package/features/workflow/ChangeRequestEditor/components/StatusChips/StatusChips.module.css.js +0 -9
- package/features/workflow/ChangeRequestEditor/components/StatusChips/index.d.ts +0 -1
- package/features/workflow/ChangeRequestEditor/components/StatusChips/index.js +0 -1
- /package/cjs/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/SkeletonChangeItemEditorLoader.d.ts +0 -0
- /package/features/workflow/ChangeRequestEditor/components/{ChangeItemEditor → editors/ChangeItemEditor}/SkeletonChangeItemEditorLoader.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChangeItemEditorRecentlyAdded } from './ChangeItemEditorRecentlyAdded';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChangeItemEditorRecentlyAdded } from './ChangeItemEditorRecentlyAdded';
|
|
@@ -2,10 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { isNil } from 'ramda';
|
|
3
3
|
import EastIcon from '@mui/icons-material/East';
|
|
4
4
|
import { DCROperationTypes, getAttributeValue } from '@reltio/mdm-sdk';
|
|
5
|
-
import { getDataTypeDefinition } from '
|
|
6
|
-
import { DataTypeValue } from '
|
|
7
|
-
import { ChangeItemLabel } from '
|
|
8
|
-
import
|
|
5
|
+
import { getDataTypeDefinition } from '../../../../helpers/common';
|
|
6
|
+
import { DataTypeValue } from '../../../../../../DataTypeValue';
|
|
7
|
+
import { ChangeItemLabel } from '../../ChangeItemLabel';
|
|
8
|
+
import editorStyles from '../editors.module.css';
|
|
9
|
+
import styles from './ChangeItemOldValue.module.css';
|
|
9
10
|
export var ChangeItemOldValue = function (_a) {
|
|
10
11
|
var change = _a.change;
|
|
11
12
|
var isUpdateOperation = change.operation === DCROperationTypes.EDITED;
|
|
@@ -13,13 +14,13 @@ export var ChangeItemOldValue = function (_a) {
|
|
|
13
14
|
var newValue = getAttributeValue(change.newValue);
|
|
14
15
|
var dataTypeDefinition = change.attributeType && getDataTypeDefinition(change.attributeType, newValue !== null && newValue !== void 0 ? newValue : oldValue);
|
|
15
16
|
var hasOldValue = !isNil(oldValue);
|
|
16
|
-
return (React.createElement("div", { className:
|
|
17
|
-
React.createElement(ChangeItemLabel, { change: change, className:
|
|
18
|
-
React.createElement("div", { className:
|
|
17
|
+
return (React.createElement("div", { className: editorStyles.attributeRow },
|
|
18
|
+
React.createElement(ChangeItemLabel, { change: change, className: editorStyles.labelColumn }),
|
|
19
|
+
React.createElement("div", { className: editorStyles.valueColumn }, isUpdateOperation && hasOldValue && (React.createElement("div", { className: styles.previousValue },
|
|
19
20
|
React.createElement("span", { className: styles.previousValueText },
|
|
20
21
|
React.createElement(DataTypeValue, { value: oldValue, dataTypeDefinition: dataTypeDefinition })),
|
|
21
22
|
React.createElement("span", { className: styles.arrow },
|
|
22
23
|
React.createElement(EastIcon, null))))),
|
|
23
|
-
React.createElement("div", { className:
|
|
24
|
-
React.createElement("div", { className:
|
|
24
|
+
React.createElement("div", { className: editorStyles.revertColumn }),
|
|
25
|
+
React.createElement("div", { className: editorStyles.operationColumn })));
|
|
25
26
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"previousValue":"ChangeItemOldValue-previousValue--wjU38","previousValueText":"ChangeItemOldValue-previousValueText--3YlY8","arrow":"ChangeItemOldValue-arrow--uP40C"};
|
|
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 = `.ChangeItemOldValue-previousValue--wjU38{align-items:center;display:flex;line-height:16px;padding:6px 12px 7px}.ChangeItemOldValue-previousValueText--3YlY8{color:var(--mui-palette-text-primary);letter-spacing:.24px}.ChangeItemOldValue-arrow--uP40C{color:var(--mui-palette-text-secondary);font-weight:700;margin:0 5px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
package/features/workflow/ChangeRequestEditor/components/editors/ChangeItemOldValue/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChangeItemOldValue } from './ChangeItemOldValue';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChangeItemOldValue } from './ChangeItemOldValue';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AttributeType } from '@reltio/mdm-sdk';
|
|
3
|
+
import type { Diff } from '../../../../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
data: AttributeType[];
|
|
6
|
+
onApply: (attributeTypes: AttributeType[]) => void;
|
|
7
|
+
change?: Diff;
|
|
8
|
+
parent?: AttributeType;
|
|
9
|
+
};
|
|
10
|
+
export declare const MoreAttributesEditor: ({ data, onApply, change, parent }: Props) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import i18n from 'ui-i18n';
|
|
4
|
+
import { useContextSelector } from '@fluentui/react-context-selector';
|
|
5
|
+
import { MoreAttributesButton } from '../../../../../../MoreAttributesButton';
|
|
6
|
+
import { ChangeRequestEditorContext } from '../../../../contexts/ChangeRequestEditorContext';
|
|
7
|
+
import { extractLineIds } from '../../../../helpers/merge';
|
|
8
|
+
import editorStyles from '../editors.module.css';
|
|
9
|
+
import styles from './MoreAttributesEditor.module.css';
|
|
10
|
+
var emptyLineIds = [];
|
|
11
|
+
export var MoreAttributesEditor = function (_a) {
|
|
12
|
+
var _b;
|
|
13
|
+
var data = _a.data, onApply = _a.onApply, change = _a.change, parent = _a.parent;
|
|
14
|
+
var lineIds = (change === null || change === void 0 ? void 0 : change.lineIds) || extractLineIds(change === null || change === void 0 ? void 0 : change.newValue) || emptyLineIds;
|
|
15
|
+
var isLineRejected = useContextSelector(ChangeRequestEditorContext, function (context) {
|
|
16
|
+
return context.getIsLineRejected(lineIds === null || lineIds === void 0 ? void 0 : lineIds[0]);
|
|
17
|
+
});
|
|
18
|
+
var isParentLineRejected = useContextSelector(ChangeRequestEditorContext, function (context) {
|
|
19
|
+
return context.getIsParentLineRejected(lineIds === null || lineIds === void 0 ? void 0 : lineIds[0]);
|
|
20
|
+
});
|
|
21
|
+
var label = i18n.text('More attributes');
|
|
22
|
+
var isRejected = isLineRejected || isParentLineRejected;
|
|
23
|
+
return (React.createElement("div", { className: classnames(editorStyles.attributeRow, (_b = {}, _b[styles.rejectedRow] = isRejected, _b)), "data-reltio-id": "more-attributes-editor" },
|
|
24
|
+
React.createElement("div", { className: editorStyles.labelColumn }),
|
|
25
|
+
React.createElement("div", { className: classnames(editorStyles.valueColumn, styles.moreAttributesButton) },
|
|
26
|
+
React.createElement(MoreAttributesButton, { label: label, popupTitle: label, data: data, parent: parent, onApply: onApply, disabled: isRejected }))));
|
|
27
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"rejectedRow":"MoreAttributesEditor-rejectedRow--N4E3t","moreAttributesButton":"MoreAttributesEditor-moreAttributesButton--Sk8AH"};
|
|
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 = `.MoreAttributesEditor-rejectedRow--N4E3t{background-color:#f6e7e7;max-width:none}.MoreAttributesEditor-rejectedRow--N4E3t:hover{background-color:hsla(0,45%,94%,.8)}.MoreAttributesEditor-moreAttributesButton--Sk8AH{height:37px;margin-top:-10px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MoreAttributesEditor } from './MoreAttributesEditor';
|
package/features/workflow/ChangeRequestEditor/components/editors/MoreAttributesEditor/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MoreAttributesEditor } from './MoreAttributesEditor';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"attributeRow":"editors-attributeRow--cDQyT","labelColumn":"editors-labelColumn--XWilB","valueColumn":"editors-valueColumn--V0i4-","addSameAttributeColumn":"editors-addSameAttributeColumn--W1TTs","revertColumn":"editors-revertColumn--tdxCB","operationColumn":"editors-operationColumn--M-4Pz","statusColumn":"editors-statusColumn--n-6Kn","rejectColumn":"editors-rejectColumn--Eh3Lg"};
|
|
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 = `.editors-attributeRow--cDQyT{align-items:center;display:flex;font-size:16px;gap:16px;max-width:1000px;min-height:37px}.editors-labelColumn--XWilB{box-sizing:border-box;min-height:21px;width:170px}.editors-valueColumn--V0i4-{display:flex;flex:1;flex-direction:column;gap:4px}.editors-addSameAttributeColumn--W1TTs{margin-left:-8px}.editors-addSameAttributeColumn--W1TTs,.editors-revertColumn--tdxCB{align-items:flex-start;display:flex;width:16px}.editors-operationColumn--M-4Pz{align-items:flex-start;display:flex;width:84px}.editors-statusColumn--n-6Kn{align-items:flex-start;display:flex;width:90px}.editors-rejectColumn--Eh3Lg{align-items:flex-start;display:flex;width:110px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ChangeItemEditor, SkeletonChangeItemEditorLoader } from './ChangeItemEditor';
|
|
2
|
+
export { ChangeItemEditorRecentlyAdded } from './ChangeItemEditorRecentlyAdded';
|
|
3
|
+
export { ChangeItemOldValue } from './ChangeItemOldValue';
|
|
4
|
+
export { MoreAttributesEditor } from './MoreAttributesEditor';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ChangeItemEditor, SkeletonChangeItemEditorLoader } from './ChangeItemEditor';
|
|
2
|
+
export { ChangeItemEditorRecentlyAdded } from './ChangeItemEditorRecentlyAdded';
|
|
3
|
+
export { ChangeItemOldValue } from './ChangeItemOldValue';
|
|
4
|
+
export { MoreAttributesEditor } from './MoreAttributesEditor';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Diff } from '../../types';
|
|
2
|
+
import { type ChangeOverrides } from '../../contexts/AddedAttributesContext';
|
|
3
|
+
export declare const isAddedAttribute: (change: Diff) => boolean;
|
|
4
|
+
export declare const getAddedId: (change: Diff) => string | undefined;
|
|
5
|
+
export declare const getParentAddedId: (addedId: string) => string | undefined;
|
|
6
|
+
export declare const hasParentAddedAttribute: (addedId: string | undefined) => boolean;
|
|
7
|
+
export declare const getParentLineId: (lineId: string) => string | undefined;
|
|
8
|
+
export declare const isRootAddedAttribute: (lineId: string) => boolean;
|
|
9
|
+
export declare const getObjectIdFromLineId: (lineId: string) => string;
|
|
10
|
+
export declare const extractChangeOverrides: (change: Diff) => ChangeOverrides | undefined;
|
|
11
|
+
export declare const getParentChangeOverrides: (change: Diff) => ChangeOverrides | undefined;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { ADDED_ID_SEPARATOR } from '../../contexts/AddedAttributesContext';
|
|
13
|
+
export var isAddedAttribute = function (change) {
|
|
14
|
+
var _a;
|
|
15
|
+
return !!((_a = change.newValue) === null || _a === void 0 ? void 0 : _a.addedId) || !!change.addedId;
|
|
16
|
+
};
|
|
17
|
+
export var getAddedId = function (change) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return (_b = (_a = change.newValue) === null || _a === void 0 ? void 0 : _a.addedId) !== null && _b !== void 0 ? _b : change.addedId;
|
|
20
|
+
};
|
|
21
|
+
export var getParentAddedId = function (addedId) {
|
|
22
|
+
var parts = addedId.split(ADDED_ID_SEPARATOR);
|
|
23
|
+
return parts.length > 2 ? parts.slice(0, -1).join(ADDED_ID_SEPARATOR) : undefined;
|
|
24
|
+
};
|
|
25
|
+
export var hasParentAddedAttribute = function (addedId) {
|
|
26
|
+
return !!addedId && !!getParentAddedId(addedId);
|
|
27
|
+
};
|
|
28
|
+
export var getParentLineId = function (lineId) {
|
|
29
|
+
var parts = lineId.split('/');
|
|
30
|
+
return parts.length > 3 ? parts.slice(0, -3).join('/') : undefined;
|
|
31
|
+
};
|
|
32
|
+
export var isRootAddedAttribute = function (lineId) {
|
|
33
|
+
return lineId.split('/').length === 3;
|
|
34
|
+
};
|
|
35
|
+
export var getObjectIdFromLineId = function (lineId) {
|
|
36
|
+
return lineId.split('/')[0];
|
|
37
|
+
};
|
|
38
|
+
export var extractChangeOverrides = function (change) {
|
|
39
|
+
if (!change.attributePath && !change.refAttributeType && !change.refObjectURI)
|
|
40
|
+
return undefined;
|
|
41
|
+
return __assign(__assign(__assign({}, (change.attributePath && { attributePath: change.attributePath })), (change.refAttributeType && { refAttributeType: change.refAttributeType })), (change.refObjectURI && { refObjectURI: change.refObjectURI }));
|
|
42
|
+
};
|
|
43
|
+
export var getParentChangeOverrides = function (change) {
|
|
44
|
+
var result = {};
|
|
45
|
+
if (change.attributePath) {
|
|
46
|
+
var parts = change.attributePath.split('/');
|
|
47
|
+
var dropCount = parts.length % 2 === 0 ? 2 : 1;
|
|
48
|
+
if (parts.length > dropCount) {
|
|
49
|
+
result.attributePath = parts.slice(0, -dropCount).join('/');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (change.refAttributeType) {
|
|
53
|
+
var parts = change.refAttributeType.split('/');
|
|
54
|
+
if (parts.length > 2) {
|
|
55
|
+
result.refAttributeType = parts.slice(0, -2).join('/');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (change.refObjectURI) {
|
|
59
|
+
result.refObjectURI = change.refObjectURI;
|
|
60
|
+
}
|
|
61
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
62
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { DCROperationTypes, isComplexAttribute, isImage, isRoleAttrType, isTagAttrType } from '@reltio/mdm-sdk';
|
|
13
|
+
import { getOperationType } from '../../helpers/common';
|
|
14
|
+
import { isDiffChange } from './helpers';
|
|
15
|
+
var getImageOperation = function (diff) {
|
|
16
|
+
var _a;
|
|
17
|
+
var innerChange = (_a = diff.attributeValue) === null || _a === void 0 ? void 0 : _a.value;
|
|
18
|
+
return (innerChange === null || innerChange === void 0 ? void 0 : innerChange.type) ? getOperationType(innerChange.type) : undefined;
|
|
19
|
+
};
|
|
20
|
+
var filterImageSubAttributes = function (rawChangesList) {
|
|
21
|
+
var filtered = [];
|
|
22
|
+
var skipBelowLevel = null;
|
|
23
|
+
for (var _i = 0, rawChangesList_1 = rawChangesList; _i < rawChangesList_1.length; _i++) {
|
|
24
|
+
var item = rawChangesList_1[_i];
|
|
25
|
+
if (!isDiffChange(item)) {
|
|
26
|
+
skipBelowLevel = null;
|
|
27
|
+
filtered.push(item);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
var diff = item;
|
|
31
|
+
if (skipBelowLevel !== null && diff.level > skipBelowLevel) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
skipBelowLevel = null;
|
|
35
|
+
if (isImage(diff.attributeType)) {
|
|
36
|
+
skipBelowLevel = diff.level;
|
|
37
|
+
}
|
|
38
|
+
filtered.push(item);
|
|
39
|
+
}
|
|
40
|
+
return filtered;
|
|
41
|
+
};
|
|
42
|
+
var withImageOperation = function (items) {
|
|
43
|
+
return items.map(function (item) {
|
|
44
|
+
if (!isDiffChange(item) || !isImage(item.attributeType))
|
|
45
|
+
return item;
|
|
46
|
+
var operation = getImageOperation(item);
|
|
47
|
+
return operation ? __assign(__assign({}, item), { operation: operation }) : item;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
var isSameGroup = function (a, b) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
return a.operation === DCROperationTypes.ADDED &&
|
|
53
|
+
b.operation === DCROperationTypes.ADDED &&
|
|
54
|
+
((_a = a.attributeType) === null || _a === void 0 ? void 0 : _a.uri) === ((_b = b.attributeType) === null || _b === void 0 ? void 0 : _b.uri) &&
|
|
55
|
+
a.level === b.level;
|
|
56
|
+
};
|
|
57
|
+
var canAddSameAttribute = function (attributeType) {
|
|
58
|
+
var _a;
|
|
59
|
+
if (!attributeType)
|
|
60
|
+
return false;
|
|
61
|
+
if (attributeType.singleValue)
|
|
62
|
+
return false;
|
|
63
|
+
if (((_a = attributeType.cardinality) === null || _a === void 0 ? void 0 : _a.maxValue) === 1)
|
|
64
|
+
return false;
|
|
65
|
+
if (isRoleAttrType(attributeType) || isTagAttrType(attributeType))
|
|
66
|
+
return false;
|
|
67
|
+
return true;
|
|
68
|
+
};
|
|
69
|
+
var withDisplayOptions = function (items) {
|
|
70
|
+
return items.map(function (item, i) {
|
|
71
|
+
if (!isDiffChange(item))
|
|
72
|
+
return item;
|
|
73
|
+
if (item.operation !== DCROperationTypes.ADDED) {
|
|
74
|
+
return __assign(__assign({}, item), { displayOptions: {
|
|
75
|
+
showLabel: item.operation !== DCROperationTypes.EDITED,
|
|
76
|
+
showAddButton: false,
|
|
77
|
+
hasSameAttributeSiblings: false
|
|
78
|
+
} });
|
|
79
|
+
}
|
|
80
|
+
var prev = items[i - 1];
|
|
81
|
+
var next = items[i + 1];
|
|
82
|
+
var hasPrevSibling = !!prev && isDiffChange(prev) && isSameGroup(prev, item);
|
|
83
|
+
var hasNextSibling = !!next && isDiffChange(next) && isSameGroup(item, next);
|
|
84
|
+
return __assign(__assign({}, item), { displayOptions: {
|
|
85
|
+
showLabel: !hasPrevSibling,
|
|
86
|
+
showAddButton: canAddSameAttribute(item.attributeType) && !hasNextSibling,
|
|
87
|
+
hasSameAttributeSiblings: hasPrevSibling || hasNextSibling
|
|
88
|
+
} });
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
var truncateAtSegment = function (source, segment) {
|
|
92
|
+
var index = source.indexOf(segment);
|
|
93
|
+
return index >= 0 ? source.substring(0, index + segment.length) : undefined;
|
|
94
|
+
};
|
|
95
|
+
var findDescendantWithPath = function (items, fromIndex, parentLevel) {
|
|
96
|
+
for (var j = fromIndex + 1; j < items.length; j++) {
|
|
97
|
+
var next = items[j];
|
|
98
|
+
if (!isDiffChange(next) || next.level <= parentLevel)
|
|
99
|
+
break;
|
|
100
|
+
if (next.attributePath)
|
|
101
|
+
return next;
|
|
102
|
+
}
|
|
103
|
+
return undefined;
|
|
104
|
+
};
|
|
105
|
+
var deriveParentPath = function (descendant, name, instanceId) {
|
|
106
|
+
var segment = "".concat(name, "/").concat(instanceId);
|
|
107
|
+
var result = {};
|
|
108
|
+
var attributePath = truncateAtSegment(descendant.attributePath, segment);
|
|
109
|
+
if (attributePath) {
|
|
110
|
+
result.attributePath = attributePath;
|
|
111
|
+
}
|
|
112
|
+
if (descendant.refAttributeType) {
|
|
113
|
+
var refAttributeType = truncateAtSegment(descendant.refAttributeType, "/attributes/".concat(name));
|
|
114
|
+
if (refAttributeType) {
|
|
115
|
+
result.refAttributeType = refAttributeType;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (descendant.refObjectURI) {
|
|
119
|
+
result.refObjectURI = descendant.refObjectURI;
|
|
120
|
+
}
|
|
121
|
+
return Object.keys(result).length > 0 ? result : null;
|
|
122
|
+
};
|
|
123
|
+
var extractPathFromInnerChange = function (attributeValue) {
|
|
124
|
+
var inner = attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.value;
|
|
125
|
+
if (!(inner === null || inner === void 0 ? void 0 : inner.attributePath))
|
|
126
|
+
return null;
|
|
127
|
+
return __assign(__assign({ attributePath: inner.attributePath }, (inner.refAttributeType && { refAttributeType: inner.refAttributeType })), (inner.refObjectURI && { refObjectURI: inner.refObjectURI }));
|
|
128
|
+
};
|
|
129
|
+
var fillParentPaths = function (items) {
|
|
130
|
+
return items.map(function (item, index) {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
if (!isDiffChange(item) || !isComplexAttribute(item.attributeType) || item.attributePath)
|
|
133
|
+
return item;
|
|
134
|
+
var innerPath = extractPathFromInnerChange(item.attributeValue);
|
|
135
|
+
if (innerPath)
|
|
136
|
+
return __assign(__assign({}, item), innerPath);
|
|
137
|
+
var name = (_a = item.attributeType) === null || _a === void 0 ? void 0 : _a.name;
|
|
138
|
+
var instanceId = (_b = item.attributeValue) === null || _b === void 0 ? void 0 : _b.id;
|
|
139
|
+
if (!name || !instanceId)
|
|
140
|
+
return item;
|
|
141
|
+
var descendant = findDescendantWithPath(items, index, item.level);
|
|
142
|
+
if (!descendant)
|
|
143
|
+
return item;
|
|
144
|
+
var parentPath = deriveParentPath(descendant, name, instanceId);
|
|
145
|
+
return parentPath ? __assign(__assign({}, item), parentPath) : item;
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
export var prepareChangesList = function (rawChangesList) {
|
|
149
|
+
var withPaths = fillParentPaths(rawChangesList);
|
|
150
|
+
var filtered = filterImageSubAttributes(withPaths);
|
|
151
|
+
var withOperations = withImageOperation(filtered);
|
|
152
|
+
return withDisplayOptions(withOperations);
|
|
153
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { DataTypes, DCROperationTypes } from '@reltio/mdm-sdk';
|
|
13
|
+
import { prepareChangesList } from './changesList';
|
|
14
|
+
var createDiff = function (overrides) {
|
|
15
|
+
if (overrides === void 0) { overrides = {}; }
|
|
16
|
+
return (__assign({ level: 0, label: 'Test', attributeType: {
|
|
17
|
+
uri: 'configuration/entityTypes/HCP/attributes/Name',
|
|
18
|
+
name: 'Name',
|
|
19
|
+
label: 'Name',
|
|
20
|
+
type: 'String'
|
|
21
|
+
} }, overrides));
|
|
22
|
+
};
|
|
23
|
+
var createTitle = function (label) { return ({ label: label }); };
|
|
24
|
+
describe('prepareChangesList', function () {
|
|
25
|
+
describe('filterImageSubAttributes', function () {
|
|
26
|
+
it('should filter sub-attributes of image type attributes', function () {
|
|
27
|
+
var imageAttr = createDiff({
|
|
28
|
+
level: 0,
|
|
29
|
+
label: 'Photo',
|
|
30
|
+
attributeType: {
|
|
31
|
+
uri: 'attr/Photo',
|
|
32
|
+
name: 'Photo',
|
|
33
|
+
label: 'Photo',
|
|
34
|
+
type: DataTypes.TYPE_IMAGE
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
var imageSub1 = createDiff({ level: 1, label: 'FileName' });
|
|
38
|
+
var imageSub2 = createDiff({ level: 1, label: 'FileSize' });
|
|
39
|
+
var normalAttr = createDiff({ level: 0, label: 'Name' });
|
|
40
|
+
var result = prepareChangesList([imageAttr, imageSub1, imageSub2, normalAttr]);
|
|
41
|
+
var labels = result.map(function (item) { return item.label; });
|
|
42
|
+
expect(labels).toContain('Photo');
|
|
43
|
+
expect(labels).toContain('Name');
|
|
44
|
+
expect(labels).not.toContain('FileName');
|
|
45
|
+
expect(labels).not.toContain('FileSize');
|
|
46
|
+
});
|
|
47
|
+
it('should keep non-image nested attributes and their children unchanged', function () {
|
|
48
|
+
var nested = createDiff({
|
|
49
|
+
level: 0,
|
|
50
|
+
label: 'Details',
|
|
51
|
+
attributeType: { uri: 'attr/Details', name: 'Details', label: 'Details', type: 'Nested' }
|
|
52
|
+
});
|
|
53
|
+
var child = createDiff({ level: 1, label: 'Notes' });
|
|
54
|
+
var result = prepareChangesList([nested, child]);
|
|
55
|
+
expect(result).toHaveLength(2);
|
|
56
|
+
});
|
|
57
|
+
it('should reset image skip when a Title item is encountered', function () {
|
|
58
|
+
var imageAttr = createDiff({
|
|
59
|
+
level: 0,
|
|
60
|
+
label: 'Photo',
|
|
61
|
+
attributeType: {
|
|
62
|
+
uri: 'attr/Photo',
|
|
63
|
+
name: 'Photo',
|
|
64
|
+
label: 'Photo',
|
|
65
|
+
type: DataTypes.TYPE_IMAGE
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
var imageSub = createDiff({ level: 1, label: 'FileName' });
|
|
69
|
+
var title = createTitle('Section');
|
|
70
|
+
var normalAttr = createDiff({ level: 1, label: 'Name' });
|
|
71
|
+
var result = prepareChangesList([imageAttr, imageSub, title, normalAttr]);
|
|
72
|
+
var labels = result.map(function (item) { return item.label; });
|
|
73
|
+
expect(labels).toEqual(['Photo', 'Section', 'Name']);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('displayOptions', function () {
|
|
77
|
+
it('should set showLabel=true for first ADDED item in a group', function () {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
var attrType = {
|
|
80
|
+
uri: 'configuration/entityTypes/HCP/attributes/Name',
|
|
81
|
+
name: 'Name',
|
|
82
|
+
label: 'Name',
|
|
83
|
+
type: 'String'
|
|
84
|
+
};
|
|
85
|
+
var diff1 = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType, level: 0 });
|
|
86
|
+
var diff2 = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType, level: 0 });
|
|
87
|
+
var result = prepareChangesList([diff1, diff2]);
|
|
88
|
+
expect((_a = result[0].displayOptions) === null || _a === void 0 ? void 0 : _a.showLabel).toBe(true);
|
|
89
|
+
expect((_b = result[1].displayOptions) === null || _b === void 0 ? void 0 : _b.showLabel).toBe(false);
|
|
90
|
+
});
|
|
91
|
+
it('should set showAddButton=true only for last ADDED item in group of multi-value attr', function () {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
var attrType = {
|
|
94
|
+
uri: 'configuration/entityTypes/HCP/attributes/Name',
|
|
95
|
+
name: 'Name',
|
|
96
|
+
label: 'Name',
|
|
97
|
+
type: 'String'
|
|
98
|
+
};
|
|
99
|
+
var diff1 = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType, level: 0 });
|
|
100
|
+
var diff2 = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType, level: 0 });
|
|
101
|
+
var result = prepareChangesList([diff1, diff2]);
|
|
102
|
+
expect((_a = result[0].displayOptions) === null || _a === void 0 ? void 0 : _a.showAddButton).toBe(false);
|
|
103
|
+
expect((_b = result[1].displayOptions) === null || _b === void 0 ? void 0 : _b.showAddButton).toBe(true);
|
|
104
|
+
});
|
|
105
|
+
it('should set showAddButton=false for single-value attributes', function () {
|
|
106
|
+
var _a;
|
|
107
|
+
var attrType = {
|
|
108
|
+
uri: 'configuration/entityTypes/HCP/attributes/Id',
|
|
109
|
+
name: 'Id',
|
|
110
|
+
label: 'Id',
|
|
111
|
+
type: 'String',
|
|
112
|
+
singleValue: true
|
|
113
|
+
};
|
|
114
|
+
var diff = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType, level: 0 });
|
|
115
|
+
var result = prepareChangesList([diff]);
|
|
116
|
+
expect((_a = result[0].displayOptions) === null || _a === void 0 ? void 0 : _a.showAddButton).toBe(false);
|
|
117
|
+
});
|
|
118
|
+
it('should set showAddButton=false for role and tag attributes', function () {
|
|
119
|
+
var _a, _b;
|
|
120
|
+
var roleType = { uri: 'roles', name: 'roles', label: 'Roles', type: 'String' };
|
|
121
|
+
var tagType = { uri: 'tags', name: 'tags', label: 'Tags', type: 'String' };
|
|
122
|
+
var diff1 = createDiff({ operation: DCROperationTypes.ADDED, attributeType: roleType, level: 0 });
|
|
123
|
+
var diff2 = createDiff({ operation: DCROperationTypes.ADDED, attributeType: tagType, level: 0 });
|
|
124
|
+
var result = prepareChangesList([diff1, diff2]);
|
|
125
|
+
expect((_a = result[0].displayOptions) === null || _a === void 0 ? void 0 : _a.showAddButton).toBe(false);
|
|
126
|
+
expect((_b = result[1].displayOptions) === null || _b === void 0 ? void 0 : _b.showAddButton).toBe(false);
|
|
127
|
+
});
|
|
128
|
+
it('should set showLabel=true and showAddButton=false for non-ADDED non-EDITED operations', function () {
|
|
129
|
+
var _a, _b;
|
|
130
|
+
var diff = createDiff({ operation: DCROperationTypes.DELETED, level: 0 });
|
|
131
|
+
var result = prepareChangesList([diff]);
|
|
132
|
+
expect((_a = result[0].displayOptions) === null || _a === void 0 ? void 0 : _a.showLabel).toBe(true);
|
|
133
|
+
expect((_b = result[0].displayOptions) === null || _b === void 0 ? void 0 : _b.showAddButton).toBe(false);
|
|
134
|
+
});
|
|
135
|
+
it('should set showLabel=false for EDITED operations', function () {
|
|
136
|
+
var _a;
|
|
137
|
+
var diff = createDiff({ operation: DCROperationTypes.EDITED, level: 0 });
|
|
138
|
+
var result = prepareChangesList([diff]);
|
|
139
|
+
expect((_a = result[0].displayOptions) === null || _a === void 0 ? void 0 : _a.showLabel).toBe(false);
|
|
140
|
+
});
|
|
141
|
+
it('should set showAddButton=false for cardinality maxValue=1 attributes', function () {
|
|
142
|
+
var _a;
|
|
143
|
+
var attrType = {
|
|
144
|
+
uri: 'configuration/entityTypes/HCP/attributes/Single',
|
|
145
|
+
name: 'Single',
|
|
146
|
+
label: 'Single',
|
|
147
|
+
type: 'String',
|
|
148
|
+
cardinality: { maxValue: 1 }
|
|
149
|
+
};
|
|
150
|
+
var diff = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType, level: 0 });
|
|
151
|
+
var result = prepareChangesList([diff]);
|
|
152
|
+
expect((_a = result[0].displayOptions) === null || _a === void 0 ? void 0 : _a.showAddButton).toBe(false);
|
|
153
|
+
});
|
|
154
|
+
it('should set hasSameAttributeSiblings=true for all items in a multi-value ADDED group', function () {
|
|
155
|
+
var _a, _b;
|
|
156
|
+
var attrType = {
|
|
157
|
+
uri: 'configuration/entityTypes/HCP/attributes/Name',
|
|
158
|
+
name: 'Name',
|
|
159
|
+
label: 'Name',
|
|
160
|
+
type: 'String'
|
|
161
|
+
};
|
|
162
|
+
var diff1 = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType, level: 0 });
|
|
163
|
+
var diff2 = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType, level: 0 });
|
|
164
|
+
var result = prepareChangesList([diff1, diff2]);
|
|
165
|
+
expect((_a = result[0].displayOptions) === null || _a === void 0 ? void 0 : _a.hasSameAttributeSiblings).toBe(true);
|
|
166
|
+
expect((_b = result[1].displayOptions) === null || _b === void 0 ? void 0 : _b.hasSameAttributeSiblings).toBe(true);
|
|
167
|
+
});
|
|
168
|
+
it('should set hasSameAttributeSiblings=false for a single ADDED item', function () {
|
|
169
|
+
var _a;
|
|
170
|
+
var attrType = {
|
|
171
|
+
uri: 'configuration/entityTypes/HCP/attributes/Name',
|
|
172
|
+
name: 'Name',
|
|
173
|
+
label: 'Name',
|
|
174
|
+
type: 'String'
|
|
175
|
+
};
|
|
176
|
+
var diff = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType, level: 0 });
|
|
177
|
+
var result = prepareChangesList([diff]);
|
|
178
|
+
expect((_a = result[0].displayOptions) === null || _a === void 0 ? void 0 : _a.hasSameAttributeSiblings).toBe(false);
|
|
179
|
+
});
|
|
180
|
+
it('should set hasSameAttributeSiblings=false for ADDED items with different attribute URIs', function () {
|
|
181
|
+
var _a, _b;
|
|
182
|
+
var attrType1 = {
|
|
183
|
+
uri: 'configuration/entityTypes/HCP/attributes/Name',
|
|
184
|
+
name: 'Name',
|
|
185
|
+
label: 'Name',
|
|
186
|
+
type: 'String'
|
|
187
|
+
};
|
|
188
|
+
var attrType2 = {
|
|
189
|
+
uri: 'configuration/entityTypes/HCP/attributes/Email',
|
|
190
|
+
name: 'Email',
|
|
191
|
+
label: 'Email',
|
|
192
|
+
type: 'String'
|
|
193
|
+
};
|
|
194
|
+
var diff1 = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType1, level: 0 });
|
|
195
|
+
var diff2 = createDiff({ operation: DCROperationTypes.ADDED, attributeType: attrType2, level: 0 });
|
|
196
|
+
var result = prepareChangesList([diff1, diff2]);
|
|
197
|
+
expect((_a = result[0].displayOptions) === null || _a === void 0 ? void 0 : _a.hasSameAttributeSiblings).toBe(false);
|
|
198
|
+
expect((_b = result[1].displayOptions) === null || _b === void 0 ? void 0 : _b.hasSameAttributeSiblings).toBe(false);
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { DCRChanges,
|
|
2
|
-
|
|
1
|
+
import { type DCRChanges, type EnrichedDCRChanges, type GroupedObjectsInfo, type Metadata, type SimpleAttributeValue, type TEntityType } from '@reltio/mdm-sdk';
|
|
2
|
+
export declare const isSimpleAttributeValue: (value: unknown) => value is SimpleAttributeValue;
|
|
3
|
+
import type { Diff, Title } from '../../types';
|
|
3
4
|
export declare const isEditableChange: (change: Diff, entityInfo: GroupedObjectsInfo["entity"]) => boolean;
|
|
4
|
-
export declare const addLineIdToValue: (data: DCRChanges) => EnrichedDCRChanges;
|
|
5
|
+
export declare const addLineIdToValue: (data: DCRChanges | EnrichedDCRChanges) => EnrichedDCRChanges;
|
|
5
6
|
export declare const isDiffChange: (change: Diff | Title) => change is Diff;
|
|
7
|
+
export declare const isRelationRow: (change: Diff) => boolean;
|
|
8
|
+
export declare const isNestedOrReferenceParent: (change: Diff) => boolean;
|
|
6
9
|
export declare const checkCanInitiateChangeRequest: (metadata: Metadata, entityType: TEntityType, change: Diff) => any;
|