synapse-react-client 4.0.1 → 4.0.3
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.js +1 -1
- package/dist/assets/icons/AwardScroll.d.ts +5 -0
- package/dist/assets/icons/AwardScroll.d.ts.map +1 -0
- package/dist/assets/icons/AwardScroll.js +78 -0
- package/dist/assets/icons/AwardScroll.js.map +1 -0
- package/dist/assets/icons/Baseline.d.ts +5 -0
- package/dist/assets/icons/Baseline.d.ts.map +1 -0
- package/dist/assets/icons/Baseline.js +43 -0
- package/dist/assets/icons/Baseline.js.map +1 -0
- package/dist/assets/icons/Challenge.svg +13 -0
- package/dist/assets/icons/Challenge.svg.js +7 -0
- package/dist/assets/icons/Challenge.svg.js.map +1 -0
- package/dist/assets/icons/ClappingHands.d.ts +5 -0
- package/dist/assets/icons/ClappingHands.d.ts.map +1 -0
- package/dist/assets/icons/ClappingHands.js +106 -0
- package/dist/assets/icons/ClappingHands.js.map +1 -0
- package/dist/assets/icons/HandWithMoney.d.ts +5 -0
- package/dist/assets/icons/HandWithMoney.d.ts.map +1 -0
- package/dist/assets/icons/HandWithMoney.js +15 -0
- package/dist/assets/icons/HandWithMoney.js.map +1 -0
- package/dist/assets/icons/MultiFile.d.ts +5 -0
- package/dist/assets/icons/MultiFile.d.ts.map +1 -0
- package/dist/assets/icons/MultiFile.js +8 -0
- package/dist/assets/icons/MultiFile.js.map +1 -0
- package/dist/assets/icons/MultiFile.svg +4 -0
- package/dist/assets/icons/MultiFile.svg.js +7 -0
- package/dist/assets/icons/MultiFile.svg.js.map +1 -0
- package/dist/assets/icons/OpenBook.d.ts +5 -0
- package/dist/assets/icons/OpenBook.d.ts.map +1 -0
- package/dist/assets/icons/OpenBook.js +99 -0
- package/dist/assets/icons/OpenBook.js.map +1 -0
- package/dist/assets/icons/Podium.d.ts +5 -0
- package/dist/assets/icons/Podium.d.ts.map +1 -0
- package/dist/assets/icons/Podium.js +36 -0
- package/dist/assets/icons/Podium.js.map +1 -0
- package/dist/assets/icons/RosetteRibbon.d.ts +5 -0
- package/dist/assets/icons/RosetteRibbon.d.ts.map +1 -0
- package/dist/assets/icons/RosetteRibbon.js +36 -0
- package/dist/assets/icons/RosetteRibbon.js.map +1 -0
- package/dist/assets/icons/StarTrophy.d.ts +5 -0
- package/dist/assets/icons/StarTrophy.d.ts.map +1 -0
- package/dist/assets/icons/StarTrophy.js +99 -0
- package/dist/assets/icons/StarTrophy.js.map +1 -0
- package/dist/assets/icons/ThreeStars.d.ts +5 -0
- package/dist/assets/icons/ThreeStars.d.ts.map +1 -0
- package/dist/assets/icons/ThreeStars.js +71 -0
- package/dist/assets/icons/ThreeStars.js.map +1 -0
- package/dist/assets/icons/UnpackagableFile.d.ts +5 -0
- package/dist/assets/icons/UnpackagableFile.d.ts.map +1 -0
- package/dist/assets/icons/UnpackagableFile.js +8 -0
- package/dist/assets/icons/UnpackagableFile.js.map +1 -0
- package/dist/assets/icons/UnpackagableFile.svg +4 -0
- package/dist/assets/icons/UnpackagableFile.svg.js +7 -0
- package/dist/assets/icons/UnpackagableFile.svg.js.map +1 -0
- package/dist/assets/mui_components/PackagableFile.d.ts.map +1 -1
- package/dist/assets/mui_components/PackagableFile.js +5 -4
- package/dist/assets/mui_components/PackagableFile.js.map +1 -1
- package/dist/assets/mui_components/PackagableFile.svg +3 -0
- package/dist/assets/mui_components/PackagableFile.svg.js +7 -0
- package/dist/assets/mui_components/PackagableFile.svg.js.map +1 -0
- package/dist/assets/themed_icons/index.d.ts +1 -2
- package/dist/assets/themed_icons/index.d.ts.map +1 -1
- package/dist/assets/themed_icons/index.js +8 -10
- package/dist/assets/themed_icons/index.js.map +1 -1
- package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js +4 -4
- package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js.map +1 -1
- package/dist/components/AddToDownloadListV2.js +10 -10
- package/dist/components/AddToDownloadListV2.js.map +1 -1
- package/dist/components/BasePortalCard/BasePortalCard.css +1 -1
- package/dist/components/BasePortalCard/BasePortalCard.d.ts +1 -2
- package/dist/components/BasePortalCard/BasePortalCard.d.ts.map +1 -1
- package/dist/components/BasePortalCard/BasePortalCard.js +21 -28
- package/dist/components/BasePortalCard/BasePortalCard.js.map +1 -1
- package/dist/components/BasePortalCard/BasePortalCard.module.scss +7 -1
- package/dist/components/BasePortalCard/BasePortalCard.module.scss.js +11 -11
- package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.d.ts.map +1 -1
- package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.js +24 -24
- package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.js.map +1 -1
- package/dist/components/CardContainerLogic/CardContainerLogic.d.ts +5 -1
- package/dist/components/CardContainerLogic/CardContainerLogic.d.ts.map +1 -1
- package/dist/components/CardContainerLogic/CardContainerLogic.js.map +1 -1
- package/dist/components/CardContainerLogic/index.d.ts +1 -1
- package/dist/components/CardContainerLogic/index.d.ts.map +1 -1
- package/dist/components/CardDeck/TableQueryCardDeck.js +12 -9
- package/dist/components/CardDeck/TableQueryCardDeck.js.map +1 -1
- package/dist/components/ChallengeDataDownload/ChallengeDataDownload.js +33 -33
- package/dist/components/ChallengeDataDownload/ChallengeDataDownload.js.map +1 -1
- package/dist/components/ChangePassword/useChangePasswordFormState.js +5 -2
- package/dist/components/ChangePassword/useChangePasswordFormState.js.map +1 -1
- package/dist/components/ComponentCollapse.d.ts +6 -10
- package/dist/components/ComponentCollapse.d.ts.map +1 -1
- package/dist/components/ComponentCollapse.js +31 -35
- package/dist/components/ComponentCollapse.js.map +1 -1
- package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.js +12 -9
- package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.js.map +1 -1
- package/dist/components/DataGrid/MergeGridWithSourceTableButton.js +8 -3
- package/dist/components/DataGrid/MergeGridWithSourceTableButton.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +8 -3
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/components/UploadCsvToGridDialog.js +8 -3
- package/dist/components/DataGrid/components/UploadCsvToGridDialog.js.map +1 -1
- package/dist/components/DirectDownload/DirectDownload.d.ts.map +1 -1
- package/dist/components/DirectDownload/DirectDownload.js +23 -23
- package/dist/components/DirectDownload/DirectDownload.js.map +1 -1
- package/dist/components/DownloadCart/AvailableForDownloadTable.d.ts +6 -2
- package/dist/components/DownloadCart/AvailableForDownloadTable.d.ts.map +1 -1
- package/dist/components/DownloadCart/AvailableForDownloadTable.js +10 -8
- package/dist/components/DownloadCart/AvailableForDownloadTable.js.map +1 -1
- package/dist/components/DownloadCart/CreatePackageV2.css +1 -0
- package/dist/components/DownloadCart/CreatePackageV2.d.ts.map +1 -1
- package/dist/components/DownloadCart/CreatePackageV2.js +50 -46
- package/dist/components/DownloadCart/CreatePackageV2.js.map +1 -1
- package/dist/components/DownloadCart/CreatePackageV2.module.scss +38 -0
- package/dist/components/DownloadCart/CreatePackageV2.module.scss.js +14 -0
- package/dist/components/DownloadCart/CreatePackageV2.module.scss.js.map +1 -0
- package/dist/components/DownloadCart/DownloadCartPage.css +1 -0
- package/dist/components/DownloadCart/DownloadCartPage.d.ts.map +1 -1
- package/dist/components/DownloadCart/DownloadCartPage.js +316 -186
- package/dist/components/DownloadCart/DownloadCartPage.js.map +1 -1
- package/dist/components/DownloadCart/DownloadCartPage.module.scss +217 -0
- package/dist/components/DownloadCart/DownloadCartPage.module.scss.js +48 -0
- package/dist/components/DownloadCart/DownloadCartPage.module.scss.js.map +1 -0
- package/dist/components/DownloadCart/DownloadDetails.js +1 -1
- package/dist/components/DownloadCart/DownloadDetails.js.map +1 -1
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js +33 -33
- package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js.map +1 -1
- package/dist/components/DownloadCart/DownloadListTable.d.ts +4 -1
- package/dist/components/DownloadCart/DownloadListTable.d.ts.map +1 -1
- package/dist/components/DownloadCart/DownloadListTable.js +156 -236
- package/dist/components/DownloadCart/DownloadListTable.js.map +1 -1
- package/dist/components/DownloadCart/ShowDownloadV2.js +5 -5
- package/dist/components/DownloadCart/ShowDownloadV2.js.map +1 -1
- package/dist/components/Ecosystem/EcosystemSkeleton.js +8 -3
- package/dist/components/Ecosystem/EcosystemSkeleton.js.map +1 -1
- package/dist/components/EntityDownloadButton/EntityDownloadButton.d.ts +3 -0
- package/dist/components/EntityDownloadButton/EntityDownloadButton.d.ts.map +1 -1
- package/dist/components/EntityDownloadButton/EntityDownloadButton.js +113 -119
- package/dist/components/EntityDownloadButton/EntityDownloadButton.js.map +1 -1
- package/dist/components/EntityFinder/details/view/table/AddToDownloadListCell.js +3 -3
- package/dist/components/EntityFinder/details/view/table/AddToDownloadListCell.js.map +1 -1
- package/dist/components/FeaturedDataTabs/FacetPlotsCard.js +6 -2
- package/dist/components/FeaturedDataTabs/FacetPlotsCard.js.map +1 -1
- package/dist/components/FeaturedDataTabs/FeaturedDataTabs.js +11 -8
- package/dist/components/FeaturedDataTabs/FeaturedDataTabs.js.map +1 -1
- package/dist/components/FullWidthAlert/FullWidthAlert.d.ts +2 -2
- package/dist/components/FullWidthAlert/FullWidthAlert.js.map +1 -1
- package/dist/components/GenericCard/GenericCard.d.ts +5 -5
- package/dist/components/GenericCard/GenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/GenericCard.js +117 -103
- package/dist/components/GenericCard/GenericCard.js.map +1 -1
- package/dist/components/GenericCard/LabelMaybeWithIcon.d.ts +10 -0
- package/dist/components/GenericCard/LabelMaybeWithIcon.d.ts.map +1 -0
- package/dist/components/GenericCard/LabelMaybeWithIcon.js +33 -0
- package/dist/components/GenericCard/LabelMaybeWithIcon.js.map +1 -0
- package/dist/components/GenericCard/SynapseCardLabel.d.ts +2 -1
- package/dist/components/GenericCard/SynapseCardLabel.d.ts.map +1 -1
- package/dist/components/GenericCard/SynapseCardLabel.js +86 -81
- package/dist/components/GenericCard/SynapseCardLabel.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts +7 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +239 -202
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/HeaderCard.js +17 -13
- package/dist/components/HeaderCard.js.map +1 -1
- package/dist/components/Icon/Icon.js +52 -52
- package/dist/components/Icon/Icon.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 +215 -171
- package/dist/components/IconSvg/IconSvg.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +1 -0
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +103 -102
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/StorybookComponentWrapper.js +6 -3
- package/dist/components/StorybookComponentWrapper.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts +7 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.js +76 -67
- package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.d.ts +2 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.js +83 -58
- package/dist/components/SynapseChat/SynapseChatInteraction.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChatMessage.d.ts +1 -0
- package/dist/components/SynapseChat/SynapseChatMessage.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChatMessage.js +16 -15
- package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts +12 -0
- package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts.map +1 -0
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js +30 -0
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js.map +1 -0
- package/dist/components/SynapseChat/extractMessageFromTraceEvent.d.ts.map +1 -1
- package/dist/components/SynapseChat/extractMessageFromTraceEvent.js +22 -16
- package/dist/components/SynapseChat/extractMessageFromTraceEvent.js.map +1 -1
- package/dist/components/SynapseChat/index.d.ts +2 -0
- package/dist/components/SynapseChat/index.d.ts.map +1 -1
- package/dist/components/SynapseChat/index.js +5 -3
- package/dist/components/SynapseChat/index.js.map +1 -1
- package/dist/components/SynapseChat/useChatState.d.ts +1 -1
- package/dist/components/SynapseChat/useChatState.d.ts.map +1 -1
- package/dist/components/SynapseChat/useChatState.js +10 -7
- package/dist/components/SynapseChat/useChatState.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageChatSearch.d.ts.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageChatSearch.js +30 -32
- package/dist/components/SynapseHomepageV2/SynapseHomepageChatSearch.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageSearch.d.ts.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageSearch.js +27 -30
- package/dist/components/SynapseHomepageV2/SynapseHomepageSearch.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseSearchChips.d.ts.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseSearchChips.js +14 -17
- package/dist/components/SynapseHomepageV2/SynapseSearchChips.js.map +1 -1
- package/dist/components/SynapseNavDrawer/SynapseNavDrawer.d.ts.map +1 -1
- package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js +114 -115
- package/dist/components/SynapseNavDrawer/SynapseNavDrawer.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.d.ts.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js +66 -64
- package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js.map +1 -1
- package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +13 -13
- package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControlsUtils.js +9 -9
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControlsUtils.js.map +1 -1
- package/dist/components/TextToComponentCollapse.d.ts +16 -0
- package/dist/components/TextToComponentCollapse.d.ts.map +1 -0
- package/dist/components/TextToComponentCollapse.js +29 -0
- package/dist/components/TextToComponentCollapse.js.map +1 -0
- package/dist/components/download_list/AddToDownloadListConfirmationAlert/AddToDownloadListConfirmationAlert.js +8 -3
- package/dist/components/download_list/AddToDownloadListConfirmationAlert/AddToDownloadListConfirmationAlert.js.map +1 -1
- package/dist/components/download_list/DownloadConfirmationUI.d.ts +1 -1
- package/dist/components/download_list/DownloadConfirmationUI.js +22 -22
- package/dist/components/download_list/DownloadConfirmationUI.js.map +1 -1
- package/dist/components/download_list/DownloadConfirmationUtils.js +4 -4
- package/dist/components/download_list/DownloadConfirmationUtils.js.map +1 -1
- package/dist/components/index.js +85 -83
- package/dist/components/index.js.map +1 -1
- package/dist/components/row_renderers/ObservationCard.js +12 -11
- package/dist/components/row_renderers/ObservationCard.js.map +1 -1
- package/dist/components/row_renderers/utils/CardFooter.d.ts +1 -3
- package/dist/components/row_renderers/utils/CardFooter.d.ts.map +1 -1
- package/dist/components/row_renderers/utils/CardFooter.js +31 -45
- package/dist/components/row_renderers/utils/CardFooter.js.map +1 -1
- package/dist/components/table/CsvPreview/CsvPreview.js +8 -3
- package/dist/components/table/CsvPreview/CsvPreview.js.map +1 -1
- package/dist/components/table/CsvPreview/CsvPreviewDialog.js +8 -3
- package/dist/components/table/CsvPreview/CsvPreviewDialog.js.map +1 -1
- package/dist/features/curator/GridPage/GridPage.js +8 -3
- package/dist/features/curator/GridPage/GridPage.js.map +1 -1
- package/dist/features/curator/GridPage/components/GridPageTitle.js +8 -3
- package/dist/features/curator/GridPage/components/GridPageTitle.js.map +1 -1
- package/dist/index.js +137 -135
- package/dist/index.js.map +1 -1
- package/dist/style/components/_all.scss +0 -1
- package/dist/style/components/_cards.scss +22 -0
- package/dist/style/components/_download-list-v2.scss +1 -1
- package/dist/style/components/_query-wrapper-plot-nav.scss +13 -0
- package/dist/style/main.css +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/AppUtils/session/ApplicationSessionManager.d.ts.map +1 -1
- package/dist/utils/AppUtils/session/ApplicationSessionManager.js.map +1 -1
- package/dist/utils/context/FullContextProvider.js +9 -9
- package/dist/utils/context/FullContextProvider.js.map +1 -1
- package/dist/utils/context/SynapseContext.d.ts.map +1 -1
- package/dist/utils/context/SynapseContext.js +1 -0
- package/dist/utils/context/SynapseContext.js.map +1 -1
- package/dist/utils/functions/SqlFunctions.d.ts +4 -0
- package/dist/utils/functions/SqlFunctions.d.ts.map +1 -1
- package/dist/utils/functions/SqlFunctions.js +25 -23
- package/dist/utils/functions/SqlFunctions.js.map +1 -1
- package/package.json +6 -6
- package/dist/assets/themed_icons/Challenge.d.ts +0 -3
- package/dist/assets/themed_icons/Challenge.d.ts.map +0 -1
- package/dist/assets/themed_icons/Challenge.js +0 -25
- package/dist/assets/themed_icons/Challenge.js.map +0 -1
- package/dist/style/components/_download-cart-page.scss +0 -204
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowSelectionControls.js","sources":["../../../../src/components/SynapseTable/RowSelection/RowSelectionControls.tsx"],"sourcesContent":["import AddToDownloadListConfirmationAlert from '@/components/download_list/AddToDownloadListConfirmationAlert/AddToDownloadListConfirmationAlert'\nimport { useGetAddToDownloadListRequestForCurrentQuery } from '@/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery'\nimport { useGetEntity } from '@/synapse-queries'\nimport { canTableQueryBeAddedToDownloadList } from '@/utils/functions/queryUtils'\nimport { GetAppTwoTone } from '@mui/icons-material'\nimport { Box, Button } from '@mui/material'\nimport { Table } from '@sage-bionetworks/synapse-types'\nimport { useAtom } from 'jotai'\nimport { useState } from 'react'\nimport { toast } from 'react-hot-toast'\nimport { useSynapseContext } from '@/utils'\nimport { useQueryContext } from '../../QueryContext'\nimport { useQueryVisualizationContext } from '../../QueryVisualizationWrapper'\nimport { selectedRowsAtom } from '../../QueryWrapper/TableRowSelectionState'\nimport { useGetQueryMetadata } from '../../QueryWrapper/useGetQueryMetadata'\nimport {\n getFileColumnModelId,\n SEND_TO_ANALYSIS_PLATFORM_SIGN_IN_MESSAGE,\n} from '../SynapseTableUtils'\nimport { CustomControlButton } from '../CustomControls/CustomControlButton'\nimport { CustomControl } from '../TopLevelControls/TopLevelControls'\nimport { RowSelectionUI } from './RowSelectionUI'\nimport { SignInRequiredModal } from '@/components/SignInRequiredModal/SignInRequiredModal'\n\nconst SEND_TO_ANALYSIS_PLATFORM_BUTTON_ID =\n 'SendToAnalysisPlatformRowSelectionControlButton'\n\nexport type RowSelectionControlsProps = {\n customControls?: CustomControl[]\n remount?: () => void\n}\n\n/**\n * This component is responsible for rendering the RowSelectionUI and the custom controls. Must be wrapped in a\n * QueryContext and a QueryVisualizationContext.\n * @param props\n * @constructor\n */\nexport function RowSelectionControls(props: RowSelectionControlsProps) {\n const { customControls = [], remount } = props\n const { isAuthenticated } = useSynapseContext()\n const [showLoginModal, setShowLoginModal] = useState(false)\n const { entityId, versionNumber, getCurrentQueryRequest } = useQueryContext()\n const { data: entity } = useGetEntity<Table>(entityId, versionNumber)\n const { data: queryMetadata } = useGetQueryMetadata()\n const [selectedRows, setSelectedRows] = useAtom(selectedRowsAtom)\n\n const addToDownloadListRequest =\n useGetAddToDownloadListRequestForCurrentQuery()\n\n const {\n setIsShowingExportToAnalysisPlatformModal,\n enabledExternalAnalysisPlatforms,\n } = useQueryVisualizationContext()\n\n const showExportToAnalysisPlatformButton =\n enabledExternalAnalysisPlatforms.length > 0\n\n const refresh = () => {\n // clear selection\n setSelectedRows([])\n if (remount) {\n remount()\n }\n }\n const fileColumnId = getFileColumnModelId(queryMetadata?.columnModels)\n const showAddToDownloadCart = canTableQueryBeAddedToDownloadList(\n entity,\n fileColumnId,\n )\n\n return (\n <RowSelectionUI\n show={selectedRows.length > 0}\n selectedRowCount={selectedRows.length}\n onClearSelection={() => setSelectedRows([])}\n customControls={\n <>\n {customControls.map(customControl => {\n return (\n <CustomControlButton\n key={customControl.buttonText}\n variant=\"contained\"\n callbackData={{\n tableId: entityId!,\n queryMetadata: queryMetadata,\n selectedRows,\n refresh,\n request: getCurrentQueryRequest(),\n }}\n control={customControl}\n startIcon={customControl.icon}\n />\n )\n })}\n {/* TODO: Generic button */}\n {showExportToAnalysisPlatformButton && (\n <Button\n variant=\"outlined\"\n onClick={() => {\n if (isAuthenticated) {\n setIsShowingExportToAnalysisPlatformModal(true)\n } else {\n setShowLoginModal(true)\n }\n }}\n id={SEND_TO_ANALYSIS_PLATFORM_BUTTON_ID}\n >\n Send to Analysis Platform\n </Button>\n )}\n {showLoginModal && (\n <SignInRequiredModal\n onHide={() => setShowLoginModal(false)}\n content={SEND_TO_ANALYSIS_PLATFORM_SIGN_IN_MESSAGE}\n />\n )}\n {showAddToDownloadCart && (\n <Button\n variant=\"contained\"\n onClick={() => {\n const toastId = toast.custom(\n <Box\n sx={{\n width: '100%',\n }}\n >\n <AddToDownloadListConfirmationAlert\n addToDownloadListRequest={addToDownloadListRequest}\n onClose={() => {\n toast.dismiss(toastId)\n }}\n />\n </Box>,\n {\n duration: Infinity,\n },\n )\n }}\n startIcon={<GetAppTwoTone />}\n >\n Add to Download
|
|
1
|
+
{"version":3,"file":"RowSelectionControls.js","sources":["../../../../src/components/SynapseTable/RowSelection/RowSelectionControls.tsx"],"sourcesContent":["import AddToDownloadListConfirmationAlert from '@/components/download_list/AddToDownloadListConfirmationAlert/AddToDownloadListConfirmationAlert'\nimport { useGetAddToDownloadListRequestForCurrentQuery } from '@/components/QueryWrapper/useGetAddToDownloadListRequestForCurrentQuery'\nimport { useGetEntity } from '@/synapse-queries'\nimport { canTableQueryBeAddedToDownloadList } from '@/utils/functions/queryUtils'\nimport { GetAppTwoTone } from '@mui/icons-material'\nimport { Box, Button } from '@mui/material'\nimport { Table } from '@sage-bionetworks/synapse-types'\nimport { useAtom } from 'jotai'\nimport { useState } from 'react'\nimport { toast } from 'react-hot-toast'\nimport { useSynapseContext } from '@/utils'\nimport { useQueryContext } from '../../QueryContext'\nimport { useQueryVisualizationContext } from '../../QueryVisualizationWrapper'\nimport { selectedRowsAtom } from '../../QueryWrapper/TableRowSelectionState'\nimport { useGetQueryMetadata } from '../../QueryWrapper/useGetQueryMetadata'\nimport {\n getFileColumnModelId,\n SEND_TO_ANALYSIS_PLATFORM_SIGN_IN_MESSAGE,\n} from '../SynapseTableUtils'\nimport { CustomControlButton } from '../CustomControls/CustomControlButton'\nimport { CustomControl } from '../TopLevelControls/TopLevelControls'\nimport { RowSelectionUI } from './RowSelectionUI'\nimport { SignInRequiredModal } from '@/components/SignInRequiredModal/SignInRequiredModal'\n\nconst SEND_TO_ANALYSIS_PLATFORM_BUTTON_ID =\n 'SendToAnalysisPlatformRowSelectionControlButton'\n\nexport type RowSelectionControlsProps = {\n customControls?: CustomControl[]\n remount?: () => void\n}\n\n/**\n * This component is responsible for rendering the RowSelectionUI and the custom controls. Must be wrapped in a\n * QueryContext and a QueryVisualizationContext.\n * @param props\n * @constructor\n */\nexport function RowSelectionControls(props: RowSelectionControlsProps) {\n const { customControls = [], remount } = props\n const { isAuthenticated } = useSynapseContext()\n const [showLoginModal, setShowLoginModal] = useState(false)\n const { entityId, versionNumber, getCurrentQueryRequest } = useQueryContext()\n const { data: entity } = useGetEntity<Table>(entityId, versionNumber)\n const { data: queryMetadata } = useGetQueryMetadata()\n const [selectedRows, setSelectedRows] = useAtom(selectedRowsAtom)\n\n const addToDownloadListRequest =\n useGetAddToDownloadListRequestForCurrentQuery()\n\n const {\n setIsShowingExportToAnalysisPlatformModal,\n enabledExternalAnalysisPlatforms,\n } = useQueryVisualizationContext()\n\n const showExportToAnalysisPlatformButton =\n enabledExternalAnalysisPlatforms.length > 0\n\n const refresh = () => {\n // clear selection\n setSelectedRows([])\n if (remount) {\n remount()\n }\n }\n const fileColumnId = getFileColumnModelId(queryMetadata?.columnModels)\n const showAddToDownloadCart = canTableQueryBeAddedToDownloadList(\n entity,\n fileColumnId,\n )\n\n return (\n <RowSelectionUI\n show={selectedRows.length > 0}\n selectedRowCount={selectedRows.length}\n onClearSelection={() => setSelectedRows([])}\n customControls={\n <>\n {customControls.map(customControl => {\n return (\n <CustomControlButton\n key={customControl.buttonText}\n variant=\"contained\"\n callbackData={{\n tableId: entityId!,\n queryMetadata: queryMetadata,\n selectedRows,\n refresh,\n request: getCurrentQueryRequest(),\n }}\n control={customControl}\n startIcon={customControl.icon}\n />\n )\n })}\n {/* TODO: Generic button */}\n {showExportToAnalysisPlatformButton && (\n <Button\n variant=\"outlined\"\n onClick={() => {\n if (isAuthenticated) {\n setIsShowingExportToAnalysisPlatformModal(true)\n } else {\n setShowLoginModal(true)\n }\n }}\n id={SEND_TO_ANALYSIS_PLATFORM_BUTTON_ID}\n >\n Send to Analysis Platform\n </Button>\n )}\n {showLoginModal && (\n <SignInRequiredModal\n onHide={() => setShowLoginModal(false)}\n content={SEND_TO_ANALYSIS_PLATFORM_SIGN_IN_MESSAGE}\n />\n )}\n {showAddToDownloadCart && (\n <Button\n variant=\"contained\"\n onClick={() => {\n const toastId = toast.custom(\n <Box\n sx={{\n width: '100%',\n }}\n >\n <AddToDownloadListConfirmationAlert\n addToDownloadListRequest={addToDownloadListRequest}\n onClose={() => {\n toast.dismiss(toastId)\n }}\n />\n </Box>,\n {\n duration: Infinity,\n },\n )\n }}\n startIcon={<GetAppTwoTone />}\n >\n Add to Download List\n </Button>\n )}\n </>\n }\n />\n )\n}\n"],"names":["SEND_TO_ANALYSIS_PLATFORM_BUTTON_ID","RowSelectionControls","props","customControls","remount","isAuthenticated","useSynapseContext","showLoginModal","setShowLoginModal","useState","entityId","versionNumber","getCurrentQueryRequest","useQueryContext","entity","useGetEntity","queryMetadata","useGetQueryMetadata","selectedRows","setSelectedRows","useAtom","selectedRowsAtom","addToDownloadListRequest","useGetAddToDownloadListRequestForCurrentQuery","setIsShowingExportToAnalysisPlatformModal","enabledExternalAnalysisPlatforms","useQueryVisualizationContext","showExportToAnalysisPlatformButton","refresh","fileColumnId","getFileColumnModelId","showAddToDownloadCart","canTableQueryBeAddedToDownloadList","jsx","RowSelectionUI","jsxs","Fragment","customControl","CustomControlButton","Button","SignInRequiredModal","SEND_TO_ANALYSIS_PLATFORM_SIGN_IN_MESSAGE","toastId","toast","Box","AddToDownloadListConfirmationAlert","GetAppTwoTone"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAMA,IACJ;AAaK,SAASC,GAAqBC,GAAkC;AACrE,QAAM,EAAE,gBAAAC,IAAiB,IAAI,SAAAC,MAAYF,GACnC,EAAE,iBAAAG,EAAA,IAAoBC,EAAA,GACtB,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAK,GACpD,EAAE,UAAAC,GAAU,eAAAC,GAAe,wBAAAC,EAAA,IAA2BC,EAAA,GACtD,EAAE,MAAMC,EAAA,IAAWC,EAAoBL,GAAUC,CAAa,GAC9D,EAAE,MAAMK,EAAA,IAAkBC,EAAA,GAC1B,CAACC,GAAcC,CAAe,IAAIC,EAAQC,CAAgB,GAE1DC,IACJC,EAAA,GAEI;AAAA,IACJ,2CAAAC;AAAA,IACA,kCAAAC;AAAA,EAAA,IACEC,EAAA,GAEEC,IACJF,EAAiC,SAAS,GAEtCG,IAAU,MAAM;AAEpB,IAAAT,EAAgB,CAAA,CAAE,GACdf,KACFA,EAAA;AAAA,EAEJ,GACMyB,IAAeC,EAAqBd,GAAe,YAAY,GAC/De,IAAwBC;AAAA,IAC5BlB;AAAA,IACAe;AAAA,EAAA;AAGF,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMhB,EAAa,SAAS;AAAA,MAC5B,kBAAkBA,EAAa;AAAA,MAC/B,kBAAkB,MAAMC,EAAgB,EAAE;AAAA,MAC1C,gBACE,gBAAAgB,EAAAC,GAAA,EACG,UAAA;AAAA,QAAAjC,EAAe,IAAI,CAAAkC,MAEhB,gBAAAJ;AAAA,UAACK;AAAA,UAAA;AAAA,YAEC,SAAQ;AAAA,YACR,cAAc;AAAA,cACZ,SAAS5B;AAAA,cACT,eAAAM;AAAA,cACA,cAAAE;AAAA,cACA,SAAAU;AAAA,cACA,SAAShB,EAAA;AAAA,YAAuB;AAAA,YAElC,SAASyB;AAAA,YACT,WAAWA,EAAc;AAAA,UAAA;AAAA,UAVpBA,EAAc;AAAA,QAAA,CAaxB;AAAA,QAEAV,KACC,gBAAAM;AAAA,UAACM;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,SAAS,MAAM;AACb,cAAIlC,IACFmB,EAA0C,EAAI,IAE9ChB,EAAkB,EAAI;AAAA,YAE1B;AAAA,YACA,IAAIR;AAAA,YACL,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAIFO,KACC,gBAAA0B;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,QAAQ,MAAMhC,EAAkB,EAAK;AAAA,YACrC,SAASiC;AAAA,UAAA;AAAA,QAAA;AAAA,QAGZV,KACC,gBAAAE;AAAA,UAACM;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,SAAS,MAAM;AACb,oBAAMG,IAAUC,EAAM;AAAA,gBACpB,gBAAAV;AAAA,kBAACW;AAAA,kBAAA;AAAA,oBACC,IAAI;AAAA,sBACF,OAAO;AAAA,oBAAA;AAAA,oBAGT,UAAA,gBAAAX;AAAA,sBAACY;AAAA,sBAAA;AAAA,wBACC,0BAAAvB;AAAA,wBACA,SAAS,MAAM;AACb,0BAAAqB,EAAM,QAAQD,CAAO;AAAA,wBACvB;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACF;AAAA,gBAAA;AAAA,gBAEF;AAAA,kBACE,UAAU;AAAA,gBAAA;AAAA,cACZ;AAAA,YAEJ;AAAA,YACA,6BAAYI,GAAA,EAAc;AAAA,YAC3B,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAED,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import u from "pluralize";
|
|
2
2
|
import { upperFirst as A } from "lodash-es";
|
|
3
|
-
const f = "to Download
|
|
4
|
-
function
|
|
3
|
+
const f = "to Download List";
|
|
4
|
+
function i(r, o, e) {
|
|
5
5
|
return r ? o.length : e;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function s(r, o, e, l, n) {
|
|
8
8
|
if (!r && !o)
|
|
9
9
|
return `all ${u(n)}`;
|
|
10
|
-
const t =
|
|
10
|
+
const t = i(
|
|
11
11
|
o,
|
|
12
12
|
e,
|
|
13
13
|
l
|
|
@@ -17,12 +17,12 @@ function $(r, o, e, l, n) {
|
|
|
17
17
|
t
|
|
18
18
|
)}` : u(n);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function $(r, o, e, l, n) {
|
|
21
21
|
if (!r && !o)
|
|
22
22
|
return `Add All ${A(
|
|
23
23
|
u(n)
|
|
24
24
|
)} ${f}`;
|
|
25
|
-
const t =
|
|
25
|
+
const t = i(
|
|
26
26
|
o,
|
|
27
27
|
e,
|
|
28
28
|
l
|
|
@@ -32,8 +32,8 @@ function c(r, o, e, l, n) {
|
|
|
32
32
|
)} ${f}` : `Add ${f}`;
|
|
33
33
|
}
|
|
34
34
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
$ as getNumberOfResultsToAddToDownloadListCopy,
|
|
36
|
+
i as getNumberOfResultsToInvokeAction,
|
|
37
|
+
s as getNumberOfResultsToInvokeActionCopy
|
|
38
38
|
};
|
|
39
39
|
//# sourceMappingURL=TopLevelControlsUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopLevelControlsUtils.js","sources":["../../../../src/components/SynapseTable/TopLevelControls/TopLevelControlsUtils.ts"],"sourcesContent":["import { QueryContextType } from '../../QueryContext'\nimport { QueryVisualizationContextType } from '../../QueryVisualizationWrapper'\nimport pluralize from 'pluralize'\nimport { upperFirst } from 'lodash-es'\nimport { Row } from '@sage-bionetworks/synapse-types'\n\nconst TO_DOWNLOAD_CART = 'to Download
|
|
1
|
+
{"version":3,"file":"TopLevelControlsUtils.js","sources":["../../../../src/components/SynapseTable/TopLevelControls/TopLevelControlsUtils.ts"],"sourcesContent":["import { QueryContextType } from '../../QueryContext'\nimport { QueryVisualizationContextType } from '../../QueryVisualizationWrapper'\nimport pluralize from 'pluralize'\nimport { upperFirst } from 'lodash-es'\nimport { Row } from '@sage-bionetworks/synapse-types'\n\nconst TO_DOWNLOAD_CART = 'to Download List'\n\n/**\n * If the user invokes an action on the table (such as \"Send to CAVATICA\"), we want to tell the user how many rows they\n * will perform the action on.\n *\n * If selection is enabled and rows have been selected, return the number of selected rows.\n * If no rows have been selected, return the total number of query results.\n * If the total number of query results is unknown, return undefined.\n * @param hasSelectedRows\n * @param selectedRows\n * @param totalNumberOfRows\n */\nexport function getNumberOfResultsToInvokeAction(\n hasSelectedRows: boolean,\n selectedRows: Row[],\n totalNumberOfRows?: number,\n) {\n return hasSelectedRows ? selectedRows.length : totalNumberOfRows\n}\n\n/**\n * Returns copy for how to reference the number of results that will be affected by an action, such as \"Send to CAVATICA\".\n * Utilizes the unit description to return a count and pluralized unit description.\n *\n * If the user has not selected rows or applied any filters, return \"all <unit>s\".\n * If the user has applied filters but not selected rows, return the total number of query results to indicate that the filtered result set is used. e.g. '2 <unit>s'\n * - If the total number of query results is unknown, the count is not included. e.g. '<unit>s'\n * If the user has selected rows, return the number of selected rows. e.g. '2 <unit>s'\n * @param hasResettableFilters\n * @param hasSelectedRows\n * @param selectedRows\n * @param totalNumberOfRows\n * @param unitDescription\n */\nexport function getNumberOfResultsToInvokeActionCopy(\n hasResettableFilters: QueryContextType['hasResettableFilters'],\n hasSelectedRows: boolean,\n selectedRows: Row[],\n totalNumberOfRows: number | undefined,\n unitDescription: QueryVisualizationContextType['unitDescription'],\n) {\n if (!hasResettableFilters && !hasSelectedRows) {\n return `all ${pluralize(unitDescription)}`\n }\n\n const numberOfResultsToInvokeAction = getNumberOfResultsToInvokeAction(\n hasSelectedRows,\n selectedRows,\n totalNumberOfRows,\n )\n if (numberOfResultsToInvokeAction != null) {\n return `${numberOfResultsToInvokeAction.toLocaleString()} ${pluralize(\n unitDescription,\n numberOfResultsToInvokeAction,\n )}`\n }\n // Null count, so just return the pluralized unit description\n return pluralize(unitDescription)\n}\n\n/**\n * Returns copy for how to reference the number of results that will be sent to the download list.\n * Utilizes the unit description to return a count and pluralized unit description.\n * @param hasResettableFilters\n * @param hasSelectedRows\n * @param selectedRows\n * @param totalNumberOfRows\n * @param unitDescription\n */\nexport function getNumberOfResultsToAddToDownloadListCopy(\n hasResettableFilters: QueryContextType['hasResettableFilters'],\n hasSelectedRows: boolean,\n selectedRows: Row[],\n totalNumberOfRows: number | undefined,\n unitDescription: QueryVisualizationContextType['unitDescription'],\n) {\n if (!hasResettableFilters && !hasSelectedRows) {\n return `Add All ${upperFirst(\n pluralize(unitDescription),\n )} ${TO_DOWNLOAD_CART}`\n }\n\n const numberOfResultsToInvokeAction = getNumberOfResultsToInvokeAction(\n hasSelectedRows,\n selectedRows,\n totalNumberOfRows,\n )\n if (numberOfResultsToInvokeAction != null) {\n return `Add ${numberOfResultsToInvokeAction.toLocaleString()} Selected ${upperFirst(\n pluralize(unitDescription, numberOfResultsToInvokeAction),\n )} ${TO_DOWNLOAD_CART}`\n }\n // Null count\n return `Add ${TO_DOWNLOAD_CART}`\n}\n"],"names":["TO_DOWNLOAD_CART","getNumberOfResultsToInvokeAction","hasSelectedRows","selectedRows","totalNumberOfRows","getNumberOfResultsToInvokeActionCopy","hasResettableFilters","unitDescription","pluralize","numberOfResultsToInvokeAction","getNumberOfResultsToAddToDownloadListCopy","upperFirst"],"mappings":";;AAMA,MAAMA,IAAmB;AAalB,SAASC,EACdC,GACAC,GACAC,GACA;AACA,SAAOF,IAAkBC,EAAa,SAASC;AACjD;AAgBO,SAASC,EACdC,GACAJ,GACAC,GACAC,GACAG,GACA;AACA,MAAI,CAACD,KAAwB,CAACJ;AAC5B,WAAO,OAAOM,EAAUD,CAAe,CAAC;AAG1C,QAAME,IAAgCR;AAAA,IACpCC;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA;AAEF,SAAIK,KAAiC,OAC5B,GAAGA,EAA8B,eAAA,CAAgB,IAAID;AAAA,IAC1DD;AAAA,IACAE;AAAA,EAAA,CACD,KAGID,EAAUD,CAAe;AAClC;AAWO,SAASG,EACdJ,GACAJ,GACAC,GACAC,GACAG,GACA;AACA,MAAI,CAACD,KAAwB,CAACJ;AAC5B,WAAO,WAAWS;AAAA,MAChBH,EAAUD,CAAe;AAAA,IAAA,CAC1B,IAAIP,CAAgB;AAGvB,QAAMS,IAAgCR;AAAA,IACpCC;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA;AAEF,SAAIK,KAAiC,OAC5B,OAAOA,EAA8B,eAAA,CAAgB,aAAaE;AAAA,IACvEH,EAAUD,GAAiBE,CAA6B;AAAA,EAAA,CACzD,IAAIT,CAAgB,KAGhB,OAAOA,CAAgB;AAChC;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SxProps, TypographyOwnProps } from '@mui/material';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
export type TextToComponentCollapseProps = PropsWithChildren<{
|
|
4
|
+
text: string;
|
|
5
|
+
defaultVisible?: boolean;
|
|
6
|
+
textVariant?: TypographyOwnProps['variant'];
|
|
7
|
+
textSx?: SxProps;
|
|
8
|
+
textContainerSx?: SxProps;
|
|
9
|
+
collapseBoxSx?: SxProps;
|
|
10
|
+
iconSx?: SxProps;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Wrap any child components in a collapse, using a Typography as the trigger
|
|
14
|
+
*/
|
|
15
|
+
export default function TextToComponentCollapse({ text, defaultVisible, textVariant, textSx, textContainerSx, collapseBoxSx, iconSx, children, }: TextToComponentCollapseProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=TextToComponentCollapse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextToComponentCollapse.d.ts","sourceRoot":"","sources":["../../src/components/TextToComponentCollapse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAc,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGzC,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAA;IAC3C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,IAAI,EACJ,cAAc,EACd,WAAyB,EACzB,MAAM,EACN,eAAe,EACf,aAAa,EACb,MAAM,EACN,QAAQ,GACT,EAAE,4BAA4B,2CAgB9B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Typography as l } from "@mui/material";
|
|
3
|
+
import s from "./ComponentCollapse.js";
|
|
4
|
+
function c({
|
|
5
|
+
text: n,
|
|
6
|
+
defaultVisible: t,
|
|
7
|
+
textVariant: r = "smallLink",
|
|
8
|
+
textSx: e,
|
|
9
|
+
textContainerSx: p,
|
|
10
|
+
collapseBoxSx: m,
|
|
11
|
+
iconSx: a,
|
|
12
|
+
children: i
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ o(
|
|
15
|
+
s,
|
|
16
|
+
{
|
|
17
|
+
component: /* @__PURE__ */ o(l, { variant: r, sx: e, children: n }),
|
|
18
|
+
componentContainerSx: p,
|
|
19
|
+
defaultVisible: t,
|
|
20
|
+
collapseBoxSx: m,
|
|
21
|
+
iconSx: a,
|
|
22
|
+
children: i
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
c as default
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=TextToComponentCollapse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextToComponentCollapse.js","sources":["../../src/components/TextToComponentCollapse.tsx"],"sourcesContent":["import { SxProps, Typography, TypographyOwnProps } from '@mui/material'\nimport { PropsWithChildren } from 'react'\nimport ComponentCollapse from './ComponentCollapse'\n\nexport type TextToComponentCollapseProps = PropsWithChildren<{\n text: string\n defaultVisible?: boolean // default to false (collapsed)\n textVariant?: TypographyOwnProps['variant']\n textSx?: SxProps\n textContainerSx?: SxProps\n collapseBoxSx?: SxProps\n iconSx?: SxProps\n}>\n\n/**\n * Wrap any child components in a collapse, using a Typography as the trigger\n */\nexport default function TextToComponentCollapse({\n text,\n defaultVisible,\n textVariant = 'smallLink',\n textSx,\n textContainerSx,\n collapseBoxSx,\n iconSx,\n children,\n}: TextToComponentCollapseProps) {\n return (\n <ComponentCollapse\n component={\n <Typography variant={textVariant} sx={textSx}>\n {text}\n </Typography>\n }\n componentContainerSx={textContainerSx}\n defaultVisible={defaultVisible}\n collapseBoxSx={collapseBoxSx}\n iconSx={iconSx}\n >\n {children}\n </ComponentCollapse>\n )\n}\n"],"names":["TextToComponentCollapse","text","defaultVisible","textVariant","textSx","textContainerSx","collapseBoxSx","iconSx","children","jsx","ComponentCollapse","Typography"],"mappings":";;;AAiBA,SAAwBA,EAAwB;AAAA,EAC9C,MAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AACF,GAAiC;AAC/B,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WACE,gBAAAD,EAACE,GAAA,EAAW,SAASR,GAAa,IAAIC,GACnC,UAAAH,GACH;AAAA,MAEF,sBAAsBI;AAAA,MACtB,gBAAAH;AAAA,MACA,eAAAI;AAAA,MACA,QAAAC;AAAA,MAEC,UAAAC;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -53,11 +53,14 @@ import "@mui/material/SvgIcon";
|
|
|
53
53
|
import "../../../assets/icons/AccessPending.svg.js";
|
|
54
54
|
import "../../../assets/icons/AccessPendingCloud.svg.js";
|
|
55
55
|
import "../../../assets/icons/FileWithShield.svg.js";
|
|
56
|
+
import "../../../assets/icons/MultiFile.svg.js";
|
|
57
|
+
import "../../../assets/icons/UnpackagableFile.svg.js";
|
|
56
58
|
import "../../../assets/icons/bioChemicalPhysical.svg.js";
|
|
57
59
|
import "../../../assets/icons/computationalTool.svg.js";
|
|
58
60
|
import "../../../assets/icons/dataReuse.svg.js";
|
|
59
61
|
import "../../../assets/icons/inSilicoModel.svg.js";
|
|
60
62
|
import "../../../assets/icons/modelSystem.svg.js";
|
|
63
|
+
import "../../../assets/mui_components/PackagableFile.svg.js";
|
|
61
64
|
import "../../../assets/icons/spatialProfiling.svg.js";
|
|
62
65
|
/* empty css */
|
|
63
66
|
import "../../Authentication/AuthenticationMethodSelection.js";
|
|
@@ -83,6 +86,7 @@ import "../../../assets/icons/study-complete.svg.js";
|
|
|
83
86
|
import "../../../assets/icons/translational.svg.js";
|
|
84
87
|
import "../../../assets/icons/tree_horizontal.svg.js";
|
|
85
88
|
import "../../../assets/icons/standardDataModel.svg.js";
|
|
89
|
+
import "../../../assets/icons/Challenge.svg.js";
|
|
86
90
|
import "react-intersection-observer";
|
|
87
91
|
import "@rjsf/utils";
|
|
88
92
|
import "../../SchemaDrivenAnnotationEditor/template/AdditionalPropertyContext.js";
|
|
@@ -100,10 +104,10 @@ import "../../../assets/icons/DoubleQuotes.svg.js";
|
|
|
100
104
|
import "../../EntityDownloadConfirmation/EntityDownloadConfirmation.js";
|
|
101
105
|
import "../../QueryContext/QueryContext.js";
|
|
102
106
|
import "../../QueryVisualizationWrapper/QueryVisualizationContext.js";
|
|
107
|
+
import "react-share";
|
|
103
108
|
import "../../GenericCard/GenericCard.js";
|
|
104
109
|
import "@mui/system";
|
|
105
110
|
import "../../GenericCard/Linkify.js";
|
|
106
|
-
import "react-share";
|
|
107
111
|
import "jotai";
|
|
108
112
|
import "lodash-es/noop";
|
|
109
113
|
import "../../QueryWrapper/TableRowSelectionState.js";
|
|
@@ -203,6 +207,7 @@ import "lodash-es/set";
|
|
|
203
207
|
import "lodash-es/trimStart";
|
|
204
208
|
import "../../SynapseForm/SynapseFormSubmissionGrid.js";
|
|
205
209
|
import "../../SynapseChat/AccessLevelMenu.js";
|
|
210
|
+
import "react-draggable";
|
|
206
211
|
import "../../TimelinePlot/phasesQueryResponseData.js";
|
|
207
212
|
import "../../EntityHeaderTable/EntityHeaderTable.js";
|
|
208
213
|
import "../../MuiContainer.js";
|
|
@@ -212,7 +217,7 @@ import "../../PortalAclEditor/PortalAclEditor.js";
|
|
|
212
217
|
import "../../SynapseHomepageV2/HomepageStyles.js";
|
|
213
218
|
import { DownloadConfirmationUI as D } from "../DownloadConfirmationUI.js";
|
|
214
219
|
import { displayFilesWereAddedToDownloadListSuccess as L } from "../DownloadConfirmationUtils.js";
|
|
215
|
-
function
|
|
220
|
+
function qi(p) {
|
|
216
221
|
const { addToDownloadListRequest: t, onClose: o } = p, { downloadCartPageUrl: e } = u(), {
|
|
217
222
|
data: r,
|
|
218
223
|
isLoading: n,
|
|
@@ -241,6 +246,6 @@ function Li(p) {
|
|
|
241
246
|
);
|
|
242
247
|
}
|
|
243
248
|
export {
|
|
244
|
-
|
|
249
|
+
qi as default
|
|
245
250
|
};
|
|
246
251
|
//# sourceMappingURL=AddToDownloadListConfirmationAlert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddToDownloadListConfirmationAlert.js","sources":["../../../../src/components/download_list/AddToDownloadListConfirmationAlert/AddToDownloadListConfirmationAlert.tsx"],"sourcesContent":["import { displayToast } from '@/components/index'\nimport { ErrorBanner } from '@/components/error/ErrorBanner'\nimport {\n useAddToDownloadList,\n useGetAddToDownloadListStats,\n} from '@/synapse-queries/download/useDownloadList'\nimport { useSynapseContext } from '@/utils'\nimport { AddToDownloadListRequest } from '@sage-bionetworks/synapse-client'\nimport DownloadConfirmationUI from '../DownloadConfirmationUI'\nimport { displayFilesWereAddedToDownloadListSuccess } from '../DownloadConfirmationUtils'\n\nexport type AddToDownloadListConfirmationAlertProps = {\n /**\n * The \"AddToDownloadListRequest\" that would be used to add items to the download list.\n */\n addToDownloadListRequest: AddToDownloadListRequest\n /**\n * Invoked when the dialog is closed, either by cancelling or successfully adding to the download list.\n */\n onClose: () => void\n}\n\n/**\n * A component that displays a confirmation alert when adding multiple items to the download list though a container or\n * query.\n * @param props\n * @constructor\n */\nfunction AddToDownloadListConfirmationAlert(\n props: AddToDownloadListConfirmationAlertProps,\n) {\n const { addToDownloadListRequest, onClose } = props\n const { downloadCartPageUrl } = useSynapseContext()\n\n const {\n data,\n isLoading,\n error: statsError,\n } = useGetAddToDownloadListStats({\n concreteType:\n 'org.sagebionetworks.repo.model.download.AddToDownloadListStatsRequest',\n request: addToDownloadListRequest,\n })\n\n const { mutate: addToDownloadList, isPending: isAddingToDownloadCart } =\n useAddToDownloadList({\n onSuccess: () => {\n displayFilesWereAddedToDownloadListSuccess(downloadCartPageUrl)\n onClose()\n },\n onError: error => {\n displayToast(error.reason, 'danger')\n onClose()\n },\n })\n\n const fileCount = data?.fileCount\n const fileSizeTotal = data?.fileSize\n\n if (statsError) {\n return <ErrorBanner error={statsError} />\n }\n\n return (\n <DownloadConfirmationUI\n onAddToDownloadCart={() => addToDownloadList(addToDownloadListRequest)}\n fileCount={fileCount}\n fileSize={fileSizeTotal}\n isAddingToDownloadCart={isAddingToDownloadCart}\n isLoadingStats={isLoading}\n onCancel={onClose}\n />\n )\n}\n\nexport default AddToDownloadListConfirmationAlert\n"],"names":["AddToDownloadListConfirmationAlert","props","addToDownloadListRequest","onClose","downloadCartPageUrl","useSynapseContext","data","isLoading","statsError","useGetAddToDownloadListStats","addToDownloadList","isAddingToDownloadCart","useAddToDownloadList","displayFilesWereAddedToDownloadListSuccess","error","displayToast","fileCount","fileSizeTotal","jsx","ErrorBanner","DownloadConfirmationUI"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddToDownloadListConfirmationAlert.js","sources":["../../../../src/components/download_list/AddToDownloadListConfirmationAlert/AddToDownloadListConfirmationAlert.tsx"],"sourcesContent":["import { displayToast } from '@/components/index'\nimport { ErrorBanner } from '@/components/error/ErrorBanner'\nimport {\n useAddToDownloadList,\n useGetAddToDownloadListStats,\n} from '@/synapse-queries/download/useDownloadList'\nimport { useSynapseContext } from '@/utils'\nimport { AddToDownloadListRequest } from '@sage-bionetworks/synapse-client'\nimport DownloadConfirmationUI from '../DownloadConfirmationUI'\nimport { displayFilesWereAddedToDownloadListSuccess } from '../DownloadConfirmationUtils'\n\nexport type AddToDownloadListConfirmationAlertProps = {\n /**\n * The \"AddToDownloadListRequest\" that would be used to add items to the download list.\n */\n addToDownloadListRequest: AddToDownloadListRequest\n /**\n * Invoked when the dialog is closed, either by cancelling or successfully adding to the download list.\n */\n onClose: () => void\n}\n\n/**\n * A component that displays a confirmation alert when adding multiple items to the download list though a container or\n * query.\n * @param props\n * @constructor\n */\nfunction AddToDownloadListConfirmationAlert(\n props: AddToDownloadListConfirmationAlertProps,\n) {\n const { addToDownloadListRequest, onClose } = props\n const { downloadCartPageUrl } = useSynapseContext()\n\n const {\n data,\n isLoading,\n error: statsError,\n } = useGetAddToDownloadListStats({\n concreteType:\n 'org.sagebionetworks.repo.model.download.AddToDownloadListStatsRequest',\n request: addToDownloadListRequest,\n })\n\n const { mutate: addToDownloadList, isPending: isAddingToDownloadCart } =\n useAddToDownloadList({\n onSuccess: () => {\n displayFilesWereAddedToDownloadListSuccess(downloadCartPageUrl)\n onClose()\n },\n onError: error => {\n displayToast(error.reason, 'danger')\n onClose()\n },\n })\n\n const fileCount = data?.fileCount\n const fileSizeTotal = data?.fileSize\n\n if (statsError) {\n return <ErrorBanner error={statsError} />\n }\n\n return (\n <DownloadConfirmationUI\n onAddToDownloadCart={() => addToDownloadList(addToDownloadListRequest)}\n fileCount={fileCount}\n fileSize={fileSizeTotal}\n isAddingToDownloadCart={isAddingToDownloadCart}\n isLoadingStats={isLoading}\n onCancel={onClose}\n />\n )\n}\n\nexport default AddToDownloadListConfirmationAlert\n"],"names":["AddToDownloadListConfirmationAlert","props","addToDownloadListRequest","onClose","downloadCartPageUrl","useSynapseContext","data","isLoading","statsError","useGetAddToDownloadListStats","addToDownloadList","isAddingToDownloadCart","useAddToDownloadList","displayFilesWereAddedToDownloadListSuccess","error","displayToast","fileCount","fileSizeTotal","jsx","ErrorBanner","DownloadConfirmationUI"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAASA,GACPC,GACA;AACA,QAAM,EAAE,0BAAAC,GAA0B,SAAAC,EAAA,IAAYF,GACxC,EAAE,qBAAAG,EAAA,IAAwBC,EAAA,GAE1B;AAAA,IACJ,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAOC;AAAA,EAAA,IACLC,EAA6B;AAAA,IAC/B,cACE;AAAA,IACF,SAASP;AAAA,EAAA,CACV,GAEK,EAAE,QAAQQ,GAAmB,WAAWC,EAAA,IAC5CC,EAAqB;AAAA,IACnB,WAAW,MAAM;AACf,MAAAC,EAA2CT,CAAmB,GAC9DD,EAAA;AAAA,IACF;AAAA,IACA,SAAS,CAAAW,MAAS;AAChB,MAAAC,EAAaD,EAAM,QAAQ,QAAQ,GACnCX,EAAA;AAAA,IACF;AAAA,EAAA,CACD,GAEGa,IAAYV,GAAM,WAClBW,IAAgBX,GAAM;AAE5B,SAAIE,IACK,gBAAAU,EAACC,GAAA,EAAY,OAAOX,EAAA,CAAY,IAIvC,gBAAAU;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,qBAAqB,MAAMV,EAAkBR,CAAwB;AAAA,MACrE,WAAAc;AAAA,MACA,UAAUC;AAAA,MACV,wBAAAN;AAAA,MACA,gBAAgBJ;AAAA,MAChB,UAAUJ;AAAA,IAAA;AAAA,EAAA;AAGhB;"}
|
|
@@ -8,7 +8,7 @@ export type DownloadConfirmationUIProps = {
|
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* This component is used to display the download confirmation dialog that presents to a user the number of files and the
|
|
11
|
-
* total size of the files they are about to add to their download
|
|
11
|
+
* total size of the files they are about to add to their download list.
|
|
12
12
|
*/
|
|
13
13
|
export declare function DownloadConfirmationUI(props: DownloadConfirmationUIProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default DownloadConfirmationUI;
|
|
@@ -13,7 +13,7 @@ import "../../utils/PermissionLevelToAccessType.js";
|
|
|
13
13
|
import { useMemo as y } from "react";
|
|
14
14
|
import { useSynapseContext as h } from "../../utils/context/SynapseContext.js";
|
|
15
15
|
import "use-deep-compare-effect";
|
|
16
|
-
import { Alert as w, Box as T, Button as u, Typography as
|
|
16
|
+
import { Alert as w, Box as T, Button as u, Typography as m } from "@mui/material";
|
|
17
17
|
import "../../utils/hooks/useCookiePreferences.js";
|
|
18
18
|
import "../../utils/hooks/useSourceAppConfigs.js";
|
|
19
19
|
import "universal-cookie";
|
|
@@ -34,21 +34,21 @@ import g from "./DownloadDetails.js";
|
|
|
34
34
|
const r = {
|
|
35
35
|
2: {
|
|
36
36
|
severity: "info",
|
|
37
|
-
infoText: "Would you like to add these files to the download
|
|
37
|
+
infoText: "Would you like to add these files to the download list?",
|
|
38
38
|
closeText: "Cancel"
|
|
39
39
|
},
|
|
40
40
|
3: {
|
|
41
41
|
severity: "info",
|
|
42
42
|
infoText: /* @__PURE__ */ n(o, { children: [
|
|
43
|
-
"Note: Files that you add will be mixed in with the files already in your download
|
|
43
|
+
"Note: Files that you add will be mixed in with the files already in your download list.",
|
|
44
44
|
/* @__PURE__ */ t("br", {}),
|
|
45
|
-
"If you don't want to mix these files, clear your download
|
|
45
|
+
"If you don't want to mix these files, clear your download list before continuing."
|
|
46
46
|
] }),
|
|
47
47
|
closeText: "Cancel"
|
|
48
48
|
},
|
|
49
49
|
1: {
|
|
50
50
|
severity: "info",
|
|
51
|
-
infoText: "Adding files to download
|
|
51
|
+
infoText: "Adding files to download list",
|
|
52
52
|
closeText: "Cancel"
|
|
53
53
|
},
|
|
54
54
|
0: {
|
|
@@ -62,50 +62,50 @@ const r = {
|
|
|
62
62
|
infoText: /* @__PURE__ */ n(o, { children: [
|
|
63
63
|
"Please ",
|
|
64
64
|
/* @__PURE__ */ t(v, {}),
|
|
65
|
-
" to add files to your download
|
|
65
|
+
" to add files to your download list."
|
|
66
66
|
] })
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
function S(
|
|
70
|
-
const { status: i, fileCount:
|
|
69
|
+
function S(l) {
|
|
70
|
+
const { status: i, fileCount: s, fileSize: a } = l;
|
|
71
71
|
switch (i) {
|
|
72
72
|
case 0:
|
|
73
73
|
case 1:
|
|
74
74
|
return /* @__PURE__ */ n(o, { children: [
|
|
75
75
|
/* @__PURE__ */ t("div", { className: "spinner white" }),
|
|
76
|
-
/* @__PURE__ */ t(
|
|
76
|
+
/* @__PURE__ */ t(m, { variant: "smallText1", children: r[i].infoText })
|
|
77
77
|
] });
|
|
78
78
|
case 4:
|
|
79
|
-
return /* @__PURE__ */ t(
|
|
79
|
+
return /* @__PURE__ */ t(m, { variant: "smallText1", children: r[i].infoText });
|
|
80
80
|
case 2:
|
|
81
81
|
case 3:
|
|
82
82
|
return /* @__PURE__ */ n(o, { children: [
|
|
83
83
|
/* @__PURE__ */ t(
|
|
84
84
|
g,
|
|
85
85
|
{
|
|
86
|
-
numFiles:
|
|
87
|
-
numBytes:
|
|
86
|
+
numFiles: s,
|
|
87
|
+
numBytes: a
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
/* @__PURE__ */ t(
|
|
90
|
+
/* @__PURE__ */ t(m, { variant: "smallText1", sx: { flexGrow: 1 }, children: r[i].infoText })
|
|
91
91
|
] });
|
|
92
92
|
default:
|
|
93
93
|
return /* @__PURE__ */ t(o, {});
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function it(
|
|
96
|
+
function it(l) {
|
|
97
97
|
const {
|
|
98
98
|
onAddToDownloadCart: i,
|
|
99
|
-
onCancel:
|
|
100
|
-
fileCount:
|
|
99
|
+
onCancel: s,
|
|
100
|
+
fileCount: a,
|
|
101
101
|
fileSize: x,
|
|
102
|
-
isLoadingStats:
|
|
102
|
+
isLoadingStats: c = !1,
|
|
103
103
|
isAddingToDownloadCart: f = !1
|
|
104
|
-
} =
|
|
104
|
+
} = l, { isAuthenticated: p } = h(), { data: d } = C(), e = y(() => p ? c ? 0 : f ? 1 : d && d.totalNumberOfFiles > 0 ? 3 : 2 : 4, [
|
|
105
105
|
p,
|
|
106
|
-
|
|
106
|
+
c,
|
|
107
107
|
f,
|
|
108
|
-
|
|
108
|
+
d
|
|
109
109
|
]);
|
|
110
110
|
return /* @__PURE__ */ t(o, { children: /* @__PURE__ */ t(
|
|
111
111
|
w,
|
|
@@ -121,7 +121,7 @@ function it(a) {
|
|
|
121
121
|
severity: r[e].severity,
|
|
122
122
|
className: "download-confirmation",
|
|
123
123
|
action: /* @__PURE__ */ n(o, { children: [
|
|
124
|
-
e !== 1 && /* @__PURE__ */ t(u, { variant: "text", color: "primary", onClick:
|
|
124
|
+
e !== 1 && /* @__PURE__ */ t(u, { variant: "text", color: "primary", onClick: s, children: r[e].closeText }),
|
|
125
125
|
(e === 2 || e === 3) && /* @__PURE__ */ t(
|
|
126
126
|
u,
|
|
127
127
|
{
|
|
@@ -147,7 +147,7 @@ function it(a) {
|
|
|
147
147
|
S,
|
|
148
148
|
{
|
|
149
149
|
status: e,
|
|
150
|
-
fileCount:
|
|
150
|
+
fileCount: a,
|
|
151
151
|
fileSize: x
|
|
152
152
|
}
|
|
153
153
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadConfirmationUI.js","sources":["../../../src/components/download_list/DownloadConfirmationUI.tsx"],"sourcesContent":["import { useGetDownloadListStatistics } from '@/synapse-queries'\nimport { useSynapseContext } from '@/utils'\nimport { Alert, AlertProps, Box, Button, Typography } from '@mui/material'\nimport { ReactNode, useMemo } from 'react'\nimport SignInButton from '../SignInButton'\nimport DownloadDetails from './DownloadDetails'\n\nenum StatusEnum {\n LOADING_INFO,\n PROCESSING,\n INFO,\n INFO_ITEMS_IN_LIST,\n SIGNED_OUT,\n}\n\nexport type DownloadConfirmationUIProps = {\n onAddToDownloadCart: () => void\n fileCount?: number\n fileSize?: number\n onCancel: () => void\n isLoadingStats?: boolean\n isAddingToDownloadCart?: boolean\n}\n\ntype UiStateDictionary = {\n [key: string]: {\n severity: AlertProps['severity']\n infoText: string | ReactNode\n closeText: string\n }\n}\n\n// css classes, text, and close button text associated with different stages\nconst StatusConstruct: UiStateDictionary = {\n [StatusEnum.INFO]: {\n severity: 'info',\n infoText: 'Would you like to add these files to the download
|
|
1
|
+
{"version":3,"file":"DownloadConfirmationUI.js","sources":["../../../src/components/download_list/DownloadConfirmationUI.tsx"],"sourcesContent":["import { useGetDownloadListStatistics } from '@/synapse-queries'\nimport { useSynapseContext } from '@/utils'\nimport { Alert, AlertProps, Box, Button, Typography } from '@mui/material'\nimport { ReactNode, useMemo } from 'react'\nimport SignInButton from '../SignInButton'\nimport DownloadDetails from './DownloadDetails'\n\nenum StatusEnum {\n LOADING_INFO,\n PROCESSING,\n INFO,\n INFO_ITEMS_IN_LIST,\n SIGNED_OUT,\n}\n\nexport type DownloadConfirmationUIProps = {\n onAddToDownloadCart: () => void\n fileCount?: number\n fileSize?: number\n onCancel: () => void\n isLoadingStats?: boolean\n isAddingToDownloadCart?: boolean\n}\n\ntype UiStateDictionary = {\n [key: string]: {\n severity: AlertProps['severity']\n infoText: string | ReactNode\n closeText: string\n }\n}\n\n// css classes, text, and close button text associated with different stages\nconst StatusConstruct: UiStateDictionary = {\n [StatusEnum.INFO]: {\n severity: 'info',\n infoText: 'Would you like to add these files to the download list?',\n closeText: 'Cancel',\n },\n [StatusEnum.INFO_ITEMS_IN_LIST]: {\n severity: 'info',\n infoText: (\n <>\n Note: Files that you add will be mixed in with the files already in your\n download list.\n <br />\n If you don't want to mix these files, clear your download list\n before continuing.\n </>\n ),\n closeText: 'Cancel',\n },\n [StatusEnum.PROCESSING]: {\n severity: 'info',\n infoText: 'Adding files to download list',\n closeText: 'Cancel',\n },\n\n [StatusEnum.LOADING_INFO]: {\n severity: 'info',\n infoText: 'Calculating file size',\n closeText: 'Cancel',\n },\n [StatusEnum.SIGNED_OUT]: {\n severity: 'error',\n closeText: 'Close',\n infoText: (\n <>\n Please <SignInButton /> to add files to your download list.\n </>\n ),\n },\n}\n\ntype DownloadConfirmationContentProps = {\n status: StatusEnum\n fileCount?: number\n fileSize?: number\n}\n\nfunction DownloadConfirmationContent(props: DownloadConfirmationContentProps) {\n const { status, fileCount, fileSize } = props\n switch (status) {\n case StatusEnum.LOADING_INFO:\n case StatusEnum.PROCESSING:\n return (\n <>\n <div className={'spinner white'} />\n <Typography variant={'smallText1'}>\n {StatusConstruct[status].infoText}\n </Typography>\n </>\n )\n\n case StatusEnum.SIGNED_OUT:\n return (\n <Typography variant={'smallText1'}>\n {StatusConstruct[status].infoText}\n </Typography>\n )\n case StatusEnum.INFO:\n case StatusEnum.INFO_ITEMS_IN_LIST:\n return (\n <>\n <DownloadDetails\n numFiles={fileCount}\n numBytes={fileSize}\n ></DownloadDetails>\n <Typography variant={'smallText1'} sx={{ flexGrow: 1 }}>\n {StatusConstruct[status].infoText}\n </Typography>\n </>\n )\n\n default:\n return <></>\n }\n}\n\n/**\n * This component is used to display the download confirmation dialog that presents to a user the number of files and the\n * total size of the files they are about to add to their download list.\n */\nexport function DownloadConfirmationUI(props: DownloadConfirmationUIProps) {\n const {\n onAddToDownloadCart,\n onCancel,\n fileCount,\n fileSize,\n isLoadingStats = false,\n isAddingToDownloadCart = false,\n } = props\n const { isAuthenticated } = useSynapseContext()\n\n const { data: downloadListStatistics } = useGetDownloadListStatistics()\n\n const status = useMemo(() => {\n if (!isAuthenticated) return StatusEnum.SIGNED_OUT\n if (isLoadingStats) return StatusEnum.LOADING_INFO\n if (isAddingToDownloadCart) return StatusEnum.PROCESSING\n if (downloadListStatistics && downloadListStatistics.totalNumberOfFiles > 0)\n return StatusEnum.INFO_ITEMS_IN_LIST\n return StatusEnum.INFO\n }, [\n isAuthenticated,\n isLoadingStats,\n isAddingToDownloadCart,\n downloadListStatistics,\n ])\n\n return (\n <>\n <Alert\n sx={{\n pr: 4,\n py: 1,\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n }}\n icon={StatusConstruct[status].severity === 'error' ? undefined : false}\n severity={StatusConstruct[status].severity}\n className={`download-confirmation`}\n action={\n <>\n {status !== StatusEnum.PROCESSING && (\n <Button variant=\"text\" color=\"primary\" onClick={onCancel}>\n {StatusConstruct[status].closeText}\n </Button>\n )}\n\n {(status === StatusEnum.INFO ||\n status === StatusEnum.INFO_ITEMS_IN_LIST) && (\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => {\n onAddToDownloadCart()\n }}\n sx={{ ml: '5px' }}\n >\n Add\n </Button>\n )}\n </>\n }\n >\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n gap: 1,\n }}\n >\n <DownloadConfirmationContent\n status={status}\n fileCount={fileCount}\n fileSize={fileSize}\n />\n </Box>\n </Alert>\n </>\n )\n}\n\nexport default DownloadConfirmationUI\n"],"names":["StatusConstruct","jsxs","Fragment","SignInButton","DownloadConfirmationContent","props","status","fileCount","fileSize","jsx","Typography","DownloadDetails","DownloadConfirmationUI","onAddToDownloadCart","onCancel","isLoadingStats","isAddingToDownloadCart","isAuthenticated","useSynapseContext","downloadListStatistics","useGetDownloadListStatistics","useMemo","Alert","Button","Box"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAMA,IAAqC;AAAA,EACxC,GAAkB;AAAA,IACjB,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,EAAA;AAAA,EAEZ,GAAgC;AAAA,IAC/B,UAAU;AAAA,IACV,UACE,gBAAAC,EAAAC,GAAA,EAAE,UAAA;AAAA,MAAA;AAAA,wBAGC,MAAA,EAAG;AAAA,MAAE;AAAA,IAAA,GAGR;AAAA,IAEF,WAAW;AAAA,EAAA;AAAA,EAEZ,GAAwB;AAAA,IACvB,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,EAAA;AAAA,EAGZ,GAA0B;AAAA,IACzB,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,EAAA;AAAA,EAEZ,GAAwB;AAAA,IACvB,UAAU;AAAA,IACV,WAAW;AAAA,IACX,UACE,gBAAAD,EAAAC,GAAA,EAAE,UAAA;AAAA,MAAA;AAAA,wBACQC,GAAA,EAAa;AAAA,MAAE;AAAA,IAAA,EAAA,CACzB;AAAA,EAAA;AAGN;AAQA,SAASC,EAA4BC,GAAyC;AAC5E,QAAM,EAAE,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,EAAA,IAAaH;AACxC,UAAQC,GAAA;AAAA,IACN,KAAK;AAAA,IACL,KAAK;AACH,aACE,gBAAAL,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAO,EAAC,OAAA,EAAI,WAAW,gBAAA,CAAiB;AAAA,0BAChCC,GAAA,EAAW,SAAS,cAClB,UAAAV,EAAgBM,CAAM,EAAE,SAAA,CAC3B;AAAA,MAAA,GACF;AAAA,IAGJ,KAAK;AACH,+BACGI,GAAA,EAAW,SAAS,cAClB,UAAAV,EAAgBM,CAAM,EAAE,UAC3B;AAAA,IAEJ,KAAK;AAAA,IACL,KAAK;AACH,aACE,gBAAAL,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAO;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,UAAUJ;AAAA,YACV,UAAUC;AAAA,UAAA;AAAA,QAAA;AAAA,QAEZ,gBAAAC,EAACC,GAAA,EAAW,SAAS,cAAc,IAAI,EAAE,UAAU,EAAA,GAChD,UAAAV,EAAgBM,CAAM,EAAE,SAAA,CAC3B;AAAA,MAAA,GACF;AAAA,IAGJ;AACE,aAAO,gBAAAG,EAAAP,GAAA,EAAE;AAAA,EAAA;AAEf;AAMO,SAASU,GAAuBP,GAAoC;AACzE,QAAM;AAAA,IACJ,qBAAAQ;AAAA,IACA,UAAAC;AAAA,IACA,WAAAP;AAAA,IACA,UAAAC;AAAA,IACA,gBAAAO,IAAiB;AAAA,IACjB,wBAAAC,IAAyB;AAAA,EAAA,IACvBX,GACE,EAAE,iBAAAY,EAAA,IAAoBC,EAAA,GAEtB,EAAE,MAAMC,EAAA,IAA2BC,EAAA,GAEnCd,IAASe,EAAQ,MAChBJ,IACDF,IAAuB,IACvBC,IAA+B,IAC/BG,KAA0BA,EAAuB,qBAAqB,IACjE,IACF,IALsB,GAM5B;AAAA,IACDF;AAAA,IACAF;AAAA,IACAC;AAAA,IACAG;AAAA,EAAA,CACD;AAED,SACE,gBAAAV,EAAAP,GAAA,EACE,UAAA,gBAAAO;AAAA,IAACa;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,QACF,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,gBAAgB;AAAA,QAChB,YAAY;AAAA,MAAA;AAAA,MAEd,MAAMtB,EAAgBM,CAAM,EAAE,aAAa,UAAU,SAAY;AAAA,MACjE,UAAUN,EAAgBM,CAAM,EAAE;AAAA,MAClC,WAAW;AAAA,MACX,QACE,gBAAAL,EAAAC,GAAA,EACG,UAAA;AAAA,QAAAI,MAAW,KACV,gBAAAG,EAACc,GAAA,EAAO,SAAQ,QAAO,OAAM,WAAU,SAAST,GAC7C,UAAAd,EAAgBM,CAAM,EAAE,WAC3B;AAAA,SAGAA,MAAW,KACXA,MAAW,MACX,gBAAAG;AAAA,UAACc;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,SAAS,MAAM;AACb,cAAAV,EAAA;AAAA,YACF;AAAA,YACA,IAAI,EAAE,IAAI,MAAA;AAAA,YACX,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAED,GAEJ;AAAA,MAGF,UAAA,gBAAAJ;AAAA,QAACe;AAAA,QAAA;AAAA,UACC,IAAI;AAAA,YACF,SAAS;AAAA,YACT,YAAY;AAAA,YACZ,KAAK;AAAA,UAAA;AAAA,UAGP,UAAA,gBAAAf;AAAA,YAACL;AAAA,YAAA;AAAA,cACC,QAAAE;AAAA,cACA,WAAAC;AAAA,cACA,UAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { displayToast as
|
|
1
|
+
import { displayToast as s } from "../ToastMessage/ToastMessage.js";
|
|
2
2
|
function i(o) {
|
|
3
|
-
|
|
4
|
-
"File(s) were successfully added to your Download
|
|
3
|
+
s(
|
|
4
|
+
"File(s) were successfully added to your Download List.",
|
|
5
5
|
"success",
|
|
6
6
|
{
|
|
7
7
|
primaryButtonConfig: {
|
|
8
|
-
text: "View Download
|
|
8
|
+
text: "View Download List",
|
|
9
9
|
onClick: () => {
|
|
10
10
|
window.location.href = o;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadConfirmationUtils.js","sources":["../../../src/components/download_list/DownloadConfirmationUtils.ts"],"sourcesContent":["import { displayToast } from '../ToastMessage'\n\nexport function displayFilesWereAddedToDownloadListSuccess(\n downloadCartPageUrl: string,\n) {\n displayToast(\n 'File(s) were successfully added to your Download
|
|
1
|
+
{"version":3,"file":"DownloadConfirmationUtils.js","sources":["../../../src/components/download_list/DownloadConfirmationUtils.ts"],"sourcesContent":["import { displayToast } from '../ToastMessage'\n\nexport function displayFilesWereAddedToDownloadListSuccess(\n downloadCartPageUrl: string,\n) {\n displayToast(\n 'File(s) were successfully added to your Download List.',\n 'success',\n {\n primaryButtonConfig: {\n text: 'View Download List',\n onClick: () => {\n window.location.href = downloadCartPageUrl\n },\n },\n },\n )\n}\n"],"names":["displayFilesWereAddedToDownloadListSuccess","downloadCartPageUrl","displayToast"],"mappings":";AAEO,SAASA,EACdC,GACA;AACA,EAAAC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,MACE,qBAAqB;AAAA,QACnB,MAAM;AAAA,QACN,SAAS,MAAM;AACb,iBAAO,SAAS,OAAOD;AAAA,QACzB;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;"}
|