@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,103 @@
|
|
|
1
|
+
export const getMetadata = ({tenant}) => ({
|
|
2
|
+
[tenant]: {
|
|
3
|
+
uri: 'configuration',
|
|
4
|
+
entityTypes: [
|
|
5
|
+
{
|
|
6
|
+
uri: 'configuration/entityTypes/HCP',
|
|
7
|
+
attributes: [
|
|
8
|
+
{
|
|
9
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested',
|
|
10
|
+
name: 'FirstLevelNested',
|
|
11
|
+
type: 'Nested',
|
|
12
|
+
attributes: [
|
|
13
|
+
{
|
|
14
|
+
label: 'FirstLevelNestedSub1_HCP',
|
|
15
|
+
name: 'FirstLevelNestedSub1',
|
|
16
|
+
uri: 'configuration/entityTypes/HCP/attributes/FirstLevelNested/attributes/FirstLevelNestedSub1',
|
|
17
|
+
type: 'String',
|
|
18
|
+
required: true
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
uri: 'configuration/entityTypes/HCP/attributes/CountryCode',
|
|
24
|
+
name: 'CountryCode',
|
|
25
|
+
type: 'String'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
uri: 'configuration/entityTypes/HCP/attributes/ContactPreference',
|
|
29
|
+
name: 'ContactPreference',
|
|
30
|
+
type: 'Nested',
|
|
31
|
+
attributes: [
|
|
32
|
+
{
|
|
33
|
+
label: 'Communication Channel Name',
|
|
34
|
+
name: 'ChannelName',
|
|
35
|
+
uri: 'configuration/entityTypes/HCP/attributes/ContactPreference/attributes/ChannelName',
|
|
36
|
+
type: 'String',
|
|
37
|
+
required: true,
|
|
38
|
+
dependentLookupCode: 'CHANNEL_NAME_CD',
|
|
39
|
+
dependentLookupAttributes: [
|
|
40
|
+
'configuration/entityTypes/HCP/attributes/ContactPreference/attributes/ClassificationName'
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Communication Classification',
|
|
45
|
+
name: 'ClassificationName',
|
|
46
|
+
uri: 'configuration/entityTypes/HCP/attributes/ContactPreference/attributes/ClassificationName',
|
|
47
|
+
type: 'String',
|
|
48
|
+
required: true,
|
|
49
|
+
dependentLookupCode: 'CLASSIFICATION_NAME_CD'
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
required: true,
|
|
53
|
+
dataLabelPattern: '{ClassificationName} [- {ChannelName}]'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
uri: 'configuration/entityTypes/HCP/attributes/Test',
|
|
57
|
+
name: 'Test',
|
|
58
|
+
type: 'Nested',
|
|
59
|
+
attributes: [
|
|
60
|
+
{
|
|
61
|
+
label: 'Country Code Lookup',
|
|
62
|
+
name: 'CountryCodeLookup',
|
|
63
|
+
uri: 'configuration/entityTypes/HCP/attributes/Test/attributes/CountryCodeLookup',
|
|
64
|
+
type: 'String',
|
|
65
|
+
required: true,
|
|
66
|
+
defaultValue: 'PT',
|
|
67
|
+
dependentLookupCode: 'COUNTRY_CD'
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
required: true,
|
|
71
|
+
dataLabelPattern: '{CountryCodeLookup}'
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
analyticsAttributes: [],
|
|
75
|
+
label: 'HCP'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
uri: 'configuration/entityTypes/HCA',
|
|
79
|
+
attributes: [
|
|
80
|
+
{
|
|
81
|
+
label: 'Address',
|
|
82
|
+
name: 'HCPtoHCA',
|
|
83
|
+
type: 'Reference',
|
|
84
|
+
uri: 'configuration/entityTypes/HCA/attributes/HCPtoHCA',
|
|
85
|
+
referencedEntityTypeURI: 'configuration/entityTypes/HCP',
|
|
86
|
+
relationshipTypeURI: 'configuration/relationTypes/HCPtoHCA',
|
|
87
|
+
referencedAttributeURIs: ['configuration/entityTypes/HCP/attributes/ContactPreference'],
|
|
88
|
+
required: true
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
label: 'HCA'
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
relationTypes: [
|
|
95
|
+
{
|
|
96
|
+
uri: 'configuration/relationTypes/HCPtoHCA',
|
|
97
|
+
label: 'Affiliated with',
|
|
98
|
+
description: 'test',
|
|
99
|
+
attributes: []
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {Mode} from '@reltio/mdm-sdk';
|
|
2
|
+
import {getMetadata} from './metadata.data';
|
|
3
|
+
|
|
4
|
+
export const createInitialState = ({mode = Mode.Viewing, entityTypeUri = 'configuration/entityTypes/HCP'} = {}) => {
|
|
5
|
+
const tenant = 't1';
|
|
6
|
+
return {
|
|
7
|
+
metadata: getMetadata({tenant}),
|
|
8
|
+
profile: {
|
|
9
|
+
entity: {
|
|
10
|
+
uri: 'entities/1rIaPEx4',
|
|
11
|
+
type: entityTypeUri,
|
|
12
|
+
attributes: {}
|
|
13
|
+
},
|
|
14
|
+
modifiedEntities: {},
|
|
15
|
+
views: [],
|
|
16
|
+
history: {},
|
|
17
|
+
mode,
|
|
18
|
+
dependentLookups: {
|
|
19
|
+
structure: {},
|
|
20
|
+
editors: {},
|
|
21
|
+
initedTypeUris: ['']
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
tenant: {
|
|
25
|
+
id: tenant
|
|
26
|
+
},
|
|
27
|
+
ui: {
|
|
28
|
+
paths: {
|
|
29
|
+
apiPath: 'https://tst-01.reltio.com/reltio'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
search: {
|
|
33
|
+
searchOptions: {
|
|
34
|
+
searchByOv: true,
|
|
35
|
+
ovOnly: true
|
|
36
|
+
},
|
|
37
|
+
globalFilter: {
|
|
38
|
+
query: null
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, {useContext, useRef, useState} from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import i18n from 'ui-i18n';
|
|
4
|
+
import Popover from '@mui/material/Popover';
|
|
5
|
+
import Button from '@mui/material/Button';
|
|
6
|
+
import FilterIcon from '@mui/icons-material/FilterList';
|
|
7
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
8
|
+
import Checkbox from '@mui/material/Checkbox';
|
|
9
|
+
|
|
10
|
+
import {SingleAttributeContext} from '../../contexts/SingleAttributeContext';
|
|
11
|
+
import {useStyles} from './styles';
|
|
12
|
+
|
|
13
|
+
type Props = {
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const FilterButton = ({className}: Props) => {
|
|
18
|
+
const styles = useStyles();
|
|
19
|
+
const buttonRef = useRef();
|
|
20
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
21
|
+
const {showInactive, toggleShowInactive} = useContext(SingleAttributeContext);
|
|
22
|
+
|
|
23
|
+
const togglePopup = () => setIsOpen((open) => !open);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<>
|
|
27
|
+
<Button ref={buttonRef} classes={{root: classnames(styles.triggerButton, className)}} onClick={togglePopup}>
|
|
28
|
+
<FilterIcon />
|
|
29
|
+
</Button>
|
|
30
|
+
<Popover
|
|
31
|
+
open={isOpen}
|
|
32
|
+
classes={{paper: styles.popupContent}}
|
|
33
|
+
anchorEl={buttonRef.current}
|
|
34
|
+
onClose={togglePopup}
|
|
35
|
+
anchorOrigin={{
|
|
36
|
+
vertical: 'bottom',
|
|
37
|
+
horizontal: 'right'
|
|
38
|
+
}}
|
|
39
|
+
transformOrigin={{
|
|
40
|
+
vertical: 'top',
|
|
41
|
+
horizontal: 'right'
|
|
42
|
+
}}
|
|
43
|
+
>
|
|
44
|
+
<FormControlLabel
|
|
45
|
+
classes={{
|
|
46
|
+
root: styles.checkboxControlRoot,
|
|
47
|
+
label: styles.checkboxControlLabel
|
|
48
|
+
}}
|
|
49
|
+
control={
|
|
50
|
+
<Checkbox
|
|
51
|
+
className={styles.checkboxControlCheckbox}
|
|
52
|
+
checked={showInactive}
|
|
53
|
+
onChange={(e) => toggleShowInactive(e.target.checked)}
|
|
54
|
+
/>
|
|
55
|
+
}
|
|
56
|
+
label={i18n.text('Show inactive values')}
|
|
57
|
+
/>
|
|
58
|
+
</Popover>
|
|
59
|
+
</>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default FilterButton;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {ReactWrapper, mount} from 'enzyme';
|
|
3
|
+
import Button from '@mui/material/Button';
|
|
4
|
+
import Popover from '@mui/material/Popover';
|
|
5
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
6
|
+
|
|
7
|
+
import FilterButton from '../FilterButton';
|
|
8
|
+
import {SingleAttributeContext} from '../../../contexts/SingleAttributeContext';
|
|
9
|
+
|
|
10
|
+
const singleAttribute = {
|
|
11
|
+
searchQuery: '',
|
|
12
|
+
setSearchQuery: jest.fn(),
|
|
13
|
+
values: [],
|
|
14
|
+
page: 1,
|
|
15
|
+
setPage: jest.fn(),
|
|
16
|
+
isLoading: false,
|
|
17
|
+
showInactive: false,
|
|
18
|
+
toggleShowInactive: jest.fn(),
|
|
19
|
+
hasPaging: true,
|
|
20
|
+
totalVisibleValues: 0,
|
|
21
|
+
totalNonVisibleValues: 0,
|
|
22
|
+
nonVisibleValues: [],
|
|
23
|
+
attributeType: {
|
|
24
|
+
name: 'name',
|
|
25
|
+
type: 'type',
|
|
26
|
+
uri: 'uri'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const findTriggerButton = (component) => component.find(Button);
|
|
31
|
+
const findPopover = (component) => component.find(Popover);
|
|
32
|
+
const togglePopover = (component) => findTriggerButton(component).find('button').simulate('click');
|
|
33
|
+
const findControl = (component) => findPopover(component).find(FormControlLabel);
|
|
34
|
+
const findCheckbox = (component) => {
|
|
35
|
+
return new ReactWrapper(findControl(component).prop('control'));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
describe('FilterButton tests', () => {
|
|
39
|
+
it('should render Button and closed Popover', () => {
|
|
40
|
+
const component = mount(
|
|
41
|
+
<SingleAttributeContext.Provider value={singleAttribute}>
|
|
42
|
+
<FilterButton />
|
|
43
|
+
</SingleAttributeContext.Provider>
|
|
44
|
+
);
|
|
45
|
+
expect(findTriggerButton).toHaveLength(1);
|
|
46
|
+
const popover = findPopover(component);
|
|
47
|
+
expect(popover.length).toBe(1);
|
|
48
|
+
expect(popover.prop('open')).toBe(false);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should toggle Popover after click on filter Button', () => {
|
|
52
|
+
const component = mount(
|
|
53
|
+
<SingleAttributeContext.Provider value={singleAttribute}>
|
|
54
|
+
<FilterButton />
|
|
55
|
+
</SingleAttributeContext.Provider>
|
|
56
|
+
);
|
|
57
|
+
expect(findPopover(component).prop('open')).toBe(false);
|
|
58
|
+
findTriggerButton(component).find('button').simulate('click');
|
|
59
|
+
expect(findPopover(component).prop('open')).toBe(true);
|
|
60
|
+
findTriggerButton(component).find('button').simulate('click');
|
|
61
|
+
expect(findPopover(component).prop('open')).toBe(false);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should render checkbox with initial values according context', () => {
|
|
65
|
+
const component = mount(
|
|
66
|
+
<SingleAttributeContext.Provider value={singleAttribute}>
|
|
67
|
+
<FilterButton />
|
|
68
|
+
</SingleAttributeContext.Provider>
|
|
69
|
+
);
|
|
70
|
+
togglePopover(component);
|
|
71
|
+
const control = findControl(component);
|
|
72
|
+
expect(control.length).toBe(1);
|
|
73
|
+
const checkbox = findCheckbox(component);
|
|
74
|
+
expect(checkbox.length).toBe(1);
|
|
75
|
+
expect(checkbox.prop('checked')).toBe(false);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('should call "toggleShowInactive" on checkbox change', () => {
|
|
79
|
+
const component = mount(
|
|
80
|
+
<SingleAttributeContext.Provider value={singleAttribute}>
|
|
81
|
+
<FilterButton />
|
|
82
|
+
</SingleAttributeContext.Provider>
|
|
83
|
+
);
|
|
84
|
+
togglePopover(component);
|
|
85
|
+
const checkbox = findCheckbox(component);
|
|
86
|
+
(checkbox.prop('onChange') as (target) => void)({
|
|
87
|
+
target: {
|
|
88
|
+
checked: true
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
expect(singleAttribute.toggleShowInactive).toHaveBeenCalledWith(true);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {makeStyles} from '@mui/styles';
|
|
2
|
+
|
|
3
|
+
export const useStyles = makeStyles(() => ({
|
|
4
|
+
triggerButton: {
|
|
5
|
+
minWidth: 0,
|
|
6
|
+
color: 'rgba(0,0,0,0.54)',
|
|
7
|
+
width: '36px'
|
|
8
|
+
},
|
|
9
|
+
popupContent: {
|
|
10
|
+
paddingTop: '19px',
|
|
11
|
+
paddingBottom: '23px',
|
|
12
|
+
paddingLeft: '23px',
|
|
13
|
+
paddingRight: '23px',
|
|
14
|
+
maxWidth: '180px',
|
|
15
|
+
width: '40%'
|
|
16
|
+
},
|
|
17
|
+
checkboxControlRoot: {
|
|
18
|
+
marginTop: '6px',
|
|
19
|
+
marginLeft: '-12px'
|
|
20
|
+
},
|
|
21
|
+
checkboxControlLabel: {
|
|
22
|
+
fontSize: '0.85rem'
|
|
23
|
+
},
|
|
24
|
+
checkboxControlCheckbox: {
|
|
25
|
+
marginRight: '5px'
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import React, {useCallback, useContext, useMemo} from 'react';
|
|
2
|
+
import i18n from 'ui-i18n';
|
|
3
|
+
import {always, cond, isEmpty, map, pathOr, pipe, prop, propEq} from 'ramda';
|
|
4
|
+
import {useDispatch, useSelector} from 'react-redux';
|
|
5
|
+
import Button from '@mui/material/Button';
|
|
6
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
7
|
+
import Divider from '@mui/material/Divider';
|
|
8
|
+
import Typography from '@mui/material/Typography';
|
|
9
|
+
import classnames from 'classnames';
|
|
10
|
+
import {
|
|
11
|
+
CardinalityMessage,
|
|
12
|
+
EditableAttribute,
|
|
13
|
+
ErrorMessage,
|
|
14
|
+
isHighlightedErrorType,
|
|
15
|
+
ScrollToElementContext,
|
|
16
|
+
useScrollToAttributeError,
|
|
17
|
+
ViewIdContext,
|
|
18
|
+
withContext
|
|
19
|
+
} from '@reltio/components';
|
|
20
|
+
import mdmModule, {profile} from '@reltio/mdm-module';
|
|
21
|
+
import {
|
|
22
|
+
AttributeType,
|
|
23
|
+
AttributeValue,
|
|
24
|
+
checkCanCreateAttribute,
|
|
25
|
+
createNewAttribute,
|
|
26
|
+
Entity,
|
|
27
|
+
getAttributeOwnError,
|
|
28
|
+
getAttributePagerActiveTypeErrorMessage,
|
|
29
|
+
getAttributeSource,
|
|
30
|
+
isComplexAttribute,
|
|
31
|
+
isEmptyValue,
|
|
32
|
+
isOv,
|
|
33
|
+
isTempUri,
|
|
34
|
+
AttributeItem,
|
|
35
|
+
isAttributeTypeError,
|
|
36
|
+
AttributeError
|
|
37
|
+
} from '@reltio/mdm-sdk';
|
|
38
|
+
import {areValuesEqual} from '../../../hooks/helpers';
|
|
39
|
+
|
|
40
|
+
import {useStyles} from './styles';
|
|
41
|
+
|
|
42
|
+
type Props = {
|
|
43
|
+
values: AttributeValue[];
|
|
44
|
+
attributeType: AttributeType;
|
|
45
|
+
parentUri: string;
|
|
46
|
+
showInactive: boolean;
|
|
47
|
+
noDataText: string;
|
|
48
|
+
highlightedError?: React.ContextType<typeof ScrollToElementContext>;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const emptyArray = [];
|
|
52
|
+
|
|
53
|
+
const SingleAttributeEditableContent = ({
|
|
54
|
+
values,
|
|
55
|
+
attributeType,
|
|
56
|
+
parentUri,
|
|
57
|
+
showInactive,
|
|
58
|
+
noDataText,
|
|
59
|
+
highlightedError
|
|
60
|
+
}: Props) => {
|
|
61
|
+
const styles = useStyles();
|
|
62
|
+
|
|
63
|
+
const {uri: attributeTypeUri, required: isRequired, cardinality, name} = attributeType;
|
|
64
|
+
const dispatch = useDispatch();
|
|
65
|
+
const viewId = useContext(ViewIdContext);
|
|
66
|
+
const entity = useSelector(mdmModule.selectors.getEntity);
|
|
67
|
+
const modifiedEntity = useSelector(
|
|
68
|
+
(state) => mdmModule.selectors.getModifiedEntity(state, entity.uri) || ({} as Entity)
|
|
69
|
+
);
|
|
70
|
+
const errors = useSelector((state) =>
|
|
71
|
+
mdmModule.selectors.getActiveErrorsForAttributesPager(state, parentUri, attributeType)
|
|
72
|
+
);
|
|
73
|
+
const errorMessage = useSelector((state) =>
|
|
74
|
+
getAttributePagerActiveTypeErrorMessage(parentUri, attributeType, mdmModule.selectors.getProfileErrors(state))
|
|
75
|
+
);
|
|
76
|
+
const mode = useSelector(mdmModule.selectors.getMode);
|
|
77
|
+
const attributeSource = getAttributeSource(attributeType);
|
|
78
|
+
const entityValuesUris: string[] = pipe(pathOr(emptyArray, [attributeSource, name]), map(prop('uri')))(entity);
|
|
79
|
+
const modifiedEntityValues: AttributeValue[] = pathOr(emptyArray, [attributeSource, name], modifiedEntity);
|
|
80
|
+
const modifiedEntityValuesUris: string[] = modifiedEntityValues.map(prop('uri'));
|
|
81
|
+
const showEmptyEditors = isTempUri(entity.uri);
|
|
82
|
+
|
|
83
|
+
const emptyEditorValue: AttributeValue = useMemo(
|
|
84
|
+
() =>
|
|
85
|
+
createNewAttribute({
|
|
86
|
+
parentUri,
|
|
87
|
+
attributeType
|
|
88
|
+
}),
|
|
89
|
+
[parentUri, attributeType]
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const {ref, errorClassName} = useScrollToAttributeError({highlightedError, isSimple: true});
|
|
93
|
+
|
|
94
|
+
const isModifiedEntityValuesEmpty = isEmptyValue(modifiedEntityValues);
|
|
95
|
+
const showEmpty = isRequired && isModifiedEntityValuesEmpty;
|
|
96
|
+
|
|
97
|
+
const newValues = showEmpty ? [emptyEditorValue] : modifiedEntityValues.filter(pipe(prop('uri'), isTempUri));
|
|
98
|
+
|
|
99
|
+
const onAddAttributes = useCallback(
|
|
100
|
+
(params: AttributeItem[]) =>
|
|
101
|
+
pipe(profile.actions.addAttributes, dispatch)(params.map((param) => ({...param, viewId}))),
|
|
102
|
+
[viewId, dispatch]
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const onChangeAttribute = useCallback(
|
|
106
|
+
(params: AttributeItem) => pipe(profile.actions.modifyAttribute, dispatch)({...params, viewId}),
|
|
107
|
+
[viewId, dispatch]
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const onDeleteAttribute = useCallback(
|
|
111
|
+
(params: AttributeItem) => pipe(profile.actions.removeAttribute, dispatch)({...params, viewId}),
|
|
112
|
+
[viewId, dispatch]
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
const onDeactivateError = useCallback(pipe(profile.errors.actions.errorDeactivated, dispatch), [dispatch]);
|
|
116
|
+
|
|
117
|
+
const onAdd = useCallback(() => {
|
|
118
|
+
const attribute: AttributeItem = {
|
|
119
|
+
parentUri,
|
|
120
|
+
attributeType
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return onAddAttributes(
|
|
124
|
+
showEmpty && !isComplexAttribute(attributeType.type) ? [attribute, attribute] : [attribute]
|
|
125
|
+
);
|
|
126
|
+
}, [onAddAttributes, parentUri, attributeType, showEmpty]);
|
|
127
|
+
|
|
128
|
+
const canCreate = checkCanCreateAttribute({attributeType, mode});
|
|
129
|
+
|
|
130
|
+
const commonProps = {
|
|
131
|
+
attributeType: attributeType,
|
|
132
|
+
errors,
|
|
133
|
+
crosswalks: modifiedEntity.crosswalks,
|
|
134
|
+
mode,
|
|
135
|
+
onAddAttributes,
|
|
136
|
+
onChangeAttribute,
|
|
137
|
+
onDeactivateError,
|
|
138
|
+
showNonOv: showInactive
|
|
139
|
+
};
|
|
140
|
+
const isEmptyAttributeList = newValues.length === 0 && values.length === 0;
|
|
141
|
+
return (
|
|
142
|
+
!isEmpty(modifiedEntity) && (
|
|
143
|
+
<div ref={ref} className={errorClassName}>
|
|
144
|
+
<CardinalityMessage cardinality={cardinality} />
|
|
145
|
+
<ErrorMessage message={errorMessage} />
|
|
146
|
+
{canCreate && (
|
|
147
|
+
<Button color="primary" onClick={onAdd} className={styles.moreButton}>
|
|
148
|
+
<AddIcon classes={{root: styles.icon}} />
|
|
149
|
+
<div className={styles.buttonLabel}>{i18n.text('Add')}</div>
|
|
150
|
+
</Button>
|
|
151
|
+
)}
|
|
152
|
+
{newValues.map((value, idx) => (
|
|
153
|
+
<EditableAttribute
|
|
154
|
+
key={value.uri}
|
|
155
|
+
{...commonProps}
|
|
156
|
+
attributeValue={value}
|
|
157
|
+
lazy={showEmpty && !isRequired}
|
|
158
|
+
showEmptyEditors={showEmptyEditors}
|
|
159
|
+
ownError={getAttributeOwnError(value, idx, attributeTypeUri, errors)}
|
|
160
|
+
onDeleteAttribute={onDeleteAttribute}
|
|
161
|
+
isEmptyEditor={showEmpty}
|
|
162
|
+
/>
|
|
163
|
+
))}
|
|
164
|
+
{newValues.length > 0 && values.length > 0 && <Divider className={styles.divider} />}
|
|
165
|
+
{values.map((originalValue) => {
|
|
166
|
+
const modifiedEntityValue = modifiedEntityValues.find(propEq('uri', originalValue.uri));
|
|
167
|
+
const value = modifiedEntityValue || originalValue;
|
|
168
|
+
const deleted =
|
|
169
|
+
entityValuesUris.includes(value.uri) && !modifiedEntityValuesUris.includes(value.uri);
|
|
170
|
+
const edited =
|
|
171
|
+
!deleted && modifiedEntityValue && !areValuesEqual(modifiedEntityValue, originalValue);
|
|
172
|
+
const state = cond([
|
|
173
|
+
[always(deleted), always('deleted')],
|
|
174
|
+
[always(edited), always('edited')]
|
|
175
|
+
])();
|
|
176
|
+
return (
|
|
177
|
+
<div key={value.uri} className={classnames({[styles.ovFalse]: !isOv(value)})}>
|
|
178
|
+
<EditableAttribute
|
|
179
|
+
{...commonProps}
|
|
180
|
+
attributeValue={value}
|
|
181
|
+
ownError={getAttributeOwnError(value, null, attributeTypeUri, errors)}
|
|
182
|
+
onDeleteAttribute={onDeleteAttribute}
|
|
183
|
+
state={state}
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
186
|
+
);
|
|
187
|
+
})}
|
|
188
|
+
{isEmptyAttributeList && <Typography className={styles.noData}>{noDataText}</Typography>}
|
|
189
|
+
</div>
|
|
190
|
+
)
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export default withContext(
|
|
195
|
+
ScrollToElementContext,
|
|
196
|
+
(contextValue, {parentUri, attributeType}) => {
|
|
197
|
+
const {element, type} = contextValue || {};
|
|
198
|
+
const isHighlighted =
|
|
199
|
+
isHighlightedErrorType(type) &&
|
|
200
|
+
isAttributeTypeError(element as AttributeError, parentUri, attributeType.uri);
|
|
201
|
+
return {highlightedError: isHighlighted ? contextValue : null};
|
|
202
|
+
},
|
|
203
|
+
SingleAttributeEditableContent
|
|
204
|
+
);
|