@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,933 @@
1
+ import React from 'react';
2
+ import * as reactRedux from 'react-redux';
3
+ import {act} from 'react-dom/test-utils';
4
+ import {mount} from 'enzyme';
5
+ import {EmptyStub} from '@reltio/components';
6
+ import {getPagedEntity, SingleAttributeViewConfig} from '@reltio/mdm-sdk';
7
+ import {profile, ui} from '@reltio/mdm-module';
8
+ import {ProfileSingleAttributeView} from '../ProfileSingleAttributeView';
9
+ import {SingleAttributeView} from '../components/SingleAttributeView/SingleAttributeView';
10
+ import {SingleAttributeContext} from '../contexts/SingleAttributeContext';
11
+ import {getPagedLocalEntity} from '../../hooks/helpers';
12
+ import {delayPromise} from '../../../../../../__mocks__/test-utils';
13
+
14
+ jest.mock('@reltio/mdm-sdk', () => ({
15
+ ...(jest.requireActual('@reltio/mdm-sdk') as Record<string, unknown>),
16
+ getPagedEntity: jest.fn().mockResolvedValue({})
17
+ }));
18
+
19
+ jest.mock('../../hooks/helpers', () => ({
20
+ ...(jest.requireActual('../../hooks/helpers') as Record<string, unknown>),
21
+ getPagedLocalEntity: jest.fn().mockResolvedValue({})
22
+ }));
23
+
24
+ jest.mock('../components/SingleAttributeView/SingleAttributeView', () => ({
25
+ SingleAttributeView: jest.fn()
26
+ }));
27
+
28
+ jest.mock('../contexts/SingleAttributeContext', () => ({
29
+ SingleAttributeContext: {
30
+ Provider: jest.fn()
31
+ }
32
+ }));
33
+
34
+ const createStore = (isDataTenantEntity = false, isTempEnity = false, history = {}) => {
35
+ const tenant = 'knest';
36
+
37
+ return {
38
+ metadata: {
39
+ [tenant]: {
40
+ uri: 'configuration',
41
+ entityTypes: [
42
+ {
43
+ uri: 'configuration/entityTypes/HCP',
44
+ attributes: [
45
+ {
46
+ uri: 'configuration/entityTypes/HCP/attributes/Address'
47
+ },
48
+ {
49
+ uri: 'configuration/entityTypes/HCP/attributes/TestAttribute'
50
+ },
51
+ {
52
+ uri: 'configuration/entityTypes/HCP/attributes/TestAttribute/attributes/SecondLevelNested'
53
+ },
54
+ {
55
+ uri: 'configuration/entityTypes/HCP/attributes/Commenters',
56
+ hidden: true
57
+ }
58
+ ],
59
+ analyticsAttributes: [
60
+ {
61
+ uri: 'configuration/entityTypes/HCP/analyticsAttributes/DQ'
62
+ }
63
+ ]
64
+ }
65
+ ]
66
+ }
67
+ },
68
+ profile: {
69
+ entity: {
70
+ uri: isTempEnity ? 'entities/uri$$tempo' : 'entities/1E4APrQW',
71
+ dataTenant: isDataTenantEntity ? 'uitest3' : undefined,
72
+ attributes: {
73
+ TestAttribute: [
74
+ {uri: '2', value: 'testValue'},
75
+ {uri: '3', value: 'testOvFalseValue', ov: false}
76
+ ]
77
+ }
78
+ },
79
+ mode: 'Viewing',
80
+ history
81
+ },
82
+ tenant: {
83
+ id: tenant
84
+ },
85
+ ui: {
86
+ paths: {
87
+ apiPath: 'https://tst-01.reltio.com/reltio'
88
+ }
89
+ },
90
+ search: {
91
+ searchOptions: {
92
+ searchByOv: true,
93
+ ovOnly: true
94
+ },
95
+ globalFilter: {
96
+ query: null
97
+ }
98
+ }
99
+ };
100
+ };
101
+
102
+ const defaultConfig = {
103
+ attributeUri: 'configuration/entityTypes/HCP/attributes/Address',
104
+ max: 15
105
+ } as SingleAttributeViewConfig;
106
+
107
+ const setUp = (config?: SingleAttributeViewConfig, className?: string) => {
108
+ return mount(<ProfileSingleAttributeView config={config || defaultConfig} className={className} />);
109
+ };
110
+
111
+ const dispatch = jest.fn();
112
+
113
+ const mockStore = (store = createStore()) => {
114
+ jest.spyOn(reactRedux, 'useSelector').mockImplementation((selector) => selector(store));
115
+ jest.spyOn(reactRedux, 'useDispatch').mockImplementation(() => dispatch);
116
+ return store;
117
+ };
118
+
119
+ describe('ProfileSingleAttributeView tests', () => {
120
+ beforeAll(() => {
121
+ (SingleAttributeView as unknown as jest.Mock).mockImplementation(EmptyStub);
122
+ (SingleAttributeContext.Provider as unknown as jest.Mock).mockImplementation(({children}) => (
123
+ <div id="singleAttributeContextMock">{children}</div>
124
+ ));
125
+ });
126
+
127
+ afterEach(() => {
128
+ jest.clearAllMocks();
129
+ });
130
+
131
+ describe('render tests', () => {
132
+ it('should render SingleAttributeContext.Provider correctly', () => {
133
+ mockStore();
134
+ const component = setUp();
135
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toBeDefined();
136
+ });
137
+
138
+ it('should render SingleAttributeView correctly', () => {
139
+ mockStore();
140
+ const component = setUp();
141
+ expect(component.find(SingleAttributeView).prop('config')).toEqual(defaultConfig);
142
+ });
143
+ });
144
+
145
+ describe('useSingleAttributeLoader tests', () => {
146
+ it('should not call getPagedEntity if attributeUri is incorrect', async () => {
147
+ mockStore();
148
+
149
+ const component = setUp({
150
+ ...defaultConfig,
151
+ attributeUri: 'incorrectUri'
152
+ });
153
+
154
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
155
+ isLoading: false,
156
+ page: 0,
157
+ values: [],
158
+ totalVisibleValues: 0
159
+ });
160
+
161
+ expect(getPagedEntity).not.toHaveBeenCalled();
162
+
163
+ await act(async () => {
164
+ await Promise.resolve();
165
+ });
166
+
167
+ component.update();
168
+
169
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
170
+ isLoading: false,
171
+ page: 0,
172
+ totalVisibleValues: 0,
173
+ values: []
174
+ });
175
+ });
176
+
177
+ it('should not call getPagedEntity if attributeUri is is not first level attribute', async () => {
178
+ mockStore();
179
+
180
+ const component = setUp({
181
+ ...defaultConfig,
182
+ attributeUri: 'configuration/entityTypes/HCP/attributes/TestAttribute/attributes/SecondLevelNested'
183
+ });
184
+
185
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
186
+ isLoading: false,
187
+ page: 0,
188
+ values: [],
189
+ totalVisibleValues: 0
190
+ });
191
+
192
+ expect(getPagedEntity).not.toHaveBeenCalled();
193
+
194
+ await act(async () => {
195
+ await Promise.resolve();
196
+ });
197
+
198
+ expect(getPagedEntity).not.toHaveBeenCalled();
199
+
200
+ component.update();
201
+
202
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
203
+ isLoading: false,
204
+ page: 0,
205
+ totalVisibleValues: 0,
206
+ values: []
207
+ });
208
+ });
209
+
210
+ it('should not call getPagedEntity if attributeType is hidden', async () => {
211
+ mockStore();
212
+ (getPagedEntity as jest.Mock).mockResolvedValue({
213
+ attributes: {
214
+ paging: {
215
+ 'configuration/entityTypes/HCP/attributes/Commenters': {
216
+ totalOvValues: 1
217
+ }
218
+ }
219
+ }
220
+ });
221
+
222
+ const component = setUp({
223
+ ...defaultConfig,
224
+ attributeUri: 'configuration/entityTypes/HCP/attributes/Commenters'
225
+ });
226
+
227
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
228
+ isLoading: false,
229
+ page: 0,
230
+ values: [],
231
+ totalVisibleValues: 0
232
+ });
233
+
234
+ expect(getPagedEntity).not.toHaveBeenCalled();
235
+
236
+ await act(async () => {
237
+ await Promise.resolve();
238
+ });
239
+
240
+ component.update();
241
+
242
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
243
+ isLoading: false,
244
+ page: 0,
245
+ totalVisibleValues: 0,
246
+ values: []
247
+ });
248
+ });
249
+
250
+ it('should not call getPagedEntity if entity is temporary', async () => {
251
+ mockStore(createStore(false, true));
252
+ (getPagedEntity as jest.Mock).mockResolvedValue({});
253
+
254
+ const component = setUp();
255
+
256
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
257
+ isLoading: false,
258
+ page: 0,
259
+ values: [],
260
+ totalVisibleValues: 0
261
+ });
262
+
263
+ expect(getPagedEntity).not.toHaveBeenCalled();
264
+
265
+ await act(async () => {
266
+ await Promise.resolve();
267
+ });
268
+
269
+ component.update();
270
+
271
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
272
+ isLoading: false,
273
+ page: 0,
274
+ totalVisibleValues: 0,
275
+ values: []
276
+ });
277
+ });
278
+
279
+ it('should call getPagedEntity with correct params and correct update state if entity is not DTSS', async () => {
280
+ const store = mockStore();
281
+ const values = [{uri: '1', value: '1'}];
282
+ (getPagedEntity as jest.Mock).mockResolvedValue({
283
+ attributes: {
284
+ Address: values,
285
+ paging: {
286
+ 'configuration/entityTypes/HCP/attributes/Address': {
287
+ totalValues: 1
288
+ }
289
+ }
290
+ }
291
+ });
292
+
293
+ const component = setUp();
294
+
295
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
296
+ isLoading: true,
297
+ page: 0,
298
+ values: []
299
+ });
300
+
301
+ expect(getPagedEntity).toHaveBeenCalledWith({
302
+ metadata: store.metadata.knest,
303
+ entity: store.profile.entity,
304
+ apiPath: store.ui.paths.apiPath,
305
+ tenant: store.tenant.id,
306
+ parentUri: store.profile.entity.uri,
307
+ defaultMaxValues: 15,
308
+ attributeTypeUri: defaultConfig.attributeUri,
309
+ searchQuery: '',
310
+ globalFilter: '',
311
+ offset: 0,
312
+ options: undefined
313
+ });
314
+
315
+ await act(async () => {
316
+ await Promise.resolve();
317
+ });
318
+
319
+ component.update();
320
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
321
+ isLoading: false,
322
+ page: 0,
323
+ totalVisibleValues: 1,
324
+ values
325
+ });
326
+ expect(dispatch).toHaveBeenCalledWith(
327
+ profile.actions.processNextPageOfAttributeValues({
328
+ parentUri: store.profile.entity.uri,
329
+ attributeTypeUri: defaultConfig.attributeUri,
330
+ attributeTypeName: 'Address',
331
+ values
332
+ })
333
+ );
334
+ });
335
+
336
+ it('should call getPagedEntity with default max param if it is not passed', async () => {
337
+ const store = mockStore();
338
+ const values = [{uri: '1', value: '1'}];
339
+ (getPagedEntity as jest.Mock).mockResolvedValue({
340
+ attributes: {
341
+ Address: values,
342
+ paging: {
343
+ 'configuration/entityTypes/HCP/attributes/Address': {
344
+ totalValues: 1
345
+ }
346
+ }
347
+ }
348
+ });
349
+
350
+ setUp({
351
+ attributeUri: 'configuration/entityTypes/HCP/attributes/Address',
352
+ max: undefined
353
+ } as SingleAttributeViewConfig);
354
+
355
+ expect(getPagedEntity).toHaveBeenCalledWith({
356
+ metadata: store.metadata.knest,
357
+ entity: store.profile.entity,
358
+ apiPath: store.ui.paths.apiPath,
359
+ tenant: store.tenant.id,
360
+ parentUri: store.profile.entity.uri,
361
+ defaultMaxValues: 15,
362
+ attributeTypeUri: defaultConfig.attributeUri,
363
+ searchQuery: '',
364
+ globalFilter: '',
365
+ offset: 0,
366
+ options: undefined
367
+ });
368
+ });
369
+
370
+ it('should show error from getPagedEntity and update state with empty array for values', async () => {
371
+ const errorMessage = 'test Error message';
372
+
373
+ (getPagedEntity as jest.Mock).mockRejectedValue({
374
+ error: errorMessage
375
+ });
376
+
377
+ const component = setUp();
378
+
379
+ await act(async () => {
380
+ await delayPromise();
381
+ });
382
+
383
+ component.update();
384
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
385
+ isLoading: false,
386
+ page: 0,
387
+ totalVisibleValues: 0,
388
+ values: []
389
+ });
390
+ expect(dispatch).toHaveBeenCalledWith(ui.actions.errorSet(errorMessage));
391
+ });
392
+
393
+ it('should clear values after switching from real entity to temporary', async () => {
394
+ const store = mockStore();
395
+ const values = [{uri: '1', value: '1'}];
396
+ (getPagedEntity as jest.Mock).mockResolvedValue({
397
+ attributes: {
398
+ Address: values,
399
+ paging: {
400
+ 'configuration/entityTypes/HCP/attributes/Address': {
401
+ totalValues: 1
402
+ }
403
+ }
404
+ }
405
+ });
406
+
407
+ const component = setUp();
408
+
409
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
410
+ isLoading: true,
411
+ page: 0,
412
+ values: []
413
+ });
414
+
415
+ expect(getPagedEntity).toHaveBeenCalled();
416
+
417
+ await act(async () => {
418
+ await Promise.resolve();
419
+ });
420
+
421
+ component.update();
422
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
423
+ isLoading: false,
424
+ page: 0,
425
+ totalVisibleValues: 1,
426
+ values
427
+ });
428
+ expect(dispatch).toHaveBeenCalledWith(
429
+ profile.actions.processNextPageOfAttributeValues({
430
+ parentUri: store.profile.entity.uri,
431
+ attributeTypeUri: defaultConfig.attributeUri,
432
+ attributeTypeName: 'Address',
433
+ values
434
+ })
435
+ );
436
+
437
+ //switch to new temp entity
438
+ mockStore(createStore(false, true));
439
+ component.setProps({});
440
+ await act(async () => {
441
+ await Promise.resolve();
442
+ });
443
+ component.update();
444
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
445
+ isLoading: false,
446
+ page: 0,
447
+ totalVisibleValues: 0,
448
+ values: []
449
+ });
450
+ expect(getPagedEntity).toHaveBeenCalledTimes(1);
451
+ expect(dispatch).toHaveBeenCalledTimes(1);
452
+ });
453
+
454
+ it('should call getPagedEntity with correct params and correct update state if entity is not DTSS for analytics attributes', async () => {
455
+ const store = mockStore();
456
+ (getPagedEntity as jest.Mock).mockResolvedValue({
457
+ analyticsAttributes: {
458
+ DQ: ['VALUE 1'],
459
+ paging: {
460
+ 'configuration/entityTypes/HCP/analyticsAttributes/DQ': {
461
+ totalValues: 1
462
+ }
463
+ }
464
+ }
465
+ });
466
+
467
+ const config = {
468
+ ...defaultConfig,
469
+ attributeUri: 'configuration/entityTypes/HCP/analyticsAttributes/DQ'
470
+ };
471
+
472
+ const component = setUp(config);
473
+
474
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
475
+ isLoading: true,
476
+ page: 0,
477
+ values: []
478
+ });
479
+
480
+ expect(getPagedEntity).toHaveBeenCalledWith({
481
+ metadata: store.metadata.knest,
482
+ entity: store.profile.entity,
483
+ apiPath: store.ui.paths.apiPath,
484
+ tenant: store.tenant.id,
485
+ parentUri: store.profile.entity.uri,
486
+ defaultMaxValues: 15,
487
+ attributeTypeUri: config.attributeUri,
488
+ searchQuery: '',
489
+ globalFilter: '',
490
+ offset: 0,
491
+ options: undefined
492
+ });
493
+
494
+ await act(async () => {
495
+ await Promise.resolve();
496
+ });
497
+
498
+ component.update();
499
+
500
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
501
+ isLoading: false,
502
+ page: 0,
503
+ totalVisibleValues: 1,
504
+ values: ['VALUE 1']
505
+ });
506
+ });
507
+
508
+ it('should call getPagedLocalEntity with correct params and correct update state if entity is DTSS', async () => {
509
+ const store = mockStore(createStore(true));
510
+ (getPagedLocalEntity as jest.Mock).mockResolvedValue({
511
+ attributes: {
512
+ Address: ['VALUE 1', 'VALUE 2'],
513
+ paging: {
514
+ 'configuration/entityTypes/HCP/attributes/Address': {
515
+ totalOvValues: 2
516
+ }
517
+ }
518
+ }
519
+ });
520
+
521
+ const component = setUp();
522
+
523
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
524
+ isLoading: true,
525
+ page: 0,
526
+ totalVisibleValues: 0,
527
+ values: []
528
+ });
529
+
530
+ expect(getPagedLocalEntity).toHaveBeenCalledWith({
531
+ metadata: store.metadata.knest,
532
+ entity: store.profile.entity,
533
+ apiPath: store.ui.paths.apiPath,
534
+ tenant: store.tenant.id,
535
+ parentUri: store.profile.entity.uri,
536
+ defaultMaxValues: 15,
537
+ searchQuery: '',
538
+ globalFilter: '',
539
+ attributeTypeUri: defaultConfig.attributeUri,
540
+ offset: 0,
541
+ options: undefined
542
+ });
543
+
544
+ await act(async () => {
545
+ await Promise.resolve();
546
+ });
547
+
548
+ component.update();
549
+
550
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
551
+ isLoading: false,
552
+ page: 0,
553
+ totalVisibleValues: 2,
554
+ values: ['VALUE 1', 'VALUE 2']
555
+ });
556
+ });
557
+
558
+ it('should call getPagedLocalEntity with correct params and correct update state if entity is DTSS for analytics attributes', async () => {
559
+ const store = mockStore(createStore(true));
560
+ (getPagedLocalEntity as jest.Mock).mockResolvedValue({
561
+ analyticsAttributes: {
562
+ DQ: ['VALUE 1', 'VALUE 2'],
563
+ paging: {
564
+ 'configuration/entityTypes/HCP/analyticsAttributes/DQ': {
565
+ totalOvValues: 2
566
+ }
567
+ }
568
+ }
569
+ });
570
+
571
+ const component = setUp({
572
+ ...defaultConfig,
573
+ attributeUri: 'configuration/entityTypes/HCP/analyticsAttributes/DQ'
574
+ });
575
+
576
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
577
+ isLoading: true,
578
+ page: 0,
579
+ values: []
580
+ });
581
+
582
+ expect(getPagedLocalEntity).toHaveBeenCalledWith({
583
+ metadata: store.metadata.knest,
584
+ entity: store.profile.entity,
585
+ apiPath: store.ui.paths.apiPath,
586
+ tenant: store.tenant.id,
587
+ parentUri: store.profile.entity.uri,
588
+ defaultMaxValues: 15,
589
+ searchQuery: '',
590
+ globalFilter: '',
591
+ attributeTypeUri: 'configuration/entityTypes/HCP/analyticsAttributes/DQ',
592
+ offset: 0,
593
+ options: undefined
594
+ });
595
+
596
+ await act(async () => {
597
+ await Promise.resolve();
598
+ });
599
+
600
+ component.update();
601
+
602
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
603
+ isLoading: false,
604
+ page: 0,
605
+ totalVisibleValues: 2,
606
+ values: ['VALUE 1', 'VALUE 2']
607
+ });
608
+ });
609
+
610
+ it('should call getPagedLocalEntity with correct params and correct update state if history is active', async () => {
611
+ const history = {
612
+ slice: {aEntity: {uri: 'entity/entityUri'}, bEntity: {a: 1}},
613
+ diff: {
614
+ attributes: {
615
+ TestAttribute: [{uri: '3', value: 'newValue'}]
616
+ },
617
+ roles: [],
618
+ tags: []
619
+ }
620
+ };
621
+ const store = mockStore(createStore(false, false, history));
622
+ (getPagedLocalEntity as jest.Mock).mockResolvedValue({
623
+ attributes: {
624
+ Address: ['VALUE 1', 'VALUE 2'],
625
+ paging: {
626
+ 'configuration/entityTypes/HCP/attributes/Address': {
627
+ totalOvValues: 2,
628
+ totalValues: 2
629
+ }
630
+ }
631
+ }
632
+ });
633
+
634
+ const component = setUp();
635
+
636
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
637
+ isLoading: true,
638
+ page: 0,
639
+ totalVisibleValues: 0,
640
+ values: []
641
+ });
642
+
643
+ expect(getPagedLocalEntity).toHaveBeenCalledWith({
644
+ metadata: store.metadata.knest,
645
+ entity: {
646
+ ...history.slice.aEntity,
647
+ ...history.diff
648
+ },
649
+ apiPath: store.ui.paths.apiPath,
650
+ tenant: store.tenant.id,
651
+ parentUri: history.slice.aEntity.uri,
652
+ defaultMaxValues: 15,
653
+ searchQuery: '',
654
+ globalFilter: '',
655
+ attributeTypeUri: defaultConfig.attributeUri,
656
+ offset: 0,
657
+ options: undefined
658
+ });
659
+
660
+ await act(async () => {
661
+ await Promise.resolve();
662
+ });
663
+
664
+ component.update();
665
+
666
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
667
+ isLoading: false,
668
+ page: 0,
669
+ totalVisibleValues: 2,
670
+ values: ['VALUE 1', 'VALUE 2']
671
+ });
672
+
673
+ expect(dispatch).not.toHaveBeenCalled();
674
+ });
675
+
676
+ it('setPage should work correctly', () => {
677
+ const store = mockStore();
678
+ const component = setUp();
679
+ expect(component.find(SingleAttributeContext.Provider).prop('value').page).toBe(0);
680
+
681
+ act(() => {
682
+ component.find(SingleAttributeContext.Provider).prop('value').setPage(1);
683
+ });
684
+
685
+ component.update();
686
+ expect(component.find(SingleAttributeContext.Provider).prop('value').page).toBe(1);
687
+
688
+ expect(getPagedEntity).toHaveBeenCalledWith({
689
+ metadata: store.metadata.knest,
690
+ entity: store.profile.entity,
691
+ apiPath: store.ui.paths.apiPath,
692
+ tenant: store.tenant.id,
693
+ parentUri: store.profile.entity.uri,
694
+ defaultMaxValues: 15,
695
+ searchQuery: '',
696
+ globalFilter: '',
697
+ attributeTypeUri: defaultConfig.attributeUri,
698
+ offset: 15,
699
+ options: undefined
700
+ });
701
+ });
702
+
703
+ it('setSearchQuery should work correctly', () => {
704
+ const store = mockStore();
705
+ const component = setUp();
706
+ expect(component.find(SingleAttributeContext.Provider).prop('value').searchQuery).toBe('');
707
+
708
+ act(() => {
709
+ component.find(SingleAttributeContext.Provider).prop('value').setSearchQuery('query');
710
+ });
711
+
712
+ component.update();
713
+ expect(component.find(SingleAttributeContext.Provider).prop('value').searchQuery).toBe('query');
714
+
715
+ expect(getPagedEntity).toHaveBeenCalledWith({
716
+ metadata: store.metadata.knest,
717
+ entity: store.profile.entity,
718
+ apiPath: store.ui.paths.apiPath,
719
+ tenant: store.tenant.id,
720
+ parentUri: store.profile.entity.uri,
721
+ defaultMaxValues: 15,
722
+ attributeTypeUri: defaultConfig.attributeUri,
723
+ offset: 0,
724
+ searchQuery: 'query',
725
+ globalFilter: '',
726
+ sorting: undefined,
727
+ options: undefined
728
+ });
729
+ });
730
+
731
+ it('setShowInactiveValues should work correctly', () => {
732
+ const store = mockStore();
733
+ const component = setUp();
734
+ expect(component.find(SingleAttributeContext.Provider).prop('value').showInactive).toBe(false);
735
+
736
+ act(() => {
737
+ component.find(SingleAttributeContext.Provider).prop('value').toggleShowInactive(true);
738
+ });
739
+
740
+ component.update();
741
+ expect(component.find(SingleAttributeContext.Provider).prop('value').showInactive).toBe(true);
742
+
743
+ expect(getPagedEntity).toHaveBeenCalledWith({
744
+ metadata: store.metadata.knest,
745
+ entity: store.profile.entity,
746
+ apiPath: store.ui.paths.apiPath,
747
+ tenant: store.tenant.id,
748
+ parentUri: store.profile.entity.uri,
749
+ defaultMaxValues: 15,
750
+ searchQuery: '',
751
+ globalFilter: '',
752
+ attributeTypeUri: defaultConfig.attributeUri,
753
+ offset: 0,
754
+ options: ''
755
+ });
756
+ });
757
+
758
+ it('should use the value from the entity', async () => {
759
+ const store = mockStore();
760
+ const values = [
761
+ {uri: '1', value: '1'},
762
+ {uri: '2', value: 'loadedValue'}
763
+ ];
764
+ const attributeUri = 'configuration/entityTypes/HCP/attributes/TestAttribute';
765
+ (getPagedEntity as jest.Mock).mockResolvedValue({
766
+ attributes: {
767
+ TestAttribute: values,
768
+ paging: {
769
+ [attributeUri]: {
770
+ totalOvValues: 1
771
+ }
772
+ }
773
+ }
774
+ });
775
+
776
+ const component = setUp({
777
+ attributeUri
778
+ } as SingleAttributeViewConfig);
779
+
780
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
781
+ isLoading: true,
782
+ page: 0,
783
+ values: []
784
+ });
785
+
786
+ await act(async () => {
787
+ await Promise.resolve();
788
+ });
789
+
790
+ component.update();
791
+
792
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
793
+ isLoading: false,
794
+ page: 0,
795
+ values: [values[0], store.profile.entity.attributes.TestAttribute[0]]
796
+ });
797
+ expect(dispatch).toHaveBeenCalledWith(
798
+ profile.actions.processNextPageOfAttributeValues({
799
+ parentUri: store.profile.entity.uri,
800
+ attributeTypeUri: attributeUri,
801
+ attributeTypeName: 'TestAttribute',
802
+ values
803
+ })
804
+ );
805
+ });
806
+
807
+ it('should switch to history correctly', async () => {
808
+ const store = mockStore();
809
+ const values = [{uri: '1', value: '1'}];
810
+ (getPagedEntity as jest.Mock).mockResolvedValue({
811
+ attributes: {
812
+ Address: values,
813
+ paging: {
814
+ 'configuration/entityTypes/HCP/attributes/Address': {
815
+ totalValues: 1
816
+ }
817
+ }
818
+ }
819
+ });
820
+
821
+ const component = setUp();
822
+
823
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
824
+ isLoading: true,
825
+ page: 0,
826
+ values: []
827
+ });
828
+
829
+ expect(getPagedEntity).toHaveBeenCalled();
830
+
831
+ await act(async () => {
832
+ await Promise.resolve();
833
+ });
834
+
835
+ component.update();
836
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
837
+ isLoading: false,
838
+ page: 0,
839
+ totalVisibleValues: 1,
840
+ values
841
+ });
842
+
843
+ expect(dispatch).toHaveBeenCalledWith(
844
+ profile.actions.processNextPageOfAttributeValues({
845
+ parentUri: store.profile.entity.uri,
846
+ attributeTypeUri: defaultConfig.attributeUri,
847
+ attributeTypeName: 'Address',
848
+ values
849
+ })
850
+ );
851
+
852
+ //switch to history
853
+ const history = {
854
+ slice: {aEntity: {uri: 'entity/entityUri'}, bEntity: {a: 1}},
855
+ diff: {
856
+ attributes: {
857
+ TestAttribute: [{uri: '3', value: 'newValue'}]
858
+ },
859
+ roles: [],
860
+ tags: []
861
+ }
862
+ };
863
+ mockStore(createStore(false, false, history));
864
+ (getPagedLocalEntity as jest.Mock).mockResolvedValue({
865
+ attributes: {
866
+ Address: ['VALUE 1', 'VALUE 2'],
867
+ paging: {
868
+ 'configuration/entityTypes/HCP/attributes/Address': {
869
+ totalOvValues: 2,
870
+ totalValues: 2
871
+ }
872
+ }
873
+ }
874
+ });
875
+
876
+ component.setProps({});
877
+ await act(async () => {
878
+ await Promise.resolve();
879
+ });
880
+ component.update();
881
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
882
+ isLoading: false,
883
+ page: 0,
884
+ totalVisibleValues: 2,
885
+ values: ['VALUE 1', 'VALUE 2']
886
+ });
887
+
888
+ expect(getPagedLocalEntity).toHaveBeenCalledWith({
889
+ metadata: store.metadata.knest,
890
+ entity: {
891
+ ...history.slice.aEntity,
892
+ ...history.diff
893
+ },
894
+ apiPath: store.ui.paths.apiPath,
895
+ tenant: store.tenant.id,
896
+ parentUri: history.slice.aEntity.uri,
897
+ defaultMaxValues: 15,
898
+ searchQuery: '',
899
+ globalFilter: '',
900
+ attributeTypeUri: defaultConfig.attributeUri,
901
+ offset: 0,
902
+ options: undefined
903
+ });
904
+
905
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
906
+ isLoading: false,
907
+ page: 0,
908
+ totalVisibleValues: 2,
909
+ values: ['VALUE 1', 'VALUE 2']
910
+ });
911
+ });
912
+
913
+ it('should provide nonVisibleValues which contain ov false values', async () => {
914
+ const store = mockStore();
915
+ const attributeUri = 'configuration/entityTypes/HCP/attributes/TestAttribute';
916
+
917
+ const component = setUp({
918
+ attributeUri
919
+ } as SingleAttributeViewConfig);
920
+
921
+ expect(component.find(SingleAttributeContext.Provider).prop('value')).toMatchObject({
922
+ nonVisibleValues: [store.profile.entity.attributes.TestAttribute[1]]
923
+ });
924
+ });
925
+ });
926
+
927
+ it('should provide className to SingleAttributeView component', () => {
928
+ const className = 'TestClassname';
929
+ mockStore();
930
+ const component = setUp(defaultConfig, className);
931
+ expect(component.find(SingleAttributeView).prop('className')).toBe(className);
932
+ });
933
+ });