@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
@@ -0,0 +1,9 @@
1
+ const styles = {"chip":"OperationChip-chip--1GvDu","edited":"OperationChip-edited--szKT3","added":"OperationChip-added--LBI82","deleted":"OperationChip-deleted--3-a9r","ignored":"OperationChip-ignored--xwl3i"};
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 = `.OperationChip-chip--1GvDu{border-color:var(--mui-palette-primary-main);color:var(--mui-palette-primary-main);flex-shrink:0;font-size:10px;font-weight:500;height:20px;letter-spacing:0;line-height:16px;text-transform:capitalize}.OperationChip-chip--1GvDu.OperationChip-edited--szKT3{border-color:#cc7500;color:#cc7500}.OperationChip-chip--1GvDu.OperationChip-added--LBI82{border-color:#599e0e;color:#599e0e}.OperationChip-chip--1GvDu.OperationChip-deleted--3-a9r{border-color:#cf0e26;color:#cf0e26}.OperationChip-chip--1GvDu.OperationChip-ignored--xwl3i{border-color:#3075c9;color:#3075c9}`;
7
+ head.appendChild(style);
8
+ }
9
+ export default styles;
@@ -0,0 +1 @@
1
+ export { OperationChip } from './OperationChip';
@@ -0,0 +1 @@
1
+ export { OperationChip } from './OperationChip';
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { AttributeType, DCRAttributeValue, TRelationType } from '@reltio/mdm-sdk';
3
+ type Props = {
4
+ attributeOrRelationType: AttributeType | TRelationType;
5
+ attributeValue: DCRAttributeValue;
6
+ className?: string;
7
+ };
8
+ export declare const RelationEntityLink: ({ attributeOrRelationType, attributeValue, className }: Props) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,37 @@
1
+ import React, { useCallback, useContext } from 'react';
2
+ import { isNil } from 'ramda';
3
+ import classnames from 'classnames';
4
+ import { getLabel, isReference } from '@reltio/mdm-sdk';
5
+ import { getAttributeDescription } from '../helpers/common';
6
+ import { EntityUriLink } from '../../../EntityUriLink';
7
+ import { useMdmEntityUri } from '../../../contexts/MdmModuleContext';
8
+ import { AttributesChangesContext } from '../AttributesChanges/AttributesChangesContext';
9
+ import styles from './RelationEntityLink.module.css';
10
+ export var RelationEntityLink = function (_a) {
11
+ var _b, _c;
12
+ var _d;
13
+ var attributeOrRelationType = _a.attributeOrRelationType, attributeValue = _a.attributeValue, className = _a.className;
14
+ var objectsInfo = useContext(AttributesChangesContext);
15
+ var entityUri = useMdmEntityUri();
16
+ var getLinkDescription = useCallback(function () {
17
+ var _a, _b, _c;
18
+ if (isReference(attributeOrRelationType)) {
19
+ 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;
20
+ return getAttributeDescription(attributeOrRelationType, value || attributeValue, entityUri, objectsInfo);
21
+ }
22
+ else if ('endObject' in attributeOrRelationType) {
23
+ var _d = attributeValue, endObjectUri = _d.endObjectUri, endObjectLabel = _d.endObjectLabel;
24
+ return {
25
+ objectUri: endObjectUri,
26
+ objectLabel: endObjectLabel
27
+ };
28
+ }
29
+ }, [attributeOrRelationType, attributeValue, entityUri, objectsInfo]);
30
+ var _e = getLinkDescription() || {}, objectUri = _e.objectUri, objectLabel = _e.objectLabel;
31
+ if (isNil(objectUri) || isNil(objectLabel)) {
32
+ return null;
33
+ }
34
+ var isNotExist = ((_d = objectsInfo[objectUri]) === null || _d === void 0 ? void 0 : _d.isExist) === false;
35
+ return (React.createElement(EntityUriLink, { value: objectUri, className: classnames(styles.linkContainer, (_b = {}, _b[styles.disabledLink] = isNotExist, _b), className) },
36
+ React.createElement("span", { className: classnames(styles.linkLabel, (_c = {}, _c[styles.label] = isNotExist, _c)) }, getLabel(objectLabel))));
37
+ };
@@ -0,0 +1,9 @@
1
+ const styles = {"linkContainer":"RelationEntityLink-linkContainer--lrgwy","linkLabel":"RelationEntityLink-linkLabel--1-dRa","disabledLink":"RelationEntityLink-disabledLink--r8PS0","label":"RelationEntityLink-label--0---g"};
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 = `.RelationEntityLink-linkContainer--lrgwy{cursor:pointer;font-size:12px;margin-left:4px;text-decoration:none}.RelationEntityLink-linkLabel--1-dRa{color:var(--mui-palette-primary-main);letter-spacing:0;line-height:16px;white-space:break-spaces}.RelationEntityLink-disabledLink--r8PS0{cursor:default;pointer-events:none}.RelationEntityLink-label--0---g{color:var(--mui-palette-text-primary)}`;
7
+ head.appendChild(style);
8
+ }
9
+ export default styles;
@@ -0,0 +1 @@
1
+ export { RelationEntityLink } from './RelationEntityLink';
@@ -0,0 +1 @@
1
+ export { RelationEntityLink } from './RelationEntityLink';
@@ -48,7 +48,7 @@ export var ReviewDCRDialog = function (_a) {
48
48
  React.createElement("div", { className: styles.editableItem },
49
49
  React.createElement(AssigneeSelector, { taskId: task.taskId, assignee: task.assignee, isTaskOpen: task.isOpen })))),
