synapse-react-client 4.0.26 → 4.0.28
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/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/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/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/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/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +12 -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/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/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 +39 -49
- 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/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 +5 -5
- 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
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { CSRF_TOKEN_STORAGE_KEY as e, OAUTH2_PROVIDERS as t } from "../SynapseConstants.js";
|
|
2
2
|
import { BackendDestinationEnum as n } from "../functions/getEndpoint.js";
|
|
3
|
-
import { bindOAuthProviderToAccount as r, getRootURL as i,
|
|
3
|
+
import { bindOAuthProviderToAccount as r, getRootURL as i, oAuthIdentityRequest as a, oAuthRegisterAccountStep2 as o, oAuthSessionRequest as s, setAccessTokenCookie as c } from "../../synapse-client/SynapseClient.js";
|
|
4
4
|
import "../../synapse-client/index.js";
|
|
5
5
|
import "../functions/index.js";
|
|
6
|
-
import { useOneSageURL as
|
|
7
|
-
import { useEffect as
|
|
6
|
+
import { useOneSageURL as l } from "./useOneSageURL.js";
|
|
7
|
+
import { useEffect as u, useMemo as d, useState as f } from "react";
|
|
8
8
|
//#region src/utils/hooks/useDetectSSOCode.ts
|
|
9
|
-
function
|
|
9
|
+
function p(e) {
|
|
10
10
|
try {
|
|
11
11
|
return localStorage.getItem(e);
|
|
12
12
|
} catch (t) {
|
|
13
13
|
return console.warn(`Unable to read from localStorage: ${e}`, t), null;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function m(e) {
|
|
17
17
|
try {
|
|
18
18
|
localStorage.removeItem(e);
|
|
19
19
|
} catch (t) {
|
|
20
20
|
console.warn(`Unable to remove from localStorage: ${e}`, t);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function h(h = {
|
|
24
24
|
isInitializingSession: !0,
|
|
25
25
|
isAuthenticated: !1
|
|
26
26
|
}) {
|
|
27
|
-
let
|
|
28
|
-
if (!
|
|
29
|
-
let e =
|
|
27
|
+
let g = l("/register1"), { onSignInComplete: _, registerAccountUrl: v = g.toString(), onError: y, onTwoFactorAuthRequired: b, onTwoFactorAuthResetTokenPresent: x, isInitializingSession: S, isAuthenticated: C } = h, w = i(), { searchParams: T } = new URL(typeof window < "u" ? window.location.href : "http://localhost/"), E = T?.get("code"), D = T?.get("provider"), O = !!(T?.get("client_id") && T?.get("redirect_uri")), k = d(() => {
|
|
28
|
+
if (!O) {
|
|
29
|
+
let e = T?.get("state");
|
|
30
30
|
try {
|
|
31
31
|
return e ? JSON.parse(decodeURIComponent(e)) : null;
|
|
32
32
|
} catch (t) {
|
|
@@ -34,33 +34,43 @@ function m(m = {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
return null;
|
|
37
|
-
}, [
|
|
38
|
-
return
|
|
39
|
-
if (!
|
|
40
|
-
if (!
|
|
41
|
-
let t =
|
|
37
|
+
}, [O, T]), [A, j] = f(!!(E && D));
|
|
38
|
+
return u(() => {
|
|
39
|
+
if (!S && E && D) {
|
|
40
|
+
if (!O) {
|
|
41
|
+
let t = p(e), n = k?.csrfToken ?? null;
|
|
42
42
|
if (!(typeof n == "string" && typeof t == "string" && n === t)) {
|
|
43
|
-
|
|
43
|
+
m(e), console.error("Invalid or missing OAuth CSRF token detected. Aborting OAuth flow."), y && y("Invalid OAuth state. Please try signing in again."), j(!1);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
m(e);
|
|
47
47
|
}
|
|
48
|
-
let i = `${
|
|
49
|
-
if (t.ORCID ==
|
|
50
|
-
console.error("Error binding ORCiD to account: ", e),
|
|
51
|
-
}).finally(() =>
|
|
52
|
-
else if (t.
|
|
48
|
+
let i = `${w}?provider=${D}`;
|
|
49
|
+
if (t.ORCID == D && C) r(D, E, i, n.REPO_ENDPOINT).then(_).catch((e) => {
|
|
50
|
+
console.error("Error binding ORCiD to account: ", e), y && y(e.reason);
|
|
51
|
+
}).finally(() => j(!1));
|
|
52
|
+
else if (t.NIH_RESEARCHER_AUTH_SERVICE == D && C) a(D, String(E), i).then(_).catch((e) => {
|
|
53
|
+
console.error("Error binding NIH RAS identity to account: ", e), y && y(e.reason);
|
|
54
|
+
}).finally(() => j(!1));
|
|
55
|
+
else if (t.GOOGLE == D || t.ORCID == D || t.ARCUS == D || t.SAGE_BIONETWORKS == D || t.NIH_RESEARCHER_AUTH_SERVICE == D) {
|
|
53
56
|
let e = (e) => {
|
|
54
|
-
e && ("accessToken" in e ?
|
|
57
|
+
e && ("accessToken" in e ? c(e.accessToken).then(_) : (b && b(e), k && k.twoFaResetToken && x && x(e, k.twoFaResetToken)));
|
|
55
58
|
}, r = (e) => {
|
|
56
|
-
e.status === 404
|
|
59
|
+
if (e.status === 404) {
|
|
60
|
+
if (t.NIH_RESEARCHER_AUTH_SERVICE == D) {
|
|
61
|
+
console.error("No Synapse account is linked to this NIH RAS identity: ", e), y && y("No Synapse account is linked to this NIH RAS identity. Sign in to Synapse and link your NIH RAS identity from your account settings.");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
window.location.replace(v);
|
|
65
|
+
}
|
|
66
|
+
console.error("Error with account login: ", e), y && y(e.reason);
|
|
57
67
|
};
|
|
58
|
-
(t.GOOGLE ==
|
|
59
|
-
} else console.warn("Unknown SSO Provider: ",
|
|
68
|
+
(t.GOOGLE == D || t.ARCUS == D || t.SAGE_BIONETWORKS == D) && k?.registrationUsername ? o(k.registrationUsername, D, E, i, n.REPO_ENDPOINT).then(e).catch(r).finally(() => j(!1)) : s(D, E, i, n.REPO_ENDPOINT).then(e).catch(r).finally(() => j(!1));
|
|
69
|
+
} else console.warn("Unknown SSO Provider: ", D), j(!1);
|
|
60
70
|
}
|
|
61
|
-
}, [
|
|
71
|
+
}, [S]), { isLoading: A };
|
|
62
72
|
}
|
|
63
73
|
//#endregion
|
|
64
|
-
export {
|
|
74
|
+
export { h as default };
|
|
65
75
|
|
|
66
76
|
//# sourceMappingURL=useDetectSSOCode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDetectSSOCode.js","names":[],"sources":["../../../src/utils/hooks/useDetectSSOCode.ts"],"sourcesContent":["import {\n bindOAuthProviderToAccount,\n getRootURL,\n oAuthRegisterAccountStep2,\n oAuthSessionRequest,\n setAccessTokenCookie,\n} from '@/synapse-client'\nimport { OAuth2State } from '@/utils/types'\nimport { TwoFactorAuthErrorResponse } from '@sage-bionetworks/synapse-client/generated/models/TwoFactorAuthErrorResponse'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { LoginResponse } from '@sage-bionetworks/synapse-types'\nimport { useEffect, useMemo, useState } from 'react'\nimport { BackendDestinationEnum } from '../functions'\nimport { CSRF_TOKEN_STORAGE_KEY, OAUTH2_PROVIDERS } from '../SynapseConstants'\nimport { useOneSageURL } from './useOneSageURL'\n\nfunction safeLocalStorageGetItem(key: string): string | null {\n try {\n return localStorage.getItem(key)\n } catch (err) {\n console.warn(`Unable to read from localStorage: ${key}`, err)\n return null\n }\n}\n\nfunction safeLocalStorageRemoveItem(key: string): void {\n try {\n localStorage.removeItem(key)\n } catch (err) {\n console.warn(`Unable to remove from localStorage: ${key}`, err)\n }\n}\n\nexport type UseDetectSSOCodeReturnType = {\n /* true iff SSO login has occurred and the completion of the OAuth flow in Synapse is pending */\n isLoading: boolean\n}\n\nexport type UseDetectSSOCodeOptions = {\n onSignInComplete?: () => void\n registerAccountUrl?: string\n onError?: (err: unknown) => void\n onTwoFactorAuthRequired?: (resp: TwoFactorAuthErrorResponse) => void\n onTwoFactorAuthResetTokenPresent?: (\n resp: TwoFactorAuthErrorResponse,\n encodedTwoFaResetToken: string,\n ) => void\n isInitializingSession: boolean\n isAuthenticated: boolean\n}\n\n/*\n * During SSO login, the authorization provider (Google, ORCiD, ArcusBio Okta, ...) will send the user back to the portal with an authorization code,\n * which can be exchanged for a Synapse user session. This function should be called whenever the root App is initialized\n * (to look for this code parameter and complete the round-trip). If state is included, then we assume that this is being\n * used for account creation, where we pass the username through the process.\n */\nexport default function useDetectSSOCode(\n opts: UseDetectSSOCodeOptions = {\n isInitializingSession: true,\n isAuthenticated: false,\n },\n): UseDetectSSOCodeReturnType {\n const defaultRegisterAccountURL = useOneSageURL('/register1')\n\n const {\n onSignInComplete,\n registerAccountUrl = defaultRegisterAccountURL.toString(),\n onError,\n onTwoFactorAuthRequired,\n onTwoFactorAuthResetTokenPresent,\n isInitializingSession,\n isAuthenticated,\n } = opts\n const redirectURL = getRootURL()\n // 'code' handling (from SSO) should be preformed on the root page, and then redirect to original route.\n // Use 'http://localhost/' as a placeholder during SSR (no browser URL available).\n // Since there is no 'code' or 'provider' in this placeholder URL, the rest of the hook is a no-op.\n const fullUrl: URL = new URL(\n typeof window !== 'undefined' ? window.location.href : 'http://localhost/',\n )\n // in test environment the searchParams isn't defined\n const { searchParams } = fullUrl\n const code = searchParams?.get('code')\n const provider = searchParams?.get('provider')\n\n // If the URL contains a client_id and redirect_uri, then we are acting as an identity provider for an external OAuth client\n const isHandlingSynapseOAuthSignIn = Boolean(\n searchParams?.get('client_id') && searchParams?.get('redirect_uri'),\n )\n\n // If the Synapse user signed in with an external IdP, we may have passed data in the 'state' param\n // Parse it (if appropriate)\n const state: OAuth2State | null = useMemo(() => {\n // If we are acting as an OIDC identity provider, then we should not parse the state param -- it was sent to us, and we should return it untouched\n if (!isHandlingSynapseOAuthSignIn) {\n const encodedState = searchParams?.get('state')\n try {\n return encodedState\n ? (JSON.parse(decodeURIComponent(encodedState)) as OAuth2State)\n : null\n } catch (e) {\n console.error(\n 'Error parsing state param:\\n',\n e,\n '\\nEncoded value:\\n',\n encodedState,\n )\n }\n }\n return null\n }, [isHandlingSynapseOAuthSignIn, searchParams])\n\n const [isLoading, setIsLoading] = useState(!!(code && provider))\n\n useEffect(() => {\n if (!isInitializingSession) {\n if (code && provider) {\n if (!isHandlingSynapseOAuthSignIn) {\n const storedCsrfToken = safeLocalStorageGetItem(\n CSRF_TOKEN_STORAGE_KEY,\n )\n\n const expectedCsrfToken = state?.csrfToken ?? null\n const tokensMatch =\n typeof expectedCsrfToken === 'string' &&\n typeof storedCsrfToken === 'string' &&\n expectedCsrfToken === storedCsrfToken\n\n if (!tokensMatch) {\n safeLocalStorageRemoveItem(CSRF_TOKEN_STORAGE_KEY)\n console.error(\n 'Invalid or missing OAuth CSRF token detected. Aborting OAuth flow.',\n )\n if (onError) {\n onError('Invalid OAuth state. Please try signing in again.')\n }\n setIsLoading(false)\n return\n }\n\n safeLocalStorageRemoveItem(CSRF_TOKEN_STORAGE_KEY)\n }\n\n const redirectUrl = `${redirectURL}?provider=${provider}`\n\n //If user is already logged in, and the provider is ORCID, then try to bind this OAuth provider to the account.\n if (OAUTH2_PROVIDERS.ORCID == provider && isAuthenticated) {\n // now bind this to the user account\n const onFailure = (err: SynapseClientError) => {\n console.error('Error binding ORCiD to account: ', err)\n if (onError) {\n onError(err.reason)\n }\n }\n bindOAuthProviderToAccount(\n provider,\n code,\n redirectUrl,\n BackendDestinationEnum.REPO_ENDPOINT,\n )\n .then(onSignInComplete)\n .catch(onFailure)\n .finally(() => setIsLoading(false))\n } else if (\n OAUTH2_PROVIDERS.GOOGLE == provider ||\n OAUTH2_PROVIDERS.ORCID == provider ||\n OAUTH2_PROVIDERS.ARCUS == provider ||\n OAUTH2_PROVIDERS.SAGE_BIONETWORKS == provider\n ) {\n const onSuccess = (\n response: LoginResponse | TwoFactorAuthErrorResponse | null,\n ) => {\n if (response) {\n if ('accessToken' in response) {\n setAccessTokenCookie(response.accessToken).then(\n onSignInComplete,\n )\n } else {\n // The app will redirect or open a modal to handle a standard 2FA sign in\n if (onTwoFactorAuthRequired) {\n onTwoFactorAuthRequired(response)\n }\n if (\n // The user logged in with OAuth while attempting to disable 2FA using an emailed signed token\n state &&\n state.twoFaResetToken &&\n onTwoFactorAuthResetTokenPresent\n ) {\n // Let the app handle redirecting to the 2FA reset page\n onTwoFactorAuthResetTokenPresent(\n response,\n state.twoFaResetToken,\n )\n }\n }\n }\n }\n const onFailure = (err: SynapseClientError) => {\n if (err.status === 404) {\n // Synapse account not found, send to registration page\n window.location.replace(registerAccountUrl)\n }\n console.error('Error with account login: ', err)\n if (onError) {\n onError(err.reason)\n }\n }\n\n if (\n (OAUTH2_PROVIDERS.GOOGLE == provider ||\n OAUTH2_PROVIDERS.ARCUS == provider ||\n OAUTH2_PROVIDERS.SAGE_BIONETWORKS == provider) &&\n state?.registrationUsername\n ) {\n oAuthRegisterAccountStep2(\n state.registrationUsername,\n provider,\n code,\n redirectUrl,\n BackendDestinationEnum.REPO_ENDPOINT,\n )\n .then(onSuccess)\n .catch(onFailure)\n .finally(() => setIsLoading(false))\n } else {\n oAuthSessionRequest(\n provider,\n code,\n redirectUrl,\n BackendDestinationEnum.REPO_ENDPOINT,\n )\n .then(onSuccess)\n .catch(onFailure)\n .finally(() => setIsLoading(false))\n }\n } else {\n console.warn('Unknown SSO Provider: ', provider)\n setIsLoading(false)\n }\n }\n }\n // Intentionally only monitoring initialization of the session -- only running on mount after the session detection has completed since this uses URL params that come from a redirect\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [isInitializingSession])\n\n return { isLoading }\n}\n"],"mappings":";;;;;;;;AAgBA,SAAS,EAAwB,GAA4B;CAC3D,IAAI;EACF,OAAO,aAAa,QAAQ,CAAG;CACjC,SAAS,GAAK;EAEZ,OADA,QAAQ,KAAK,qCAAqC,KAAO,CAAG,GACrD;CACT;AACF;AAEA,SAAS,EAA2B,GAAmB;CACrD,IAAI;EACF,aAAa,WAAW,CAAG;CAC7B,SAAS,GAAK;EACZ,QAAQ,KAAK,uCAAuC,KAAO,CAAG;CAChE;AACF;AA0BA,SAAwB,EACtB,IAAgC;CAC9B,uBAAuB;CACvB,iBAAiB;AACnB,GAC4B;CAC5B,IAAM,IAA4B,EAAc,YAAY,GAEtD,EACJ,qBACA,wBAAqB,EAA0B,SAAS,GACxD,YACA,4BACA,qCACA,0BACA,uBACE,GACE,IAAc,EAAW,GAQzB,EAAE,oBAAiB,IAJA,IACvB,OAAO,SAAW,MAAc,OAAO,SAAS,OAAO,mBAGhC,GACnB,IAAO,GAAc,IAAI,MAAM,GAC/B,IAAW,GAAc,IAAI,UAAU,GAGvC,IAA+B,GACnC,GAAc,IAAI,WAAW,KAAK,GAAc,IAAI,cAAc,IAK9D,IAA4B,QAAc;EAE9C,IAAI,CAAC,GAA8B;GACjC,IAAM,IAAe,GAAc,IAAI,OAAO;GAC9C,IAAI;IACF,OAAO,IACF,KAAK,MAAM,mBAAmB,CAAY,CAAC,IAC5C;GACN,SAAS,GAAG;IACV,QAAQ,MACN,gCACA,GACA,sBACA,CACF;GACF;EACF;EACA,OAAO;CACT,GAAG,CAAC,GAA8B,CAAY,CAAC,GAEzC,CAAC,GAAW,KAAgB,EAAS,CAAC,EAAE,KAAQ,EAAS;CAqI/D,OAnIA,Q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zB,EACG,KAAK,CAAS,EACd,MAAM,CAAS,EACf,cAAc,EAAa,EAAK,CAAC;GAExC,OAEE,AADA,QAAQ,KAAK,0BAA0B,CAAQ,GAC/C,EAAa,EAAK;EAEtB;CAIJ,GAAG,CAAC,CAAqB,CAAC,GAEnB,EAAE,aAAU;AACrB"}
|
|
1
|
+
{"version":3,"file":"useDetectSSOCode.js","names":[],"sources":["../../../src/utils/hooks/useDetectSSOCode.ts"],"sourcesContent":["import {\n bindOAuthProviderToAccount,\n getRootURL,\n oAuthIdentityRequest,\n oAuthRegisterAccountStep2,\n oAuthSessionRequest,\n setAccessTokenCookie,\n} from '@/synapse-client'\nimport { OAuth2State } from '@/utils/types'\nimport { OAuthValidationRequestProviderEnum } from '@sage-bionetworks/synapse-client'\nimport { TwoFactorAuthErrorResponse } from '@sage-bionetworks/synapse-client/generated/models/TwoFactorAuthErrorResponse'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { LoginResponse } from '@sage-bionetworks/synapse-types'\nimport { useEffect, useMemo, useState } from 'react'\nimport { BackendDestinationEnum } from '../functions'\nimport { CSRF_TOKEN_STORAGE_KEY, OAUTH2_PROVIDERS } from '../SynapseConstants'\nimport { useOneSageURL } from './useOneSageURL'\n\nfunction safeLocalStorageGetItem(key: string): string | null {\n try {\n return localStorage.getItem(key)\n } catch (err) {\n console.warn(`Unable to read from localStorage: ${key}`, err)\n return null\n }\n}\n\nfunction safeLocalStorageRemoveItem(key: string): void {\n try {\n localStorage.removeItem(key)\n } catch (err) {\n console.warn(`Unable to remove from localStorage: ${key}`, err)\n }\n}\n\nexport type UseDetectSSOCodeReturnType = {\n /* true iff SSO login has occurred and the completion of the OAuth flow in Synapse is pending */\n isLoading: boolean\n}\n\nexport type UseDetectSSOCodeOptions = {\n onSignInComplete?: () => void\n registerAccountUrl?: string\n onError?: (err: unknown) => void\n onTwoFactorAuthRequired?: (resp: TwoFactorAuthErrorResponse) => void\n onTwoFactorAuthResetTokenPresent?: (\n resp: TwoFactorAuthErrorResponse,\n encodedTwoFaResetToken: string,\n ) => void\n isInitializingSession: boolean\n isAuthenticated: boolean\n}\n\n/*\n * During SSO login, the authorization provider (Google, ORCiD, ArcusBio Okta, ...) will send the user back to the portal with an authorization code,\n * which can be exchanged for a Synapse user session. This function should be called whenever the root App is initialized\n * (to look for this code parameter and complete the round-trip). If state is included, then we assume that this is being\n * used for account creation, where we pass the username through the process.\n */\nexport default function useDetectSSOCode(\n opts: UseDetectSSOCodeOptions = {\n isInitializingSession: true,\n isAuthenticated: false,\n },\n): UseDetectSSOCodeReturnType {\n const defaultRegisterAccountURL = useOneSageURL('/register1')\n\n const {\n onSignInComplete,\n registerAccountUrl = defaultRegisterAccountURL.toString(),\n onError,\n onTwoFactorAuthRequired,\n onTwoFactorAuthResetTokenPresent,\n isInitializingSession,\n isAuthenticated,\n } = opts\n const redirectURL = getRootURL()\n // 'code' handling (from SSO) should be preformed on the root page, and then redirect to original route.\n // Use 'http://localhost/' as a placeholder during SSR (no browser URL available).\n // Since there is no 'code' or 'provider' in this placeholder URL, the rest of the hook is a no-op.\n const fullUrl: URL = new URL(\n typeof window !== 'undefined' ? window.location.href : 'http://localhost/',\n )\n // in test environment the searchParams isn't defined\n const { searchParams } = fullUrl\n const code = searchParams?.get('code')\n const provider = searchParams?.get('provider')\n\n // If the URL contains a client_id and redirect_uri, then we are acting as an identity provider for an external OAuth client\n const isHandlingSynapseOAuthSignIn = Boolean(\n searchParams?.get('client_id') && searchParams?.get('redirect_uri'),\n )\n\n // If the Synapse user signed in with an external IdP, we may have passed data in the 'state' param\n // Parse it (if appropriate)\n const state: OAuth2State | null = useMemo(() => {\n // If we are acting as an OIDC identity provider, then we should not parse the state param -- it was sent to us, and we should return it untouched\n if (!isHandlingSynapseOAuthSignIn) {\n const encodedState = searchParams?.get('state')\n try {\n return encodedState\n ? (JSON.parse(decodeURIComponent(encodedState)) as OAuth2State)\n : null\n } catch (e) {\n console.error(\n 'Error parsing state param:\\n',\n e,\n '\\nEncoded value:\\n',\n encodedState,\n )\n }\n }\n return null\n }, [isHandlingSynapseOAuthSignIn, searchParams])\n\n const [isLoading, setIsLoading] = useState(!!(code && provider))\n\n useEffect(() => {\n if (!isInitializingSession) {\n if (code && provider) {\n if (!isHandlingSynapseOAuthSignIn) {\n const storedCsrfToken = safeLocalStorageGetItem(\n CSRF_TOKEN_STORAGE_KEY,\n )\n\n const expectedCsrfToken = state?.csrfToken ?? null\n const tokensMatch =\n typeof expectedCsrfToken === 'string' &&\n typeof storedCsrfToken === 'string' &&\n expectedCsrfToken === storedCsrfToken\n\n if (!tokensMatch) {\n safeLocalStorageRemoveItem(CSRF_TOKEN_STORAGE_KEY)\n console.error(\n 'Invalid or missing OAuth CSRF token detected. Aborting OAuth flow.',\n )\n if (onError) {\n onError('Invalid OAuth state. Please try signing in again.')\n }\n setIsLoading(false)\n return\n }\n\n safeLocalStorageRemoveItem(CSRF_TOKEN_STORAGE_KEY)\n }\n\n const redirectUrl = `${redirectURL}?provider=${provider}`\n\n //If user is already logged in, and the provider is ORCID, then try to bind this OAuth provider to the account.\n if (OAUTH2_PROVIDERS.ORCID == provider && isAuthenticated) {\n // now bind this to the user account\n const onFailure = (err: SynapseClientError) => {\n console.error('Error binding ORCiD to account: ', err)\n if (onError) {\n onError(err.reason)\n }\n }\n bindOAuthProviderToAccount(\n provider,\n code,\n redirectUrl,\n BackendDestinationEnum.REPO_ENDPOINT,\n )\n .then(onSignInComplete)\n .catch(onFailure)\n .finally(() => setIsLoading(false))\n } else if (\n OAUTH2_PROVIDERS.NIH_RESEARCHER_AUTH_SERVICE == provider &&\n isAuthenticated\n ) {\n // RAS does not provide an alias, so bind via the identity endpoint\n const onFailure = (err: SynapseClientError) => {\n console.error('Error binding NIH RAS identity to account: ', err)\n if (onError) {\n onError(err.reason)\n }\n }\n oAuthIdentityRequest(\n provider as OAuthValidationRequestProviderEnum,\n String(code),\n redirectUrl,\n )\n .then(onSignInComplete)\n .catch(onFailure)\n .finally(() => setIsLoading(false))\n } else if (\n OAUTH2_PROVIDERS.GOOGLE == provider ||\n OAUTH2_PROVIDERS.ORCID == provider ||\n OAUTH2_PROVIDERS.ARCUS == provider ||\n OAUTH2_PROVIDERS.SAGE_BIONETWORKS == provider ||\n OAUTH2_PROVIDERS.NIH_RESEARCHER_AUTH_SERVICE == provider\n ) {\n const onSuccess = (\n response: LoginResponse | TwoFactorAuthErrorResponse | null,\n ) => {\n if (response) {\n if ('accessToken' in response) {\n setAccessTokenCookie(response.accessToken).then(\n onSignInComplete,\n )\n } else {\n // The app will redirect or open a modal to handle a standard 2FA sign in\n if (onTwoFactorAuthRequired) {\n onTwoFactorAuthRequired(response)\n }\n if (\n // The user logged in with OAuth while attempting to disable 2FA using an emailed signed token\n state &&\n state.twoFaResetToken &&\n onTwoFactorAuthResetTokenPresent\n ) {\n // Let the app handle redirecting to the 2FA reset page\n onTwoFactorAuthResetTokenPresent(\n response,\n state.twoFaResetToken,\n )\n }\n }\n }\n }\n const onFailure = (err: SynapseClientError) => {\n if (err.status === 404) {\n if (OAUTH2_PROVIDERS.NIH_RESEARCHER_AUTH_SERVICE == provider) {\n // RAS cannot create a Synapse account (no alias). Surface an\n // explicit error instead of redirecting to registration.\n console.error(\n 'No Synapse account is linked to this NIH RAS identity: ',\n err,\n )\n if (onError) {\n onError(\n 'No Synapse account is linked to this NIH RAS identity. Sign in to Synapse and link your NIH RAS identity from your account settings.',\n )\n }\n return\n }\n // Synapse account not found, send to registration page\n window.location.replace(registerAccountUrl)\n }\n console.error('Error with account login: ', err)\n if (onError) {\n onError(err.reason)\n }\n }\n\n if (\n (OAUTH2_PROVIDERS.GOOGLE == provider ||\n OAUTH2_PROVIDERS.ARCUS == provider ||\n OAUTH2_PROVIDERS.SAGE_BIONETWORKS == provider) &&\n state?.registrationUsername\n ) {\n oAuthRegisterAccountStep2(\n state.registrationUsername,\n provider,\n code,\n redirectUrl,\n BackendDestinationEnum.REPO_ENDPOINT,\n )\n .then(onSuccess)\n .catch(onFailure)\n .finally(() => setIsLoading(false))\n } else {\n oAuthSessionRequest(\n provider,\n code,\n redirectUrl,\n BackendDestinationEnum.REPO_ENDPOINT,\n )\n .then(onSuccess)\n .catch(onFailure)\n .finally(() => setIsLoading(false))\n }\n } else {\n console.warn('Unknown SSO Provider: ', provider)\n setIsLoading(false)\n }\n }\n }\n // Intentionally only monitoring initialization of the session -- only running on mount after the session detection has completed since this uses URL params that come from a redirect\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [isInitializingSession])\n\n return { isLoading }\n}\n"],"mappings":";;;;;;;;AAkBA,SAAS,EAAwB,GAA4B;CAC3D,IAAI;EACF,OAAO,aAAa,QAAQ,CAAG;CACjC,SAAS,GAAK;EAEZ,OADA,QAAQ,KAAK,qCAAqC,KAAO,CAAG,GACrD;CACT;AACF;AAEA,SAAS,EAA2B,GAAmB;CACrD,IAAI;EACF,aAAa,WAAW,CAAG;CAC7B,SAAS,GAAK;EACZ,QAAQ,KAAK,uCAAuC,KAAO,CAAG;CAChE;AACF;AA0BA,SAAwB,EACtB,IAAgC;CAC9B,uBAAuB;CACvB,iBAAiB;AACnB,GAC4B;CAC5B,IAAM,IAA4B,EAAc,YAAY,GAEtD,EACJ,qBACA,wBAAqB,EAA0B,SAAS,GACxD,YACA,4BACA,qCACA,0BACA,uBACE,GACE,IAAc,EAAW,GAQzB,EAAE,oBAAiB,IAJA,IACvB,OAAO,SAAW,MAAc,OAAO,SAAS,OAAO,mBAGhC,GACnB,IAAO,GAAc,IAAI,MAAM,GAC/B,IAAW,GAAc,IAAI,UAAU,GAGvC,IAA+B,GACnC,GAAc,IAAI,WAAW,KAAK,GAAc,IAAI,cAAc,IAK9D,IAA4B,QAAc;EAE9C,IAAI,CAAC,GAA8B;GACjC,IAAM,IAAe,GAAc,IAAI,OAAO;GAC9C,IAAI;IACF,OAAO,IACF,KAAK,MAAM,mBAAmB,CAAY,CAAC,IAC5C;GACN,SAAS,GAAG;IACV,QAAQ,MACN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,EAAM,eACR;IAIR,GACM,KAAa,MAA4B;KAC7C,IAAI,EAAI,WAAW,KAAK;MACtB,IAAI,EAAiB,+BAA+B,GAAU;OAO5D,AAJA,QAAQ,MACN,2DACA,CACF,GACI,KACF,EACE,sIACF;OAEF;MACF;MAEA,OAAO,SAAS,QAAQ,CAAkB;KAC5C;KAEA,AADA,QAAQ,MAAM,8BAA8B,CAAG,GAC3C,KACF,EAAQ,EAAI,MAAM;IAEtB;IAEA,CACG,EAAiB,UAAU,KAC1B,EAAiB,SAAS,KAC1B,EAAiB,oBAAoB,MACvC,GAAO,uBAEP,EACE,EAAM,sBACN,GACA,GACA,GACA,EAAuB,aACzB,EACG,KAAK,CAAS,EACd,MAAM,CAAS,EACf,cAAc,EAAa,EAAK,CAAC,IAEpC,EACE,GACA,GACA,GACA,EAAuB,aACzB,EACG,KAAK,CAAS,EACd,MAAM,CAAS,EACf,cAAc,EAAa,EAAK,CAAC;GAExC,OAEE,AADA,QAAQ,KAAK,0BAA0B,CAAQ,GAC/C,EAAa,EAAK;EAEtB;CAIJ,GAAG,CAAC,CAAqB,CAAC,GAEnB,EAAE,aAAU;AACrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "synapse-react-client",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.28",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"dagre": "^0.8.5",
|
|
65
65
|
"dayjs": "^1.11.21",
|
|
66
66
|
"html-react-parser": "^6.1.3",
|
|
67
|
-
"immutable": "4.3.
|
|
67
|
+
"immutable": "4.3.9",
|
|
68
68
|
"isomorphic-dompurify": "^3.16.0",
|
|
69
69
|
"jotai": "^2.20.0",
|
|
70
70
|
"js-cookie": "^3.0.8",
|
|
@@ -119,11 +119,11 @@
|
|
|
119
119
|
"use-deep-compare-effect": "^1.8.1",
|
|
120
120
|
"xss": "^1.0.15",
|
|
121
121
|
"zod": "^4.4.3",
|
|
122
|
-
"
|
|
123
|
-
"@sage-bionetworks/synapse-client": "0.0.18",
|
|
122
|
+
"markdown-it-synapse": "2.0.0",
|
|
124
123
|
"@sage-bionetworks/synapse-types": "0.0.7",
|
|
125
124
|
"markdown-it-synapse-table": "1.0.8",
|
|
126
|
-
"
|
|
125
|
+
"@sage-bionetworks/synapse-client": "0.0.20",
|
|
126
|
+
"@sage-bionetworks/markdown-it-container": "4.0.1"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
129
|
"@sage-bionetworks/aridhia-client": "*",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { EntityType } from '@sage-bionetworks/synapse-client';
|
|
2
|
-
export type MergeGridWithSourceTableButtonProps = {
|
|
3
|
-
sourceEntityId: string;
|
|
4
|
-
gridSessionId: string;
|
|
5
|
-
sourceEntityType?: EntityType;
|
|
6
|
-
};
|
|
7
|
-
export default function MergeGridWithSourceTableButton(props: MergeGridWithSourceTableButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
//# sourceMappingURL=MergeGridWithSourceTableButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MergeGridWithSourceTableButton.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/MergeGridWithSourceTableButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EACL,UAAU,EAMX,MAAM,kCAAkC,CAAA;AAEzC,MAAM,MAAM,mCAAmC,GAAG;IAChD,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,CAAC,EAAE,UAAU,CAAA;CAC9B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,8BAA8B,CACpD,KAAK,EAAE,mCAAmC,2CAuC3C"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { displayToast as e } from "../ToastMessage/ToastMessage.js";
|
|
2
|
-
import { convertToEntityType as t } from "../../utils/functions/EntityTypeUtils.js";
|
|
3
|
-
import { useGetEntity as n } from "../../synapse-queries/entity/useEntity.js";
|
|
4
|
-
import "../../synapse-queries/index.js";
|
|
5
|
-
import "../index.js";
|
|
6
|
-
import r from "./components/GridMenuButton/GridMenuButton.js";
|
|
7
|
-
import i from "./useMergeGridWithSource.js";
|
|
8
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
9
|
-
import { instanceOfEntityUpdateResults as o, instanceOfUploadToTableResult as s } from "@sage-bionetworks/synapse-client";
|
|
10
|
-
import { c } from "react/compiler-runtime";
|
|
11
|
-
//#region src/components/DataGrid/MergeGridWithSourceTableButton.tsx
|
|
12
|
-
function l(e) {
|
|
13
|
-
let o = c(13), { sourceEntityId: s, gridSessionId: l } = e, { data: f, isLoading: p } = n(s), m;
|
|
14
|
-
o[0] === f ? m = o[1] : (m = f?.concreteType ? t(f.concreteType) : void 0, o[0] = f, o[1] = m);
|
|
15
|
-
let h = m, g;
|
|
16
|
-
o[2] === Symbol.for("react.memo_cache_sentinel") ? (g = {
|
|
17
|
-
onSuccess: d,
|
|
18
|
-
onError: u
|
|
19
|
-
}, o[2] = g) : g = o[2];
|
|
20
|
-
let { mutate: _, isPending: v } = i(g), y = h === "entityview" ? "Sync changes" : "Apply changes", b;
|
|
21
|
-
o[3] !== l || o[4] !== _ || o[5] !== s || o[6] !== h ? (b = () => {
|
|
22
|
-
_({
|
|
23
|
-
gridSessionId: l,
|
|
24
|
-
sourceEntityId: s,
|
|
25
|
-
sourceEntityType: h
|
|
26
|
-
});
|
|
27
|
-
}, o[3] = l, o[4] = _, o[5] = s, o[6] = h, o[7] = b) : b = o[7];
|
|
28
|
-
let x;
|
|
29
|
-
return o[8] !== y || o[9] !== p || o[10] !== v || o[11] !== b ? (x = /* @__PURE__ */ a(r, {
|
|
30
|
-
loading: v,
|
|
31
|
-
disabled: p,
|
|
32
|
-
onClick: b,
|
|
33
|
-
variant: "contained",
|
|
34
|
-
children: y
|
|
35
|
-
}), o[8] = y, o[9] = p, o[10] = v, o[11] = b, o[12] = x) : x = o[12], x;
|
|
36
|
-
}
|
|
37
|
-
function u(t) {
|
|
38
|
-
return e(t.message, "danger");
|
|
39
|
-
}
|
|
40
|
-
function d(t) {
|
|
41
|
-
t.type === "entityview" ? f(t.data) : t.type === "table" ? p(t.data) : e("Successfully updated RecordSet.", "success");
|
|
42
|
-
}
|
|
43
|
-
function f(t) {
|
|
44
|
-
t.errorMessages == null || t.errorMessages.length === 0 ? e("Successfully synchronized metadata.", "success") : e(/* @__PURE__ */ a("ul", { children: t.errorMessages.map((e, t) => /* @__PURE__ */ a("li", { children: e }, t)) }), "warning", { title: "Some changes could not be applied" });
|
|
45
|
-
}
|
|
46
|
-
function p(t) {
|
|
47
|
-
if (t.results?.length) {
|
|
48
|
-
let n = t.results[0];
|
|
49
|
-
if (o(n)) {
|
|
50
|
-
let t = m(n).join("\n");
|
|
51
|
-
t ? e(`Some changes could not be applied:\n${t}`, "danger") : e("Changes applied successfully", "success");
|
|
52
|
-
} else if (s(n)) {
|
|
53
|
-
let t = n.rowsProcessed?.toLocaleString();
|
|
54
|
-
e(`Successfully updated ${t} rows.`, "success");
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function m(e) {
|
|
59
|
-
return e.updateResults?.filter((e) => !!e.failureCode).map((e) => `${e.entityId}: ${e.failureMessage} (code: ${e.failureCode})`) ?? [];
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
62
|
-
export { l as default };
|
|
63
|
-
|
|
64
|
-
//# sourceMappingURL=MergeGridWithSourceTableButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MergeGridWithSourceTableButton.js","names":["GridMenuButton","useMergeGridWithSource","displayToast","useGetEntity","convertToEntityType","EntityType","EntityUpdateResults","instanceOfEntityUpdateResults","instanceOfUploadToTableResult","SynchronizeGridResponse","TableUpdateTransactionResponse","MergeGridWithSourceTableButtonProps","sourceEntityId","gridSessionId","sourceEntityType","MergeGridWithSourceTableButton","props","$","_c","data","entity","isLoading","entityLoading","t0","concreteType","undefined","t1","Symbol","for","onSuccess","_temp","onError","_temp2","mutate","mergeGrid","isPending","buttonText","t2","t3","e","message","result","type","onSynchronizeSuccess","onMergeTableSuccess","errorMessages","length","map","msg","index","title","results","updateResult","failureMessages","getEntityUpdateResultsErrorMessages","join","rowsUpdatedStr","rowsProcessed","toLocaleString","updateResults","filter","failureCode","r","entityId","failureMessage"],"sources":["../../../src/components/DataGrid/MergeGridWithSourceTableButton.tsx"],"sourcesContent":["import GridMenuButton from '@/components/DataGrid/components/GridMenuButton/GridMenuButton'\nimport useMergeGridWithSource from '@/components/DataGrid/useMergeGridWithSource'\nimport { displayToast } from '@/components/index'\nimport { useGetEntity } from '@/synapse-queries'\nimport { convertToEntityType } from '@/utils/functions/EntityTypeUtils'\nimport {\n EntityType,\n EntityUpdateResults,\n instanceOfEntityUpdateResults,\n instanceOfUploadToTableResult,\n SynchronizeGridResponse,\n TableUpdateTransactionResponse,\n} from '@sage-bionetworks/synapse-client'\n\nexport type MergeGridWithSourceTableButtonProps = {\n sourceEntityId: string\n gridSessionId: string\n sourceEntityType?: EntityType\n}\n\nexport default function MergeGridWithSourceTableButton(\n props: MergeGridWithSourceTableButtonProps,\n) {\n const { sourceEntityId, gridSessionId } = props\n\n const { data: entity, isLoading: entityLoading } =\n useGetEntity(sourceEntityId)\n\n const sourceEntityType = entity?.concreteType\n ? convertToEntityType(entity.concreteType)\n : undefined\n\n const { mutate: mergeGrid, isPending } = useMergeGridWithSource({\n onSuccess: result => {\n if (result.type === 'entityview') {\n onSynchronizeSuccess(result.data)\n } else if (result.type === 'table') {\n onMergeTableSuccess(result.data)\n } else {\n displayToast('Successfully updated RecordSet.', 'success')\n }\n },\n onError: e => displayToast(e.message, 'danger'),\n })\n\n const buttonText =\n sourceEntityType === 'entityview' ? 'Sync changes' : 'Apply changes'\n\n return (\n <GridMenuButton\n loading={isPending}\n disabled={entityLoading}\n onClick={() => {\n mergeGrid({ gridSessionId, sourceEntityId, sourceEntityType })\n }}\n variant=\"contained\"\n >\n {buttonText}\n </GridMenuButton>\n )\n}\n\nfunction onSynchronizeSuccess(result: SynchronizeGridResponse) {\n if (result.errorMessages == null || result.errorMessages.length === 0) {\n displayToast('Successfully synchronized metadata.', 'success')\n } else {\n displayToast(\n <ul>\n {result.errorMessages.map((msg, index) => (\n <li key={index}>{msg}</li>\n ))}\n </ul>,\n 'warning',\n { title: 'Some changes could not be applied' },\n )\n }\n}\n\nfunction onMergeTableSuccess(result: TableUpdateTransactionResponse) {\n if (result.results?.length) {\n // There should only be one result since the CSV upload is done in one step\n const updateResult = result.results[0]\n if (instanceOfEntityUpdateResults(updateResult)) {\n // This is an update to the contents of a View\n const failureMessages =\n getEntityUpdateResultsErrorMessages(updateResult).join('\\n')\n\n if (failureMessages) {\n displayToast(\n `Some changes could not be applied:\\n${failureMessages}`,\n 'danger',\n )\n } else {\n displayToast('Changes applied successfully', 'success')\n }\n } else if (instanceOfUploadToTableResult(updateResult)) {\n // This is an update to a TableEntity\n const rowsUpdatedStr = updateResult.rowsProcessed?.toLocaleString()\n displayToast(`Successfully updated ${rowsUpdatedStr} rows.`, 'success')\n }\n }\n}\n\nfunction getEntityUpdateResultsErrorMessages(\n results: EntityUpdateResults,\n): string[] {\n return (\n results.updateResults\n ?.filter(e => !!e.failureCode)\n .map(\n r => `${r.entityId}: ${r.failureMessage} (code: ${r.failureCode})`,\n ) ?? []\n )\n}\n"],"mappings":";;;;;;;;;;;AAoBA,SAAee,EAAAC,GAAA;CAAA,IAAAC,IAAAC,EAAA,EAAA,GAGb,EAAAN,mBAAAC,qBAA0CG,GAE1C,EAAAG,MAAAC,GAAAC,WAAAC,MACEnB,EAAaS,CAAc,GAACW;CAAA,AAAAN,EAAA,OAAAG,IAIjBG,IAAAN,EAAA,MAFYM,IAAAH,GAAMI,eAC3BpB,EAAoBgB,E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