@reltio/profile 1.4.1585 → 1.4.1586-mui5

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 (335) hide show
  1. package/.DS_Store +0 -0
  2. package/index.ts +4 -0
  3. package/package.json +40 -23
  4. package/public/bundle.js +205 -0
  5. package/{bundle.js.LICENSE.txt → public/bundle.js.LICENSE.txt} +44 -16
  6. package/public/package.json +24 -0
  7. package/scripts/build/index.js +20 -0
  8. package/src/.DS_Store +0 -0
  9. package/src/components/.DS_Store +0 -0
  10. package/src/components/BackgroundProcessIndicator/BackgroundProcessIndicator.tsx +101 -0
  11. package/src/components/BackgroundProcessIndicator/styles.ts +50 -0
  12. package/src/components/DCRReviewPerspectiveView/DCRReviewPerspectiveView.tsx +77 -0
  13. package/src/components/DCRReviewPerspectiveView/__tests__/DCRReviewPerspectiveView.test.tsx +156 -0
  14. package/src/components/DCRReviewPerspectiveView/components/DCRProfileBand/DCRProfileBand.tsx +22 -0
  15. package/src/components/DCRReviewPerspectiveView/components/DCRProfileBand/__tests__/DCRProfileBand.test.tsx +92 -0
  16. package/src/components/DCRReviewPerspectiveView/components/DCRProfileBand/styles.ts +11 -0
  17. package/src/components/DCRReviewPerspectiveView/hooks/useWorkflowTasks.ts +31 -0
  18. package/src/components/DCRReviewPerspectiveView/index.ts +1 -0
  19. package/src/components/DCRReviewPerspectiveView/styles.ts +33 -0
  20. package/src/components/EntityMapView/EntityMapView.tsx +64 -0
  21. package/src/components/EntityMapView/__tests__/EntityMapView.spec.js +121 -0
  22. package/src/components/EntityMapView/styles.ts +20 -0
  23. package/src/components/EntityMapView/useMarkers.ts +27 -0
  24. package/src/components/HierarchyPathsView/ConfigContext.ts +4 -0
  25. package/src/components/HierarchyPathsView/HierarchyPathsHeader.tsx +32 -0
  26. package/src/components/HierarchyPathsView/HierarchyPathsView.tsx +90 -0
  27. package/src/components/HierarchyPathsView/Node.tsx +62 -0
  28. package/src/components/HierarchyPathsView/__tests__/HierarchyPathsView.test.tsx +547 -0
  29. package/src/components/HierarchyPathsView/__tests__/IntegrationHierarchyPathsView.test.tsx +47 -0
  30. package/src/components/HierarchyPathsView/__tests__/Node.test.tsx +152 -0
  31. package/src/components/HierarchyPathsView/__tests__/data/metadata.data.ts +33 -0
  32. package/src/components/HierarchyPathsView/__tests__/data/store.data.ts +37 -0
  33. package/src/components/HierarchyPathsView/__tests__/data/treePaths.data.ts +63 -0
  34. package/src/components/HierarchyPathsView/defaultTypeIcon.png +0 -0
  35. package/src/components/HierarchyPathsView/helpers.ts +3 -0
  36. package/src/components/HierarchyPathsView/hooks/useDynamicNodesHeights.ts +33 -0
  37. package/src/components/HierarchyPathsView/hooks/useLoadPaths.ts +76 -0
  38. package/src/components/HierarchyPathsView/icons/ShowGraph.svg +10 -0
  39. package/src/components/HierarchyPathsView/index.ts +1 -0
  40. package/src/components/HierarchyPathsView/styles.ts +60 -0
  41. package/src/components/HierarchyPathsView/theme/__tests__/node-content-renderer.test.tsx +78 -0
  42. package/src/components/HierarchyPathsView/theme/__tests__/tree-node-data-renderer.test.tsx +72 -0
  43. package/src/components/HierarchyPathsView/theme/index.ts +8 -0
  44. package/src/components/HierarchyPathsView/theme/node-content-renderer.tsx +84 -0
  45. package/src/components/HierarchyPathsView/theme/styles.ts +102 -0
  46. package/src/components/HierarchyPathsView/theme/tree-node-data-renderer.tsx +70 -0
  47. package/src/components/HierarchyPathsView/types.ts +17 -0
  48. package/src/components/ImageAttributeView/ImageAttributeView.tsx +87 -0
  49. package/src/components/ImageAttributeView/ImageAttributeViewEditableContent/ImageAttributeViewEditableContent.tsx +52 -0
  50. package/src/components/ImageAttributeView/ImageAttributeViewEditableContent/__tests__/ImageAttributeViewEditableContent.test.tsx +136 -0
  51. package/src/components/ImageAttributeView/ImageLineCaption/ImageLineCaption.tsx +18 -0
  52. package/src/components/ImageAttributeView/ImageLineCaption/__tests__/ImageLineCaption.test.tsx +15 -0
  53. package/src/components/ImageAttributeView/ImageLineCaption/styles.ts +10 -0
  54. package/src/components/ImageAttributeView/__tests__/ImageAttributeView.test.tsx +151 -0
  55. package/src/components/ImageAttributeView/__tests__/IntegrationImageAttributeView.test.tsx +36 -0
  56. package/src/components/ImageAttributeView/__tests__/data/store.data.ts +22 -0
  57. package/src/components/ImageAttributeView/styles.ts +13 -0
  58. package/src/components/Notifications/Notification.tsx +98 -0
  59. package/src/components/Notifications/Notifications.tsx +17 -0
  60. package/src/components/Notifications/__tests__/Notification.spec.tsx +230 -0
  61. package/src/components/Notifications/__tests__/Notifications.spec.tsx +37 -0
  62. package/src/components/Notifications/index.ts +1 -0
  63. package/src/components/Notifications/styles.ts +17 -0
  64. package/src/components/Notifications/types.ts +21 -0
  65. package/src/components/PerspectiveProfileBand/PerspectiveProfileBand.tsx +304 -0
  66. package/src/components/PerspectiveProfileBand/__tests__/PerspectiveProfileBand.specs.tsx +526 -0
  67. package/src/components/PerspectiveProfileBand/__tests__/data/collaboration.data.ts +23 -0
  68. package/src/components/PerspectiveProfileBand/__tests__/data/store.data.ts +162 -0
  69. package/src/components/PerspectiveProfileBand/copy.svg +14 -0
  70. package/src/components/PerspectiveProfileBand/hooks/useCloneAction.ts +94 -0
  71. package/src/components/PerspectiveProfileBand/index.ts +1 -0
  72. package/src/components/PerspectiveProfileBand/styles.ts +27 -0
  73. package/src/components/PerspectiveProfileBand/suggest.svg +16 -0
  74. package/src/components/ProfileAttributesView/ProfileAttributesView.tsx +21 -0
  75. package/src/components/ProfileAttributesView/__tests__/ProfileAttributesView.test.tsx +70 -0
  76. package/src/components/ProfileErrorsPanel/ProfileErrorsPanel.tsx +70 -0
  77. package/src/components/ProfileErrorsPanel/__tests__/ProfileErrorsPanel.specs.tsx +140 -0
  78. package/src/components/ProfileErrorsPanel/components/Error.tsx +50 -0
  79. package/src/components/ProfileErrorsPanel/components/ErrorsPanel.tsx +65 -0
  80. package/src/components/ProfileErrorsPanel/components/__tests__/Error.specs.tsx +264 -0
  81. package/src/components/ProfileErrorsPanel/components/__tests__/ErrorsPanel.specs.tsx +93 -0
  82. package/src/components/ProfileErrorsPanel/helpers.ts +45 -0
  83. package/src/components/ProfileErrorsPanel/icons/hyperlink.svg +4 -0
  84. package/src/components/ProfileErrorsPanel/index.ts +1 -0
  85. package/src/components/ProfileErrorsPanel/styles.ts +100 -0
  86. package/src/components/ProfileErrorsPanel/useCachedErrors.ts +11 -0
  87. package/src/components/ProfileLayout/ProfileLayout.tsx +56 -0
  88. package/src/components/ProfileLayout/__tests__/ProfileLayout.specs.tsx +56 -0
  89. package/src/components/ProfileLayout/index.ts +1 -0
  90. package/src/components/ProfileLayout/styles.ts +19 -0
  91. package/src/components/ProfileLayoutItem/ProfileLayoutItem.tsx +89 -0
  92. package/src/components/ProfileLayoutItem/__tests__/ProfileLayoutItem.test.tsx +165 -0
  93. package/src/components/ProfileLayoutItem/__tests__/data/store.data.ts +29 -0
  94. package/src/components/ProfileLayoutItem/index.ts +1 -0
  95. package/src/components/ProfileLayoutItem/styles.ts +13 -0
  96. package/src/components/ProfilePerspectiveResizablePanes/ProfilePerspectiveResizablePanes.tsx +34 -0
  97. package/src/components/ProfilePerspectiveResizablePanes/styles.ts +9 -0
  98. package/src/components/ProfilePerspectiveView/ProfilePerspectiveView.tsx +193 -0
  99. package/src/components/ProfilePerspectiveView/__tests__/IntegrationProfilePerspective.test.tsx +417 -0
  100. package/src/components/ProfilePerspectiveView/__tests__/ProfilePerspectiveView.specs.tsx +1503 -0
  101. package/src/components/ProfilePerspectiveView/__tests__/data/entities.data.ts +19 -0
  102. package/src/components/ProfilePerspectiveView/__tests__/data/entity.data.ts +25 -0
  103. package/src/components/ProfilePerspectiveView/__tests__/data/metadata.data.ts +33 -0
  104. package/src/components/ProfilePerspectiveView/__tests__/data/profile.data.ts +22 -0
  105. package/src/components/ProfilePerspectiveView/__tests__/data/store.data.ts +51 -0
  106. package/src/components/ProfilePerspectiveView/hooks/data/backgroundUpdateDalay.ts +2 -0
  107. package/src/components/ProfilePerspectiveView/hooks/useBackgroundProcessIndicator.ts +121 -0
  108. package/src/components/ProfilePerspectiveView/hooks/useProfileLayout.ts +101 -0
  109. package/src/components/ProfilePerspectiveView/hooks/useProfileRightSidePanelElements.tsx +167 -0
  110. package/src/components/ProfilePerspectiveView/hooks/useWorkflowTasks.ts +15 -0
  111. package/src/components/ProfilePerspectiveView/index.ts +1 -0
  112. package/src/components/ProfilePerspectiveView/styles.ts +38 -0
  113. package/src/components/ProfilePotentialMatchesView/ActionButtons.tsx +39 -0
  114. package/src/components/ProfilePotentialMatchesView/MatchCard.tsx +53 -0
  115. package/src/components/ProfilePotentialMatchesView/ProfilePotentialMatchesView.tsx +137 -0
  116. package/src/components/ProfilePotentialMatchesView/__tests__/ActionButtons.specs.tsx +89 -0
  117. package/src/components/ProfilePotentialMatchesView/__tests__/MatchCard.specs.tsx +62 -0
  118. package/src/components/ProfilePotentialMatchesView/__tests__/ProfilePotentialMatchesView.specs.tsx +267 -0
  119. package/src/components/ProfilePotentialMatchesView/__tests__/commonData.ts +91 -0
  120. package/src/components/ProfilePotentialMatchesView/styles.ts +30 -0
  121. package/src/components/ProfileRelationsView/ProfileRelationsView.tsx +24 -0
  122. package/src/components/ProfileRelationsView/__tests__/ProfileRelationsView.test.tsx +112 -0
  123. package/src/components/ProfileRelationsView/components/EditableRelationItem/EditableRelationItem.tsx +133 -0
  124. package/src/components/ProfileRelationsView/components/EditableRelationItem/__tests__/EditableRelationItem.specs.tsx +222 -0
  125. package/src/components/ProfileRelationsView/components/EditableRelationItem/styles.ts +59 -0
  126. package/src/components/ProfileRelationsView/components/RelationArrowButton/RelationArrowButton.tsx +29 -0
  127. package/src/components/ProfileRelationsView/components/RelationArrowButton/__tests__/RelationArrowButton.specs.tsx +99 -0
  128. package/src/components/ProfileRelationsView/components/RelationArrowButton/styles.ts +8 -0
  129. package/src/components/ProfileRelationsView/components/RelationTooltip/RelationTooltip.tsx +83 -0
  130. package/src/components/ProfileRelationsView/components/RelationTooltip/__tests__/RelationTooltip.test.tsx +155 -0
  131. package/src/components/ProfileRelationsView/components/RelationTooltip/styles.ts +27 -0
  132. package/src/components/ProfileRelationsView/components/RelationsContent/RelationsContent.tsx +62 -0
  133. package/src/components/ProfileRelationsView/components/RelationsContent/__tests__/RelationsContent.specs.tsx +148 -0
  134. package/src/components/ProfileRelationsView/components/RelationsContent/styles.ts +15 -0
  135. package/src/components/ProfileRelationsView/components/RelationsEditableContent/RelationsEditableContent.tsx +153 -0
  136. package/src/components/ProfileRelationsView/components/RelationsEditableContent/__tests__/RelationsEditableContent.specs.tsx +367 -0
  137. package/src/components/ProfileRelationsView/components/RelationsEditableContent/styles.ts +28 -0
  138. package/src/components/ProfileRelationsView/components/RelationsHeader/FilterButton/FilterButton.tsx +113 -0
  139. package/src/components/ProfileRelationsView/components/RelationsHeader/FilterButton/styles.ts +43 -0
  140. package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/ImportFromDT.tsx +65 -0
  141. package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/MultipleImportIcon.tsx +23 -0
  142. package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/__tests__/ImportFromDT.test.tsx +500 -0
  143. package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/__tests__/MultipleImportIcon.test.tsx +20 -0
  144. package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/hooks/useImportFromDTLoader.ts +84 -0
  145. package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/styles.ts +37 -0
  146. package/src/components/ProfileRelationsView/components/RelationsHeader/RelationsHeader.tsx +39 -0
  147. package/src/components/ProfileRelationsView/components/RelationsHeader/__tests__/RelationsHeader.test.tsx +82 -0
  148. package/src/components/ProfileRelationsView/components/RelationsHeader/styles.ts +18 -0
  149. package/src/components/ProfileRelationsView/components/RelationsList/Ratings/Ratings.tsx +60 -0
  150. package/src/components/ProfileRelationsView/components/RelationsList/Ratings/__tests__/Ratings.test.tsx +64 -0
  151. package/src/components/ProfileRelationsView/components/RelationsList/Ratings/styles.ts +48 -0
  152. package/src/components/ProfileRelationsView/components/RelationsList/RatingsButtons/RatingsButtons.tsx +74 -0
  153. package/src/components/ProfileRelationsView/components/RelationsList/RatingsButtons/__tests__/RatingsButtons.test.tsx +72 -0
  154. package/src/components/ProfileRelationsView/components/RelationsList/RatingsButtons/styles.ts +20 -0
  155. package/src/components/ProfileRelationsView/components/RelationsList/RatingsPopup/RatingsPopup.tsx +109 -0
  156. package/src/components/ProfileRelationsView/components/RelationsList/RatingsPopup/__tests__/RatingsPopup.test.tsx +106 -0
  157. package/src/components/ProfileRelationsView/components/RelationsList/RatingsPopup/styles.ts +133 -0
  158. package/src/components/ProfileRelationsView/components/RelationsList/RelationAttributes/RelationAttributes.tsx +81 -0
  159. package/src/components/ProfileRelationsView/components/RelationsList/RelationAttributes/__tests__/RelationAttributes.test.tsx +218 -0
  160. package/src/components/ProfileRelationsView/components/RelationsList/RelationAttributes/styles.ts +12 -0
  161. package/src/components/ProfileRelationsView/components/RelationsList/RelationCompexItem/RelationComplexItem.tsx +129 -0
  162. package/src/components/ProfileRelationsView/components/RelationsList/RelationCompexItem/__tests__/RelationComplexItem.test.tsx +303 -0
  163. package/src/components/ProfileRelationsView/components/RelationsList/RelationCompexItem/styles.ts +51 -0
  164. package/src/components/ProfileRelationsView/components/RelationsList/RelationItem/RelationItem.tsx +103 -0
  165. package/src/components/ProfileRelationsView/components/RelationsList/RelationItem/__tests__/RelationItem.test.tsx +222 -0
  166. package/src/components/ProfileRelationsView/components/RelationsList/RelationItem/styles.ts +72 -0
  167. package/src/components/ProfileRelationsView/components/RelationsList/RelationsList.tsx +69 -0
  168. package/src/components/ProfileRelationsView/components/RelationsList/ShowDetailsButton/ShowDetailsButton.tsx +28 -0
  169. package/src/components/ProfileRelationsView/components/RelationsList/ShowDetailsButton/__tests__/ShowDetailsButton.test.tsx +33 -0
  170. package/src/components/ProfileRelationsView/components/RelationsList/__tests__/RelationsList.test.tsx +143 -0
  171. package/src/components/ProfileRelationsView/components/RelationsView/RelationsView.tsx +108 -0
  172. package/src/components/ProfileRelationsView/components/RelationsView/__tests__/RelationsView.test.tsx +183 -0
  173. package/src/components/ProfileRelationsView/components/RelationsView/index.ts +1 -0
  174. package/src/components/ProfileRelationsView/components/RelationsView/styles.ts +22 -0
  175. package/src/components/ProfileRelationsView/components/SecondLevelWrapper/SecondLevelWrapper.tsx +66 -0
  176. package/src/components/ProfileRelationsView/components/SecondLevelWrapper/__tests__/SecondLevelWrapper.test.tsx +234 -0
  177. package/src/components/ProfileRelationsView/components/SecondLevelWrapper/styles.ts +12 -0
  178. package/src/components/ProfileRelationsView/components/SuggestedButtons/SuggestedButtons.tsx +23 -0
  179. package/src/components/ProfileRelationsView/components/SuggestedButtons/__tests__/SuggestedButtons.test.tsx +33 -0
  180. package/src/components/ProfileRelationsView/components/SuggestedButtons/styles.ts +7 -0
  181. package/src/components/ProfileRelationsView/contexts/ImportDTContext.ts +7 -0
  182. package/src/components/ProfileRelationsView/contexts/RelationsViewStateContext.ts +6 -0
  183. package/src/components/ProfileRelationsView/helpers/__tests__/filters.test.tsx +10 -0
  184. package/src/components/ProfileRelationsView/helpers/__tests__/ratings.test.ts +92 -0
  185. package/src/components/ProfileRelationsView/helpers/__tests__/relation.test.tsx +27 -0
  186. package/src/components/ProfileRelationsView/helpers/filters.ts +17 -0
  187. package/src/components/ProfileRelationsView/helpers/permissions.ts +17 -0
  188. package/src/components/ProfileRelationsView/helpers/ratings.ts +35 -0
  189. package/src/components/ProfileRelationsView/helpers/relation.ts +15 -0
  190. package/src/components/ProfileRelationsView/hooks/useRelationInfo.ts +25 -0
  191. package/src/components/ProfileRelationsView/hooks/useRelationsState.ts +92 -0
  192. package/src/components/ProfileRelationsView/hooks/useSecondLevelConnections.ts +76 -0
  193. package/src/components/ProfileRelationsView/hooks/useSuggestedRelations.ts +54 -0
  194. package/src/components/ProfileSingleAttributeView/ProfileSingleAttributeView.tsx +20 -0
  195. package/src/components/ProfileSingleAttributeView/__tests__/IntegrationProfileSingleAttribute.test.tsx +368 -0
  196. package/src/components/ProfileSingleAttributeView/__tests__/ProfileSingleAttributeView.test.tsx +933 -0
  197. package/src/components/ProfileSingleAttributeView/__tests__/data/metadata.data.ts +103 -0
  198. package/src/components/ProfileSingleAttributeView/__tests__/data/store.data.ts +42 -0
  199. package/src/components/ProfileSingleAttributeView/components/FilterButton/FilterButton.tsx +63 -0
  200. package/src/components/ProfileSingleAttributeView/components/FilterButton/__tests__/FilterButton.spec.tsx +93 -0
  201. package/src/components/ProfileSingleAttributeView/components/FilterButton/styles.ts +27 -0
  202. package/src/components/ProfileSingleAttributeView/components/SingleAttributeEditableContent/SingleAttributeEditableContent.tsx +204 -0
  203. package/src/components/ProfileSingleAttributeView/components/SingleAttributeEditableContent/__tests__/SingleAttributeEditableContent.specs.tsx +559 -0
  204. package/src/components/ProfileSingleAttributeView/components/SingleAttributeEditableContent/styles.ts +28 -0
  205. package/src/components/ProfileSingleAttributeView/components/SingleAttributeHeader/SingleAttributeHeader.tsx +58 -0
  206. package/src/components/ProfileSingleAttributeView/components/SingleAttributeHeader/__tests__/SingleAttributeHeader.test.tsx +188 -0
  207. package/src/components/ProfileSingleAttributeView/components/SingleAttributeHeader/styles.ts +21 -0
  208. package/src/components/ProfileSingleAttributeView/components/SingleAttributeReadableContent/SingleAttributeReadableContent.tsx +31 -0
  209. package/src/components/ProfileSingleAttributeView/components/SingleAttributeReadableContent/__tests__/SingleAttributeReadableContent.spec.tsx +42 -0
  210. package/src/components/ProfileSingleAttributeView/components/SingleAttributeReadableContent/styles.ts +9 -0
  211. package/src/components/ProfileSingleAttributeView/components/SingleAttributeView/SingleAttributeView.tsx +90 -0
  212. package/src/components/ProfileSingleAttributeView/components/SingleAttributeView/__tests__/SingleAttributeView.test.tsx +346 -0
  213. package/src/components/ProfileSingleAttributeView/components/SingleAttributeView/styles.ts +22 -0
  214. package/src/components/ProfileSingleAttributeView/contexts/SingleAttributeContext.ts +20 -0
  215. package/src/components/ProfileSingleAttributeView/hooks/useSingleAttribute.ts +25 -0
  216. package/src/components/ProfileSingleAttributeView/styles.ts +26 -0
  217. package/src/components/ProfileTableAttributeView/ProfileTableAttributeView.tsx +20 -0
  218. package/src/components/ProfileTableAttributeView/__tests__/IntegrationProfileTableAttributeView.test.tsx +278 -0
  219. package/src/components/ProfileTableAttributeView/__tests__/ProfileTableAttributeView.test.tsx +744 -0
  220. package/src/components/ProfileTableAttributeView/__tests__/data/metadata.data.ts +141 -0
  221. package/src/components/ProfileTableAttributeView/__tests__/data/store.data.ts +48 -0
  222. package/src/components/ProfileTableAttributeView/components/AttributeEditing/AttributeEditing.tsx +97 -0
  223. package/src/components/ProfileTableAttributeView/components/AttributeEditing/__tests__/AttributeEditing.test.tsx +409 -0
  224. package/src/components/ProfileTableAttributeView/components/AttributeEditing/styles.ts +17 -0
  225. package/src/components/ProfileTableAttributeView/components/AttributeTable/AttributeTable.tsx +171 -0
  226. package/src/components/ProfileTableAttributeView/components/AttributeTable/EditButtons.tsx +28 -0
  227. package/src/components/ProfileTableAttributeView/components/AttributeTable/__tests__/AttributeTable.test.tsx +431 -0
  228. package/src/components/ProfileTableAttributeView/components/AttributeTable/__tests__/EditButtons.test.tsx +54 -0
  229. package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/BlobRenderer.tsx +20 -0
  230. package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/DefaultCellValueRenderer.tsx +43 -0
  231. package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/HeadCellRenderer.tsx +19 -0
  232. package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/RowCellRenderer.tsx +33 -0
  233. package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/__tests__/BlobRenderer.test.tsx +29 -0
  234. package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/__tests__/DefaultCellValueRenderer.test.tsx +149 -0
  235. package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/styles.ts +61 -0
  236. package/src/components/ProfileTableAttributeView/components/AttributeTable/styles.ts +21 -0
  237. package/src/components/ProfileTableAttributeView/components/AttributeTableHeader/AttributeTableHeader.tsx +53 -0
  238. package/src/components/ProfileTableAttributeView/components/AttributeTableHeader/__tests__/AttributeTableHeader.test.tsx +96 -0
  239. package/src/components/ProfileTableAttributeView/components/AttributeTableHeader/styles.ts +7 -0
  240. package/src/components/ProfileTableAttributeView/components/TableAttributeContent/TableAttributeContent.tsx +123 -0
  241. package/src/components/ProfileTableAttributeView/components/TableAttributeContent/__tests__/TableAttributeContent.test.tsx +600 -0
  242. package/src/components/ProfileTableAttributeView/components/TableAttributeContent/hooks/useEditableAttribute.ts +212 -0
  243. package/src/components/ProfileTableAttributeView/components/TableAttributeEditableContent/TableAttributeEditableContent.tsx +96 -0
  244. package/src/components/ProfileTableAttributeView/components/TableAttributeEditableContent/__tests__/TableAttributeEditableContent.test.tsx +450 -0
  245. package/src/components/ProfileTableAttributeView/components/TableAttributeEditableContent/hooks/__tests__/useExpandAttributes.test.tsx +92 -0
  246. package/src/components/ProfileTableAttributeView/components/TableAttributeEditableContent/hooks/useExpandAttributes.ts +88 -0
  247. package/src/components/ProfileTableAttributeView/components/TableAttributeEditableContent/styles.ts +21 -0
  248. package/src/components/ProfileTableAttributeView/components/TableAttributeView/TableAttributeView.tsx +64 -0
  249. package/src/components/ProfileTableAttributeView/components/TableAttributeView/__tests__/TableAttributeView.test.tsx +139 -0
  250. package/src/components/ProfileTableAttributeView/components/TableAttributeView/styles.ts +20 -0
  251. package/src/components/ProfileTableAttributeView/components/types.ts +16 -0
  252. package/src/components/ProfileTableAttributeView/contexts/TableAttributeContext.tsx +34 -0
  253. package/src/components/ProfileTableAttributeView/helpers/tableAttributeHelpers.ts +72 -0
  254. package/src/components/ProfileTableAttributeView/hooks/__tests__/helpers.test.ts +97 -0
  255. package/src/components/ProfileTableAttributeView/hooks/helpers.ts +13 -0
  256. package/src/components/ProfileTableAttributeView/hooks/reducer.ts +19 -0
  257. package/src/components/ProfileTableAttributeView/hooks/useTableAttribute.ts +77 -0
  258. package/src/components/RightSidePanel/RightSidePanel.tsx +43 -0
  259. package/src/components/RightSidePanel/__tests__/RightSidePanel.spec.tsx +149 -0
  260. package/src/components/RightSidePanel/components/CollaborationButton/CollaborationButton.tsx +22 -0
  261. package/src/components/RightSidePanel/components/CollaborationButton/__tests__/CollaborationButton.spec.tsx +24 -0
  262. package/src/components/RightSidePanel/components/CollaborationList/CollaborationList.tsx +56 -0
  263. package/src/components/RightSidePanel/components/CollaborationList/__tests__/CollaborationList.spec.tsx +104 -0
  264. package/src/components/RightSidePanel/components/CollaborationList/styles.ts +15 -0
  265. package/src/components/RightSidePanel/components/CollaborationPanelEmptyState/CollaborationPanelEmptyState.tsx +14 -0
  266. package/src/components/RightSidePanel/components/CollaborationPanelEmptyState/__tests__/CollaborationPanelEmptyState.specs.tsx +16 -0
  267. package/src/components/RightSidePanel/components/DBConnectorsList/DBConnectorsList.tsx +19 -0
  268. package/src/components/RightSidePanel/components/DBConnectorsList/__tests__/DBConnectorsList.spec.tsx +42 -0
  269. package/src/components/RightSidePanel/components/DBConnectorsList/styles.ts +12 -0
  270. package/src/components/RightSidePanel/components/WorkflowButton/WorkflowButton.tsx +21 -0
  271. package/src/components/RightSidePanel/components/WorkflowButton/__tests__/WorkflowButton.spec.tsx +23 -0
  272. package/src/components/RightSidePanel/components/WorkflowList/WorkflowList.tsx +18 -0
  273. package/src/components/RightSidePanel/components/WorkflowList/__tests__/WorkflowList.spec.tsx +46 -0
  274. package/src/components/RightSidePanel/components/WorkflowList/styles.ts +9 -0
  275. package/src/components/RightSidePanel/components/WorkflowPanelEmptyState/WorkflowPanelEmptyState.tsx +14 -0
  276. package/src/components/RightSidePanel/components/WorkflowPanelEmptyState/__tests__/WorkflowPanelEmptyState.specs.tsx +17 -0
  277. package/src/components/RightSidePanel/icons/CollaborationIcon.svg +18 -0
  278. package/src/components/RightSidePanel/icons/ConnectorsIcon.svg +3 -0
  279. package/src/components/RightSidePanel/styles.ts +21 -0
  280. package/src/components/Sandbox/CustomView.tsx +59 -0
  281. package/src/components/Sandbox/__tests__/CustomView.test.tsx +294 -0
  282. package/src/components/Sandbox/styles.ts +10 -0
  283. package/src/components/TagPerspectiveView/TagPerspectiveView.tsx +79 -0
  284. package/src/components/TagPerspectiveView/__tests__/TagPerspectiveView.test.tsx +146 -0
  285. package/src/components/TagPerspectiveView/components/TagListHeader/TagListHeader.tsx +48 -0
  286. package/src/components/TagPerspectiveView/components/TagListHeader/__tests__/TagListHeader.test.tsx +60 -0
  287. package/src/components/TagPerspectiveView/components/TagListHeader/index.ts +1 -0
  288. package/src/components/TagPerspectiveView/components/TagListHeader/styles.ts +36 -0
  289. package/src/components/TagPerspectiveView/components/TagProfileBand/TagProfileBand.tsx +21 -0
  290. package/src/components/TagPerspectiveView/components/TagProfileBand/__tests__/TagProfileBand.test.tsx +14 -0
  291. package/src/components/TagPerspectiveView/components/TagProfileBand/index.ts +1 -0
  292. package/src/components/TagPerspectiveView/components/TagProfileBand/styles.ts +24 -0
  293. package/src/components/TagPerspectiveView/hooks/__tests__/useTag.test.tsx +166 -0
  294. package/src/components/TagPerspectiveView/hooks/__tests__/useTagsProvider.test.tsx +208 -0
  295. package/src/components/TagPerspectiveView/hooks/useTag.ts +48 -0
  296. package/src/components/TagPerspectiveView/hooks/useTagsProvider.ts +83 -0
  297. package/src/components/TagPerspectiveView/index.ts +1 -0
  298. package/src/components/TagPerspectiveView/styles.ts +43 -0
  299. package/src/components/hooks/helpers/__tests__/helpers.test.ts +688 -0
  300. package/src/components/hooks/helpers/index.ts +77 -0
  301. package/src/components/hooks/useProfileValidation.ts +30 -0
  302. package/src/components/hooks/useSingleAttributeLoader.ts +164 -0
  303. package/src/components/views/HOCs/styles.ts +37 -0
  304. package/src/components/views/HOCs/withDragHandle.tsx +26 -0
  305. package/src/components/views/HOCs/withErrorBoundary.tsx +27 -0
  306. package/src/components/views/StubView.tsx +18 -0
  307. package/src/components/views/ViewComponent.tsx +25 -0
  308. package/src/components/views/ViewsFactory.tsx +143 -0
  309. package/src/components/views/__tests__/ViewComponent.specs.tsx +47 -0
  310. package/src/components/views/__tests__/ViewsFactory.specs.tsx +256 -0
  311. package/src/components/views/styles.ts +16 -0
  312. package/src/perspectives/DCRReviewPerspective.tsx +51 -0
  313. package/src/perspectives/ProfilePerspective.tsx +104 -0
  314. package/src/perspectives/TagPerspective.tsx +42 -0
  315. package/src/perspectives/__tests__/DCRReviewPerspective.spec.tsx +54 -0
  316. package/src/perspectives/__tests__/ProfilePerspective.spec.tsx +76 -0
  317. package/src/perspectives/__tests__/helpers.spec.ts +131 -0
  318. package/src/perspectives/helpers.ts +29 -0
  319. package/src/types/index.ts +9 -0
  320. package/stories/Profile.stories.tsx +35 -0
  321. package/stories/utils/entity.ts +80 -0
  322. package/stories/utils/hierarchyTree/config.ts +13 -0
  323. package/stories/utils/hierarchyTree/hopsResponse.ts +182 -0
  324. package/stories/utils/hierarchyTree/treeResponse.ts +412 -0
  325. package/stories/utils/mdmStore.ts +64 -0
  326. package/stories/utils/metadata.ts +701 -0
  327. package/stories/utils/profilePerspectiveConfig.ts +95 -0
  328. package/stories/utils/relationsTableView/config.ts +18 -0
  329. package/stories/utils/relationsTableView/connections.ts +647 -0
  330. package/stories/utils/responses.ts +62 -0
  331. package/tsconfig.json +4 -0
  332. package/webpack.config.js +10 -0
  333. package/bundle.js +0 -2
  334. /package/{5271a9e7b6651c852e93.png → public/5271a9e7b6651c852e93.png} +0 -0
  335. /package/{main.css → public/main.css} +0 -0
