@reltio/components 1.4.2198 → 1.4.2200

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/ModeSwitcherSelect/ModeSwitcherSelect.d.ts +1 -0
  2. package/ModeSwitcherSelect/ModeSwitcherSelect.js +3 -3
  3. package/RolesEditor/RolesEditor.js +5 -20
  4. package/RolesEditor/RolesEditor.module.css.js +2 -2
  5. package/RolesInput/RolesInput.d.ts +8 -0
  6. package/RolesInput/RolesInput.js +31 -0
  7. package/RolesInput/RolesInput.module.css.js +9 -0
  8. package/TagsEditor/TagsEditor.js +4 -67
  9. package/TagsInput/TagsInput.d.ts +8 -0
  10. package/TagsInput/TagsInput.js +71 -0
  11. package/cjs/ModeSwitcherSelect/ModeSwitcherSelect.d.ts +1 -0
  12. package/cjs/ModeSwitcherSelect/ModeSwitcherSelect.js +3 -3
  13. package/cjs/RolesEditor/RolesEditor.js +2 -17
  14. package/cjs/RolesEditor/RolesEditor.module.css.js +2 -2
  15. package/cjs/RolesInput/RolesInput.d.ts +8 -0
  16. package/cjs/RolesInput/RolesInput.js +61 -0
  17. package/cjs/RolesInput/RolesInput.module.css.js +9 -0
  18. package/cjs/TagsEditor/TagsEditor.js +2 -65
  19. package/cjs/TagsInput/TagsInput.d.ts +8 -0
  20. package/cjs/TagsInput/TagsInput.js +98 -0
  21. package/cjs/features/workflow/AttributesChanges/AttributesChanges.js +9 -48
  22. package/cjs/features/workflow/AttributesChanges/AttributesChanges.module.css.js +9 -0
  23. package/cjs/features/workflow/AttributesChanges/components/ChangeView/ChangeView.js +7 -9
  24. package/cjs/features/workflow/AttributesChanges/components/ChangeView/ChangeView.module.css.js +9 -0
  25. package/cjs/features/workflow/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +1 -1
  26. package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +2 -2
  27. package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.js +19 -40
  28. package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.module.css.js +9 -0
  29. package/cjs/features/workflow/AttributesChanges/useCollapsibleList.d.ts +1 -1
  30. package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.d.ts +3 -2
  31. package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +11 -6
  32. package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.module.css.js +2 -2
  33. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts +10 -0
  34. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +72 -0
  35. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.module.css.js +9 -0
  36. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemLabel.d.ts +9 -0
  37. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemLabel.js +19 -0
  38. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.d.ts +7 -0
  39. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.js +32 -0
  40. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.d.ts +9 -0
  41. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.js +44 -0
  42. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.d.ts +12 -0
  43. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.js +38 -0
  44. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/SkeletonChangeItemEditorLoader.d.ts +2 -0
  45. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/SkeletonChangeItemEditorLoader.js +20 -0
  46. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/index.d.ts +3 -0
  47. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/index.js +9 -0
  48. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +10 -0
  49. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +27 -0
  50. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js +9 -0
  51. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/index.d.ts +1 -0
  52. package/cjs/features/workflow/ChangeRequestEditor/components/ChangeItemRow/index.js +5 -0
  53. package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +10 -0
  54. package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +61 -0
  55. package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.module.css.js +9 -0
  56. package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.d.ts +2 -0
  57. package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.js +23 -0
  58. package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/index.d.ts +2 -0
  59. package/cjs/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/index.js +7 -0
  60. package/cjs/features/workflow/ChangeRequestEditor/helpers.d.ts +3 -0
  61. package/cjs/features/workflow/ChangeRequestEditor/helpers.js +16 -0
  62. package/cjs/features/workflow/DCREntityUriLink/DCREntityUriLink.d.ts +10 -0
  63. package/cjs/features/workflow/DCREntityUriLink/DCREntityUriLink.js +21 -0
  64. package/cjs/features/workflow/DCREntityUriLink/DCREntityUriLink.module.css.js +9 -0
  65. package/cjs/features/workflow/OperationChip/OperationChip.d.ts +10 -0
  66. package/cjs/features/workflow/OperationChip/OperationChip.js +16 -0
  67. package/cjs/features/workflow/OperationChip/OperationChip.module.css.js +9 -0
  68. package/cjs/features/workflow/OperationChip/index.d.ts +1 -0
  69. package/cjs/features/workflow/OperationChip/index.js +5 -0
  70. package/cjs/features/workflow/RelationEntityLink/RelationEntityLink.d.ts +9 -0
  71. package/cjs/features/workflow/RelationEntityLink/RelationEntityLink.js +67 -0
  72. package/cjs/features/workflow/RelationEntityLink/RelationEntityLink.module.css.js +9 -0
  73. package/cjs/features/workflow/RelationEntityLink/index.d.ts +1 -0
  74. package/cjs/features/workflow/RelationEntityLink/index.js +5 -0
  75. package/cjs/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +1 -1
  76. package/cjs/features/workflow/ReviewDCRDialog/ReviewDCRDialog.module.css.js +1 -1
  77. package/cjs/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.js +3 -17
  78. package/cjs/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.module.css.js +1 -1
  79. package/cjs/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.js +1 -1
  80. package/cjs/features/workflow/WorkflowComments/components/Comment/Comment.js +9 -10
  81. package/cjs/features/workflow/WorkflowComments/components/Comment/Comment.module.css.js +9 -0
  82. package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/attributes.js +13 -10
  83. package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/attributes.test.js +19 -9
  84. package/cjs/features/workflow/helpers/common.d.ts +2 -1
  85. package/cjs/features/workflow/helpers/common.js +6 -1
  86. package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/merge.js +3 -4
  87. package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/merge.test.js +5 -3
  88. package/cjs/features/workflow/hooks/useChangesList.d.ts +9 -0
  89. package/cjs/features/workflow/hooks/useChangesList.js +24 -0
  90. package/cjs/features/workflow/types.d.ts +16 -0
  91. package/cjs/hooks/useCssVariableStyles/useCssVariableStyles.js +1 -1
  92. package/cjs/icons/SuggestedChanges.d.ts +3 -0
  93. package/cjs/icons/SuggestedChanges.js +27 -0
  94. package/features/workflow/AttributesChanges/AttributesChanges.js +7 -23
  95. package/features/workflow/AttributesChanges/AttributesChanges.module.css.js +9 -0
  96. package/features/workflow/AttributesChanges/components/ChangeView/ChangeView.js +3 -5
  97. package/features/workflow/AttributesChanges/components/ChangeView/ChangeView.module.css.js +9 -0
  98. package/features/workflow/AttributesChanges/components/DCRChangesList/DCRChangesList.d.ts +1 -1
  99. package/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.d.ts +2 -2
  100. package/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.js +22 -43
  101. package/features/workflow/AttributesChanges/components/DiffRenderer/DiffRenderer.module.css.js +9 -0
  102. package/features/workflow/AttributesChanges/useCollapsibleList.d.ts +1 -1
  103. package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.d.ts +3 -2
  104. package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +11 -6
  105. package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.module.css.js +2 -2
  106. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.d.ts +10 -0
  107. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.js +42 -0
  108. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemEditor.module.css.js +9 -0
  109. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemLabel.d.ts +9 -0
  110. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemLabel.js +12 -0
  111. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.d.ts +7 -0
  112. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/ChangeItemOldValue.js +25 -0
  113. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.d.ts +9 -0
  114. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditor.js +14 -0
  115. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.d.ts +12 -0
  116. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/DCRValueEditorFactory.js +32 -0
  117. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/SkeletonChangeItemEditorLoader.d.ts +2 -0
  118. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/SkeletonChangeItemEditorLoader.js +13 -0
  119. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/index.d.ts +3 -0
  120. package/features/workflow/ChangeRequestEditor/components/ChangeItemEditor/index.js +3 -0
  121. package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.d.ts +10 -0
  122. package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.js +20 -0
  123. package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/ChangeItemRow.module.css.js +9 -0
  124. package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/index.d.ts +1 -0
  125. package/features/workflow/ChangeRequestEditor/components/ChangeItemRow/index.js +1 -0
  126. package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.d.ts +10 -0
  127. package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.js +31 -0
  128. package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/EntityChangesGroup.module.css.js +9 -0
  129. package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.d.ts +2 -0
  130. package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/SkeletonEntityChangesGroupLoader.js +16 -0
  131. package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/index.d.ts +2 -0
  132. package/features/workflow/ChangeRequestEditor/components/EntityChangesGroup/index.js +2 -0
  133. package/features/workflow/ChangeRequestEditor/helpers.d.ts +3 -0
  134. package/features/workflow/ChangeRequestEditor/helpers.js +12 -0
  135. package/features/workflow/DCREntityUriLink/DCREntityUriLink.d.ts +10 -0
  136. package/features/workflow/DCREntityUriLink/DCREntityUriLink.js +14 -0
  137. package/features/workflow/DCREntityUriLink/DCREntityUriLink.module.css.js +9 -0
  138. package/features/workflow/OperationChip/OperationChip.d.ts +10 -0
  139. package/features/workflow/OperationChip/OperationChip.js +9 -0
  140. package/features/workflow/OperationChip/OperationChip.module.css.js +9 -0
  141. package/features/workflow/OperationChip/index.d.ts +1 -0
  142. package/features/workflow/OperationChip/index.js +1 -0
  143. package/features/workflow/RelationEntityLink/RelationEntityLink.d.ts +9 -0
  144. package/features/workflow/RelationEntityLink/RelationEntityLink.js +37 -0
  145. package/features/workflow/RelationEntityLink/RelationEntityLink.module.css.js +9 -0
  146. package/features/workflow/RelationEntityLink/index.d.ts +1 -0
  147. package/features/workflow/RelationEntityLink/index.js +1 -0
  148. package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +1 -1
  149. package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.module.css.js +1 -1
  150. package/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.js +2 -16
  151. package/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.module.css.js +1 -1
  152. package/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.js +1 -1
  153. package/features/workflow/WorkflowComments/components/Comment/Comment.js +1 -2
  154. package/features/workflow/WorkflowComments/components/Comment/Comment.module.css.js +9 -0
  155. package/features/workflow/{AttributesChanges/helpers → helpers}/attributes.js +13 -10
  156. package/features/workflow/{AttributesChanges/helpers → helpers}/attributes.test.js +19 -9
  157. package/features/workflow/helpers/common.d.ts +2 -1
  158. package/features/workflow/helpers/common.js +6 -2
  159. package/features/workflow/{AttributesChanges/helpers → helpers}/merge.js +4 -5
  160. package/features/workflow/{AttributesChanges/helpers → helpers}/merge.test.js +5 -3
  161. package/features/workflow/hooks/useChangesList.d.ts +9 -0
  162. package/features/workflow/hooks/useChangesList.js +17 -0
  163. package/features/workflow/types.d.ts +16 -0
  164. package/hooks/useCssVariableStyles/useCssVariableStyles.js +1 -1
  165. package/icons/SuggestedChanges.d.ts +3 -0
  166. package/icons/SuggestedChanges.js +22 -0
  167. package/package.json +2 -2
  168. package/cjs/features/workflow/AttributesChanges/components/ChangeView/styles.d.ts +0 -1
  169. package/cjs/features/workflow/AttributesChanges/components/ChangeView/styles.js +0 -49
  170. package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/styles.d.ts +0 -5
  171. package/cjs/features/workflow/AttributesChanges/components/DiffRenderer/styles.js +0 -31
  172. package/cjs/features/workflow/AttributesChanges/styles.d.ts +0 -1
  173. package/cjs/features/workflow/AttributesChanges/styles.js +0 -28
  174. package/cjs/features/workflow/AttributesChanges/types.d.ts +0 -14
  175. package/cjs/features/workflow/AttributesChanges/types.js +0 -2
  176. package/cjs/features/workflow/WorkflowComments/components/Comment/styles.d.ts +0 -1
  177. package/cjs/features/workflow/WorkflowComments/components/Comment/styles.js +0 -49
  178. package/features/workflow/AttributesChanges/components/ChangeView/styles.d.ts +0 -1
  179. package/features/workflow/AttributesChanges/components/ChangeView/styles.js +0 -46
  180. package/features/workflow/AttributesChanges/components/DiffRenderer/styles.d.ts +0 -5
  181. package/features/workflow/AttributesChanges/components/DiffRenderer/styles.js +0 -28
  182. package/features/workflow/AttributesChanges/styles.d.ts +0 -1
  183. package/features/workflow/AttributesChanges/styles.js +0 -25
  184. package/features/workflow/AttributesChanges/types.d.ts +0 -14
  185. package/features/workflow/AttributesChanges/types.js +0 -1
  186. package/features/workflow/WorkflowComments/components/Comment/styles.d.ts +0 -1
  187. package/features/workflow/WorkflowComments/components/Comment/styles.js +0 -46
  188. /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/attributes.d.ts +0 -0
  189. /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/attributes.test.d.ts +0 -0
  190. /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/merge.d.ts +0 -0
  191. /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/merge.test.d.ts +0 -0
  192. /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/metadata.test-data.d.ts +0 -0
  193. /package/cjs/features/workflow/{AttributesChanges/helpers → helpers}/metadata.test-data.js +0 -0
  194. /package/features/workflow/{AttributesChanges/helpers → helpers}/attributes.d.ts +0 -0
  195. /package/features/workflow/{AttributesChanges/helpers → helpers}/attributes.test.d.ts +0 -0
  196. /package/features/workflow/{AttributesChanges/helpers → helpers}/merge.d.ts +0 -0
  197. /package/features/workflow/{AttributesChanges/helpers → helpers}/merge.test.d.ts +0 -0
  198. /package/features/workflow/{AttributesChanges/helpers → helpers}/metadata.test-data.d.ts +0 -0
  199. /package/features/workflow/{AttributesChanges/helpers → helpers}/metadata.test-data.js +0 -0
