@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
package/src/components/ProfileRelationsView/components/RelationArrowButton/RelationArrowButton.tsx
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ArrowRightIcon from '@mui/icons-material/ArrowRight';
|
|
3
|
+
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
4
|
+
import {checkNew, Connection, RelationsViewConfig} from '@reltio/mdm-sdk';
|
|
5
|
+
import {useStyles} from './styles';
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
connection: Connection;
|
|
10
|
+
config: RelationsViewConfig;
|
|
11
|
+
showSecondLevel: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const RelationArrowButton = ({onClick, connection, config, showSecondLevel}: Props) => {
|
|
15
|
+
const styles = useStyles();
|
|
16
|
+
const {parentEntityUri} = connection;
|
|
17
|
+
const {contentSecondLevel} = config;
|
|
18
|
+
|
|
19
|
+
const props = {
|
|
20
|
+
onClick,
|
|
21
|
+
className: styles.arrowIcon
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
if (parentEntityUri || !contentSecondLevel || checkNew(connection)) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return showSecondLevel ? <ArrowDropDownIcon {...props} /> : <ArrowRightIcon {...props} />;
|
|
29
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {shallow} from 'enzyme';
|
|
3
|
+
import ArrowRightIcon from '@mui/icons-material/ArrowRight';
|
|
4
|
+
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
5
|
+
import {RelationArrowButton} from '../RelationArrowButton';
|
|
6
|
+
|
|
7
|
+
describe('RelationArrowButton tests', () => {
|
|
8
|
+
it('should return ArrowDropDownIcon if showSecondLevel is true', () => {
|
|
9
|
+
const config = {
|
|
10
|
+
contentSecondLevel: {
|
|
11
|
+
entityTypes: []
|
|
12
|
+
}
|
|
13
|
+
} as any;
|
|
14
|
+
|
|
15
|
+
const onClick = jest.fn();
|
|
16
|
+
|
|
17
|
+
const props = {
|
|
18
|
+
connection: {},
|
|
19
|
+
config,
|
|
20
|
+
onClick,
|
|
21
|
+
showSecondLevel: true
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const component = shallow(<RelationArrowButton {...props} />);
|
|
25
|
+
|
|
26
|
+
expect(component.find(ArrowDropDownIcon)).toHaveLength(1);
|
|
27
|
+
expect(component.find(ArrowDropDownIcon).prop('onClick')).toEqual(onClick);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should return ArrowRightIcon if showSecondLevel is false', () => {
|
|
31
|
+
const config = {
|
|
32
|
+
contentSecondLevel: {
|
|
33
|
+
entityTypes: []
|
|
34
|
+
}
|
|
35
|
+
} as any;
|
|
36
|
+
|
|
37
|
+
const onClick = jest.fn();
|
|
38
|
+
|
|
39
|
+
const props = {
|
|
40
|
+
connection: {},
|
|
41
|
+
config,
|
|
42
|
+
onClick,
|
|
43
|
+
showSecondLevel: false
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const component = shallow(<RelationArrowButton {...props} />);
|
|
47
|
+
|
|
48
|
+
expect(component.find(ArrowRightIcon)).toHaveLength(1);
|
|
49
|
+
expect(component.find(ArrowRightIcon).prop('onClick')).toEqual(onClick);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('should return null if parentEntityUri exists', () => {
|
|
53
|
+
const config = {
|
|
54
|
+
contentSecondLevel: {
|
|
55
|
+
entityTypes: []
|
|
56
|
+
}
|
|
57
|
+
} as any;
|
|
58
|
+
|
|
59
|
+
const props = {
|
|
60
|
+
connection: {parentEntityUri: 'entities/123'},
|
|
61
|
+
config,
|
|
62
|
+
onClick: jest.fn(),
|
|
63
|
+
showSecondLevel: true
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const component = shallow(<RelationArrowButton {...props} />);
|
|
67
|
+
expect(component.isEmptyRender()).toBe(true);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('should return null if contentSecondLevel not exists', () => {
|
|
71
|
+
const props = {
|
|
72
|
+
connection: {},
|
|
73
|
+
config: {} as any,
|
|
74
|
+
onClick: jest.fn(),
|
|
75
|
+
showSecondLevel: true
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const component = shallow(<RelationArrowButton {...props} />);
|
|
79
|
+
expect(component.isEmptyRender()).toBe(true);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('should return null if connection is new', () => {
|
|
83
|
+
const config = {
|
|
84
|
+
contentSecondLevel: {
|
|
85
|
+
entityTypes: []
|
|
86
|
+
}
|
|
87
|
+
} as any;
|
|
88
|
+
|
|
89
|
+
const props = {
|
|
90
|
+
connection: {__metadata: {draft: 'new'}},
|
|
91
|
+
config,
|
|
92
|
+
onClick: jest.fn(),
|
|
93
|
+
showSecondLevel: true
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const component = shallow(<RelationArrowButton {...props} />);
|
|
97
|
+
expect(component.isEmptyRender()).toBe(true);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React, {useCallback, useEffect, useState} from 'react';
|
|
2
|
+
import {isNil, ifElse} from 'ramda';
|
|
3
|
+
import {useSelector} from 'react-redux';
|
|
4
|
+
import {
|
|
5
|
+
ConnectionEntity,
|
|
6
|
+
getDataTenantEntitySecondaryLabel,
|
|
7
|
+
getEntitySecondaryLabel,
|
|
8
|
+
isDataTenantEntity,
|
|
9
|
+
isTempUri
|
|
10
|
+
} from '@reltio/mdm-sdk';
|
|
11
|
+
import mdm from '@reltio/mdm-module';
|
|
12
|
+
import {useSafePromise} from '@reltio/components';
|
|
13
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
14
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
15
|
+
import {useStyles} from './styles';
|
|
16
|
+
|
|
17
|
+
const PROGRESS_ICON_SIZE = 16;
|
|
18
|
+
|
|
19
|
+
type Props = {
|
|
20
|
+
label: string;
|
|
21
|
+
entity?: ConnectionEntity;
|
|
22
|
+
children: React.ReactElement;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const RelationTooltip = ({label, entity, children, ...tooltipProps}: Props) => {
|
|
26
|
+
const styles = useStyles();
|
|
27
|
+
const safePromise = useSafePromise();
|
|
28
|
+
const tenant = useSelector(mdm.selectors.getTenant);
|
|
29
|
+
const dtssPath = useSelector(mdm.selectors.getDtssPath) as string;
|
|
30
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
31
|
+
const [secondaryLabel, setSecondaryLabel] = useState<string>(null);
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
setSecondaryLabel(null);
|
|
35
|
+
}, [entity]);
|
|
36
|
+
|
|
37
|
+
const onOpen = useCallback(() => {
|
|
38
|
+
if (entity?.entityUri && !isTempUri(entity?.entityUri) && isNil(secondaryLabel)) {
|
|
39
|
+
const request = ifElse(
|
|
40
|
+
isDataTenantEntity,
|
|
41
|
+
(entity: ConnectionEntity) =>
|
|
42
|
+
getDataTenantEntitySecondaryLabel({
|
|
43
|
+
entityUri: entity.entityUri,
|
|
44
|
+
dataTenant: entity.dataTenant,
|
|
45
|
+
customerTenant: tenant,
|
|
46
|
+
dtssPath
|
|
47
|
+
}),
|
|
48
|
+
(entity: ConnectionEntity) => getEntitySecondaryLabel(entity.entityUri)
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
setIsLoading(true);
|
|
52
|
+
safePromise(request(entity))
|
|
53
|
+
.then(({secondaryLabel}) => {
|
|
54
|
+
setSecondaryLabel(secondaryLabel);
|
|
55
|
+
})
|
|
56
|
+
.finally(() => {
|
|
57
|
+
setIsLoading(false);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}, [dtssPath, entity, tenant, safePromise, secondaryLabel]);
|
|
61
|
+
|
|
62
|
+
const tooltipContent = (
|
|
63
|
+
<div className={styles.tooltipContent}>
|
|
64
|
+
<div className={styles.label}>{label}</div>
|
|
65
|
+
{isLoading && <CircularProgress size={PROGRESS_ICON_SIZE} classes={{colorPrimary: styles.progress}} />}
|
|
66
|
+
{secondaryLabel && <div className={styles.secondaryLabel}>{secondaryLabel}</div>}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<Tooltip
|
|
72
|
+
onOpen={onOpen}
|
|
73
|
+
title={tooltipContent}
|
|
74
|
+
disableFocusListener
|
|
75
|
+
classes={{tooltip: styles.tooltip}}
|
|
76
|
+
{...tooltipProps}
|
|
77
|
+
>
|
|
78
|
+
{children}
|
|
79
|
+
</Tooltip>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export default RelationTooltip;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import React, {ChangeEvent, ReactElement} from 'react';
|
|
2
|
+
import {ReactWrapper, shallow} from 'enzyme';
|
|
3
|
+
import * as reactReduxImports from 'react-redux';
|
|
4
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
5
|
+
import {act} from 'react-dom/test-utils';
|
|
6
|
+
|
|
7
|
+
import RelationTooltip from '../RelationTooltip';
|
|
8
|
+
import {ConnectionEntity, getDataTenantEntitySecondaryLabel, getEntitySecondaryLabel} from '@reltio/mdm-sdk';
|
|
9
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
10
|
+
|
|
11
|
+
jest.mock('@reltio/mdm-sdk', () => ({
|
|
12
|
+
...jest.requireActual<Record<string, unknown>>('@reltio/mdm-sdk'),
|
|
13
|
+
getEntitySecondaryLabel: jest.fn(),
|
|
14
|
+
getDataTenantEntitySecondaryLabel: jest.fn()
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
describe('RelationTooltip behaviour', () => {
|
|
18
|
+
const children = <div>children</div>;
|
|
19
|
+
const label = 'Main Label';
|
|
20
|
+
|
|
21
|
+
const entity = {
|
|
22
|
+
entityUri: 'entities/uri1'
|
|
23
|
+
} as ConnectionEntity;
|
|
24
|
+
|
|
25
|
+
let store;
|
|
26
|
+
|
|
27
|
+
beforeEach(() => {
|
|
28
|
+
store = {
|
|
29
|
+
tenant: {id: 'customerTenant'},
|
|
30
|
+
ui: {}
|
|
31
|
+
};
|
|
32
|
+
jest.spyOn(reactReduxImports, 'useSelector').mockImplementation((selector) => selector(store));
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
afterEach(() => {
|
|
36
|
+
jest.restoreAllMocks();
|
|
37
|
+
});
|
|
38
|
+
it('should render main parts', () => {
|
|
39
|
+
const component = shallow(
|
|
40
|
+
<RelationTooltip label={label} entity={entity}>
|
|
41
|
+
{children}
|
|
42
|
+
</RelationTooltip>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const tooltip = component.find(Tooltip);
|
|
46
|
+
expect(tooltip).toHaveLength(1);
|
|
47
|
+
expect(new ReactWrapper(tooltip.prop('title') as ReactElement).text()).toEqual(label);
|
|
48
|
+
expect(tooltip.prop('children')).toBe(children);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('load secondary label behaviour', async () => {
|
|
52
|
+
const secondaryLabel = 'Secondary Label';
|
|
53
|
+
(getEntitySecondaryLabel as jest.Mock).mockReturnValue(Promise.resolve({secondaryLabel}));
|
|
54
|
+
const component = shallow(
|
|
55
|
+
<RelationTooltip label={label} entity={entity}>
|
|
56
|
+
{children}
|
|
57
|
+
</RelationTooltip>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
act(() => {
|
|
61
|
+
component.find(Tooltip).prop('onOpen')({} as ChangeEvent);
|
|
62
|
+
});
|
|
63
|
+
component.update();
|
|
64
|
+
|
|
65
|
+
let tooltipContent = new ReactWrapper(component.find(Tooltip).prop('title') as ReactElement);
|
|
66
|
+
expect(getEntitySecondaryLabel).toHaveBeenCalledWith(entity.entityUri);
|
|
67
|
+
expect(tooltipContent.text()).toEqual(label);
|
|
68
|
+
expect(tooltipContent.find(CircularProgress)).toHaveLength(1);
|
|
69
|
+
|
|
70
|
+
await act(async () => {
|
|
71
|
+
await Promise.resolve();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
tooltipContent = new ReactWrapper(component.find(Tooltip).prop('title') as ReactElement);
|
|
75
|
+
|
|
76
|
+
expect(tooltipContent.find('.label').text()).toEqual(label);
|
|
77
|
+
expect(tooltipContent.find('.secondaryLabel').text()).toEqual(secondaryLabel);
|
|
78
|
+
expect(tooltipContent.find(CircularProgress)).toHaveLength(0);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('load secondary label behaviour for dtss entity', async () => {
|
|
82
|
+
const secondaryLabel = 'Secondary Label';
|
|
83
|
+
const dtssPath = 'dtssPath/';
|
|
84
|
+
const dtssEntity = {
|
|
85
|
+
...entity,
|
|
86
|
+
dataTenant: 'dtssTenant'
|
|
87
|
+
};
|
|
88
|
+
store.ui = {paths: {dtssPath}};
|
|
89
|
+
|
|
90
|
+
(getDataTenantEntitySecondaryLabel as jest.Mock).mockReturnValue(Promise.resolve({secondaryLabel}));
|
|
91
|
+
|
|
92
|
+
const component = shallow(
|
|
93
|
+
<RelationTooltip label={label} entity={dtssEntity}>
|
|
94
|
+
{children}
|
|
95
|
+
</RelationTooltip>
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
act(() => {
|
|
99
|
+
component.find(Tooltip).prop('onOpen')({} as ChangeEvent);
|
|
100
|
+
});
|
|
101
|
+
component.update();
|
|
102
|
+
|
|
103
|
+
let tooltipContent = new ReactWrapper(component.find(Tooltip).prop('title') as ReactElement);
|
|
104
|
+
expect(getDataTenantEntitySecondaryLabel).toHaveBeenCalledWith({
|
|
105
|
+
entityUri: dtssEntity.entityUri,
|
|
106
|
+
dataTenant: dtssEntity.dataTenant,
|
|
107
|
+
customerTenant: store.tenant.id,
|
|
108
|
+
dtssPath: dtssPath
|
|
109
|
+
});
|
|
110
|
+
expect(tooltipContent.text()).toEqual(label);
|
|
111
|
+
expect(tooltipContent.find(CircularProgress)).toHaveLength(1);
|
|
112
|
+
expect(tooltipContent.find('.secondaryLabel')).toHaveLength(0);
|
|
113
|
+
|
|
114
|
+
await act(async () => {
|
|
115
|
+
await Promise.resolve();
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
tooltipContent = new ReactWrapper(component.find(Tooltip).prop('title') as ReactElement);
|
|
119
|
+
|
|
120
|
+
expect(tooltipContent.find('.label').text()).toEqual(label);
|
|
121
|
+
expect(tooltipContent.find('.secondaryLabel').text()).toEqual(secondaryLabel);
|
|
122
|
+
expect(tooltipContent.find(CircularProgress)).toHaveLength(0);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('should not show empty secondary label', async () => {
|
|
126
|
+
const secondaryLabel = '';
|
|
127
|
+
(getEntitySecondaryLabel as jest.Mock).mockReturnValue(Promise.resolve({secondaryLabel}));
|
|
128
|
+
const component = shallow(
|
|
129
|
+
<RelationTooltip label={label} entity={entity}>
|
|
130
|
+
{children}
|
|
131
|
+
</RelationTooltip>
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
act(() => {
|
|
135
|
+
component.find(Tooltip).prop('onOpen')({} as ChangeEvent);
|
|
136
|
+
});
|
|
137
|
+
component.update();
|
|
138
|
+
|
|
139
|
+
let tooltipContent = new ReactWrapper(component.find(Tooltip).prop('title') as ReactElement);
|
|
140
|
+
expect(getEntitySecondaryLabel).toHaveBeenCalledWith(entity.entityUri);
|
|
141
|
+
expect(tooltipContent.text()).toEqual(label);
|
|
142
|
+
expect(tooltipContent.find(CircularProgress)).toHaveLength(1);
|
|
143
|
+
expect(tooltipContent.find('.secondaryLabel')).toHaveLength(0);
|
|
144
|
+
|
|
145
|
+
await act(async () => {
|
|
146
|
+
await Promise.resolve();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
tooltipContent = new ReactWrapper(component.find(Tooltip).prop('title') as ReactElement);
|
|
150
|
+
|
|
151
|
+
expect(tooltipContent.find('.label').text()).toEqual(label);
|
|
152
|
+
expect(tooltipContent.find('.secondaryLabel')).toHaveLength(0);
|
|
153
|
+
expect(tooltipContent.find(CircularProgress)).toHaveLength(0);
|
|
154
|
+
});
|
|
155
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {makeStyles} from '@mui/styles';
|
|
2
|
+
|
|
3
|
+
export const useStyles = makeStyles((theme) => ({
|
|
4
|
+
tooltip: theme.tooltip,
|
|
5
|
+
tooltipContent: {
|
|
6
|
+
minWidth: '165px',
|
|
7
|
+
padding: '4px 2px 2px'
|
|
8
|
+
},
|
|
9
|
+
label: {
|
|
10
|
+
fontSize: '11px',
|
|
11
|
+
lineHeight: '13px',
|
|
12
|
+
fontWeight: 500,
|
|
13
|
+
margin: 0,
|
|
14
|
+
color: 'white'
|
|
15
|
+
},
|
|
16
|
+
secondaryLabel: {
|
|
17
|
+
color: 'rgba(255, 255, 255, 0.7)',
|
|
18
|
+
fontSize: '10px',
|
|
19
|
+
marginTop: '4px',
|
|
20
|
+
fontWeight: 500,
|
|
21
|
+
lineHeight: '11px'
|
|
22
|
+
},
|
|
23
|
+
progress: {
|
|
24
|
+
marginTop: '4px',
|
|
25
|
+
color: '#FFFFFF'
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import i18n from 'ui-i18n';
|
|
3
|
+
import {useSelector} from 'react-redux';
|
|
4
|
+
import mdmModule from '@reltio/mdm-module';
|
|
5
|
+
import {isEditableMode, Connection, RelationsViewConfig} from '@reltio/mdm-sdk';
|
|
6
|
+
import {LinearLoadIndicator} from '@reltio/components';
|
|
7
|
+
import Typography from '@mui/material/Typography';
|
|
8
|
+
import RelationsEditableContent from '../RelationsEditableContent/RelationsEditableContent';
|
|
9
|
+
import RelationsList from '../RelationsList/RelationsList';
|
|
10
|
+
import {useStyles} from './styles';
|
|
11
|
+
|
|
12
|
+
type Props = {
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
config: RelationsViewConfig;
|
|
15
|
+
loadRelations: () => void;
|
|
16
|
+
connections: Connection[];
|
|
17
|
+
total: number;
|
|
18
|
+
parentEntityUri?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const RelationsContent = ({isLoading, config, loadRelations, connections, total, parentEntityUri}: Props) => {
|
|
22
|
+
const styles = useStyles();
|
|
23
|
+
|
|
24
|
+
const {selectors} = mdmModule;
|
|
25
|
+
const entity = useSelector(selectors.getEntity);
|
|
26
|
+
const mode = useSelector(selectors.getMode);
|
|
27
|
+
|
|
28
|
+
const noDataText = config['text-empty'] || i18n.text('No data found');
|
|
29
|
+
|
|
30
|
+
if (isLoading) {
|
|
31
|
+
return <LinearLoadIndicator />;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (isEditableMode(mode)) {
|
|
35
|
+
return (
|
|
36
|
+
<RelationsEditableContent
|
|
37
|
+
connections={connections}
|
|
38
|
+
className={styles.list}
|
|
39
|
+
key={entity?.uri}
|
|
40
|
+
config={config}
|
|
41
|
+
mode={mode}
|
|
42
|
+
noDataText={noDataText}
|
|
43
|
+
parentEntityUri={parentEntityUri}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (total > 0) {
|
|
49
|
+
return (
|
|
50
|
+
<RelationsList
|
|
51
|
+
config={config}
|
|
52
|
+
loadRelations={loadRelations}
|
|
53
|
+
connections={connections}
|
|
54
|
+
className={styles.list}
|
|
55
|
+
key={entity?.uri}
|
|
56
|
+
mainEnityUri={entity.uri}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return <Typography className={styles.noData}>{noDataText}</Typography>;
|
|
62
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {shallow} from 'enzyme';
|
|
3
|
+
import * as reactRedux from 'react-redux';
|
|
4
|
+
import {Mode, RelationsViewConfig} from '@reltio/mdm-sdk';
|
|
5
|
+
import {LinearLoadIndicator} from '@reltio/components';
|
|
6
|
+
import RelationsEditableContent from '../../RelationsEditableContent/RelationsEditableContent';
|
|
7
|
+
import {RelationsContent} from '../RelationsContent';
|
|
8
|
+
import RelationsList from '../../RelationsList/RelationsList';
|
|
9
|
+
|
|
10
|
+
const config = {
|
|
11
|
+
point: 'com.reltio.plugins.ui.view',
|
|
12
|
+
id: 'com.reltio.plugins.entity.relations.RelationsView.1',
|
|
13
|
+
content: null,
|
|
14
|
+
caption: 'Relations view title',
|
|
15
|
+
isComplex: false
|
|
16
|
+
} as RelationsViewConfig;
|
|
17
|
+
|
|
18
|
+
let store;
|
|
19
|
+
|
|
20
|
+
const loadRelations = jest.fn();
|
|
21
|
+
|
|
22
|
+
describe('RelationsContent tests', () => {
|
|
23
|
+
const dispatch = jest.fn();
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
store = {
|
|
26
|
+
profile: {
|
|
27
|
+
mode: Mode.Viewing,
|
|
28
|
+
entity: {
|
|
29
|
+
uri: 'entities/1',
|
|
30
|
+
type: 'configuration/entityTypes/HCP'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
beforeAll(() => {
|
|
36
|
+
jest.spyOn(reactRedux, 'useSelector').mockImplementation((selector) => selector(store));
|
|
37
|
+
jest.spyOn(reactRedux, 'useDispatch').mockImplementation(() => dispatch);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should render RelationsList correctly if mode is Viewing', () => {
|
|
41
|
+
store.profile.mode = Mode.Viewing;
|
|
42
|
+
const connections = [{entity: {uri: '1'}, relations: {uri: '2'}}] as any;
|
|
43
|
+
const component = shallow(
|
|
44
|
+
<RelationsContent
|
|
45
|
+
total={25}
|
|
46
|
+
connections={connections}
|
|
47
|
+
isLoading={false}
|
|
48
|
+
config={config}
|
|
49
|
+
loadRelations={loadRelations}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const relationsList = component.find(RelationsList);
|
|
54
|
+
expect(relationsList).toHaveLength(1);
|
|
55
|
+
expect(relationsList.props()).toMatchObject({
|
|
56
|
+
connections,
|
|
57
|
+
config: config,
|
|
58
|
+
loadRelations
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should render RelationsEditableContent correctly if mode is editable', () => {
|
|
63
|
+
store.profile.mode = Mode.Editing;
|
|
64
|
+
const connections = [{entity: {uri: '1'}, relations: {uri: '2'}}] as any;
|
|
65
|
+
const parentEntityUri = 'entities/123';
|
|
66
|
+
const component = shallow(
|
|
67
|
+
<RelationsContent
|
|
68
|
+
total={25}
|
|
69
|
+
connections={connections}
|
|
70
|
+
isLoading={false}
|
|
71
|
+
config={config}
|
|
72
|
+
loadRelations={loadRelations}
|
|
73
|
+
parentEntityUri={parentEntityUri}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
const editableContent = component.find(RelationsEditableContent);
|
|
77
|
+
expect(editableContent).toHaveLength(1);
|
|
78
|
+
expect(editableContent.props()).toMatchObject({
|
|
79
|
+
connections,
|
|
80
|
+
config: config,
|
|
81
|
+
mode: Mode.Editing,
|
|
82
|
+
noDataText: 'No data found',
|
|
83
|
+
parentEntityUri
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('should render RelationsEditableContent correctly if relation list is empty', () => {
|
|
88
|
+
store.profile.mode = Mode.Editing;
|
|
89
|
+
const connections = [];
|
|
90
|
+
const component = shallow(
|
|
91
|
+
<RelationsContent
|
|
92
|
+
isLoading={false}
|
|
93
|
+
total={0}
|
|
94
|
+
connections={connections}
|
|
95
|
+
config={config}
|
|
96
|
+
loadRelations={loadRelations}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
const editableContent = component.find(RelationsEditableContent);
|
|
100
|
+
expect(editableContent).toHaveLength(1);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('should show default empty text', () => {
|
|
104
|
+
const connections = [];
|
|
105
|
+
const component = shallow(
|
|
106
|
+
<RelationsContent
|
|
107
|
+
connections={connections}
|
|
108
|
+
total={0}
|
|
109
|
+
config={config}
|
|
110
|
+
isLoading={false}
|
|
111
|
+
loadRelations={loadRelations}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
expect(component.find(RelationsList)).toHaveLength(0);
|
|
115
|
+
expect(component.find('.noData').text()).toBe('No data found');
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('should show the empty text from config', () => {
|
|
119
|
+
const emptyText = 'No data';
|
|
120
|
+
config['text-empty'] = emptyText;
|
|
121
|
+
const connections = [];
|
|
122
|
+
const component = shallow(
|
|
123
|
+
<RelationsContent
|
|
124
|
+
connections={connections}
|
|
125
|
+
config={config}
|
|
126
|
+
isLoading={false}
|
|
127
|
+
loadRelations={loadRelations}
|
|
128
|
+
total={0}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
|
+
expect(component.find(RelationsList)).toHaveLength(0);
|
|
132
|
+
expect(component.find('.noData').text()).toBe(emptyText);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('should render LinearLoadIndicator', () => {
|
|
136
|
+
const component = shallow(
|
|
137
|
+
<RelationsContent
|
|
138
|
+
isLoading={true}
|
|
139
|
+
connections={[]}
|
|
140
|
+
config={config}
|
|
141
|
+
total={0}
|
|
142
|
+
loadRelations={loadRelations}
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
expect(component.find(LinearLoadIndicator)).toHaveLength(1);
|
|
147
|
+
});
|
|
148
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {makeStyles} from '@mui/styles';
|
|
2
|
+
|
|
3
|
+
export const useStyles = makeStyles((theme) => ({
|
|
4
|
+
list: {
|
|
5
|
+
paddingTop: '8px',
|
|
6
|
+
paddingBottom: '10px',
|
|
7
|
+
overflow: 'auto',
|
|
8
|
+
flexGrow: 1
|
|
9
|
+
},
|
|
10
|
+
noData: {
|
|
11
|
+
fontSize: '13px',
|
|
12
|
+
color: theme.palette.text.secondary,
|
|
13
|
+
padding: '8px 16px'
|
|
14
|
+
}
|
|
15
|
+
}));
|