@@ -1,3 +1,9 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
1
7
  /*!
2
8
  * The buffer module from node.js, for the browser.
3
9
  *
@@ -27,22 +33,41 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27
33
  PERFORMANCE OF THIS SOFTWARE.
28
34
  ***************************************************************************** */
29
35
 
30
- /*! *****************************************************************************
31
- Copyright (c) Microsoft Corporation. All rights reserved.
32
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
33
- this file except in compliance with the License. You may obtain a copy of the
34
- License at http://www.apache.org/licenses/LICENSE-2.0
36
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
35
37
 
36
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
37
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
38
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
39
- MERCHANTABLITY OR NON-INFRINGEMENT.
38
+ /**
39
+ * @license React
40
+ * react-is.production.min.js
41
+ *
42
+ * Copyright (c) Facebook, Inc. and its affiliates.
43
+ *
44
+ * This source code is licensed under the MIT license found in the
45
+ * LICENSE file in the root directory of this source tree.
46
+ */
40
47
 
41
- See the Apache Version 2.0 License for specific language governing permissions
42
- and limitations under the License.
43
- ***************************************************************************** */
48
+ /**
49
+ * @mui/material v5.13.4
50
+ *
51
+ * @license MIT
52
+ * This source code is licensed under the MIT license found in the
53
+ * LICENSE file in the root directory of this source tree.
54
+ */
44
55
 