@@ -1,52 +1,31 @@
1
- import React, { useCallback, useContext, useMemo } from 'react';
2
- import { isNil } from 'ramda';
3
- import classnames from 'classnames';
4
- import { getAttributeValue, getLabel, isReference } from '@reltio/mdm-sdk';
1
+ import React, { useCallback, useMemo } from 'react';
2
+ import { EntityAttrTypes, getAttributeValue } from '@reltio/mdm-sdk';
5
3
  import { ChangeView } from '../ChangeView';
6
- import { AttributesChangesContext } from '../../AttributesChangesContext';
7
- import { getAttributeDescription, getDataTypeDefinition } from '../../../helpers/common';
4
+ import { getDataTypeDefinition, prepareRolesOrTagsValue } from '../../../helpers/common';
5
+ import { useCssVariableStyles } from '../../../../../hooks/useCssVariableStyles';
6
+ import { useMdmMetadata } from '../../../../../contexts/MdmModuleContext';
8
7
  import { DataTypeValue } from '../../../../../DataTypeValue';
9
- import { EntityUriLink } from '../../../../../EntityUriLink';
10
- import { useMdmEntityUri } from '../../../../../contexts/MdmModuleContext';
11
- import { useStyles } from './styles';
8
+ import { RelationEntityLink } from '../../../RelationEntityLink';
9
+ import styles from './DiffRenderer.module.css';
12
10
  export var DiffRenderer = function (_a) {
13
- var label = _a.label, level = _a.level, attributeType = _a.attributeType, attributeValue = _a.attributeValue, oldValue = _a.oldValue, newValue = _a.newValue, operation = _a.operation;
14
- var styles = useStyles({ level: level });
15
- var objectsInfo = useContext(AttributesChangesContext);
16
- var entityUri = useMdmEntityUri();
17
- var getLinkDescription = useCallback(function () {
18
- var _a, _b, _c;
19
- if (isReference(attributeType)) {
20
- var value = (_b = (_a = attributeValue.value) === null || _a === void 0 ? void 0 : _a.newValue) !== null && _b !== void 0 ? _b : (_c = attributeValue.value) === null || _c === void 0 ? void 0 : _c.oldValue;
21
- return getAttributeDescription(attributeType, value || attributeValue, entityUri, objectsInfo);
22
- }
23
- else if ('endObject' in attributeType) {
24
- var _d = attributeValue, endObjectUri = _d.endObjectUri, endObjectLabel = _d.endObjectLabel;
25
- return {
26
- objectUri: endObjectUri,
27
- objectLabel: endObjectLabel
28
- };
29
- }
30
- }, [attributeType, attributeValue, entityUri, objectsInfo]);
31
- var renderLink = useCallback(function () {
32
- var _a, _b;
33
- var _c;
34
- var _d = getLinkDescription() || {}, objectUri = _d.objectUri, objectLabel = _d.objectLabel;
35
- if (!isNil(objectUri) && !isNil(objectLabel)) {
36
- var isNotExist = ((_c = objectsInfo[objectUri]) === null || _c === void 0 ? void 0 : _c.isExist) === false;
37
- return (React.createElement(EntityUriLink, { value: objectUri, className: classnames(styles.linkContainer, (_a = {}, _a[styles.disabledLink] = isNotExist, _a)) },
38
- React.createElement("span", { className: classnames(styles.linkLabel, (_b = {}, _b[styles.label] = isNotExist, _b)) }, getLabel(objectLabel))));
39
- }
40
- return null;
41
- }, [getLinkDescription, objectsInfo, styles]);
11
+ var label = _a.label, level = _a.level, attributeType = _a.attributeType, relationType = _a.relationType, attributeValue = _a.attributeValue, oldValue = _a.oldValue, newValue = _a.newValue, operation = _a.operation;
12
+ var variableStyles = useCssVariableStyles({
13
+ '--level': level
14
+ });
15
+ var metadata = useMdmMetadata();
42
16
  var changeLabel = useMemo(function () {
43
17
  return (React.createElement("span", null,
44
18
  label,
45
- renderLink()));
46
- }, [label, renderLink]);
19
+ React.createElement(RelationEntityLink, { attributeOrRelationType: attributeType || relationType, attributeValue: attributeValue })));
20
+ }, [label, attributeType, relationType, attributeValue]);
47
21
  var renderValue = useCallback(function (value) {
48
22
  var attrValue = getAttributeValue(value);
49
- return (React.createElement(DataTypeValue, { value: attrValue, dataTypeDefinition: getDataTypeDefinition(attributeType, attrValue) }));
50
- }, [attributeType]);
51
- return (React.createElement(ChangeView, { className: styles.change, label: changeLabel, oldValue: oldValue && renderValue(oldValue), newValue: newValue && renderValue(newValue), operation: operation }));
23
+ var isRolesOrTags = attributeType.uri === EntityAttrTypes.roles.uri || attributeType.uri === EntityAttrTypes.tags.uri;
24
+ var preparedValue = isRolesOrTags
25
+ ? prepareRolesOrTagsValue(metadata, attrValue, attributeType.uri)
26
+ : attrValue;
27
+ return (React.createElement(DataTypeValue, { value: preparedValue, dataTypeDefinition: getDataTypeDefinition(attributeType, attrValue) }));
28
+ }, [attributeType, metadata]);
29
+ return (React.createElement("div", { className: styles.change, style: variableStyles },
30
+ React.createElement(ChangeView, { label: changeLabel, oldValue: oldValue && renderValue(oldValue), newValue: newValue && renderValue(newValue), operation: operation })));
52
31
  };
