synapse-react-client 4.0.34 → 4.0.35
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/curie-head.svg +21 -0
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts +24 -2
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js +108 -106
- package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +26 -25
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts +6 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +55 -54
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
- package/dist/components/DraggableDialog/DraggableDialog.d.ts +2 -1
- package/dist/components/DraggableDialog/DraggableDialog.d.ts.map +1 -1
- package/dist/components/DraggableDialog/DraggableDialog.js +42 -33
- package/dist/components/DraggableDialog/DraggableDialog.js.map +1 -1
- package/dist/components/EntityTreeTable/hooks/useTableColumns.d.ts.map +1 -1
- package/dist/components/EntityTreeTable/hooks/useTableColumns.js +12 -6
- package/dist/components/EntityTreeTable/hooks/useTableColumns.js.map +1 -1
- package/dist/components/ExperimentalMode/ExperimentalMode.js +2 -1
- package/dist/components/ExperimentalMode/ExperimentalMode.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +64 -55
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/StorybookComponentWrapper.d.ts.map +1 -1
- package/dist/components/StorybookComponentWrapper.js +15 -10
- package/dist/components/StorybookComponentWrapper.js.map +1 -1
- package/dist/components/SynapseChat/GridAgentChat.js +6 -6
- package/dist/components/SynapseChat/SynapseChat.d.ts +2 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.js +118 -74
- package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.d.ts +3 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChatInteraction.js +21 -21
- 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 +9 -8
- package/dist/components/SynapseChat/SynapseChatMessage.js.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js +2 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js.map +1 -1
- package/dist/components/TanStackTable/TanStackTableUtils.d.ts.map +1 -1
- package/dist/components/TanStackTable/TanStackTableUtils.js +6 -6
- package/dist/components/TanStackTable/TanStackTableUtils.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts +12 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +84 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js +20 -18
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPage.js.map +1 -1
- package/dist/components/entity/page/CreatedByModifiedBy.d.ts.map +1 -1
- package/dist/components/entity/page/CreatedByModifiedBy.js +43 -61
- package/dist/components/entity/page/CreatedByModifiedBy.js.map +1 -1
- package/dist/components/entity/page/createdByModifiedByTooltips.d.ts +7 -0
- package/dist/components/entity/page/createdByModifiedByTooltips.d.ts.map +1 -0
- package/dist/components/entity/page/createdByModifiedByTooltips.js +36 -0
- package/dist/components/entity/page/createdByModifiedByTooltips.js.map +1 -0
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +130 -65
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
- package/dist/components/widgets/Range.js +8 -2
- package/dist/components/widgets/Range.js.map +1 -1
- package/dist/components/widgets/query-filter/RangeFacetFilter.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/RangeFacetFilter.js +2 -1
- package/dist/components/widgets/query-filter/RangeFacetFilter.js.map +1 -1
- package/dist/components/widgets/query-filter/RangeFacetFilterUI.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/RangeFacetFilterUI.js +19 -19
- package/dist/components/widgets/query-filter/RangeFacetFilterUI.js.map +1 -1
- package/dist/mocks/msw/handlers/fileHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/fileHandlers.js +22 -22
- package/dist/mocks/msw/handlers/fileHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/userProfileHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/userProfileHandlers.js +36 -36
- package/dist/mocks/msw/handlers/userProfileHandlers.js.map +1 -1
- package/dist/mocks/user/mock_user_profile.d.ts +1 -0
- package/dist/mocks/user/mock_user_profile.d.ts.map +1 -1
- package/dist/mocks/user/mock_user_profile.js +45 -45
- package/dist/mocks/user/mock_user_profile.js.map +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +1 -0
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +3 -0
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +4 -4
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts +13 -1
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js +67 -49
- package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
- package/dist/synapse-queries/index.js +185 -184
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/APIConstants.d.ts +1 -0
- package/dist/utils/APIConstants.d.ts.map +1 -1
- package/dist/utils/APIConstants.js +2 -2
- package/dist/utils/APIConstants.js.map +1 -1
- package/dist/utils/AppUtils/session/ApplicationSessionManager.d.ts.map +1 -1
- package/dist/utils/AppUtils/session/ApplicationSessionManager.js +20 -19
- package/dist/utils/AppUtils/session/ApplicationSessionManager.js.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts +1 -0
- 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/functions/RegularExpressions.d.ts +7 -0
- package/dist/utils/functions/RegularExpressions.d.ts.map +1 -1
- package/dist/utils/functions/RegularExpressions.js +5 -4
- package/dist/utils/functions/RegularExpressions.js.map +1 -1
- package/dist/utils/hooks/useIsHydrated.d.ts +9 -0
- package/dist/utils/hooks/useIsHydrated.d.ts.map +1 -0
- package/dist/utils/hooks/useIsHydrated.js +10 -0
- package/dist/utils/hooks/useIsHydrated.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureStatusStep.js","names":[],"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.tsx"],"sourcesContent":["import {\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useGetDataAccessRequestSignatureStatus,\n useGetDataAccessRequestSignedFileHandleId,\n useSubmitDataAccessRequest,\n useUpdateDataAccessRequest,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport { PRODUCTION_ENDPOINT_CONFIG } from '@/utils/functions/getEndpoint'\nimport {\n CheckCircleOutline,\n HourglassEmpty,\n OpenInNew,\n Refresh,\n} from '@mui/icons-material'\nimport {\n Alert,\n Box,\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Link,\n Skeleton,\n Stack,\n Typography,\n} from '@mui/material'\nimport { EDucSignerStatus } from '@sage-bionetworks/synapse-client'\nimport {\n ManagedACTAccessRequirement,\n RestrictableObjectType,\n} from '@sage-bionetworks/synapse-types'\nimport { useState } from 'react'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport { longFieldLabelSx } from '../styles'\n\nexport type SignatureStatusStepProps = {\n managedACTAccessRequirement: ManagedACTAccessRequirement\n subjectId: string\n subjectType: RestrictableObjectType\n onHide: () => void\n onBackClicked: () => void\n onSubmissionCreated: (submissionId: string) => void\n /**\n * Optional href override for the \"View DUC\" link. When set, the preview file handle fetch\n * is skipped and this URL is used directly. Used by stories and tests where the portal\n * servlet is not available.\n */\n viewDucHrefOverride?: string\n}\n\n/**\n * Wizard step shown after the user has routed the eDUC for electronic signature\n * (PORTALS-4380). Polls the DocuSign envelope status, lists the pending signers,\n * and enables submission once every signer has signed.\n */\nexport default function SignatureStatusStep(props: SignatureStatusStepProps) {\n const {\n managedACTAccessRequirement,\n subjectId,\n subjectType,\n onHide,\n onBackClicked,\n onSubmissionCreated,\n viewDucHrefOverride,\n } = props\n\n const { data: dataAccessRequest, isLoading: isLoadingDar } =\n useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n staleTime: Infinity,\n throwOnError: true,\n })\n\n const requestId = dataAccessRequest?.id ?? ''\n\n const {\n data: signatureStatus,\n isLoading: isLoadingStatus,\n isRefetching: isRefetchingStatus,\n error: statusError,\n refetch: refetchStatus,\n } = useGetDataAccessRequestSignatureStatus(requestId, {\n enabled: Boolean(requestId),\n })\n\n const signers: EDucSignerStatus[] = signatureStatus?.signerStatus ?? []\n const collectedCount = signers.filter(s => s.status === 'done').length\n const totalCount = signers.length\n const allCollected = totalCount > 0 && collectedCount === totalCount\n const outstandingSigners = signers.filter(s => s.status !== 'done')\n\n const { data: previewFileHandle } = useGetDataAccessRequestPreview(\n requestId,\n { enabled: Boolean(requestId) && !viewDucHrefOverride },\n )\n const viewDucHref =\n viewDucHrefOverride ??\n (previewFileHandle?.fileHandleId\n ? SynapseClient.getPortalFileHandleServletUrl(\n previewFileHandle.fileHandleId,\n )\n : undefined)\n\n const { data: signedFileHandle } = useGetDataAccessRequestSignedFileHandleId(\n requestId,\n { enabled: Boolean(requestId) && allCollected },\n )\n\n const [updateDarError, setUpdateDarError] = useState<string | undefined>()\n const [submitDarError, setSubmitDarError] = useState<string | undefined>()\n\n const { mutateAsync: updateDarAsync, isPending: isUpdating } =\n useUpdateDataAccessRequest({\n onError: e => setUpdateDarError(e.reason),\n })\n\n const { mutate: submit, isPending: isSubmitting } =\n useSubmitDataAccessRequest({\n onSuccess: submission => onSubmissionCreated(submission.submissionId),\n onError: e => setSubmitDarError(e.reason),\n })\n\n const isSubmitDisabled =\n isLoadingDar ||\n isLoadingStatus ||\n isRefetchingStatus ||\n !dataAccessRequest ||\n !allCollected ||\n !signedFileHandle?.fileHandleId ||\n isUpdating ||\n isSubmitting\n\n const handleSubmit = async () => {\n if (!dataAccessRequest || !signedFileHandle?.fileHandleId) return\n setUpdateDarError(undefined)\n setSubmitDarError(undefined)\n const updated = await updateDarAsync({\n ...dataAccessRequest,\n ducFileHandleId: signedFileHandle.fileHandleId,\n }).catch(() => null)\n if (!updated) return\n submit({\n request: {\n requestId: updated.id,\n requestEtag: updated.etag,\n subjectId,\n subjectType,\n },\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\n }\n\n return (\n <>\n <DialogTitle>\n <Stack direction=\"row\" sx={{ alignItems: 'center', gap: '5px' }}>\n Request Access\n <Box sx={{ flexGrow: 1 }} />\n <IconButton aria-label={'Close'} onClick={onHide}>\n <IconSvg icon={'close'} wrap={false} sx={{ color: 'grey.700' }} />\n </IconButton>\n </Stack>\n </DialogTitle>\n <DialogContent>\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Sign a Data Use Certificate (DUC)\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n Your DUC has been emailed to your Collaborators. Once all signatures\n (including the Signing Official) have been collected, you can submit\n the Data Access Request.\n </Typography>\n {/* TODO: restore once the backend precheck allows editing collaborators mid-signature (PORTALS-4380 notes).\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 3 }}>\n You can update the list of Collaborators by pressing{' '}\n <strong>Back</strong>.\n </Typography>\n */}\n\n {isLoadingStatus && (\n <Skeleton\n variant={'rectangular'}\n width={'100%'}\n height={120}\n data-testid={'SignatureStatusStep-loading'}\n />\n )}\n\n {statusError && (\n <Alert severity={'error'}>\n <strong>\n Sorry, we couldn't load the current signature status.\n </strong>\n <br />\n {statusError.reason}\n </Alert>\n )}\n\n {!isLoadingStatus && !statusError && signatureStatus && (\n <>\n <Stack\n direction={'row'}\n sx={{ alignItems: 'center', gap: 1, mb: 1 }}\n >\n {allCollected ? (\n <CheckCircleOutline color={'success'} />\n ) : (\n <HourglassEmpty sx={{ color: 'grey.700' }} />\n )}\n <Typography variant={'body1'} sx={{ fontWeight: 700 }}>\n {allCollected\n ? 'All signatures collected.'\n : `${collectedCount} out of ${totalCount} signatures collected.`}\n </Typography>\n <Box sx={{ flexGrow: 1 }} />\n {viewDucHref && (\n <Link\n href={viewDucHref}\n target={'_blank'}\n rel={'noopener'}\n sx={{\n display: 'inline-flex',\n alignItems: 'center',\n gap: 0.5,\n }}\n >\n View DUC\n <OpenInNew fontSize={'small'} />\n </Link>\n )}\n </Stack>\n\n {outstandingSigners.length > 0 && (\n <>\n <Typography variant={'body1'} sx={{ mb: 1 }}>\n You're still waiting for signatures from\n </Typography>\n <Box component={'ul'} sx={{ mt: 0, mb: 2, pl: 3 }}>\n {outstandingSigners.map((signer, index) => (\n <li key={signer.userId ?? `${signer.name}-${index}`}>\n <SignerLine signer={signer} />\n </li>\n ))}\n </Box>\n </>\n )}\n\n <Button\n variant={'outlined'}\n startIcon={<Refresh />}\n loading={isRefetchingStatus}\n onClick={() => {\n refetchStatus()\n }}\n >\n Refresh\n </Button>\n </>\n )}\n\n {updateDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't save your change.</strong>\n <br />\n {updateDarError}\n </Alert>\n )}\n {submitDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't submit your request.</strong>\n <br />\n {submitDarError}\n </Alert>\n )}\n </DialogContent>\n <DialogActions>\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n <Box sx={{ flexGrow: 1 }} />\n <Button\n variant={'contained'}\n disabled={isSubmitDisabled}\n loading={isSubmitting}\n onClick={() => {\n handleSubmit()\n }}\n >\n Submit\n </Button>\n </DialogActions>\n </>\n )\n}\n\nfunction SignerLine(props: { signer: EDucSignerStatus }) {\n const { signer } = props\n const displayName = signer.name ?? 'Unnamed signer'\n const nameNode = signer.userId ? (\n <Link\n href={`${PRODUCTION_ENDPOINT_CONFIG.PORTAL}Profile:${signer.userId}`}\n target={'_blank'}\n rel={'noopener'}\n >\n {displayName}\n </Link>\n ) : (\n <>{displayName}</>\n )\n // Only surface non-pending problem states inline; pending is implied by the section header.\n const statusLabel =\n signer.status && signer.status !== 'pending' && signer.status !== 'done'\n ? ` (${signer.status})`\n : ''\n return (\n <Typography variant={'body1'} component={'span'}>\n {nameNode}\n {statusLabel}\n </Typography>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AA0DA,SAAwB,EAAoB,GAAiC;CAC3E,IAAM,EACJ,gCACA,cACA,gBACA,YACA,mBACA,yBACA,2BACE,GAEE,EAAE,MAAM,GAAmB,WAAW,MAC1C,EAAiC,OAAO,EAA4B,EAAE,GAAG;EACvE,WAAW;EACX,cAAc;CAChB,CAAC,GAEG,IAAY,GAAmB,MAAM,IAErC,EACJ,MAAM,GACN,WAAW,GACX,cAAc,GACd,OAAO,GACP,SAAS,MACP,EAAuC,GAAW,EACpD,SAAS,EAAQ,EACnB,CAAC,GAEK,IAA8B,GAAiB,gBAAgB,CAAC,GAChE,IAAiB,EAAQ,QAAO,MAAK,EAAE,WAAW,MAAM,EAAE,QAC1D,IAAa,EAAQ,QACrB,IAAe,IAAa,KAAK,MAAmB,GACpD,IAAqB,EAAQ,QAAO,MAAK,EAAE,WAAW,MAAM,GAE5D,EAAE,MAAM,MAAsB,EAClC,GACA,EAAE,SAAS,EAAQ,KAAc,CAAC,EAAoB,CACxD,GACM,IACJ,MACC,GAAmB,eAChB,EAAc,8BACZ,EAAkB,YACpB,IACA,KAAA,IAEA,EAAE,MAAM,MAAqB,EACjC,GACA,EAAE,SAAS,EAAQ,KAAc,EAAa,CAChD,GAEM,CAAC,GAAgB,KAAqB,E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"sources":["../../../../../src/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.tsx"],"sourcesContent":["import {\n useGetDataAccessRequestForUpdate,\n useGetDataAccessRequestPreview,\n useGetDataAccessRequestSignatureStatus,\n useGetDataAccessRequestSignedFileHandleId,\n useSubmitDataAccessRequest,\n useUpdateDataAccessRequest,\n} from '@/synapse-queries'\nimport SynapseClient from '@/synapse-client'\nimport { PRODUCTION_ENDPOINT_CONFIG } from '@/utils/functions/getEndpoint'\nimport {\n CheckCircleOutline,\n HourglassEmpty,\n OpenInNew,\n Refresh,\n} from '@mui/icons-material'\nimport {\n Alert,\n Box,\n Button,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Link,\n Skeleton,\n Stack,\n Typography,\n} from '@mui/material'\nimport { EDucSignerStatus } from '@sage-bionetworks/synapse-client'\nimport {\n FileHandleAssociateType,\n ManagedACTAccessRequirement,\n RestrictableObjectType,\n} from '@sage-bionetworks/synapse-types'\nimport { useState } from 'react'\nimport IconSvg from '../../../IconSvg/IconSvg'\nimport { longFieldLabelSx } from '../styles'\n\nexport type SignatureStatusStepProps = {\n managedACTAccessRequirement: ManagedACTAccessRequirement\n subjectId: string\n subjectType: RestrictableObjectType\n onHide: () => void\n /**\n * Called when the user clicks the Back button. When omitted, the Back button is hidden —\n * used when the step is reached via direct entry (e.g. a deep-link route) rather than\n * through the wizard flow, so there is no meaningful previous step to return to.\n */\n onBackClicked?: () => void\n onSubmissionCreated: (submissionId: string) => void\n /**\n * Optional href override for the \"View DUC\" link. When set, the preview file handle fetch\n * is skipped and this URL is used directly. Used by stories and tests where the portal\n * servlet is not available.\n */\n viewDucHrefOverride?: string\n}\n\n/**\n * Wizard step shown after the user has routed the eDUC for electronic signature\n * (PORTALS-4380). Polls the DocuSign envelope status, lists the pending signers,\n * and enables submission once every signer has signed.\n */\nexport default function SignatureStatusStep(props: SignatureStatusStepProps) {\n const {\n managedACTAccessRequirement,\n subjectId,\n subjectType,\n onHide,\n onBackClicked,\n onSubmissionCreated,\n viewDucHrefOverride,\n } = props\n\n const { data: dataAccessRequest, isLoading: isLoadingDar } =\n useGetDataAccessRequestForUpdate(String(managedACTAccessRequirement.id), {\n staleTime: Infinity,\n throwOnError: true,\n })\n\n const requestId = dataAccessRequest?.id ?? ''\n\n const {\n data: signatureStatus,\n isLoading: isLoadingStatus,\n isRefetching: isRefetchingStatus,\n error: statusError,\n refetch: refetchStatus,\n } = useGetDataAccessRequestSignatureStatus(requestId, {\n enabled: Boolean(requestId),\n })\n\n const signers: EDucSignerStatus[] = signatureStatus?.signerStatus ?? []\n const collectedCount = signers.filter(s => s.status === 'done').length\n const totalCount = signers.length\n const allCollected = totalCount > 0 && collectedCount === totalCount\n const outstandingSigners = signers.filter(s => s.status !== 'done')\n\n const { data: previewFileHandle } = useGetDataAccessRequestPreview(\n requestId,\n { enabled: Boolean(requestId) && !viewDucHrefOverride },\n )\n const viewDucHref =\n viewDucHrefOverride ??\n (previewFileHandle?.fileHandleId && requestId\n ? SynapseClient.getPortalFileHandleServletUrl(\n previewFileHandle.fileHandleId,\n requestId,\n FileHandleAssociateType.DataAccessRequestAttachment,\n )\n : undefined)\n\n const { data: signedFileHandle } = useGetDataAccessRequestSignedFileHandleId(\n requestId,\n { enabled: Boolean(requestId) && allCollected },\n )\n\n const [updateDarError, setUpdateDarError] = useState<string | undefined>()\n const [submitDarError, setSubmitDarError] = useState<string | undefined>()\n\n const { mutateAsync: updateDarAsync, isPending: isUpdating } =\n useUpdateDataAccessRequest({\n onError: e => setUpdateDarError(e.reason),\n })\n\n const { mutate: submit, isPending: isSubmitting } =\n useSubmitDataAccessRequest({\n onSuccess: submission => onSubmissionCreated(submission.submissionId),\n onError: e => setSubmitDarError(e.reason),\n })\n\n const isSubmitDisabled =\n isLoadingDar ||\n isLoadingStatus ||\n isRefetchingStatus ||\n !dataAccessRequest ||\n !allCollected ||\n !signedFileHandle?.fileHandleId ||\n isUpdating ||\n isSubmitting\n\n const handleSubmit = async () => {\n if (!dataAccessRequest || !signedFileHandle?.fileHandleId) return\n setUpdateDarError(undefined)\n setSubmitDarError(undefined)\n const updated = await updateDarAsync({\n ...dataAccessRequest,\n ducFileHandleId: signedFileHandle.fileHandleId,\n }).catch(() => null)\n if (!updated) return\n submit({\n request: {\n requestId: updated.id,\n requestEtag: updated.etag,\n subjectId,\n subjectType,\n },\n accessRequirementId: String(managedACTAccessRequirement.id),\n })\n }\n\n return (\n <>\n <DialogTitle>\n <Stack direction=\"row\" sx={{ alignItems: 'center', gap: '5px' }}>\n Request Access\n <Box sx={{ flexGrow: 1 }} />\n <IconButton aria-label={'Close'} onClick={onHide}>\n <IconSvg icon={'close'} wrap={false} sx={{ color: 'grey.700' }} />\n </IconButton>\n </Stack>\n </DialogTitle>\n <DialogContent>\n <Typography variant={'headline3'} sx={{ mb: 2 }}>\n Sign a Data Use Certificate (DUC)\n </Typography>\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 2 }}>\n Your DUC has been emailed to your Collaborators. Once all signatures\n (including the Signing Official) have been collected, you can submit\n the Data Access Request.\n </Typography>\n {/* TODO: restore once the backend precheck allows editing collaborators mid-signature (PORTALS-4380 notes).\n <Typography variant={'body1'} sx={{ ...longFieldLabelSx, mb: 3 }}>\n You can update the list of Collaborators by pressing{' '}\n <strong>Back</strong>.\n </Typography>\n */}\n\n {isLoadingStatus && (\n <Skeleton\n variant={'rectangular'}\n width={'100%'}\n height={120}\n data-testid={'SignatureStatusStep-loading'}\n />\n )}\n\n {statusError && (\n <Alert severity={'error'}>\n <strong>\n Sorry, we couldn't load the current signature status.\n </strong>\n <br />\n {statusError.reason}\n </Alert>\n )}\n\n {!isLoadingStatus && !statusError && signatureStatus && (\n <>\n <Stack\n direction={'row'}\n sx={{ alignItems: 'center', gap: 1, mb: 1 }}\n >\n {allCollected ? (\n <CheckCircleOutline color={'success'} />\n ) : (\n <HourglassEmpty sx={{ color: 'grey.700' }} />\n )}\n <Typography variant={'body1'} sx={{ fontWeight: 700 }}>\n {allCollected\n ? 'All signatures collected.'\n : `${collectedCount} out of ${totalCount} signatures collected.`}\n </Typography>\n <Box sx={{ flexGrow: 1 }} />\n {viewDucHref && (\n <Link\n href={viewDucHref}\n target={'_blank'}\n rel={'noopener'}\n sx={{\n display: 'inline-flex',\n alignItems: 'center',\n gap: 0.5,\n }}\n >\n View DUC\n <OpenInNew fontSize={'small'} />\n </Link>\n )}\n </Stack>\n\n {outstandingSigners.length > 0 && (\n <>\n <Typography variant={'body1'} sx={{ mb: 1 }}>\n You're still waiting for signatures from\n </Typography>\n <Box component={'ul'} sx={{ mt: 0, mb: 2, pl: 3 }}>\n {outstandingSigners.map((signer, index) => (\n <li key={signer.userId ?? `${signer.name}-${index}`}>\n <SignerLine signer={signer} />\n </li>\n ))}\n </Box>\n </>\n )}\n\n <Button\n variant={'outlined'}\n startIcon={<Refresh />}\n loading={isRefetchingStatus}\n onClick={() => {\n refetchStatus()\n }}\n >\n Refresh\n </Button>\n </>\n )}\n\n {updateDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't save your change.</strong>\n <br />\n {updateDarError}\n </Alert>\n )}\n {submitDarError && (\n <Alert severity={'error'} sx={{ mt: 2 }}>\n <strong>Sorry, we couldn't submit your request.</strong>\n <br />\n {submitDarError}\n </Alert>\n )}\n </DialogContent>\n <DialogActions>\n {onBackClicked && (\n <Button variant={'outlined'} onClick={onBackClicked}>\n Back\n </Button>\n )}\n <Box sx={{ flexGrow: 1 }} />\n <Button\n variant={'contained'}\n disabled={isSubmitDisabled}\n loading={isSubmitting}\n onClick={() => {\n handleSubmit()\n }}\n >\n Submit\n </Button>\n </DialogActions>\n </>\n )\n}\n\nfunction SignerLine(props: { signer: EDucSignerStatus }) {\n const { signer } = props\n const displayName = signer.name ?? 'Unnamed signer'\n const nameNode = signer.userId ? (\n <Link\n href={`${PRODUCTION_ENDPOINT_CONFIG.PORTAL}Profile:${signer.userId}`}\n target={'_blank'}\n rel={'noopener'}\n >\n {displayName}\n </Link>\n ) : (\n <>{displayName}</>\n )\n // Only surface non-pending problem states inline; pending is implied by the section header.\n const statusLabel =\n signer.status && signer.status !== 'pending' && signer.status !== 'done'\n ? ` (${signer.status})`\n : ''\n return (\n <Typography variant={'body1'} component={'span'}>\n {nameNode}\n {statusLabel}\n </Typography>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAgEA,SAAwB,EAAoB,GAAiC;CAC3E,IAAM,EACJ,gCACA,eACA,iBACA,YACA,kBACA,wBACA,2BACE,GAEE,EAAE,MAAM,GAAmB,WAAW,MAC1C,EAAiC,OAAO,EAA4B,EAAE,GAAG;EACvE,WAAW;EACX,cAAc;CAChB,CAAC,GAEG,IAAY,GAAmB,MAAM,IAErC,EACJ,MAAM,GACN,WAAW,GACX,cAAc,GACd,OAAO,GACP,SAAS,MACP,EAAuC,GAAW,EACpD,SAAS,EAAQ,EACnB,CAAC,GAEK,IAA8B,GAAiB,gBAAgB,CAAC,GAChE,IAAiB,EAAQ,QAAO,MAAK,EAAE,WAAW,MAAM,EAAE,QAC1D,IAAa,EAAQ,QACrB,IAAe,IAAa,KAAK,MAAmB,GACpD,IAAqB,EAAQ,QAAO,MAAK,EAAE,WAAW,MAAM,GAE5D,EAAE,MAAM,MAAsB,EAClC,GACA,EAAE,SAAS,EAAQ,KAAc,CAAC,EAAoB,CACxD,GACM,IACJ,MACC,GAAmB,gBAAgB,IAChC,EAAc,8BACZ,EAAkB,cAClB,GACA,EAAwB,2BAC1B,IACA,KAAA,IAEA,EAAE,MAAM,MAAqB,EACjC,GACA,EAAE,SAAS,EAAQ,KAAc,EAAa,CAChD,GAEM,CAAC,GAAgB,KAAqB,EAA6B,GACnE,CAAC,GAAgB,KAAqB,EAA6B,GAEnE,EAAE,aAAa,IAAgB,WAAW,OAC9C,EAA2B,EACzB,UAAS,MAAK,EAAkB,EAAE,MAAM,EAC1C,CAAC,GAEG,EAAE,QAAQ,IAAQ,WAAW,MACj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ACC,kBAAC,GAAD;IAAO,UAAU;IAAS,IAAI,EAAE,IAAI,EAAE;cAAtC;KACE,kBAAC,UAAD,EAAA,UAAQ,uCAAiD,CAAA;KACzD,kBAAC,MAAD,CAAK,CAAA;KACJ;IACI;;GAER,KACC,kBAAC,GAAD;IAAO,UAAU;IAAS,IAAI,EAAE,IAAI,EAAE;cAAtC;KACE,kBAAC,UAAD,EAAA,UAAQ,0CAAoD,CAAA;KAC5D,kBAAC,MAAD,CAAK,CAAA;KACJ;IACI;;EAEI,EAAA,CAAA;EACf,kBAAC,GAAD,EAAA,UAAA;GACG,KACC,kBAAC,GAAD;IAAQ,SAAS;IAAY,SAAS;cAAe;GAE7C,CAAA;GAEV,kBAAC,GAAD,EAAK,IAAI,EAAE,UAAU,EAAE,EAAI,CAAA;GAC3B,kBAAC,GAAD;IACE,SAAS;IACT,UAAU;IACV,SAAS;IACT,eAAe;KACb,GAAa;IACf;cACD;GAEO,CAAA;EACK,EAAA,CAAA;CACf,EAAA,CAAA;AAEN;AAEA,SAAS,EAAW,GAAqC;CACvD,IAAM,EAAE,cAAW,GACb,IAAc,EAAO,QAAQ;CAiBnC,OACE,kBAAC,GAAD;EAAY,SAAS;EAAS,WAAW;YAAzC,CAjBe,EAAO,SACtB,kBAAC,GAAD;GACE,MAAM,GAAG,EAA2B,OAAO,UAAU,EAAO;GAC5D,QAAQ;GACR,KAAK;aAEJ;EACG,CAAA,IAEN,kBAAA,GAAA,EAAA,UAAG,EAAc,CAAA,GAIjB,EAAO,UAAU,EAAO,WAAW,aAAa,EAAO,WAAW,SAC9D,KAAK,EAAO,OAAO,KACnB,EAKQ;;AAEhB"}
|
|
@@ -4,7 +4,8 @@ type DraggableDialogProps = {
|
|
|
4
4
|
onClose?: () => void;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
title?: ReactNode;
|
|
7
|
+
variant?: 'default' | 'curie';
|
|
7
8
|
};
|
|
8
|
-
export default function DraggableDialog({ open, onClose, title, children, }: DraggableDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export default function DraggableDialog({ open, onClose, title, children, variant, }: DraggableDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=DraggableDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableDialog.d.ts","sourceRoot":"","sources":["../../../src/components/DraggableDialog/DraggableDialog.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAU,SAAS,EAAuB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"DraggableDialog.d.ts","sourceRoot":"","sources":["../../../src/components/DraggableDialog/DraggableDialog.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAU,SAAS,EAAuB,MAAM,OAAO,CAAA;AAM9D,KAAK,oBAAoB,GAAG;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;CAC9B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,IAAY,EACZ,OAAO,EACP,KAAK,EACL,QAAQ,EACR,OAAmB,GACpB,EAAE,oBAAoB,kDAwItB"}
|
|
@@ -6,13 +6,14 @@ import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
|
6
6
|
import g from "@mui/icons-material/Close";
|
|
7
7
|
import _ from "react-draggable";
|
|
8
8
|
//#region src/components/DraggableDialog/DraggableDialog.tsx
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
var v = 700;
|
|
10
|
+
function y({ open: y = !1, onClose: b, title: x, children: S, variant: C = "default" }) {
|
|
11
|
+
let w = p(), T = f(w.breakpoints.down("sm")), E = r(null), [D, O] = i(), [k, A] = i({
|
|
11
12
|
x: 100,
|
|
12
|
-
y: 100
|
|
13
|
-
}), { width:
|
|
13
|
+
y: C === "curie" ? 50 : 100
|
|
14
|
+
}), { width: j, height: M, handleResizeStart: N } = e({
|
|
14
15
|
initialWidth: 600,
|
|
15
|
-
initialHeight: 500,
|
|
16
|
+
initialHeight: C === "curie" ? v : 500,
|
|
16
17
|
minWidth: 300,
|
|
17
18
|
minHeight: 200,
|
|
18
19
|
maxWidth: 1200,
|
|
@@ -21,26 +22,26 @@ function v({ open: v = !1, onClose: y, title: b, children: x }) {
|
|
|
21
22
|
if (n(() => {
|
|
22
23
|
function e() {
|
|
23
24
|
let e = {
|
|
24
|
-
left: -(
|
|
25
|
+
left: -(j - 100),
|
|
25
26
|
top: 0,
|
|
26
27
|
right: window.innerWidth - 100,
|
|
27
28
|
bottom: window.innerHeight - 100
|
|
28
29
|
};
|
|
29
|
-
|
|
30
|
+
O(e), A((t) => ({
|
|
30
31
|
x: Math.max(e.left, Math.min(t.x, e.right)),
|
|
31
32
|
y: Math.max(e.top, Math.min(t.y, e.bottom))
|
|
32
33
|
}));
|
|
33
34
|
}
|
|
34
35
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
35
|
-
}, [
|
|
36
|
-
let
|
|
36
|
+
}, [j, M]), !y) return null;
|
|
37
|
+
let P = /* @__PURE__ */ h(l, {
|
|
37
38
|
elevation: 5,
|
|
38
39
|
sx: {
|
|
39
40
|
display: "flex",
|
|
40
41
|
flexDirection: "column",
|
|
41
|
-
height:
|
|
42
|
-
width:
|
|
43
|
-
...
|
|
42
|
+
height: T ? "95vh" : `${M}px`,
|
|
43
|
+
width: T ? "95vw" : `${j}px`,
|
|
44
|
+
...T && { position: "fixed" }
|
|
44
45
|
},
|
|
45
46
|
children: [
|
|
46
47
|
/* @__PURE__ */ h(u, {
|
|
@@ -49,63 +50,71 @@ function v({ open: v = !1, onClose: y, title: b, children: x }) {
|
|
|
49
50
|
gap: "5px",
|
|
50
51
|
className: "drag-handle",
|
|
51
52
|
sx: {
|
|
52
|
-
padding: "20px",
|
|
53
|
+
padding: C === "curie" ? "44px 44px 20px 44px" : "20px",
|
|
53
54
|
cursor: "move"
|
|
54
55
|
},
|
|
55
56
|
children: [
|
|
56
|
-
/* @__PURE__ */ m(d, {
|
|
57
|
+
C !== "curie" && /* @__PURE__ */ m(d, {
|
|
57
58
|
variant: "headline1",
|
|
58
|
-
children:
|
|
59
|
+
children: x
|
|
59
60
|
}),
|
|
60
61
|
/* @__PURE__ */ m(a, { sx: { flexGrow: 1 } }),
|
|
61
62
|
/* @__PURE__ */ m(c, {
|
|
62
|
-
onClick:
|
|
63
|
-
children: /* @__PURE__ */ m(g, {
|
|
63
|
+
onClick: b,
|
|
64
|
+
children: /* @__PURE__ */ m(g, { sx: C === "curie" ? {
|
|
65
|
+
width: "16px",
|
|
66
|
+
height: "16px"
|
|
67
|
+
} : void 0 })
|
|
64
68
|
})
|
|
65
69
|
]
|
|
66
70
|
}),
|
|
67
|
-
/* @__PURE__ */ m(s, { sx: { mx: 2 } }),
|
|
71
|
+
C !== "curie" && /* @__PURE__ */ m(s, { sx: { mx: 2 } }),
|
|
68
72
|
/* @__PURE__ */ m(o, {
|
|
69
73
|
sx: {
|
|
70
74
|
height: "100%",
|
|
71
75
|
maxWidth: "100%",
|
|
72
|
-
padding: "16px"
|
|
76
|
+
padding: "16px",
|
|
77
|
+
...C === "curie" && {
|
|
78
|
+
borderTop: "none",
|
|
79
|
+
borderBottom: "none",
|
|
80
|
+
padding: C === "curie" ? "0 44px 44px 44px" : "44px"
|
|
81
|
+
}
|
|
73
82
|
},
|
|
74
|
-
children:
|
|
83
|
+
children: S
|
|
75
84
|
})
|
|
76
85
|
]
|
|
77
86
|
});
|
|
78
87
|
return /* @__PURE__ */ m(a, {
|
|
79
88
|
sx: {
|
|
80
89
|
position: "fixed",
|
|
81
|
-
zIndex:
|
|
90
|
+
zIndex: w.zIndex.modal,
|
|
82
91
|
top: 0,
|
|
83
92
|
left: 0,
|
|
84
|
-
pointerEvents:
|
|
93
|
+
pointerEvents: T ? "auto" : "none"
|
|
85
94
|
},
|
|
86
|
-
children:
|
|
87
|
-
position:
|
|
88
|
-
onDrag: (e, t) =>
|
|
95
|
+
children: T ? P : /* @__PURE__ */ m(_, {
|
|
96
|
+
position: k,
|
|
97
|
+
onDrag: (e, t) => A({
|
|
89
98
|
x: t.x,
|
|
90
99
|
y: t.y
|
|
91
100
|
}),
|
|
92
|
-
nodeRef:
|
|
93
|
-
bounds:
|
|
101
|
+
nodeRef: E,
|
|
102
|
+
bounds: D,
|
|
94
103
|
handle: ".drag-handle",
|
|
95
104
|
children: /* @__PURE__ */ m(a, {
|
|
96
|
-
ref:
|
|
105
|
+
ref: E,
|
|
97
106
|
sx: { pointerEvents: "auto" },
|
|
98
107
|
children: /* @__PURE__ */ m(t, {
|
|
99
|
-
width:
|
|
100
|
-
height:
|
|
101
|
-
onResizeStart:
|
|
102
|
-
children:
|
|
108
|
+
width: j,
|
|
109
|
+
height: M,
|
|
110
|
+
onResizeStart: N,
|
|
111
|
+
children: P
|
|
103
112
|
})
|
|
104
113
|
})
|
|
105
114
|
})
|
|
106
115
|
});
|
|
107
116
|
}
|
|
108
117
|
//#endregion
|
|
109
|
-
export {
|
|
118
|
+
export { y as default };
|
|
110
119
|
|
|
111
120
|
//# sourceMappingURL=DraggableDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableDialog.js","names":[],"sources":["../../../src/components/DraggableDialog/DraggableDialog.tsx"],"sourcesContent":["import Draggable, { DraggableBounds } from 'react-draggable'\nimport {\n Box,\n IconButton,\n Paper,\n Stack,\n Typography,\n Divider,\n useMediaQuery,\n useTheme,\n DialogContent,\n} from '@mui/material'\nimport CloseIcon from '@mui/icons-material/Close'\nimport { useRef, ReactNode, useEffect, useState } from 'react'\nimport { useResizable } from '../ResizableContainer/hooks/useResizable'\nimport { ResizableContainer } from '../ResizableContainer/ResizableContainer'\n\ntype DraggableDialogProps = {\n open?: boolean\n onClose?: () => void\n children: ReactNode\n title?: ReactNode\n}\n\nexport default function DraggableDialog({\n open = false,\n onClose,\n title,\n children,\n}: DraggableDialogProps) {\n const theme = useTheme()\n const isMobile = useMediaQuery(theme.breakpoints.down('sm'))\n const draggableRef = useRef<HTMLDivElement>(null)\n const [bounds, setBounds] = useState<DraggableBounds>()\n const [position, setPosition] = useState({
|
|
1
|
+
{"version":3,"file":"DraggableDialog.js","names":[],"sources":["../../../src/components/DraggableDialog/DraggableDialog.tsx"],"sourcesContent":["import Draggable, { DraggableBounds } from 'react-draggable'\nimport {\n Box,\n IconButton,\n Paper,\n Stack,\n Typography,\n Divider,\n useMediaQuery,\n useTheme,\n DialogContent,\n} from '@mui/material'\nimport CloseIcon from '@mui/icons-material/Close'\nimport { useRef, ReactNode, useEffect, useState } from 'react'\nimport { useResizable } from '../ResizableContainer/hooks/useResizable'\nimport { ResizableContainer } from '../ResizableContainer/ResizableContainer'\n\nconst CURIE_INITIAL_SIZE = 700\n\ntype DraggableDialogProps = {\n open?: boolean\n onClose?: () => void\n children: ReactNode\n title?: ReactNode\n variant?: 'default' | 'curie'\n}\n\nexport default function DraggableDialog({\n open = false,\n onClose,\n title,\n children,\n variant = 'default',\n}: DraggableDialogProps) {\n const theme = useTheme()\n const isMobile = useMediaQuery(theme.breakpoints.down('sm'))\n const draggableRef = useRef<HTMLDivElement>(null)\n const [bounds, setBounds] = useState<DraggableBounds>()\n const [position, setPosition] = useState({\n x: 100,\n y: variant === 'curie' ? 50 : 100,\n })\n const { width, height, handleResizeStart } = useResizable({\n initialWidth: 600,\n initialHeight: variant === 'curie' ? CURIE_INITIAL_SIZE : 500,\n minWidth: 300,\n minHeight: 200,\n maxWidth: 1200,\n maxHeight: 800,\n })\n\n useEffect(() => {\n // Calculate draggable bounds to keep dialog within viewport with margin\n function updateBounds() {\n const margin = 100\n const dialogWidth = width\n\n const newBounds = {\n left: -(dialogWidth - margin),\n top: 0,\n right: window.innerWidth - margin,\n bottom: window.innerHeight - margin,\n }\n\n setBounds(newBounds)\n\n // Clamp dialog position to new bounds to keep it visible after window resize\n setPosition(prevPosition => ({\n x: Math.max(newBounds.left, Math.min(prevPosition.x, newBounds.right)),\n y: Math.max(newBounds.top, Math.min(prevPosition.y, newBounds.bottom)),\n }))\n }\n updateBounds()\n window.addEventListener('resize', updateBounds)\n return () => window.removeEventListener('resize', updateBounds)\n }, [width, height])\n\n if (!open) {\n return null\n }\n\n const paperContent = (\n <Paper\n elevation={5}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n height: isMobile ? '95vh' : `${height}px`,\n width: isMobile ? '95vw' : `${width}px`,\n ...(isMobile && {\n position: 'fixed',\n }),\n }}\n >\n <Stack\n direction=\"row\"\n alignItems=\"center\"\n gap=\"5px\"\n className=\"drag-handle\"\n sx={{\n padding: variant === 'curie' ? '44px 44px 20px 44px' : '20px',\n cursor: 'move',\n }}\n >\n {variant !== 'curie' && (\n <Typography variant=\"headline1\">{title}</Typography>\n )}\n <Box sx={{ flexGrow: 1 }} />\n <IconButton onClick={onClose}>\n <CloseIcon\n sx={\n variant === 'curie'\n ? { width: '16px', height: '16px' }\n : undefined\n }\n />\n </IconButton>\n </Stack>\n {variant !== 'curie' && <Divider sx={{ mx: 2 }} />}\n <DialogContent\n sx={{\n height: '100%',\n maxWidth: '100%',\n padding: '16px',\n ...(variant === 'curie' && {\n borderTop: 'none',\n borderBottom: 'none',\n padding: variant === 'curie' ? '0 44px 44px 44px' : '44px',\n }),\n }}\n >\n {children}\n </DialogContent>\n </Paper>\n )\n\n return (\n <Box\n sx={{\n position: 'fixed',\n zIndex: theme.zIndex.modal,\n top: 0,\n left: 0,\n pointerEvents: isMobile ? 'auto' : 'none',\n }}\n >\n {isMobile ? (\n paperContent\n ) : (\n <Draggable\n position={position}\n onDrag={(e, data) => setPosition({ x: data.x, y: data.y })}\n nodeRef={draggableRef}\n bounds={bounds}\n handle=\".drag-handle\"\n >\n <Box ref={draggableRef} sx={{ pointerEvents: 'auto' }}>\n <ResizableContainer\n width={width}\n height={height}\n onResizeStart={handleResizeStart}\n >\n {paperContent}\n </ResizableContainer>\n </Box>\n </Draggable>\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;AAiBA,IAAM,IAAqB;AAU3B,SAAwB,EAAgB,EACtC,UAAO,IACP,YACA,UACA,aACA,aAAU,aACa;CACvB,IAAM,IAAQ,EAAS,GACjB,IAAW,EAAc,EAAM,YAAY,KAAK,IAAI,CAAC,GACrD,IAAe,EAAuB,IAAI,GAC1C,CAAC,GAAQ,KAAa,EAA0B,GAChD,CAAC,GAAU,KAAe,EAAS;EACvC,GAAG;EACH,GAAG,MAAY,UAAU,KAAK;CAChC,CAAC,GACK,EAAE,UAAO,WAAQ,yBAAsB,EAAa;EACxD,cAAc;EACd,eAAe,MAAY,UAAU,IAAqB;EAC1D,UAAU;EACV,WAAW;EACX,UAAU;EACV,WAAW;CACb,CAAC;CA4BD,IA1BA,QAAgB;EAEd,SAAS,IAAe;GACtB,IAGM,IAAY;IAChB,MAAM,EAAE,IAAc;IACtB,KAAK;IACL,OAAO,OAAO,aAAa;IAC3B,QAAQ,OAAO,cAAc;GAC/B;GAKA,AAHA,EAAU,CAAS,GAGnB,GAAY,OAAiB;IAC3B,GAAG,KAAK,IAAI,EAAU,MAAM,KAAK,IAAI,EAAa,GAAG,EAAU,KAAK,CAAC;IACrE,GAAG,KAAK,IAAI,EAAU,KAAK,KAAK,IAAI,EAAa,GAAG,EAAU,MAAM,CAAC;GACvE,EAAE;EACJ;EAGA,OAFA,EAAa,GACb,OAAO,iBAAiB,UAAU,CAAY,SACjC,OAAO,oBAAoB,UAAU,CAAY;CAChE,GAAG,CAAC,GAAO,CAAM,CAAC,GAEd,CAAC,GACH,OAAO;CAGT,IAAM,IACJ,kBAAC,GAAD;EACE,WAAW;EACX,IAAI;GACF,SAAS;GACT,eAAe;GACf,QAAQ,IAAW,SAAS,GAAG,EAAO;GACtC,OAAO,IAAW,SAAS,GAAG,EAAM;GACpC,GAAI,KAAY,EACd,UAAU,QACZ;EACF;YAVF;GAYE,kBAAC,GAAD;IACE,WAAU;IACV,YAAW;IACX,KAAI;IACJ,WAAU;IACV,IAAI;KACF,SAAS,MAAY,UAAU,wBAAwB;KACvD,QAAQ;IACV;cARF;KAUG,MAAY,WACX,kBAAC,GAAD;MAAY,SAAQ;gBAAa;KAAkB,CAAA;KAErD,kBAAC,GAAD,EAAK,IAAI,EAAE,UAAU,EAAE,EAAI,CAAA;KAC3B,kBAAC,GAAD;MAAY,SAAS;gBACnB,kBAAC,GAAD,EACE,IACE,MAAY,UACR;OAAE,OAAO;OAAQ,QAAQ;MAAO,IAChC,KAAA,EAEP,CAAA;KACS,CAAA;IACP;;GACN,MAAY,WAAW,kBAAC,GAAD,EAAS,IAAI,EAAE,IAAI,EAAE,EAAI,CAAA;GACjD,kBAAC,GAAD;IACE,IAAI;KACF,QAAQ;KACR,UAAU;KACV,SAAS;KACT,GAAI,MAAY,WAAW;MACzB,WAAW;MACX,cAAc;MACd,SAAS,MAAY,UAAU,qBAAqB;KACtD;IACF;IAEC;GACY,CAAA;EACV;;CAGT,OACE,kBAAC,GAAD;EACE,IAAI;GACF,UAAU;GACV,QAAQ,EAAM,OAAO;GACrB,KAAK;GACL,MAAM;GACN,eAAe,IAAW,SAAS;EACrC;YAEC,IACC,IAEA,kBAAC,GAAD;GACY;GACV,SAAS,GAAG,MAAS,EAAY;IAAE,GAAG,EAAK;IAAG,GAAG,EAAK;GAAE,CAAC;GACzD,SAAS;GACD;GACR,QAAO;aAEP,kBAAC,GAAD;IAAK,KAAK;IAAc,IAAI,EAAE,eAAe,OAAO;cAClD,kBAAC,GAAD;KACS;KACC;KACR,eAAe;eAEd;IACiB,CAAA;GACjB,CAAA;EACI,CAAA;CAEV,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableColumns.d.ts","sourceRoot":"","sources":["../../../../src/components/EntityTreeTable/hooks/useTableColumns.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAmBpD,eAAO,MAAM,eAAe,GAC1B,eAAe,OAAO,EACtB,4BAA0B,
|
|
1
|
+
{"version":3,"file":"useTableColumns.d.ts","sourceRoot":"","sources":["../../../../src/components/EntityTreeTable/hooks/useTableColumns.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAmBpD,eAAO,MAAM,eAAe,GAC1B,eAAe,OAAO,EACtB,4BAA0B,iCAmH3B,CAAA"}
|
|
@@ -33,40 +33,46 @@ var y = (y, b = !1) => {
|
|
|
33
33
|
header: d,
|
|
34
34
|
cell: e,
|
|
35
35
|
enableSorting: y,
|
|
36
|
-
size:
|
|
36
|
+
size: 600
|
|
37
37
|
}), C && (m.push({
|
|
38
38
|
id: "badges",
|
|
39
39
|
header: "",
|
|
40
40
|
cell: f,
|
|
41
41
|
enableSorting: !1,
|
|
42
|
+
enableResizing: !1,
|
|
42
43
|
size: 120
|
|
43
44
|
}), m.push({
|
|
44
45
|
id: "id",
|
|
45
46
|
header: n,
|
|
46
47
|
cell: t,
|
|
47
|
-
enableSorting: !1
|
|
48
|
+
enableSorting: !1,
|
|
49
|
+
size: 110
|
|
48
50
|
})), S && m.push({
|
|
49
51
|
accessorKey: "entityHeader.createdOn",
|
|
50
52
|
id: "createdOn",
|
|
51
53
|
header: l,
|
|
52
54
|
cell: a,
|
|
53
|
-
enableSorting: y
|
|
55
|
+
enableSorting: y,
|
|
56
|
+
size: 130
|
|
54
57
|
}), C && m.push({
|
|
55
58
|
accessorKey: "entityHeader.modifiedOn",
|
|
56
59
|
id: "modifiedOn",
|
|
57
60
|
header: u,
|
|
58
61
|
cell: r,
|
|
59
|
-
enableSorting: y
|
|
62
|
+
enableSorting: y,
|
|
63
|
+
size: 130
|
|
60
64
|
}), S && m.push({
|
|
61
65
|
id: "modifiedBy",
|
|
62
66
|
header: "Modified By",
|
|
63
67
|
cell: i,
|
|
64
|
-
enableSorting: !1
|
|
68
|
+
enableSorting: !1,
|
|
69
|
+
size: 130
|
|
65
70
|
}), C && m.push({
|
|
66
71
|
id: "size",
|
|
67
72
|
header: "Size",
|
|
68
73
|
cell: o,
|
|
69
|
-
enableSorting: !1
|
|
74
|
+
enableSorting: !1,
|
|
75
|
+
size: 80
|
|
70
76
|
}), S && m.push({
|
|
71
77
|
id: "md5",
|
|
72
78
|
header: "MD5",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableColumns.js","names":[],"sources":["../../../../src/components/EntityTreeTable/hooks/useTableColumns.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { ColumnDef } from '@tanstack/react-table'\nimport { useTheme, useMediaQuery } from '@mui/material'\nimport { EntityBundleRow } from '../EntityTreeTable'\nimport { NameCell } from '../components/EntityNameCell'\nimport { IdCell } from '../components/IdCell'\nimport { IdColumnHeader } from '../components/IdColumnHeader'\nimport { ModifiedOnCell } from '../../EntityFinder/details/view/table/ModifiedOnCell'\nimport { ModifiedByCell } from '../../EntityFinder/details/view/table/ModifiedByCell'\nimport { CreatedOnCell } from '../../EntityFinder/details/view/table/CreatedOnCell'\nimport { FileEntitySizeCell } from '../../EntityFinder/details/view/table/FileEntitySizeCell'\nimport { FileEntityMD5Cell } from '../../EntityFinder/details/view/table/FileEntityMD5Cell'\nimport { AddFileToDownloadListCell } from '../../EntityFinder/details/view/table/AddToDownloadListCell'\nimport {\n NameColumnHeader,\n CreatedOnColumnHeader,\n ModifiedOnColumnHeader,\n} from '../components/ColumnHeaders'\nimport { EntityBadgeIconsCell } from '../components/EntityBadgeIconsCell'\nimport { CheckboxCell } from '../components/CheckboxCell'\nimport PlaylistAddIcon from '@mui/icons-material/PlaylistAdd'\n\nexport const useTableColumns = (\n enableSorting: boolean,\n showCheckboxColumn = false,\n) => {\n // Responsive design hooks\n const theme = useTheme()\n const isXtraLarge = useMediaQuery(theme.breakpoints.up('xl'))\n const isMediumAndUp = useMediaQuery(theme.breakpoints.up('md'))\n\n // Table columns\n const columns = useMemo<ColumnDef<EntityBundleRow>[]>(() => {\n const baseColumns: ColumnDef<EntityBundleRow>[] = []\n\n if (showCheckboxColumn) {\n baseColumns.push({\n id: 'select',\n header: '',\n cell: CheckboxCell,\n enableSorting: false,\n size: 45,\n minSize: 45,\n maxSize: 45,\n })\n }\n\n baseColumns.push({\n accessorKey: 'entityHeader.name',\n id: 'name',\n header: NameColumnHeader,\n cell: NameCell,\n enableSorting: enableSorting,\n size:
|
|
1
|
+
{"version":3,"file":"useTableColumns.js","names":[],"sources":["../../../../src/components/EntityTreeTable/hooks/useTableColumns.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { ColumnDef } from '@tanstack/react-table'\nimport { useTheme, useMediaQuery } from '@mui/material'\nimport { EntityBundleRow } from '../EntityTreeTable'\nimport { NameCell } from '../components/EntityNameCell'\nimport { IdCell } from '../components/IdCell'\nimport { IdColumnHeader } from '../components/IdColumnHeader'\nimport { ModifiedOnCell } from '../../EntityFinder/details/view/table/ModifiedOnCell'\nimport { ModifiedByCell } from '../../EntityFinder/details/view/table/ModifiedByCell'\nimport { CreatedOnCell } from '../../EntityFinder/details/view/table/CreatedOnCell'\nimport { FileEntitySizeCell } from '../../EntityFinder/details/view/table/FileEntitySizeCell'\nimport { FileEntityMD5Cell } from '../../EntityFinder/details/view/table/FileEntityMD5Cell'\nimport { AddFileToDownloadListCell } from '../../EntityFinder/details/view/table/AddToDownloadListCell'\nimport {\n NameColumnHeader,\n CreatedOnColumnHeader,\n ModifiedOnColumnHeader,\n} from '../components/ColumnHeaders'\nimport { EntityBadgeIconsCell } from '../components/EntityBadgeIconsCell'\nimport { CheckboxCell } from '../components/CheckboxCell'\nimport PlaylistAddIcon from '@mui/icons-material/PlaylistAdd'\n\nexport const useTableColumns = (\n enableSorting: boolean,\n showCheckboxColumn = false,\n) => {\n // Responsive design hooks\n const theme = useTheme()\n const isXtraLarge = useMediaQuery(theme.breakpoints.up('xl'))\n const isMediumAndUp = useMediaQuery(theme.breakpoints.up('md'))\n\n // Table columns\n const columns = useMemo<ColumnDef<EntityBundleRow>[]>(() => {\n const baseColumns: ColumnDef<EntityBundleRow>[] = []\n\n if (showCheckboxColumn) {\n baseColumns.push({\n id: 'select',\n header: '',\n cell: CheckboxCell,\n enableSorting: false,\n size: 45,\n minSize: 45,\n maxSize: 45,\n })\n }\n\n baseColumns.push({\n accessorKey: 'entityHeader.name',\n id: 'name',\n header: NameColumnHeader,\n cell: NameCell,\n enableSorting: enableSorting,\n size: 600,\n })\n if (isMediumAndUp) {\n baseColumns.push({\n id: 'badges',\n header: '',\n cell: EntityBadgeIconsCell,\n enableSorting: false,\n enableResizing: false,\n size: 120,\n })\n baseColumns.push({\n id: 'id',\n header: IdColumnHeader,\n cell: IdCell,\n enableSorting: false,\n size: 110,\n })\n }\n if (isXtraLarge) {\n baseColumns.push({\n accessorKey: 'entityHeader.createdOn',\n id: 'createdOn',\n header: CreatedOnColumnHeader,\n cell: CreatedOnCell,\n enableSorting: enableSorting,\n size: 130,\n })\n }\n\n if (isMediumAndUp) {\n baseColumns.push({\n accessorKey: 'entityHeader.modifiedOn',\n id: 'modifiedOn',\n header: ModifiedOnColumnHeader,\n cell: ModifiedOnCell,\n enableSorting: enableSorting,\n size: 130,\n })\n }\n\n if (isXtraLarge) {\n baseColumns.push({\n id: 'modifiedBy',\n header: 'Modified By',\n cell: ModifiedByCell,\n enableSorting: false,\n size: 130,\n })\n }\n\n if (isMediumAndUp) {\n baseColumns.push({\n id: 'size',\n header: 'Size',\n cell: FileEntitySizeCell,\n enableSorting: false,\n size: 80,\n })\n }\n if (isXtraLarge) {\n baseColumns.push({\n id: 'md5',\n header: 'MD5',\n cell: FileEntityMD5Cell,\n enableSorting: false,\n })\n }\n\n baseColumns.push({\n id: 'download',\n header: 'Download',\n cell: props => (\n <AddFileToDownloadListCell\n {...props}\n downloadIcon={<PlaylistAddIcon />}\n />\n ),\n enableSorting: false,\n size: 90,\n })\n\n return baseColumns\n }, [enableSorting, isXtraLarge, isMediumAndUp, showCheckboxColumn])\n\n return columns\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,IAAa,KACX,GACA,IAAqB,OAClB;CAEH,IAAM,IAAQ,EAAS,GACjB,IAAc,EAAc,EAAM,YAAY,GAAG,IAAI,CAAC,GACtD,IAAgB,EAAc,EAAM,YAAY,GAAG,IAAI,CAAC;CA6G9D,OA1GgB,QAA4C;EAC1D,IAAM,IAA4C,CAAC;EAsGnD,OApGI,KACF,EAAY,KAAK;GACf,IAAI;GACJ,QAAQ;GACR,MAAM;GACN,eAAe;GACf,MAAM;GACN,SAAS;GACT,SAAS;EACX,CAAC,GAGH,EAAY,KAAK;GACf,aAAa;GACb,IAAI;GACJ,QAAQ;GACR,MAAM;GACS;GACf,MAAM;EACR,CAAC,GACG,MACF,EAAY,KAAK;GACf,IAAI;GACJ,QAAQ;GACR,MAAM;GACN,eAAe;GACf,gBAAgB;GAChB,MAAM;EACR,CAAC,GACD,EAAY,KAAK;GACf,IAAI;GACJ,QAAQ;GACR,MAAM;GACN,eAAe;GACf,MAAM;EACR,CAAC,IAEC,KACF,EAAY,KAAK;GACf,aAAa;GACb,IAAI;GACJ,QAAQ;GACR,MAAM;GACS;GACf,MAAM;EACR,CAAC,GAGC,KACF,EAAY,KAAK;GACf,aAAa;GACb,IAAI;GACJ,QAAQ;GACR,MAAM;GACS;GACf,MAAM;EACR,CAAC,GAGC,KACF,EAAY,KAAK;GACf,IAAI;GACJ,QAAQ;GACR,MAAM;GACN,eAAe;GACf,MAAM;EACR,CAAC,GAGC,KACF,EAAY,KAAK;GACf,IAAI;GACJ,QAAQ;GACR,MAAM;GACN,eAAe;GACf,MAAM;EACR,CAAC,GAEC,KACF,EAAY,KAAK;GACf,IAAI;GACJ,QAAQ;GACR,MAAM;GACN,eAAe;EACjB,CAAC,GAGH,EAAY,KAAK;GACf,IAAI;GACJ,QAAQ;GACR,OAAM,MACJ,kBAAC,GAAD;IACE,GAAI;IACJ,cAAc,kBAAC,GAAD,CAAkB,CAAA;GACjC,CAAA;GAEH,eAAe;GACf,MAAM;EACR,CAAC,GAEM;CACT,GAAG;EAAC;EAAe;EAAa;EAAe;CAAkB,CAE1D;AACT"}
|
|
@@ -9,7 +9,8 @@ var d = "experimental-mode", f = "This mode gives you early access to features t
|
|
|
9
9
|
function p({ onExperimentalModeToggle: p }) {
|
|
10
10
|
let m = a(), [h, g, _] = c(e, {
|
|
11
11
|
path: "/",
|
|
12
|
-
domain: (typeof window < "u" ? window.location.hostname.toLowerCase() : "").endsWith(".synapse.org") ? "synapse.org" : void 0
|
|
12
|
+
domain: (typeof window < "u" ? window.location.hostname.toLowerCase() : "").endsWith(".synapse.org") ? "synapse.org" : void 0,
|
|
13
|
+
initializeWithValue: !1
|
|
13
14
|
});
|
|
14
15
|
return /* @__PURE__ */ s(t, {
|
|
15
16
|
sx: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExperimentalMode.js","names":[],"sources":["../../../src/components/ExperimentalMode/ExperimentalMode.tsx"],"sourcesContent":["import { EXPERIMENTAL_MODE_COOKIE } from '@/utils/SynapseConstants'\nimport { InfoOutlined } from '@mui/icons-material'\nimport { Box, IconButton, Tooltip, Typography, useTheme } from '@mui/material'\nimport Switch from 'react-switch'\nimport { useCookieValue } from '@react-hookz/web/useCookieValue/index.js'\n\nconst EXPERIMENTAL_MODE_SWITCH_ID = 'experimental-mode'\nconst experimentalModeText =\n 'This mode gives you early access to features that are still in development. Please note that we do not guarantee an absence of errors, and that the data created using these features may be lost during product upgrade.'\n\nexport type ExperimentalModeProps = {\n onExperimentalModeToggle?: (newValue: boolean) => void\n}\nfunction ExperimentalMode({ onExperimentalModeToggle }: ExperimentalModeProps) {\n const theme = useTheme()\n\n const getExperimentalModeCookieOptions = () => {\n const hostname =\n typeof window !== 'undefined'\n ? window.location.hostname.toLowerCase()\n : ''\n return {\n path: '/',\n domain: hostname.endsWith('.synapse.org') ? 'synapse.org' : undefined,\n }\n }\n\n const [\n experimentalModeCookie,\n setExperimentalModeCookie,\n removeExperimentalModeCookie,\n ] = useCookieValue(\n
|
|
1
|
+
{"version":3,"file":"ExperimentalMode.js","names":[],"sources":["../../../src/components/ExperimentalMode/ExperimentalMode.tsx"],"sourcesContent":["import { EXPERIMENTAL_MODE_COOKIE } from '@/utils/SynapseConstants'\nimport { InfoOutlined } from '@mui/icons-material'\nimport { Box, IconButton, Tooltip, Typography, useTheme } from '@mui/material'\nimport Switch from 'react-switch'\nimport { useCookieValue } from '@react-hookz/web/useCookieValue/index.js'\n\nconst EXPERIMENTAL_MODE_SWITCH_ID = 'experimental-mode'\nconst experimentalModeText =\n 'This mode gives you early access to features that are still in development. Please note that we do not guarantee an absence of errors, and that the data created using these features may be lost during product upgrade.'\n\nexport type ExperimentalModeProps = {\n onExperimentalModeToggle?: (newValue: boolean) => void\n}\nfunction ExperimentalMode({ onExperimentalModeToggle }: ExperimentalModeProps) {\n const theme = useTheme()\n\n const getExperimentalModeCookieOptions = () => {\n const hostname =\n typeof window !== 'undefined'\n ? window.location.hostname.toLowerCase()\n : ''\n return {\n path: '/',\n domain: hostname.endsWith('.synapse.org') ? 'synapse.org' : undefined,\n }\n }\n\n const [\n experimentalModeCookie,\n setExperimentalModeCookie,\n removeExperimentalModeCookie,\n ] = useCookieValue(EXPERIMENTAL_MODE_COOKIE, {\n ...getExperimentalModeCookieOptions(),\n initializeWithValue: false,\n })\n\n const createExperimentalModeCookie = () => {\n setExperimentalModeCookie('true')\n\n if (onExperimentalModeToggle) {\n onExperimentalModeToggle(true)\n }\n }\n\n const deleteExperimentalModeCookie = () => {\n removeExperimentalModeCookie()\n if (onExperimentalModeToggle) {\n onExperimentalModeToggle(false)\n }\n }\n\n return (\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n <Typography\n component={'label'}\n variant=\"body1\"\n htmlFor={EXPERIMENTAL_MODE_SWITCH_ID}\n >\n Experimental Mode\n </Typography>\n <Tooltip title={experimentalModeText} arrow placement=\"top\">\n <IconButton\n aria-label=\"info\"\n color=\"inherit\"\n sx={{ '&:hover': { backgroundColor: 'transparent' } }}\n >\n <InfoOutlined sx={{ verticalAlign: 'middle' }} />\n </IconButton>\n </Tooltip>\n <Switch\n id={EXPERIMENTAL_MODE_SWITCH_ID}\n width={35}\n height={20}\n onColor={theme.palette.secondary.main}\n checkedIcon={false}\n uncheckedIcon={false}\n checked={experimentalModeCookie === 'true'}\n onChange={\n experimentalModeCookie === 'true'\n ? deleteExperimentalModeCookie\n : createExperimentalModeCookie\n }\n />\n </Box>\n )\n}\n\nexport default ExperimentalMode\n"],"mappings":";;;;;;;AAMA,IAAM,IAA8B,qBAC9B,IACJ;AAKF,SAAS,EAAiB,EAAE,+BAAmD;CAC7E,IAAM,IAAQ,EAAS,GAajB,CACJ,GACA,GACA,KACE,EAAe,GAA0B;EATzC,MAAM;EACN,SALA,OAAO,SAAW,MACd,OAAO,SAAS,SAAS,YAAY,IACrC,IAGa,SAAS,cAAc,IAAI,gBAAgB,KAAA;EAU9D,qBAAqB;CACvB,CAAC;CAiBD,OACE,kBAAC,GAAD;EAAK,IAAI;GAAE,SAAS;GAAQ,YAAY;EAAS;YAAjD;GACE,kBAAC,GAAD;IACE,WAAW;IACX,SAAQ;IACR,SAAS;cACV;GAEW,CAAA;GACZ,kBAAC,GAAD;IAAS,OAAO;IAAsB,OAAA;IAAM,WAAU;cACpD,kBAAC,GAAD;KACE,cAAW;KACX,OAAM;KACN,IAAI,EAAE,WAAW,EAAE,iBAAiB,cAAc,EAAE;eAEpD,kBAAC,GAAD,EAAc,IAAI,EAAE,eAAe,SAAS,EAAI,CAAA;IACtC,CAAA;GACL,CAAA;GACT,kBAAC,GAAD;IACE,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,SAAS,EAAM,QAAQ,UAAU;IACjC,aAAa;IACb,eAAe;IACf,SAAS,MAA2B;IACpC,UACE,MAA2B,eAlCQ;KAEzC,AADA,EAA6B,GACzB,KACF,EAAyB,EAAK;IAElC,UAb2C;KAGzC,AAFA,EAA0B,MAAM,GAE5B,KACF,EAAyB,EAAI;IAEjC;GAwCK,CAAA;EACE;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchQueryUseQueryOptions.d.ts","sourceRoot":"","sources":["../../../src/components/SearchQueryWrapper/SearchQueryUseQueryOptions.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,EACrB,WAAW,EAEX,uBAAuB,EAIvB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,EAIP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAGV,gBAAgB,EAChB,kBAAkB,EAElB,kBAAkB,EAEnB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,uBAAuB,CAAA;AAI9B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"SearchQueryUseQueryOptions.d.ts","sourceRoot":"","sources":["../../../src/components/SearchQueryWrapper/SearchQueryUseQueryOptions.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,EACrB,WAAW,EAEX,uBAAuB,EAIvB,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,EAIP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAGV,gBAAgB,EAChB,kBAAkB,EAElB,kBAAkB,EAEnB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,uBAAuB,CAAA;AAI9B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAUzD,MAAM,MAAM,mBAAmB,GA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