synapse-react-client 4.0.25 → 4.0.27
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/dist/SWC.index.d.ts +3 -2
- package/dist/SWC.index.d.ts.map +1 -1
- package/dist/SWC.index.js +4 -3
- package/dist/SWC.index.js.map +1 -1
- package/dist/assets/icons/FileCopy.d.ts +5 -0
- package/dist/assets/icons/FileCopy.d.ts.map +1 -0
- package/dist/assets/icons/FileCopy.js +13 -0
- package/dist/assets/icons/FileCopy.js.map +1 -0
- package/dist/assets/icons/NIHIcon.d.ts +4 -0
- package/dist/assets/icons/NIHIcon.d.ts.map +1 -0
- package/dist/assets/icons/NIHIcon.js +14 -0
- package/dist/assets/icons/NIHIcon.js.map +1 -0
- package/dist/assets/icons/fileCopy.svg +8 -0
- package/dist/assets/icons/fileCopy2.js +33 -0
- package/dist/assets/icons/fileCopy2.js.map +1 -0
- package/dist/assets/icons/nih.js +35 -0
- package/dist/assets/icons/nih.js.map +1 -0
- package/dist/assets/icons/nih.svg +9 -0
- package/dist/assets/illustrations/compute_illustration.js +485 -0
- package/dist/assets/illustrations/compute_illustration.js.map +1 -0
- package/dist/assets/illustrations/compute_illustration.svg +204 -0
- package/dist/assets/illustrations/curate_data_illustration.js +479 -0
- package/dist/assets/illustrations/curate_data_illustration.js.map +1 -0
- package/dist/assets/illustrations/curate_data_illustration.svg +91 -0
- package/dist/components/AccountLevelBadges/useRevokeCertificationUI.js +1 -1
- package/dist/components/AcknowledgementsPage/AcknowledgementsDialog.js +1 -1
- package/dist/components/Authentication/AuthenticationMethodSelection.d.ts +1 -0
- package/dist/components/Authentication/AuthenticationMethodSelection.d.ts.map +1 -1
- package/dist/components/Authentication/AuthenticationMethodSelection.js +17 -10
- package/dist/components/Authentication/AuthenticationMethodSelection.js.map +1 -1
- package/dist/components/Authentication/LastLoginInfo.d.ts +2 -2
- package/dist/components/Authentication/LoginForm.d.ts +1 -0
- package/dist/components/Authentication/LoginForm.d.ts.map +1 -1
- package/dist/components/Authentication/LoginForm.js +3 -2
- package/dist/components/Authentication/LoginForm.js.map +1 -1
- package/dist/components/Authentication/LoginMethod.d.ts +2 -2
- package/dist/components/Authentication/LoginMethod.d.ts.map +1 -1
- package/dist/components/Authentication/LoginMethod.js +10 -8
- package/dist/components/Authentication/LoginMethod.js.map +1 -1
- package/dist/components/Authentication/StandaloneLoginForm.d.ts +1 -0
- package/dist/components/Authentication/StandaloneLoginForm.d.ts.map +1 -1
- package/dist/components/Authentication/StandaloneLoginForm.js +16 -15
- package/dist/components/Authentication/StandaloneLoginForm.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +24 -30
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/ChallengeDataDownload/ChallengeDataDownload.js +1 -1
- package/dist/components/ChallengeDetailPage/ChallengeDetailPage.js +1 -1
- package/dist/components/ChallengeSubmission/ChallengeSubmissionStepper.js +1 -1
- package/dist/components/ChangePassword/ChangePassword.js +1 -1
- package/dist/components/CopyToClipboardString/CopyToClipboardString.d.ts +3 -2
- package/dist/components/CopyToClipboardString/CopyToClipboardString.d.ts.map +1 -1
- package/dist/components/CopyToClipboardString/CopyToClipboardString.js +27 -18
- package/dist/components/CopyToClipboardString/CopyToClipboardString.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.css +1 -1
- package/dist/components/DataExplorer/DataExplorer.d.ts +16 -2
- package/dist/components/DataExplorer/DataExplorer.d.ts.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.js +82 -75
- package/dist/components/DataExplorer/DataExplorer.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.js +16 -16
- package/dist/components/DataExplorer/DataExplorer.module.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.scss +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +2 -5
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts +35 -0
- package/dist/components/DataGrid/SyncGridWithSourceButton.d.ts.map +1 -0
- package/dist/components/DataGrid/SyncGridWithSourceButton.js +115 -0
- package/dist/components/DataGrid/SyncGridWithSourceButton.js.map +1 -0
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +14 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
- package/dist/components/DataGrid/useMergeGridWithRecordSet.d.ts +2 -0
- package/dist/components/DataGrid/useMergeGridWithRecordSet.d.ts.map +1 -1
- package/dist/components/DataGrid/useMergeGridWithRecordSet.js.map +1 -1
- package/dist/components/DataGrid/useMergeGridWithSource.d.ts +12 -7
- package/dist/components/DataGrid/useMergeGridWithSource.d.ts.map +1 -1
- package/dist/components/DataGrid/useMergeGridWithSource.js +31 -25
- package/dist/components/DataGrid/useMergeGridWithSource.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +15 -19
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DownloadCart/DownloadListTable.js +1 -1
- package/dist/components/DynamicForm/DynamicForm.js +1 -1
- package/dist/components/EntityAclEditor/EntityAclEditorModal.js +1 -1
- package/dist/components/EntityAclEditor/useNotifyNewACLUsers.js +1 -1
- package/dist/components/EntityDownloadButton/EntityDownloadButton.js +1 -1
- package/dist/components/EntityFinder/EntityIdTextField.d.ts +1 -0
- package/dist/components/EntityFinder/EntityIdTextField.d.ts.map +1 -1
- package/dist/components/EntityFinder/EntityIdTextField.js +7 -6
- package/dist/components/EntityFinder/EntityIdTextField.js.map +1 -1
- package/dist/components/EntityFinder/details/view/table/AddToDownloadListCell.js +1 -1
- package/dist/components/EntityFinder/details/view/table/FileEntityMD5Cell.js +1 -1
- package/dist/components/EntitySidebar/EntitySidebar.css +1 -1
- package/dist/components/EntitySidebar/EntitySidebar.d.ts.map +1 -1
- package/dist/components/EntitySidebar/EntitySidebar.js +47 -39
- package/dist/components/EntitySidebar/EntitySidebar.js.map +1 -1
- package/dist/components/EntitySidebar/EntitySidebar.module.js +11 -11
- package/dist/components/EntitySidebar/EntitySidebar.module.js.map +1 -1
- package/dist/components/EntitySidebar/EntitySidebar.module.scss +6 -6
- package/dist/components/FieldDescription/FieldDescription.css +1 -0
- package/dist/components/FieldDescription/FieldDescription.d.ts +15 -0
- package/dist/components/FieldDescription/FieldDescription.d.ts.map +1 -0
- package/dist/components/FieldDescription/FieldDescription.js +13 -0
- package/dist/components/FieldDescription/FieldDescription.js.map +1 -0
- package/dist/components/FieldDescription/FieldDescription.module.js +5 -0
- package/dist/components/FieldDescription/FieldDescription.module.js.map +1 -0
- package/dist/components/FieldDescription/FieldDescription.module.scss +8 -0
- package/dist/components/FieldDescription/index.d.ts +3 -0
- package/dist/components/FieldDescription/index.d.ts.map +1 -0
- package/dist/components/FieldDescription/index.js +2 -0
- package/dist/components/GenericCard/TableRowGenericCard.d.ts +2 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +3 -2
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/HeaderCard.d.ts.map +1 -1
- package/dist/components/HeaderCard.js +4 -0
- package/dist/components/HeaderCard.js.map +1 -1
- package/dist/components/HexGrid/HexGrid.d.ts +2 -1
- package/dist/components/HexGrid/HexGrid.d.ts.map +1 -1
- package/dist/components/HexGrid/HexGrid.js +13 -13
- package/dist/components/HexGrid/HexGrid.js.map +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
- package/dist/components/IconSvg/IconSvg.js +216 -212
- package/dist/components/IconSvg/IconSvg.js.map +1 -1
- package/dist/components/OAuthClientAclEditor/OAuthAclEditorModal.js +1 -1
- package/dist/components/OAuthClientManagement/OAuthManagement.js +1 -1
- package/dist/components/PortalAclEditor/PortalAclEditorModal.js +1 -1
- package/dist/components/PortalList/CreatePortalModal.js +1 -1
- package/dist/components/PortalList/PortalCard.js +1 -1
- package/dist/components/ProjectInfo/ProjectInfo.css +1 -0
- package/dist/components/ProjectInfo/ProjectInfo.d.ts +5 -0
- package/dist/components/ProjectInfo/ProjectInfo.d.ts.map +1 -0
- package/dist/components/ProjectInfo/ProjectInfo.js +50 -0
- package/dist/components/ProjectInfo/ProjectInfo.js.map +1 -0
- package/dist/components/ProjectInfo/ProjectInfo.module.js +11 -0
- package/dist/components/ProjectInfo/ProjectInfo.module.js.map +1 -0
- package/dist/components/ProjectInfo/ProjectInfo.module.scss +35 -0
- package/dist/components/ProjectInfo/ProjectInfoPopover.d.ts +10 -0
- package/dist/components/ProjectInfo/ProjectInfoPopover.d.ts.map +1 -0
- package/dist/components/ProjectInfo/ProjectInfoPopover.js +94 -0
- package/dist/components/ProjectInfo/ProjectInfoPopover.js.map +1 -0
- package/dist/components/ProjectStorage/ProjectDataAvailability.d.ts +2 -1
- package/dist/components/ProjectStorage/ProjectDataAvailability.d.ts.map +1 -1
- package/dist/components/ProjectStorage/ProjectDataAvailability.js +67 -75
- package/dist/components/ProjectStorage/ProjectDataAvailability.js.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts +3 -0
- package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js +140 -85
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +3 -3
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/StorybookComponentWrapper.js +1 -1
- package/dist/components/SynapseChat/SynapseChat.js +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.css +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.js +9 -8
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.js.map +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.scss +4 -1
- package/dist/components/SynapseHomepageV2/WordPressNews.d.ts +2 -1
- package/dist/components/SynapseHomepageV2/WordPressNews.d.ts.map +1 -1
- package/dist/components/SynapseHomepageV2/WordPressNews.js +8 -7
- package/dist/components/SynapseHomepageV2/WordPressNews.js.map +1 -1
- package/dist/components/SynapseHomepageV2/WordPressNewsItem.d.ts +5 -1
- package/dist/components/SynapseHomepageV2/WordPressNewsItem.d.ts.map +1 -1
- package/dist/components/SynapseHomepageV2/WordPressNewsItem.js +19 -11
- package/dist/components/SynapseHomepageV2/WordPressNewsItem.js.map +1 -1
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +1 -1
- package/dist/components/SynapseTable/table-top/DownloadOptions.js +1 -1
- package/dist/components/SynapseTable/table-top/DownloadOptions.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/ImportTableColumnsButton.js +1 -1
- package/dist/components/TextField/TextField.css +1 -1
- package/dist/components/TextField/TextField.d.ts.map +1 -1
- package/dist/components/TextField/TextField.js +27 -25
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/TextField.module.js +3 -3
- package/dist/components/TextField/TextField.module.js.map +1 -1
- package/dist/components/TextField/TextField.module.scss +2 -5
- package/dist/components/Webhook/WebhookVerificationDialog.js +1 -1
- package/dist/components/WordPress/useWordPressPosts.js +1 -1
- package/dist/components/WordPress/useWordPressPosts.js.map +1 -1
- package/dist/components/dataaccess/SubmissionPage/ApproveSubmissionConfirmationModal.js +1 -1
- package/dist/components/dataaccess/SubmissionPage/CancelDataAccessRequestConfirmationModal.js +1 -1
- package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +66 -49
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
- package/dist/components/error/SendMessageToEntityOwnerDialog.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/menu/ComplexMenu.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.js +1 -4
- package/dist/components/menu/ComplexMenu.js.map +1 -1
- package/dist/features/curator/GridPage/components/UpdateGridPageSearchParamsForm.js +1 -1
- package/dist/features/curator/GridPage/components/UpdateGridPageSearchParamsForm.js.map +1 -1
- package/dist/features/curator/dashboard/CuratorDashboard.d.ts +1 -1
- package/dist/features/curator/dashboard/CuratorDashboard.d.ts.map +1 -1
- package/dist/features/curator/dashboard/CuratorDashboard.js +36 -35
- package/dist/features/curator/dashboard/CuratorDashboard.js.map +1 -1
- package/dist/features/curator/dashboard/CuratorDashboardRouter.d.ts +13 -0
- package/dist/features/curator/dashboard/CuratorDashboardRouter.d.ts.map +1 -0
- package/dist/features/curator/dashboard/CuratorDashboardRouter.js +37 -0
- package/dist/features/curator/dashboard/CuratorDashboardRouter.js.map +1 -0
- package/dist/features/curator/dashboard/components/CurationTaskCard.css +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.d.ts +3 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.d.ts.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.js +26 -157
- package/dist/features/curator/dashboard/components/CurationTaskCard.js.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.module.js +10 -6
- package/dist/features/curator/dashboard/components/CurationTaskCard.module.js.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.module.scss +31 -0
- package/dist/features/curator/dashboard/components/CurationTaskCardLayout.d.ts +25 -0
- package/dist/features/curator/dashboard/components/CurationTaskCardLayout.d.ts.map +1 -0
- package/dist/features/curator/dashboard/components/CurationTaskCardLayout.js +134 -0
- package/dist/features/curator/dashboard/components/CurationTaskCardLayout.js.map +1 -0
- package/dist/features/curator/dashboard/components/ExecutableTaskCard.d.ts +10 -0
- package/dist/features/curator/dashboard/components/ExecutableTaskCard.d.ts.map +1 -0
- package/dist/features/curator/dashboard/components/ExecutableTaskCard.js +51 -0
- package/dist/features/curator/dashboard/components/ExecutableTaskCard.js.map +1 -0
- package/dist/features/curator/dashboard/components/GridTaskCard.d.ts +10 -0
- package/dist/features/curator/dashboard/components/GridTaskCard.d.ts.map +1 -0
- package/dist/features/curator/dashboard/components/GridTaskCard.js +35 -0
- package/dist/features/curator/dashboard/components/GridTaskCard.js.map +1 -0
- package/dist/features/curator/dashboard/components/NextStepButton.css +1 -1
- package/dist/features/curator/dashboard/components/NextStepButton.d.ts +3 -0
- package/dist/features/curator/dashboard/components/NextStepButton.d.ts.map +1 -1
- package/dist/features/curator/dashboard/components/NextStepButton.js +56 -26
- package/dist/features/curator/dashboard/components/NextStepButton.js.map +1 -1
- package/dist/features/curator/dashboard/components/NextStepButton.module.js +6 -5
- package/dist/features/curator/dashboard/components/NextStepButton.module.js.map +1 -1
- package/dist/features/curator/dashboard/components/NextStepButton.module.scss +28 -0
- package/dist/features/curator/dashboard/components/getExecutableTaskButtonState.d.ts +31 -0
- package/dist/features/curator/dashboard/components/getExecutableTaskButtonState.d.ts.map +1 -0
- package/dist/features/curator/dashboard/components/getExecutableTaskButtonState.js +32 -0
- package/dist/features/curator/dashboard/components/getExecutableTaskButtonState.js.map +1 -0
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +213 -204
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.d.ts +0 -1
- package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js +19 -39
- package/dist/features/entity/metadata-task/components/MetadataTaskTableActionCell.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksPage.d.ts +9 -3
- package/dist/features/entity/metadata-task/components/MetadataTasksPage.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksPage.js +37 -46
- package/dist/features/entity/metadata-task/components/MetadataTasksPage.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.d.ts +17 -0
- package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.js +43 -0
- package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.js.map +1 -0
- package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js +27 -26
- package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js.map +1 -1
- package/dist/features/entity/metadata-task/create-task/CommonTaskFields.d.ts +16 -0
- package/dist/features/entity/metadata-task/create-task/CommonTaskFields.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/CommonTaskFields.js +64 -0
- package/dist/features/entity/metadata-task/create-task/CommonTaskFields.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/ComputeTaskForm.d.ts +41 -0
- package/dist/features/entity/metadata-task/create-task/ComputeTaskForm.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/ComputeTaskForm.js +165 -0
- package/dist/features/entity/metadata-task/create-task/ComputeTaskForm.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/CreateCurationTaskFlow.d.ts +18 -0
- package/dist/features/entity/metadata-task/create-task/CreateCurationTaskFlow.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/CreateCurationTaskFlow.js +78 -0
- package/dist/features/entity/metadata-task/create-task/CreateCurationTaskFlow.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/CreateTaskCategoryPicker.d.ts +10 -0
- package/dist/features/entity/metadata-task/create-task/CreateTaskCategoryPicker.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/CreateTaskCategoryPicker.js +40 -0
- package/dist/features/entity/metadata-task/create-task/CreateTaskCategoryPicker.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/CreateTaskConfirmation.d.ts +13 -0
- package/dist/features/entity/metadata-task/create-task/CreateTaskConfirmation.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/CreateTaskConfirmation.js +35 -0
- package/dist/features/entity/metadata-task/create-task/CreateTaskConfirmation.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/CurateTaskForm.d.ts +41 -0
- package/dist/features/entity/metadata-task/create-task/CurateTaskForm.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js +198 -0
- package/dist/features/entity/metadata-task/create-task/CurateTaskForm.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/EditCurationTaskPage.d.ts +8 -0
- package/dist/features/entity/metadata-task/create-task/EditCurationTaskPage.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/EditCurationTaskPage.js +29 -0
- package/dist/features/entity/metadata-task/create-task/EditCurationTaskPage.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/FileBasedFields.d.ts +13 -0
- package/dist/features/entity/metadata-task/create-task/FileBasedFields.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/FileBasedFields.js +65 -0
- package/dist/features/entity/metadata-task/create-task/FileBasedFields.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/ProjectSelectorField.d.ts +11 -0
- package/dist/features/entity/metadata-task/create-task/ProjectSelectorField.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/ProjectSelectorField.js +33 -0
- package/dist/features/entity/metadata-task/create-task/ProjectSelectorField.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/RecordBasedFields.d.ts +13 -0
- package/dist/features/entity/metadata-task/create-task/RecordBasedFields.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/RecordBasedFields.js +38 -0
- package/dist/features/entity/metadata-task/create-task/RecordBasedFields.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/RecordSetFields.d.ts +13 -0
- package/dist/features/entity/metadata-task/create-task/RecordSetFields.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/RecordSetFields.js +72 -0
- package/dist/features/entity/metadata-task/create-task/RecordSetFields.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/SampleSheetFields.d.ts +11 -0
- package/dist/features/entity/metadata-task/create-task/SampleSheetFields.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/SampleSheetFields.js +42 -0
- package/dist/features/entity/metadata-task/create-task/SampleSheetFields.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.d.ts +17 -0
- package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js +70 -0
- package/dist/features/entity/metadata-task/create-task/TaskCategoryCard.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/TaskFormActions.d.ts +23 -0
- package/dist/features/entity/metadata-task/create-task/TaskFormActions.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/TaskFormActions.js +68 -0
- package/dist/features/entity/metadata-task/create-task/TaskFormActions.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/TaskFormHeader.d.ts +17 -0
- package/dist/features/entity/metadata-task/create-task/TaskFormHeader.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js +33 -0
- package/dist/features/entity/metadata-task/create-task/TaskFormHeader.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/useCurationTaskFormState.d.ts +50 -0
- package/dist/features/entity/metadata-task/create-task/useCurationTaskFormState.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/useCurationTaskFormState.js +76 -0
- package/dist/features/entity/metadata-task/create-task/useCurationTaskFormState.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/utils/buildComputeTaskPayload.d.ts +36 -0
- package/dist/features/entity/metadata-task/create-task/utils/buildComputeTaskPayload.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/utils/buildComputeTaskPayload.js +31 -0
- package/dist/features/entity/metadata-task/create-task/utils/buildComputeTaskPayload.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/utils/buildCurateTaskPayload.d.ts +32 -0
- package/dist/features/entity/metadata-task/create-task/utils/buildCurateTaskPayload.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/utils/buildCurateTaskPayload.js +33 -0
- package/dist/features/entity/metadata-task/create-task/utils/buildCurateTaskPayload.js.map +1 -0
- package/dist/features/entity/metadata-task/create-task/utils/taskIdValidation.d.ts +10 -0
- package/dist/features/entity/metadata-task/create-task/utils/taskIdValidation.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/create-task/utils/taskIdValidation.js +13 -0
- package/dist/features/entity/metadata-task/create-task/utils/taskIdValidation.js.map +1 -0
- package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask.js +24 -24
- package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask.js.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask_legacy.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask_legacy.js +2 -2
- package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask_legacy.js.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useMetadataTaskTable.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useMetadataTaskTable.js +33 -32
- package/dist/features/entity/metadata-task/hooks/useMetadataTaskTable.js.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js +24 -21
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js.map +1 -1
- package/dist/features/entity/metadata-task/utils/constants.d.ts +84 -15
- package/dist/features/entity/metadata-task/utils/constants.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/utils/constants.js +47 -3
- package/dist/features/entity/metadata-task/utils/constants.js.map +1 -1
- package/dist/features/entity/metadata-task/utils/dueDate.d.ts +22 -0
- package/dist/features/entity/metadata-task/utils/dueDate.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/utils/dueDate.js +24 -0
- package/dist/features/entity/metadata-task/utils/dueDate.js.map +1 -0
- package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.d.ts +2 -2
- package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.js +5 -6
- package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.js.map +1 -1
- package/dist/features/entity/metadata-task/utils/getGridSourceIdForTask.d.ts +4 -4
- package/dist/features/entity/metadata-task/utils/getGridSourceIdForTask.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/utils/getGridSourceIdForTask.js +5 -6
- package/dist/features/entity/metadata-task/utils/getGridSourceIdForTask.js.map +1 -1
- package/dist/features/entity/metadata-task/utils/types.d.ts +12 -0
- package/dist/features/entity/metadata-task/utils/types.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/utils/types.js +18 -0
- package/dist/features/entity/metadata-task/utils/types.js.map +1 -0
- package/dist/mocks/curation/mockCurationTask.d.ts +6 -0
- package/dist/mocks/curation/mockCurationTask.d.ts.map +1 -1
- package/dist/mocks/curation/mockCurationTask.js +20 -3
- package/dist/mocks/curation/mockCurationTask.js.map +1 -1
- package/dist/mocks/msw/handlers/curationTaskExecutionHandlers.d.ts +16 -0
- package/dist/mocks/msw/handlers/curationTaskExecutionHandlers.d.ts.map +1 -0
- package/dist/mocks/msw/handlers/curationTaskExecutionHandlers.js +24 -0
- package/dist/mocks/msw/handlers/curationTaskExecutionHandlers.js.map +1 -0
- package/dist/style/components/_data-grid-extra.css +1 -1
- package/dist/style/components/_data-grid-extra.scss +0 -6
- package/dist/synapse-client/SynapseClient.d.ts +7 -1
- package/dist/synapse-client/SynapseClient.d.ts.map +1 -1
- package/dist/synapse-client/SynapseClient.js +493 -482
- package/dist/synapse-client/SynapseClient.js.map +1 -1
- package/dist/synapse-client/index.js +3 -3
- package/dist/synapse-queries/curation/task/useCurationTask.d.ts +8 -1
- package/dist/synapse-queries/curation/task/useCurationTask.d.ts.map +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.js +48 -34
- package/dist/synapse-queries/curation/task/useCurationTask.js.map +1 -1
- package/dist/theme/palette/Palettes.js +2 -2
- package/dist/theme/palette/Palettes.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/AppUtils/session/useSessionManager.d.ts.map +1 -1
- package/dist/utils/AppUtils/session/useSessionManager.js +50 -48
- package/dist/utils/AppUtils/session/useSessionManager.js.map +1 -1
- package/dist/utils/SynapseConstants.d.ts +4 -1
- package/dist/utils/SynapseConstants.d.ts.map +1 -1
- package/dist/utils/SynapseConstants.js +86 -83
- package/dist/utils/SynapseConstants.js.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts +2 -2
- package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.js +1 -1
- package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
- package/dist/utils/hooks/useDetectSSOCode.d.ts.map +1 -1
- package/dist/utils/hooks/useDetectSSOCode.js +37 -27
- package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
- package/package.json +6 -6
- package/dist/components/DataGrid/MergeGridWithSourceTableButton.d.ts +0 -8
- package/dist/components/DataGrid/MergeGridWithSourceTableButton.d.ts.map +0 -1
- package/dist/components/DataGrid/MergeGridWithSourceTableButton.js +0 -64
- package/dist/components/DataGrid/MergeGridWithSourceTableButton.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCurationTaskFormState.js","names":[],"sources":["../../../../../src/features/entity/metadata-task/create-task/useCurationTaskFormState.ts"],"sourcesContent":["import {\n useCreateCurationTask,\n useDeleteCurationTask,\n useGetCurationTaskStatus,\n useUpdateCurationTask,\n useUpdateCurationTaskStatus,\n} from '@/synapse-queries/curation/task/useCurationTask'\nimport { useGetEntityPermissions } from '@/synapse-queries/entity/useEntity'\nimport { displayToast } from '@/components/ToastMessage'\nimport { useSynapseContext } from '@/utils/index'\nimport {\n CurationTask,\n TaskStatusStateEnum,\n} from '@sage-bionetworks/synapse-client'\nimport { useState } from 'react'\nimport {\n CREATE_TASK_STATUS_NOT_SAVED_WARNING,\n DELETE_CURATION_TASK_ERROR_TOAST_PREFIX,\n DELETE_CURATION_TASK_SUCCESS_TOAST,\n} from '../utils/constants'\nimport { dueDateInputToIso, isoToDueDateInput } from '../utils/dueDate'\n\nexport type UseCurationTaskFormStateArgs = {\n /**\n * Present when the host page already has a project context. Absent when creating from a context\n * without one, in which case the caller renders a project selector. Ignored in edit mode -- the\n * project is always derived from `task`.\n */\n projectId?: string\n /** The task being edited. Undefined when creating a new task. */\n task?: CurationTask\n /** Called after the task is successfully deleted (edit mode only). */\n onDeleted?: () => void\n}\n\n/**\n * The state and persistence logic shared by every curation-task create/edit form\n * (`ComputeTaskForm`, `CurateTaskForm`): common fields, project selection, task status (state +\n * due date), permissions, the create/update/delete mutations, and the submit-with-status flow.\n * The type-specific fields, validity, and payload construction remain the responsibility of each\n * form -- the caller passes a fully-built `CurationTask` payload to `submitTaskAndStatus`.\n */\nexport function useCurationTaskFormState(args: UseCurationTaskFormStateArgs) {\n const { projectId, task, onDeleted } = args\n const isEditMode = task !== undefined\n const { synapseClient } = useSynapseContext()\n\n const showProjectSelector = !isEditMode && !projectId\n const [selectedProjectId, setSelectedProjectId] = useState('')\n const effectiveProjectId = isEditMode\n ? (task?.projectId ?? '')\n : (projectId ?? selectedProjectId)\n\n const [dataType, setDataType] = useState(() => task?.dataType ?? '')\n const [instructions, setInstructions] = useState(\n () => task?.instructions ?? '',\n )\n const [assigneePrincipalId, setAssigneePrincipalId] = useState<\n string | undefined\n >(() => task?.assigneePrincipalId)\n\n // Task status (edit mode only). `dueDate` also lives on TaskStatus, so it's collected here even in\n // create mode (where there's no status to fetch yet -- it's applied to the auto-created status\n // immediately after the task itself is created, see `submitTaskAndStatus`).\n const { data: currentTaskStatus, isFetching: isStatusFetching } =\n useGetCurationTaskStatus(task?.taskId ?? 0, {\n enabled: isEditMode && task?.taskId != null,\n })\n const [pendingStatusState, setPendingStatusState] = useState<\n TaskStatusStateEnum | undefined\n >(undefined)\n const displayedStatusState = pendingStatusState ?? currentTaskStatus?.state\n // `pendingDueDate` and `displayedDueDate` are always the native date input's `YYYY-MM-DD` string.\n // The backend stores `TaskStatus.dueDate` as an ISO 8601 date-time string, so the fetched value is\n // converted for display and the entered value is converted back on write.\n const [pendingDueDate, setPendingDueDate] = useState<string | undefined>(\n undefined,\n )\n const displayedDueDate =\n pendingDueDate ??\n (isEditMode ? isoToDueDateInput(currentTaskStatus?.dueDate) : '')\n\n const { data: permissions } = useGetEntityPermissions(effectiveProjectId, {\n enabled: !!effectiveProjectId,\n })\n const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false)\n const canDelete = Boolean(\n permissions?.canDelete &&\n isEditMode &&\n task?.taskId != null &&\n onDeleted != null,\n )\n\n const {\n mutateAsync: createTask,\n isPending: isCreatePending,\n error: createError,\n } = useCreateCurationTask()\n const {\n mutateAsync: updateTask,\n isPending: isUpdatePending,\n error: updateError,\n } = useUpdateCurationTask()\n const {\n mutateAsync: updateTaskStatus,\n isPending: isStatusUpdatePending,\n error: statusUpdateError,\n } = useUpdateCurationTaskStatus()\n const { mutate: deleteTask, isPending: isDeletePending } =\n useDeleteCurationTask({\n onSuccess: () => {\n displayToast(DELETE_CURATION_TASK_SUCCESS_TOAST, 'success')\n setShowDeleteConfirmation(false)\n onDeleted?.()\n },\n onError: err => {\n displayToast(\n DELETE_CURATION_TASK_ERROR_TOAST_PREFIX + err.message,\n 'danger',\n )\n },\n })\n\n const isPending =\n isCreatePending ||\n isUpdatePending ||\n isStatusUpdatePending ||\n isDeletePending\n const error = createError ?? updateError ?? statusUpdateError\n\n const isCommonFieldsValid = !!dataType.trim() && !!instructions.trim()\n const isProjectValid = !showProjectSelector || !!selectedProjectId.trim()\n\n /**\n * Persists `payload` as either a create or an update (based on edit mode), then reconciles the\n * task's `TaskStatus` (state + due date). Returns the persisted task. On create, the status is\n * fetched (it is created server-side automatically) and patched only when a due date was entered.\n * On update, the status is written only when the state or due date changed; clearing the due date\n * (empty string) is a valid change and persists as an absent due date.\n */\n async function submitTaskAndStatus(\n payload: CurationTask,\n ): Promise<CurationTask> {\n const dueDateIso = dueDateInputToIso(displayedDueDate)\n\n if (isEditMode) {\n const latestTask = await updateTask(payload)\n\n const statusStateChanged =\n pendingStatusState !== undefined &&\n pendingStatusState !== currentTaskStatus?.state\n const dueDateChanged =\n pendingDueDate !== undefined &&\n dueDateIso !== (currentTaskStatus?.dueDate ?? undefined)\n if ((statusStateChanged || dueDateChanged) && currentTaskStatus != null) {\n // The task and its status share an etag, and the preceding `updateTask` bumped it; the\n // status update must use the etag returned by that update, not the stale fetched one. When\n // the user didn't touch the due date, preserve the stored value verbatim rather than the\n // re-encoded one, so a status-only edit can never blank out or rewrite an existing due date.\n await updateTaskStatus({\n ...currentTaskStatus,\n state: pendingStatusState ?? currentTaskStatus.state,\n dueDate:\n pendingDueDate !== undefined\n ? dueDateIso\n : currentTaskStatus.dueDate,\n etag: latestTask.etag,\n })\n }\n\n return latestTask\n }\n\n const created = await createTask(payload)\n\n if (dueDateIso && created.taskId != null) {\n // TODO(PLFM-9839): replace this best-effort status write with a single service that creates\n // the task and its status atomically. Until then, the task is created first and the due date\n // is applied to the auto-created status in a separate call; a failure there must not strand a\n // created task or surface as a hard error (which would tempt the user to re-create the task).\n try {\n // A CurationTask's TaskStatus is created automatically server-side; fetch it so the due date\n // can be applied to it. The freshly-fetched status carries the current shared etag.\n const status =\n await synapseClient.curationTaskServicesClient.getRepoV1CurationTaskTaskIdStatus(\n { taskId: created.taskId },\n )\n await updateTaskStatus({\n ...status,\n taskId: created.taskId,\n dueDate: dueDateIso,\n })\n } catch {\n displayToast(CREATE_TASK_STATUS_NOT_SAVED_WARNING, 'warning')\n }\n }\n\n return created\n }\n\n return {\n isEditMode,\n // project\n showProjectSelector,\n selectedProjectId,\n setSelectedProjectId,\n effectiveProjectId,\n // common fields\n dataType,\n setDataType,\n instructions,\n setInstructions,\n assigneePrincipalId,\n setAssigneePrincipalId,\n // status + due date\n currentTaskStatus,\n isStatusFetching,\n displayedStatusState,\n setPendingStatusState,\n displayedDueDate,\n setPendingDueDate,\n // permissions + delete\n canDelete,\n showDeleteConfirmation,\n setShowDeleteConfirmation,\n deleteTask,\n isDeletePending,\n // aggregate mutation state\n isPending,\n error,\n // validity (common portion; type-specific validity is the caller's responsibility)\n isCommonFieldsValid,\n isProjectValid,\n // submit\n submitTaskAndStatus,\n }\n}\n"],"mappings":";;;;;;;;;;AA0CA,SAAgB,EAAyB,GAAoC;CAC3E,IAAM,EAAE,cAAW,SAAM,iBAAc,GACjC,IAAa,MAAS,KAAA,GACtB,EAAE,qBAAkB,EAAkB,GAEtC,IAAsB,CAAC,KAAc,CAAC,GACtC,CAAC,GAAmB,KAAwB,EAAS,EAAE,GACvD,IAAqB,IACtB,GAAM,aAAa,KACnB,KAAa,GAEZ,CAAC,GAAU,KAAe,QAAe,GAAM,YAAY,EAAE,GAC7D,CAAC,GAAc,KAAmB,QAChC,GAAM,gBAAgB,EAC9B,GACM,CAAC,GAAqB,KAA0B,QAE9C,GAAM,mBAAmB,GAK3B,EAAE,MAAM,GAAmB,YAAY,MAC3C,EAAyB,GAAM,UAAU,GAAG,EAC1C,SAAS,KAAc,GAAM,UAAU,KACzC,CAAC,GACG,CAAC,GAAoB,KAAyB,EAElD,KAAA,CAAS,GACL,IAAuB,KAAsB,GAAmB,OAIhE,CAAC,GAAgB,KAAqB,EAC1C,KAAA,CACF,GACM,IACJ,MACC,IAAa,EAAkB,GAAmB,OAAO,IAAI,KAE1D,EAAE,MAAM,MAAgB,EAAwB,GAAoB,EACxE,SAAS,CAAC,CAAC,EACb,CAAC,GACK,CAAC,GAAwB,KAA6B,EAAS,EAAK,GACpE,IAAY,GAChB,GAAa,aACb,KACA,GAAM,UAAU,QAChB,KAAa,OAGT,EACJ,aAAa,GACb,WAAW,GACX,OAAO,MACL,EAAsB,GACpB,EACJ,aAAa,GACb,WAAW,GACX,OAAO,MACL,EAAsB,GACpB,EACJ,aAAa,GACb,WAAW,GACX,OAAO,MACL,EAA4B,GAC1B,EAAE,QAAQ,GAAY,WAAW,MACrC,EAAsB;EACpB,iBAAiB;GAGf,AAFA,EAAa,GAAoC,SAAS,GAC1D,EAA0B,EAAK,GAC/B,IAAY;EACd;EACA,UAAS,MAAO;GACd,EACE,IAA0C,EAAI,SAC9C,QACF;EACF;CACF,CAAC,GAEG,IACJ,KACA,KACA,KACA,GACI,IAAQ,KAAe,KAAe,GAEtC,KAAsB,CAAC,CAAC,EAAS,KAAK,KAAK,CAAC,CAAC,EAAa,KAAK,GAC/D,KAAiB,CAAC,KAAuB,CAAC,CAAC,EAAkB,KAAK;CASxE,eAAe,GACb,GACuB;EACvB,IAAM,IAAa,GAAkB,CAAgB;EAErD,IAAI,GAAY;GACd,IAAM,IAAa,MAAM,EAAW,CAAO,GAErC,IACJ,MAAuB,KAAA,KACvB,MAAuB,GAAmB,OACtC,IACJ,MAAmB,KAAA,KACnB,OAAgB,GAAmB,WAAW,KAAA;GAiBhD,QAhBK,KAAsB,MAAmB,KAAqB,QAKjE,MAAM,EAAiB;IACrB,GAAG;IACH,OAAO,KAAsB,EAAkB;IAC/C,SACE,MAAmB,KAAA,IAEf,EAAkB,UADlB;IAEN,MAAM,EAAW;GACnB,CAAC,GAGI;EACT;EAEA,IAAM,IAAU,MAAM,EAAW,CAAO;EAExC,IAAI,KAAc,EAAQ,UAAU,MAKlC,IAAI;GAOF,MAAM,EAAiB;IACrB,GAAG,MAJG,EAAc,2BAA2B,kCAC7C,EAAE,QAAQ,EAAQ,OAAO,CAC3B;IAGA,QAAQ,EAAQ;IAChB,SAAS;GACX,CAAC;EACH,QAAQ;GACN,EAAa,GAAsC,SAAS;EAC9D;EAGF,OAAO;CACT;CAEA,OAAO;EACL;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EAEA;CACF;AACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CurationTask } from '@sage-bionetworks/synapse-client';
|
|
2
|
+
import { ComputeTaskConcreteType } from '../../utils/types';
|
|
3
|
+
export type SampleSheetFieldsValue = {
|
|
4
|
+
inputTaskId: string;
|
|
5
|
+
destinationTaskId: string;
|
|
6
|
+
};
|
|
7
|
+
export type RecordSetFieldsValue = {
|
|
8
|
+
folderId: string;
|
|
9
|
+
instructions: string;
|
|
10
|
+
destinationTaskId: string;
|
|
11
|
+
};
|
|
12
|
+
export type ComputeTypeFields = {
|
|
13
|
+
concreteType: ComputeTaskConcreteType;
|
|
14
|
+
sampleSheet: SampleSheetFieldsValue;
|
|
15
|
+
recordSet: RecordSetFieldsValue;
|
|
16
|
+
};
|
|
17
|
+
export type BuildComputeTaskPayloadArgs = {
|
|
18
|
+
/** The task being edited, if any. Server-managed fields (taskId, etag, etc.) are carried over. */
|
|
19
|
+
existingTask?: CurationTask;
|
|
20
|
+
projectId: string;
|
|
21
|
+
dataType: string;
|
|
22
|
+
instructions: string;
|
|
23
|
+
assigneePrincipalId: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The Compute Data type-specific fields to write into `taskProperties`. Omit this when editing a task
|
|
26
|
+
* whose category is not one of the two Compute Data types (e.g. a legacy Curate Data task) -- in that
|
|
27
|
+
* case the existing `taskProperties` are carried over unchanged.
|
|
28
|
+
*/
|
|
29
|
+
computeTypeFields?: ComputeTypeFields;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Builds the `CurationTask` payload for creating or updating a Compute Data task from the create/edit
|
|
33
|
+
* task form's field state.
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildComputeTaskPayload(args: BuildComputeTaskPayloadArgs): CurationTask;
|
|
36
|
+
//# sourceMappingURL=buildComputeTaskPayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildComputeTaskPayload.d.ts","sourceRoot":"","sources":["../../../../../../src/features/entity/metadata-task/create-task/utils/buildComputeTaskPayload.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAG3D,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,uBAAuB,CAAA;IACrC,WAAW,EAAE,sBAAsB,CAAA;IACnC,SAAS,EAAE,oBAAoB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,kGAAkG;IAClG,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC,CAAA;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,2BAA2B,GAChC,YAAY,CAsBd"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { parseTaskIdInput as e } from "./taskIdValidation.js";
|
|
2
|
+
import { RecordSetGenerationExecutionPropertiesConcreteTypeEnum as t } from "@sage-bionetworks/synapse-client";
|
|
3
|
+
//#region src/features/entity/metadata-task/create-task/utils/buildComputeTaskPayload.ts
|
|
4
|
+
function n(e) {
|
|
5
|
+
let { existingTask: t, projectId: n, dataType: i, instructions: a, assigneePrincipalId: o, computeTypeFields: s } = e, c = s ? r(s) : t?.taskProperties;
|
|
6
|
+
return {
|
|
7
|
+
...t,
|
|
8
|
+
projectId: n,
|
|
9
|
+
dataType: i.trim() || void 0,
|
|
10
|
+
instructions: a.trim() || void 0,
|
|
11
|
+
assigneePrincipalId: o || void 0,
|
|
12
|
+
taskProperties: c
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function r(n) {
|
|
16
|
+
let { concreteType: r, sampleSheet: i, recordSet: a } = n;
|
|
17
|
+
return r === t.org_sagebionetworks_repo_model_curation_execution_RecordSetGenerationExecutionProperties ? {
|
|
18
|
+
concreteType: r,
|
|
19
|
+
folderId: a.folderId.trim() || void 0,
|
|
20
|
+
instructions: a.instructions.trim() || void 0,
|
|
21
|
+
destinationTaskId: e(a.destinationTaskId)
|
|
22
|
+
} : {
|
|
23
|
+
concreteType: r,
|
|
24
|
+
inputTaskId: e(i.inputTaskId),
|
|
25
|
+
destinationTaskId: e(i.destinationTaskId)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { n as buildComputeTaskPayload };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=buildComputeTaskPayload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildComputeTaskPayload.js","names":[],"sources":["../../../../../../src/features/entity/metadata-task/create-task/utils/buildComputeTaskPayload.ts"],"sourcesContent":["import {\n CurationTask,\n CurationTaskProperties,\n RecordSetGenerationExecutionPropertiesConcreteTypeEnum,\n} from '@sage-bionetworks/synapse-client'\nimport { ComputeTaskConcreteType } from '../../utils/types'\nimport { parseTaskIdInput } from './taskIdValidation'\n\nexport type SampleSheetFieldsValue = {\n inputTaskId: string\n destinationTaskId: string\n}\n\nexport type RecordSetFieldsValue = {\n folderId: string\n instructions: string\n destinationTaskId: string\n}\n\nexport type ComputeTypeFields = {\n concreteType: ComputeTaskConcreteType\n sampleSheet: SampleSheetFieldsValue\n recordSet: RecordSetFieldsValue\n}\n\nexport type BuildComputeTaskPayloadArgs = {\n /** The task being edited, if any. Server-managed fields (taskId, etag, etc.) are carried over. */\n existingTask?: CurationTask\n projectId: string\n dataType: string\n instructions: string\n assigneePrincipalId: string | undefined\n /**\n * The Compute Data type-specific fields to write into `taskProperties`. Omit this when editing a task\n * whose category is not one of the two Compute Data types (e.g. a legacy Curate Data task) -- in that\n * case the existing `taskProperties` are carried over unchanged.\n */\n computeTypeFields?: ComputeTypeFields\n}\n\n/**\n * Builds the `CurationTask` payload for creating or updating a Compute Data task from the create/edit\n * task form's field state.\n */\nexport function buildComputeTaskPayload(\n args: BuildComputeTaskPayloadArgs,\n): CurationTask {\n const {\n existingTask,\n projectId,\n dataType,\n instructions,\n assigneePrincipalId,\n computeTypeFields,\n } = args\n\n const taskProperties = computeTypeFields\n ? buildComputeTaskProperties(computeTypeFields)\n : existingTask?.taskProperties\n\n return {\n ...existingTask,\n projectId,\n dataType: dataType.trim() || undefined,\n instructions: instructions.trim() || undefined,\n assigneePrincipalId: assigneePrincipalId || undefined,\n taskProperties,\n }\n}\n\nfunction buildComputeTaskProperties(\n fields: ComputeTypeFields,\n): CurationTaskProperties {\n const { concreteType, sampleSheet, recordSet } = fields\n\n if (\n concreteType ===\n RecordSetGenerationExecutionPropertiesConcreteTypeEnum.org_sagebionetworks_repo_model_curation_execution_RecordSetGenerationExecutionProperties\n ) {\n return {\n concreteType,\n folderId: recordSet.folderId.trim() || undefined,\n instructions: recordSet.instructions.trim() || undefined,\n destinationTaskId: parseTaskIdInput(recordSet.destinationTaskId),\n }\n }\n\n return {\n concreteType,\n inputTaskId: parseTaskIdInput(sampleSheet.inputTaskId),\n destinationTaskId: parseTaskIdInput(sampleSheet.destinationTaskId),\n }\n}\n"],"mappings":";;;AA4CA,SAAgB,EACd,GACc;CACd,IAAM,EACJ,iBACA,cACA,aACA,iBACA,wBACA,yBACE,GAEE,IAAiB,IACnB,EAA2B,CAAiB,IAC5C,GAAc;CAElB,OAAO;EACL,GAAG;EACH;EACA,UAAU,EAAS,KAAK,KAAK,KAAA;EAC7B,cAAc,EAAa,KAAK,KAAK,KAAA;EACrC,qBAAqB,KAAuB,KAAA;EAC5C;CACF;AACF;AAEA,SAAS,EACP,GACwB;CACxB,IAAM,EAAE,iBAAc,gBAAa,iBAAc;CAcjD,OAXE,MACA,EAAuD,2FAEhD;EACL;EACA,UAAU,EAAU,SAAS,KAAK,KAAK,KAAA;EACvC,cAAc,EAAU,aAAa,KAAK,KAAK,KAAA;EAC/C,mBAAmB,EAAiB,EAAU,iBAAiB;CACjE,IAGK;EACL;EACA,aAAa,EAAiB,EAAY,WAAW;EACrD,mBAAmB,EAAiB,EAAY,iBAAiB;CACnE;AACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CurationTask, FileBasedMetadataTaskPropertiesSuggestedAuthorizationModeEnum } from '@sage-bionetworks/synapse-client';
|
|
2
|
+
import { CurateTaskConcreteType } from '../../utils/types';
|
|
3
|
+
/** Null represents the "Legacy" / unset option for suggestedAuthorizationMode. */
|
|
4
|
+
export type AuthorizationModeOption = FileBasedMetadataTaskPropertiesSuggestedAuthorizationModeEnum | 'NONE';
|
|
5
|
+
export type FileBasedFieldsValue = {
|
|
6
|
+
uploadFolderId: string;
|
|
7
|
+
fileViewId: string;
|
|
8
|
+
};
|
|
9
|
+
export type RecordBasedFieldsValue = {
|
|
10
|
+
recordSetId: string;
|
|
11
|
+
};
|
|
12
|
+
export type CurateTypeFields = {
|
|
13
|
+
concreteType: CurateTaskConcreteType;
|
|
14
|
+
authorizationMode: AuthorizationModeOption;
|
|
15
|
+
fileBased: FileBasedFieldsValue;
|
|
16
|
+
recordBased: RecordBasedFieldsValue;
|
|
17
|
+
};
|
|
18
|
+
export type BuildCurateTaskPayloadArgs = {
|
|
19
|
+
/** The task being edited, if any. Server-managed fields (taskId, etag, etc.) are carried over. */
|
|
20
|
+
existingTask?: CurationTask;
|
|
21
|
+
projectId: string;
|
|
22
|
+
dataType: string;
|
|
23
|
+
instructions: string;
|
|
24
|
+
assigneePrincipalId: string | undefined;
|
|
25
|
+
curateTypeFields: CurateTypeFields;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Builds the `CurationTask` payload for creating or updating a Curate Data task from the create/edit
|
|
29
|
+
* task form's field state.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildCurateTaskPayload(args: BuildCurateTaskPayloadArgs): CurationTask;
|
|
32
|
+
//# sourceMappingURL=buildCurateTaskPayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildCurateTaskPayload.d.ts","sourceRoot":"","sources":["../../../../../../src/features/entity/metadata-task/create-task/utils/buildCurateTaskPayload.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGZ,6DAA6D,EAC9D,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACL,sBAAsB,EAEvB,MAAM,mBAAmB,CAAA;AAE1B,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAC/B,6DAA6D,GAC7D,MAAM,CAAA;AAEV,MAAM,MAAM,oBAAoB,GAAG;IACjC,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,EAAE,sBAAsB,CAAA;IACpC,iBAAiB,EAAE,uBAAuB,CAAA;IAC1C,SAAS,EAAE,oBAAoB,CAAA;IAC/B,WAAW,EAAE,sBAAsB,CAAA;CACpC,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,kGAAkG;IAClG,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,gBAAgB,EAAE,gBAAgB,CAAA;CACnC,CAAA;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,0BAA0B,GAC/B,YAAY,CA4Bd"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { instanceOfGridSupportedTaskProperties as e } from "../../utils/types.js";
|
|
2
|
+
import { FileBasedMetadataTaskPropertiesConcreteTypeEnum as t } from "@sage-bionetworks/synapse-client";
|
|
3
|
+
//#region src/features/entity/metadata-task/create-task/utils/buildCurateTaskPayload.ts
|
|
4
|
+
function n(t) {
|
|
5
|
+
let { existingTask: n, projectId: i, dataType: a, instructions: o, assigneePrincipalId: s, curateTypeFields: c } = t, l = n?.taskProperties, u = e(l) ? l.collaboratorPrincipalIds : void 0;
|
|
6
|
+
return {
|
|
7
|
+
...n,
|
|
8
|
+
projectId: i,
|
|
9
|
+
dataType: a.trim() || void 0,
|
|
10
|
+
instructions: o.trim() || void 0,
|
|
11
|
+
assigneePrincipalId: s || void 0,
|
|
12
|
+
taskProperties: r(c, u)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function r(e, n) {
|
|
16
|
+
let { concreteType: r, authorizationMode: i, fileBased: a, recordBased: o } = e, s = i === "NONE" ? void 0 : i;
|
|
17
|
+
return r === t.org_sagebionetworks_repo_model_curation_metadata_FileBasedMetadataTaskProperties ? {
|
|
18
|
+
concreteType: r,
|
|
19
|
+
uploadFolderId: a.uploadFolderId.trim() || void 0,
|
|
20
|
+
fileViewId: a.fileViewId.trim() || void 0,
|
|
21
|
+
suggestedAuthorizationMode: s,
|
|
22
|
+
collaboratorPrincipalIds: n
|
|
23
|
+
} : {
|
|
24
|
+
concreteType: r,
|
|
25
|
+
recordSetId: o.recordSetId.trim() || void 0,
|
|
26
|
+
suggestedAuthorizationMode: s,
|
|
27
|
+
collaboratorPrincipalIds: n
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { n as buildCurateTaskPayload };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=buildCurateTaskPayload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildCurateTaskPayload.js","names":[],"sources":["../../../../../../src/features/entity/metadata-task/create-task/utils/buildCurateTaskPayload.ts"],"sourcesContent":["import {\n CurationTask,\n CurationTaskProperties,\n FileBasedMetadataTaskPropertiesConcreteTypeEnum,\n FileBasedMetadataTaskPropertiesSuggestedAuthorizationModeEnum,\n} from '@sage-bionetworks/synapse-client'\nimport {\n CurateTaskConcreteType,\n instanceOfGridSupportedTaskProperties,\n} from '../../utils/types'\n\n/** Null represents the \"Legacy\" / unset option for suggestedAuthorizationMode. */\nexport type AuthorizationModeOption =\n | FileBasedMetadataTaskPropertiesSuggestedAuthorizationModeEnum\n | 'NONE'\n\nexport type FileBasedFieldsValue = {\n uploadFolderId: string\n fileViewId: string\n}\n\nexport type RecordBasedFieldsValue = {\n recordSetId: string\n}\n\nexport type CurateTypeFields = {\n concreteType: CurateTaskConcreteType\n authorizationMode: AuthorizationModeOption\n fileBased: FileBasedFieldsValue\n recordBased: RecordBasedFieldsValue\n}\n\nexport type BuildCurateTaskPayloadArgs = {\n /** The task being edited, if any. Server-managed fields (taskId, etag, etc.) are carried over. */\n existingTask?: CurationTask\n projectId: string\n dataType: string\n instructions: string\n assigneePrincipalId: string | undefined\n curateTypeFields: CurateTypeFields\n}\n\n/**\n * Builds the `CurationTask` payload for creating or updating a Curate Data task from the create/edit\n * task form's field state.\n */\nexport function buildCurateTaskPayload(\n args: BuildCurateTaskPayloadArgs,\n): CurationTask {\n const {\n existingTask,\n projectId,\n dataType,\n instructions,\n assigneePrincipalId,\n curateTypeFields,\n } = args\n\n const existingTaskProperties = existingTask?.taskProperties\n const collaboratorPrincipalIds = instanceOfGridSupportedTaskProperties(\n existingTaskProperties,\n )\n ? existingTaskProperties.collaboratorPrincipalIds\n : undefined\n\n return {\n ...existingTask,\n projectId,\n dataType: dataType.trim() || undefined,\n instructions: instructions.trim() || undefined,\n assigneePrincipalId: assigneePrincipalId || undefined,\n taskProperties: buildCurateTaskProperties(\n curateTypeFields,\n collaboratorPrincipalIds,\n ),\n }\n}\n\nfunction buildCurateTaskProperties(\n fields: CurateTypeFields,\n collaboratorPrincipalIds: string[] | undefined,\n): CurationTaskProperties {\n const { concreteType, authorizationMode, fileBased, recordBased } = fields\n const suggestedAuthorizationMode =\n authorizationMode === 'NONE' ? undefined : authorizationMode\n\n if (\n concreteType ===\n FileBasedMetadataTaskPropertiesConcreteTypeEnum.org_sagebionetworks_repo_model_curation_metadata_FileBasedMetadataTaskProperties\n ) {\n return {\n concreteType,\n uploadFolderId: fileBased.uploadFolderId.trim() || undefined,\n fileViewId: fileBased.fileViewId.trim() || undefined,\n suggestedAuthorizationMode,\n collaboratorPrincipalIds,\n }\n }\n\n return {\n concreteType,\n recordSetId: recordBased.recordSetId.trim() || undefined,\n suggestedAuthorizationMode,\n collaboratorPrincipalIds,\n }\n}\n"],"mappings":";;;AA8CA,SAAgB,EACd,GACc;CACd,IAAM,EACJ,iBACA,cACA,aACA,iBACA,wBACA,wBACE,GAEE,IAAyB,GAAc,gBACvC,IAA2B,EAC/B,CACF,IACI,EAAuB,2BACvB,KAAA;CAEJ,OAAO;EACL,GAAG;EACH;EACA,UAAU,EAAS,KAAK,KAAK,KAAA;EAC7B,cAAc,EAAa,KAAK,KAAK,KAAA;EACrC,qBAAqB,KAAuB,KAAA;EAC5C,gBAAgB,EACd,GACA,CACF;CACF;AACF;AAEA,SAAS,EACP,GACA,GACwB;CACxB,IAAM,EAAE,iBAAc,sBAAmB,cAAW,mBAAgB,GAC9D,IACJ,MAAsB,SAAS,KAAA,IAAY;CAe7C,OAZE,MACA,EAAgD,mFAEzC;EACL;EACA,gBAAgB,EAAU,eAAe,KAAK,KAAK,KAAA;EACnD,YAAY,EAAU,WAAW,KAAK,KAAK,KAAA;EAC3C;EACA;CACF,IAGK;EACL;EACA,aAAa,EAAY,YAAY,KAAK,KAAK,KAAA;EAC/C;EACA;CACF;AACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if `value` is a positive integer (a valid Synapse task ID). If `allowEmpty` is true, an
|
|
3
|
+
* empty/whitespace-only string is also considered valid (useful for not-yet-required fields).
|
|
4
|
+
*/
|
|
5
|
+
export declare function isValidTaskIdInput(value: string, options?: {
|
|
6
|
+
allowEmpty?: boolean;
|
|
7
|
+
}): boolean;
|
|
8
|
+
/** Parses a task ID input string into a number, or undefined if it is not a valid positive integer. */
|
|
9
|
+
export declare function parseTaskIdInput(value: string): number | undefined;
|
|
10
|
+
//# sourceMappingURL=taskIdValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskIdValidation.d.ts","sourceRoot":"","sources":["../../../../../../src/features/entity/metadata-task/create-task/utils/taskIdValidation.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACrC,OAAO,CAMT;AAED,uGAAuG;AACvG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKlE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/features/entity/metadata-task/create-task/utils/taskIdValidation.ts
|
|
2
|
+
var e = /^[1-9][0-9]*$/;
|
|
3
|
+
function t(t, n = {}) {
|
|
4
|
+
let r = t.trim();
|
|
5
|
+
return r === "" ? n.allowEmpty ?? !1 : e.test(r);
|
|
6
|
+
}
|
|
7
|
+
function n(e) {
|
|
8
|
+
if (t(e)) return Number(e.trim());
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as isValidTaskIdInput, n as parseTaskIdInput };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=taskIdValidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taskIdValidation.js","names":[],"sources":["../../../../../../src/features/entity/metadata-task/create-task/utils/taskIdValidation.ts"],"sourcesContent":["/**\n * A positive whole number, e.g. \"1\", \"42\". Does not allow leading zeros, decimals, or negative numbers.\n */\nconst POSITIVE_INTEGER_PATTERN = /^[1-9][0-9]*$/\n\n/**\n * Returns true if `value` is a positive integer (a valid Synapse task ID). If `allowEmpty` is true, an\n * empty/whitespace-only string is also considered valid (useful for not-yet-required fields).\n */\nexport function isValidTaskIdInput(\n value: string,\n options: { allowEmpty?: boolean } = {},\n): boolean {\n const trimmed = value.trim()\n if (trimmed === '') {\n return options.allowEmpty ?? false\n }\n return POSITIVE_INTEGER_PATTERN.test(trimmed)\n}\n\n/** Parses a task ID input string into a number, or undefined if it is not a valid positive integer. */\nexport function parseTaskIdInput(value: string): number | undefined {\n if (!isValidTaskIdInput(value)) {\n return undefined\n }\n return Number(value.trim())\n}\n"],"mappings":";AAGA,IAAM,IAA2B;AAMjC,SAAgB,EACd,GACA,IAAoC,CAAC,GAC5B;CACT,IAAM,IAAU,EAAM,KAAK;CAI3B,OAHI,MAAY,KACP,EAAQ,cAAc,KAExB,EAAyB,KAAK,CAAO;AAC9C;AAGA,SAAgB,EAAiB,GAAmC;CAC7D,MAAmB,CAAK,GAG7B,OAAO,OAAO,EAAM,KAAK,CAAC;AAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGridSessionForCurationTask.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/hooks/useGridSessionForCurationTask.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,WAAW,
|
|
1
|
+
{"version":3,"file":"useGridSessionForCurationTask.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/hooks/useGridSessionForCurationTask.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,WAAW,EAGX,kBAAkB,EAClB,UAAU,EACX,MAAM,kCAAkC,CAAA;AAKzC,MAAM,MAAM,mCAAmC,GAAG;IAChD,WAAW,EAAE,WAAW,CAAA;CACzB,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,6BAA6B,oIA0GpD"}
|
|
@@ -4,53 +4,53 @@ import { getGridSessionQuery as t, useCreateGridSession as n, useDeleteGridSessi
|
|
|
4
4
|
import { useUpdateCurationTaskStatus as i } from "../../../../synapse-queries/curation/task/useCurationTask.js";
|
|
5
5
|
import { OPEN_CURATOR_LINK_TASK_CONFLICT_ERROR_MESSAGE as a } from "../utils/constants.js";
|
|
6
6
|
import { getCreateGridRequestForMetadataTask as o } from "../utils/getCreateGridRequestForMetadataTask.js";
|
|
7
|
-
import { AuthorizationMode as s, SynapseClientError as c } from "@sage-bionetworks/synapse-client";
|
|
8
|
-
import { useMutation as
|
|
7
|
+
import { AuthorizationMode as s, SynapseClientError as c, instanceOfGridExecutionDetails as l } from "@sage-bionetworks/synapse-client";
|
|
8
|
+
import { useMutation as u, useQueryClient as d } from "@tanstack/react-query";
|
|
9
9
|
//#region src/features/entity/metadata-task/hooks/useGridSessionForCurationTask.ts
|
|
10
|
-
function
|
|
11
|
-
let { mutateAsync:
|
|
12
|
-
return
|
|
10
|
+
function f() {
|
|
11
|
+
let { mutateAsync: f } = n(), { mutateAsync: p } = i(), { mutateAsync: m } = r(), h = e(), g = d();
|
|
12
|
+
return u({ mutationFn: async (e) => {
|
|
13
13
|
let { task: n, status: r } = e;
|
|
14
14
|
if (!n || !r) throw Error("CurationTaskBundle is missing task or status");
|
|
15
|
-
let i = r?.executionDetails
|
|
15
|
+
let i = r?.executionDetails != null && l(r.executionDetails) ? r.executionDetails.activeSessionId : void 0;
|
|
16
16
|
if (i) try {
|
|
17
|
-
return { gridSession: await
|
|
17
|
+
return { gridSession: await g.fetchQuery({
|
|
18
18
|
...t(i, {
|
|
19
|
-
...
|
|
20
|
-
queryClient:
|
|
19
|
+
...h,
|
|
20
|
+
queryClient: g
|
|
21
21
|
}),
|
|
22
22
|
staleTime: 0
|
|
23
23
|
}) };
|
|
24
24
|
} catch (e) {
|
|
25
25
|
if (!(e instanceof c && e.status === 404)) throw e;
|
|
26
26
|
}
|
|
27
|
-
let
|
|
28
|
-
if (
|
|
29
|
-
let
|
|
30
|
-
if (
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
let
|
|
34
|
-
...o(
|
|
35
|
-
authorizationMode:
|
|
36
|
-
ownerPrincipalId:
|
|
27
|
+
let u = n.taskProperties;
|
|
28
|
+
if (u == null) throw Error("CurationTask is missing taskProperties");
|
|
29
|
+
let d = "suggestedAuthorizationMode" in u ? u.suggestedAuthorizationMode : void 0;
|
|
30
|
+
if (d == null) throw Error("CurationTask is missing suggestedAuthorizationMode in taskProperties");
|
|
31
|
+
let _;
|
|
32
|
+
d === s.SESSION_OWNER && (_ = n.assigneePrincipalId);
|
|
33
|
+
let v = (await f({
|
|
34
|
+
...o(u),
|
|
35
|
+
authorizationMode: d,
|
|
36
|
+
ownerPrincipalId: _
|
|
37
37
|
})).gridSession;
|
|
38
38
|
try {
|
|
39
|
-
await
|
|
39
|
+
await p({
|
|
40
40
|
...r,
|
|
41
41
|
executionDetails: {
|
|
42
42
|
...r.executionDetails,
|
|
43
|
-
activeSessionId:
|
|
43
|
+
activeSessionId: v.sessionId,
|
|
44
44
|
concreteType: "org.sagebionetworks.repo.model.curation.execution.GridExecutionDetails"
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
} catch (e) {
|
|
48
|
-
throw e instanceof c && e.status === 412 ? (await
|
|
48
|
+
throw e instanceof c && e.status === 412 ? (await m(v.sessionId), Error(a)) : e;
|
|
49
49
|
}
|
|
50
|
-
return { gridSession:
|
|
50
|
+
return { gridSession: v };
|
|
51
51
|
} });
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
|
-
export {
|
|
54
|
+
export { f as default };
|
|
55
55
|
|
|
56
56
|
//# sourceMappingURL=useGridSessionForCurationTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGridSessionForCurationTask.js","names":[],"sources":["../../../../../src/features/entity/metadata-task/hooks/useGridSessionForCurationTask.ts"],"sourcesContent":["import { useUpdateCurationTaskStatus } from '@/synapse-queries/curation/task/useCurationTask'\nimport {\n getGridSessionQuery,\n useCreateGridSession,\n useDeleteGridSession,\n} from '@/synapse-queries/grid/useGridSession'\nimport { useSynapseContext } from '@/utils'\nimport {\n AuthorizationMode,\n CreateGridRequest,\n GridSession,\n GridSupportedTaskProperties,\n SynapseClientError,\n TaskBundle,\n} from '@sage-bionetworks/synapse-client'\nimport { useMutation, useQueryClient } from '@tanstack/react-query'\nimport { OPEN_CURATOR_LINK_TASK_CONFLICT_ERROR_MESSAGE } from '../utils/constants'\nimport { getCreateGridRequestForMetadataTask } from '../utils/getCreateGridRequestForMetadataTask'\n\nexport type UseGridSessionForCurationTaskResult = {\n gridSession: GridSession\n}\n\n/**\n * A hook to get or create a GridSession for a given CurationTask. If an appropriate GridSession exists, it will be returned.\n * If not, a new GridSession will be created based on the CurationTask's properties.\n *\n * @returns A mutation object with a function to get or create a GridSession for a CurationTask. The response will also indicate\n * if the GridSession owner matches the task assignee (if there is one).\n * @throws SynapseClientError with status 403 if the user does not have permission to access an existing GridSession\n */\nexport default function useGridSessionForCurationTask() {\n const { mutateAsync: createGridSession } = useCreateGridSession()\n const { mutateAsync: updateCurationTaskStatus } =\n useUpdateCurationTaskStatus()\n const { mutateAsync: deleteGridSession } = useDeleteGridSession()\n\n const synapseContext = useSynapseContext()\n const queryClient = useQueryClient()\n\n return useMutation<\n UseGridSessionForCurationTaskResult,\n SynapseClientError,\n TaskBundle\n >({\n mutationFn: async curationTaskBundle => {\n const { task, status } = curationTaskBundle\n if (!task || !status) {\n throw new Error('CurationTaskBundle is missing task or status')\n }\n
|
|
1
|
+
{"version":3,"file":"useGridSessionForCurationTask.js","names":[],"sources":["../../../../../src/features/entity/metadata-task/hooks/useGridSessionForCurationTask.ts"],"sourcesContent":["import { useUpdateCurationTaskStatus } from '@/synapse-queries/curation/task/useCurationTask'\nimport {\n getGridSessionQuery,\n useCreateGridSession,\n useDeleteGridSession,\n} from '@/synapse-queries/grid/useGridSession'\nimport { useSynapseContext } from '@/utils'\nimport {\n AuthorizationMode,\n CreateGridRequest,\n GridSession,\n GridSupportedTaskProperties,\n instanceOfGridExecutionDetails,\n SynapseClientError,\n TaskBundle,\n} from '@sage-bionetworks/synapse-client'\nimport { useMutation, useQueryClient } from '@tanstack/react-query'\nimport { OPEN_CURATOR_LINK_TASK_CONFLICT_ERROR_MESSAGE } from '../utils/constants'\nimport { getCreateGridRequestForMetadataTask } from '../utils/getCreateGridRequestForMetadataTask'\n\nexport type UseGridSessionForCurationTaskResult = {\n gridSession: GridSession\n}\n\n/**\n * A hook to get or create a GridSession for a given CurationTask. If an appropriate GridSession exists, it will be returned.\n * If not, a new GridSession will be created based on the CurationTask's properties.\n *\n * @returns A mutation object with a function to get or create a GridSession for a CurationTask. The response will also indicate\n * if the GridSession owner matches the task assignee (if there is one).\n * @throws SynapseClientError with status 403 if the user does not have permission to access an existing GridSession\n */\nexport default function useGridSessionForCurationTask() {\n const { mutateAsync: createGridSession } = useCreateGridSession()\n const { mutateAsync: updateCurationTaskStatus } =\n useUpdateCurationTaskStatus()\n const { mutateAsync: deleteGridSession } = useDeleteGridSession()\n\n const synapseContext = useSynapseContext()\n const queryClient = useQueryClient()\n\n return useMutation<\n UseGridSessionForCurationTaskResult,\n SynapseClientError,\n TaskBundle\n >({\n mutationFn: async curationTaskBundle => {\n const { task, status } = curationTaskBundle\n if (!task || !status) {\n throw new Error('CurationTaskBundle is missing task or status')\n }\n const gridSessionId =\n status?.executionDetails != null &&\n instanceOfGridExecutionDetails(status.executionDetails)\n ? status.executionDetails.activeSessionId\n : undefined\n if (gridSessionId) {\n try {\n // Verify the session is still active before returning it\n const gridSession = await queryClient.fetchQuery({\n ...getGridSessionQuery(gridSessionId, {\n ...synapseContext,\n queryClient,\n }),\n staleTime: 0,\n })\n\n return {\n gridSession,\n }\n } catch (e) {\n if (e instanceof SynapseClientError && e.status === 404) {\n // Session not found, will create a new one\n } else {\n throw e\n }\n }\n }\n // Create a session and link it to the task\n const taskProperties = task.taskProperties as GridSupportedTaskProperties\n if (taskProperties == null) {\n throw new Error('CurationTask is missing taskProperties')\n }\n\n const suggestedAuthorizationMode =\n 'suggestedAuthorizationMode' in taskProperties\n ? taskProperties.suggestedAuthorizationMode\n : undefined\n\n if (suggestedAuthorizationMode == null) {\n throw new Error(\n 'CurationTask is missing suggestedAuthorizationMode in taskProperties',\n )\n }\n\n let ownerPrincipalId: string | undefined = undefined\n if (suggestedAuthorizationMode === AuthorizationMode.SESSION_OWNER) {\n // TODO: Add collaboratorPrincipalIds once the server supports multiple owners.\n ownerPrincipalId = task.assigneePrincipalId\n }\n\n const createGridRequest: CreateGridRequest = {\n ...getCreateGridRequestForMetadataTask(taskProperties),\n authorizationMode: suggestedAuthorizationMode,\n ownerPrincipalId,\n }\n const createGridResponse = await createGridSession(createGridRequest)\n const gridSession = createGridResponse.gridSession!\n\n // Associate the new session with the task\n try {\n await updateCurationTaskStatus({\n ...status,\n executionDetails: {\n ...status.executionDetails,\n activeSessionId: gridSession.sessionId!,\n concreteType:\n 'org.sagebionetworks.repo.model.curation.execution.GridExecutionDetails',\n },\n })\n } catch (e) {\n if (e instanceof SynapseClientError && e.status === 412) {\n // etag mismatch -- possible race condition.\n // Delete the session we just created to avoid orphaned sessions, and throw an error to notify the user that they may need to refresh and try again.\n await deleteGridSession(gridSession.sessionId!)\n throw new Error(OPEN_CURATOR_LINK_TASK_CONFLICT_ERROR_MESSAGE)\n } else {\n // Rethrow any other error\n throw e\n }\n }\n\n // Since we just created the session, the user must have access, and the owner must match the assignee (if there is one).\n return {\n gridSession,\n }\n },\n })\n}\n"],"mappings":";;;;;;;;;AAgCA,SAAwB,IAAgC;CACtD,IAAM,EAAE,aAAa,MAAsB,EAAqB,GAC1D,EAAE,aAAa,MACnB,EAA4B,GACxB,EAAE,aAAa,MAAsB,EAAqB,GAE1D,IAAiB,EAAkB,GACnC,IAAc,EAAe;CAEnC,OAAO,EAIL,EACA,YAAY,OAAM,MAAsB;EACtC,IAAM,EAAE,SAAM,cAAW;EACzB,IAAI,CAAC,KAAQ,CAAC,GACZ,MAAU,MAAM,8CAA8C;EAEhE,IAAM,IACJ,GAAQ,oBAAoB,QAC5B,EAA+B,EAAO,gBAAgB,IAClD,EAAO,iBAAiB,kBACxB,KAAA;EACN,IAAI,GACF,IAAI;GAUF,OAAO,EACL,aAAA,MATwB,EAAY,WAAW;IAC/C,GAAG,EAAoB,GAAe;KACpC,GAAG;KACH;IACF,CAAC;IACD,WAAW;GACb,CAAC,EAID;EACF,SAAS,GAAG;GACV,IAAI,eAAa,KAAsB,EAAE,WAAW,MAGlD,MAAM;EAEV;EAGF,IAAM,IAAiB,EAAK;EAC5B,IAAI,KAAkB,MACpB,MAAU,MAAM,wCAAwC;EAG1D,IAAM,IACJ,gCAAgC,IAC5B,EAAe,6BACf,KAAA;EAEN,IAAI,KAA8B,MAChC,MAAU,MACR,sEACF;EAGF,IAAI;EACJ,AAAI,MAA+B,EAAkB,kBAEnD,IAAmB,EAAK;EAS1B,IAAM,KAAc,MADa,EAAkB;GAJjD,GAAG,EAAoC,CAAc;GACrD,mBAAmB;GACnB;EAEiD,CAAiB,GAC7B;EAGvC,IAAI;GACF,MAAM,EAAyB;IAC7B,GAAG;IACH,kBAAkB;KAChB,GAAG,EAAO;KACV,iBAAiB,EAAY;KAC7B,cACE;IACJ;GACF,CAAC;EACH,SAAS,GAAG;GAQR,MAPE,aAAa,KAAsB,EAAE,WAAW,OAGlD,MAAM,EAAkB,EAAY,SAAU,GACpC,MAAM,CAA6C,KAGvD;EAEV;EAGA,OAAO,EACL,eACF;CACF,EACF,CAAC;AACH"}
|
package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask_legacy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGridSessionForCurationTask_legacy.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/hooks/useGridSessionForCurationTask_legacy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,
|
|
1
|
+
{"version":3,"file":"useGridSessionForCurationTask_legacy.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/hooks/useGridSessionForCurationTask_legacy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAEnB,MAAM,kCAAkC,CAAA;AAMzC;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oCAAoC;kBAOxC,YAAY;YAgB/B"}
|
|
@@ -6,8 +6,8 @@ import { useMutation as r } from "@tanstack/react-query";
|
|
|
6
6
|
function i() {
|
|
7
7
|
let { mutateAsync: i } = n();
|
|
8
8
|
return r({ mutationFn: async ({ curationTask: n }) => await i({
|
|
9
|
-
sourceId: t(n),
|
|
10
|
-
createRequest: e(n)
|
|
9
|
+
sourceId: t(n.taskProperties),
|
|
10
|
+
createRequest: e(n.taskProperties)
|
|
11
11
|
}) });
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
package/dist/features/entity/metadata-task/hooks/useGridSessionForCurationTask_legacy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGridSessionForCurationTask_legacy.js","names":[],"sources":["../../../../../src/features/entity/metadata-task/hooks/useGridSessionForCurationTask_legacy.ts"],"sourcesContent":["import {\n CurationTask,\n GridSession,\n SynapseClientError,\n} from '@sage-bionetworks/synapse-client'\nimport { useMutation } from '@tanstack/react-query'\nimport { getCreateGridRequestForMetadataTask } from '../utils/getCreateGridRequestForMetadataTask'\nimport { getGridSourceIdForTask } from '../utils/getGridSourceIdForTask'\nimport useGetOrCreateGridSessionForSource from './useGetOrCreateGridSessionForSource'\n\n/**\n * A hook to get or create a GridSession for an unassigned CurationTask. The session will be owned by the calling user.\n *\n * @returns A mutation object with a function to get or create a GridSession for a CurationTask.\n * @deprecated This functionality is preserved to ensure users are not blocked from doing work, but enables a critical\n * data loss scenario, so we must aim to remove it.\n */\nexport default function useGridSessionForCurationTask_legacy() {\n const { mutateAsync: getOrCreateGridSession } =\n useGetOrCreateGridSessionForSource()\n\n return useMutation<\n GridSession,\n SynapseClientError,\n { curationTask: CurationTask }\n >({\n mutationFn: async ({ curationTask }) => {\n const gridSourceId = getGridSourceIdForTask(curationTask)\n\n const createGridRequest
|
|
1
|
+
{"version":3,"file":"useGridSessionForCurationTask_legacy.js","names":[],"sources":["../../../../../src/features/entity/metadata-task/hooks/useGridSessionForCurationTask_legacy.ts"],"sourcesContent":["import {\n CurationTask,\n GridSession,\n SynapseClientError,\n GridSupportedTaskProperties,\n} from '@sage-bionetworks/synapse-client'\nimport { useMutation } from '@tanstack/react-query'\nimport { getCreateGridRequestForMetadataTask } from '../utils/getCreateGridRequestForMetadataTask'\nimport { getGridSourceIdForTask } from '../utils/getGridSourceIdForTask'\nimport useGetOrCreateGridSessionForSource from './useGetOrCreateGridSessionForSource'\n\n/**\n * A hook to get or create a GridSession for an unassigned CurationTask. The session will be owned by the calling user.\n *\n * @returns A mutation object with a function to get or create a GridSession for a CurationTask.\n * @deprecated This functionality is preserved to ensure users are not blocked from doing work, but enables a critical\n * data loss scenario, so we must aim to remove it.\n */\nexport default function useGridSessionForCurationTask_legacy() {\n const { mutateAsync: getOrCreateGridSession } =\n useGetOrCreateGridSessionForSource()\n\n return useMutation<\n GridSession,\n SynapseClientError,\n { curationTask: CurationTask }\n >({\n mutationFn: async ({ curationTask }) => {\n const gridSourceId = getGridSourceIdForTask(\n curationTask.taskProperties as GridSupportedTaskProperties,\n )\n\n const createGridRequest = getCreateGridRequestForMetadataTask(\n curationTask.taskProperties as GridSupportedTaskProperties,\n )\n return await getOrCreateGridSession({\n sourceId: gridSourceId,\n createRequest: createGridRequest,\n })\n },\n })\n}\n"],"mappings":";;;;;AAkBA,SAAwB,IAAuC;CAC7D,IAAM,EAAE,aAAa,MACnB,EAAmC;CAErC,OAAO,EAIL,EACA,YAAY,OAAO,EAAE,sBAQZ,MAAM,EAAuB;EAClC,UARmB,EACnB,EAAa,cAOH;EACV,eALwB,EACxB,EAAa,cAIE;CACjB,CAAC,EAEL,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMetadataTaskTable.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/hooks/useMetadataTaskTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMetadataTaskTable.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/hooks/useMetadataTaskTable.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,uBAAuB,EACvB,UAAU,EACX,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAGL,KAAK,EAEN,MAAM,uBAAuB,CAAA;AAqE9B,KAAK,2BAA2B,GAAG;IACjC,uBAAuB,EAAE,uBAAuB,CAAA;CACjD,CAAA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,2BAA2B;;;;;;EAiDrE"}
|
|
@@ -4,54 +4,55 @@ import { formatDate as t } from "../../../../utils/functions/DateFormatter.js";
|
|
|
4
4
|
import n from "../../../../components/TanStackTable/ColumnHeader.js";
|
|
5
5
|
import { getLinkToEntityPage as r } from "../../../../utils/functions/getSynapseWebClientLink.js";
|
|
6
6
|
import { useGetCurationTasksInfinite as i } from "../../../../synapse-queries/curation/task/useCurationTask.js";
|
|
7
|
-
import {
|
|
8
|
-
import o from "../
|
|
9
|
-
import s from "../components/
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import d from "
|
|
14
|
-
import
|
|
7
|
+
import { instanceOfGridSupportedTaskProperties as a } from "../utils/types.js";
|
|
8
|
+
import { getGridSourceIdForTask as o } from "../utils/getGridSourceIdForTask.js";
|
|
9
|
+
import s from "../components/MetadataTaskTableActionCell.js";
|
|
10
|
+
import c from "../components/MetadataTasksTableAssigneeCell.js";
|
|
11
|
+
import { useMemo as l } from "react";
|
|
12
|
+
import { Link as u } from "@mui/material";
|
|
13
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
14
|
+
import f from "dayjs";
|
|
15
|
+
import { createColumnHelper as p, getCoreRowModel as m, useReactTable as h } from "@tanstack/react-table";
|
|
15
16
|
//#region src/features/entity/metadata-task/hooks/useMetadataTaskTable.tsx
|
|
16
|
-
function
|
|
17
|
-
let i =
|
|
17
|
+
function g(e) {
|
|
18
|
+
let i = p();
|
|
18
19
|
return [
|
|
19
20
|
i.accessor("task.dataType", {
|
|
20
|
-
header: (e) => /* @__PURE__ */
|
|
21
|
+
header: (e) => /* @__PURE__ */ d(n, {
|
|
21
22
|
...e,
|
|
22
23
|
title: "Task"
|
|
23
24
|
}),
|
|
24
|
-
cell: ({ row: e, getValue: t }) => /* @__PURE__ */ u
|
|
25
|
-
href: r(
|
|
25
|
+
cell: ({ row: e, getValue: t }) => a(e.original.task.taskProperties) ? /* @__PURE__ */ d(u, {
|
|
26
|
+
href: r(o(e.original.task.taskProperties)),
|
|
26
27
|
children: t()
|
|
27
|
-
}),
|
|
28
|
+
}) : /* @__PURE__ */ d("p", { children: t() }),
|
|
28
29
|
enableSorting: !1,
|
|
29
30
|
enableColumnFilter: !1
|
|
30
31
|
}),
|
|
31
32
|
i.accessor("task.taskId", {
|
|
32
|
-
header: (e) => /* @__PURE__ */
|
|
33
|
+
header: (e) => /* @__PURE__ */ d(n, {
|
|
33
34
|
...e,
|
|
34
35
|
title: "Task ID"
|
|
35
36
|
}),
|
|
36
|
-
cell: ({ getValue: e }) => /* @__PURE__ */
|
|
37
|
+
cell: ({ getValue: e }) => /* @__PURE__ */ d("p", { children: e() }),
|
|
37
38
|
enableSorting: !1,
|
|
38
39
|
enableColumnFilter: !1
|
|
39
40
|
}),
|
|
40
41
|
i.accessor("task.instructions", {
|
|
41
|
-
header: (e) => /* @__PURE__ */
|
|
42
|
+
header: (e) => /* @__PURE__ */ d(n, {
|
|
42
43
|
...e,
|
|
43
44
|
title: "Instructions"
|
|
44
45
|
}),
|
|
45
|
-
cell: ({ getValue: e }) => /* @__PURE__ */
|
|
46
|
+
cell: ({ getValue: e }) => /* @__PURE__ */ d("p", { children: e() }),
|
|
46
47
|
enableSorting: !1,
|
|
47
48
|
enableColumnFilter: !1
|
|
48
49
|
}),
|
|
49
50
|
i.accessor("task.assigneePrincipalId", {
|
|
50
|
-
header: (e) => /* @__PURE__ */
|
|
51
|
+
header: (e) => /* @__PURE__ */ d(n, {
|
|
51
52
|
...e,
|
|
52
53
|
title: "Assignee"
|
|
53
54
|
}),
|
|
54
|
-
cell: ({ row: t }) => /* @__PURE__ */
|
|
55
|
+
cell: ({ row: t }) => /* @__PURE__ */ d(c, {
|
|
55
56
|
taskBundle: t.original,
|
|
56
57
|
canEdit: e
|
|
57
58
|
}),
|
|
@@ -59,35 +60,35 @@ function h(e) {
|
|
|
59
60
|
enableColumnFilter: !1
|
|
60
61
|
}),
|
|
61
62
|
i.accessor("task.modifiedOn", {
|
|
62
|
-
header: (e) => /* @__PURE__ */
|
|
63
|
+
header: (e) => /* @__PURE__ */ d(n, {
|
|
63
64
|
...e,
|
|
64
65
|
title: "Modified On"
|
|
65
66
|
}),
|
|
66
|
-
cell: ({ getValue: e }) => t(
|
|
67
|
+
cell: ({ getValue: e }) => t(f(e())),
|
|
67
68
|
enableSorting: !1,
|
|
68
69
|
enableColumnFilter: !1
|
|
69
70
|
}),
|
|
70
71
|
i.display({
|
|
71
72
|
id: "actions",
|
|
72
|
-
header: (e) => /* @__PURE__ */
|
|
73
|
+
header: (e) => /* @__PURE__ */ d(n, {
|
|
73
74
|
...e,
|
|
74
75
|
title: "Actions"
|
|
75
76
|
}),
|
|
76
|
-
cell: ({ row: t }) => /* @__PURE__ */
|
|
77
|
+
cell: ({ row: t }) => /* @__PURE__ */ d(s, {
|
|
77
78
|
taskBundle: t.original,
|
|
78
79
|
canEdit: e
|
|
79
80
|
})
|
|
80
81
|
})
|
|
81
82
|
];
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
let { listCurationTaskRequest: n } = t, { data: r, hasNextPage: a, fetchNextPage: o, isLoading: s, isFetchingNextPage:
|
|
84
|
+
function _(t) {
|
|
85
|
+
let { listCurationTaskRequest: n } = t, { data: r, hasNextPage: a, fetchNextPage: o, isLoading: s, isFetchingNextPage: c } = i(n), { data: u, isLoading: d } = e(n.projectId, void 0, { includePermissions: !0 }, { enabled: !!n.projectId }), f = u?.permissions?.canEdit ?? !1;
|
|
85
86
|
return {
|
|
86
|
-
table:
|
|
87
|
-
data:
|
|
88
|
-
columns:
|
|
87
|
+
table: h({
|
|
88
|
+
data: l(() => r?.pages.flatMap((e) => e.bundlePage) ?? [], [r]),
|
|
89
|
+
columns: l(() => g(f), [f]),
|
|
89
90
|
getRowId: (e) => String(e.task.taskId),
|
|
90
|
-
getCoreRowModel:
|
|
91
|
+
getCoreRowModel: m(),
|
|
91
92
|
columnResizeMode: "onChange",
|
|
92
93
|
manualSorting: !1,
|
|
93
94
|
meta: { getWrapInExpandableTd: (e) => e.column.id === "instructions" }
|
|
@@ -95,10 +96,10 @@ function g(t) {
|
|
|
95
96
|
isLoading: s || d,
|
|
96
97
|
hasNextPage: a,
|
|
97
98
|
fetchNextPage: o,
|
|
98
|
-
isFetchingNextPage:
|
|
99
|
+
isFetchingNextPage: c
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
102
|
//#endregion
|
|
102
|
-
export {
|
|
103
|
+
export { _ as useMetadataTaskTable };
|
|
103
104
|
|
|
104
105
|
//# sourceMappingURL=useMetadataTaskTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMetadataTaskTable.js","names":[],"sources":["../../../../../src/features/entity/metadata-task/hooks/useMetadataTaskTable.tsx"],"sourcesContent":["import ColumnHeader from '@/components/TanStackTable/ColumnHeader'\nimport { getGridSourceIdForTask } from '@/features/entity/metadata-task/utils/getGridSourceIdForTask'\nimport { useGetCurationTasksInfinite } from '@/synapse-queries/curation/task/useCurationTask'\nimport { useGetEntityBundle } from '@/synapse-queries/index'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport { getLinkToEntityPage } from '@/utils/functions/getSynapseWebClientLink'\nimport { Link } from '@mui/material'\nimport {\n ListCurationTaskRequest,\n TaskBundle,\n} from '@sage-bionetworks/synapse-client'\nimport {\n createColumnHelper,\n getCoreRowModel,\n Table,\n useReactTable,\n} from '@tanstack/react-table'\nimport dayjs from 'dayjs'\nimport { useMemo } from 'react'\nimport MetadataTaskTableActionCell from '../components/MetadataTaskTableActionCell'\nimport MetadataTasksTableAssigneeCell from '../components/MetadataTasksTableAssigneeCell'\n\nfunction getColumns(canEdit: boolean) {\n const columnHelper = createColumnHelper<TaskBundle>()\n return [\n columnHelper.accessor('task.dataType', {\n header: props => <ColumnHeader {...props} title={'Task'} />,\n cell: ({ row, getValue }) => {\n const entityId = getGridSourceIdForTask(row.original.task
|
|
1
|
+
{"version":3,"file":"useMetadataTaskTable.js","names":[],"sources":["../../../../../src/features/entity/metadata-task/hooks/useMetadataTaskTable.tsx"],"sourcesContent":["import ColumnHeader from '@/components/TanStackTable/ColumnHeader'\nimport { getGridSourceIdForTask } from '@/features/entity/metadata-task/utils/getGridSourceIdForTask'\nimport { instanceOfGridSupportedTaskProperties } from '@/features/entity/metadata-task/utils/types'\nimport { useGetCurationTasksInfinite } from '@/synapse-queries/curation/task/useCurationTask'\nimport { useGetEntityBundle } from '@/synapse-queries/index'\nimport { formatDate } from '@/utils/functions/DateFormatter'\nimport { getLinkToEntityPage } from '@/utils/functions/getSynapseWebClientLink'\nimport { Link } from '@mui/material'\nimport {\n ListCurationTaskRequest,\n TaskBundle,\n} from '@sage-bionetworks/synapse-client'\nimport {\n createColumnHelper,\n getCoreRowModel,\n Table,\n useReactTable,\n} from '@tanstack/react-table'\nimport dayjs from 'dayjs'\nimport { useMemo } from 'react'\nimport MetadataTaskTableActionCell from '../components/MetadataTaskTableActionCell'\nimport MetadataTasksTableAssigneeCell from '../components/MetadataTasksTableAssigneeCell'\n\nfunction getColumns(canEdit: boolean) {\n const columnHelper = createColumnHelper<TaskBundle>()\n return [\n columnHelper.accessor('task.dataType', {\n header: props => <ColumnHeader {...props} title={'Task'} />,\n cell: ({ row, getValue }) => {\n if (\n instanceOfGridSupportedTaskProperties(\n row.original.task!.taskProperties!,\n )\n ) {\n const entityId = getGridSourceIdForTask(\n row.original.task!.taskProperties,\n )\n return <Link href={getLinkToEntityPage(entityId)}>{getValue()}</Link>\n }\n return <p>{getValue()}</p>\n },\n enableSorting: false,\n enableColumnFilter: false,\n }),\n columnHelper.accessor('task.taskId', {\n header: props => <ColumnHeader {...props} title={'Task ID'} />,\n cell: ({ getValue }) => <p>{getValue()}</p>,\n enableSorting: false,\n enableColumnFilter: false,\n }),\n columnHelper.accessor('task.instructions', {\n header: props => <ColumnHeader {...props} title={'Instructions'} />,\n cell: ({ getValue }) => <p>{getValue()}</p>,\n enableSorting: false,\n enableColumnFilter: false,\n }),\n columnHelper.accessor('task.assigneePrincipalId', {\n header: props => <ColumnHeader {...props} title={'Assignee'} />,\n cell: ({ row }) => (\n <MetadataTasksTableAssigneeCell\n taskBundle={row.original}\n canEdit={canEdit}\n />\n ),\n enableSorting: false,\n enableColumnFilter: false,\n }),\n columnHelper.accessor('task.modifiedOn', {\n header: props => <ColumnHeader {...props} title={'Modified On'} />,\n cell: ({ getValue }) => formatDate(dayjs(getValue())),\n enableSorting: false,\n enableColumnFilter: false,\n }),\n columnHelper.display({\n id: 'actions',\n header: props => <ColumnHeader {...props} title={'Actions'} />,\n cell: ({ row }) => (\n <MetadataTaskTableActionCell\n taskBundle={row.original}\n canEdit={canEdit}\n />\n ),\n }),\n ]\n}\n\ntype UseMetadataTaskTableOptions = {\n listCurationTaskRequest: ListCurationTaskRequest\n}\n\n/**\n * Provides a table instance and loading states for displaying metadata curation tasks associated with a project.\n */\nexport function useMetadataTaskTable(opts: UseMetadataTaskTableOptions) {\n const { listCurationTaskRequest } = opts\n\n const {\n data,\n hasNextPage,\n fetchNextPage,\n isLoading: isLoadingTasks,\n isFetchingNextPage,\n } = useGetCurationTasksInfinite(listCurationTaskRequest)\n\n const { data: projectBundle, isLoading: isLoadingProjectBundle } =\n useGetEntityBundle(\n listCurationTaskRequest.projectId,\n undefined,\n { includePermissions: true },\n {\n enabled: !!listCurationTaskRequest.projectId,\n },\n )\n\n const canEditTasks = projectBundle?.permissions?.canEdit ?? false\n\n const tasks = useMemo(\n () => data?.pages.flatMap(page => page.bundlePage!) ?? [],\n [data],\n )\n\n const columns = useMemo(() => getColumns(canEditTasks), [canEditTasks])\n\n const table: Table<TaskBundle> = useReactTable<TaskBundle>({\n data: tasks,\n columns,\n getRowId: row => String(row.task!.taskId!),\n getCoreRowModel: getCoreRowModel(),\n columnResizeMode: 'onChange',\n manualSorting: false,\n meta: {\n getWrapInExpandableTd: cell => cell.column.id === 'instructions',\n },\n })\n\n return {\n table,\n isLoading: isLoadingTasks || isLoadingProjectBundle,\n hasNextPage,\n fetchNextPage,\n isFetchingNextPage,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,SAAS,EAAW,GAAkB;CACpC,IAAM,IAAe,EAA+B;CACpD,OAAO;EACL,EAAa,SAAS,iBAAiB;GACrC,SAAQ,MAAS,kBAAC,GAAD;IAAc,GAAI;IAAO,OAAO;GAAS,CAAA;GAC1D,OAAO,EAAE,QAAK,kBAEV,EACE,EAAI,SAAS,KAAM,cACrB,IAKO,kBAAC,GAAD;IAAM,MAAM,EAHF,EACf,EAAI,SAAS,KAAM,cAEkB,CAAQ;cAAI,EAAS;GAAQ,CAAA,IAE/D,kBAAC,KAAD,EAAA,UAAI,EAAS,EAAK,CAAA;GAE3B,eAAe;GACf,oBAAoB;EACtB,CAAC;EACD,EAAa,SAAS,eAAe;GACnC,SAAQ,MAAS,kBAAC,GAAD;IAAc,GAAI;IAAO,OAAO;GAAY,CAAA;GAC7D,OAAO,EAAE,kBAAe,kBAAC,KAAD,EAAA,UAAI,EAAS,EAAK,CAAA;GAC1C,eAAe;GACf,oBAAoB;EACtB,CAAC;EACD,EAAa,SAAS,qBAAqB;GACzC,SAAQ,MAAS,kBAAC,GAAD;IAAc,GAAI;IAAO,OAAO;GAAiB,CAAA;GAClE,OAAO,EAAE,kBAAe,kBAAC,KAAD,EAAA,UAAI,EAAS,EAAK,CAAA;GAC1C,eAAe;GACf,oBAAoB;EACtB,CAAC;EACD,EAAa,SAAS,4BAA4B;GAChD,SAAQ,MAAS,kBAAC,GAAD;IAAc,GAAI;IAAO,OAAO;GAAa,CAAA;GAC9D,OAAO,EAAE,aACP,kBAAC,GAAD;IACE,YAAY,EAAI;IACP;GACV,CAAA;GAEH,eAAe;GACf,oBAAoB;EACtB,CAAC;EACD,EAAa,SAAS,mBAAmB;GACvC,SAAQ,MAAS,kBAAC,GAAD;IAAc,GAAI;IAAO,OAAO;GAAgB,CAAA;GACjE,OAAO,EAAE,kBAAe,EAAW,EAAM,EAAS,CAAC,CAAC;GACpD,eAAe;GACf,oBAAoB;EACtB,CAAC;EACD,EAAa,QAAQ;GACnB,IAAI;GACJ,SAAQ,MAAS,kBAAC,GAAD;IAAc,GAAI;IAAO,OAAO;GAAY,CAAA;GAC7D,OAAO,EAAE,aACP,kBAAC,GAAD;IACE,YAAY,EAAI;IACP;GACV,CAAA;EAEL,CAAC;CACH;AACF;AASA,SAAgB,EAAqB,GAAmC;CACtE,IAAM,EAAE,+BAA4B,GAE9B,EACJ,SACA,gBACA,kBACA,WAAW,GACX,0BACE,EAA4B,CAAuB,GAEjD,EAAE,MAAM,GAAe,WAAW,MACtC,EACE,EAAwB,WACxB,KAAA,GACA,EAAE,oBAAoB,GAAK,GAC3B,EACE,SAAS,CAAC,CAAC,EAAwB,UACrC,CACF,GAEI,IAAe,GAAe,aAAa,WAAW;CAqB5D,OAAO;EACL,OAb+B,EAA0B;GACzD,MARY,QACN,GAAM,MAAM,SAAQ,MAAQ,EAAK,UAAW,KAAK,CAAC,GACxD,CAAC,CAAI,CAMC;GACN,SAJc,QAAc,EAAW,CAAY,GAAG,CAAC,CAAY,CAInE;GACA,WAAU,MAAO,OAAO,EAAI,KAAM,MAAO;GACzC,iBAAiB,EAAgB;GACjC,kBAAkB;GAClB,eAAe;GACf,MAAM,EACJ,wBAAuB,MAAQ,EAAK,OAAO,OAAO,eACpD;EACF,CAGE;EACA,WAAW,KAAkB;EAC7B;EACA;EACA;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOpenCuratorButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/hooks/useOpenCuratorButton.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,UAAU,EACX,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"useOpenCuratorButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/hooks/useOpenCuratorButton.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,UAAU,EACX,MAAM,kCAAkC,CAAA;AAYzC,KAAK,kCAAkC,GAAG;IACxC,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAOD,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAClD,UAAU,EAAE,UAAU,GACrB,kCAAkC,CAkFpC"}
|