@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,149 @@
|
|
|
1
|
+
import {shallow, mount} from 'enzyme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {DataTypes, HistoryAppearanceActions} from '@reltio/mdm-sdk';
|
|
4
|
+
import {DataTypeValue, HistoryDiffContext} from '@reltio/components';
|
|
5
|
+
import DefaultCellValueRenderer from '../DefaultCellValueRenderer';
|
|
6
|
+
import BlobRenderer from '../BlobRenderer';
|
|
7
|
+
|
|
8
|
+
jest.mock('@reltio/components', () => ({
|
|
9
|
+
...(jest.requireActual('@reltio/components') as Record<string, unknown>),
|
|
10
|
+
DataTypeValue: () => null,
|
|
11
|
+
BlobRenderer: () => null
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
describe('DefaultCellValueRenderer tests', () => {
|
|
15
|
+
const defaulColumnData = {
|
|
16
|
+
dataTypeDefinition: {
|
|
17
|
+
type: DataTypes.TYPE_STRING
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const value = {
|
|
22
|
+
value: 'test value 0',
|
|
23
|
+
uri: 'entities/1MfzxX4I/testUri0'
|
|
24
|
+
};
|
|
25
|
+
const valueInserted = {
|
|
26
|
+
value: 'test value 1',
|
|
27
|
+
uri: 'entities/1MfzxX4I/testUri1'
|
|
28
|
+
};
|
|
29
|
+
const valueUpdated = {
|
|
30
|
+
value: 'test value 2',
|
|
31
|
+
uri: 'entities/1MfzxX4I/testUri2'
|
|
32
|
+
};
|
|
33
|
+
const valueDeleted = {
|
|
34
|
+
value: 'test value 3',
|
|
35
|
+
uri: 'entities/1MfzxX4I/testUri3'
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const historyDiff = {
|
|
39
|
+
appearance: {
|
|
40
|
+
'entities/1MfzxX4I/testUri2': 'UPDATE_ATTRIBUTE' as HistoryAppearanceActions,
|
|
41
|
+
'entities/1MfzxX4I/testUri1': 'INSERT_ATTRIBUTE' as HistoryAppearanceActions,
|
|
42
|
+
'entities/1MfzxX4I/testUri3': 'DELETE_ATTRIBUTE' as HistoryAppearanceActions
|
|
43
|
+
},
|
|
44
|
+
attributes: {},
|
|
45
|
+
roles: [],
|
|
46
|
+
tags: []
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
it('should render correctly', () => {
|
|
50
|
+
const wrapper = mount(
|
|
51
|
+
<HistoryDiffContext.Provider value={historyDiff}>
|
|
52
|
+
<DefaultCellValueRenderer columnData={defaulColumnData} value={value} />
|
|
53
|
+
</HistoryDiffContext.Provider>
|
|
54
|
+
);
|
|
55
|
+
const dataTypeValue = wrapper.find(DataTypeValue);
|
|
56
|
+
expect(dataTypeValue.prop('value')).toBe(value.value);
|
|
57
|
+
expect(dataTypeValue.prop('dataTypeDefinition')).toBe(defaulColumnData.dataTypeDefinition);
|
|
58
|
+
expect(wrapper.find('span').hasClass('updateAttribute')).toBe(false);
|
|
59
|
+
expect(wrapper.find('span').hasClass('insertAttribute')).toBe(false);
|
|
60
|
+
expect(wrapper.find('span').hasClass('deleteAttribute')).toBe(false);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('should add updateAttribute class name if HistoryDiffContext contains value.uri with UPDATE_ATTRIBUTE value', () => {
|
|
64
|
+
const wrapper = mount(
|
|
65
|
+
<HistoryDiffContext.Provider value={historyDiff}>
|
|
66
|
+
<DefaultCellValueRenderer columnData={defaulColumnData} value={valueUpdated} />
|
|
67
|
+
</HistoryDiffContext.Provider>
|
|
68
|
+
);
|
|
69
|
+
expect(wrapper.find('span').hasClass('updateAttribute')).toBe(true);
|
|
70
|
+
expect(wrapper.find('span').hasClass('insertAttribute')).toBe(false);
|
|
71
|
+
expect(wrapper.find('span').hasClass('deleteAttribute')).toBe(false);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should add insertAttribute class name if HistoryDiffContext contains value.uri with INSERT_ATTRIBUTE value', () => {
|
|
75
|
+
const wrapper = mount(
|
|
76
|
+
<HistoryDiffContext.Provider value={historyDiff}>
|
|
77
|
+
<DefaultCellValueRenderer columnData={defaulColumnData} value={valueInserted} />
|
|
78
|
+
</HistoryDiffContext.Provider>
|
|
79
|
+
);
|
|
80
|
+
expect(wrapper.find('span').hasClass('updateAttribute')).toBe(false);
|
|
81
|
+
expect(wrapper.find('span').hasClass('insertAttribute')).toBe(true);
|
|
82
|
+
expect(wrapper.find('span').hasClass('deleteAttribute')).toBe(false);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('should add deleteAttribute class name if HistoryDiffContext contains value.uri with DELETE_ATTRIBUTE value', () => {
|
|
86
|
+
const wrapper = mount(
|
|
87
|
+
<HistoryDiffContext.Provider value={historyDiff}>
|
|
88
|
+
<DefaultCellValueRenderer columnData={defaulColumnData} value={valueDeleted} />
|
|
89
|
+
</HistoryDiffContext.Provider>
|
|
90
|
+
);
|
|
91
|
+
expect(wrapper.find('span').hasClass('updateAttribute')).toBe(false);
|
|
92
|
+
expect(wrapper.find('span').hasClass('insertAttribute')).toBe(false);
|
|
93
|
+
expect(wrapper.find('span').hasClass('deleteAttribute')).toBe(true);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('should render TYPE_BLOB correctly', () => {
|
|
97
|
+
const columnData = {
|
|
98
|
+
dataTypeDefinition: {
|
|
99
|
+
type: DataTypes.TYPE_BLOB
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const wrapper = shallow(<DefaultCellValueRenderer columnData={columnData} value={value} />);
|
|
103
|
+
const blobRenderer = wrapper.find(BlobRenderer);
|
|
104
|
+
expect(blobRenderer.prop('value')).toBe(value.value);
|
|
105
|
+
expect(blobRenderer.prop('historyClassName')).toBe('');
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('should render TYPE_BLOB with proper historyClassName if HistoryDiffContext contains value.uri with UPDATE_ATTRIBUTE value', () => {
|
|
109
|
+
const columnData = {
|
|
110
|
+
dataTypeDefinition: {
|
|
111
|
+
type: DataTypes.TYPE_BLOB
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const wrapper = mount(
|
|
115
|
+
<HistoryDiffContext.Provider value={historyDiff}>
|
|
116
|
+
<DefaultCellValueRenderer columnData={columnData} value={valueUpdated} />
|
|
117
|
+
</HistoryDiffContext.Provider>
|
|
118
|
+
);
|
|
119
|
+
expect(wrapper.find(BlobRenderer).prop('historyClassName')).toBe('updateAttribute');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should render TYPE_BLOB with proper historyClassName if HistoryDiffContext contains value.uri with INSERT_ATTRIBUTE value', () => {
|
|
123
|
+
const columnData = {
|
|
124
|
+
dataTypeDefinition: {
|
|
125
|
+
type: DataTypes.TYPE_BLOB
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const wrapper = mount(
|
|
129
|
+
<HistoryDiffContext.Provider value={historyDiff}>
|
|
130
|
+
<DefaultCellValueRenderer columnData={columnData} value={valueInserted} />
|
|
131
|
+
</HistoryDiffContext.Provider>
|
|
132
|
+
);
|
|
133
|
+
expect(wrapper.find(BlobRenderer).prop('historyClassName')).toBe('insertAttribute');
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('should render TYPE_BLOB with proper historyClassName if HistoryDiffContext contains value.uri with DELETE_ATTRIBUTE value', () => {
|
|
137
|
+
const columnData = {
|
|
138
|
+
dataTypeDefinition: {
|
|
139
|
+
type: DataTypes.TYPE_BLOB
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const wrapper = mount(
|
|
143
|
+
<HistoryDiffContext.Provider value={historyDiff}>
|
|
144
|
+
<DefaultCellValueRenderer columnData={columnData} value={valueDeleted} />
|
|
145
|
+
</HistoryDiffContext.Provider>
|
|
146
|
+
);
|
|
147
|
+
expect(wrapper.find(BlobRenderer).prop('historyClassName')).toBe('deleteAttribute');
|
|
148
|
+
});
|
|
149
|
+
});
|
package/src/components/ProfileTableAttributeView/components/AttributeTable/cell-renderers/styles.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {makeStyles} from '@mui/styles';
|
|
2
|
+
import {HistoryOperations, historyPalettes} from '@reltio/mdm-sdk';
|
|
3
|
+
|
|
4
|
+
const BLOB_HEIGHT = 100;
|
|
5
|
+
|
|
6
|
+
const removedStyle = {
|
|
7
|
+
textDecoration: 'line-through',
|
|
8
|
+
color: 'rgba(0,0,0,.54)'
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const useStyles = makeStyles(() => ({
|
|
12
|
+
headCell: {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
height: '100%',
|
|
16
|
+
fontSize: '12px'
|
|
17
|
+
},
|
|
18
|
+
rowCell: {
|
|
19
|
+
fontSize: '13px',
|
|
20
|
+
overflow: 'hidden'
|
|
21
|
+
},
|
|
22
|
+
blobWrapper: {
|
|
23
|
+
position: 'relative',
|
|
24
|
+
overflowY: 'auto',
|
|
25
|
+
overflowX: 'hidden',
|
|
26
|
+
whiteSpace: 'pre',
|
|
27
|
+
maxHeight: `${BLOB_HEIGHT}px`,
|
|
28
|
+
boxSizing: 'border-box',
|
|
29
|
+
padding: '15px 25px 0 25px'
|
|
30
|
+
},
|
|
31
|
+
defaultWrapper: {
|
|
32
|
+
whiteSpace: 'nowrap',
|
|
33
|
+
overflow: 'hidden',
|
|
34
|
+
textOverflow: 'ellipsis',
|
|
35
|
+
padding: '15px 25px 0 25px'
|
|
36
|
+
},
|
|
37
|
+
updateAttribute: {
|
|
38
|
+
padding: '0 4px',
|
|
39
|
+
marginLeft: '-4px',
|
|
40
|
+
...historyPalettes[HistoryOperations.updateAttribute]
|
|
41
|
+
},
|
|
42
|
+
insertAttribute: {
|
|
43
|
+
...historyPalettes[HistoryOperations.insertAttribute]
|
|
44
|
+
},
|
|
45
|
+
deleteAttribute: {
|
|
46
|
+
padding: '0 4px',
|
|
47
|
+
marginLeft: '-4px',
|
|
48
|
+
textDecoration: 'line-through',
|
|
49
|
+
...historyPalettes[HistoryOperations.deleteAttribute]
|
|
50
|
+
},
|
|
51
|
+
description: {
|
|
52
|
+
marginLeft: '-22px'
|
|
53
|
+
},
|
|
54
|
+
'row-cell--sorted': {
|
|
55
|
+
color: 'rgba(0,0,0,0.87)'
|
|
56
|
+
},
|
|
57
|
+
'row-cell--removed': {
|
|
58
|
+
pointerEvents: 'none',
|
|
59
|
+
'& > div': removedStyle
|
|
60
|
+
}
|
|
61
|
+
}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {makeStyles} from '@mui/styles';
|
|
2
|
+
|
|
3
|
+
export const useStyles = makeStyles(() => ({
|
|
4
|
+
tableContainer: {
|
|
5
|
+
display: 'flex',
|
|
6
|
+
fontFamily: 'Roboto',
|
|
7
|
+
color: 'rgba(0,0,0,0.54)',
|
|
8
|
+
marginBottom: '15px'
|
|
9
|
+
},
|
|
10
|
+
'row-cell__buttons-container': {
|
|
11
|
+
position: 'absolute'
|
|
12
|
+
},
|
|
13
|
+
'row-cell__buttons-wrapper': {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
paddingLeft: '10px',
|
|
16
|
+
'& > button': {
|
|
17
|
+
marginLeft: '-10px',
|
|
18
|
+
transform: 'scale(0.9)'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, {useContext} from 'react';
|
|
2
|
+
import {useSelector} from 'react-redux';
|
|
3
|
+
import {
|
|
4
|
+
FacetViewHeader,
|
|
5
|
+
ColumnsSettings,
|
|
6
|
+
FilterButton,
|
|
7
|
+
VerticalDivider,
|
|
8
|
+
ExpandableSearchInput,
|
|
9
|
+
DescriptionIcon,
|
|
10
|
+
RequiredMark
|
|
11
|
+
} from '@reltio/components';
|
|
12
|
+
import mdmModule from '@reltio/mdm-module';
|
|
13
|
+
import {TableAttributeContext} from '../../contexts/TableAttributeContext';
|
|
14
|
+
import {useStyles} from './styles';
|
|
15
|
+
|
|
16
|
+
type Props = {
|
|
17
|
+
title: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const AttributeTableHeader = ({title}: Props) => {
|
|
21
|
+
const styles = useStyles();
|
|
22
|
+
const isEditableMode = useSelector(mdmModule.selectors.getIsEditableMode);
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
attributeType,
|
|
26
|
+
searchQuery,
|
|
27
|
+
setSearchQuery,
|
|
28
|
+
filters,
|
|
29
|
+
onToggleFilters,
|
|
30
|
+
allColumnsData,
|
|
31
|
+
visibleColumns,
|
|
32
|
+
onChangeColumns
|
|
33
|
+
} = useContext(TableAttributeContext);
|
|
34
|
+
|
|
35
|
+
const showRequiredMark = isEditableMode && attributeType?.required;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<FacetViewHeader title={title} className={styles.header}>
|
|
39
|
+
{showRequiredMark && <RequiredMark />}
|
|
40
|
+
<DescriptionIcon description={attributeType?.description} />
|
|
41
|
+
<ExpandableSearchInput query={searchQuery} onChange={setSearchQuery} />
|
|
42
|
+
<FilterButton enabled={!!filters} onClick={onToggleFilters} />
|
|
43
|
+
<VerticalDivider height={24} margin={4} />
|
|
44
|
+
<ColumnsSettings
|
|
45
|
+
columnsData={allColumnsData}
|
|
46
|
+
selectedColumns={visibleColumns}
|
|
47
|
+
onChangeColumns={onChangeColumns}
|
|
48
|
+
/>
|
|
49
|
+
</FacetViewHeader>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default AttributeTableHeader;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React, {ContextType} from 'react';
|
|
2
|
+
import {mount} from 'enzyme';
|
|
3
|
+
import * as reactRedux from 'react-redux';
|
|
4
|
+
import {
|
|
5
|
+
FacetViewHeader,
|
|
6
|
+
ColumnsSettings,
|
|
7
|
+
FilterButton,
|
|
8
|
+
VerticalDivider,
|
|
9
|
+
ExpandableSearchInput,
|
|
10
|
+
DescriptionIcon,
|
|
11
|
+
RequiredMark
|
|
12
|
+
} from '@reltio/components';
|
|
13
|
+
import {Mode} from '@reltio/mdm-sdk';
|
|
14
|
+
import AttributeTableHeader from '../AttributeTableHeader';
|
|
15
|
+
import {TableAttributeContext} from '../../../contexts/TableAttributeContext';
|
|
16
|
+
|
|
17
|
+
const defaultStore = {
|
|
18
|
+
profile: {
|
|
19
|
+
mode: Mode.Viewing
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
describe('AttributeTableHeader tests', () => {
|
|
24
|
+
const defaultContextValue = {
|
|
25
|
+
attributeType: {
|
|
26
|
+
name: 'n1',
|
|
27
|
+
uri: 'uri1',
|
|
28
|
+
description: '123'
|
|
29
|
+
},
|
|
30
|
+
searchQuery: 'query',
|
|
31
|
+
setSearchQuery: jest.fn(),
|
|
32
|
+
filters: {},
|
|
33
|
+
onToggleFilters: jest.fn(),
|
|
34
|
+
allColumnsData: [],
|
|
35
|
+
visibleColumns: [],
|
|
36
|
+
onChangeColumns: jest.fn()
|
|
37
|
+
} as unknown as ContextType<typeof TableAttributeContext>;
|
|
38
|
+
|
|
39
|
+
let store;
|
|
40
|
+
|
|
41
|
+
beforeAll(() => {
|
|
42
|
+
jest.spyOn(reactRedux, 'useSelector').mockImplementation((selector) => selector(store));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
beforeEach(() => {
|
|
46
|
+
store = defaultStore;
|
|
47
|
+
jest.clearAllMocks();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should render main parts', () => {
|
|
51
|
+
const component = mount(
|
|
52
|
+
<TableAttributeContext.Provider value={defaultContextValue}>
|
|
53
|
+
<AttributeTableHeader title="Title!" />
|
|
54
|
+
</TableAttributeContext.Provider>
|
|
55
|
+
);
|
|
56
|
+
const header = component.find(FacetViewHeader);
|
|
57
|
+
expect(header.prop('title')).toBe('Title!');
|
|
58
|
+
expect(header.find(DescriptionIcon)).toHaveLength(1);
|
|
59
|
+
expect(header.find(DescriptionIcon).prop('description')).toBe(defaultContextValue.attributeType.description);
|
|
60
|
+
expect(header.find(ExpandableSearchInput)).toHaveLength(1);
|
|
61
|
+
expect(header.find(ExpandableSearchInput).prop('query')).toBe(defaultContextValue.searchQuery);
|
|
62
|
+
expect(header.find(ExpandableSearchInput).prop('onChange')).toBe(defaultContextValue.setSearchQuery);
|
|
63
|
+
expect(header.find(FilterButton)).toHaveLength(1);
|
|
64
|
+
expect(header.find(FilterButton).prop('enabled')).toBe(true);
|
|
65
|
+
expect(header.find(FilterButton).prop('onClick')).toBe(defaultContextValue.onToggleFilters);
|
|
66
|
+
expect(header.find(ColumnsSettings)).toHaveLength(1);
|
|
67
|
+
expect(header.find(ColumnsSettings).prop('columnsData')).toBe(defaultContextValue.allColumnsData);
|
|
68
|
+
expect(header.find(ColumnsSettings).prop('onChangeColumns')).toBe(defaultContextValue.onChangeColumns);
|
|
69
|
+
expect(header.find(ColumnsSettings).prop('selectedColumns')).toBe(defaultContextValue.visibleColumns);
|
|
70
|
+
expect(header.find(VerticalDivider)).toHaveLength(1);
|
|
71
|
+
expect(header.find(RequiredMark)).toHaveLength(0);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should render DescriptionIcon with correct description prop if attributeType is undefined', () => {
|
|
75
|
+
const contextValue = {...defaultContextValue, attributeType: undefined};
|
|
76
|
+
const component = mount(
|
|
77
|
+
<TableAttributeContext.Provider value={contextValue}>
|
|
78
|
+
<AttributeTableHeader title="Title!" />
|
|
79
|
+
</TableAttributeContext.Provider>
|
|
80
|
+
);
|
|
81
|
+
expect(component.find(DescriptionIcon)).toHaveLength(1);
|
|
82
|
+
expect(component.find(DescriptionIcon).prop('description')).toBe(undefined);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('should render RequiredMark if isEditableMode is true and attribute type is required', () => {
|
|
86
|
+
store = {profile: {mode: Mode.Editing}};
|
|
87
|
+
const attributeType = {name: 'n1', uri: 'uri1', required: true};
|
|
88
|
+
const contextValue = {...defaultContextValue, attributeType} as ContextType<typeof TableAttributeContext>;
|
|
89
|
+
const component = mount(
|
|
90
|
+
<TableAttributeContext.Provider value={contextValue}>
|
|
91
|
+
<AttributeTableHeader title="Title!" />
|
|
92
|
+
</TableAttributeContext.Provider>
|
|
93
|
+
);
|
|
94
|
+
expect(component.find(RequiredMark)).toHaveLength(1);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React, {useContext, useMemo} from 'react';
|
|
2
|
+
import {isEmpty, propEq} from 'ramda';
|
|
3
|
+
import {useSelector} from 'react-redux';
|
|
4
|
+
import {
|
|
5
|
+
AttributeError,
|
|
6
|
+
AttributeType,
|
|
7
|
+
isAttributeTypeError as checkIsAttributeTypeError,
|
|
8
|
+
Entity,
|
|
9
|
+
isPartOfErrorAttributeTypeUri,
|
|
10
|
+
isPartOfErrorParentUri,
|
|
11
|
+
TableAttributeViewConfig
|
|
12
|
+
} from '@reltio/mdm-sdk';
|
|
13
|
+
import mdmModule from '@reltio/mdm-module';
|
|
14
|
+
import {
|
|
15
|
+
isHighlightedErrorType,
|
|
16
|
+
ScrollToElementContext,
|
|
17
|
+
useScrollToAttributeError,
|
|
18
|
+
withContext
|
|
19
|
+
} from '@reltio/components';
|
|
20
|
+
import AttributeTable from '../AttributeTable/AttributeTable';
|
|
21
|
+
import {useEditableAttribute} from './hooks/useEditableAttribute';
|
|
22
|
+
import {TableAttributeContext} from '../../contexts/TableAttributeContext';
|
|
23
|
+
import {TableAttributeEditableContent} from '../TableAttributeEditableContent/TableAttributeEditableContent';
|
|
24
|
+
|
|
25
|
+
type HighlightedElement = React.ContextType<typeof ScrollToElementContext>;
|
|
26
|
+
|
|
27
|
+
type Props = {
|
|
28
|
+
config: TableAttributeViewConfig;
|
|
29
|
+
entityUri: string;
|
|
30
|
+
attributeType: AttributeType;
|
|
31
|
+
highlightedError?: HighlightedElement;
|
|
32
|
+
highlightedAttributeError?: HighlightedElement;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const TableAttributeContent = ({config, entityUri, highlightedError, highlightedAttributeError}: Props) => {
|
|
36
|
+
const isEditableMode = useSelector(mdmModule.selectors.getIsEditableMode);
|
|
37
|
+
const modifiedEntity = useSelector(
|
|
38
|
+
(state) => mdmModule.selectors.getModifiedEntity(state, entityUri) || ({} as Entity)
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const {values, visibleColumns, onFilter, onSort, filters, sorting, allColumnsData} =
|
|
42
|
+
useContext(TableAttributeContext);
|
|
43
|
+
|
|
44
|
+
const {
|
|
45
|
+
onDeleteAttribute,
|
|
46
|
+
onStartEditing,
|
|
47
|
+
onChangeAttribute,
|
|
48
|
+
onAdd,
|
|
49
|
+
onCancel,
|
|
50
|
+
onApply,
|
|
51
|
+
onReset,
|
|
52
|
+
checkHasChanges,
|
|
53
|
+
modifiedValues,
|
|
54
|
+
editingValues,
|
|
55
|
+
deletedUris
|
|
56
|
+
} = useEditableAttribute();
|
|
57
|
+
const {ref, errorClassName} = useScrollToAttributeError({highlightedError, isSimple: true});
|
|
58
|
+
|
|
59
|
+
const preparedValues = isEditableMode ? modifiedValues : values;
|
|
60
|
+
|
|
61
|
+
const visibleColumnsData = useMemo(
|
|
62
|
+
() => visibleColumns.map((id) => allColumnsData.find(propEq('id', id))),
|
|
63
|
+
[visibleColumns, allColumnsData]
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div ref={ref} className={errorClassName}>
|
|
68
|
+
{isEditableMode && !isEmpty(modifiedEntity) && (
|
|
69
|
+
<TableAttributeEditableContent
|
|
70
|
+
config={config}
|
|
71
|
+
editingValues={editingValues}
|
|
72
|
+
modifiedValues={modifiedValues}
|
|
73
|
+
onChangeAttribute={onChangeAttribute}
|
|
74
|
+
onDeleteAttribute={onDeleteAttribute}
|
|
75
|
+
onAdd={onAdd}
|
|
76
|
+
onReset={onReset}
|
|
77
|
+
onCancel={onCancel}
|
|
78
|
+
onApply={onApply}
|
|
79
|
+
onStartEditing={onStartEditing}
|
|
80
|
+
checkHasChanges={checkHasChanges}
|
|
81
|
+
highlightedError={highlightedError?.element as AttributeError}
|
|
82
|
+
highlightedAttributeError={highlightedAttributeError?.element as AttributeError}
|
|
83
|
+
/>
|
|
84
|
+
)}
|
|
85
|
+
{visibleColumnsData.length > 0 && (
|
|
86
|
+
<AttributeTable
|
|
87
|
+
columnsData={visibleColumnsData}
|
|
88
|
+
config={config}
|
|
89
|
+
values={preparedValues}
|
|
90
|
+
filters={filters}
|
|
91
|
+
onFilter={onFilter}
|
|
92
|
+
sorting={sorting}
|
|
93
|
+
onSort={onSort}
|
|
94
|
+
onEdit={onStartEditing}
|
|
95
|
+
onDeleteAttribute={onDeleteAttribute}
|
|
96
|
+
deletedUris={deletedUris}
|
|
97
|
+
/>
|
|
98
|
+
)}
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export default withContext(
|
|
104
|
+
ScrollToElementContext,
|
|
105
|
+
(contextValue, {entityUri, attributeType}) => {
|
|
106
|
+
const {element, type} = contextValue || {};
|
|
107
|
+
const isError = isHighlightedErrorType(type);
|
|
108
|
+
|
|
109
|
+
const isAttributeTypeError =
|
|
110
|
+
isError && checkIsAttributeTypeError(element as AttributeError, entityUri, attributeType.uri);
|
|
111
|
+
const isAttributeError =
|
|
112
|
+
element &&
|
|
113
|
+
isError &&
|
|
114
|
+
!isAttributeTypeError &&
|
|
115
|
+
isPartOfErrorAttributeTypeUri(attributeType, element) &&
|
|
116
|
+
isPartOfErrorParentUri(entityUri, element);
|
|
117
|
+
|
|
118
|
+
const highlightedError = isAttributeTypeError ? contextValue : null;
|
|
119
|
+
const highlightedAttributeError = isAttributeError ? contextValue : null;
|
|
120
|
+
return {highlightedError, highlightedAttributeError};
|
|
121
|
+
},
|
|
122
|
+
TableAttributeContent
|
|
123
|
+
);
|