@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.
- package/.DS_Store +0 -0
- package/index.ts +4 -0
- package/package.json +40 -23
- package/public/bundle.js +205 -0
- package/{bundle.js.LICENSE.txt → public/bundle.js.LICENSE.txt} +44 -16
- package/public/package.json +24 -0
- package/scripts/build/index.js +20 -0
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/BackgroundProcessIndicator/BackgroundProcessIndicator.tsx +101 -0
- package/src/components/BackgroundProcessIndicator/styles.ts +50 -0
- package/src/components/DCRReviewPerspectiveView/DCRReviewPerspectiveView.tsx +77 -0
- package/src/components/DCRReviewPerspectiveView/__tests__/DCRReviewPerspectiveView.test.tsx +156 -0
- package/src/components/DCRReviewPerspectiveView/components/DCRProfileBand/DCRProfileBand.tsx +22 -0
- package/src/components/DCRReviewPerspectiveView/components/DCRProfileBand/__tests__/DCRProfileBand.test.tsx +92 -0
- package/src/components/DCRReviewPerspectiveView/components/DCRProfileBand/styles.ts +11 -0
- package/src/components/DCRReviewPerspectiveView/hooks/useWorkflowTasks.ts +31 -0
- package/src/components/DCRReviewPerspectiveView/index.ts +1 -0
- package/src/components/DCRReviewPerspectiveView/styles.ts +33 -0
- package/src/components/EntityMapView/EntityMapView.tsx +64 -0
- package/src/components/EntityMapView/__tests__/EntityMapView.spec.js +121 -0
- package/src/components/EntityMapView/styles.ts +20 -0
- package/src/components/EntityMapView/useMarkers.ts +27 -0
- package/src/components/HierarchyPathsView/ConfigContext.ts +4 -0
- package/src/components/HierarchyPathsView/HierarchyPathsHeader.tsx +32 -0
- package/src/components/HierarchyPathsView/HierarchyPathsView.tsx +90 -0
- package/src/components/HierarchyPathsView/Node.tsx +62 -0
- package/src/components/HierarchyPathsView/__tests__/HierarchyPathsView.test.tsx +547 -0
- package/src/components/HierarchyPathsView/__tests__/IntegrationHierarchyPathsView.test.tsx +47 -0
- package/src/components/HierarchyPathsView/__tests__/Node.test.tsx +152 -0
- package/src/components/HierarchyPathsView/__tests__/data/metadata.data.ts +33 -0
- package/src/components/HierarchyPathsView/__tests__/data/store.data.ts +37 -0
- package/src/components/HierarchyPathsView/__tests__/data/treePaths.data.ts +63 -0
- package/src/components/HierarchyPathsView/defaultTypeIcon.png +0 -0
- package/src/components/HierarchyPathsView/helpers.ts +3 -0
- package/src/components/HierarchyPathsView/hooks/useDynamicNodesHeights.ts +33 -0
- package/src/components/HierarchyPathsView/hooks/useLoadPaths.ts +76 -0
- package/src/components/HierarchyPathsView/icons/ShowGraph.svg +10 -0
- package/src/components/HierarchyPathsView/index.ts +1 -0
- package/src/components/HierarchyPathsView/styles.ts +60 -0
- package/src/components/HierarchyPathsView/theme/__tests__/node-content-renderer.test.tsx +78 -0
- package/src/components/HierarchyPathsView/theme/__tests__/tree-node-data-renderer.test.tsx +72 -0
- package/src/components/HierarchyPathsView/theme/index.ts +8 -0
- package/src/components/HierarchyPathsView/theme/node-content-renderer.tsx +84 -0
- package/src/components/HierarchyPathsView/theme/styles.ts +102 -0
- package/src/components/HierarchyPathsView/theme/tree-node-data-renderer.tsx +70 -0
- package/src/components/HierarchyPathsView/types.ts +17 -0
- package/src/components/ImageAttributeView/ImageAttributeView.tsx +87 -0
- package/src/components/ImageAttributeView/ImageAttributeViewEditableContent/ImageAttributeViewEditableContent.tsx +52 -0
- package/src/components/ImageAttributeView/ImageAttributeViewEditableContent/__tests__/ImageAttributeViewEditableContent.test.tsx +136 -0
- package/src/components/ImageAttributeView/ImageLineCaption/ImageLineCaption.tsx +18 -0
- package/src/components/ImageAttributeView/ImageLineCaption/__tests__/ImageLineCaption.test.tsx +15 -0
- package/src/components/ImageAttributeView/ImageLineCaption/styles.ts +10 -0
- package/src/components/ImageAttributeView/__tests__/ImageAttributeView.test.tsx +151 -0
- package/src/components/ImageAttributeView/__tests__/IntegrationImageAttributeView.test.tsx +36 -0
- package/src/components/ImageAttributeView/__tests__/data/store.data.ts +22 -0
- package/src/components/ImageAttributeView/styles.ts +13 -0
- package/src/components/Notifications/Notification.tsx +98 -0
- package/src/components/Notifications/Notifications.tsx +17 -0
- package/src/components/Notifications/__tests__/Notification.spec.tsx +230 -0
- package/src/components/Notifications/__tests__/Notifications.spec.tsx +37 -0
- package/src/components/Notifications/index.ts +1 -0
- package/src/components/Notifications/styles.ts +17 -0
- package/src/components/Notifications/types.ts +21 -0
- package/src/components/PerspectiveProfileBand/PerspectiveProfileBand.tsx +304 -0
- package/src/components/PerspectiveProfileBand/__tests__/PerspectiveProfileBand.specs.tsx +526 -0
- package/src/components/PerspectiveProfileBand/__tests__/data/collaboration.data.ts +23 -0
- package/src/components/PerspectiveProfileBand/__tests__/data/store.data.ts +162 -0
- package/src/components/PerspectiveProfileBand/copy.svg +14 -0
- package/src/components/PerspectiveProfileBand/hooks/useCloneAction.ts +94 -0
- package/src/components/PerspectiveProfileBand/index.ts +1 -0
- package/src/components/PerspectiveProfileBand/styles.ts +27 -0
- package/src/components/PerspectiveProfileBand/suggest.svg +16 -0
- package/src/components/ProfileAttributesView/ProfileAttributesView.tsx +21 -0
- package/src/components/ProfileAttributesView/__tests__/ProfileAttributesView.test.tsx +70 -0
- package/src/components/ProfileErrorsPanel/ProfileErrorsPanel.tsx +70 -0
- package/src/components/ProfileErrorsPanel/__tests__/ProfileErrorsPanel.specs.tsx +140 -0
- package/src/components/ProfileErrorsPanel/components/Error.tsx +50 -0
- package/src/components/ProfileErrorsPanel/components/ErrorsPanel.tsx +65 -0
- package/src/components/ProfileErrorsPanel/components/__tests__/Error.specs.tsx +264 -0
- package/src/components/ProfileErrorsPanel/components/__tests__/ErrorsPanel.specs.tsx +93 -0
- package/src/components/ProfileErrorsPanel/helpers.ts +45 -0
- package/src/components/ProfileErrorsPanel/icons/hyperlink.svg +4 -0
- package/src/components/ProfileErrorsPanel/index.ts +1 -0
- package/src/components/ProfileErrorsPanel/styles.ts +100 -0
- package/src/components/ProfileErrorsPanel/useCachedErrors.ts +11 -0
- package/src/components/ProfileLayout/ProfileLayout.tsx +56 -0
- package/src/components/ProfileLayout/__tests__/ProfileLayout.specs.tsx +56 -0
- package/src/components/ProfileLayout/index.ts +1 -0
- package/src/components/ProfileLayout/styles.ts +19 -0
- package/src/components/ProfileLayoutItem/ProfileLayoutItem.tsx +89 -0
- package/src/components/ProfileLayoutItem/__tests__/ProfileLayoutItem.test.tsx +165 -0
- package/src/components/ProfileLayoutItem/__tests__/data/store.data.ts +29 -0
- package/src/components/ProfileLayoutItem/index.ts +1 -0
- package/src/components/ProfileLayoutItem/styles.ts +13 -0
- package/src/components/ProfilePerspectiveResizablePanes/ProfilePerspectiveResizablePanes.tsx +34 -0
- package/src/components/ProfilePerspectiveResizablePanes/styles.ts +9 -0
- package/src/components/ProfilePerspectiveView/ProfilePerspectiveView.tsx +193 -0
- package/src/components/ProfilePerspectiveView/__tests__/IntegrationProfilePerspective.test.tsx +417 -0
- package/src/components/ProfilePerspectiveView/__tests__/ProfilePerspectiveView.specs.tsx +1503 -0
- package/src/components/ProfilePerspectiveView/__tests__/data/entities.data.ts +19 -0
- package/src/components/ProfilePerspectiveView/__tests__/data/entity.data.ts +25 -0
- package/src/components/ProfilePerspectiveView/__tests__/data/metadata.data.ts +33 -0
- package/src/components/ProfilePerspectiveView/__tests__/data/profile.data.ts +22 -0
- package/src/components/ProfilePerspectiveView/__tests__/data/store.data.ts +51 -0
- package/src/components/ProfilePerspectiveView/hooks/data/backgroundUpdateDalay.ts +2 -0
- package/src/components/ProfilePerspectiveView/hooks/useBackgroundProcessIndicator.ts +121 -0
- package/src/components/ProfilePerspectiveView/hooks/useProfileLayout.ts +101 -0
- package/src/components/ProfilePerspectiveView/hooks/useProfileRightSidePanelElements.tsx +167 -0
- package/src/components/ProfilePerspectiveView/hooks/useWorkflowTasks.ts +15 -0
- package/src/components/ProfilePerspectiveView/index.ts +1 -0
- package/src/components/ProfilePerspectiveView/styles.ts +38 -0
- package/src/components/ProfilePotentialMatchesView/ActionButtons.tsx +39 -0
- package/src/components/ProfilePotentialMatchesView/MatchCard.tsx +53 -0
- package/src/components/ProfilePotentialMatchesView/ProfilePotentialMatchesView.tsx +137 -0
- package/src/components/ProfilePotentialMatchesView/__tests__/ActionButtons.specs.tsx +89 -0
- package/src/components/ProfilePotentialMatchesView/__tests__/MatchCard.specs.tsx +62 -0
- package/src/components/ProfilePotentialMatchesView/__tests__/ProfilePotentialMatchesView.specs.tsx +267 -0
- package/src/components/ProfilePotentialMatchesView/__tests__/commonData.ts +91 -0
- package/src/components/ProfilePotentialMatchesView/styles.ts +30 -0
- package/src/components/ProfileRelationsView/ProfileRelationsView.tsx +24 -0
- package/src/components/ProfileRelationsView/__tests__/ProfileRelationsView.test.tsx +112 -0
- package/src/components/ProfileRelationsView/components/EditableRelationItem/EditableRelationItem.tsx +133 -0
- package/src/components/ProfileRelationsView/components/EditableRelationItem/__tests__/EditableRelationItem.specs.tsx +222 -0
- package/src/components/ProfileRelationsView/components/EditableRelationItem/styles.ts +59 -0
- package/src/components/ProfileRelationsView/components/RelationArrowButton/RelationArrowButton.tsx +29 -0
- package/src/components/ProfileRelationsView/components/RelationArrowButton/__tests__/RelationArrowButton.specs.tsx +99 -0
- package/src/components/ProfileRelationsView/components/RelationArrowButton/styles.ts +8 -0
- package/src/components/ProfileRelationsView/components/RelationTooltip/RelationTooltip.tsx +83 -0
- package/src/components/ProfileRelationsView/components/RelationTooltip/__tests__/RelationTooltip.test.tsx +155 -0
- package/src/components/ProfileRelationsView/components/RelationTooltip/styles.ts +27 -0
- package/src/components/ProfileRelationsView/components/RelationsContent/RelationsContent.tsx +62 -0
- package/src/components/ProfileRelationsView/components/RelationsContent/__tests__/RelationsContent.specs.tsx +148 -0
- package/src/components/ProfileRelationsView/components/RelationsContent/styles.ts +15 -0
- package/src/components/ProfileRelationsView/components/RelationsEditableContent/RelationsEditableContent.tsx +153 -0
- package/src/components/ProfileRelationsView/components/RelationsEditableContent/__tests__/RelationsEditableContent.specs.tsx +367 -0
- package/src/components/ProfileRelationsView/components/RelationsEditableContent/styles.ts +28 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/FilterButton/FilterButton.tsx +113 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/FilterButton/styles.ts +43 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/ImportFromDT.tsx +65 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/MultipleImportIcon.tsx +23 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/__tests__/ImportFromDT.test.tsx +500 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/__tests__/MultipleImportIcon.test.tsx +20 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/hooks/useImportFromDTLoader.ts +84 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/ImportFromDT/styles.ts +37 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/RelationsHeader.tsx +39 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/__tests__/RelationsHeader.test.tsx +82 -0
- package/src/components/ProfileRelationsView/components/RelationsHeader/styles.ts +18 -0
- package/src/components/ProfileRelationsView/components/RelationsList/Ratings/Ratings.tsx +60 -0
- package/src/components/ProfileRelationsView/components/RelationsList/Ratings/__tests__/Ratings.test.tsx +64 -0
- package/src/components/ProfileRelationsView/components/RelationsList/Ratings/styles.ts +48 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RatingsButtons/RatingsButtons.tsx +74 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RatingsButtons/__tests__/RatingsButtons.test.tsx +72 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RatingsButtons/styles.ts +20 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RatingsPopup/RatingsPopup.tsx +109 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RatingsPopup/__tests__/RatingsPopup.test.tsx +106 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RatingsPopup/styles.ts +133 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RelationAttributes/RelationAttributes.tsx +81 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RelationAttributes/__tests__/RelationAttributes.test.tsx +218 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RelationAttributes/styles.ts +12 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RelationCompexItem/RelationComplexItem.tsx +129 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RelationCompexItem/__tests__/RelationComplexItem.test.tsx +303 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RelationCompexItem/styles.ts +51 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RelationItem/RelationItem.tsx +103 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RelationItem/__tests__/RelationItem.test.tsx +222 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RelationItem/styles.ts +72 -0
- package/src/components/ProfileRelationsView/components/RelationsList/RelationsList.tsx +69 -0
- package/src/components/ProfileRelationsView/components/RelationsList/ShowDetailsButton/ShowDetailsButton.tsx +28 -0
- package/src/components/ProfileRelationsView/components/RelationsList/ShowDetailsButton/__tests__/ShowDetailsButton.test.tsx +33 -0
- package/src/components/ProfileRelationsView/components/RelationsList/__tests__/RelationsList.test.tsx +143 -0
- package/src/components/ProfileRelationsView/components/RelationsView/RelationsView.tsx +108 -0
- package/src/components/ProfileRelationsView/components/RelationsView/__tests__/RelationsView.test.tsx +183 -0
- package/src/components/ProfileRelationsView/components/RelationsView/index.ts +1 -0
- package/src/components/ProfileRelationsView/components/RelationsView/styles.ts +22 -0
- package/src/components/ProfileRelationsView/components/SecondLevelWrapper/SecondLevelWrapper.tsx +66 -0
- package/src/components/ProfileRelationsView/components/SecondLevelWrapper/__tests__/SecondLevelWrapper.test.tsx +234 -0
- package/src/components/ProfileRelationsView/components/SecondLevelWrapper/styles.ts +12 -0
- package/src/components/ProfileRelationsView/components/SuggestedButtons/SuggestedButtons.tsx +23 -0
- package/src/components/ProfileRelationsView/components/SuggestedButtons/__tests__/SuggestedButtons.test.tsx +33 -0
- package/src/components/ProfileRelationsView/components/SuggestedButtons/styles.ts +7 -0
- package/src/components/ProfileRelationsView/contexts/ImportDTContext.ts +7 -0
- package/src/components/ProfileRelationsView/contexts/RelationsViewStateContext.ts +6 -0
- package/src/components/ProfileRelationsView/helpers/__tests__/filters.test.tsx +10 -0
- package/src/components/ProfileRelationsView/helpers/__tests__/ratings.test.ts +92 -0
- package/src/components/ProfileRelationsView/helpers/__tests__/relation.test.tsx +27 -0
- package/src/components/ProfileRelationsView/helpers/filters.ts +17 -0
- package/src/components/ProfileRelationsView/helpers/permissions.ts +17 -0
- package/src/components/ProfileRelationsView/helpers/ratings.ts +35 -0
- package/src/components/ProfileRelationsView/helpers/relation.ts +15 -0
- package/src/components/ProfileRelationsView/hooks/useRelationInfo.ts +25 -0
- package/src/components/ProfileRelationsView/hooks/useRelationsState.ts +92 -0
- package/src/components/ProfileRelationsView/hooks/useSecondLevelConnections.ts +76 -0
- package/src/components/ProfileRelationsView/hooks/useSuggestedRelations.ts +54 -0
- package/src/components/ProfileSingleAttributeView/ProfileSingleAttributeView.tsx +20 -0
- package/src/components/ProfileSingleAttributeView/__tests__/IntegrationProfileSingleAttribute.test.tsx +368 -0
- package/src/components/ProfileSingleAttributeView/__tests__/ProfileSingleAttributeView.test.tsx +933 -0
- package/src/components/ProfileSingleAttributeView/__tests__/data/metadata.data.ts +103 -0
- package/src/components/ProfileSingleAttributeView/__tests__/data/store.data.ts +42 -0
- package/src/components/ProfileSingleAttributeView/components/FilterButton/FilterButton.tsx +63 -0
- package/src/components/ProfileSingleAttributeView/components/FilterButton/__tests__/FilterButton.spec.tsx +93 -0
- package/src/components/ProfileSingleAttributeView/components/FilterButton/styles.ts +27 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeEditableContent/SingleAttributeEditableContent.tsx +204 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeEditableContent/__tests__/SingleAttributeEditableContent.specs.tsx +559 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeEditableContent/styles.ts +28 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeHeader/SingleAttributeHeader.tsx +58 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeHeader/__tests__/SingleAttributeHeader.test.tsx +188 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeHeader/styles.ts +21 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeReadableContent/SingleAttributeReadableContent.tsx +31 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeReadableContent/__tests__/SingleAttributeReadableContent.spec.tsx +42 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeReadableContent/styles.ts +9 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeView/SingleAttributeView.tsx +90 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeView/__tests__/SingleAttributeView.test.tsx +346 -0
- package/src/components/ProfileSingleAttributeView/components/SingleAttributeView/styles.ts +22 -0
- package/src/components/ProfileSingleAttributeView/contexts/SingleAttributeContext.ts +20 -0
- package/src/components/ProfileSingleAttributeView/hooks/useSingleAttribute.ts +25 -0
- package/src/components/ProfileSingleAttributeView/styles.ts +26 -0
- package/src/components/ProfileTableAttributeView/ProfileTableAttributeView.tsx +20 -0
- package/src/components/ProfileTableAttributeView/__tests__/IntegrationProfileTableAttributeView.test.tsx +278 -0
- package/src/components/ProfileTableAttributeView/__tests__/ProfileTableAttributeView.test.tsx +744 -0
- package/src/components/ProfileTableAttributeView/__tests__/data/metadata.data.ts +141 -0
- package/src/components/ProfileTableAttributeView/__tests__/data/store.data.ts +48 -0
- package/src/components/ProfileTableAttributeView/components/AttributeEditing/AttributeEditing.tsx +97 -0
- package/src/components/ProfileTableAttributeView/components/AttributeEditing/__tests__/AttributeEditing.test.tsx +409 -0
- package/src/components/ProfileTableAttributeView/components/AttributeEditing/styles.ts +17 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/AttributeTable.tsx +171 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/EditButtons.tsx +28 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/__tests__/AttributeTable.test.tsx +431 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/__tests__/EditButtons.test.tsx +54 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/BlobRenderer.tsx +20 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/DefaultCellValueRenderer.tsx +43 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/HeadCellRenderer.tsx +19 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/RowCellRenderer.tsx +33 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/__tests__/BlobRenderer.test.tsx +29 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/__tests__/DefaultCellValueRenderer.test.tsx +149 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/styles.ts +61 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTable/styles.ts +21 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTableHeader/AttributeTableHeader.tsx +53 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTableHeader/__tests__/AttributeTableHeader.test.tsx +96 -0
- package/src/components/ProfileTableAttributeView/components/AttributeTableHeader/styles.ts +7 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeContent/TableAttributeContent.tsx +123 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeContent/__tests__/TableAttributeContent.test.tsx +600 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeContent/hooks/useEditableAttribute.ts +212 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeEditableContent/TableAttributeEditableContent.tsx +96 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeEditableContent/__tests__/TableAttributeEditableContent.test.tsx +450 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeEditableContent/hooks/__tests__/useExpandAttributes.test.tsx +92 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeEditableContent/hooks/useExpandAttributes.ts +88 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeEditableContent/styles.ts +21 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeView/TableAttributeView.tsx +64 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeView/__tests__/TableAttributeView.test.tsx +139 -0
- package/src/components/ProfileTableAttributeView/components/TableAttributeView/styles.ts +20 -0
- package/src/components/ProfileTableAttributeView/components/types.ts +16 -0
- package/src/components/ProfileTableAttributeView/contexts/TableAttributeContext.tsx +34 -0
- package/src/components/ProfileTableAttributeView/helpers/tableAttributeHelpers.ts +72 -0
- package/src/components/ProfileTableAttributeView/hooks/__tests__/helpers.test.ts +97 -0
- package/src/components/ProfileTableAttributeView/hooks/helpers.ts +13 -0
- package/src/components/ProfileTableAttributeView/hooks/reducer.ts +19 -0
- package/src/components/ProfileTableAttributeView/hooks/useTableAttribute.ts +77 -0
- package/src/components/RightSidePanel/RightSidePanel.tsx +43 -0
- package/src/components/RightSidePanel/__tests__/RightSidePanel.spec.tsx +149 -0
- package/src/components/RightSidePanel/components/CollaborationButton/CollaborationButton.tsx +22 -0
- package/src/components/RightSidePanel/components/CollaborationButton/__tests__/CollaborationButton.spec.tsx +24 -0
- package/src/components/RightSidePanel/components/CollaborationList/CollaborationList.tsx +56 -0
- package/src/components/RightSidePanel/components/CollaborationList/__tests__/CollaborationList.spec.tsx +104 -0
- package/src/components/RightSidePanel/components/CollaborationList/styles.ts +15 -0
- package/src/components/RightSidePanel/components/CollaborationPanelEmptyState/CollaborationPanelEmptyState.tsx +14 -0
- package/src/components/RightSidePanel/components/CollaborationPanelEmptyState/__tests__/CollaborationPanelEmptyState.specs.tsx +16 -0
- package/src/components/RightSidePanel/components/DBConnectorsList/DBConnectorsList.tsx +19 -0
- package/src/components/RightSidePanel/components/DBConnectorsList/__tests__/DBConnectorsList.spec.tsx +42 -0
- package/src/components/RightSidePanel/components/DBConnectorsList/styles.ts +12 -0
- package/src/components/RightSidePanel/components/WorkflowButton/WorkflowButton.tsx +21 -0
- package/src/components/RightSidePanel/components/WorkflowButton/__tests__/WorkflowButton.spec.tsx +23 -0
- package/src/components/RightSidePanel/components/WorkflowList/WorkflowList.tsx +18 -0
- package/src/components/RightSidePanel/components/WorkflowList/__tests__/WorkflowList.spec.tsx +46 -0
- package/src/components/RightSidePanel/components/WorkflowList/styles.ts +9 -0
- package/src/components/RightSidePanel/components/WorkflowPanelEmptyState/WorkflowPanelEmptyState.tsx +14 -0
- package/src/components/RightSidePanel/components/WorkflowPanelEmptyState/__tests__/WorkflowPanelEmptyState.specs.tsx +17 -0
- package/src/components/RightSidePanel/icons/CollaborationIcon.svg +18 -0
- package/src/components/RightSidePanel/icons/ConnectorsIcon.svg +3 -0
- package/src/components/RightSidePanel/styles.ts +21 -0
- package/src/components/Sandbox/CustomView.tsx +59 -0
- package/src/components/Sandbox/__tests__/CustomView.test.tsx +294 -0
- package/src/components/Sandbox/styles.ts +10 -0
- package/src/components/TagPerspectiveView/TagPerspectiveView.tsx +79 -0
- package/src/components/TagPerspectiveView/__tests__/TagPerspectiveView.test.tsx +146 -0
- package/src/components/TagPerspectiveView/components/TagListHeader/TagListHeader.tsx +48 -0
- package/src/components/TagPerspectiveView/components/TagListHeader/__tests__/TagListHeader.test.tsx +60 -0
- package/src/components/TagPerspectiveView/components/TagListHeader/index.ts +1 -0
- package/src/components/TagPerspectiveView/components/TagListHeader/styles.ts +36 -0
- package/src/components/TagPerspectiveView/components/TagProfileBand/TagProfileBand.tsx +21 -0
- package/src/components/TagPerspectiveView/components/TagProfileBand/__tests__/TagProfileBand.test.tsx +14 -0
- package/src/components/TagPerspectiveView/components/TagProfileBand/index.ts +1 -0
- package/src/components/TagPerspectiveView/components/TagProfileBand/styles.ts +24 -0
- package/src/components/TagPerspectiveView/hooks/__tests__/useTag.test.tsx +166 -0
- package/src/components/TagPerspectiveView/hooks/__tests__/useTagsProvider.test.tsx +208 -0
- package/src/components/TagPerspectiveView/hooks/useTag.ts +48 -0
- package/src/components/TagPerspectiveView/hooks/useTagsProvider.ts +83 -0
- package/src/components/TagPerspectiveView/index.ts +1 -0
- package/src/components/TagPerspectiveView/styles.ts +43 -0
- package/src/components/hooks/helpers/__tests__/helpers.test.ts +688 -0
- package/src/components/hooks/helpers/index.ts +77 -0
- package/src/components/hooks/useProfileValidation.ts +30 -0
- package/src/components/hooks/useSingleAttributeLoader.ts +164 -0
- package/src/components/views/HOCs/styles.ts +37 -0
- package/src/components/views/HOCs/withDragHandle.tsx +26 -0
- package/src/components/views/HOCs/withErrorBoundary.tsx +27 -0
- package/src/components/views/StubView.tsx +18 -0
- package/src/components/views/ViewComponent.tsx +25 -0
- package/src/components/views/ViewsFactory.tsx +143 -0
- package/src/components/views/__tests__/ViewComponent.specs.tsx +47 -0
- package/src/components/views/__tests__/ViewsFactory.specs.tsx +256 -0
- package/src/components/views/styles.ts +16 -0
- package/src/perspectives/DCRReviewPerspective.tsx +51 -0
- package/src/perspectives/ProfilePerspective.tsx +104 -0
- package/src/perspectives/TagPerspective.tsx +42 -0
- package/src/perspectives/__tests__/DCRReviewPerspective.spec.tsx +54 -0
- package/src/perspectives/__tests__/ProfilePerspective.spec.tsx +76 -0
- package/src/perspectives/__tests__/helpers.spec.ts +131 -0
- package/src/perspectives/helpers.ts +29 -0
- package/src/types/index.ts +9 -0
- package/stories/Profile.stories.tsx +35 -0
- package/stories/utils/entity.ts +80 -0
- package/stories/utils/hierarchyTree/config.ts +13 -0
- package/stories/utils/hierarchyTree/hopsResponse.ts +182 -0
- package/stories/utils/hierarchyTree/treeResponse.ts +412 -0
- package/stories/utils/mdmStore.ts +64 -0
- package/stories/utils/metadata.ts +701 -0
- package/stories/utils/profilePerspectiveConfig.ts +95 -0
- package/stories/utils/relationsTableView/config.ts +18 -0
- package/stories/utils/relationsTableView/connections.ts +647 -0
- package/stories/utils/responses.ts +62 -0
- package/tsconfig.json +4 -0
- package/webpack.config.js +10 -0
- package/bundle.js +0 -2
- /package/{5271a9e7b6651c852e93.png → public/5271a9e7b6651c852e93.png} +0 -0
- /package/{main.css → public/main.css} +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as reactRedux from 'react-redux';
|
|
3
|
+
import {render, screen, fireEvent} from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import * as mdmSdk from '@reltio/mdm-sdk';
|
|
6
|
+
import {ui} from '@reltio/mdm-module';
|
|
7
|
+
import {UrlGeneratorsContext} from '@reltio/components';
|
|
8
|
+
import {Node} from '../Node';
|
|
9
|
+
import {ConfigContext} from '../ConfigContext';
|
|
10
|
+
import DEFAULT_ICON from '../defaultTypeIcon.png';
|
|
11
|
+
|
|
12
|
+
const {ProfileViewTypes} = mdmSdk;
|
|
13
|
+
|
|
14
|
+
jest.mock('@reltio/mdm-sdk', () => ({
|
|
15
|
+
...jest.requireActual<Record<string, unknown>>('@reltio/mdm-sdk'),
|
|
16
|
+
getEntity: jest.fn()
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
const config = {
|
|
20
|
+
id: 'com.reltio.plugins.entity.HierarchyPathsView.78fe-51a8-c9d00c59',
|
|
21
|
+
class: ProfileViewTypes.HierarchyPaths,
|
|
22
|
+
caption: 'caption',
|
|
23
|
+
graph: {
|
|
24
|
+
type: 'configuration/graphTypes/PharmaCompanyHierarchy'
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const entity = {
|
|
29
|
+
uri: 'entities/1HonRdLo',
|
|
30
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
31
|
+
label: 'NATALINE DILCHAND',
|
|
32
|
+
secondaryLabel: 'secondary label'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const node = {
|
|
36
|
+
entity,
|
|
37
|
+
nodeId: 31,
|
|
38
|
+
expanded: false,
|
|
39
|
+
root: false,
|
|
40
|
+
children: []
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const setUp = (ui) => {
|
|
44
|
+
const user = userEvent.setup();
|
|
45
|
+
const generateEntityUrl = ({uri, screen = 'profile'}) => `nui/aleant/${screen}?entityUri=${uri}`;
|
|
46
|
+
const urlGenerators = {generateEntityUrl};
|
|
47
|
+
|
|
48
|
+
const Providers = ({children}: {children: React.ReactNode}) => {
|
|
49
|
+
return (
|
|
50
|
+
<UrlGeneratorsContext.Provider value={urlGenerators}>
|
|
51
|
+
<ConfigContext.Provider value={config}>{children}</ConfigContext.Provider>
|
|
52
|
+
</UrlGeneratorsContext.Provider>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return {user, ...render(ui, {wrapper: Providers})};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
describe('Node', () => {
|
|
60
|
+
const dispatch = jest.fn();
|
|
61
|
+
let store;
|
|
62
|
+
|
|
63
|
+
beforeEach(() => {
|
|
64
|
+
store = {
|
|
65
|
+
metadata: {
|
|
66
|
+
sokol: {
|
|
67
|
+
entityTypes: [
|
|
68
|
+
{
|
|
69
|
+
uri: 'configuration/entityTypes/OrganizationM',
|
|
70
|
+
typeGraphIcon: 'images/graphIcon/Client.png'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
uri: 'configuration/entityTypes/HCP'
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
tenant: {
|
|
79
|
+
id: 'sokol'
|
|
80
|
+
},
|
|
81
|
+
profile: {entity},
|
|
82
|
+
ui: {
|
|
83
|
+
paths: {
|
|
84
|
+
uiPath: 'http://localhost:3000/ui/sokol/',
|
|
85
|
+
imagePath: 'https://s3.amazonaws.com/reltio.images/api'
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
jest.spyOn(mdmSdk, 'getEntity').mockResolvedValue(entity);
|
|
90
|
+
jest.spyOn(reactRedux, 'useDispatch').mockReturnValue(dispatch);
|
|
91
|
+
jest.spyOn(reactRedux, 'useSelector').mockImplementation((selector) => selector(store));
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
afterEach(() => {
|
|
95
|
+
jest.clearAllMocks();
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('should show entityTypeGraphIcon if entityType has it', () => {
|
|
99
|
+
setUp(<Node node={node} />);
|
|
100
|
+
const expectedImageSrc = 'https://s3.amazonaws.com/reltio.images/api/images/graphIcon/Client.png';
|
|
101
|
+
expect(screen.getByAltText('Node icon')).toHaveAttribute('src', expectedImageSrc);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('should show default pic if an error occurred during the download image', () => {
|
|
105
|
+
setUp(<Node node={node} />);
|
|
106
|
+
fireEvent.error(screen.getByAltText('Node icon'));
|
|
107
|
+
expect(screen.getByAltText('Node icon')).toHaveAttribute('src', DEFAULT_ICON);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('should show default pic if entityType has not typeGraphIcon', () => {
|
|
111
|
+
const newEntity = {...entity, type: 'configuration/entityTypes/HCP', uri: 'entities/123'};
|
|
112
|
+
const newNode = {...node, entity: newEntity};
|
|
113
|
+
store.profile.entity = newEntity;
|
|
114
|
+
setUp(<Node node={newNode} />);
|
|
115
|
+
expect(screen.getByAltText('Node icon')).toHaveAttribute('src', DEFAULT_ICON);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('should show popup with entity details on hover on title', async () => {
|
|
119
|
+
const {user} = setUp(<Node node={node} />);
|
|
120
|
+
await user.hover(screen.getByText('NATALINE DILCHAND'));
|
|
121
|
+
await screen.findByRole('tooltip');
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('should display anchor with correct title and link', () => {
|
|
125
|
+
setUp(<Node node={node} />);
|
|
126
|
+
expect(screen.getByRole('link')).toHaveTextContent('NATALINE DILCHAND');
|
|
127
|
+
expect(screen.getByRole('link')).toHaveAttribute('href', 'nui/aleant/profile?entityUri=entities/1HonRdLo');
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('should call dispatch with correct payload', async () => {
|
|
131
|
+
const {user} = setUp(<Node node={node} />);
|
|
132
|
+
await user.click(screen.getByRole('link'));
|
|
133
|
+
expect(dispatch).toHaveBeenCalledWith(ui.actions.openEntity({uri: entity.uri, viewId: config.id}));
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('should select title if node uri is equal to current entity uri', () => {
|
|
137
|
+
setUp(<Node node={node} />);
|
|
138
|
+
expect(screen.getByTestId('reltio-hierarchy-node-title')).toHaveClass('selected');
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('should not select title if node uri is not equal to current entity uri', () => {
|
|
142
|
+
const newNode = {...node, entity: {...node.entity, uri: 'entities/other'}};
|
|
143
|
+
setUp(<Node node={newNode} />);
|
|
144
|
+
expect(screen.getByTestId('reltio-hierarchy-node-title')).not.toHaveClass('selected');
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it('should set <No label> title if there is no label in the entity', () => {
|
|
148
|
+
const newNode = {...node, entity: {...node.entity, label: ''}};
|
|
149
|
+
setUp(<Node node={newNode} />);
|
|
150
|
+
expect(screen.getByRole('link')).toHaveTextContent('<No label>');
|
|
151
|
+
});
|
|
152
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const getMetadata = ({tenant}) => ({
|
|
2
|
+
[tenant]: {
|
|
3
|
+
uri: 'configuration',
|
|
4
|
+
entityTypes: [
|
|
5
|
+
{
|
|
6
|
+
uri: 'configuration/entityTypes/HCP',
|
|
7
|
+
attributes: [
|
|
8
|
+
{
|
|
9
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested',
|
|
10
|
+
name: 'FirstLevelNested',
|
|
11
|
+
type: 'Nested',
|
|
12
|
+
attributes: [
|
|
13
|
+
{
|
|
14
|
+
label: 'FirstLevelNestedSub1_HCP',
|
|
15
|
+
name: 'FirstLevelNestedSub1',
|
|
16
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested/attributes/FirstLevelNestedSub1',
|
|
17
|
+
type: 'String',
|
|
18
|
+
required: true
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
uri: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
24
|
+
name: 'CountryCode',
|
|
25
|
+
type: 'String'
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
analyticsAttributes: []
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
relationTypes: []
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {Mode} from '@reltio/mdm-sdk';
|
|
2
|
+
import {getMetadata} from './metadata.data';
|
|
3
|
+
|
|
4
|
+
export const createInitialState = ({mode = Mode.Viewing} = {}) => {
|
|
5
|
+
const tenant = 't1';
|
|
6
|
+
return {
|
|
7
|
+
metadata: getMetadata({tenant}),
|
|
8
|
+
profile: {
|
|
9
|
+
entity: {
|
|
10
|
+
uri: 'entities/1HonRdLo',
|
|
11
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
12
|
+
label: 'NATALINE DILCHAND'
|
|
13
|
+
},
|
|
14
|
+
modifiedEntities: {},
|
|
15
|
+
views: [],
|
|
16
|
+
history: {},
|
|
17
|
+
mode
|
|
18
|
+
},
|
|
19
|
+
tenant: {
|
|
20
|
+
id: tenant
|
|
21
|
+
},
|
|
22
|
+
ui: {
|
|
23
|
+
paths: {
|
|
24
|
+
apiPath: 'https://tst-01.reltio.com/reltio'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
search: {
|
|
28
|
+
searchOptions: {
|
|
29
|
+
searchByOv: true,
|
|
30
|
+
ovOnly: true
|
|
31
|
+
},
|
|
32
|
+
globalFilter: {
|
|
33
|
+
query: null
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const createTreePaths = () => {
|
|
2
|
+
return {
|
|
3
|
+
entities: {
|
|
4
|
+
'entities/1HonRdLo': {
|
|
5
|
+
uri: 'entities/1HonRdLo',
|
|
6
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
7
|
+
label: 'NATALINE DILCHAND'
|
|
8
|
+
},
|
|
9
|
+
'entities/1WFdeovr': {
|
|
10
|
+
uri: 'entities/1WFdeovr',
|
|
11
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
12
|
+
label: 'MainRoot Test 100 levels'
|
|
13
|
+
},
|
|
14
|
+
'entities/1WFdfAF9': {
|
|
15
|
+
uri: 'entities/1WFdfAF9',
|
|
16
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
17
|
+
label: 'PHILIS AURELIO\r'
|
|
18
|
+
},
|
|
19
|
+
'entities/1WFdf1id': {
|
|
20
|
+
uri: 'entities/1WFdf1id',
|
|
21
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
22
|
+
label: 'JANINE GSTOHL\r'
|
|
23
|
+
},
|
|
24
|
+
'entities/pO7S74k': {
|
|
25
|
+
uri: 'entities/pO7S74k',
|
|
26
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
27
|
+
label: 'Name_0_1'
|
|
28
|
+
},
|
|
29
|
+
'entities/1WFdfEVP': {
|
|
30
|
+
uri: 'entities/1WFdfEVP',
|
|
31
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
32
|
+
label: 'AME HANINGTON\r'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
parentPaths: [
|
|
36
|
+
[
|
|
37
|
+
{
|
|
38
|
+
entityUri: 'entities/1HonRdLo'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
entityUri: 'entities/1WFdfAF9'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
entityUri: 'entities/1WFdf1id'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
entityUri: 'entities/1WFdeovr'
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
{
|
|
52
|
+
entityUri: 'entities/1HonRdLo'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
entityUri: 'entities/pO7S74k'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
entityUri: 'entities/1WFdfEVP'
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
]
|
|
62
|
+
};
|
|
63
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {useCallback, useState} from 'react';
|
|
2
|
+
import {assoc} from 'ramda';
|
|
3
|
+
|
|
4
|
+
import {theme} from '../theme';
|
|
5
|
+
import {Node} from '../types';
|
|
6
|
+
import {getNodeKey} from '../helpers';
|
|
7
|
+
|
|
8
|
+
type HeightsCache = {[nodeId: Node['nodeId']]: number};
|
|
9
|
+
|
|
10
|
+
const getCacheKey = (node: Node) => getNodeKey({node});
|
|
11
|
+
|
|
12
|
+
export const useDynamicNodesHeights = () => {
|
|
13
|
+
const [heightsCache, setHeightsCache] = useState<HeightsCache>({});
|
|
14
|
+
const clearHeightsCache = useCallback(() => {
|
|
15
|
+
setHeightsCache({});
|
|
16
|
+
}, []);
|
|
17
|
+
const onResize = useCallback(
|
|
18
|
+
(node: Node) => (_, height) => {
|
|
19
|
+
setHeightsCache((prevCache) =>
|
|
20
|
+
prevCache[getCacheKey(node)] !== height ? assoc(getCacheKey(node), height, prevCache) : prevCache
|
|
21
|
+
);
|
|
22
|
+
},
|
|
23
|
+
[]
|
|
24
|
+
);
|
|
25
|
+
const getRowHeight = useCallback(
|
|
26
|
+
({node}: {node: Node}): number =>
|
|
27
|
+
heightsCache[getCacheKey(node)]
|
|
28
|
+
? Math.max(heightsCache[getCacheKey(node)], theme.rowHeight)
|
|
29
|
+
: theme.rowHeight,
|
|
30
|
+
[heightsCache]
|
|
31
|
+
);
|
|
32
|
+
return {onResize, getRowHeight, clearHeightsCache};
|
|
33
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {useEffect, useState} from 'react';
|
|
2
|
+
import i18n from 'ui-i18n';
|
|
3
|
+
import {useSelector} from 'react-redux';
|
|
4
|
+
import mdmModule from '@reltio/mdm-module';
|
|
5
|
+
import {pick, prop} from 'ramda';
|
|
6
|
+
import {Entity, getPathsTree, getRequestErrorMessage, isTempUri, updateTreesWithNewEntity} from '@reltio/mdm-sdk';
|
|
7
|
+
import {useDidUpdateEffect, useSafePromise} from '@reltio/components';
|
|
8
|
+
import {Response, Node} from '../types';
|
|
9
|
+
|
|
10
|
+
let nodeCounter = 0;
|
|
11
|
+
export const generateId = () => nodeCounter++;
|
|
12
|
+
|
|
13
|
+
const processResponse = (response: Response) => {
|
|
14
|
+
const fakeRoot = {
|
|
15
|
+
children: [] as Node[],
|
|
16
|
+
nodeId: generateId()
|
|
17
|
+
};
|
|
18
|
+
if (response.parentPaths) {
|
|
19
|
+
for (let i = 0; i < response.parentPaths.length; i++) {
|
|
20
|
+
const path = response.parentPaths[i];
|
|
21
|
+
let nextRoot = fakeRoot;
|
|
22
|
+
for (let j = path.length - 1; j >= 0; j--) {
|
|
23
|
+
const nextParent = path[j];
|
|
24
|
+
const entity = response.entities[nextParent.entityUri];
|
|
25
|
+
const isRoot = j === path.length - 1;
|
|
26
|
+
const node: Node = {
|
|
27
|
+
entity,
|
|
28
|
+
children: [],
|
|
29
|
+
nodeId: generateId(),
|
|
30
|
+
expanded: true,
|
|
31
|
+
rootIndex: isRoot ? i + 1 : undefined
|
|
32
|
+
};
|
|
33
|
+
if (isRoot) {
|
|
34
|
+
node.root = isRoot;
|
|
35
|
+
}
|
|
36
|
+
nextRoot.children.push(node);
|
|
37
|
+
nextRoot = node;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return fakeRoot.children;
|
|
42
|
+
};
|
|
43
|
+
export const useLoadPaths = (entityUri: string, graphUri: string) => {
|
|
44
|
+
const safePromise = useSafePromise();
|
|
45
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
46
|
+
const [treeData, setTreeData] = useState<Node[]>([]);
|
|
47
|
+
const [errorMessage, setErrorMessage] = useState<string>(null);
|
|
48
|
+
const entity: Entity = useSelector(mdmModule.selectors.getEntity);
|
|
49
|
+
useDidUpdateEffect(() => {
|
|
50
|
+
const forest = treeData
|
|
51
|
+
.map((tree, index) => ({tree, index}))
|
|
52
|
+
.reduce((acc, tree) => ({...acc, [tree.index]: {root: tree.tree}}), {});
|
|
53
|
+
const newTrees = updateTreesWithNewEntity(pick(['uri', 'label', 'secondaryLabel', 'type'], entity), forest);
|
|
54
|
+
setTreeData(newTrees.map(prop('root')));
|
|
55
|
+
}, [entity?.updatedTime]);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (!isTempUri(entityUri)) {
|
|
58
|
+
setErrorMessage(null);
|
|
59
|
+
setIsLoading(true);
|
|
60
|
+
safePromise(getPathsTree({uri: entityUri, graphUri}))
|
|
61
|
+
.then(processResponse)
|
|
62
|
+
.then(setTreeData)
|
|
63
|
+
.catch((e) => {
|
|
64
|
+
console.warn(e);
|
|
65
|
+
setErrorMessage(getRequestErrorMessage(e, i18n.text('Something went wrong')));
|
|
66
|
+
})
|
|
67
|
+
.finally(() => {
|
|
68
|
+
setIsLoading(false);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return () => {
|
|
72
|
+
setTreeData([]);
|
|
73
|
+
};
|
|
74
|
+
}, [entityUri, graphUri, safePromise]);
|
|
75
|
+
return {isLoading, treeData, setTreeData, errorMessage};
|
|
76
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<!-- Generator: Sketch 46.1 (44463) - http://www.bohemiancoding.com/sketch -->
|
|
4
|
+
<title>Combined Shape</title>
|
|
5
|
+
<desc>Created with Sketch.</desc>
|
|
6
|
+
<defs></defs>
|
|
7
|
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.54">
|
|
8
|
+
<path d="M14.5,5 C13.6715729,5 13,4.32842712 13,3.5 C13,2.67157288 13.6715729,2 14.5,2 C15.3284271,2 16,2.67157288 16,3.5 C16,4.32842712 15.3284271,5 14.5,5 Z M18.5,10 C17.6715729,10 17,9.32842712 17,8.5 C17,7.67157288 17.6715729,7 18.5,7 C19.3284271,7 20,7.67157288 20,8.5 C20,9.32842712 19.3284271,10 18.5,10 Z M1.5,11 C0.671572875,11 0,10.3284271 0,9.5 C0,8.67157288 0.671572875,8 1.5,8 C2.32842712,8 3,8.67157288 3,9.5 C3,10.3284271 2.32842712,11 1.5,11 Z M4,4 C2.8954305,4 2,3.1045695 2,2 C2,0.8954305 2.8954305,0 4,0 C5.1045695,0 6,0.8954305 6,2 C6,3.1045695 5.1045695,4 4,4 Z M5,20 C3.8954305,20 3,19.1045695 3,18 C3,16.8954305 3.8954305,16 5,16 C6.1045695,16 7,16.8954305 7,18 C7,19.1045695 6.1045695,20 5,20 Z M9.5,14 C7.01471863,14 5,11.9852814 5,9.5 C5,7.01471863 7.01471863,5 9.5,5 C11.9852814,5 14,7.01471863 14,9.5 C14,11.9852814 11.9852814,14 9.5,14 Z M9.5,12 C10.8807119,12 12,10.8807119 12,9.5 C12,8.11928813 10.8807119,7 9.5,7 C8.11928813,7 7,8.11928813 7,9.5 C7,10.8807119 8.11928813,12 9.5,12 Z M15.5,17 C14.6715729,17 14,16.3284271 14,15.5 C14,14.6715729 14.6715729,14 15.5,14 C16.3284271,14 17,14.6715729 17,15.5 C17,16.3284271 16.3284271,17 15.5,17 Z" id="Combined-Shape" fill="#000000"></path>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {HierarchyPathsView} from './HierarchyPathsView';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {makeStyles} from '@mui/styles';
|
|
2
|
+
|
|
3
|
+
export const useStyles = makeStyles((theme) => ({
|
|
4
|
+
container: {
|
|
5
|
+
fontSize: '13px',
|
|
6
|
+
display: 'flex',
|
|
7
|
+
paddingTop: '6px',
|
|
8
|
+
position: 'relative'
|
|
9
|
+
},
|
|
10
|
+
title: {
|
|
11
|
+
flexGrow: 1,
|
|
12
|
+
minHeight: '15px',
|
|
13
|
+
color: theme.palette.primary.main,
|
|
14
|
+
lineHeight: '15px'
|
|
15
|
+
},
|
|
16
|
+
wrapper: {
|
|
17
|
+
width: '100%'
|
|
18
|
+
},
|
|
19
|
+
avatar: {
|
|
20
|
+
height: '16px',
|
|
21
|
+
width: '16px',
|
|
22
|
+
marginRight: '8px',
|
|
23
|
+
marginLeft: '8px'
|
|
24
|
+
},
|
|
25
|
+
header: {
|
|
26
|
+
padding: '0 4px 0 16px'
|
|
27
|
+
},
|
|
28
|
+
treeContainer: {
|
|
29
|
+
flexGrow: 1,
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
height: '100%',
|
|
33
|
+
minHeight: '372px',
|
|
34
|
+
maxHeight: '507px',
|
|
35
|
+
overflow: 'auto'
|
|
36
|
+
},
|
|
37
|
+
tree: {
|
|
38
|
+
flexGrow: 1,
|
|
39
|
+
height: 0
|
|
40
|
+
},
|
|
41
|
+
buttonsContainer: {
|
|
42
|
+
flexShrink: 0,
|
|
43
|
+
marginLeft: 'auto',
|
|
44
|
+
'& > * + *': {
|
|
45
|
+
marginLeft: '-4px'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
button: {
|
|
49
|
+
padding: '8px'
|
|
50
|
+
},
|
|
51
|
+
errorMessage: {
|
|
52
|
+
fontSize: '13px',
|
|
53
|
+
margin: '0 16px 0',
|
|
54
|
+
lineHeight: '1.4',
|
|
55
|
+
color: theme.palette.text.secondary
|
|
56
|
+
},
|
|
57
|
+
linearIndicator: {
|
|
58
|
+
top: '42px'
|
|
59
|
+
}
|
|
60
|
+
}));
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {shallow} from 'enzyme';
|
|
3
|
+
import NodeContentRenderer from '../node-content-renderer';
|
|
4
|
+
|
|
5
|
+
const node = {
|
|
6
|
+
entity: {
|
|
7
|
+
uri: 'entities/1HonRdLo',
|
|
8
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
9
|
+
label: 'NATALINE DILCHAND'
|
|
10
|
+
},
|
|
11
|
+
children: [
|
|
12
|
+
{
|
|
13
|
+
entity: {
|
|
14
|
+
uri: 'entities/child',
|
|
15
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
16
|
+
label: 'CHILD'
|
|
17
|
+
},
|
|
18
|
+
children: [],
|
|
19
|
+
nodeId: 19,
|
|
20
|
+
expanded: false,
|
|
21
|
+
root: false
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
nodeId: 31,
|
|
25
|
+
expanded: false,
|
|
26
|
+
root: false
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const setUp = (expanded = false, withChildren = true) =>
|
|
30
|
+
shallow(
|
|
31
|
+
<NodeContentRenderer
|
|
32
|
+
treeIndex={0}
|
|
33
|
+
scaffoldBlockPxWidth={16}
|
|
34
|
+
node={{...node, expanded, children: withChildren ? node.children : []}}
|
|
35
|
+
path={[1]}
|
|
36
|
+
title={<>Node</>}
|
|
37
|
+
toggleChildrenVisibility={jest.fn()}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
describe('NodeContentRenderer test', () => {
|
|
42
|
+
it('should render title', () => {
|
|
43
|
+
const component = setUp();
|
|
44
|
+
expect(component.find('.rowTitle').html()).toBe('<div class="rowTitle">Node</div>');
|
|
45
|
+
expect(component.find('.lineChildren')).toHaveLength(0);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should render line children if node expanded', () => {
|
|
49
|
+
const component = setUp(true);
|
|
50
|
+
expect(component.find('.lineChildren')).toHaveLength(1);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should render expanded button if expanded', () => {
|
|
54
|
+
const component = setUp(true);
|
|
55
|
+
expect(component.find('.buttonWrapper')).toHaveLength(1);
|
|
56
|
+
expect(component.find('.button')).toHaveLength(1);
|
|
57
|
+
expect(component.find('.expandedButton')).toHaveLength(1);
|
|
58
|
+
expect(component.find('.collapsedButton')).toHaveLength(0);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should render collapsed button if collapsed', () => {
|
|
62
|
+
const component = setUp(false);
|
|
63
|
+
expect(component.find('.buttonWrapper')).toHaveLength(1);
|
|
64
|
+
expect(component.find('.button')).toHaveLength(1);
|
|
65
|
+
expect(component.find('.collapsedButton')).toHaveLength(1);
|
|
66
|
+
expect(component.find('.expandedButton')).toHaveLength(0);
|
|
67
|
+
expect(component.find('.lineChildren')).toHaveLength(0);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('should not render lineChildren and expanded button if no children', () => {
|
|
71
|
+
const component = setUp(true, false);
|
|
72
|
+
expect(component.find('.buttonWrapper')).toHaveLength(0);
|
|
73
|
+
expect(component.find('.button')).toHaveLength(0);
|
|
74
|
+
expect(component.find('.collapsedButton')).toHaveLength(0);
|
|
75
|
+
expect(component.find('.expandedButton')).toHaveLength(0);
|
|
76
|
+
expect(component.find('.lineChildren')).toHaveLength(0);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {shallow} from 'enzyme';
|
|
3
|
+
import TreeNodeRenderer from '../tree-node-data-renderer';
|
|
4
|
+
|
|
5
|
+
const node = {
|
|
6
|
+
entity: {
|
|
7
|
+
uri: 'entities/1HonRdLo',
|
|
8
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
9
|
+
label: 'NATALINE DILCHAND'
|
|
10
|
+
},
|
|
11
|
+
children: [
|
|
12
|
+
{
|
|
13
|
+
entity: {
|
|
14
|
+
uri: 'entities/child',
|
|
15
|
+
type: 'configuration/entityTypes/OrganizationM',
|
|
16
|
+
label: 'CHILD'
|
|
17
|
+
},
|
|
18
|
+
children: [],
|
|
19
|
+
nodeId: 19,
|
|
20
|
+
expanded: false,
|
|
21
|
+
root: false
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
nodeId: 31,
|
|
25
|
+
expanded: false,
|
|
26
|
+
root: false
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const scaffoldBlockPxWidth = 16;
|
|
30
|
+
const style = {height: '28px'};
|
|
31
|
+
|
|
32
|
+
const setUp = (root = false) =>
|
|
33
|
+
shallow(
|
|
34
|
+
<TreeNodeRenderer
|
|
35
|
+
scaffoldBlockPxWidth={scaffoldBlockPxWidth}
|
|
36
|
+
node={{...node, root}}
|
|
37
|
+
lowerSiblingCounts={root ? [2] : [2, 5]}
|
|
38
|
+
style={style}
|
|
39
|
+
>
|
|
40
|
+
<>Node</>
|
|
41
|
+
</TreeNodeRenderer>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
describe('TreeNodeRenderer test', () => {
|
|
45
|
+
it('should render node, nodeContent, scaffold', () => {
|
|
46
|
+
const component = setUp();
|
|
47
|
+
expect(component.find('.node')).toHaveLength(1);
|
|
48
|
+
const scaffoldWidth = scaffoldBlockPxWidth * 2;
|
|
49
|
+
expect(component.find('.node').prop('style')).toEqual({...style, width: `${scaffoldWidth + 250}px`});
|
|
50
|
+
expect(component.find('.nodeContent')).toHaveLength(1);
|
|
51
|
+
expect(component.find('.nodeContent').prop('style')).toEqual({
|
|
52
|
+
left: scaffoldWidth,
|
|
53
|
+
width: `calc(100% - ${scaffoldWidth}px`
|
|
54
|
+
});
|
|
55
|
+
expect(component.find('.lineBlock')).toHaveLength(2);
|
|
56
|
+
expect(component.find('.verticalLine')).toHaveLength(1);
|
|
57
|
+
expect(component.find('.horizontalLineRight')).toHaveLength(1);
|
|
58
|
+
expect(component.find('.rootIndex')).toHaveLength(0);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should render root properly', () => {
|
|
62
|
+
const component = setUp(true);
|
|
63
|
+
expect(component.find('.node')).toHaveLength(1);
|
|
64
|
+
expect(component.find('.node').prop('style')).toEqual({...style, width: '254px'});
|
|
65
|
+
expect(component.find('.nodeContent')).toHaveLength(1);
|
|
66
|
+
expect(component.find('.nodeContent').prop('style')).toEqual({left: 4, width: 'calc(100% - 4px'});
|
|
67
|
+
expect(component.find('.lineBlock')).toHaveLength(1);
|
|
68
|
+
expect(component.find('.verticalLine')).toHaveLength(0);
|
|
69
|
+
expect(component.find('.horizontalLineRight')).toHaveLength(0);
|
|
70
|
+
expect(component.find('.rootIndex')).toHaveLength(1);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import treeNodeRenderer from './tree-node-data-renderer';
|
|
2
|
+
import nodeContentRenderer from './node-content-renderer';
|
|
3
|
+
|
|
4
|
+
const scaffoldBlockPxWidth = 16;
|
|
5
|
+
const rowHeight = 28;
|
|
6
|
+
const slideRegionSize = 50;
|
|
7
|
+
|
|
8
|
+
export const theme = {nodeContentRenderer, treeNodeRenderer, scaffoldBlockPxWidth, rowHeight, slideRegionSize};
|