@@ -0,0 +1,9 @@
1
+ const styles = {"change":"DiffRenderer-change--ep0bt"};
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 = `.DiffRenderer-change--ep0bt{margin-left:calc(var(--level, 0)*16px)}`;
7
+ head.appendChild(style);
8
+ }
9
+ export default styles;
@@ -1,4 +1,4 @@
1
- import { Diff, Title } from './types';
1
+ import { Diff, Title } from '../types';
2
2
  export declare const useCollapsibleList: (items: (Diff | Title)[], limit?: number) => {
3
3
  isExpanded: boolean;
4
4
  onToggle: () => void;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- import { ChangeRequest, WorkflowTaskData } from '@reltio/mdm-sdk';
2
+ import { ChangeRequest, WorkflowTaskData, GroupedObjectsInfo } from '@reltio/mdm-sdk';
3
3
  type Props = {
4
4
  dcr: ChangeRequest;
5
5
  task: WorkflowTaskData;
6
+ groupedObjects: GroupedObjectsInfo[];
6
7
  };
7
- export declare const ChangeRequestEditor: ({ dcr, task: _task }: Props) => React.JSX.Element;
8
+ export declare const ChangeRequestEditor: ({ dcr, task, groupedObjects }: Props) => React.JSX.Element;
8
9
  export {};
@@ -1,11 +1,16 @@
1
1
  import React from 'react';
2
2
  import i18n from 'ui-i18n';
3
+ import Typography from '@mui/material/Typography';
4
+ import SvgSuggestedChanges from '../../../icons/SuggestedChanges';
5
+ import { EntityChangesGroup, SkeletonEntityChangesGroupLoader } from './components/EntityChangesGroup';
3
6
  import styles from './ChangeRequestEditor.module.css';
4
7
  export var ChangeRequestEditor = function (_a) {
5
- var dcr = _a.dcr, _task = _a.task;
6
- var dcrLoaded = !!dcr;
7
- if (!dcrLoaded) {
8
- return null;
9
- }
10
- return React.createElement("div", { className: styles.container }, i18n.text('DCR changes'));
8
+ var dcr = _a.dcr, task = _a.task, groupedObjects = _a.groupedObjects;
9
+ var dcrLoaded = !!dcr && groupedObjects.length > 0;
10
+ return (React.createElement("div", { className: styles.container },
11
+ React.createElement("div", { className: styles.header },
12
+ React.createElement("div", { className: styles.suggestedChangesIcon },
13
+ React.createElement(SvgSuggestedChanges, null)),
14
+ React.createElement(Typography, { variant: "h6", className: styles.suggestedChangesTitle }, i18n.text('Suggested changes'))),
15
+ dcrLoaded ? (groupedObjects.map(function (object, index) { return (React.createElement(EntityChangesGroup, { key: "entity-".concat(index), entityInfo: object.entity, relationsInfo: object.relations, task: task, dcr: dcr })); })) : (React.createElement(SkeletonEntityChangesGroupLoader, null))));
11
16
  };
@@ -1,9 +1,9 @@
1
- const styles = {"container":"ChangeRequestEditor-container--pOvfN"};
1
+ const styles = {"container":"ChangeRequestEditor-container--pOvfN","suggestedChangesTitle":"ChangeRequestEditor-suggestedChangesTitle--Vln-y","header":"ChangeRequestEditor-header--ZS-Cs","showBorderOnScroll":"ChangeRequestEditor-showBorderOnScroll--CiFhA","suggestedChangesIcon":"ChangeRequestEditor-suggestedChangesIcon--pIDL-"};
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 = `.ChangeRequestEditor-container--pOvfN{border:1px solid rgba(0,0,0,.03);border-radius:8px;padding:16px}`;
6
+ style.innerHTML = `.ChangeRequestEditor-container--pOvfN{background-color:#fff;border:1px solid rgba(0,0,0,.12);border-radius:8px;bottom:0;display:flex;flex-direction:column;gap:16px;left:0;overflow:auto;padding-bottom:16px;position:absolute;right:0;top:0;scroll-timeline-name:--changes-scroll;scroll-timeline-axis:block}.ChangeRequestEditor-suggestedChangesTitle--Vln-y{color:var(--mui-palette-text-primary);font-size:16px;font-weight:500}.ChangeRequestEditor-header--ZS-Cs{align-items:center;animation:ChangeRequestEditor-showBorderOnScroll--CiFhA 1s linear both;background:#fff;border-bottom:1px solid transparent;box-shadow:none;display:flex;gap:16px;margin-bottom:-16px;padding:16px;position:sticky;top:0;z-index:1;animation-timeline:--changes-scroll;animation-range:0 16px}.ChangeRequestEditor-suggestedChangesIcon--pIDL-{height:32px;width:32px}@keyframes ChangeRequestEditor-showBorderOnScroll--CiFhA{0%{border-bottom-color:transparent;box-shadow:none}to{border-bottom-color:rgba(0,0,0,.12);box-shadow:0 2px 6px rgba(0,0,0,.06)}}`;
7
7
  head.appendChild(style);
8
8
  }