50
50
  React.createElement("div", { className: styles.changesSection },
51
- React.createElement(ChangeRequestEditor, { dcr: dcr, task: task }))),
51
+ React.createElement(ChangeRequestEditor, { dcr: dcr, task: task, groupedObjects: groupedObjects }))),
52
52
  canViewComments && (React.createElement(WorkflowComments, { workflowActions: workflowActions, actionRequestIsInProgress: actionRequestIsInProgress, preferredAction: task.preferredAction, taskId: task.taskId, processInstanceComments: task.processInstanceComments, isTaskOpen: task.isOpen, showActionButtons: false, alwaysExpanded: true, classes: {
53
53
  container: styles.commentsRootContainer,
54
54
  commentsContainer: styles.commentsContainer
@@ -3,7 +3,7 @@ if (typeof document !== 'undefined') {
3
3
  const head = document.head || document.getElementsByTagName('head')[0]
4
4
  const style = document.createElement('style');
5
5
  style.type = 'text/css'
6
- style.innerHTML = `.ReviewDCRDialog-dialogTitle--xCXtj{align-items:center;border-bottom:1px solid #e0e0e0;display:flex;justify-content:space-between;padding:12px 16px 8px}.ReviewDCRDialog-titleContent--Hh2KH{align-items:center;display:flex;flex:1;justify-content:space-between;position:relative}.ReviewDCRDialog-titleText--ME8s4{flex:1;margin:0;padding-left:48px}.ReviewDCRDialog-closeButton--YMAEf{color:#666;left:15px;position:absolute}.ReviewDCRDialog-closeButton--YMAEf:hover{background-color:rgba(0,0,0,.04);color:#333}.ReviewDCRDialog-content--qvUva{display:flex;min-height:400px;padding:0!important;width:100%}.ReviewDCRDialog-leftSection--5MELW{border-right:1px solid #e0e0e0;padding:0 16px;width:100%}.ReviewDCRDialog-profileBand--7r6Xy{margin-left:-16px}.ReviewDCRDialog-profileBandRoot--G7p1m{box-shadow:none;margin-bottom:0}.ReviewDCRDialog-editableSection--v-D7a{border:1px solid #d9d9d9;border-radius:0 0 8px 8px;margin-bottom:32px;padding:8px 16px 14px}.ReviewDCRDialog-editableGrid--auc-d{display:grid;gap:24px;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));margin-bottom:12px}.ReviewDCRDialog-editableItem--isGwv{display:flex;flex-direction:column}.ReviewDCRDialog-priorityField--LQ1n3{min-width:200px}.ReviewDCRDialog-changesSection--qj2OK{margin-bottom:24px}.ReviewDCRDialog-commentsRootContainer--g2f7m{margin:10px 0 16px 10px;min-width:323px;width:323px}.ReviewDCRDialog-commentsContainer--OApOx{flex-grow:1;max-height:100%}`;
6
+ style.innerHTML = `.ReviewDCRDialog-dialogTitle--xCXtj{align-items:center;border-bottom:1px solid #e0e0e0;display:flex;justify-content:space-between;padding:12px 16px 8px}.ReviewDCRDialog-titleContent--Hh2KH{align-items:center;display:flex;flex:1;justify-content:space-between;position:relative}.ReviewDCRDialog-titleText--ME8s4{flex:1;margin:0;padding-left:48px}.ReviewDCRDialog-closeButton--YMAEf{color:#666;left:15px;position:absolute}.ReviewDCRDialog-closeButton--YMAEf:hover{background-color:var(--mui-palette-action-hover);color:var(--mui-palette-text-primary)}.ReviewDCRDialog-content--qvUva{display:flex;min-height:400px;padding:0!important;width:100%}.ReviewDCRDialog-leftSection--5MELW{border-right:1px solid #e0e0e0;display:flex;flex-direction:column;padding:0 16px;width:100%}.ReviewDCRDialog-profileBand--7r6Xy{margin-left:-16px}.ReviewDCRDialog-profileBandRoot--G7p1m{box-shadow:none;margin-bottom:0}.ReviewDCRDialog-editableSection--v-D7a{border:1px solid #d9d9d9;border-radius:0 0 8px 8px;margin-bottom:16px;padding:8px 16px 14px}.ReviewDCRDialog-editableGrid--auc-d{display:grid;gap:24px;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));margin-bottom:12px}.ReviewDCRDialog-editableItem--isGwv{display:flex;flex-direction:column}.ReviewDCRDialog-priorityField--LQ1n3{min-width:200px}.ReviewDCRDialog-changesSection--qj2OK{flex-grow:1;margin-bottom:16px;position:relative}.ReviewDCRDialog-commentsRootContainer--g2f7m{margin:10px 0 16px 10px;min-width:323px;width:323px}.ReviewDCRDialog-commentsContainer--OApOx{flex-grow:1;max-height:100%}`;
7
7
  head.appendChild(style);
8
8
  }
9
9
  export default styles;
@@ -1,24 +1,10 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import Skeleton from '@mui/material/Skeleton';
4
- import i18n from 'ui-i18n';
5
- import { DCROperationTypes } from '@reltio/mdm-sdk';
6
4
  import { useMdmMetadata } from '../../../../../contexts/MdmModuleContext';
7
5
  import { calculateDCRChanges } from '../../helpers';
6
+ import { getOperationLabel } from '../../../helpers/common';
8
7
  import styles from './DCRChangesSummary.module.css';
9
- var getOperationLabel = function (operation) {
10
- var _a;
11
- var labels = (_a = {},
12
- _a[DCROperationTypes.ADDED] = i18n.text('Added'),
13
- _a[DCROperationTypes.EDITED] = i18n.text('Edited'),
14
- _a[DCROperationTypes.DELETED] = i18n.text('Deleted'),
15
- _a[DCROperationTypes.PINNED] = i18n.text('Pinned'),
16
- _a[DCROperationTypes.PIN_DELETED] = i18n.text('Pin deleted'),
17
- _a[DCROperationTypes.IGNORED] = i18n.text('Ignored'),
18
- _a[DCROperationTypes.IGNORE_DELETED] = i18n.text('Ignore deleted'),
19
- _a);
20
- return labels[operation] || operation || '';
21
- };
22
8
  var ChangeItem = function (_a) {
23
9
  var count = _a.count, operation = _a.operation;
24
10
  return count > 0 && (React.createElement("div", { className: styles.changeItem },
@@ -32,7 +18,7 @@ export var DCRChangesSummary = function (_a) {
32
18
  var changes = _a.changes, groupedObjects = _a.groupedObjects;
33
19
  var metadata = useMdmMetadata();
34
20
  var dcrChanges = useMemo(function () { return (changes ? calculateDCRChanges(metadata, changes, groupedObjects) : null); }, [metadata, changes, groupedObjects]);
35
- var changesLoaded = !!dcrChanges;
21
+ var changesLoaded = !!dcrChanges && groupedObjects.length > 0;
36
22
  return (React.createElement("div", { className: styles.changesSummary, "data-reltio-id": "dcr-changes-summary" },
37
23
  !changesLoaded && React.createElement(LoadingSkeleton, null),
38
24
  changesLoaded &&
@@ -3,7 +3,7 @@ if (typeof document !== 'undefined') {
3
3
  const head = document.head || document.getElementsByTagName('head')[0]
4
4
  const style = document.createElement('style');
5
5
  style.type = 'text/css'
6
- style.innerHTML = `.DCRChangesSummary-changesSummary--31gR-{align-items:center;display:flex;gap:22px}.DCRChangesSummary-changeItem---XfYP{align-items:center;display:flex;flex-direction:column;gap:4px;position:relative}.DCRChangesSummary-changeItem---XfYP:not(:last-child):after{background-color:#d9d9d9;bottom:2px;content:"";height:20px;position:absolute;right:-12px;top:2px;width:1px}.DCRChangesSummary-changeNumber--vZxc4{font-size:16px;font-weight:500;line-height:1}.DCRChangesSummary-changeLabel--tDXS6{color:var(--mui-palette-text-primary);font-size:13px}.DCRChangesSummary-edited--KFivZ{color:#eb9d08}.DCRChangesSummary-added--KGdGw{color:#599e0e}.DCRChangesSummary-deleted--TWgS5{color:#eb5757}.DCRChangesSummary-ignored--Q2Q8R{color:var(--mui-palette-primary-light)}`;
6
+ style.innerHTML = `.DCRChangesSummary-changesSummary--31gR-{align-items:center;display:flex;gap:22px}.DCRChangesSummary-changeItem---XfYP{align-items:center;display:flex;flex-direction:column;gap:4px;position:relative}.DCRChangesSummary-changeItem---XfYP:not(:last-child):after{background-color:#d9d9d9;bottom:2px;content:"";height:20px;position:absolute;right:-12px;top:2px;width:1px}.DCRChangesSummary-changeNumber--vZxc4{font-size:16px;font-weight:500;line-height:1}.DCRChangesSummary-changeLabel--tDXS6{color:var(--mui-palette-text-primary);font-size:13px;text-transform:capitalize}.DCRChangesSummary-edited--KFivZ{color:#eb9d08}.DCRChangesSummary-added--KGdGw{color:#599e0e}.DCRChangesSummary-deleted--TWgS5{color:#eb5757}.DCRChangesSummary-ignored--Q2Q8R{color:var(--mui-palette-primary-light)}`;
7
7
  head.appendChild(style);
8
8
  }
9
9
  export default styles;
@@ -1,4 +1,4 @@
1
- import { mergeChanges } from '../../AttributesChanges/helpers/merge';
1
+ import { mergeChanges } from '../../helpers/merge';
2
2
  export var calculateDCRChanges = function (metadata, changes, groupedObjects) {
3
3
  var mergedChanges = groupedObjects.reduce(function (mergedChanges, object) {
4
4
  var _a = mergeChanges(metadata, changes, object.entity, object.relations), mergedEntityChanges = _a[0], mergedRelationsChanges = _a[1];
@@ -3,10 +3,9 @@ import i18n from 'ui-i18n';
3
3
  import classnames from 'classnames';
4
4
  import Avatar from '@mui/material/Avatar';
5
5
  import Person from '@mui/icons-material/Person';
6
- import { useStyles } from './styles';
6
+ import styles from './Comment.module.css';
7
7
  export var Comment = function (_a) {
8
8
  var author = _a.author, message = _a.message, time = _a.time, _b = _a.classes, classes = _b === void 0 ? {} : _b;
9
- var styles = useStyles();
10
9
  return (React.createElement("div", { className: styles.comment },
11
10
  React.createElement(Avatar, { className: styles.avatar },
12
11
  React.createElement(Person, { className: styles.icon })),
@@ -0,0 +1,9 @@
1
+ const styles = {"comment":"Comment-comment--EbYOv","avatar":"Comment-avatar--zDzhi","icon":"Comment-icon--VXgD-","firstLine":"Comment-firstLine--16ocZ","info":"Comment-info--Z0Lgv","author":"Comment-author--xm-WD","date":"Comment-date--4aLvh","text":"Comment-text--a3pI0"};
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 = `.Comment-comment--EbYOv{display:flex;flex:1;flex-direction:row;margin-left:6px}.Comment-avatar--zDzhi{height:24px;margin:3px 13px 0 0;width:24px}.Comment-icon--VXgD-{fill:#537280;background-color:#eaedee}.Comment-firstLine--16ocZ{display:flex;flex-direction:row;flex-wrap:wrap}.Comment-info--Z0Lgv{flex:1}.Comment-author--xm-WD{color:var(--mui-palette-text-primary);flex:1;font-size:13px;font-weight:500;line-height:15px;margin-right:10px}.Comment-date--4aLvh{color:var(--mui-palette-text-secondary);font-size:11px;line-height:15px;margin-right:17px}.Comment-text--a3pI0{color:rgba(0,0,0,.6);font-size:13px;word-wrap:break-word;padding-right:10px;white-space:pre-wrap;word-break:break-all}`;
7
+ head.appendChild(style);
8
+ }
9
+ export default styles;
@@ -11,8 +11,8 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { complement, curry, flatten, is, isEmpty, pathOr, propOr, times } from 'ramda';
13
13
  import { DataTypes, DCRTypes, getAttributeTypeSubAttributes, getLabel, getRelationAttributesList, getRelationType, isEmptyValue, isSpecialAttribute } from '@reltio/mdm-sdk';
14
- import { getFilteredAttrTypes } from '../../../../helpers/attributesView';
15
- import { getOperationType } from '../../helpers/common';
14
+ import { getFilteredAttrTypes } from '../../../helpers/attributesView';
15
+ import { getOperationType } from './common';
16
16
  var getValues = function (attributes, attrType) {
17
17
  if ('newValue' in attributes || 'oldValue' in attributes) {
18
18
  var newValue = attributes.newValue, oldValue = attributes.oldValue, type_1 = attributes.type;
@@ -31,13 +31,14 @@ var getValues = function (attributes, attrType) {
31
31
  var values = attributes[attrType.name];
32
32
  return values ? [values] : [];
33
33
  };
34
- var getAttributesList = function (metadata, attrTypes, attributes, level) {
34
+ var getAttributesList = function (metadata, attrTypes, attributes, level, isReferenceSubAttribute) {
35
35
  if (level === void 0) { level = 0; }
36
+ if (isReferenceSubAttribute === void 0) { isReferenceSubAttribute = false; }
36
37
  return flatten(attrTypes
37
38
  .map(function (attrType) {
38
39
  return getValues(attributes, attrType).map(function (value) {
39
40
  return value.map(function (attributeValue) {
40
- return dcrAttributesFactory(metadata, attrType, attributeValue, level);
41
+ return dcrAttributesFactory(metadata, attrType, attributeValue, level, isReferenceSubAttribute);
41
42
  });
42
43
  });
43
44
  })
@@ -47,7 +48,7 @@ var getSimpleAttributeValue = function (attributeType, attributeValue) {
47
48
  var value = isSpecialAttribute(attributeType) ? attributeValue : attributeValue.value;
48
49
  return is(Object, value) ? value : { newValue: attributeValue, type: DCRTypes.INSERT_ATTRIBUTE };
49
50
  };
50
- var dcrAttributesFactory = function (metadata, attributeType, attributeValue, level) {
51
+ var dcrAttributesFactory = function (metadata, attributeType, attributeValue, level, isReferenceSubAttribute) {
51
52
  switch (attributeType.type) {
52
53
  case DataTypes.TYPE_NESTED:
53
54
  case DataTypes.TYPE_IMAGE:
@@ -56,7 +57,7 @@ var dcrAttributesFactory = function (metadata, attributeType, attributeValue, le
56
57
  return getReferenceAttributeChange(metadata, attributeType, attributeValue, level);
57
58
  default: {
58
59
  var value = getSimpleAttributeValue(attributeType, attributeValue);
59
- return getSimpleAttributeChange(attributeType, value, level);
60
+ return getSimpleAttributeChange(attributeType, value, level, isReferenceSubAttribute);
60
61
  }
61
62
  }
62
63
  };
@@ -73,14 +74,15 @@ var getReferenceAttributeChange = function (metadata, attributeType, attributeVa
73
74
  var label = (attributeType === null || attributeType === void 0 ? void 0 : attributeType.label) || (attributeType === null || attributeType === void 0 ? void 0 : attributeType.name);
74
75
  return [
75
76
  { level: level, label: label, attributeType: attributeType, attributeValue: attributeValue },
76
- getAttributesList(metadata, attributeTypeList, attributeValue.value, level + 1)
77
+ getAttributesList(metadata, attributeTypeList, attributeValue.value, level + 1, true)
77
78
  ];
78
79
  };
79
80
  var getDiffParameters = function (_a) {
80
81
  var newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type;
81
82
  return type === DCRTypes.UPDATE_ATTRIBUTE ? { type: type, newValue: newValue, oldValue: oldValue } : { type: type, newValue: oldValue || newValue };
82
83
  };
83
- var getSimpleAttributeChange = function (attributeType, attributeValue, level) {
84
+ var getSimpleAttributeChange = function (attributeType, attributeValue, level, isReferenceSubAttribute) {
85
+ if (isReferenceSubAttribute === void 0) { isReferenceSubAttribute = false; }
84
86
  var _a = getDiffParameters(attributeValue), newValue = _a.newValue, oldValue = _a.oldValue, type = _a.type;
85
87
  var operation = getOperationType(type, oldValue);
86
88
  var label = (attributeType === null || attributeType === void 0 ? void 0 : attributeType.label) || (attributeType === null || attributeType === void 0 ? void 0 : attributeType.name);
@@ -90,7 +92,8 @@ var getSimpleAttributeChange = function (attributeType, attributeValue, level) {
90
92
  oldValue: oldValue,
91
93
  operation: operation,
92
94
  label: label,
93
- level: level
95
+ level: level,
96
+ isReferenceSubAttribute: isReferenceSubAttribute
94
97
  };
95
98
  };
96
99
  export var getEntityChanges = curry(function (metadata, entityInfo, changes) {
@@ -108,7 +111,7 @@ export var getRelationChanges = curry(function (metadata, relationInfo, changes,
108
111
  var relationType = getRelationType(metadata, relationInfo.type);
109
112
  var attrTypes = getRelationAttributesList(metadata, relationInfo.type);
110
113
  return flatten([
111
- __assign({ level: 1, label: propOr('', 'label', relationType), attributeType: relationType, attributeValue: __assign(__assign({}, relationInfo), changes) }, addRelationOperationIfNeeded(changes, changeType)),
114
+ __assign({ level: 1, label: propOr('', 'label', relationType), attributeType: null, relationType: relationType, attributeValue: __assign(__assign({}, relationInfo), changes) }, addRelationOperationIfNeeded(changes, changeType)),
112
115
  getAttributesList(metadata, attrTypes, changes, 2)
113
116
  ]);
114
117
  });
@@ -75,14 +75,16 @@ describe('attributes helpers tests', function () {
75
75
  label: 'Country Code',
76
76
  level: 0,
77
77
  newValue: changes.CountryCode[0].value.newValue,
78
- operation: 'ignored'
78
+ operation: 'ignored',
79
+ isReferenceSubAttribute: false
79
80
  },
80
81
  {
81
82
  attributeType: metadata.entityTypes[0].attributes[1],
82
83
  label: 'Country Code',
83
84
  level: 0,
84
85
  newValue: changes.CountryCode[1].value.newValue,
85
- operation: 'added'
86
+ operation: 'added',
87
+ isReferenceSubAttribute: false
86
88
  },
87
89
  {
88
90
  attributeType: metadata.entityTypes[0].attributes[3],
@@ -95,7 +97,8 @@ describe('attributes helpers tests', function () {
95
97
  label: 'Identity Type',
96
98
  level: 1,
97
99
  newValue: changes.Identifiers[0].value.Type[0].value.newValue,
98
- operation: 'ignored'
100
+ operation: 'ignored',
101
+ isReferenceSubAttribute: false
99
102
  }
100
103
  ]);
101
104
  });
@@ -116,7 +119,8 @@ describe('attributes helpers tests', function () {
116
119
  it('should not show operation for relation title', function () {
117
120
  expect(getRelationChanges(metadata, relationInfo, changes, DCRTypes.INSERT_ATTRIBUTE)).toEqual([
118
121
  {
119
- attributeType: metadata.relationTypes[1],
122
+ attributeType: null,
123
+ relationType: metadata.relationTypes[1],
120
124
  attributeValue: __assign(__assign({}, relationInfo), changes),
121
125
  label: metadata.relationTypes[1].label,
122
126
  level: 1
@@ -126,21 +130,24 @@ describe('attributes helpers tests', function () {
126
130
  label: EntityAttrTypes.startDate.label,
127
131
  level: 2,
128
132
  newValue: { value: 1644001200000 },
129
- operation: DCROperationTypes.ADDED
133
+ operation: DCROperationTypes.ADDED,
134
+ isReferenceSubAttribute: false
130
135
  },
131
136
  {
132
137
  attributeType: metadata.relationTypes[1].attributes[0],
133
138
  label: metadata.relationTypes[1].attributes[0].label,
134
139
  level: 2,
135
140
  newValue: '123',
136
- operation: DCROperationTypes.ADDED
141
+ operation: DCROperationTypes.ADDED,
142
+ isReferenceSubAttribute: false
137
143
  }
138
144
  ]);
139
145
  });
140
146
  it('should show operation for relation title if it is new', function () {
141
147
  expect(getRelationChanges(metadata, relationInfo, changes, DCRTypes.CREATE_RELATIONSHIP)).toEqual([
142
148
  {
143
- attributeType: metadata.relationTypes[1],
149
+ attributeType: null,
150
+ relationType: metadata.relationTypes[1],
144
151
  attributeValue: __assign(__assign({}, relationInfo), changes),
145
152
  label: metadata.relationTypes[1].label,
146
153
  level: 1,
@@ -151,11 +158,13 @@ describe('attributes helpers tests', function () {
151
158
  label: EntityAttrTypes.startDate.label,
152
159
  level: 2,
153
160
  newValue: { value: 1644001200000 },
154
- operation: DCROperationTypes.ADDED
161
+ operation: DCROperationTypes.ADDED,
162
+ isReferenceSubAttribute: false
155
163
  },
156
164
  {
157
165
  attributeType: metadata.relationTypes[1].attributes[0],
158
166
  label: metadata.relationTypes[1].attributes[0].label,
167
+ isReferenceSubAttribute: false,
159
168
  level: 2,
160
169
  newValue: '123',
161
170
  operation: DCROperationTypes.ADDED
@@ -165,7 +174,8 @@ describe('attributes helpers tests', function () {
165
174
  it('should show operation for relation title if it was deleted and changes are empty', function () {
166
175
  expect(getRelationChanges(metadata, relationInfo, {}, DCRTypes.DELETE_RELATIONSHIP)).toEqual([
167
176
  {
168
- attributeType: metadata.relationTypes[1],
177
+ attributeType: null,
178
+ relationType: metadata.relationTypes[1],
169
179
  attributeValue: relationInfo,
170
180
  label: metadata.relationTypes[1].label,
171
181
  level: 1,
@@ -1,4 +1,4 @@
1
- import { AttributeType, DCRAttributeValue, DCRObjectsInfo, DCROperationTypes, DCRValue, WorkflowTaskData, WorkflowDefinition } from '@reltio/mdm-sdk';
1
+ import { AttributeType, DCRAttributeValue, DCRObjectsInfo, DCROperationTypes, DCRValue, Metadata, WorkflowDefinition, WorkflowTaskData } from '@reltio/mdm-sdk';
2
2
  export declare const getOperationType: (type: string, oldValue?: DCRAttributeValue) => DCROperationTypes;
3
3
  export declare const getOperationLabel: (operation: DCROperationTypes) => string;
4
4
  export declare const getAttributeDescription: (attrType: AttributeType, value: DCRAttributeValue, currentEntityUri: string, objectsInfo?: DCRObjectsInfo) => {
@@ -12,3 +12,4 @@ export declare const getDCRId: (objectUris?: string[]) => string;
12
12
  export declare const isOpenTask: (isOpen: WorkflowTaskData["isOpen"]) => boolean;
13
13
  export declare const isRequestedTask: (processTypes: string[], assignee: string) => (task: WorkflowTaskData) => boolean;
14
14
  export declare const findWorkflowDefinitionByType: (definitions: WorkflowDefinition[], type: string) => WorkflowDefinition | undefined;
15
+ export declare const prepareRolesOrTagsValue: (metadata: Metadata, value: string[], type: string) => string;
@@ -1,6 +1,6 @@
1
- import { pipe, startsWith, isNil, unless, split, nth, allPass, always, equals, evolve, prop, when, filter, has, length, propEq } from 'ramda';
1
+ import { allPass, always, equals, evolve, filter, has, identity, isNil, length, nth, pipe, prop, propEq, split, startsWith, unless, when } from 'ramda';
2
2
  import i18n from 'ui-i18n';
3
- import { DataTypes, DCRTypes, getAttrDataTypeDefinition, isUrl, DCROperationTypes } from '@reltio/mdm-sdk';
3
+ import { DataTypes, DCROperationTypes, DCRTypes, EntityAttrTypes, getAttrDataTypeDefinition, getRoleLabel, isUrl } from '@reltio/mdm-sdk';
4
4
  export var getOperationType = function (type, oldValue) {
5
5
  switch (type) {
6
6
  case DCRTypes.CREATE_RELATIONSHIP:
@@ -67,3 +67,7 @@ export var isRequestedTask = function (processTypes, assignee) { return function
67
67
  return (!processTypes || processTypes.includes(task.processType)) && (!assignee || assignee === task.assignee);
68
68
  }; };
69
69
  export var findWorkflowDefinitionByType = function (definitions, type) { return definitions.find(propEq('type', type)); };
70
+ export var prepareRolesOrTagsValue = function (metadata, value, type) {
71
+ var getLabel = type === EntityAttrTypes.roles.uri ? getRoleLabel(metadata) : identity;
72
+ return value.map(getLabel).join(', ');
73
+ };
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { concat, curry, difference, flatten, identity, isNil, omit, path, pick, pipe, propEq, propOr, reduce } from 'ramda';
12
+ import { concat, curry, difference, flatten, isNil, omit, path, pick, pipe, propEq, propOr, reduce } from 'ramda';
13
13
  import { DCRTypes, EntityAttrTypes, generateTempUri, getRoleLabel, isEmptyValue } from '@reltio/mdm-sdk';
14
14
  import { getEntityChanges, getRelationChanges } from './attributes';
15
15
  var ATTRIBUTE_DELIMITER = '/';
@@ -53,21 +53,20 @@ var prepareStartOrEndDate = function (_a) {
53
53
  }
54
54
  };
55
55
  var prepareRolesOrTags = function (metadata, change) {
56
- var _a = change.newValue, newValue = _a === void 0 ? [] : _a, _b = change.oldValue, oldValue = _b === void 0 ? [] : _b, type = change.type;
57
- var getLabel = type === DCRTypes.UPDATE_ROLES ? getRoleLabel(metadata) : identity;
56
+ var _a = change.newValue, newValue = _a === void 0 ? [] : _a, _b = change.oldValue, oldValue = _b === void 0 ? [] : _b;
58
57
  var diffNewValue = difference(newValue, oldValue);
59
58
  var diffOldValue = difference(oldValue, newValue);
60
59
  var items = [];
61
60
  if (diffNewValue.length) {
62
61
  items.push({
63
62
  type: DCRTypes.INSERT_ATTRIBUTE,
64
- newValue: { value: diffNewValue.map(getLabel).join(', ') }
63
+ newValue: { value: diffNewValue }
65
64
  });
66
65
  }
67
66
  if (diffOldValue.length) {
68
67
  items.push({
69
68
  type: DCRTypes.DELETE_ATTRIBUTE,
70
- oldValue: { value: diffOldValue.map(getLabel).join(', ') }
69
+ oldValue: { value: diffOldValue }
71
70
  });
72
71
  }
73
72
  return items;
@@ -59,7 +59,8 @@ describe('mergeChanges tests', function () {
59
59
  label: 'Identity Type',
60
60
  level: 1,
61
61
  newValue: changes[entityUri][0].newValue,
62
- operation: 'ignored'
62
+ operation: 'ignored',
63
+ isReferenceSubAttribute: false
63
64
  }
64
65
  ],
65
66
  []
@@ -177,7 +178,7 @@ describe('mergeChanges tests', function () {
177
178
  attributeType: EntityAttrTypes.tags,
178
179
  label: EntityAttrTypes.tags.label,
179
180
  level: 0,
180
- newValue: { value: 'tag2' },
181
+ newValue: { value: ['tag2'] },
181
182
  operation: DCROperationTypes.DELETED
182
183
  },
183
184
  {
@@ -225,7 +226,8 @@ describe('mergeChanges tests', function () {
225
226
  ];
226
227
  var mergedRelations = [
227
228
  {
228
- attributeType: metadata.relationTypes[1],
229
+ attributeType: null,
230
+ relationType: metadata.relationTypes[1],
229
231
  attributeValue: __assign(__assign({}, relationsInfo[0]), (_a = {}, _a[EntityAttrTypes.startDate.name] = [
230
232
  {
231
233
  newValue: { value: 1643742000000 },
@@ -0,0 +1,9 @@
1
+ import { DCRChanges, GroupedObjectsInfo } from '@reltio/mdm-sdk';
2
+ import { Diff, Title } from '../types';
3
+ type Props = {
4
+ changes: DCRChanges;
5
+ entityInfo: GroupedObjectsInfo['entity'];
6
+ relationsInfo: GroupedObjectsInfo['relations'];
7
+ };
8
+ export declare const useChangesList: ({ changes, entityInfo, relationsInfo }: Props) => (Diff | Title)[];
9
+ export {};
@@ -0,0 +1,17 @@
1
+ import { useMemo } from 'react';
2
+ import { flatten } from 'ramda';
3
+ import i18n from 'ui-i18n';
4
+ import { mergeChanges } from '../helpers/merge';
5
+ import { useMdmMetadata } from '../../../contexts/MdmModuleContext';
6
+ export var useChangesList = function (_a) {
7
+ var changes = _a.changes, entityInfo = _a.entityInfo, relationsInfo = _a.relationsInfo;
8
+ var metadata = useMdmMetadata();
9
+ var _b = useMemo(function () { return mergeChanges(metadata, changes, entityInfo, relationsInfo); }, [metadata, changes, entityInfo, relationsInfo]), mergedEntityChanges = _b[0], mergedRelationsChanges = _b[1];
10
+ var changesList = useMemo(function () {
11
+ var relationshipTitle = { label: i18n.text('Relationships') };
12
+ return mergedRelationsChanges.length > 0
13
+ ? flatten([mergedEntityChanges, relationshipTitle, mergedRelationsChanges])
14
+ : mergedEntityChanges;
15
+ }, [mergedEntityChanges, mergedRelationsChanges]);
16
+ return changesList;
17
+ };
@@ -1,4 +1,20 @@
1
+ import { AttributeType, ChangeValue, DCRAttributeValue, DCROperationTypes, DCRRelationInfo, TRelationType } from '@reltio/mdm-sdk';
1
2
  export type TaskAction = {
2
3
  text: string;
3
4
  onClick: (comment: string) => void;
4
5
  };
6
+ export type RelationAttributeValue = DCRAttributeValue & DCRRelationInfo;
7
+ export type Diff = {
8
+ level: number;
9
+ label: string;
10
+ attributeType: AttributeType | null;
11
+ relationType?: TRelationType;
12
+ attributeValue?: DCRAttributeValue | RelationAttributeValue;
13
+ newValue?: ChangeValue;
14
+ oldValue?: ChangeValue;
15
+ operation?: DCROperationTypes;
16
+ isReferenceSubAttribute?: boolean;
17
+ };
18
+ export type Title = {
19
+ label: string;
20
+ };
@@ -20,5 +20,5 @@ export var useCssVariableStyles = function (variables, additionalStyles) {
20
20
  return [key, verifiedValue];
21
21
  }));
22
22
  }, [variables]);
23
- return __assign(__assign({}, style), additionalStyles);
23
+ return useMemo(function () { return (__assign(__assign({}, style), additionalStyles)); }, [style, additionalStyles]);
24
24
  };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const SvgSuggestedChanges: React.FC<React.SVGProps<SVGSVGElement>>;
3
+ export default SvgSuggestedChanges;
@@ -0,0 +1,22 @@
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 React from 'react';
13
+ var SvgSuggestedChanges = function (props) {
14
+ return (React.createElement("svg", __assign({ width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-reltio-id": "SvgSuggestedChanges" }, props),
15
+ React.createElement("g", { clipPath: "url(#clip0_536_106424)" },
16
+ React.createElement("path", { d: "M15.972 32C24.7931 32 31.9441 24.8366 31.9441 16C31.9441 7.16344 24.7931 0 15.972 0C7.15092 0 0 7.16344 0 16C0 24.8366 7.15092 32 15.972 32Z", fill: "#205191" }),
17
+ React.createElement("path", { opacity: "0.87", fillRule: "evenodd", clipRule: "evenodd", d: "M11.0288 23.5683C9.97918 23.5683 9.12695 22.718 9.12695 21.6689V10.2746C9.12695 9.22772 9.97918 8.37744 11.0288 8.37744H13.8193C13.9763 7.9316 14.2679 7.54575 14.6536 7.27339C15.0394 7.00103 15.5002 6.85566 15.9721 6.85744L16.1569 6.8643C16.5959 6.89826 17.0156 7.05924 17.365 7.32766C17.7143 7.59608 17.9784 7.96038 18.1249 8.3763H20.9155C21.965 8.3763 22.8173 9.22772 22.8173 10.2757V21.67C22.8173 22.718 21.965 23.5683 20.9155 23.5683H11.0288ZM21.2965 22.0483V9.89744H19.7746V12.1752H12.1696V9.89744H10.6477V22.0506H21.2965V22.0483ZM18.0941 16.526V18.014H12.1548V16.526H18.0941ZM19.7986 14.2403V15.7283H12.1548V14.2403H19.7986ZM15.9721 8.37744C16.3908 8.37744 16.7331 8.71801 16.7331 9.1363C16.7224 9.33125 16.6376 9.5147 16.496 9.64893C16.3545 9.78316 16.167 9.85797 15.9721 9.85797C15.7772 9.85797 15.5897 9.78316 15.4482 9.64893C15.3066 9.5147 15.2218 9.33125 15.2112 9.1363C15.2112 8.71801 15.5534 8.37744 15.9721 8.37744Z", fill: "white" })),
18
+ React.createElement("defs", null,
19
+ React.createElement("clipPath", { id: "clip0_536_106424" },
20
+ React.createElement("rect", { width: "31.9441", height: "32", fill: "white" })))));
21
+ };
22
+ export default SvgSuggestedChanges;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.2198",
3
+ "version": "1.4.2200",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",
@@ -11,7 +11,7 @@
11
11
  "@fluentui/react-context-selector": "^9.1.26",
12
12
  "@googlemaps/markerclusterer": "^2.5.3",
13
13
  "@react-sigma/core": "3.4.0",
14
- "@reltio/mdm-sdk": "^1.4.2001",
14
+ "@reltio/mdm-sdk": "^1.4.2003",
15
15
  "@vis.gl/react-google-maps": "^1.3.0",
16
16
  "d3-cloud": "^1.2.5",
17
17
  "d3-geo": "^2.0.1",
@@ -1 +0,0 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"difference" | "arrow" | "fieldName" | "field" | "chip">;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useStyles = void 0;
4
- var styles_1 = require("@mui/styles");
5
- exports.useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
6
- field: {
7
- fontSize: '12px',
8
- lineHeight: '20px',
9
- color: theme.palette.text.primary,
10
- marginTop: '6px',
11
- overflow: 'hidden',
12
- wordBreak: 'break-word'
13
- },
14
- fieldName: {
15
- color: theme.palette.text.secondary,
16
- marginRight: '8px'
17
- },
18
- difference: {
19
- marginRight: '8px'
20
- },
21
- arrow: {
22
- margin: '0 4px',
23
- fontSize: '12px',
24
- color: theme.palette.text.primary
25
- },
26
- chip: {
27
- height: '20px',
28
- fontSize: '10px',
29
- fontWeight: 500,
30
- lineHeight: '16px',
31
- letterSpacing: 0,
32
- flexShrink: 0,
33
- textTransform: 'capitalize',
34
- color: theme.palette.primary.main,
35
- borderColor: theme.palette.primary.main,
36
- '&.edited': {
37
- color: '#CC7500',
38
- borderColor: '#CC7500'
39
- },
40
- '&.added': {
41
- color: '#599E0E',
42
- borderColor: '#599E0E'
43
- },
44
- '&.deleted': {
45
- color: '#CF0E26',
46
- borderColor: '#CF0E26'
47
- }
48
- }
49
- }); });
@@ -1,5 +0,0 @@
1
- type StylesProps = {
2
- level: number;
3
- };
4
- export declare const useStyles: (props: StylesProps) => import("@mui/styles").ClassNameMap<"label" | "change" | "linkLabel" | "linkContainer" | "disabledLink">;
5
- export {};