@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,744 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as reactRedux from 'react-redux';
|
|
3
|
+
import {act} from 'react-dom/test-utils';
|
|
4
|
+
import {mount} from 'enzyme';
|
|
5
|
+
import {EmptyStub} from '@reltio/components';
|
|
6
|
+
import {getPagedEntity, Mode, TableAttributeViewConfig} from '@reltio/mdm-sdk';
|
|
7
|
+
import {profile} from '@reltio/mdm-module';
|
|
8
|
+
import {TableAttributeView} from '../components/TableAttributeView/TableAttributeView';
|
|
9
|
+
import {ProfileTableAttributeView} from '../ProfileTableAttributeView';
|
|
10
|
+
import {TableAttributeContext} from '../contexts/TableAttributeContext';
|
|
11
|
+
|
|
12
|
+
jest.mock('@reltio/mdm-sdk', () => ({
|
|
13
|
+
...(jest.requireActual('@reltio/mdm-sdk') as Record<string, unknown>),
|
|
14
|
+
getPagedEntity: jest.fn().mockResolvedValue({})
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
jest.mock('../components/TableAttributeView/TableAttributeView', () => ({
|
|
18
|
+
TableAttributeView: jest.fn()
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
jest.mock('../contexts/TableAttributeContext', () => ({
|
|
22
|
+
TableAttributeContext: {
|
|
23
|
+
Provider: jest.fn()
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
const createStore = (attributeHidden = false, mode = Mode.Viewing) => {
|
|
28
|
+
const tenant = 'knest';
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
metadata: {
|
|
32
|
+
[tenant]: {
|
|
33
|
+
uri: 'configuration',
|
|
34
|
+
entityTypes: [
|
|
35
|
+
{
|
|
36
|
+
uri: 'configuration/entityTypes/HCP',
|
|
37
|
+
attributes: [
|
|
38
|
+
{
|
|
39
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested',
|
|
40
|
+
name: 'FirstLevelNested',
|
|
41
|
+
...(attributeHidden ? {hidden: true} : {}),
|
|
42
|
+
attributes: [
|
|
43
|
+
{
|
|
44
|
+
label: 'FirstLevelNestedSub1_HCP',
|
|
45
|
+
name: 'FirstLevelNestedSub1',
|
|
46
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested/attributes/FirstLevelNestedSub1',
|
|
47
|
+
dependentLookupCode: 'LANG_CD',
|
|
48
|
+
searchable: true,
|
|
49
|
+
skipInDataAccess: false,
|
|
50
|
+
system: false,
|
|
51
|
+
type: 'String'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: 'Date1_HCP',
|
|
55
|
+
name: 'Date1',
|
|
56
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested/attributes/Date1',
|
|
57
|
+
attributeOrdering: {orderType: 'ASC', orderingStrategy: 'LUD'},
|
|
58
|
+
skipInDataAccess: false,
|
|
59
|
+
system: false,
|
|
60
|
+
faceted: true,
|
|
61
|
+
hidden: false,
|
|
62
|
+
type: 'Date'
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
uri: 'configuration/entityTypes/HCP/attributes/Commenters',
|
|
68
|
+
hidden: true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: 'Affiliated with',
|
|
72
|
+
name: 'affiliatedwith',
|
|
73
|
+
type: 'Reference',
|
|
74
|
+
uri: 'configuration/entityTypes/HCP/attributes/affiliatedwith',
|
|
75
|
+
referencedAttributeURIs: [
|
|
76
|
+
'configuration/entityTypes/Organization/attributes/Nick',
|
|
77
|
+
'configuration/entityTypes/Organization/attributes/Name',
|
|
78
|
+
'configuration/relationTypes/affiliatedwith/attributes/Title',
|
|
79
|
+
'configuration/relationTypes/affiliatedwith/attributes/Status'
|
|
80
|
+
],
|
|
81
|
+
referencedEntityTypeURI: 'configuration/entityTypes/Organization',
|
|
82
|
+
relationshipTypeURI: 'configuration/relationTypes/affiliatedwith'
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
analyticsAttributes: [
|
|
86
|
+
{
|
|
87
|
+
uri: 'configuration/entityTypes/HCP/analyticsAttributes/DQ',
|
|
88
|
+
name: 'DQ',
|
|
89
|
+
label: 'DQ',
|
|
90
|
+
hidden: false
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
uri: 'configuration/entityTypes/Organization',
|
|
96
|
+
label: 'Organization',
|
|
97
|
+
dataLabelPattern: '{Name}!',
|
|
98
|
+
attributes: [
|
|
99
|
+
{
|
|
100
|
+
label: 'Name',
|
|
101
|
+
name: 'Name',
|
|
102
|
+
type: 'String',
|
|
103
|
+
uri: 'configuration/entityTypes/Organization/attributes/Name'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: 'oAuth Customer name',
|
|
107
|
+
name: 'oAuthAccount',
|
|
108
|
+
type: 'String',
|
|
109
|
+
uri: 'configuration/entityTypes/Organization/attributes/oAuthAccount'
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label: 'Nickname',
|
|
113
|
+
name: 'Nick',
|
|
114
|
+
type: 'String',
|
|
115
|
+
uri: 'configuration/entityTypes/Organization/attributes/Nick'
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
relationTypes: [
|
|
121
|
+
{
|
|
122
|
+
uri: 'configuration/relationTypes/affiliatedwith',
|
|
123
|
+
label: 'Affiliated with',
|
|
124
|
+
attributes: [
|
|
125
|
+
{
|
|
126
|
+
label: 'Contact Type',
|
|
127
|
+
name: 'ContactType',
|
|
128
|
+
type: 'String',
|
|
129
|
+
uri: 'configuration/relationTypes/affiliatedwith/attributes/ContactType',
|
|
130
|
+
lookupCode: 'rdm/lookupTypes/ContactType_affiliatedwith'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: 'Title',
|
|
134
|
+
name: 'Title',
|
|
135
|
+
type: 'String',
|
|
136
|
+
uri: 'configuration/relationTypes/affiliatedwith/attributes/Title'
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
label: 'Status',
|
|
140
|
+
name: 'Status',
|
|
141
|
+
type: 'String',
|
|
142
|
+
uri: 'configuration/relationTypes/affiliatedwith/attributes/Status',
|
|
143
|
+
lookupCode: 'rdm/lookupTypes/Status_affiliatedwith'
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
profile: {
|
|
151
|
+
entity: {
|
|
152
|
+
uri: 'entities/1E4APrQW',
|
|
153
|
+
attributes: {}
|
|
154
|
+
},
|
|
155
|
+
history: {},
|
|
156
|
+
mode
|
|
157
|
+
},
|
|
158
|
+
tenant: {
|
|
159
|
+
id: tenant
|
|
160
|
+
},
|
|
161
|
+
ui: {
|
|
162
|
+
paths: {
|
|
163
|
+
apiPath: 'https://tst-01.reltio.com/reltio'
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
search: {
|
|
167
|
+
searchOptions: {
|
|
168
|
+
searchByOv: true,
|
|
169
|
+
ovOnly: true
|
|
170
|
+
},
|
|
171
|
+
globalFilter: {
|
|
172
|
+
query: null
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const defaultConfig = {
|
|
179
|
+
attributeUri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested',
|
|
180
|
+
max: 15
|
|
181
|
+
} as TableAttributeViewConfig;
|
|
182
|
+
|
|
183
|
+
const setUp = (config = defaultConfig, className = '') => {
|
|
184
|
+
return mount(<ProfileTableAttributeView config={config} className={className} />);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const dispatch = jest.fn();
|
|
188
|
+
|
|
189
|
+
const mockStore = (store = createStore()) => {
|
|
190
|
+
jest.spyOn(reactRedux, 'useSelector').mockImplementation((selector) => selector(store));
|
|
191
|
+
jest.spyOn(reactRedux, 'useDispatch').mockImplementation(() => dispatch);
|
|
192
|
+
return store;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
describe('ProfileTableAttributeView tests', () => {
|
|
196
|
+
beforeAll(() => {
|
|
197
|
+
(TableAttributeView as unknown as jest.Mock).mockImplementation(EmptyStub);
|
|
198
|
+
(TableAttributeContext.Provider as unknown as jest.Mock).mockImplementation(({children}) => (
|
|
199
|
+
<div id="tableAttributeContextMock">{children}</div>
|
|
200
|
+
));
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
afterEach(() => {
|
|
204
|
+
jest.clearAllMocks();
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
describe('render tests', () => {
|
|
208
|
+
it('should render TableAttributeContext.Provider correctly', () => {
|
|
209
|
+
mockStore();
|
|
210
|
+
const component = setUp();
|
|
211
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toBeDefined();
|
|
212
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').allColumnsData).toEqual([
|
|
213
|
+
{
|
|
214
|
+
id: 'attributes.FirstLevelNested.FirstLevelNestedSub1',
|
|
215
|
+
label: 'FirstLevelNestedSub1_HCP',
|
|
216
|
+
dataTypeDefinition: {
|
|
217
|
+
type: 'DependentLookup',
|
|
218
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested/attributes/FirstLevelNestedSub1',
|
|
219
|
+
dependentLookupCode: 'LANG_CD',
|
|
220
|
+
name: 'FirstLevelNestedSub1'
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: 'attributes.FirstLevelNested.Date1',
|
|
225
|
+
label: 'Date1_HCP',
|
|
226
|
+
dataTypeDefinition: {
|
|
227
|
+
type: 'Date',
|
|
228
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested/attributes/Date1',
|
|
229
|
+
name: 'Date1'
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
]);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it('should provide correct allColumnsData for reference attribute type', () => {
|
|
236
|
+
mockStore();
|
|
237
|
+
const component = setUp({
|
|
238
|
+
...defaultConfig,
|
|
239
|
+
attributeUri: 'configuration/entityTypes/HCP/attributes/affiliatedwith'
|
|
240
|
+
});
|
|
241
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toBeDefined();
|
|
242
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').allColumnsData).toEqual([
|
|
243
|
+
{
|
|
244
|
+
dataTypeDefinition: {
|
|
245
|
+
type: 'String',
|
|
246
|
+
uri: 'configuration/entityTypes/Organization/attributes/Nick',
|
|
247
|
+
name: 'Nick'
|
|
248
|
+
},
|
|
249
|
+
id: 'attributes.affiliatedwith.Nick',
|
|
250
|
+
label: 'Nickname'
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
dataTypeDefinition: {
|
|
254
|
+
type: 'String',
|
|
255
|
+
uri: 'configuration/entityTypes/Organization/attributes/Name',
|
|
256
|
+
name: 'Name'
|
|
257
|
+
},
|
|
258
|
+
id: 'attributes.affiliatedwith.Name',
|
|
259
|
+
label: 'Name'
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
dataTypeDefinition: {
|
|
263
|
+
type: 'String',
|
|
264
|
+
uri: 'configuration/relationTypes/affiliatedwith/attributes/Title',
|
|
265
|
+
name: 'Title'
|
|
266
|
+
},
|
|
267
|
+
id: 'attributes.affiliatedwith.Title',
|
|
268
|
+
label: 'Title'
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
dataTypeDefinition: {
|
|
272
|
+
lookupCode: 'rdm/lookupTypes/Status_affiliatedwith',
|
|
273
|
+
type: 'Lookup',
|
|
274
|
+
uri: 'configuration/relationTypes/affiliatedwith/attributes/Status',
|
|
275
|
+
name: 'Status'
|
|
276
|
+
},
|
|
277
|
+
id: 'attributes.affiliatedwith.Status',
|
|
278
|
+
label: 'Status'
|
|
279
|
+
}
|
|
280
|
+
]);
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it('should render TableAttributeView correctly', () => {
|
|
284
|
+
mockStore();
|
|
285
|
+
const className = 'TesClassName';
|
|
286
|
+
const component = setUp(defaultConfig, className);
|
|
287
|
+
expect(component.find(TableAttributeView).prop('config')).toEqual(defaultConfig);
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
describe('useSingleAttributeLoader tests', () => {
|
|
292
|
+
it('should not call getPagedEntity if attributeUri is incorrect', async () => {
|
|
293
|
+
mockStore();
|
|
294
|
+
|
|
295
|
+
const component = setUp({
|
|
296
|
+
...defaultConfig,
|
|
297
|
+
attributeUri: 'incorrectUri'
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toMatchObject({
|
|
301
|
+
isLoading: false,
|
|
302
|
+
page: 0,
|
|
303
|
+
values: [],
|
|
304
|
+
totalVisibleValues: 0
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
expect(getPagedEntity).not.toHaveBeenCalled();
|
|
308
|
+
|
|
309
|
+
await act(async () => {
|
|
310
|
+
await Promise.resolve();
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
component.update();
|
|
314
|
+
|
|
315
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toMatchObject({
|
|
316
|
+
isLoading: false,
|
|
317
|
+
page: 0,
|
|
318
|
+
totalVisibleValues: 0,
|
|
319
|
+
values: []
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
it('should not call getPagedEntity if attributeType is hidden', async () => {
|
|
324
|
+
mockStore();
|
|
325
|
+
|
|
326
|
+
const component = setUp({
|
|
327
|
+
...defaultConfig,
|
|
328
|
+
attributeUri: 'configuration/entityTypes/HCP/attributes/Commenters'
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toMatchObject({
|
|
332
|
+
isLoading: false,
|
|
333
|
+
page: 0,
|
|
334
|
+
values: [],
|
|
335
|
+
totalVisibleValues: 0
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
expect(getPagedEntity).not.toHaveBeenCalled();
|
|
339
|
+
|
|
340
|
+
await act(async () => {
|
|
341
|
+
await Promise.resolve();
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
component.update();
|
|
345
|
+
|
|
346
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toMatchObject({
|
|
347
|
+
isLoading: false,
|
|
348
|
+
page: 0,
|
|
349
|
+
totalVisibleValues: 0,
|
|
350
|
+
values: []
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
it('should call getPagedEntity with correctly params and correctly update state if entity is not DTSS', async () => {
|
|
354
|
+
const store = mockStore();
|
|
355
|
+
const values = [{uri: '1', value: '1'}];
|
|
356
|
+
(getPagedEntity as jest.Mock).mockResolvedValue({
|
|
357
|
+
attributes: {
|
|
358
|
+
FirstLevelNested: values,
|
|
359
|
+
paging: {
|
|
360
|
+
'configuration/entityTypes/HCP/attributes/FirstLevelNested': {
|
|
361
|
+
totalValues: 1
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
const component = setUp();
|
|
368
|
+
|
|
369
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toMatchObject({
|
|
370
|
+
isLoading: true,
|
|
371
|
+
page: 0,
|
|
372
|
+
values: []
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
expect(getPagedEntity).toHaveBeenCalledWith({
|
|
376
|
+
metadata: store.metadata.knest,
|
|
377
|
+
entity: store.profile.entity,
|
|
378
|
+
apiPath: store.ui.paths.apiPath,
|
|
379
|
+
tenant: store.tenant.id,
|
|
380
|
+
parentUri: store.profile.entity.uri,
|
|
381
|
+
defaultMaxValues: 15,
|
|
382
|
+
attributeTypeUri: defaultConfig.attributeUri,
|
|
383
|
+
offset: 0,
|
|
384
|
+
searchQuery: '',
|
|
385
|
+
globalFilter: ''
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
await act(async () => {
|
|
389
|
+
await Promise.resolve();
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
component.update();
|
|
393
|
+
|
|
394
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toMatchObject({
|
|
395
|
+
isLoading: false,
|
|
396
|
+
page: 0,
|
|
397
|
+
totalVisibleValues: 1,
|
|
398
|
+
values
|
|
399
|
+
});
|
|
400
|
+
expect(dispatch).toHaveBeenCalledWith(
|
|
401
|
+
profile.actions.processNextPageOfAttributeValues({
|
|
402
|
+
parentUri: store.profile.entity.uri,
|
|
403
|
+
attributeTypeUri: defaultConfig.attributeUri,
|
|
404
|
+
attributeTypeName: 'FirstLevelNested',
|
|
405
|
+
values
|
|
406
|
+
})
|
|
407
|
+
);
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
it('should call getPagedEntity with correctly params and correctly update state if entity is not DTSS for analytics attributes', async () => {
|
|
411
|
+
const store = mockStore();
|
|
412
|
+
(getPagedEntity as jest.Mock).mockResolvedValue({
|
|
413
|
+
analyticsAttributes: {
|
|
414
|
+
DQ: ['VALUE 1'],
|
|
415
|
+
paging: {
|
|
416
|
+
'configuration/entityTypes/HCP/analyticsAttributes/DQ': {
|
|
417
|
+
totalOvValues: 1
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
const config = {
|
|
424
|
+
...defaultConfig,
|
|
425
|
+
attributeUri: 'configuration/entityTypes/HCP/analyticsAttributes/DQ'
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
const component = setUp(config);
|
|
429
|
+
|
|
430
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toMatchObject({
|
|
431
|
+
isLoading: true,
|
|
432
|
+
page: 0,
|
|
433
|
+
values: []
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
expect(getPagedEntity).toHaveBeenCalledWith({
|
|
437
|
+
metadata: store.metadata.knest,
|
|
438
|
+
entity: store.profile.entity,
|
|
439
|
+
apiPath: store.ui.paths.apiPath,
|
|
440
|
+
tenant: store.tenant.id,
|
|
441
|
+
parentUri: store.profile.entity.uri,
|
|
442
|
+
defaultMaxValues: 15,
|
|
443
|
+
attributeTypeUri: config.attributeUri,
|
|
444
|
+
offset: 0,
|
|
445
|
+
searchQuery: '',
|
|
446
|
+
globalFilter: ''
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
await act(async () => {
|
|
450
|
+
await Promise.resolve();
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
component.update();
|
|
454
|
+
|
|
455
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toMatchObject({
|
|
456
|
+
isLoading: false,
|
|
457
|
+
page: 0,
|
|
458
|
+
totalVisibleValues: 1,
|
|
459
|
+
values: ['VALUE 1'],
|
|
460
|
+
showTable: true
|
|
461
|
+
});
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
it('should not call getPagedEntity if attributeUri is is not first level attribute', async () => {
|
|
465
|
+
mockStore();
|
|
466
|
+
|
|
467
|
+
const component = setUp({
|
|
468
|
+
...defaultConfig,
|
|
469
|
+
attributeUri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested/attributes/Date1'
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toMatchObject({
|
|
473
|
+
isLoading: false,
|
|
474
|
+
page: 0,
|
|
475
|
+
values: [],
|
|
476
|
+
totalVisibleValues: 0
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
expect(getPagedEntity).not.toHaveBeenCalled();
|
|
480
|
+
|
|
481
|
+
await act(async () => {
|
|
482
|
+
await Promise.resolve();
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
expect(getPagedEntity).not.toHaveBeenCalled();
|
|
486
|
+
|
|
487
|
+
component.update();
|
|
488
|
+
|
|
489
|
+
expect(component.find(TableAttributeContext.Provider).prop('value')).toMatchObject({
|
|
490
|
+
isLoading: false,
|
|
491
|
+
page: 0,
|
|
492
|
+
totalVisibleValues: 0,
|
|
493
|
+
values: []
|
|
494
|
+
});
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
it('toggleFilter should work correctly', () => {
|
|
498
|
+
const store = mockStore();
|
|
499
|
+
const component = setUp();
|
|
500
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').filters).toBeNull();
|
|
501
|
+
const onToggleFilters = component.find(TableAttributeContext.Provider).prop('value').onToggleFilters;
|
|
502
|
+
|
|
503
|
+
act(() => {
|
|
504
|
+
onToggleFilters();
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
component.update();
|
|
508
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').filters).toEqual({});
|
|
509
|
+
|
|
510
|
+
act(() => {
|
|
511
|
+
onToggleFilters();
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
component.update();
|
|
515
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').filters).toBeNull();
|
|
516
|
+
|
|
517
|
+
expect(getPagedEntity).toHaveBeenCalledTimes(1);
|
|
518
|
+
|
|
519
|
+
expect(getPagedEntity).toHaveBeenCalledWith({
|
|
520
|
+
metadata: store.metadata.knest,
|
|
521
|
+
entity: store.profile.entity,
|
|
522
|
+
apiPath: store.ui.paths.apiPath,
|
|
523
|
+
tenant: store.tenant.id,
|
|
524
|
+
parentUri: store.profile.entity.uri,
|
|
525
|
+
defaultMaxValues: 15,
|
|
526
|
+
attributeTypeUri: defaultConfig.attributeUri,
|
|
527
|
+
offset: 0,
|
|
528
|
+
searchQuery: '',
|
|
529
|
+
globalFilter: ''
|
|
530
|
+
});
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
it('setPage should work correctly', () => {
|
|
534
|
+
const store = mockStore();
|
|
535
|
+
const component = setUp();
|
|
536
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').page).toBe(0);
|
|
537
|
+
|
|
538
|
+
act(() => {
|
|
539
|
+
component.find(TableAttributeContext.Provider).prop('value').setPage(1);
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
component.update();
|
|
543
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').page).toBe(1);
|
|
544
|
+
|
|
545
|
+
expect(getPagedEntity).toHaveBeenCalledWith({
|
|
546
|
+
metadata: store.metadata.knest,
|
|
547
|
+
entity: store.profile.entity,
|
|
548
|
+
apiPath: store.ui.paths.apiPath,
|
|
549
|
+
tenant: store.tenant.id,
|
|
550
|
+
parentUri: store.profile.entity.uri,
|
|
551
|
+
defaultMaxValues: 15,
|
|
552
|
+
attributeTypeUri: defaultConfig.attributeUri,
|
|
553
|
+
offset: 15,
|
|
554
|
+
searchQuery: '',
|
|
555
|
+
globalFilter: ''
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
it('setSearchQuery and filter and sorting should work correctly', () => {
|
|
560
|
+
const store = mockStore();
|
|
561
|
+
const component = setUp();
|
|
562
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').searchQuery).toBe('');
|
|
563
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').showTable).toBeFalsy();
|
|
564
|
+
|
|
565
|
+
act(() => {
|
|
566
|
+
component.find(TableAttributeContext.Provider).prop('value').setSearchQuery('query');
|
|
567
|
+
});
|
|
568
|
+
|
|
569
|
+
component.update();
|
|
570
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').searchQuery).toBe('query');
|
|
571
|
+
|
|
572
|
+
expect(getPagedEntity).toHaveBeenCalledWith({
|
|
573
|
+
metadata: store.metadata.knest,
|
|
574
|
+
entity: store.profile.entity,
|
|
575
|
+
apiPath: store.ui.paths.apiPath,
|
|
576
|
+
tenant: store.tenant.id,
|
|
577
|
+
parentUri: store.profile.entity.uri,
|
|
578
|
+
defaultMaxValues: 15,
|
|
579
|
+
attributeTypeUri: defaultConfig.attributeUri,
|
|
580
|
+
offset: 0,
|
|
581
|
+
searchQuery: 'query',
|
|
582
|
+
globalFilter: ''
|
|
583
|
+
});
|
|
584
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').filters).toBeNull();
|
|
585
|
+
|
|
586
|
+
act(() => {
|
|
587
|
+
component
|
|
588
|
+
.find(TableAttributeContext.Provider)
|
|
589
|
+
.prop('value')
|
|
590
|
+
.onFilter({
|
|
591
|
+
columnId: 'attributes.FirstLevelNested.FirstLevelNestedSub1',
|
|
592
|
+
filter: {
|
|
593
|
+
filter: 'equals',
|
|
594
|
+
value: [{lookupCode: 'guj', value: 'Gujarati'}]
|
|
595
|
+
}
|
|
596
|
+
});
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
component.update();
|
|
600
|
+
|
|
601
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').filters).toStrictEqual({
|
|
602
|
+
['attributes.FirstLevelNested.FirstLevelNestedSub1']: {
|
|
603
|
+
filter: 'equals',
|
|
604
|
+
value: [{lookupCode: 'guj', value: 'Gujarati'}]
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
component.update();
|
|
609
|
+
|
|
610
|
+
expect(getPagedEntity).toHaveBeenCalledWith({
|
|
611
|
+
metadata: store.metadata.knest,
|
|
612
|
+
entity: store.profile.entity,
|
|
613
|
+
apiPath: store.ui.paths.apiPath,
|
|
614
|
+
tenant: store.tenant.id,
|
|
615
|
+
parentUri: store.profile.entity.uri,
|
|
616
|
+
defaultMaxValues: 15,
|
|
617
|
+
attributeTypeUri: defaultConfig.attributeUri,
|
|
618
|
+
offset: 0,
|
|
619
|
+
searchQuery: 'query',
|
|
620
|
+
globalFilter: '',
|
|
621
|
+
filters: [
|
|
622
|
+
{
|
|
623
|
+
filter: 'equals',
|
|
624
|
+
fieldName: 'attributes.FirstLevelNested.FirstLevelNestedSub1',
|
|
625
|
+
values: [[{lookupCode: 'guj', value: 'Gujarati'}]],
|
|
626
|
+
type: 'DependentLookup'
|
|
627
|
+
}
|
|
628
|
+
]
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
act(() => {
|
|
632
|
+
component
|
|
633
|
+
.find(TableAttributeContext.Provider)
|
|
634
|
+
.prop('value')
|
|
635
|
+
.onSort('attributes.FirstLevelNested.FirstLevelNestedSub1');
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
component.update();
|
|
639
|
+
|
|
640
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').sorting).toStrictEqual({
|
|
641
|
+
order: 'asc',
|
|
642
|
+
field: 'attributes.FirstLevelNested.FirstLevelNestedSub1'
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
component.update();
|
|
646
|
+
|
|
647
|
+
expect(getPagedEntity).toHaveBeenCalledWith({
|
|
648
|
+
metadata: store.metadata.knest,
|
|
649
|
+
entity: store.profile.entity,
|
|
650
|
+
apiPath: store.ui.paths.apiPath,
|
|
651
|
+
tenant: store.tenant.id,
|
|
652
|
+
parentUri: store.profile.entity.uri,
|
|
653
|
+
defaultMaxValues: 15,
|
|
654
|
+
attributeTypeUri: defaultConfig.attributeUri,
|
|
655
|
+
offset: 0,
|
|
656
|
+
searchQuery: 'query',
|
|
657
|
+
globalFilter: '',
|
|
658
|
+
filters: [
|
|
659
|
+
{
|
|
660
|
+
filter: 'equals',
|
|
661
|
+
fieldName: 'attributes.FirstLevelNested.FirstLevelNestedSub1',
|
|
662
|
+
type: 'DependentLookup',
|
|
663
|
+
values: [[{lookupCode: 'guj', value: 'Gujarati'}]]
|
|
664
|
+
}
|
|
665
|
+
],
|
|
666
|
+
sorting: {
|
|
667
|
+
field: 'attributes.FirstLevelNested.FirstLevelNestedSub1',
|
|
668
|
+
order: 'asc'
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').showTable).toBeTruthy();
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
it('change visible column should work correctly and change sorting', () => {
|
|
675
|
+
mockStore();
|
|
676
|
+
const component = setUp();
|
|
677
|
+
|
|
678
|
+
act(() => {
|
|
679
|
+
component
|
|
680
|
+
.find(TableAttributeContext.Provider)
|
|
681
|
+
.prop('value')
|
|
682
|
+
.onSort('attributes.FirstLevelNested.FirstLevelNestedSub1');
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
component.update();
|
|
686
|
+
|
|
687
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').sorting).toStrictEqual({
|
|
688
|
+
order: 'asc',
|
|
689
|
+
field: 'attributes.FirstLevelNested.FirstLevelNestedSub1'
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
act(() => {
|
|
693
|
+
component
|
|
694
|
+
.find(TableAttributeContext.Provider)
|
|
695
|
+
.prop('value')
|
|
696
|
+
.onChangeColumns(['attributes.FirstLevelNested.Date1']);
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
component.update();
|
|
700
|
+
|
|
701
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').sorting).toStrictEqual({
|
|
702
|
+
order: 'asc',
|
|
703
|
+
field: 'attributes.FirstLevelNested.Date1'
|
|
704
|
+
});
|
|
705
|
+
expect(component.find(TableAttributeContext.Provider).prop('value').visibleColumns).toEqual([
|
|
706
|
+
'attributes.FirstLevelNested.Date1'
|
|
707
|
+
]);
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
it('should has visible columns as empty array and attributeType should be defined in case with hidden attributeType', () => {
|
|
711
|
+
mockStore(createStore(true));
|
|
712
|
+
const component = setUp();
|
|
713
|
+
const data = component.find(TableAttributeContext.Provider).prop('value');
|
|
714
|
+
|
|
715
|
+
expect(data.attributeType).toBeDefined();
|
|
716
|
+
expect(data.attributeType.hidden).toBeTruthy();
|
|
717
|
+
expect(data.values).toEqual([]);
|
|
718
|
+
expect(data.page).toBe(0);
|
|
719
|
+
expect(data.isLoading).toBe(false);
|
|
720
|
+
expect(data.showTable).toBeFalsy();
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
it('should pass showTable as false for empty values and filters TableAttributeContext', () => {
|
|
724
|
+
mockStore(createStore());
|
|
725
|
+
const component = setUp();
|
|
726
|
+
const data = component.find(TableAttributeContext.Provider).prop('value');
|
|
727
|
+
expect(data.values.length).toBe(0);
|
|
728
|
+
expect(data.showTable).toBeFalsy();
|
|
729
|
+
expect(data.searchQuery).toBe('');
|
|
730
|
+
expect(data.filters).toBe(null);
|
|
731
|
+
});
|
|
732
|
+
|
|
733
|
+
it('should pass showTable as true for editing mode', () => {
|
|
734
|
+
mockStore(createStore(false, Mode.Editing));
|
|
735
|
+
const component = setUp();
|
|
736
|
+
const data = component.find(TableAttributeContext.Provider).prop('value');
|
|
737
|
+
expect(data.values.length).toBe(0);
|
|
738
|
+
expect(data.showTable).toBeTruthy();
|
|
739
|
+
expect(data.searchQuery).toBe('');
|
|
740
|
+
expect(data.filters).toBe(null);
|
|
741
|
+
expect(data.attributeType.hidden).toBeFalsy();
|
|
742
|
+
});
|
|
743
|
+
});
|
|
744
|
+
});
|