9
9
  export default styles;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { DCRValue } from '@reltio/mdm-sdk';
3
+ import { Diff } from '../../../types';
4
+ type Props = {
5
+ change: Diff;
6
+ onValueChange: (id: string, newValue: DCRValue) => void;
7
+ editable?: boolean;
8
+ };
9
+ export declare const ChangeItemEditor: ({ change, onValueChange, editable }: Props) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,42 @@
1
+ import React, { useMemo } from 'react';
2
+ import { isNil } from 'ramda';
3
+ import { DCROperationTypes, EntityAttrTypes, getAttributeValue } from '@reltio/mdm-sdk';
4
+ import { getDataTypeDefinition, prepareRolesOrTagsValue } from '../../../helpers/common';
5
+ import { OperationChip } from '../../../OperationChip';
6
+ import { DataTypeValue } from '../../../../../DataTypeValue';
7
+ import { RelationEntityLink } from '../../../RelationEntityLink';
8
+ import { ChangeItemLabel } from './ChangeItemLabel';
9
+ import { DCRValueEditor } from './DCRValueEditor';
10
+ import { useMdmMetadata } from '../../../../../contexts/MdmModuleContext';
11
+ import styles from './ChangeItemEditor.module.css';
12
+ export var ChangeItemEditor = function (_a) {
13
+ var _b, _c, _d;
14
+ var change = _a.change, onValueChange = _a.onValueChange, _e = _a.editable, editable = _e === void 0 ? true : _e;
15
+ var metadata = useMdmMetadata();
16
+ var isUpdateOperation = change.operation === DCROperationTypes.EDITED;
17
+ var isAddOperation = change.operation === DCROperationTypes.ADDED;
18
+ var hasAnyValue = Boolean(change.oldValue || change.newValue);
19
+ var oldValue = getAttributeValue(change.oldValue);
20
+ var newValue = getAttributeValue(change.newValue);
21
+ var hasNewValue = !isNil(newValue);
22
+ var dataTypeDefinition = useMemo(function () {
23
+ return change.attributeType && getDataTypeDefinition(change.attributeType, newValue || oldValue);
24
+ }, [change.attributeType, newValue, oldValue]);
25
+ var shouldShowValueEditor = (isUpdateOperation || isAddOperation) && editable;
26
+ var shouldShowOperationChip = hasAnyValue && change.operation;
27
+ var isRolesOrTags = ((_b = change === null || change === void 0 ? void 0 : change.attributeType) === null || _b === void 0 ? void 0 : _b.uri) === EntityAttrTypes.roles.uri ||
28
+ ((_c = change === null || change === void 0 ? void 0 : change.attributeType) === null || _c === void 0 ? void 0 : _c.uri) === EntityAttrTypes.tags.uri;
29
+ var preparedValue = useMemo(function () {
30
+ return isRolesOrTags
31
+ ? prepareRolesOrTagsValue(metadata, newValue, change.attributeType.uri)
32
+ : newValue;
33
+ }, [isRolesOrTags, metadata, newValue, (_d = change.attributeType) === null || _d === void 0 ? void 0 : _d.uri]);
34
+ return (React.createElement("div", { className: styles.attributeRow },
35
+ React.createElement(ChangeItemLabel, { change: change, className: styles.labelColumn, showLabel: !isUpdateOperation }),
36
+ React.createElement("div", { className: styles.valueColumn },
37
+ React.createElement(RelationEntityLink, { attributeOrRelationType: change.attributeType || change.relationType, attributeValue: change.attributeValue, className: styles.relationEntityLink }),
38
+ shouldShowValueEditor ? (React.createElement(DCRValueEditor, { attributeType: change.attributeType, value: change.newValue, onChange: onValueChange })) : (hasNewValue && (React.createElement("div", { className: styles.value },
39
+ React.createElement(DataTypeValue, { value: preparedValue, dataTypeDefinition: dataTypeDefinition }))))),
40
+ React.createElement("div", { className: styles.revertColumn }),
41
+ React.createElement("div", { className: styles.operationColumn }, shouldShowOperationChip && (React.createElement(OperationChip, { operation: change.operation, size: "small", variant: "outlined" })))));
42
+ };
@@ -0,0 +1,9 @@
1
+ const styles = {"attributeRow":"ChangeItemEditor-attributeRow--bITG5","labelColumn":"ChangeItemEditor-labelColumn--6B4w4","changeLabel":"ChangeItemEditor-changeLabel--C7s6T","valueColumn":"ChangeItemEditor-valueColumn--q9456","revertColumn":"ChangeItemEditor-revertColumn--T5mVE","operationColumn":"ChangeItemEditor-operationColumn--me-4D","previousValue":"ChangeItemEditor-previousValue--lTOVp","previousValueText":"ChangeItemEditor-previousValueText--gAnge","editor":"ChangeItemEditor-editor--hyLPa","arrow":"ChangeItemEditor-arrow--IXZ6i","value":"ChangeItemEditor-value--GxSUf","columnSkeleton":"ChangeItemEditor-columnSkeleton---iGmr","relationEntityLink":"ChangeItemEditor-relationEntityLink--Vr7Z-"};
2
+ if (typeof document !== 'undefined') {
3
+ const head = document.head || document.getElementsByTagName('head')[0]
4
+ const style = document.createElement('style');
5
+ style.type = 'text/css'
6
+ style.innerHTML = `.ChangeItemEditor-attributeRow--bITG5{align-items:center;display:flex;font-size:16px;gap:16px}.ChangeItemEditor-labelColumn--6B4w4{box-sizing:border-box;min-height:21px;width:170px}.ChangeItemEditor-changeLabel--C7s6T{color:var(--mui-palette-text-secondary);font-size:14px;font-weight:400;letter-spacing:.24px;padding-left:calc(var(--level, 0)*16px)}.ChangeItemEditor-valueColumn--q9456{display:flex;flex:1;flex-direction:column;gap:4px}.ChangeItemEditor-revertColumn--T5mVE{margin-left:-9px;width:24px}.ChangeItemEditor-operationColumn--me-4D{width:145px}.ChangeItemEditor-previousValue--lTOVp{align-items:center;display:flex;line-height:16px;padding:6px 12px 7px}.ChangeItemEditor-previousValueText--gAnge{color:var(--mui-palette-text-primary);letter-spacing:.24px}.ChangeItemEditor-editor--hyLPa{min-height:40px}.ChangeItemEditor-arrow--IXZ6i{color:var(--mui-palette-text-secondary);font-weight:700;margin:0 5px}.ChangeItemEditor-value--GxSUf{font-size:16px;padding:8px}.ChangeItemEditor-columnSkeleton---iGmr{transform:none}.ChangeItemEditor-relationEntityLink--Vr7Z-{font-size:16px}`;
7
+ head.appendChild(style);
8
+ }
9
+ export default styles;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { Diff } from '../../../types';
3
+ type Props = {
4
+ change: Diff;
5
+ showLabel?: boolean;
6
+ className?: string;
7
+ };
8
+ export declare const ChangeItemLabel: ({ change, className, showLabel }: Props) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import classnames from 'classnames';
3
+ import { useCssVariableStyles } from '../../../../../hooks/useCssVariableStyles';
4
+ import styles from './ChangeItemEditor.module.css';
5
+ export var ChangeItemLabel = function (_a) {
6
+ var change = _a.change, className = _a.className, _b = _a.showLabel, showLabel = _b === void 0 ? true : _b;
7
+ var _c = change.level, level = _c === void 0 ? 0 : _c, label = change.label;
8
+ var variableStyles = useCssVariableStyles({
9
+ '--level': level
10
+ });
11
+ return (React.createElement("div", { className: classnames(styles.changeLabel, className), style: variableStyles }, showLabel && label));
12
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { Diff } from '../../../types';
3
+ type Props = {
4
+ change: Diff;
5
+ };
6
+ export declare const ChangeItemOldValue: ({ change }: Props) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { isNil } from 'ramda';
3
+ import EastIcon from '@mui/icons-material/East';
4
+ import { DCROperationTypes, getAttributeValue } from '@reltio/mdm-sdk';
5
+ import { getDataTypeDefinition } from '../../../helpers/common';
6
+ import { DataTypeValue } from '../../../../../DataTypeValue';
7
+ import { ChangeItemLabel } from './ChangeItemLabel';
8
+ import styles from './ChangeItemEditor.module.css';
9
+ export var ChangeItemOldValue = function (_a) {
10
+ var change = _a.change;
11
+ var isUpdateOperation = change.operation === DCROperationTypes.EDITED;
12
+ var oldValue = getAttributeValue(change.oldValue);
13
+ var newValue = getAttributeValue(change.newValue);
14
+ var dataTypeDefinition = change.attributeType && getDataTypeDefinition(change.attributeType, newValue !== null && newValue !== void 0 ? newValue : oldValue);
15
+ var hasOldValue = !isNil(oldValue);
16
+ return (React.createElement("div", { className: styles.attributeRow },
17
+ React.createElement(ChangeItemLabel, { change: change, className: styles.labelColumn }),
18
+ React.createElement("div", { className: styles.valueColumn }, isUpdateOperation && hasOldValue && (React.createElement("div", { className: styles.previousValue },
19
+ React.createElement("span", { className: styles.previousValueText },
20
+ React.createElement(DataTypeValue, { value: oldValue, dataTypeDefinition: dataTypeDefinition })),
21
+ React.createElement("span", { className: styles.arrow },
22
+ React.createElement(EastIcon, null))))),
23
+ React.createElement("div", { className: styles.revertColumn }),
24
+ React.createElement("div", { className: styles.operationColumn })));
25
+ };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { AttributeType, DCRValue, ChangeValue } from '@reltio/mdm-sdk';
3
+ type Props = {
4
+ attributeType: AttributeType;
5
+ value: ChangeValue;
6
+ onChange: (id: string, newValue: DCRValue) => void;
7
+ };
8
+ export declare const DCRValueEditor: ({ attributeType, value, onChange }: Props) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,14 @@
1
+ import React, { useCallback } from 'react';
2
+ import { DCRValueEditorFactory } from './DCRValueEditorFactory';
3
+ import styles from './ChangeItemEditor.module.css';
4
+ export var DCRValueEditor = function (_a) {
5
+ var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange;
6
+ var handleChange = useCallback(function (updatedValue) {
7
+ onChange(attributeType.uri, updatedValue);
8
+ }, [attributeType.uri, onChange]);
9
+ return (React.createElement("div", { className: styles.editor }, DCRValueEditorFactory.build({
10
+ attributeType: attributeType,
11
+ value: value,
12
+ onChange: handleChange
13
+ })));
14
+ };
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { AttributeType, DCRValue, DataTypeDefinition, ChangeValue } from '@reltio/mdm-sdk';
3
+ type Props = {
4
+ attributeType: AttributeType;
5
+ value: ChangeValue;
6
+ onChange: (value: DCRValue) => void;
7
+ dataTypeDefinition?: DataTypeDefinition;
8
+ };
9
+ export declare class DCRValueEditorFactory {
10
+ static build({ attributeType, value, onChange }: Props): React.JSX.Element;
11
+ }
12
+ export {};
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { EntityAttrTypes, wrapInArrayIfNeeded, getAttributeValue } from '@reltio/mdm-sdk';
3
+ import { DataTypeValueEditor } from '../../../../../DataTypeValueEditor';
4
+ import { attributeValueToEditorValue } from '../../../../../helpers/attributesView';
5
+ import { getDataTypeDefinition } from '../../../helpers/common';
6
+ import { RolesInput } from '../../../../../RolesInput/RolesInput';
7
+ import { TagsInput } from '../../../../../TagsInput/TagsInput';
8
+ var DCRValueEditorFactory = /** @class */ (function () {
9
+ function DCRValueEditorFactory() {
10
+ }
11
+ DCRValueEditorFactory.build = function (_a) {
12
+ var attributeType = _a.attributeType, value = _a.value, onChange = _a.onChange;
13
+ var dcrValue = getAttributeValue(value);
14
+ switch (attributeType.uri) {
15
+ case EntityAttrTypes.roles.uri: {
16
+ return React.createElement(RolesInput, { value: wrapInArrayIfNeeded(dcrValue), onChange: onChange });
17
+ }
18
+ case EntityAttrTypes.tags.uri: {
19
+ return React.createElement(TagsInput, { value: wrapInArrayIfNeeded(dcrValue), onChange: onChange });
20
+ }
21
+ default: {
22
+ var dataTypeDefinition = getDataTypeDefinition(attributeType, dcrValue);
23
+ var editorValue = value && dataTypeDefinition
24
+ ? attributeValueToEditorValue(value, dataTypeDefinition)
25
+ : null;
26
+ return (React.createElement(DataTypeValueEditor, { fieldName: attributeType.uri, value: editorValue, dataTypeDefinition: dataTypeDefinition, onChange: onChange, fullWidth: true }));
27
+ }
28
+ }
29
+ };
30
+ return DCRValueEditorFactory;
31
+ }());
32
+ export { DCRValueEditorFactory };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SkeletonChangeItemEditorLoader: () => React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import Skeleton from '@mui/material/Skeleton';
3
+ import styles from './ChangeItemEditor.module.css';
4
+ export var SkeletonChangeItemEditorLoader = function () {
5
+ return (React.createElement("div", { className: styles.attributeRow },
6
+ React.createElement("div", { className: styles.labelColumn },
7
+ React.createElement(Skeleton, { variant: "text", width: "90%", height: 18, className: styles.columnSkeleton })),
8
+ React.createElement("div", { className: styles.valueColumn },
9
+ React.createElement(Skeleton, { variant: "text", height: 40, className: styles.columnSkeleton })),
10
+ React.createElement("div", { className: styles.revertColumn }),
11
+ React.createElement("div", { className: styles.operationColumn },
12
+ React.createElement(Skeleton, { variant: "rectangular", width: 60, height: 20, className: styles.columnSkeleton }))));
13
+ };
@@ -0,0 +1,3 @@
1
+ export { ChangeItemEditor } from './ChangeItemEditor';
2
+ export { ChangeItemOldValue } from './ChangeItemOldValue';
3
+ export { SkeletonChangeItemEditorLoader } from './SkeletonChangeItemEditorLoader';
@@ -0,0 +1,3 @@
1
+ export { ChangeItemEditor } from './ChangeItemEditor';
2
+ export { ChangeItemOldValue } from './ChangeItemOldValue';
3
+ export { SkeletonChangeItemEditorLoader } from './SkeletonChangeItemEditorLoader';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { GroupedObjectsInfo, DCRValue } from '@reltio/mdm-sdk';
3
+ import { Diff, Title } from '../../../types';
4
+ type Props = {
5
+ item: Diff | Title;
6
+ onValueChange: (id: string, newValue: DCRValue) => void;
7
+ entityInfo: GroupedObjectsInfo['entity'];
8
+ };
9
+ export declare const ChangeItemRow: ({ item, onValueChange, entityInfo }: Props) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { has } from 'ramda';
3
+ import classnames from 'classnames';
4
+ import { DCROperationTypes } from '@reltio/mdm-sdk';
5
+ import { isEditableChange } from '../../helpers';
6
+ import { ChangeItemOldValue, ChangeItemEditor } from '../ChangeItemEditor';
7
+ import styles from './ChangeItemRow.module.css';
8
+ export var ChangeItemRow = function (_a) {
9
+ var _b;
10
+ var item = _a.item, onValueChange = _a.onValueChange, entityInfo = _a.entityInfo;
11
+ if (!has('level', item)) {
12
+ return React.createElement("div", { className: styles.title }, item.label);
13
+ }
14
+ var change = item;
15
+ var isEditedOperation = change.operation === DCROperationTypes.EDITED;
16
+ var editable = isEditableChange(change, entityInfo);
17
+ return (React.createElement("div", { className: classnames(styles.changeItemRow, (_b = {}, _b[styles.editableRow] = editable, _b)) },
18
+ isEditedOperation && React.createElement(ChangeItemOldValue, { change: change }),
19
+ React.createElement(ChangeItemEditor, { change: change, onValueChange: onValueChange, editable: editable })));
20
+ };
@@ -0,0 +1,9 @@
1
+ const styles = {"changeItemRow":"ChangeItemRow-changeItemRow--oF9hn","editableRow":"ChangeItemRow-editableRow--ZQzGk","title":"ChangeItemRow-title--G8iV2"};
2
+ if (typeof document !== 'undefined') {
3
+ const head = document.head || document.getElementsByTagName('head')[0]
4
+ const style = document.createElement('style');
5
+ style.type = 'text/css'
6
+ style.innerHTML = `.ChangeItemRow-changeItemRow--oF9hn{display:flex;flex-direction:column;gap:8px}.ChangeItemRow-editableRow--ZQzGk:hover{background:var(--mui-palette-action-hover)}.ChangeItemRow-title--G8iV2{color:var(--mui-palette-text-primary);font-size:14px;font-weight:600;margin:0 0 12px}`;
7
+ head.appendChild(style);
8
+ }
9
+ export default styles;
@@ -0,0 +1 @@
1
+ export { ChangeItemRow } from './ChangeItemRow';
@@ -0,0 +1 @@
1
+ export { ChangeItemRow } from './ChangeItemRow';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { GroupedObjectsInfo, WorkflowTaskData, ChangeRequest } from '@reltio/mdm-sdk';
3
+ type Props = {
4
+ task: WorkflowTaskData;
5
+ dcr: ChangeRequest;
6
+ entityInfo: GroupedObjectsInfo['entity'];
7
+ relationsInfo: GroupedObjectsInfo['relations'];
8
+ };
9
+ export declare const EntityChangesGroup: ({ task, dcr, entityInfo, relationsInfo }: Props) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,31 @@
1
+ import React, { useCallback } from 'react';
2
+ import Accordion from '@mui/material/Accordion';
3
+ import AccordionSummary from '@mui/material/AccordionSummary';
4
+ import AccordionDetails from '@mui/material/AccordionDetails';
5
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
6
+ import { useChangesList } from '../../../hooks/useChangesList';
7
+ import { DCREntityUriLink } from '../../../DCREntityUriLink/DCREntityUriLink';
8
+ import { ChangeItemRow } from '../ChangeItemRow/ChangeItemRow';
9
+ import { AttributesChangesContext } from '../../../AttributesChanges/AttributesChangesContext';
10
+ import { getDCRUri } from '../../../helpers/common';
11
+ import styles from './EntityChangesGroup.module.css';
12
+ export var EntityChangesGroup = function (_a) {
13
+ var task = _a.task, dcr = _a.dcr, entityInfo = _a.entityInfo, relationsInfo = _a.relationsInfo;
14
+ var dcrUri = getDCRUri(task.objectURIs);
15
+ var _b = dcr || {}, changes = _b.changes, objectsInfo = _b.objectsInfo;
16
+ var changesList = useChangesList({
17
+ changes: changes,
18
+ entityInfo: entityInfo,
19
+ relationsInfo: relationsInfo
20
+ });
21
+ var handleValueChange = useCallback(function () {
22
+ // TODO: Implement value change logic
23
+ }, []);
24
+ return (React.createElement(AttributesChangesContext.Provider, { value: objectsInfo },
25
+ React.createElement(Accordion, { className: styles.entityGroup, defaultExpanded: true, "data-reltio-id": "entity-changes-group" },
26
+ React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null), className: styles.entityHeader, classes: {
27
+ content: styles.accordionContent
28
+ } },
29
+ React.createElement(DCREntityUriLink, { entityInfo: entityInfo, changes: changes, dcrUri: dcrUri, className: styles.entityTitle })),
30
+ React.createElement(AccordionDetails, { className: styles.attributesList }, changesList.map(function (item, index) { return (React.createElement(ChangeItemRow, { key: "".concat('label' in item ? 'title' : 'change', "-").concat(index), item: item, onValueChange: handleValueChange, entityInfo: entityInfo })); })))));
31
+ };
@@ -0,0 +1,9 @@
1
+ const styles = {"entityGroup":"EntityChangesGroup-entityGroup--KmWaa","entityHeader":"EntityChangesGroup-entityHeader--hf8-J","entityTitle":"EntityChangesGroup-entityTitle--caeZE","accordionContent":"EntityChangesGroup-accordionContent--N7C6Y","attributesList":"EntityChangesGroup-attributesList--7Tmk6","skeletonEntityGroupDisabled":"EntityChangesGroup-skeletonEntityGroupDisabled--qFGAK"};
2
+ if (typeof document !== 'undefined') {
3
+ const head = document.head || document.getElementsByTagName('head')[0]
4
+ const style = document.createElement('style');
5
+ style.type = 'text/css'
6
+ style.innerHTML = `.EntityChangesGroup-entityGroup--KmWaa{background-color:#f7f7f7;border:1px solid #f0f0f0;border-radius:8px;box-shadow:none;margin:0 16px}.EntityChangesGroup-entityGroup--KmWaa.Mui-expanded{margin:0 16px}.EntityChangesGroup-entityGroup--KmWaa:before{display:none}.EntityChangesGroup-entityHeader--hf8-J{border-bottom:1px solid #f0f0f0;min-height:auto;padding:8px 16px}.EntityChangesGroup-entityHeader--hf8-J.Mui-expanded{min-height:auto}.EntityChangesGroup-entityTitle--caeZE{font-size:14px}.EntityChangesGroup-accordionContent--N7C6Y,.EntityChangesGroup-accordionContent--N7C6Y.Mui-expanded{margin:0}.EntityChangesGroup-attributesList--7Tmk6{display:flex;flex-direction:column;gap:8px;max-width:1000px;min-width:750px;padding:16px}.EntityChangesGroup-skeletonEntityGroupDisabled--qFGAK.Mui-disabled{background-color:#f7f7f7}`;
7
+ head.appendChild(style);
8
+ }
9
+ export default styles;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SkeletonEntityChangesGroupLoader: () => React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import Accordion from '@mui/material/Accordion';
3
+ import AccordionSummary from '@mui/material/AccordionSummary';
4
+ import AccordionDetails from '@mui/material/AccordionDetails';
5
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
6
+ import Skeleton from '@mui/material/Skeleton';
7
+ import { SkeletonChangeItemEditorLoader } from '../ChangeItemEditor';
8
+ import styles from './EntityChangesGroup.module.css';
9
+ export var SkeletonEntityChangesGroupLoader = function () {
10
+ return (React.createElement(Accordion, { className: styles.entityGroup, classes: { disabled: styles.skeletonEntityGroupDisabled }, defaultExpanded: true, disabled: true },
11
+ React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null), className: styles.entityHeader, classes: {
12
+ content: styles.accordionContent
13
+ } },
14
+ React.createElement(Skeleton, { variant: "text", width: "150px", height: 30 })),
15
+ React.createElement(AccordionDetails, { className: styles.attributesList }, Array.from({ length: 3 }).map(function (_, index) { return (React.createElement(SkeletonChangeItemEditorLoader, { key: "change-list-item-loader-".concat(index) })); }))));
16
+ };
@@ -0,0 +1,2 @@
1
+ export { EntityChangesGroup } from './EntityChangesGroup';
2
+ export { SkeletonEntityChangesGroupLoader } from './SkeletonEntityChangesGroupLoader';
@@ -0,0 +1,2 @@
1
+ export { EntityChangesGroup } from './EntityChangesGroup';
2
+ export { SkeletonEntityChangesGroupLoader } from './SkeletonEntityChangesGroupLoader';
@@ -0,0 +1,3 @@
1
+ import { GroupedObjectsInfo } from '@reltio/mdm-sdk';
2
+ import { Diff } from '../types';
3
+ export declare const isEditableChange: (change: Diff, entityInfo: GroupedObjectsInfo["entity"]) => boolean;
@@ -0,0 +1,12 @@
1
+ import { isNil } from 'ramda';
2
+ import { DCROperationTypes, isRelationTypeUri } from '@reltio/mdm-sdk';
3
+ export var isEditableChange = function (change, entityInfo) {
4
+ var _a;
5
+ var currentAttributeTypeUri = (_a = change.attributeType) === null || _a === void 0 ? void 0 : _a.uri;
6
+ var isExistingReferenceEntityChange = entityInfo.isExist &&
7
+ currentAttributeTypeUri &&
8
+ change.isReferenceSubAttribute &&
9
+ change.operation === DCROperationTypes.ADDED &&
10
+ !isRelationTypeUri(currentAttributeTypeUri);
11
+ return !!currentAttributeTypeUri && !isExistingReferenceEntityChange && !isNil(change.newValue);
12
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { DCRChanges, GroupedObjectsInfo } from '@reltio/mdm-sdk';
3
+ type Props = {
4
+ entityInfo: GroupedObjectsInfo['entity'];
5
+ changes: DCRChanges;
6
+ dcrUri: string;
7
+ className?: string;
8
+ };
9
+ export declare const DCREntityUriLink: ({ entityInfo, changes, dcrUri, className }: Props) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { always, any, ifElse, propOr } from 'ramda';
3
+ import classnames from 'classnames';
4
+ import { getEntityUriForLink, getLabel } from '@reltio/mdm-sdk';
5
+ import { EntityUriLink } from '../../../EntityUriLink';
6
+ import { getEntityUriForChangeRequest, isCreateEntityOperation } from '../helpers/dcr';
7
+ import classes from './DCREntityUriLink.module.css';
8
+ export var DCREntityUriLink = function (_a) {
9
+ var entityInfo = _a.entityInfo, changes = _a.changes, dcrUri = _a.dcrUri, className = _a.className;
10
+ var entityUri = ifElse(any(isCreateEntityOperation), always(getEntityUriForChangeRequest(dcrUri, entityInfo.uri)), always(getEntityUriForLink(entityInfo)))(propOr([], entityInfo.uri, changes));
11
+ var screen = ifElse(any(isCreateEntityOperation), always('dcrReview'), always('profile'))(propOr([], entityInfo.uri, changes));
12
+ return (React.createElement(EntityUriLink, { className: classnames(classes.link, className), value: entityUri, screen: screen },
13
+ React.createElement("div", { className: classes.label }, getLabel(entityInfo.label))));
14
+ };
@@ -0,0 +1,9 @@
1
+ const styles = {"link":"DCREntityUriLink-link--cTnX-","label":"DCREntityUriLink-label--okYmG"};
2
+ if (typeof document !== 'undefined') {
3
+ const head = document.head || document.getElementsByTagName('head')[0]
4
+ const style = document.createElement('style');
5
+ style.type = 'text/css'
6
+ style.innerHTML = `.DCREntityUriLink-link--cTnX-{color:var(--mui-palette-primary-main);cursor:pointer;font-size:12px;text-decoration:none}.DCREntityUriLink-label--okYmG{letter-spacing:0;line-height:16px;white-space:break-spaces}`;
7
+ head.appendChild(style);
8
+ }
9
+ export default styles;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { DCROperationTypes } from '@reltio/mdm-sdk';
3
+ type Props = {
4
+ operation: DCROperationTypes;
5
+ className?: string;
6
+ size?: 'small' | 'medium';
7
+ variant?: 'filled' | 'outlined';
8
+ };
9
+ export declare const OperationChip: ({ operation, className, size, variant }: Props) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import classnames from 'classnames';
3
+ import Chip from '@mui/material/Chip';
4
+ import { getOperationLabel } from '../helpers/common';
5
+ import styles from './OperationChip.module.css';
6
+ export var OperationChip = function (_a) {
7
+ var operation = _a.operation, className = _a.className, _b = _a.size, size = _b === void 0 ? 'small' : _b, _c = _a.variant, variant = _c === void 0 ? 'outlined' : _c;
8
+ return (React.createElement(Chip, { variant: variant, label: getOperationLabel(operation), size: size, className: classnames(styles.chip, styles[operation], className) }));
9
+ };