45
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
56
+ /**
57
+ * @mui/styled-engine v5.13.2
58
+ *
59
+ * @license MIT
60
+ * This source code is licensed under the MIT license found in the
61
+ * LICENSE file in the root directory of this source tree.
62
+ */
63
+
64
+ /**
65
+ * A better abstraction over CSS.
66
+ *
67
+ * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present
68
+ * @website https://github.com/cssinjs/jss
69
+ * @license MIT
70
+ */
46
71
 
47
72
  /**
48
73
  * React Router DOM v6.2.1
@@ -66,14 +91,17 @@ and limitations under the License.
66
91
  * @license MIT
67
92
  */
68
93
 
69
- /** @license Material-UI v4.11.2
94
+ /** @license React v16.13.1
95
+ * react-is.production.min.js
96
+ *
97
+ * Copyright (c) Facebook, Inc. and its affiliates.
70
98
  *
71
99
  * This source code is licensed under the MIT license found in the
72
100
  * LICENSE file in the root directory of this source tree.
73
101
  */
74
102
 
75
- /** @license React v16.8.6
76
- * react-is.production.min.js
103
+ /** @license React v17.0.2
104
+ * react-jsx-runtime.production.min.js
77
105
  *
78
106
  * Copyright (c) Facebook, Inc. and its affiliates.
79
107
  *
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@reltio/profile",
3
+ "version": "1.4.1586-mui5",
4
+ "license": "SEE LICENSE IN LICENSE FILE",
5
+ "main": "bundle.js",
6
+ "dependencies": {
7
+ "@date-io/moment": "^1.3.5",
8
+ "@reltio/hierarchy-tree": "^1.4.1586-mui5",
9
+ "@reltio/mdm-module": "^1.4.1586-mui5",
10
+ "@reltio/mdm-sdk": "^1.4.1586-mui5",
11
+ "@reltio/relations-table": "^1.4.1586-mui5",
12
+ "classnames": "^2.2.5",
13
+ "object-hash": "^2.1.1",
14
+ "prop-types": "^15.6.2",
15
+ "ramda": "^0.28.0",
16
+ "react-redux": "^7.2.3",
17
+ "react-resize-detector": "^4.2.0",
18
+ "redux": "^4.1.2",
19
+ "ui-i18n": "bitbucket:reltio-ondemand/ui-i18n#v1.4.0"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ }
24
+ }
@@ -0,0 +1,20 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+
4
+ const outputDir = path.resolve(process.cwd(), 'public');
5
+ const generatePackageJson = () => {
6
+ const packageJson = require('../../package.json');
7
+ const result = {
8
+ name: packageJson.name,
9
+ version: packageJson.version,
10
+ license: 'SEE LICENSE IN LICENSE FILE',
11
+ main: 'bundle.js',
12
+ dependencies: packageJson.dependencies,
13
+ peerDependencies: packageJson.peerDependencies,
14
+ publishConfig: packageJson.publishConfig
15
+ };
16
+ const source = JSON.stringify(result, null, 2);
17
+ fs.writeFileSync(path.join(outputDir, 'package.json'), source);
18
+ };
19
+
20
+ generatePackageJson();
package/src/.DS_Store ADDED
Binary file
Binary file
@@ -0,0 +1,101 @@
1
+ import React from 'react';
2
+ import classnames from 'classnames';
3
+ import i18n from 'ui-i18n';
4
+
5
+ import {SmallIconButtonWithTooltip} from '@reltio/components';
6
+ import {getLabel} from '@reltio/mdm-sdk';
7
+
8
+ import Typography from '@mui/material/Typography';
9
+ import CloseIcon from '@mui/icons-material/Close';
10
+ import InfoIcon from '@mui/icons-material/InfoRounded';
11
+ import SuccessIcon from '@mui/icons-material/CheckCircle';
12
+ import ErrorIcon from '@mui/icons-material/ReportProblem';
13
+
14
+ import useStyles from './styles';
15
+
16
+ export enum BackgroundUpdateStatus {
17
+ loading = 'loading',
18
+ success = 'success',
19
+ error = 'error'
20
+ }
21
+
22
+ type Props = {
23
+ label?: string;
24
+ onClose: () => void;
25
+ onRefresh?: () => void;
26
+ status?: BackgroundUpdateStatus;
27
+ };
28
+
29
+ const CloseIconButton = ({onClose}: {onClose: () => void}) => {
30
+ const styles = useStyles();
31
+ return (
32
+ <SmallIconButtonWithTooltip
33
+ tooltipTitle={i18n.text('Close')}
34
+ onClick={onClose}
35
+ size={'S'}
36
+ className={styles.closeIcon}
37
+ icon={CloseIcon}
38
+ />
39
+ );
40
+ };
41
+
42
+ const ProcessLoading = ({onClose}: Props) => {
43
+ const styles = useStyles();
44
+
45
+ return (
46
+ <div className={classnames(styles.wrapper, styles.loadingWrapper)}>
47
+ <CloseIconButton onClose={onClose} />
48
+ <InfoIcon className={classnames(styles.indicatorIcon)} />
49
+ <Typography>{i18n.text('Loading background process...')}</Typography>
50
+ </div>
51
+ );
52
+ };
53
+
54
+ const ProcessSuccess = ({label, onClose, onRefresh}: Props) => {
55
+ const styles = useStyles();
56
+
57
+ return (
58
+ <div className={classnames(styles.wrapper, styles.successWrapper)}>
59
+ <CloseIconButton onClose={onClose} />
60
+ <SuccessIcon className={classnames(styles.indicatorIcon)} />
61
+ <div data-reltio-id="background-update-success">
62
+ <span>{i18n.text('This Profile')}</span>
63
+ <b>{getLabel(label)}</b>
64
+ <span>{i18n.text('has been updated.')}</span>
65
+ <span onClick={onRefresh} className={styles.link}>
66
+ {i18n.text('Click Here to Refresh the page')}
67
+ </span>
68
+ <span>{i18n.text(' to retrieve the latest profile data.')}</span>
69
+ </div>
70
+ </div>
71
+ );
72
+ };
73
+
74
+ const ProcessError = ({onClose}: Props) => {
75
+ const styles = useStyles();
76
+
77
+ return (
78
+ <div className={classnames(styles.wrapper, styles.errorWrapper)}>
79
+ <CloseIconButton onClose={onClose} />
80
+ <ErrorIcon className={classnames(styles.indicatorIcon)} />
81
+ <Typography>
82
+ {i18n.text(
83
+ 'UI attempted to check for updates but no update received in the last 30 seconds. Try refreshing the page manually.'
84
+ )}
85
+ </Typography>
86
+ </div>
87
+ );
88
+ };
89
+
90
+ export const BackgroundProcessIndicator = ({label, onClose, onRefresh, status}: Props) => {
91
+ switch (status) {
92
+ case BackgroundUpdateStatus.loading:
93
+ return <ProcessLoading onClose={onClose} />;
94
+ case BackgroundUpdateStatus.success:
95
+ return <ProcessSuccess label={label} onClose={onClose} onRefresh={onRefresh} />;
96
+ case BackgroundUpdateStatus.error:
97
+ return <ProcessError onClose={onClose} />;
98
+ default:
99
+ return null;
100
+ }
101
+ };
@@ -0,0 +1,50 @@
1
+ import {makeStyles} from '@mui/styles';
2
+
3
+ const useStyles = makeStyles((theme) => ({
4
+ wrapper: {
5
+ alignItems: 'center',
6
+ display: 'flex',
7
+ padding: '12px 16px',
8
+ fontSize: '13px',
9
+ lineHeight: '15px',
10
+ fontWeight: theme.typography.fontWeightRegular,
11
+ color: theme.palette.text.secondary
12
+ },
13
+ loadingWrapper: {
14
+ display: 'flex',
15
+ backgroundColor: 'rgba(238, 238, 238, 1)',
16
+ color: theme.palette.text.secondary,
17
+ boxShadow: 'inset 0px -1px 0px rgba(0, 0, 0, 0.12)'
18
+ },
19
+ errorWrapper: {
20
+ display: 'flex',
21
+ backgroundColor: 'rgba(255, 235, 238, 1)',
22
+ color: theme.palette.error.main
23
+ },
24
+ successWrapper: {
25
+ display: 'flex',
26
+ backgroundColor: 'rgba(239, 253, 227, 1)',
27
+ color: theme.palette.success.main,
28
+ '& span, & b': {
29
+ paddingRight: '4px'
30
+ }
31
+ },
32
+ closeIcon: {
33
+ color: theme.palette.text.secondary,
34
+ cursor: 'pointer',
35
+ '&:hover': {
36
+ background: 'none'
37
+ }
38
+ },
39
+ indicatorIcon: {
40
+ padding: '0 14px'
41
+ },
42
+ link: {
43
+ color: theme.palette.primary.main,
44
+ fontSize: theme.typography.pxToRem(13),
45
+ fontWeight: theme.typography.fontWeightRegular,
46
+ cursor: 'pointer'
47
+ }
48
+ }));
49
+
50
+ export default useStyles;
@@ -0,0 +1,77 @@
1
+ import React, {memo, useEffect} from 'react';
2
+ import {useDispatch, useSelector} from 'react-redux';
3
+ import i18n from 'ui-i18n';
4
+ import {Entity} from '@reltio/mdm-sdk';
5
+ import mdm, {profile} from '@reltio/mdm-module';
6
+ import {
7
+ AttributesView,
8
+ EMPTY_STATE_ICONS,
9
+ EMPTY_STATE_VARIANTS,
10
+ EmptyState,
11
+ LinearLoadIndicator,
12
+ WorkflowTasksContext
13
+ } from '@reltio/components';
14
+ import {DCRProfileBand} from './components/DCRProfileBand/DCRProfileBand';
15
+ import {useWorkflowTasks} from './hooks/useWorkflowTasks';
16
+ import {ProfilePerspectiveResizablePanes} from '../ProfilePerspectiveResizablePanes/ProfilePerspectiveResizablePanes';
17
+
18
+ import {useStyles} from './styles';
19
+
20
+ const workflowConfig = {processTypes: ['dataChangeRequestReview']};
21
+ const perspectiveId = 'dcrCard';
22
+
23
+ export const DCRReviewPerspectiveView = memo(() => {
24
+ const styles = useStyles();
25
+ const dispatch = useDispatch();
26
+
27
+ const workflowTasks = useWorkflowTasks(workflowConfig);
28
+
29
+ const entity: Entity = useSelector(mdm.selectors.getEntity);
30
+
31
+ useEffect(() => {
32
+ dispatch(
33
+ profile.sidePanelViews.actions.sidePanelViewsLoaded([
34
+ {
35
+ id: 'common',
36
+ views: [
37
+ {
38
+ point: 'com.reltio.plugins.ui.view',
39
+ id: 'com.reltio.plugins.entity.side.WorkflowsView',
40
+ class: 'com.reltio.plugins.entity.side.WorkflowsView'
41
+ }
42
+ ]
43
+ }
44
+ ])
45
+ );
46
+ }, [dispatch]);
47
+
48
+ const isLoaded = !workflowTasks.loading && !!entity.uri;
49
+
50
+ return (
51
+ <WorkflowTasksContext.Provider value={workflowTasks}>
52
+ <div className={styles.perspectiveView}>
53
+ {!isLoaded && <LinearLoadIndicator />}
54
+ <div className={styles.perspectiveContainer}>
55
+ {isLoaded ? (
56
+ <ProfilePerspectiveResizablePanes hideHistory={true} perspectiveId={perspectiveId}>
57
+ <div className={styles.contentWrapper}>
58
+ <DCRProfileBand />
59
+ <div className={styles.attributesWrapper}>
60
+ <AttributesView />
61
+ </div>
62
+ </div>
63
+ </ProfilePerspectiveResizablePanes>
64
+ ) : (
65
+ <EmptyState
66
+ LogoRenderer={EMPTY_STATE_ICONS.NO_DATA}
67
+ text={i18n.text('No data to display.')}
68
+ variant={EMPTY_STATE_VARIANTS.embedded}
69
+ />
70
+ )}
71
+ </div>
72
+ </div>
73
+ </WorkflowTasksContext.Provider>
74
+ );
75
+ });
76
+
77
+ DCRReviewPerspectiveView.displayName = 'DCRReviewPerspectiveView';
@@ -0,0 +1,156 @@
1
+ import React from 'react';
2
+ import {mount, shallow} from 'enzyme';
3
+ import * as reactRedux from 'react-redux';
4
+ import {
5
+ AttributesView,
6
+ EmptyState,
7
+ LinearLoadIndicator,
8
+ useWorkflowTasks,
9
+ WorkflowTasksContext
10
+ } from '@reltio/components';
11
+ import mdmModule, {ui} from '@reltio/mdm-module';
12
+ import * as reltioComponents from '@reltio/components';
13
+ import {DCRReviewPerspectiveView} from '../DCRReviewPerspectiveView';
14
+ import {DCRProfileBand} from '../components/DCRProfileBand/DCRProfileBand';
15
+ import {RightSidePanel} from '../../RightSidePanel/RightSidePanel';
16
+
17
+ jest.mock('../components/DCRProfileBand/DCRProfileBand', () => ({
18
+ DCRProfileBand: function DCRProfileBand({children}) {
19
+ return <>{children}</>;
20
+ }
21
+ }));
22
+
23
+ jest.mock('../../RightSidePanel/RightSidePanel', () => ({
24
+ RightSidePanel: function RightSidePanel({children}) {
25
+ return <>{children}</>;
26
+ }
27
+ }));
28
+
29
+ jest.mock('../../ProfilePerspectiveView/hooks/useProfileRightSidePanelElements', () => ({
30
+ useProfileRightSidePanelElements: jest.fn(() => ({tabs: []}))
31
+ }));
32
+
33
+ jest.mock('@reltio/components', () => ({
34
+ ...jest.requireActual<Record<string, unknown>>('@reltio/components'),
35
+ AttributesView: function AttributesView({children}) {
36
+ return <>{children}</>;
37
+ },
38
+ useWorkflowTasks: jest.fn()
39
+ }));
40
+
41
+ describe('DCRReviewPerspectiveView tests', () => {
42
+ const useWorkflowTasksMock: ReturnType<typeof useWorkflowTasks> = {
43
+ tasks: [
44
+ {
45
+ assignee: 'somebody1',
46
+ processInstanceId: '38363829',
47
+ processType: 'dataChangeRequestReview',
48
+ objectURIs: ['changeRequests/123', 'entities/123'],
49
+ suspended: false,
50
+ createdBy: 'somebody2',
51
+ priorityClass: 'Medium',
52
+ taskType: 'dcrReview',
53
+ createTime: 1671514671782,
54
+ dueDate: 1671687471782,
55
+ taskId: '38363841',
56
+ displayName: 'DCR Review',
57
+ processDefinitionDisplayName: 'Data Change Request Review',
58
+ possibleActions: [
59
+ {
60
+ action: 'Approve',
61
+ label: 'Approve'
62
+ },
63
+ {
64
+ action: 'Reject',
65
+ label: 'Reject'
66
+ }
67
+ ],
68
+ priority: 50,
69
+ preferredAction: {
70
+ action: 'Approve',
71
+ label: 'Approve'
72
+ },
73
+ repeatingTask: false,
74
+ valid: true
75
+ }
76
+ ],
77
+ total: 1,
78
+ loading: false,
79
+ updateTaskState: () => {},
80
+ loadTasks: () => {}
81
+ };
82
+
83
+ const entityUri = 'changeRequests/123/changes/entities/123';
84
+ const entity = {
85
+ uri: entityUri,
86
+ type: 'entityType'
87
+ };
88
+
89
+ const dispatch = jest.fn();
90
+
91
+ let workflow;
92
+
93
+ beforeAll(() => {
94
+ jest.spyOn(reactRedux, 'useDispatch').mockReturnValue(dispatch);
95
+ jest.spyOn(reactRedux, 'useSelector').mockImplementation((selector) => selector({}));
96
+ });
97
+
98
+ beforeEach(() => {
99
+ workflow = useWorkflowTasksMock;
100
+ jest.spyOn(reltioComponents, 'useWorkflowTasks').mockImplementation(() => workflow);
101
+ jest.spyOn(mdmModule.selectors, 'getEntity').mockImplementation(() => entity);
102
+ jest.spyOn(mdmModule.selectors, 'getEntityUri').mockImplementation(() => entity.uri);
103
+ });
104
+
105
+ afterEach(() => {
106
+ jest.clearAllMocks();
107
+ });
108
+
109
+ const setUp = () => mount(<DCRReviewPerspectiveView />);
110
+
111
+ const getLinearLoadIndicator = (component) => component.find(LinearLoadIndicator);
112
+ const getDCRProfileBand = (component) => component.find(DCRProfileBand);
113
+ const getAttributesView = (component) => component.find(AttributesView);
114
+ const getEmptyState = (component) => component.find(EmptyState);
115
+ const getRightSidePanel = (component) => component.find(RightSidePanel);
116
+ const getWorkflowTasksContext = (component) => component.find(WorkflowTasksContext.Provider);
117
+
118
+ it('should render main components', () => {
119
+ const view = setUp();
120
+
121
+ expect(getDCRProfileBand(view)).toHaveLength(1);
122
+ expect(getAttributesView(view)).toHaveLength(1);
123
+ expect(getRightSidePanel(view)).toHaveLength(1);
124
+ });
125
+
126
+ it('should render loading state if workflow is loading', () => {
127
+ workflow = {
128
+ ...useWorkflowTasksMock,
129
+ loading: true
130
+ };
131
+ const view = setUp();
132
+
133
+ expect(getDCRProfileBand(view)).toHaveLength(0);
134
+ expect(getAttributesView(view)).toHaveLength(0);
135
+ expect(getRightSidePanel(view)).toHaveLength(0);
136
+
137
+ expect(getLinearLoadIndicator(view)).toHaveLength(1);
138
+ expect(getEmptyState(view)).toHaveLength(1);
139
+ });
140
+
141
+ it('should open default perspective on reject action', () => {
142
+ const view = shallow(<DCRReviewPerspectiveView />);
143
+
144
+ getWorkflowTasksContext(view).prop('value').onActionSuccess('Reject');
145
+
146
+ expect(dispatch).toHaveBeenCalledWith(ui.actions.openPerspective({perspectiveId: null, viewId: null}));
147
+ });
148
+
149
+ it('should open entity in profile perspective on Approve action', () => {
150
+ const view = shallow(<DCRReviewPerspectiveView />);
151
+
152
+ getWorkflowTasksContext(view).prop('value').onActionSuccess('Approve');
153
+
154
+ expect(dispatch).toHaveBeenCalledWith(ui.actions.openEntity({uri: 'entities/123', viewId: null}));
155
+ });
156
+ });
@@ -0,0 +1,22 @@
1
+ import React, {useContext, useMemo} from 'react';
2
+ import {ProfileBand, TaskActionButtons, WorkflowTasksContext} from '@reltio/components';
3
+ import {useSelector} from 'react-redux';
4
+ import {Entity, getEntityUriFromDCRUri} from '@reltio/mdm-sdk';
5
+ import mdm from '@reltio/mdm-module';
6
+ import {useStyles} from './styles';
7
+
8
+ export const DCRProfileBand = () => {
9
+ const styles = useStyles();
10
+
11
+ const entity: Entity = useSelector(mdm.selectors.getEntity);
12
+ const {tasks} = useContext(WorkflowTasksContext);
13
+ const entityTask = useMemo(() => {
14
+ return tasks?.find((task) => task.objectURIs.includes(getEntityUriFromDCRUri(entity.uri)));
15
+ }, [entity.uri, tasks]);
16
+
17
+ return (
18
+ <ProfileBand entity={entity}>
19
+ <div className={styles.actionsWrapper}>{entityTask && <TaskActionButtons task={entityTask} />}</div>
20
+ </ProfileBand>
21
+ );
22
+ };
@@ -0,0 +1,92 @@
1
+ import React from 'react';
2
+ import * as reactRedux from 'react-redux';
3
+
4
+ import {ProfileBand, TaskActionButtons, WorkflowTasksContext} from '@reltio/components';
5
+ import mdm from '@reltio/mdm-module';
6
+ import {Entity, WorkflowTaskData} from '@reltio/mdm-sdk';
7
+ import {mount} from 'enzyme';
8
+ import {DCRProfileBand} from '../DCRProfileBand';
9
+
10
+ jest.mock('@reltio/components', () => ({
11
+ ...(jest.requireActual('@reltio/components') as Record<string, unknown>),
12
+ ProfileBand: function ProfileBand({children}) {
13
+ return <>{children}</>;
14
+ },
15
+ TaskActionButtons: () => null
16
+ }));
17
+ describe('DCRProfileBand tests', () => {
18
+ const entity: Entity = {
19
+ uri: 'changeRequests/123/changes/entities/123',
20
+ type: 'entityType'
21
+ };
22
+ const testTasks: WorkflowTaskData[] = [
23
+ {
24
+ assignee: 'somebody1',
25
+ processInstanceId: '38363829',
26
+ processType: 'dataChangeRequestReview',
27
+ objectURIs: ['changeRequests/123', 'entities/123'],
28
+ suspended: false,
29
+ createdBy: 'somebody2',
30
+ priorityClass: 'Medium',
31
+ taskType: 'dcrReview',
32
+ createTime: 1671514671782,
33
+ dueDate: 1671687471782,
34
+ taskId: '38363841',
35
+ displayName: 'DCR Review',
36
+ processDefinitionDisplayName: 'Data Change Request Review',
37
+ possibleActions: [
38
+ {
39
+ action: 'Approve',
40
+ label: 'Approve'
41
+ },
42
+ {
43
+ action: 'Reject',
44
+ label: 'Reject'
45
+ }
46
+ ],
47
+ priority: 50,
48
+ preferredAction: {
49
+ action: 'Approve',
50
+ label: 'Approve'
51
+ },
52
+ repeatingTask: false,
53
+ valid: true
54
+ }
55
+ ];
56
+
57
+ const setUp = (tasks) => {
58
+ return mount(
59
+ <WorkflowTasksContext.Provider
60
+ value={{
61
+ tasks,
62
+ total: 1,
63
+ loadTasks: () => {},
64
+ loading: false,
65
+ updateTaskState: () => {}
66
+ }}
67
+ >
68
+ <DCRProfileBand />
69
+ </WorkflowTasksContext.Provider>
70
+ );
71
+ };
72
+
73
+ beforeAll(() => {
74
+ jest.spyOn(reactRedux, 'useSelector').mockImplementation((selector) => selector({}));
75
+ jest.spyOn(mdm.selectors, 'getEntity').mockReturnValue(entity);
76
+ });
77
+
78
+ const getProfileBand = (component) => component.find(ProfileBand);
79
+ const getTaskActionButtons = (component) => component.find(TaskActionButtons);
80
+
81
+ it('should render main components', () => {
82
+ const component = setUp(testTasks);
83
+ expect(getProfileBand(component).prop('entity')).toBe(entity);
84
+ expect(getTaskActionButtons(component).prop('task')).toBe(testTasks[0]);
85
+ });
86
+
87
+ it('should not render TaskActionButtons without task', () => {
88
+ const component = setUp([]);
89
+ expect(getProfileBand(component).prop('entity')).toBe(entity);
90
+ expect(getTaskActionButtons(component)).toHaveLength(0);
91
+ });
92
+ });
@@ -0,0 +1,11 @@
1
+ import {makeStyles} from '@mui/styles';
2
+
3
+ export const useStyles = makeStyles(() => ({
4
+ actionsWrapper: {
5
+ display: 'flex',
6
+ '& button + button': {
7
+ width: '88px',
8
+ marginLeft: '8px'
9
+ }
10
+ }
11
+ }));
@@ -0,0 +1,31 @@
1
+ import {useWorkflowTasks as useCommonWorkflowTasks} from '@reltio/components';
2
+ import mdmModule, {ui} from '@reltio/mdm-module';
3
+ import {getEntityUriFromDCRUri} from '@reltio/mdm-sdk';
4
+ import {useCallback, useMemo} from 'react';
5
+ import {useDispatch, useSelector} from 'react-redux';
6
+
7
+ export const useWorkflowTasks = (workflowConfig: Parameters<typeof useCommonWorkflowTasks>[0]) => {
8
+ const dispatch = useDispatch();
9
+ const entityUri: string = useSelector(mdmModule.selectors.getEntityUri);
10
+ const commonWorkflowTasks = useCommonWorkflowTasks(workflowConfig);
11
+
12
+ const actionSuccessHandler = useCallback(
13
+ (action: string) => {
14
+ if (action === 'Reject') {
15
+ dispatch(ui.actions.openPerspective({perspectiveId: null, viewId: null}));
16
+ }
17
+ if (action === 'Approve') {
18
+ dispatch(ui.actions.openEntity({uri: getEntityUriFromDCRUri(entityUri), viewId: null}));
19
+ }
20
+ },
21
+ [dispatch, entityUri]
22
+ );
23
+
24
+ return useMemo(
25
+ () => ({
26
+ ...commonWorkflowTasks,
27
+ onActionSuccess: actionSuccessHandler
28
+ }),
29
+ [commonWorkflowTasks, actionSuccessHandler]
30
+ );
31
+ };