@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
@@ -0,0 +1,64 @@
1
+ import React, {useContext} from 'react';
2
+ import classnames from 'classnames';
3
+ import i18n from 'ui-i18n';
4
+ import {useSelector} from 'react-redux';
5
+ import {
6
+ BasicView,
7
+ FacetViewHeader,
8
+ DescriptionIcon,
9
+ LinearLoadIndicator,
10
+ BasicTablePagination
11
+ } from '@reltio/components';
12
+ import mdmModule from '@reltio/mdm-module';
13
+ import {TableAttributeViewConfig} from '@reltio/mdm-sdk';
14
+ import Typography from '@mui/material/Typography';
15
+ import {TableAttributeContext} from '../../contexts/TableAttributeContext';
16
+ import AttributeTableHeader from '../AttributeTableHeader/AttributeTableHeader';
17
+ import TableAttributeContent from '../TableAttributeContent/TableAttributeContent';
18
+ import {useStyles} from './styles';
19
+
20
+ const DEFAULT_ROWS_PER_PAGE = 15;
21
+
22
+ type Props = {
23
+ config: TableAttributeViewConfig;
24
+ className?: string;
25
+ };
26
+
27
+ export const TableAttributeView = ({config, className}: Props) => {
28
+ const {caption, max = DEFAULT_ROWS_PER_PAGE} = config;
29
+
30
+ const styles = useStyles();
31
+ const entityUri = useSelector(mdmModule.selectors.getEntityUri);
32
+ const {totalVisibleValues, attributeType, showTable, hasPaging, isLoading, page, setPage} =
33
+ useContext(TableAttributeContext);
34
+
35
+ return (
36
+ <BasicView className={classnames(styles.root, className)}>
37
+ {showTable ? (
38
+ <>
39
+ <AttributeTableHeader title={caption} />
40
+ <div className={styles.content}>
41
+ <TableAttributeContent config={config} attributeType={attributeType} entityUri={entityUri} />
42
+ {hasPaging && (
43
+ <BasicTablePagination
44
+ count={totalVisibleValues}
45
+ rowsPerPageOptions={[]}
46
+ rowsPerPage={max}
47
+ page={page}
48
+ onChangePage={setPage}
49
+ />
50
+ )}
51
+ {isLoading && <LinearLoadIndicator />}
52
+ </div>
53
+ </>
54
+ ) : (
55
+ <>
56
+ <FacetViewHeader title={caption} className={styles.header}>
57
+ <DescriptionIcon description={attributeType?.description} />
58
+ </FacetViewHeader>
59
+ <Typography className={styles.noData}>{i18n.text('No data')}</Typography>
60
+ </>
61
+ )}
62
+ </BasicView>
63
+ );
64
+ };
@@ -0,0 +1,139 @@
1
+ import React, {ContextType} from 'react';
2
+ import {mount} from 'enzyme';
3
+ import * as reactRedux from 'react-redux';
4
+ import {omit} from 'ramda';
5
+ import {AttributeType, ProfileViewTypes, TableAttributeViewConfig} from '@reltio/mdm-sdk';
6
+ import {
7
+ BasicTablePagination,
8
+ BasicView,
9
+ LinearLoadIndicator,
10
+ FacetViewHeader,
11
+ DescriptionIcon
12
+ } from '@reltio/components';
13
+ import {TableAttributeContext} from '../../../contexts/TableAttributeContext';
14
+ import TableAttributeContent from '../../TableAttributeContent/TableAttributeContent';
15
+ import AttributeTableHeader from '../../AttributeTableHeader/AttributeTableHeader';
16
+ import {TableAttributeView} from '../TableAttributeView';
17
+
18
+ jest.mock('@reltio/components', () => ({
19
+ ...jest.requireActual<Record<string, unknown>>('@reltio/components'),
20
+ DescriptionIcon: () => null
21
+ }));
22
+ jest.mock('@mui/material/Typography', () => () => null);
23
+ jest.mock('../../AttributeTableHeader/AttributeTableHeader', () => () => null);
24
+ jest.mock('../../TableAttributeContent/TableAttributeContent', () => () => null);
25
+
26
+ const store = {
27
+ profile: {
28
+ entity: {
29
+ uri: 'entities/1E4APrQW'
30
+ }
31
+ }
32
+ };
33
+
34
+ const defaultConfig = {
35
+ attributeUri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested',
36
+ caption: 'Attributes View',
37
+ max: 10,
38
+ id: 'viewId',
39
+ class: ProfileViewTypes.AttributeTable
40
+ };
41
+
42
+ const defaultAttributeType = {
43
+ uri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested',
44
+ description: 'description string'
45
+ } as AttributeType;
46
+
47
+ const defaultContextValue = {
48
+ totalVisibleValues: 1,
49
+ hasPaging: false,
50
+ page: 0,
51
+ setPage: jest.fn(),
52
+ isLoading: false,
53
+ attributeType: defaultAttributeType,
54
+ showTable: true
55
+ };
56
+
57
+ type SetUpProps = {
58
+ contextValue?: Partial<ContextType<typeof TableAttributeContext>>;
59
+ config?: TableAttributeViewConfig;
60
+ className?: string;
61
+ };
62
+
63
+ const setUp = ({contextValue = defaultContextValue, config = defaultConfig, className}: SetUpProps = {}) => {
64
+ return mount(
65
+ <TableAttributeContext.Provider value={contextValue as ContextType<typeof TableAttributeContext>}>
66
+ <TableAttributeView config={config} className={className} />
67
+ </TableAttributeContext.Provider>
68
+ );
69
+ };
70
+
71
+ describe('TableAttributeView tests', () => {
72
+ beforeAll(() => {
73
+ jest.spyOn(reactRedux, 'useSelector').mockImplementation((selector) => selector(store));
74
+ });
75
+
76
+ it('should render BasicView with correctly className if className prop is passed', () => {
77
+ const component = setUp({className: 'someClassName'});
78
+ expect(component.find(BasicView).prop('className')).toBe('root someClassName');
79
+ });
80
+
81
+ it('should render BasicView with correctly className if className prop is not passed', () => {
82
+ const component = setUp();
83
+ expect(component.find(BasicView).prop('className')).toBe('root');
84
+ });
85
+
86
+ it('should render correct data if showTable is true', () => {
87
+ const contextValue = {...defaultContextValue, hasPaging: true};
88
+ const component = setUp({contextValue});
89
+ expect(component.find(AttributeTableHeader).prop('title')).toBe(defaultConfig.caption);
90
+ expect(component.find(TableAttributeContent).props()).toEqual({
91
+ config: defaultConfig,
92
+ attributeType: defaultAttributeType,
93
+ entityUri: store.profile.entity.uri
94
+ });
95
+ expect(component.find(BasicTablePagination).props()).toEqual({
96
+ count: contextValue.totalVisibleValues,
97
+ rowsPerPageOptions: [],
98
+ rowsPerPage: defaultConfig.max,
99
+ page: contextValue.page,
100
+ onChangePage: contextValue.setPage
101
+ });
102
+ });
103
+
104
+ it('should not render BasicTablePagination if hasPaging is false', () => {
105
+ const contextValue = {...defaultContextValue, hasPaging: false};
106
+ const component = setUp({contextValue});
107
+ expect(component.find(BasicTablePagination)).toHaveLength(0);
108
+ });
109
+
110
+ it('should render BasicTablePagination with default rowsPerPage if config has no max property', () => {
111
+ const contextValue = {...defaultContextValue, hasPaging: true};
112
+ const config = omit(['max'], defaultConfig);
113
+ const component = setUp({contextValue, config});
114
+ expect(component.find(BasicTablePagination).prop('rowsPerPage')).toBe(15);
115
+ });
116
+
117
+ it('should render LinearLoadIndicator if isLoading is "true"', () => {
118
+ const contextValue = {...defaultContextValue, isLoading: true};
119
+ const component = setUp({contextValue});
120
+ expect(component.find(LinearLoadIndicator)).toHaveLength(1);
121
+ });
122
+
123
+ it('should render no data message if showTable is false', () => {
124
+ const contextValue = {...defaultContextValue, showTable: false};
125
+ const component = setUp({contextValue});
126
+ expect(component.find(LinearLoadIndicator)).toHaveLength(0);
127
+ expect(component.find(AttributeTableHeader)).toHaveLength(0);
128
+ expect(component.find(FacetViewHeader).prop('title')).toEqual(defaultConfig.caption);
129
+ expect(component.find(DescriptionIcon).prop('description')).toBe('description string');
130
+ expect(component.find(BasicTablePagination)).toHaveLength(0);
131
+ expect(component.find('.noData')).toHaveLength(1);
132
+ });
133
+
134
+ it('should render DescriptionIcon with correct description prop if attributeType is null or undefined', () => {
135
+ const contextValue = {...defaultContextValue, showTable: false, attributeType: null};
136
+ const component = setUp({contextValue});
137
+ expect(component.find(DescriptionIcon).prop('description')).toBe(undefined);
138
+ });
139
+ });
@@ -0,0 +1,20 @@
1
+ import {makeStyles} from '@mui/styles';
2
+
3
+ export const useStyles = makeStyles(() => ({
4
+ root: {
5
+ display: 'flex',
6
+ flexDirection: 'column'
7
+ },
8
+ content: {
9
+ position: 'relative',
10
+ overflow: 'hidden'
11
+ },
12
+ noData: {
13
+ fontSize: '13px',
14
+ paddingLeft: '20px',
15
+ color: 'rgba(0,0,0,0.54)'
16
+ },
17
+ header: {
18
+ padding: '0 4px 0 16px'
19
+ }
20
+ }));
@@ -0,0 +1,16 @@
1
+ type PlainColumnDataType = {
2
+ id: string;
3
+ label: string;
4
+ description?: string;
5
+ dataTypeDefinition: any;
6
+ };
7
+
8
+ export type ColumnsDataType = Array<
9
+ | {
10
+ id: string;
11
+ label: string;
12
+ columns: Array<PlainColumnDataType>;
13
+ description?: string;
14
+ }
15
+ | PlainColumnDataType
16
+ >;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import {AttributeType, ComplexAttributeValue} from '@reltio/mdm-sdk';
3
+ import {ColumnsDataType} from '../components/types';
4
+
5
+ export const TableAttributeContext = React.createContext<{
6
+ searchQuery: string;
7
+ setSearchQuery: (query: string) => void;
8
+ values: ComplexAttributeValue[];
9
+ page: number;
10
+ setPage: (page: number) => void;
11
+ isLoading: boolean;
12
+ visibleColumns: string[];
13
+ onChangeColumns: (cols: string[]) => void;
14
+ onToggleFilters: () => void;
15
+ onSort: (payload) => void;
16
+ onFilter: (payload) => void;
17
+ hasPaging: boolean;
18
+ totalVisibleValues: number;
19
+ showTable: boolean;
20
+ filters: {
21
+ [key: string]: {
22
+ filter: string;
23
+ values: [string];
24
+ };
25
+ };
26
+ sorting: {
27
+ order: 'desc' | 'asc';
28
+ field: string;
29
+ };
30
+ attributeType: AttributeType;
31
+ allColumnsData: ColumnsDataType;
32
+ }>(null);
33
+
34
+ TableAttributeContext.displayName = 'TableAttributeContext';
@@ -0,0 +1,72 @@
1
+ import {assoc, chain, isNil, map, path, pipe, prop, reduce, reject, slice, split, uniqBy} from 'ramda';
2
+ import {
3
+ AttributeNode,
4
+ AttributeType,
5
+ attributeUriToSearchUri,
6
+ flatAttributeTreeNode,
7
+ getAttrDataTypeDefinition,
8
+ getAttributeTypesTree,
9
+ getOvAttributeValuesByPathWithUri,
10
+ isAttributeSearchUri,
11
+ Metadata,
12
+ SearchParent
13
+ } from '@reltio/mdm-sdk';
14
+ import HeadCellRenderer from '../components/AttributeTable/cell-renderers/HeadCellRenderer';
15
+ import DefaultCellValueRenderer from '../components/AttributeTable/cell-renderers/DefaultCellValueRenderer';
16
+
17
+ export const getColumnsDataFromAttributeNode = (attrNode: AttributeNode, parents: SearchParent[]) => {
18
+ const {uri, label, children, name, description} = attrNode;
19
+ return reject(isNil, {
20
+ id: attributeUriToSearchUri(uri, parents),
21
+ label,
22
+ description,
23
+ dataTypeDefinition: getAttrDataTypeDefinition(attrNode),
24
+ children: children?.map((childNode) => getColumnsDataFromAttributeNode(childNode, parents.concat({name})))
25
+ });
26
+ };
27
+
28
+ export const getColumnsData = (metadata: Metadata, attributeType: AttributeType) =>
29
+ pipe(
30
+ (metadata: Metadata, attributeType: AttributeType) => getAttributeTypesTree(metadata, attributeType),
31
+ map((attrNode: AttributeNode) => getColumnsDataFromAttributeNode(attrNode, [attributeType])),
32
+ chain(flatAttributeTreeNode),
33
+ uniqBy(prop('id'))
34
+ )(metadata, attributeType);
35
+
36
+ const getAttrPathFromColumnId = pipe(split('.'), slice(2, Infinity));
37
+
38
+ const getAttributeValues = (attrPath, value) =>
39
+ pipe(path(['value']), getOvAttributeValuesByPathWithUri(attrPath))(value);
40
+
41
+ const getRowValueByColumnId = (columnId, value) => {
42
+ const attrPath = getAttrPathFromColumnId(columnId);
43
+ return getAttributeValues(attrPath, value);
44
+ };
45
+
46
+ export const getBasicTableRowsData = (values, columnsData) =>
47
+ values.map((value) =>
48
+ pipe(
49
+ reduce((acc, {id}) => assoc(id, getRowValueByColumnId(id, value), acc), {}),
50
+ assoc('value', value)
51
+ )(columnsData)
52
+ );
53
+
54
+ const getNestedPathByColumnId = (columnId) => {
55
+ if (isAttributeSearchUri(columnId)) {
56
+ const attrPath = getAttrPathFromColumnId(columnId);
57
+ return attrPath.length > 1 ? attrPath.slice(0, -1) : null;
58
+ } else {
59
+ return null;
60
+ }
61
+ };
62
+
63
+ const getColumnDataByColumnId = (columnData) => ({
64
+ ...columnData,
65
+ sortable: true,
66
+ resizable: true,
67
+ nestedPath: getNestedPathByColumnId(columnData.id),
68
+ headCellRenderer: HeadCellRenderer,
69
+ rowCellValueRenderer: DefaultCellValueRenderer
70
+ });
71
+
72
+ export const getBasicTableColumnsData = map(getColumnDataByColumnId);
@@ -0,0 +1,97 @@
1
+ import {buildMDMFilters} from '../helpers';
2
+ import {DataTypes} from '@reltio/mdm-sdk';
3
+
4
+ describe('buildMDMFilters tests', () => {
5
+ it('should build correct filter for "in.file"', () => {
6
+ const filters = {
7
+ member: {
8
+ filter: 'in.file',
9
+ value: {link: 'fileLink'}
10
+ }
11
+ };
12
+ const columnsData = [
13
+ {
14
+ id: 'member',
15
+ label: 'member label',
16
+ dataTypeDefinition: {
17
+ type: DataTypes.TYPE_STRING
18
+ }
19
+ }
20
+ ];
21
+
22
+ expect(buildMDMFilters(columnsData, filters)).toEqual([
23
+ {fieldName: 'member', type: 'String', filter: 'in.file', values: [{link: 'fileLink'}]}
24
+ ]);
25
+ });
26
+
27
+ it('should build correct filter for boolean type', () => {
28
+ const filters = {
29
+ member: {
30
+ filter: 'equals',
31
+ value: true
32
+ }
33
+ };
34
+ const columnsData = [
35
+ {
36
+ id: 'member',
37
+ label: 'member label',
38
+ dataTypeDefinition: {
39
+ type: DataTypes.TYPE_BOOLEAN_RADIO
40
+ }
41
+ }
42
+ ];
43
+
44
+ expect(buildMDMFilters(columnsData, filters)).toEqual([
45
+ {fieldName: 'member', type: 'Boolean_Radio', filter: 'equals', values: [true]}
46
+ ]);
47
+ });
48
+
49
+ it('should build correct filter for "hasAll" filter', () => {
50
+ const filters = {
51
+ member: {
52
+ filter: 'hasAll',
53
+ value: [
54
+ {lookupCode: 'DIGI', value: 'Digital'},
55
+ {lookupCode: 'POST', value: 'Postal'}
56
+ ]
57
+ }
58
+ };
59
+ const columnsData = [
60
+ {
61
+ id: 'member',
62
+ label: 'member label',
63
+ dataTypeDefinition: {
64
+ type: DataTypes.TYPE_DEPENDENT_LOOKUP
65
+ }
66
+ }
67
+ ];
68
+
69
+ expect(buildMDMFilters(columnsData, filters)).toEqual([
70
+ {
71
+ fieldName: 'member',
72
+ type: 'DependentLookup',
73
+ filter: 'hasAll',
74
+ values: [
75
+ [
76
+ {lookupCode: 'DIGI', value: 'Digital'},
77
+ {lookupCode: 'POST', value: 'Postal'}
78
+ ]
79
+ ]
80
+ }
81
+ ]);
82
+ });
83
+
84
+ it('should build empty filters for null', () => {
85
+ const columnsData = [
86
+ {
87
+ id: 'member',
88
+ label: 'member label',
89
+ dataTypeDefinition: {
90
+ type: DataTypes.TYPE_STRING
91
+ }
92
+ }
93
+ ];
94
+
95
+ expect(buildMDMFilters(columnsData, null)).toEqual([]);
96
+ });
97
+ });
@@ -0,0 +1,13 @@
1
+ import {propEq} from 'ramda';
2
+ import {Maybe} from '@reltio/mdm-sdk';
3
+ import {ColumnData, ColumnFilter, columnFilterToMdmFilter} from '@reltio/components';
4
+
5
+ export const buildMDMFilters = (columnsData: ColumnData[], filters: Record<string, ColumnFilter>) =>
6
+ Maybe.fromNull<Record<string, ColumnFilter>>(filters)
7
+ .map<ReturnType<typeof columnFilterToMdmFilter>[]>((filters) =>
8
+ Object.entries(filters).map(([columnId, columnFilter]) => {
9
+ const columnData = columnsData.find(propEq('id', columnId));
10
+ return columnFilterToMdmFilter(columnData, columnFilter);
11
+ })
12
+ )
13
+ .orSome([]);
@@ -0,0 +1,19 @@
1
+ import {basicTableViewState, createStandardAction} from '@reltio/components';
2
+
3
+ const CHANGE_SEARCH_QUERY = 'CHANGE_SEARCH_QUERY';
4
+
5
+ const actions = {
6
+ ...basicTableViewState.actions,
7
+ changeSearchQuery: createStandardAction(CHANGE_SEARCH_QUERY)
8
+ };
9
+
10
+ const reducer = (state, action) => {
11
+ switch (action.type) {
12
+ case CHANGE_SEARCH_QUERY:
13
+ return {...state, searchQuery: action.payload, page: 0};
14
+ default:
15
+ return basicTableViewState.reducer(state, action);
16
+ }
17
+ };
18
+
19
+ export {reducer as default, actions};
@@ -0,0 +1,77 @@
1
+ import {useMemo, useReducer} from 'react';
2
+ import {reject, isNil, pipe, not, prop} from 'ramda';
3
+ import {useSelector} from 'react-redux';
4
+ import {
5
+ ComplexAttributeValue,
6
+ findAttributeTypeByUri,
7
+ isComplexAttribute,
8
+ SingleAttributeViewConfig
9
+ } from '@reltio/mdm-sdk';
10
+ import mdm from '@reltio/mdm-module';
11
+ import {useActions} from '@reltio/components';
12
+ import reducer, {actions} from './reducer';
13
+ import {getColumnsData} from '../helpers/tableAttributeHelpers';
14
+ import {useSingleAttributeLoader} from '../../hooks/useSingleAttributeLoader';
15
+ import {buildMDMFilters} from './helpers';
16
+
17
+ const DEFAULT_COUNT_COLUMN = 5;
18
+
19
+ export const useTableAttribute = (config: SingleAttributeViewConfig) => {
20
+ const {attributeUri} = config;
21
+ const metadata = useSelector(mdm.selectors.getMetadata);
22
+ const attributeType = useMemo(() => findAttributeTypeByUri(metadata, attributeUri), [metadata, attributeUri]);
23
+ const allColumnsData = useMemo(
24
+ () => (attributeType ? getColumnsData(metadata, attributeType) : []),
25
+ [metadata, attributeType]
26
+ );
27
+ const initialState = useMemo(
28
+ () => ({
29
+ searchQuery: '',
30
+ filters: null,
31
+ sorting: undefined,
32
+ visibleColumns: allColumnsData
33
+ .filter(pipe(prop('dataTypeDefinition'), isComplexAttribute, not))
34
+ .map(({id}) => id)
35
+ .slice(0, DEFAULT_COUNT_COLUMN),
36
+ page: 0
37
+ }),
38
+ [allColumnsData]
39
+ );
40
+
41
+ const [state, dispatch] = useReducer(reducer, initialState);
42
+
43
+ const {searchQuery, filters, sorting, page} = state;
44
+ const isEditableMode = useSelector(mdm.selectors.getIsEditableMode);
45
+
46
+ const requestFilters = useMemo(() => {
47
+ const mdmFilters = buildMDMFilters(allColumnsData, filters);
48
+ return mdmFilters.length ? mdmFilters : null;
49
+ }, [filters, allColumnsData]);
50
+
51
+ const params = useMemo(
52
+ () => reject(isNil, {filters: requestFilters, page, sorting, searchQuery}),
53
+ [requestFilters, page, sorting, searchQuery]
54
+ );
55
+ const {changeSearchQuery, changePage, toggleSort, changeFilter, toggleFilters, changeColumns} = useActions({
56
+ actions,
57
+ dispatch
58
+ });
59
+ const attribute = useSingleAttributeLoader<ComplexAttributeValue>(config, params);
60
+ const showTable = Boolean(
61
+ (attribute?.values?.length || requestFilters || searchQuery || isEditableMode) &&
62
+ attributeType &&
63
+ !attributeType.hidden
64
+ );
65
+ return {
66
+ ...state,
67
+ setSearchQuery: changeSearchQuery,
68
+ setPage: changePage,
69
+ onSort: toggleSort,
70
+ onFilter: changeFilter,
71
+ onToggleFilters: toggleFilters,
72
+ onChangeColumns: changeColumns,
73
+ showTable,
74
+ allColumnsData,
75
+ ...attribute
76
+ };
77
+ };
@@ -0,0 +1,43 @@
1
+ import React, {useEffect} from 'react';
2
+ import {SidePanelContentHeader, SidePanel, RightPanelTab} from '@reltio/components';
3
+ import {isNil} from 'ramda';
4
+
5
+ import {useStyles} from './styles';
6
+
7
+ export enum ActivePanel {
8
+ Workflow,
9
+ Collaboration,
10
+ History,
11
+ DBConnector
12
+ }
13
+
14
+ type Props = {
15
+ active?: ActivePanel;
16
+ tabs: Array<RightPanelTab>;
17
+ onClose?: () => void;
18
+ };
19
+
20
+ export const RightSidePanel = ({active, tabs, onClose}: Props) => {
21
+ const styles = useStyles();
22
+ const isOpen = !isNil(active);
23
+ const {content, headerProps, hidden} = tabs[active] || {};
24
+
25
+ useEffect(() => {
26
+ if (hidden) {
27
+ onClose();
28
+ }
29
+ }, [active, hidden, onClose]);
30
+
31
+ return (
32
+ <div className={styles.wrapper}>
33
+ <SidePanel open={isOpen}>
34
+ {!hidden && (
35
+ <>
36
+ <SidePanelContentHeader {...headerProps} onClose={onClose} />
37
+ {content}
38
+ </>
39
+ )}
40
+ </SidePanel>
41
+ </div>
42
+ );
43
+ };