@truedat/dd 8.6.7 → 8.7.1
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/package.json +3 -3
- package/src/components/BucketView.js +2 -2
- package/src/components/CatalogCustomViewCards.js +1 -1
- package/src/components/DictionaryRoutes.js +3 -3
- package/src/components/FilteredNav.js +3 -3
- package/src/components/Grant.js +4 -4
- package/src/components/GrantApprovalRule.js +1 -1
- package/src/components/GrantApprovalRuleConditions.js +1 -1
- package/src/components/GrantApprovalRuleDeleteButton.js +1 -1
- package/src/components/GrantApprovalRuleEdit.js +1 -1
- package/src/components/GrantApprovalRuleForm.js +6 -6
- package/src/components/GrantApprovalRules.js +1 -1
- package/src/components/GrantFilters.js +1 -1
- package/src/components/GrantFiltersLoader.js +1 -1
- package/src/components/GrantRemovalDirectButton.js +1 -1
- package/src/components/GrantRemovalWorkflow.js +2 -2
- package/src/components/GrantRemovalWorkflowDropdown.js +1 -1
- package/src/components/GrantRequest.js +3 -3
- package/src/components/GrantRequestApprovalForm.js +2 -2
- package/src/components/GrantRequestApprovalResults.js +1 -1
- package/src/components/GrantRequestBulkActions.js +2 -2
- package/src/components/GrantRequestBulkRoleSelector.js +1 -1
- package/src/components/GrantRequestCartResult.js +13 -3
- package/src/components/GrantRequestSummary.js +1 -1
- package/src/components/GrantRequests.js +2 -2
- package/src/components/GrantRequestsSearchResults.js +7 -7
- package/src/components/GrantRoutes.js +3 -9
- package/src/components/Grants.js +14 -4
- package/src/components/GrantsDownloadButton.js +1 -1
- package/src/components/GrantsLabelResults.js +2 -5
- package/src/components/GrantsLoader.js +2 -2
- package/src/components/GrantsTable.js +3 -8
- package/src/components/GraphLoader.js +1 -1
- package/src/components/LineageContextMenu.js +1 -1
- package/src/components/LineageDownloadButton.js +2 -2
- package/src/components/LineageEventsTable.js +1 -1
- package/src/components/LineageGraph.js +7 -6
- package/src/components/LineageGroup.js +2 -7
- package/src/components/LinkLabelsSelector.js +1 -1
- package/src/components/MyGrantRequests.js +1 -1
- package/src/components/ProfileGroup.js +2 -2
- package/src/components/ReferenceDatasetActions.js +1 -1
- package/src/components/ReferenceDatasetCreate.js +1 -1
- package/src/components/ReferenceDatasetDetail.js +1 -1
- package/src/components/ReferenceDatasetFieldSelector.js +5 -5
- package/src/components/ReferenceDatasetForm.js +3 -3
- package/src/components/ReferenceDatasetSelectorInputField.js +3 -3
- package/src/components/ReferenceDatasetsTable.js +1 -1
- package/src/components/StructureChildrenRelations.js +1 -1
- package/src/components/StructureConfidentialButton.js +1 -1
- package/src/components/StructureCrumbs.js +3 -3
- package/src/components/StructureDeleteButton.js +1 -1
- package/src/components/StructureFields.js +3 -3
- package/src/components/StructureFieldsDropdown.js +10 -10
- package/src/components/StructureGrantCart.js +3 -3
- package/src/components/StructureGrantCartCheckout.js +9 -4
- package/src/components/StructureGrantCartInformation.js +2 -7
- package/src/components/StructureGrantListButton.js +5 -5
- package/src/components/StructureGrantRequestAddCart.js +1 -1
- package/src/components/StructureGrantSummaryButton.js +2 -2
- package/src/components/StructureGrants.js +2 -2
- package/src/components/StructureItem.js +4 -4
- package/src/components/StructureItemRoot.js +1 -1
- package/src/components/StructureLoader.js +1 -2
- package/src/components/StructureMetadata.js +23 -17
- package/src/components/StructureNav.js +1 -1
- package/src/components/StructureNavClassified.js +1 -1
- package/src/components/StructureNoteActions.js +1 -1
- package/src/components/StructureNotes.js +3 -3
- package/src/components/StructureNotesEdit.js +4 -4
- package/src/components/StructureProfileButton.js +1 -1
- package/src/components/StructureProperties.js +1 -1
- package/src/components/StructureSelector.js +3 -3
- package/src/components/StructureSelectorInputFieldJoin.js +2 -2
- package/src/components/StructureStructureForm.js +2 -2
- package/src/components/StructureStructureLinks.js +5 -5
- package/src/components/StructureTabPane.js +5 -5
- package/src/components/StructureTabPaneRoutes.js +92 -80
- package/src/components/StructureTabRoutes.js +30 -8
- package/src/components/StructureTabs.js +17 -16
- package/src/components/StructureTagForm.js +2 -2
- package/src/components/StructureTags.js +1 -1
- package/src/components/StructureTypeForm.js +3 -3
- package/src/components/StructureTypeLoader.js +1 -1
- package/src/components/StructureTypesLoader.js +1 -1
- package/src/components/StructureTypesRoutes.js +1 -1
- package/src/components/StructureVersions.js +17 -16
- package/src/components/StructureView.js +1 -1
- package/src/components/StructuresBulkUpdate.js +4 -4
- package/src/components/StructuresDomainsUploadOption.js +1 -1
- package/src/components/StructuresDownloadOption.js +1 -1
- package/src/components/StructuresGrantRequestView.js +1 -1
- package/src/components/StructuresLoader.js +1 -1
- package/src/components/StructuresRoutes.js +2 -2
- package/src/components/StructuresTable.js +4 -4
- package/src/components/StructuresUpdateOption.js +3 -3
- package/src/components/StructuresUploadEventsTable.js +9 -9
- package/src/components/StructuresUploadOption.js +14 -14
- package/src/components/StructuresView.js +1 -1
- package/src/components/SystemCards.js +7 -7
- package/src/components/SystemForm.js +2 -2
- package/src/components/SystemLoader.js +1 -1
- package/src/components/SystemStructures.js +2 -2
- package/src/components/SystemView.js +3 -3
- package/src/components/Task.js +6 -6
- package/src/components/Tasks.js +1 -1
- package/src/components/ValueConditionStructure.js +2 -2
- package/src/components/__tests__/BucketView.spec.js +2 -2
- package/src/components/__tests__/CatalogCustomViewCards.spec.js +1 -1
- package/src/components/__tests__/CatalogViewConfigForm.spec.js +2 -2
- package/src/components/__tests__/CatalogViewConfigs.spec.js +2 -2
- package/src/components/__tests__/DictionaryRoutes.spec.js +7 -3
- package/src/components/__tests__/EditDomainForm.spec.js +3 -3
- package/src/components/__tests__/FilteredNav.spec.js +4 -4
- package/src/components/__tests__/Grant.spec.js +4 -4
- package/src/components/__tests__/GrantApprovalRuleConditions.spec.js +6 -6
- package/src/components/__tests__/GrantApprovalRuleDeleteButton.spec.js +2 -2
- package/src/components/__tests__/GrantApprovalRuleForm.spec.js +9 -7
- package/src/components/__tests__/GrantApprovalRules.spec.js +3 -3
- package/src/components/__tests__/GrantRemoval.spec.js +4 -4
- package/src/components/__tests__/GrantRemovalDirectButton.spec.js +8 -8
- package/src/components/__tests__/GrantRemovalWorkflow.spec.js +8 -8
- package/src/components/__tests__/GrantRequest.spec.js +1 -1
- package/src/components/__tests__/GrantRequestApprovalForm.spec.js +6 -6
- package/src/components/__tests__/GrantRequestApprovalPopup.spec.js +1 -1
- package/src/components/__tests__/GrantRequestBulkActions.spec.js +8 -8
- package/src/components/__tests__/GrantRequestBulkApprovalForm.spec.js +2 -2
- package/src/components/__tests__/GrantRequestBulkRoleSelector.spec.js +2 -2
- package/src/components/__tests__/GrantRequestCartResult.spec.js +13 -3
- package/src/components/__tests__/GrantRequestHeader.spec.js +2 -2
- package/src/components/__tests__/GrantRequestRow.spec.js +4 -4
- package/src/components/__tests__/GrantRequestSummary.spec.js +1 -1
- package/src/components/__tests__/GrantRequests.spec.js +2 -2
- package/src/components/__tests__/GrantRequestsLabelResults.spec.js +3 -3
- package/src/components/__tests__/GrantRequestsSearchResults.spec.js +2 -2
- package/src/components/__tests__/GrantRequestsTable.spec.js +1 -1
- package/src/components/__tests__/GrantRoutes.spec.js +16 -16
- package/src/components/__tests__/GrantsDownloadButton.spec.js +68 -40
- package/src/components/__tests__/GrantsLabelResults.spec.js +2 -2
- package/src/components/__tests__/GrantsLoader.spec.js +1 -1
- package/src/components/__tests__/GrantsTable.spec.js +4 -4
- package/src/components/__tests__/LineageForm.spec.js +5 -5
- package/src/components/__tests__/LineageGroup.spec.js +6 -6
- package/src/components/__tests__/LineageResource.spec.js +5 -5
- package/src/components/__tests__/LineageRoutes.spec.js +6 -6
- package/src/components/__tests__/PendingStructureNoteRow.spec.js +4 -4
- package/src/components/__tests__/PendingStructureNotes.spec.js +1 -1
- package/src/components/__tests__/PendingStructureNotesLabelResults.spec.js +1 -1
- package/src/components/__tests__/PendingStructureNotesPagination.spec.js +1 -1
- package/src/components/__tests__/PendingStructureNotesTable.spec.js +2 -2
- package/src/components/__tests__/ProfileExecution.spec.js +2 -2
- package/src/components/__tests__/ProfileGroup.spec.js +2 -2
- package/src/components/__tests__/ReferenceDataset.spec.js +7 -5
- package/src/components/__tests__/ReferenceDatasetCreate.spec.js +1 -1
- package/src/components/__tests__/ReferenceDatasetDetail.spec.js +1 -1
- package/src/components/__tests__/ReferenceDatasetFieldSelector.spec.js +9 -9
- package/src/components/__tests__/ReferenceDatasetForm.spec.js +9 -7
- package/src/components/__tests__/ReferenceDatasetRoutes.spec.js +1 -1
- package/src/components/__tests__/StructureFieldRow.spec.js +3 -3
- package/src/components/__tests__/StructureFieldsDropdown.spec.js +5 -5
- package/src/components/__tests__/StructureGrantCartCheckout.spec.js +2 -2
- package/src/components/__tests__/StructureGrantCartInformation.spec.js +1 -1
- package/src/components/__tests__/StructureGrantCartUserSelector.spec.js +4 -4
- package/src/components/__tests__/StructureGrantDropdown.spec.js +3 -3
- package/src/components/__tests__/StructureGrantListButton.spec.js +4 -4
- package/src/components/__tests__/StructureGrantSummaryButton.spec.js +5 -5
- package/src/components/__tests__/StructureItem.spec.js +3 -3
- package/src/components/__tests__/StructureMetadata.spec.js +2 -4
- package/src/components/__tests__/StructureNavClassified.spec.js +1 -1
- package/src/components/__tests__/StructureNoteActions.spec.js +17 -15
- package/src/components/__tests__/StructureNoteLink.spec.js +8 -9
- package/src/components/__tests__/StructureNotes.spec.js +3 -3
- package/src/components/__tests__/StructureNotesDownloadButton.spec.js +15 -15
- package/src/components/__tests__/StructureNotesEdit.spec.js +1 -1
- package/src/components/__tests__/StructureRelationRow.spec.js +2 -2
- package/src/components/__tests__/StructureRelations.spec.js +2 -2
- package/src/components/__tests__/StructureRow.spec.js +2 -2
- package/src/components/__tests__/StructureSelectorInputField.spec.js +2 -2
- package/src/components/__tests__/StructureSelectorInputFieldJoin.spec.js +1 -1
- package/src/components/__tests__/StructureStructureForm.spec.js +1 -1
- package/src/components/__tests__/StructureStructureLinks.spec.js +15 -15
- package/src/components/__tests__/StructureSummary.spec.js +1 -1
- package/src/components/__tests__/StructureTabPane.spec.js +10 -12
- package/src/components/__tests__/StructureTabRoutes.spec.js +1 -1
- package/src/components/__tests__/StructureTabs.spec.js +24 -8
- package/src/components/__tests__/StructureTag.spec.js +11 -11
- package/src/components/__tests__/StructureTagForm.spec.js +17 -17
- package/src/components/__tests__/StructureTypesRoutes.spec.js +4 -4
- package/src/components/__tests__/StructureVersions.spec.js +0 -1
- package/src/components/__tests__/StructuresBulkUpdate.spec.js +3 -3
- package/src/components/__tests__/StructuresDownloadOption.spec.js +3 -3
- package/src/components/__tests__/StructuresEditableDownloadOption.spec.js +2 -2
- package/src/components/__tests__/StructuresGrantRequestView.spec.js +2 -2
- package/src/components/__tests__/StructuresLabelResults.spec.js +1 -1
- package/src/components/__tests__/StructuresLoader.spec.js +1 -1
- package/src/components/__tests__/StructuresOptions.spec.js +15 -9
- package/src/components/__tests__/StructuresRoutes.spec.js +1 -1
- package/src/components/__tests__/StructuresSearchResults.spec.js +2 -2
- package/src/components/__tests__/StructuresTable.spec.js +5 -5
- package/src/components/__tests__/StructuresUpdateOption.spec.js +2 -2
- package/src/components/__tests__/StructuresUploadOption.spec.js +2 -2
- package/src/components/__tests__/StructuresView.spec.js +6 -6
- package/src/components/__tests__/SystemCards.spec.js +2 -2
- package/src/components/__tests__/SystemFilteredNav.spec.js +1 -1
- package/src/components/__tests__/SystemStructuresLoader.spec.js +1 -1
- package/src/components/__tests__/SystemsRoutes.spec.js +1 -1
- package/src/components/__tests__/TagForm.spec.js +7 -5
- package/src/components/__tests__/TagsRoutes.spec.js +1 -1
- package/src/components/__tests__/Tasks.spec.js +9 -9
- package/src/components/__tests__/TasksRoutes.spec.js +1 -1
- package/src/components/__tests__/ValueConditionStructure.spec.js +2 -2
- package/src/hooks/useBucketPaths.js +1 -1
- package/src/hooks/useBucketStructures.js +1 -1
- package/src/hooks/useCustomTabs.js +1 -1
- package/src/hooks/useGrant.js +7 -3
- package/src/hooks/useGrantRequest.js +4 -4
- package/src/hooks/useStructures.js +4 -5
- package/src/hooks/useTemplatesByIds.js +10 -5
- package/src/messages/en.js +1 -2
- package/src/messages/es.js +1 -2
- package/src/messages/index.js +1 -1
- package/src/reducers/__tests__/bulkUpdateStructuresLoading.spec.js +5 -5
- package/src/reducers/__tests__/creatingGrantRequestApproval.spec.js +3 -3
- package/src/reducers/__tests__/csvGraphDownloading.spec.js +4 -4
- package/src/reducers/__tests__/ddMessage.spec.js +3 -3
- package/src/reducers/__tests__/grantFilters.spec.js +1 -1
- package/src/reducers/__tests__/grantQuery.spec.js +6 -6
- package/src/reducers/__tests__/grantRequests.spec.js +2 -2
- package/src/reducers/__tests__/grantRequestsCart.spec.js +31 -31
- package/src/reducers/__tests__/grantRequestsLoading.spec.js +3 -3
- package/src/reducers/__tests__/grantRequestsQuery.spec.js +2 -2
- package/src/reducers/__tests__/grants.spec.js +2 -2
- package/src/reducers/__tests__/graph.spec.js +1 -1
- package/src/reducers/__tests__/graphLoading.spec.js +6 -4
- package/src/reducers/__tests__/graphRedirect.spec.js +11 -7
- package/src/reducers/__tests__/lineageEventsLoading.spec.js +2 -2
- package/src/reducers/__tests__/lineageQuery.spec.js +6 -6
- package/src/reducers/__tests__/nodes.spec.js +1 -1
- package/src/reducers/__tests__/nodesLoading.spec.js +2 -2
- package/src/reducers/__tests__/profileExecution.spec.js +6 -6
- package/src/reducers/__tests__/profileExecutionLoading.spec.js +5 -3
- package/src/reducers/__tests__/profileGroup.spec.js +12 -12
- package/src/reducers/__tests__/profileGroupLoading.spec.js +6 -6
- package/src/reducers/__tests__/referenceDatasetSaving.spec.js +8 -4
- package/src/reducers/__tests__/selectedGroups.spec.js +2 -2
- package/src/reducers/__tests__/selectedNode.spec.js +5 -5
- package/src/reducers/__tests__/selectedResources.spec.js +5 -5
- package/src/reducers/__tests__/selectedUserSearchFilter.spec.js +3 -3
- package/src/reducers/__tests__/structure.spec.js +2 -2
- package/src/reducers/__tests__/structureActions.spec.js +4 -4
- package/src/reducers/__tests__/structureAncestry.spec.js +6 -6
- package/src/reducers/__tests__/structureChildren.spec.js +2 -2
- package/src/reducers/__tests__/structureFields.spec.js +5 -5
- package/src/reducers/__tests__/structureImpactGraph.spec.js +6 -6
- package/src/reducers/__tests__/structureImpactId.spec.js +7 -7
- package/src/reducers/__tests__/structureLineageGraph.spec.js +7 -7
- package/src/reducers/__tests__/structureLineageId.spec.js +7 -7
- package/src/reducers/__tests__/structureLinks.spec.js +6 -6
- package/src/reducers/__tests__/structureLoading.spec.js +2 -2
- package/src/reducers/__tests__/structureNotes.spec.js +1 -1
- package/src/reducers/__tests__/structureParents.spec.js +2 -2
- package/src/reducers/__tests__/structureProfile.spec.js +9 -6
- package/src/reducers/__tests__/structureQuery.spec.js +4 -4
- package/src/reducers/__tests__/structureRedirect.spec.js +9 -9
- package/src/reducers/__tests__/structureRelations.spec.js +4 -4
- package/src/reducers/__tests__/structureSiblings.spec.js +2 -2
- package/src/reducers/__tests__/structureSystem.spec.js +3 -3
- package/src/reducers/__tests__/structureTagSaving.spec.js +2 -2
- package/src/reducers/__tests__/structureType.spec.js +2 -2
- package/src/reducers/__tests__/structureTypeLoading.spec.js +6 -6
- package/src/reducers/__tests__/structureVersion.spec.js +4 -4
- package/src/reducers/__tests__/structureVersions.spec.js +9 -5
- package/src/reducers/__tests__/structures.spec.js +3 -3
- package/src/reducers/__tests__/structuresAliasNameMode.spec.js +5 -5
- package/src/reducers/__tests__/structuresUploadEvents.spec.js +1 -1
- package/src/reducers/__tests__/structuresUploadEventsLoading.spec.js +4 -4
- package/src/reducers/__tests__/system.spec.js +2 -2
- package/src/reducers/__tests__/systemId.spec.js +3 -3
- package/src/reducers/__tests__/systemStructures.spec.js +3 -3
- package/src/reducers/__tests__/systemStructuresLoading.spec.js +2 -2
- package/src/reducers/ddMessage.js +1 -1
- package/src/reducers/grantFilters.js +1 -1
- package/src/reducers/grantRequestsCart.js +16 -13
- package/src/reducers/grantSelectedFilter.js +1 -1
- package/src/reducers/profileGroup.js +1 -1
- package/src/reducers/selectedResources.js +1 -1
- package/src/reducers/selectedUserSearchFilter.js +1 -1
- package/src/reducers/structure.js +1 -1
- package/src/reducers/structureImpactGraph.js +1 -1
- package/src/reducers/structureLineageGraph.js +1 -1
- package/src/reducers/structureRedirect.js +1 -1
- package/src/reducers/structuresAliasNameMode.js +1 -1
- package/src/reducers/structuresUploadEvents.js +1 -1
- package/src/reducers/systemId.js +1 -1
- package/src/reducers/userSearchFilters.js +1 -1
- package/src/routines.js +31 -32
- package/src/sagas/__tests__/createGrantApprovalRule.spec.js +1 -1
- package/src/sagas/__tests__/createGrantRequestApproval.spec.js +1 -1
- package/src/sagas/__tests__/createGrantRequestStatus.spec.js +1 -1
- package/src/sagas/__tests__/createGraph.spec.js +5 -5
- package/src/sagas/__tests__/createProfileGroup.spec.js +10 -10
- package/src/sagas/__tests__/deleteGrantApprovalRule.spec.js +1 -1
- package/src/sagas/__tests__/deleteStructureStructureLink.spec.js +1 -1
- package/src/sagas/__tests__/doStructureNoteAction.spec.js +6 -6
- package/src/sagas/__tests__/downloadCsvGraph.spec.js +2 -2
- package/src/sagas/__tests__/fetchGrantFilters.spec.js +1 -1
- package/src/sagas/__tests__/fetchGrantRequestsFilters.spec.js +3 -3
- package/src/sagas/__tests__/fetchProfileExecution.spec.js +3 -3
- package/src/sagas/__tests__/fetchProfileGroup.spec.js +6 -6
- package/src/sagas/__tests__/fetchStructureNotes.spec.js +3 -3
- package/src/sagas/__tests__/fetchStructures.spec.js +2 -2
- package/src/sagas/__tests__/fetchStructuresUploadEvents.spec.js +1 -1
- package/src/sagas/__tests__/fetchSystemStructures.spec.js +4 -4
- package/src/sagas/__tests__/requestGrantRemoval.spec.js +2 -2
- package/src/sagas/__tests__/updateGrantApprovalRule.spec.js +1 -1
- package/src/sagas/__tests__/updateStructure.spec.js +1 -1
- package/src/sagas/__tests__/uploadStructuresDomains.spec.js +3 -3
- package/src/sagas/bulkUpdateStructures.js +1 -1
- package/src/sagas/createGrantApprovalRule.js +1 -1
- package/src/sagas/createGrantRequestApproval.js +1 -1
- package/src/sagas/createGrantRequestStatus.js +2 -2
- package/src/sagas/createGraph.js +3 -3
- package/src/sagas/createProfileGroup.js +1 -1
- package/src/sagas/createSystem.js +2 -2
- package/src/sagas/deleteCatalogViewConfig.js +1 -1
- package/src/sagas/deleteGrantApprovalRule.js +1 -1
- package/src/sagas/deleteStructureStructureLink.js +1 -1
- package/src/sagas/doStructureNoteAction.js +9 -4
- package/src/sagas/downloadCsvGraph.js +2 -2
- package/src/sagas/downloadReferenceDataset.js +1 -1
- package/src/sagas/fetchGrantRequestsFilters.js +1 -1
- package/src/sagas/fetchGraph.js +1 -1
- package/src/sagas/fetchStructuresUploadEvents.js +1 -1
- package/src/sagas/graph/polling.js +4 -4
- package/src/sagas/linkStructureToStructure.js +2 -2
- package/src/sagas/requestGrantRemoval.js +1 -1
- package/src/sagas/updateGrantApprovalRule.js +1 -1
- package/src/sagas/updateStructure.js +1 -1
- package/src/sagas/uploadStructuresDomains.js +2 -2
- package/src/sagas/upsertCatalogViewConfig.js +1 -1
- package/src/selectors/__tests__/getActiveTab.spec.js +99 -28
- package/src/selectors/__tests__/getBusinessConceptsLinksToStructuresColumnsSelector.spec.js +1 -1
- package/src/selectors/__tests__/getGrantRequestsColumns.spec.js +2 -2
- package/src/selectors/__tests__/getGrantRequestsSearchColumns.spec.js +1 -1
- package/src/selectors/__tests__/getGrantsColumns.spec.js +4 -4
- package/src/selectors/__tests__/getParsedEvents.spec.js +1 -1
- package/src/selectors/__tests__/getSortedRelations.spec.js +5 -5
- package/src/selectors/__tests__/getStructureFieldColumns.spec.js +1 -1
- package/src/selectors/__tests__/getStructureRelations.spec.js +1 -1
- package/src/selectors/__tests__/getTabVisibility.spec.js +38 -28
- package/src/selectors/__tests__/messages.spec.js +4 -4
- package/src/selectors/getActiveTab.js +16 -4
- package/src/selectors/getBusinessConceptsLinksToStructuresColumnsSelector.js +1 -1
- package/src/selectors/getGrantAvailableFilters.js +2 -2
- package/src/selectors/getGrantRequestTemplate.js +1 -1
- package/src/selectors/getGrantRequests.js +2 -2
- package/src/selectors/getGrantRequestsColumns.js +6 -6
- package/src/selectors/getGrantRequestsQuery.js +1 -1
- package/src/selectors/getGrantRequestsSearchColumns.js +2 -2
- package/src/selectors/getGrantSelectedFilters.js +1 -1
- package/src/selectors/getGrantsColumns.js +5 -5
- package/src/selectors/getLineageLevels.js +1 -1
- package/src/selectors/getLinkedImplementationsToStructuresColumns.js +1 -1
- package/src/selectors/getRelationSortingCriteria.js +1 -1
- package/src/selectors/getSortedRelations.js +5 -5
- package/src/selectors/getSortedStructureNotes.js +4 -4
- package/src/selectors/getStructureDeletedAt.js +2 -2
- package/src/selectors/getStructureFieldColumns.js +1 -1
- package/src/selectors/getStructureLinks.js +1 -1
- package/src/selectors/getStructureParent.js +2 -2
- package/src/selectors/getStructureProperties.js +1 -1
- package/src/selectors/getStructureRelations.js +4 -4
- package/src/selectors/getStructureSortingCriteria.js +1 -1
- package/src/selectors/getStructureUpdatedAt.js +1 -1
- package/src/selectors/getStructuresFields.js +5 -5
- package/src/selectors/getStructuresUploadEventColumns.js +1 -1
- package/src/selectors/getSystem.js +1 -1
- package/src/selectors/getSystemTemplate.js +1 -1
- package/src/selectors/getTabVisibility.js +2 -2
- package/src/selectors/groupOptionsSelector.js +2 -2
- package/src/selectors/leafClassesSelector.js +1 -1
- package/src/selectors/messages.js +1 -1
- package/src/selectors/metadataViewsSelector.js +6 -6
- package/src/selectors/resourceOptionsSelector.js +2 -2
- package/src/selectors/structureColumnsSelector.js +2 -2
- package/src/selectors/structureNotesColumnsSelector.js +1 -1
- package/src/selectors/templateNamesSelector.js +1 -1
- package/src/selectors/utils/decorators.js +32 -20
|
@@ -7,16 +7,18 @@ describe("<StructureNoteLink />", () => {
|
|
|
7
7
|
<StructureNoteLink
|
|
8
8
|
data_structure_id={42}
|
|
9
9
|
external_id="my-structure-id"
|
|
10
|
-
|
|
10
|
+
/>,
|
|
11
|
+
);
|
|
12
|
+
const link = rendered.container.querySelector(
|
|
13
|
+
'a[href="/structures/42/notes"]',
|
|
11
14
|
);
|
|
12
|
-
const link = rendered.container.querySelector('a[href="/structures/42/notes"]');
|
|
13
15
|
expect(link).toBeInTheDocument();
|
|
14
16
|
expect(rendered.getByText(/my-structure-id/i)).toBeInTheDocument();
|
|
15
17
|
});
|
|
16
18
|
|
|
17
19
|
it("renders only external_id as text when data_structure_id is not provided", () => {
|
|
18
20
|
const rendered = render(
|
|
19
|
-
<StructureNoteLink external_id="some-external-id"
|
|
21
|
+
<StructureNoteLink external_id="some-external-id" />,
|
|
20
22
|
);
|
|
21
23
|
expect(rendered.getByText(/some-external-id/i)).toBeInTheDocument();
|
|
22
24
|
expect(rendered.container.querySelector("a")).not.toBeInTheDocument();
|
|
@@ -24,7 +26,7 @@ describe("<StructureNoteLink />", () => {
|
|
|
24
26
|
|
|
25
27
|
it("renders only external_id when data_structure_id is zero", () => {
|
|
26
28
|
const rendered = render(
|
|
27
|
-
<StructureNoteLink data_structure_id={0} external_id="zero-id"
|
|
29
|
+
<StructureNoteLink data_structure_id={0} external_id="zero-id" />,
|
|
28
30
|
);
|
|
29
31
|
expect(rendered.getByText(/zero-id/i)).toBeInTheDocument();
|
|
30
32
|
expect(rendered.container.querySelector("a")).not.toBeInTheDocument();
|
|
@@ -32,13 +34,10 @@ describe("<StructureNoteLink />", () => {
|
|
|
32
34
|
|
|
33
35
|
it("renders link with correct href for different structure id", () => {
|
|
34
36
|
const rendered = render(
|
|
35
|
-
<StructureNoteLink
|
|
36
|
-
data_structure_id={100}
|
|
37
|
-
external_id="structure-100"
|
|
38
|
-
/>
|
|
37
|
+
<StructureNoteLink data_structure_id={100} external_id="structure-100" />,
|
|
39
38
|
);
|
|
40
39
|
expect(
|
|
41
|
-
rendered.container.querySelector('a[href="/structures/100/notes"]')
|
|
40
|
+
rendered.container.querySelector('a[href="/structures/100/notes"]'),
|
|
42
41
|
).toBeInTheDocument();
|
|
43
42
|
expect(rendered.getByText(/structure-100/i)).toBeInTheDocument();
|
|
44
43
|
});
|
|
@@ -37,12 +37,12 @@ describe("<StructureNotes />", () => {
|
|
|
37
37
|
|
|
38
38
|
const user = userEvent.setup({ delay: null });
|
|
39
39
|
await user.click(
|
|
40
|
-
await rendered.findByText(/structure.notes.actions.show_versioned/i)
|
|
40
|
+
await rendered.findByText(/structure.notes.actions.show_versioned/i),
|
|
41
41
|
);
|
|
42
42
|
expect(rendered.container).toMatchSnapshot();
|
|
43
43
|
|
|
44
44
|
await user.click(
|
|
45
|
-
await rendered.findByText(/structure.notes.df_content.collapsed.true/i)
|
|
45
|
+
await rendered.findByText(/structure.notes.df_content.collapsed.true/i),
|
|
46
46
|
);
|
|
47
47
|
expect(rendered.container).toMatchSnapshot();
|
|
48
48
|
});
|
|
@@ -107,7 +107,7 @@ describe("<StructureNotes />", () => {
|
|
|
107
107
|
|
|
108
108
|
const user = userEvent.setup({ delay: null });
|
|
109
109
|
await user.click(
|
|
110
|
-
await rendered.findByText(/structure.notes.df_content.collapsed.true/i)
|
|
110
|
+
await rendered.findByText(/structure.notes.df_content.collapsed.true/i),
|
|
111
111
|
);
|
|
112
112
|
expect(rendered.container).toMatchSnapshot();
|
|
113
113
|
});
|
|
@@ -23,7 +23,7 @@ const renderWithIntl = (component) => {
|
|
|
23
23
|
return render(
|
|
24
24
|
<IntlProvider locale="en" messages={messages}>
|
|
25
25
|
{component}
|
|
26
|
-
</IntlProvider
|
|
26
|
+
</IntlProvider>,
|
|
27
27
|
);
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -42,7 +42,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
42
42
|
|
|
43
43
|
it("always renders download button", () => {
|
|
44
44
|
renderWithIntl(
|
|
45
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
45
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
const button = screen.getByRole("button");
|
|
@@ -52,7 +52,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
52
52
|
|
|
53
53
|
it("renders button with tooltip", () => {
|
|
54
54
|
renderWithIntl(
|
|
55
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
55
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
56
56
|
);
|
|
57
57
|
|
|
58
58
|
const button = screen.getByRole("button");
|
|
@@ -61,7 +61,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
61
61
|
|
|
62
62
|
it("opens modal when button is clicked", () => {
|
|
63
63
|
renderWithIntl(
|
|
64
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
64
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
65
65
|
);
|
|
66
66
|
|
|
67
67
|
const button = screen.getByRole("button");
|
|
@@ -72,14 +72,14 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
72
72
|
|
|
73
73
|
it("displays include children checkbox in modal", () => {
|
|
74
74
|
renderWithIntl(
|
|
75
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
75
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
76
76
|
);
|
|
77
77
|
|
|
78
78
|
const button = screen.getByRole("button");
|
|
79
79
|
fireEvent.click(button);
|
|
80
80
|
|
|
81
81
|
const includeChildrenLabel = screen.getByText(
|
|
82
|
-
"Include direct children notes"
|
|
82
|
+
"Include direct children notes",
|
|
83
83
|
);
|
|
84
84
|
expect(includeChildrenLabel).toBeInTheDocument();
|
|
85
85
|
|
|
@@ -89,7 +89,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
89
89
|
|
|
90
90
|
it("allows toggling include children checkbox", () => {
|
|
91
91
|
renderWithIntl(
|
|
92
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
92
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
93
93
|
);
|
|
94
94
|
|
|
95
95
|
const button = screen.getByRole("button");
|
|
@@ -108,7 +108,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
108
108
|
|
|
109
109
|
it("calls trigger with correct parameters when download button is clicked", async () => {
|
|
110
110
|
renderWithIntl(
|
|
111
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
111
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
112
112
|
);
|
|
113
113
|
|
|
114
114
|
const openButton = screen.getByRole("button");
|
|
@@ -135,7 +135,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
135
135
|
|
|
136
136
|
it("calls trigger with include_children false when checkbox is not selected", async () => {
|
|
137
137
|
renderWithIntl(
|
|
138
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
138
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
139
139
|
);
|
|
140
140
|
|
|
141
141
|
const openButton = screen.getByRole("button");
|
|
@@ -161,7 +161,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
161
161
|
|
|
162
162
|
it("closes modal after download", async () => {
|
|
163
163
|
renderWithIntl(
|
|
164
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
164
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
165
165
|
);
|
|
166
166
|
|
|
167
167
|
const openButton = screen.getByRole("button");
|
|
@@ -175,7 +175,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
175
175
|
|
|
176
176
|
await waitFor(() => {
|
|
177
177
|
expect(
|
|
178
|
-
screen.queryByText("Download Structure Notes")
|
|
178
|
+
screen.queryByText("Download Structure Notes"),
|
|
179
179
|
).not.toBeInTheDocument();
|
|
180
180
|
});
|
|
181
181
|
});
|
|
@@ -187,7 +187,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
187
187
|
});
|
|
188
188
|
|
|
189
189
|
renderWithIntl(
|
|
190
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
190
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
191
191
|
);
|
|
192
192
|
|
|
193
193
|
const button = screen.getByRole("button");
|
|
@@ -196,7 +196,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
196
196
|
|
|
197
197
|
it("closes modal when cancel button is clicked", () => {
|
|
198
198
|
renderWithIntl(
|
|
199
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
199
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
200
200
|
);
|
|
201
201
|
|
|
202
202
|
const openButton = screen.getByRole("button");
|
|
@@ -209,7 +209,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
209
209
|
fireEvent.click(cancelButton);
|
|
210
210
|
|
|
211
211
|
expect(
|
|
212
|
-
screen.queryByText("Download Structure Notes")
|
|
212
|
+
screen.queryByText("Download Structure Notes"),
|
|
213
213
|
).not.toBeInTheDocument();
|
|
214
214
|
});
|
|
215
215
|
|
|
@@ -222,7 +222,7 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
222
222
|
});
|
|
223
223
|
|
|
224
224
|
renderWithIntl(
|
|
225
|
-
<StructureNotesDownloadButton structureId={mockStructureId}
|
|
225
|
+
<StructureNotesDownloadButton structureId={mockStructureId} />,
|
|
226
226
|
);
|
|
227
227
|
|
|
228
228
|
const openButton = screen.getByRole("button");
|
|
@@ -68,14 +68,14 @@ describe("<StructureRelationRow />", () => {
|
|
|
68
68
|
const fieldDecorator = (x) => x + "_decorated";
|
|
69
69
|
const column = _.flow(
|
|
70
70
|
_.last,
|
|
71
|
-
_.set("fieldDecorator", fieldDecorator)
|
|
71
|
+
_.set("fieldDecorator", fieldDecorator),
|
|
72
72
|
)(columns);
|
|
73
73
|
const props = { relation, columns: [column] };
|
|
74
74
|
const rendered = render(<StructureRelationRow {...props} />);
|
|
75
75
|
await waitForLoad(rendered);
|
|
76
76
|
|
|
77
77
|
expect(rendered.container.querySelector("td")).toHaveTextContent(
|
|
78
|
-
"used_by_decorated"
|
|
78
|
+
"used_by_decorated",
|
|
79
79
|
);
|
|
80
80
|
});
|
|
81
81
|
});
|
|
@@ -58,10 +58,10 @@ describe("<StructureRelations />", () => {
|
|
|
58
58
|
const rendered = render(<StructureRelations {...props} />);
|
|
59
59
|
await waitForLoad(rendered);
|
|
60
60
|
expect(rendered.container.querySelectorAll("th")).toHaveLength(
|
|
61
|
-
columns.length
|
|
61
|
+
columns.length,
|
|
62
62
|
);
|
|
63
63
|
expect(rendered.container.querySelectorAll("tbody tr")).toHaveLength(
|
|
64
|
-
relations.length
|
|
64
|
+
relations.length,
|
|
65
65
|
);
|
|
66
66
|
});
|
|
67
67
|
});
|
|
@@ -35,7 +35,7 @@ describe("<StructureRow />", () => {
|
|
|
35
35
|
const user = userEvent.setup({ delay: null });
|
|
36
36
|
|
|
37
37
|
await user.click(
|
|
38
|
-
rendered.container.querySelector(".structure-cell-overflow")
|
|
38
|
+
rendered.container.querySelector(".structure-cell-overflow"),
|
|
39
39
|
);
|
|
40
40
|
await waitFor(() => {
|
|
41
41
|
expect(onClick).toHaveBeenCalledTimes(1);
|
|
@@ -76,7 +76,7 @@ describe("<StructureRow />", () => {
|
|
|
76
76
|
|
|
77
77
|
const decoratedValue = fieldDecorator(testValue);
|
|
78
78
|
expect(rendered.container.querySelector("td")).toHaveTextContent(
|
|
79
|
-
decoratedValue
|
|
79
|
+
decoratedValue,
|
|
80
80
|
);
|
|
81
81
|
});
|
|
82
82
|
});
|
|
@@ -5,10 +5,10 @@ import { StructureSelectorInputField } from "../StructureSelectorInputField";
|
|
|
5
5
|
|
|
6
6
|
// Mock the imported components
|
|
7
7
|
jest.mock("../StructureSelector", () =>
|
|
8
|
-
jest.fn(() => <div data-testid="structure-selector" />)
|
|
8
|
+
jest.fn(() => <div data-testid="structure-selector" />),
|
|
9
9
|
);
|
|
10
10
|
jest.mock("../StructureSelectorInputFieldJoin", () =>
|
|
11
|
-
jest.fn(() => <div data-testid="structure-selector-join" />)
|
|
11
|
+
jest.fn(() => <div data-testid="structure-selector-join" />),
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
describe("<StructureSelectorInputField />", () => {
|
|
@@ -113,7 +113,7 @@ describe("<StructureSelectorInputFieldJoin />", () => {
|
|
|
113
113
|
|
|
114
114
|
const user = userEvent.setup({ delay: null });
|
|
115
115
|
const deleteButton = rendered.container.querySelector(
|
|
116
|
-
".ui.red.mini.basic.icon.button.selectable"
|
|
116
|
+
".ui.red.mini.basic.icon.button.selectable",
|
|
117
117
|
);
|
|
118
118
|
expect(deleteButton).toBeInTheDocument();
|
|
119
119
|
|
|
@@ -184,30 +184,30 @@ describe("<StructureStructureLinks />", () => {
|
|
|
184
184
|
it("shows structure to structure links", async () => {
|
|
185
185
|
const rendered = render(
|
|
186
186
|
<StructureStructureLinks {...props} />,
|
|
187
|
-
_.merge(renderOpts, { state: { structureActions } })
|
|
187
|
+
_.merge(renderOpts, { state: { structureActions } }),
|
|
188
188
|
);
|
|
189
189
|
await waitForLoad(rendered);
|
|
190
190
|
|
|
191
191
|
await waitFor(() => {
|
|
192
192
|
expect(
|
|
193
|
-
rendered.getByRole("link", { name: /alias/i })
|
|
193
|
+
rendered.getByRole("link", { name: /alias/i }),
|
|
194
194
|
).toBeInTheDocument();
|
|
195
195
|
expect(
|
|
196
|
-
rendered.getByRole("link", { name: /structure_3/i })
|
|
196
|
+
rendered.getByRole("link", { name: /structure_3/i }),
|
|
197
197
|
).toBeInTheDocument();
|
|
198
198
|
});
|
|
199
199
|
|
|
200
200
|
await waitFor(() => {
|
|
201
201
|
expect(
|
|
202
|
-
rendered.getByRole("button", { name: /links.actions.create/i })
|
|
202
|
+
rendered.getByRole("button", { name: /links.actions.create/i }),
|
|
203
203
|
).toBeInTheDocument();
|
|
204
204
|
});
|
|
205
205
|
|
|
206
206
|
expect(
|
|
207
|
-
document.getElementById("delete-link-60217-60218")
|
|
207
|
+
document.getElementById("delete-link-60217-60218"),
|
|
208
208
|
).toBeInTheDocument();
|
|
209
209
|
expect(
|
|
210
|
-
document.getElementById("delete-link-151674-60217")
|
|
210
|
+
document.getElementById("delete-link-151674-60217"),
|
|
211
211
|
).toBeInTheDocument();
|
|
212
212
|
});
|
|
213
213
|
|
|
@@ -221,7 +221,7 @@ describe("<StructureStructureLinks />", () => {
|
|
|
221
221
|
|
|
222
222
|
await waitFor(() => {
|
|
223
223
|
expect(
|
|
224
|
-
rendered.getByRole("link", { name: /alias/i })
|
|
224
|
+
rendered.getByRole("link", { name: /alias/i }),
|
|
225
225
|
).toBeInTheDocument();
|
|
226
226
|
});
|
|
227
227
|
|
|
@@ -234,15 +234,15 @@ describe("<StructureStructureLinks />", () => {
|
|
|
234
234
|
|
|
235
235
|
await waitFor(() => {
|
|
236
236
|
expect(
|
|
237
|
-
rendered.getByRole("link", { name: /alias/i })
|
|
237
|
+
rendered.getByRole("link", { name: /alias/i }),
|
|
238
238
|
).toBeInTheDocument();
|
|
239
239
|
expect(
|
|
240
|
-
rendered.getByRole("link", { name: /structure_3/i })
|
|
240
|
+
rendered.getByRole("link", { name: /structure_3/i }),
|
|
241
241
|
).toBeInTheDocument();
|
|
242
242
|
});
|
|
243
243
|
|
|
244
244
|
expect(
|
|
245
|
-
rendered.queryByRole("button", { name: /links.actions.create/i })
|
|
245
|
+
rendered.queryByRole("button", { name: /links.actions.create/i }),
|
|
246
246
|
).not.toBeInTheDocument();
|
|
247
247
|
expect(document.getElementById("delete-link-60217-60218")).toBeNull();
|
|
248
248
|
expect(document.getElementById("delete-link-151674-60217")).toBeNull();
|
|
@@ -255,22 +255,22 @@ describe("<StructureStructureLinks />", () => {
|
|
|
255
255
|
_.merge(renderOpts, {
|
|
256
256
|
state: { structureActions },
|
|
257
257
|
dispatch,
|
|
258
|
-
})
|
|
258
|
+
}),
|
|
259
259
|
);
|
|
260
260
|
await waitForLoad(rendered);
|
|
261
261
|
|
|
262
262
|
await waitFor(() => {
|
|
263
263
|
expect(
|
|
264
|
-
rendered.getByRole("link", { name: /alias/i })
|
|
264
|
+
rendered.getByRole("link", { name: /alias/i }),
|
|
265
265
|
).toBeInTheDocument();
|
|
266
266
|
expect(
|
|
267
|
-
rendered.getByRole("link", { name: /structure_3/i })
|
|
267
|
+
rendered.getByRole("link", { name: /structure_3/i }),
|
|
268
268
|
).toBeInTheDocument();
|
|
269
269
|
});
|
|
270
270
|
|
|
271
271
|
await waitFor(() => {
|
|
272
272
|
expect(
|
|
273
|
-
rendered.getByRole("button", { name: /links.actions.create/i })
|
|
273
|
+
rendered.getByRole("button", { name: /links.actions.create/i }),
|
|
274
274
|
).toBeInTheDocument();
|
|
275
275
|
});
|
|
276
276
|
|
|
@@ -278,7 +278,7 @@ describe("<StructureStructureLinks />", () => {
|
|
|
278
278
|
const deleteButton = document.getElementById("delete-link-60217-60218");
|
|
279
279
|
await user.click(deleteButton);
|
|
280
280
|
expect(
|
|
281
|
-
rendered.getByText(/delete.confirmation.header/i)
|
|
281
|
+
rendered.getByText(/delete.confirmation.header/i),
|
|
282
282
|
).toBeInTheDocument();
|
|
283
283
|
const yesButton = rendered.getByRole("button", {
|
|
284
284
|
name: /modal-affirmative-action/i,
|
|
@@ -110,7 +110,7 @@ describe("<StructureSummary />", () => {
|
|
|
110
110
|
userEvent.hover(rendered.container.querySelector(".shield"));
|
|
111
111
|
|
|
112
112
|
expect(
|
|
113
|
-
await rendered.findByText(/structure.grant.has_grant/i)
|
|
113
|
+
await rendered.findByText(/structure.grant.has_grant/i),
|
|
114
114
|
).toBeInTheDocument();
|
|
115
115
|
});
|
|
116
116
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
3
|
import { waitFor } from "@testing-library/react";
|
|
4
|
-
import { StructureTabPane } from "../StructureTabPane";
|
|
5
4
|
import {
|
|
6
5
|
STRUCTURE_CHILDREN,
|
|
7
6
|
STRUCTURE_FIELDS,
|
|
@@ -20,6 +19,7 @@ import {
|
|
|
20
19
|
STRUCTURE_LINEAGE,
|
|
21
20
|
STRUCTURE_IMPACT,
|
|
22
21
|
} from "@truedat/core/routes";
|
|
22
|
+
import { StructureTabPane } from "../StructureTabPane";
|
|
23
23
|
import * as getTabVisibilityModule from "../../selectors/getTabVisibility";
|
|
24
24
|
import * as useCustomTabsModule from "../../hooks/useCustomTabs";
|
|
25
25
|
|
|
@@ -161,7 +161,7 @@ describe("<StructureTabPane />", () => {
|
|
|
161
161
|
.mockReturnValue(tabVisibility);
|
|
162
162
|
const rendered = render(
|
|
163
163
|
<StructureTabPane path={STRUCTURE_STRUCTURE_LINKS} />,
|
|
164
|
-
{ state }
|
|
164
|
+
{ state },
|
|
165
165
|
);
|
|
166
166
|
await waitForLoad(rendered);
|
|
167
167
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -248,18 +248,16 @@ describe("<StructureTabPane />", () => {
|
|
|
248
248
|
jest
|
|
249
249
|
.spyOn(getTabVisibilityModule, "getTabVisibility")
|
|
250
250
|
.mockReturnValue(tabVisibility);
|
|
251
|
-
jest
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
},
|
|
259
|
-
]);
|
|
251
|
+
jest.spyOn(useCustomTabsModule, "useStructureCustomTabs").mockReturnValue([
|
|
252
|
+
{
|
|
253
|
+
name: "custom",
|
|
254
|
+
route: "/structures/:id/custom",
|
|
255
|
+
content: <p>Custom</p>,
|
|
256
|
+
},
|
|
257
|
+
]);
|
|
260
258
|
const rendered = render(
|
|
261
259
|
<StructureTabPane path={"/structures/:id/custom"} />,
|
|
262
|
-
{ state }
|
|
260
|
+
{ state },
|
|
263
261
|
);
|
|
264
262
|
await waitForLoad(rendered);
|
|
265
263
|
await waitFor(() => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
|
-
import { StructureTabRoutes } from "../StructureTabRoutes";
|
|
4
3
|
import {
|
|
5
4
|
STRUCTURE,
|
|
6
5
|
STRUCTURE_CHILDREN,
|
|
@@ -22,6 +21,7 @@ import {
|
|
|
22
21
|
STRUCTURE_VERSION_VERSIONS,
|
|
23
22
|
STRUCTURE_METADATA,
|
|
24
23
|
} from "@truedat/core/routes";
|
|
24
|
+
import { StructureTabRoutes } from "../StructureTabRoutes";
|
|
25
25
|
|
|
26
26
|
jest.mock("../StructureTabs", () => () => <div>StructureTabs</div>);
|
|
27
27
|
|
|
@@ -23,21 +23,27 @@ describe("<StructureTabs />", () => {
|
|
|
23
23
|
const version = "1";
|
|
24
24
|
const tabVisibility = _.flow(
|
|
25
25
|
_.map((t) => [t, true]),
|
|
26
|
-
_.fromPairs
|
|
26
|
+
_.fromPairs,
|
|
27
27
|
)(tabs);
|
|
28
28
|
const activeTab = "metadata";
|
|
29
29
|
|
|
30
30
|
it("matches the latest snapshot: " + activeTab, async () => {
|
|
31
|
-
jest
|
|
31
|
+
jest
|
|
32
|
+
.spyOn(getTabVisibilityModule, "getTabVisibility")
|
|
33
|
+
.mockReturnValue(tabVisibility);
|
|
32
34
|
|
|
33
35
|
const props = { path: "/structures/:id/metadata" };
|
|
34
|
-
const rendered = render(<StructureTabs {...props} />, {
|
|
36
|
+
const rendered = render(<StructureTabs {...props} />, {
|
|
37
|
+
state: { structure, structureVersion: version, structureTabsOrder: [] },
|
|
38
|
+
});
|
|
35
39
|
await waitForLoad(rendered);
|
|
36
40
|
expect(rendered.container).toMatchSnapshot();
|
|
37
41
|
});
|
|
38
42
|
|
|
39
43
|
it("should render correctly with structureTabsOrder", async () => {
|
|
40
|
-
jest
|
|
44
|
+
jest
|
|
45
|
+
.spyOn(getTabVisibilityModule, "getTabVisibility")
|
|
46
|
+
.mockReturnValue(tabVisibility);
|
|
41
47
|
|
|
42
48
|
const structureTabsOrder = ["links", "notes", "fields", "profile"];
|
|
43
49
|
const props = { path: "/structures/:id" };
|
|
@@ -52,7 +58,9 @@ describe("<StructureTabs />", () => {
|
|
|
52
58
|
});
|
|
53
59
|
|
|
54
60
|
it("should use default order when structureTabsOrder is empty", async () => {
|
|
55
|
-
jest
|
|
61
|
+
jest
|
|
62
|
+
.spyOn(getTabVisibilityModule, "getTabVisibility")
|
|
63
|
+
.mockReturnValue(tabVisibility);
|
|
56
64
|
|
|
57
65
|
const props = { path: "/structures/:id" };
|
|
58
66
|
const rendered = render(<StructureTabs {...props} />, {
|
|
@@ -65,7 +73,9 @@ describe("<StructureTabs />", () => {
|
|
|
65
73
|
});
|
|
66
74
|
|
|
67
75
|
it("should handle structureTabsOrder with tabs not in items", async () => {
|
|
68
|
-
jest
|
|
76
|
+
jest
|
|
77
|
+
.spyOn(getTabVisibilityModule, "getTabVisibility")
|
|
78
|
+
.mockReturnValue(tabVisibility);
|
|
69
79
|
|
|
70
80
|
const structureTabsOrder = ["nonexistent", "fields", "notes"];
|
|
71
81
|
const props = { path: "/structures/:id" };
|
|
@@ -79,11 +89,17 @@ describe("<StructureTabs />", () => {
|
|
|
79
89
|
});
|
|
80
90
|
|
|
81
91
|
it("should not crash when structure is empty", async () => {
|
|
82
|
-
jest
|
|
92
|
+
jest
|
|
93
|
+
.spyOn(getTabVisibilityModule, "getTabVisibility")
|
|
94
|
+
.mockReturnValue(tabVisibility);
|
|
83
95
|
|
|
84
96
|
const props = { path: "/structures/:id" };
|
|
85
97
|
const rendered = render(<StructureTabs {...props} />, {
|
|
86
|
-
state: {
|
|
98
|
+
state: {
|
|
99
|
+
structure: null,
|
|
100
|
+
structureVersion: version,
|
|
101
|
+
structureTabsOrder: [],
|
|
102
|
+
},
|
|
87
103
|
});
|
|
88
104
|
await waitForLoad(rendered);
|
|
89
105
|
|
|
@@ -30,8 +30,8 @@ describe("<StructureTag />", () => {
|
|
|
30
30
|
userEvent.click(rendered.container.getElementsByClassName("edit")[0]);
|
|
31
31
|
await waitFor(() =>
|
|
32
32
|
expect(
|
|
33
|
-
rendered.getByLabelText(/structureTag.comment/i)
|
|
34
|
-
).toBeInTheDocument()
|
|
33
|
+
rendered.getByLabelText(/structureTag.comment/i),
|
|
34
|
+
).toBeInTheDocument(),
|
|
35
35
|
);
|
|
36
36
|
});
|
|
37
37
|
|
|
@@ -53,13 +53,13 @@ describe("<StructureTag />", () => {
|
|
|
53
53
|
userEvent.hover(rendered.getByText(tagName));
|
|
54
54
|
|
|
55
55
|
await waitFor(() =>
|
|
56
|
-
expect(rendered.getByText(/structureTag.comment/i)).toBeInTheDocument()
|
|
56
|
+
expect(rendered.getByText(/structureTag.comment/i)).toBeInTheDocument(),
|
|
57
57
|
);
|
|
58
58
|
await waitFor(() =>
|
|
59
|
-
expect(rendered.getByText(comment)).toBeInTheDocument()
|
|
59
|
+
expect(rendered.getByText(comment)).toBeInTheDocument(),
|
|
60
60
|
);
|
|
61
61
|
await waitFor(() =>
|
|
62
|
-
expect(rendered.getByText(description)).toBeInTheDocument()
|
|
62
|
+
expect(rendered.getByText(description)).toBeInTheDocument(),
|
|
63
63
|
);
|
|
64
64
|
});
|
|
65
65
|
|
|
@@ -74,7 +74,7 @@ describe("<StructureTag />", () => {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
const rendered = render(
|
|
77
|
-
<StructureTag {...tagWithDescriptionWithoutCommentProps}
|
|
77
|
+
<StructureTag {...tagWithDescriptionWithoutCommentProps} />,
|
|
78
78
|
);
|
|
79
79
|
await waitForLoad(rendered);
|
|
80
80
|
|
|
@@ -82,11 +82,11 @@ describe("<StructureTag />", () => {
|
|
|
82
82
|
|
|
83
83
|
await waitFor(() =>
|
|
84
84
|
expect(
|
|
85
|
-
rendered.queryByText(/structureTag.comment/i)
|
|
86
|
-
).not.toBeInTheDocument()
|
|
85
|
+
rendered.queryByText(/structureTag.comment/i),
|
|
86
|
+
).not.toBeInTheDocument(),
|
|
87
87
|
);
|
|
88
88
|
await waitFor(() =>
|
|
89
|
-
expect(rendered.getByText(description)).toBeInTheDocument()
|
|
89
|
+
expect(rendered.getByText(description)).toBeInTheDocument(),
|
|
90
90
|
);
|
|
91
91
|
});
|
|
92
92
|
|
|
@@ -106,10 +106,10 @@ describe("<StructureTag />", () => {
|
|
|
106
106
|
userEvent.hover(rendered.getByText(tagName));
|
|
107
107
|
|
|
108
108
|
await waitFor(() =>
|
|
109
|
-
expect(rendered.getByText(/structureTag.comment/i)).toBeInTheDocument()
|
|
109
|
+
expect(rendered.getByText(/structureTag.comment/i)).toBeInTheDocument(),
|
|
110
110
|
);
|
|
111
111
|
await waitFor(() =>
|
|
112
|
-
expect(rendered.getByText(comment)).toBeInTheDocument()
|
|
112
|
+
expect(rendered.getByText(comment)).toBeInTheDocument(),
|
|
113
113
|
);
|
|
114
114
|
});
|
|
115
115
|
});
|