synapse-react-client 4.0.3 → 4.0.5
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/DefaultColorfulPortalCardBackground.svg +14 -0
- package/dist/assets/DefaultColorfulPortalCardBackground.svg.js +7 -0
- package/dist/assets/DefaultColorfulPortalCardBackground.svg.js.map +1 -0
- package/dist/assets/homepage/nih-aging.svg +27 -27
- package/dist/assets/homepage/nih-aging.svg.js +1 -1
- package/dist/assets/homepage/nih-aging.svg.js.map +1 -1
- package/dist/assets/homepage/nih-heart.svg +39 -46
- package/dist/assets/homepage/nih-heart.svg.js +3 -3
- package/dist/assets/homepage/nih-heart.svg.js.map +1 -1
- package/dist/assets/homepage/nih-nci.svg +6 -0
- package/dist/assets/homepage/nih-nci.svg.js +7 -0
- package/dist/assets/homepage/nih-nci.svg.js.map +1 -0
- package/dist/assets/homepage/nih-nimh.svg +14 -0
- package/dist/assets/homepage/nih-nimh.svg.js +7 -0
- package/dist/assets/homepage/nih-nimh.svg.js.map +1 -0
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js +4 -4
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.js +8 -7
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsEditor.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js +4 -4
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItem.js +11 -11
- package/dist/components/AccessRequirementList/RequirementItem/RequirementItem.js +1 -1
- package/dist/components/AccessRequirementList/RequirementItem/SelfSignAccessRequirementItem.js +9 -9
- package/dist/components/AccessRequirementList/RequirementItem/UnmanagedACTAccessRequirementItem.js +5 -5
- package/dist/components/AcknowledgementsPage/AcknowledgementsPage.d.ts.map +1 -1
- package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js +33 -32
- package/dist/components/AcknowledgementsPage/AcknowledgementsPage.js.map +1 -1
- package/dist/components/AclEditor/AclEditor.js +8 -8
- package/dist/components/AclEditor/AclEditor.js.map +1 -1
- package/dist/components/AclEditor/AclEditor.test-utils.js +34 -34
- package/dist/components/AclEditor/AclEditor.test-utils.js.map +1 -1
- package/dist/components/Authentication/AuthenticationMethodSelection.js +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.d.ts.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js +6 -5
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
- package/dist/components/BasePortalCard/BasePortalCard.css +1 -1
- package/dist/components/BasePortalCard/BasePortalCard.d.ts +1 -1
- package/dist/components/BasePortalCard/BasePortalCard.d.ts.map +1 -1
- package/dist/components/BasePortalCard/BasePortalCard.js +12 -12
- package/dist/components/BasePortalCard/BasePortalCard.js.map +1 -1
- package/dist/components/BasePortalCard/BasePortalCard.module.scss +6 -0
- package/dist/components/BasePortalCard/BasePortalCard.module.scss.js +1 -1
- package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.css +1 -1
- package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.d.ts.map +1 -1
- package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.js +24 -23
- package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.js.map +1 -1
- package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.module.scss +15 -5
- package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.module.scss.js +1 -1
- package/dist/components/CardContainer/CardLink.d.ts +12 -0
- package/dist/components/CardContainer/CardLink.d.ts.map +1 -1
- package/dist/components/ChallengeSubmission/AvailableEvaluationQueueList.js +12 -12
- package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.d.ts.map +1 -1
- package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.js +7 -7
- package/dist/components/ChallengeTeamWizard/CreateChallengeTeam.js.map +1 -1
- package/dist/components/CitationPopover/CitationPopoverContent.d.ts.map +1 -1
- package/dist/components/CitationPopover/CitationPopoverContent.js +13 -12
- package/dist/components/CitationPopover/CitationPopoverContent.js.map +1 -1
- package/dist/components/CookiesNotification/CookiesNotification.js +1 -1
- package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.js +3 -4
- package/dist/components/CreateOrUpdateAccessRequirementWizard/CreateOrUpdateAccessRequirementWizard.js.map +1 -1
- package/dist/components/DataGrid/MergeGridWithSourceTableButton.js +2 -2
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +35 -35
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/components/UploadCsvToGridDialog.js +2 -2
- package/dist/components/DataGrid/hooks/useExportDataGridToCsv.d.ts.map +1 -1
- package/dist/components/DataGrid/hooks/useExportDataGridToCsv.js +9 -7
- package/dist/components/DataGrid/hooks/useExportDataGridToCsv.js.map +1 -1
- package/dist/components/DownloadCart/ActionRequiredCard/ActionRequiredCard.js +1 -1
- package/dist/components/DownloadCart/RequestDownloadCard.js +1 -1
- package/dist/components/Ecosystem/EcosystemSkeleton.js +2 -2
- package/dist/components/Ecosystem/TableQueryEcosystem.js +1 -1
- package/dist/components/EntityAclEditor/EntityAclEditorModal.js +1 -1
- package/dist/components/EntityAclEditor/OpenData.js +1 -1
- package/dist/components/EntityBadgeIcons/EntityBadgeIcons.d.ts.map +1 -1
- package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js +113 -127
- package/dist/components/EntityBadgeIcons/EntityBadgeIcons.js.map +1 -1
- package/dist/components/EntityCitation/EntityCitation.js +1 -1
- package/dist/components/EntityFinder/details/view/table/AddToDownloadListCell.js +1 -1
- package/dist/components/EntityFinder/details/view/table/CreatedOnCell.js +1 -1
- package/dist/components/EntityFinder/details/view/table/EntityNameCell.js +1 -1
- package/dist/components/EntityFinder/details/view/table/FileEntityMD5Cell.js +1 -1
- package/dist/components/EntityFinder/details/view/table/FileEntitySizeCell.js +1 -1
- package/dist/components/EntityFinder/details/view/table/ModifiedByCell.js +1 -1
- package/dist/components/EntityFinder/details/view/table/ModifiedOnCell.js +1 -1
- package/dist/components/EntityFinder/details/view/table/ParentProjectCell.js +1 -1
- package/dist/components/EntityFinder/tree/EntityTree.js +1 -1
- package/dist/components/EntityHeaderTable/EntityHeaderTable.d.ts.map +1 -1
- package/dist/components/EntityHeaderTable/EntityHeaderTable.js +39 -39
- package/dist/components/EntityHeaderTable/EntityHeaderTable.js.map +1 -1
- package/dist/components/Evaluation/DeleteEvaluationQueueConfirmationDialog.d.ts +8 -0
- package/dist/components/Evaluation/DeleteEvaluationQueueConfirmationDialog.d.ts.map +1 -0
- package/dist/components/Evaluation/DeleteEvaluationQueueConfirmationDialog.js +46 -0
- package/dist/components/Evaluation/DeleteEvaluationQueueConfirmationDialog.js.map +1 -0
- package/dist/components/Evaluation/EvaluationCard.d.ts.map +1 -1
- package/dist/components/Evaluation/EvaluationCard.js +35 -41
- package/dist/components/Evaluation/EvaluationCard.js.map +1 -1
- package/dist/components/Evaluation/EvaluationEditor.d.ts.map +1 -1
- package/dist/components/Evaluation/EvaluationEditor.js +95 -90
- package/dist/components/Evaluation/EvaluationEditor.js.map +1 -1
- package/dist/components/Evaluation/EvaluationRoundEditor.d.ts.map +1 -1
- package/dist/components/Evaluation/EvaluationRoundEditor.js +133 -124
- package/dist/components/Evaluation/EvaluationRoundEditor.js.map +1 -1
- package/dist/components/FilePreview/EntityPreview.js +1 -1
- package/dist/components/Forum/DiscussionReply.js +10 -10
- package/dist/components/Forum/DiscussionThread.js +21 -21
- package/dist/components/GenericCard/CardUtils.d.ts.map +1 -1
- package/dist/components/GenericCard/CardUtils.js +36 -36
- package/dist/components/GenericCard/CardUtils.js.map +1 -1
- package/dist/components/GenericCard/CollapsibleDescription.js +25 -25
- package/dist/components/GenericCard/SynapseCardLabel.d.ts.map +1 -1
- package/dist/components/GenericCard/SynapseCardLabel.js +72 -67
- package/dist/components/GenericCard/SynapseCardLabel.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts +4 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +98 -96
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/GoalsV2/GoalsV2.Desktop.d.ts.map +1 -1
- package/dist/components/GoalsV2/GoalsV2.Desktop.js +14 -15
- package/dist/components/GoalsV2/GoalsV2.Desktop.js.map +1 -1
- package/dist/components/GoogleAnalytics/GoogleAnalytics.js +1 -1
- package/dist/components/HasAccess/HasAccessV2.js +1 -1
- package/dist/components/HasAccess/useHasAccess.js +1 -1
- package/dist/components/IDUReport/IDUReportSubmissionInfo.js +23 -23
- package/dist/components/IDUReport/IDUReportSubmissionInfo.js.map +1 -1
- package/dist/components/JSONArrayEditor/useParseCsv.d.ts +1 -1
- package/dist/components/JSONArrayEditor/useParseCsv.d.ts.map +1 -1
- package/dist/components/JSONArrayEditor/useParseCsv.js +9 -9
- package/dist/components/JSONArrayEditor/useParseCsv.js.map +1 -1
- package/dist/components/Markdown/MarkdownCollapse.js +7 -7
- package/dist/components/Markdown/MarkdownEditor.js +11 -11
- package/dist/components/Markdown/MarkdownGithub.js +1 -1
- package/dist/components/Markdown/MarkdownPopover.js +6 -6
- package/dist/components/Markdown/MarkdownPopover.js.map +1 -1
- package/dist/components/Markdown/MarkdownSynapse.d.ts.map +1 -1
- package/dist/components/Markdown/MarkdownSynapse.js +139 -135
- package/dist/components/Markdown/MarkdownSynapse.js.map +1 -1
- package/dist/components/Markdown/MarkdownUtils.d.ts +8 -0
- package/dist/components/Markdown/MarkdownUtils.d.ts.map +1 -1
- package/dist/components/Markdown/MarkdownUtils.js +139 -65
- package/dist/components/Markdown/MarkdownUtils.js.map +1 -1
- package/dist/components/Markdown/UserMentionModal.js +18 -18
- package/dist/components/Markdown/UserMentionModal.js.map +1 -1
- package/dist/components/Markdown/widget/MarkdownButton.js +3 -3
- package/dist/components/Markdown/widget/MarkdownButton.js.map +1 -1
- package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.d.ts.map +1 -1
- package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js +9 -8
- package/dist/components/MissingQueryResultsWarning/MissingQueryResultsWarning.js.map +1 -1
- package/dist/components/Plot/SynapsePlot.css +1 -0
- package/dist/components/Plot/SynapsePlot.d.ts +2 -0
- package/dist/components/Plot/SynapsePlot.d.ts.map +1 -1
- package/dist/components/Plot/SynapsePlot.js +43 -39
- package/dist/components/Plot/SynapsePlot.js.map +1 -1
- package/dist/components/Plot/SynapsePlot.scss +8 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +114 -113
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.d.ts +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js.map +1 -1
- package/dist/components/Resources/Resources.Desktop.js +7 -7
- package/dist/components/Resources/Resources.Mobile.js +6 -6
- package/dist/components/SubsectionRowRenderer/SubsectionRowRenderer.js +3 -3
- package/dist/components/SustainabilityScorecard/SustainabilityScorecardSummary.js +10 -10
- package/dist/components/SynapseChat/SynapseChatInteraction.js +5 -5
- package/dist/components/SynapseForm/WarningDialog.d.ts +1 -0
- package/dist/components/SynapseForm/WarningDialog.d.ts.map +1 -1
- package/dist/components/SynapseForm/WarningDialog.js +18 -16
- package/dist/components/SynapseForm/WarningDialog.js.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapseHomepageNavBar.js +1 -1
- package/dist/components/SynapseHomepageV2/SynapsePartners.d.ts.map +1 -1
- package/dist/components/SynapseHomepageV2/SynapsePartners.js +17 -12
- package/dist/components/SynapseHomepageV2/SynapsePartners.js.map +1 -1
- package/dist/components/SynapsePortalBanners/SynapsePortalBanners.d.ts.map +1 -1
- package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js +39 -39
- package/dist/components/SynapsePortalBanners/SynapsePortalBanners.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/HasAccessChip.js +1 -1
- package/dist/components/SynapseSearchPageResults/SearchPagePortalBanners.d.ts.map +1 -1
- package/dist/components/SynapseSearchPageResults/SearchPagePortalBanners.js +21 -22
- package/dist/components/SynapseSearchPageResults/SearchPagePortalBanners.js.map +1 -1
- package/dist/components/SynapseSearchPageResults/SynapseSearchResultsCard.js +5 -5
- package/dist/components/SynapseTable/ExpandableTableDataCell.d.ts.map +1 -1
- package/dist/components/SynapseTable/ExpandableTableDataCell.js +3 -1
- package/dist/components/SynapseTable/ExpandableTableDataCell.js.map +1 -1
- package/dist/components/SynapseTable/SynapseTable.js +4 -4
- package/dist/components/SynapseTable/SynapseTableCell/SynapseTableCell.d.ts.map +1 -1
- package/dist/components/SynapseTable/SynapseTableCell/SynapseTableCell.js +122 -122
- package/dist/components/SynapseTable/SynapseTableCell/SynapseTableCell.js.map +1 -1
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js +5 -5
- package/dist/components/TableColumnSchemaEditor/ColumnModelForm.js +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaEditor.js +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js +1 -1
- package/dist/components/TableFeedCards/TableFeedCards.js +9 -9
- package/dist/components/TermsAndConditions/TermsAndConditionsItem.js +10 -10
- package/dist/components/TimelinePlot/TimelinePlotSpeciesSelector.js +9 -9
- package/dist/components/UserSearchBox/UserSearchBox.d.ts +23 -0
- package/dist/components/UserSearchBox/UserSearchBox.d.ts.map +1 -0
- package/dist/components/UserSearchBox/UserSearchBox.js +146 -0
- package/dist/components/UserSearchBox/UserSearchBox.js.map +1 -0
- package/dist/components/WikiMarkdownEditorButton/WikiMarkdownEditorButton.js +13 -13
- package/dist/components/WizardChoiceButton/WizardChoiceButton.js +3 -3
- package/dist/components/dataaccess/AccessHistoryDashboard.js +5 -5
- package/dist/components/dataaccess/AccessHistoryDashboard.js.map +1 -1
- package/dist/components/dataaccess/AccessRequirementDashboard.js +4 -4
- package/dist/components/dataaccess/AccessRequirementDashboard.js.map +1 -1
- package/dist/components/dataaccess/AccessSubmissionDashboard.js +1 -1
- package/dist/components/dataaccess/AccessSubmissionDashboard.js.map +1 -1
- package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js +5 -5
- package/dist/components/dataaccess/UseAccessRequirementTable.js +3 -3
- package/dist/components/dataaccess/UseAccessRequirementTable.js.map +1 -1
- package/dist/components/doi/CreateOrUpdateDoiModal.js +1 -1
- package/dist/components/download_list/AddToDownloadListConfirmationAlert/AddToDownloadListConfirmationAlert.js +2 -2
- package/dist/components/entity/metadata/EntityModal.js +1 -1
- package/dist/components/entity/metadata/MetadataTable.js +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +1 -1
- package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.js +1 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.js +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +27 -26
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
- package/dist/components/index.js +109 -107
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/InfiniteTableLayout.js +1 -1
- package/dist/components/styled/HoverPopover.css +1 -0
- package/dist/components/styled/HoverPopover.d.ts +28 -0
- package/dist/components/styled/HoverPopover.d.ts.map +1 -0
- package/dist/components/styled/HoverPopover.js +103 -0
- package/dist/components/styled/HoverPopover.js.map +1 -0
- package/dist/components/styled/HoverPopover.module.scss +9 -0
- package/dist/components/styled/HoverPopover.module.scss.js +10 -0
- package/dist/components/styled/HoverPopover.module.scss.js.map +1 -0
- package/dist/components/styled/index.d.ts +2 -0
- package/dist/components/styled/index.d.ts.map +1 -1
- package/dist/components/styled/index.js +11 -9
- package/dist/components/styled/index.js.map +1 -1
- package/dist/components/table/CsvPreview/CsvPreview.js +2 -2
- package/dist/components/table/CsvPreview/CsvPreviewDialog.js +2 -2
- package/dist/components/widgets/Range.js +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js +35 -32
- package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
- package/dist/components/widgets/facet-nav/PlotsContainer.d.ts +1 -1
- package/dist/components/widgets/facet-nav/PlotsContainer.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/PlotsContainer.js +69 -68
- package/dist/components/widgets/facet-nav/PlotsContainer.js.map +1 -1
- package/dist/components/widgets/facet-nav/useFacetPlots.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/useFacetPlots.js +24 -21
- package/dist/components/widgets/facet-nav/useFacetPlots.js.map +1 -1
- package/dist/components/widgets/query-filter/FacetFilterControls.js +3 -3
- package/dist/features/curator/GridPage/GridPage.js +2 -2
- package/dist/features/curator/GridPage/components/GridPageTitle.js +2 -2
- package/dist/features/entity/metadata-task/hooks/useMetadataTaskTable.js +1 -1
- package/dist/index.js +157 -155
- package/dist/index.js.map +1 -1
- package/dist/mocks/msw/handlers/accessRequirementHandlers.js +5 -5
- package/dist/mocks/msw/handlers/projectStorageHandlers.js +5 -5
- package/dist/mocks/msw/handlers/wikiHandlers.js +1 -1
- package/dist/mocks/msw/handlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers.js +67 -59
- package/dist/mocks/msw/handlers.js.map +1 -1
- package/dist/style/base/_core.scss +0 -1
- package/dist/style/components/_all.scss +0 -1
- package/dist/style/components/_entity-badge.scss +0 -2
- package/dist/style/components/_expandable_table_data.scss +3 -3
- package/dist/style/components/facet_nav/_facet-nav-panel.scss +3 -0
- package/dist/style/components/facet_nav/_facet-nav.scss +4 -0
- package/dist/style/main.css +1 -1
- package/dist/synapse-client/SynapseClient.js +118 -118
- package/dist/synapse-client/SynapseClient.js.map +1 -1
- package/dist/synapse-queries/auth/useOIDC.js +1 -1
- package/dist/synapse-queries/auth/useTwoFactorEnrollment.js +1 -1
- package/dist/synapse-queries/entity/index.js +6 -6
- package/dist/synapse-queries/grid/useEstablishWebsocketConnection.js +1 -1
- package/dist/synapse-queries/index.js +1 -1
- package/dist/synapse-queries/user/usePersonalAccessToken.js +1 -1
- package/dist/testutils/vitest.setup.js +10 -11
- package/dist/testutils/vitest.setup.js.map +1 -1
- package/dist/theme/DefaultTheme.js +1 -1
- package/dist/theme/ThemeProvider.d.ts +2 -1
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +11 -10
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/mergeTheme.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/AppUtils/AppUtils.js +1 -1
- package/dist/utils/functions/SanitizeHtmlUtils.d.ts.map +1 -1
- package/dist/utils/functions/SanitizeHtmlUtils.js +34 -40
- package/dist/utils/functions/SanitizeHtmlUtils.js.map +1 -1
- package/dist/utils/functions/deepLinkingUtils.js +10 -10
- package/dist/utils/functions/deepLinkingUtils.js.map +1 -1
- package/dist/utils/hooks/index.js +6 -6
- package/dist/utils/hooks/useDetectSSOCode.js +3 -3
- package/dist/utils/hooks/useGetEntityMetadata.js +1 -1
- package/dist/utils/hooks/useNativeSearchParams.d.ts.map +1 -1
- package/dist/utils/hooks/useNativeSearchParams.js +1 -1
- package/dist/utils/hooks/useNativeSearchParams.js.map +1 -1
- package/dist/utils/hooks/useOneSageURL.d.ts.map +1 -1
- package/dist/utils/hooks/useOneSageURL.js +15 -15
- package/dist/utils/hooks/useOneSageURL.js.map +1 -1
- package/dist/utils/hooks/useSourceAppConfigs.d.ts +1 -0
- package/dist/utils/hooks/useSourceAppConfigs.d.ts.map +1 -1
- package/dist/utils/hooks/useSourceAppConfigs.js +79 -77
- package/dist/utils/hooks/useSourceAppConfigs.js.map +1 -1
- package/dist/utils/index.js +4 -4
- package/package.json +14 -15
- package/dist/_virtual/index.js +0 -6
- package/dist/_virtual/index.js.map +0 -1
- package/dist/_virtual/index2.js +0 -5
- package/dist/_virtual/index2.js.map +0 -1
- package/dist/_virtual/index3.js +0 -5
- package/dist/_virtual/index3.js.map +0 -1
- package/dist/_virtual/index4.js +0 -5
- package/dist/_virtual/index4.js.map +0 -1
- package/dist/_virtual/index5.js +0 -5
- package/dist/_virtual/index5.js.map +0 -1
- package/dist/assets/homepage/nci.svg +0 -6
- package/dist/assets/homepage/nci.svg.js +0 -7
- package/dist/assets/homepage/nci.svg.js.map +0 -1
- package/dist/assets/homepage/nih-mental.svg +0 -9
- package/dist/assets/homepage/nih-mental.svg.js +0 -7
- package/dist/assets/homepage/nih-mental.svg.js.map +0 -1
- package/dist/components/UserSearchBox/UserSearchBoxV2.d.ts +0 -21
- package/dist/components/UserSearchBox/UserSearchBoxV2.d.ts.map +0 -1
- package/dist/components/UserSearchBox/UserSearchBoxV2.js +0 -144
- package/dist/components/UserSearchBox/UserSearchBoxV2.js.map +0 -1
- package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js +0 -53
- package/dist/node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js.map +0 -1
- package/dist/node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js +0 -948
- package/dist/node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js.map +0 -1
- package/dist/node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js +0 -30
- package/dist/node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js.map +0 -1
- package/dist/node_modules/.pnpm/vite-plugin-node-polyfills@0.17.0_rollup@4.55.1_vite@7.3.1_@types_node@22.19.13_sass@1._2da6e8f78437c36f3eb7db51bdd4d89e/node_modules/vite-plugin-node-polyfills/shims/dist/index.js +0 -15
- package/dist/node_modules/.pnpm/vite-plugin-node-polyfills@0.17.0_rollup@4.55.1_vite@7.3.1_@types_node@22.19.13_sass@1._2da6e8f78437c36f3eb7db51bdd4d89e/node_modules/vite-plugin-node-polyfills/shims/dist/index.js.map +0 -1
- package/dist/style/components/_user-search-box.scss +0 -30
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { screen as r, waitFor as a, within as i } from "@testing-library/react";
|
|
2
2
|
import { REMOVE_BUTTON_LABEL as m } from "./ResourceAccessItem.js";
|
|
3
3
|
import { PUBLIC_GROUP_DISPLAY_TEXT as B, AUTHENTICATED_GROUP_DISPLAY_TEXT as T } from "../TeamBadge.js";
|
|
4
|
-
import {
|
|
5
|
-
function u(
|
|
6
|
-
return
|
|
4
|
+
import { ADD_PUBLIC_PRINCIPALS_BUTTON_TEXT as x, ADD_PRINCIPAL_TO_ACL_COMBOBOX_LABEL as y } from "./AclEditor.js";
|
|
5
|
+
function u(e, n) {
|
|
6
|
+
return e.find((t) => i(t).queryByText(n, { exact: !1 }));
|
|
7
7
|
}
|
|
8
|
-
async function R(
|
|
9
|
-
let
|
|
8
|
+
async function R(e, n, t) {
|
|
9
|
+
let o;
|
|
10
10
|
try {
|
|
11
11
|
await a(() => {
|
|
12
|
-
|
|
12
|
+
o = u(e, n), expect(o).toBeInTheDocument();
|
|
13
13
|
});
|
|
14
14
|
} catch (l) {
|
|
15
15
|
throw r.debug(), new Error(`Principal ${n} not found in ACL`, { cause: l });
|
|
16
16
|
}
|
|
17
|
-
const c = i(
|
|
18
|
-
return c ? expect(c).toHaveTextContent(t) : i(
|
|
17
|
+
const c = i(o).queryByRole("combobox");
|
|
18
|
+
return c ? expect(c).toHaveTextContent(t) : i(o).getByText(t), o;
|
|
19
19
|
}
|
|
20
|
-
function b(
|
|
21
|
-
expect(i(
|
|
20
|
+
function b(e, n, t) {
|
|
21
|
+
expect(i(e).queryByRole("link") ?? e).toHaveTextContent(
|
|
22
22
|
n
|
|
23
23
|
);
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const o = i(e).queryByRole("combobox");
|
|
25
|
+
o ? expect(o).toHaveTextContent(t) : i(e).getByText(t);
|
|
26
26
|
}
|
|
27
|
-
async function d(
|
|
28
|
-
const
|
|
27
|
+
async function d(e, n, t = !0) {
|
|
28
|
+
const o = i(e).getByRole("button", {
|
|
29
29
|
name: m
|
|
30
30
|
});
|
|
31
|
-
await n.click(
|
|
32
|
-
expect(
|
|
31
|
+
await n.click(o), t && await a(() => {
|
|
32
|
+
expect(o).not.toBeInTheDocument(), expect(e).not.toBeInTheDocument();
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
async function h(
|
|
36
|
-
const
|
|
37
|
-
await n.click(
|
|
35
|
+
async function h(e, n, t) {
|
|
36
|
+
const o = i(e).getByRole("combobox");
|
|
37
|
+
await n.click(o);
|
|
38
38
|
const c = r.getByRole("option", {
|
|
39
39
|
name: t
|
|
40
40
|
});
|
|
@@ -42,30 +42,30 @@ async function h(o, n, t) {
|
|
|
42
42
|
expect(c).not.toBeInTheDocument();
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function w() {
|
|
46
46
|
return r.queryByRole("combobox", {
|
|
47
|
-
name:
|
|
47
|
+
name: y
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
async function A(
|
|
51
|
-
const t =
|
|
52
|
-
expect(t).toBeInTheDocument(), await
|
|
53
|
-
const
|
|
54
|
-
await
|
|
50
|
+
async function A(e, n) {
|
|
51
|
+
const t = w();
|
|
52
|
+
expect(t).toBeInTheDocument(), await e.clear(t), await e.type(t, n);
|
|
53
|
+
const o = await r.findByText(new RegExp(`\\(@${n}\\)`));
|
|
54
|
+
await e.click(o), await a(() => expect(o).not.toBeInTheDocument());
|
|
55
55
|
const c = r.getAllByRole("row");
|
|
56
56
|
return c[c.length - 1];
|
|
57
57
|
}
|
|
58
|
-
async function _(
|
|
58
|
+
async function _(e) {
|
|
59
59
|
const n = r.getByRole("button", {
|
|
60
|
-
name:
|
|
60
|
+
name: x
|
|
61
61
|
});
|
|
62
|
-
await
|
|
63
|
-
let t = [],
|
|
62
|
+
await e.click(n);
|
|
63
|
+
let t = [], o, c;
|
|
64
64
|
return await a(() => {
|
|
65
|
-
t = r.getAllByRole("row"),
|
|
65
|
+
t = r.getAllByRole("row"), o = u(t, B), c = u(
|
|
66
66
|
t,
|
|
67
67
|
T
|
|
68
|
-
), expect(
|
|
68
|
+
), expect(o).toBeInTheDocument(), expect(c).toBeInTheDocument();
|
|
69
69
|
}), {
|
|
70
70
|
publicRow: t[t.length - 2],
|
|
71
71
|
authenticatedUsersRow: t[t.length - 1]
|
|
@@ -76,7 +76,7 @@ export {
|
|
|
76
76
|
A as addUserToAcl,
|
|
77
77
|
b as confirmItem,
|
|
78
78
|
R as confirmItemViaQuery,
|
|
79
|
-
|
|
79
|
+
w as queryForAddUserCombobox,
|
|
80
80
|
u as queryForRowWithPrincipalName,
|
|
81
81
|
d as removeItem,
|
|
82
82
|
h as updatePermissionLevel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AclEditor.test-utils.js","sources":["../../../src/components/AclEditor/AclEditor.test-utils.ts"],"sourcesContent":["import userEvent from '@testing-library/user-event'\nimport { screen, waitFor, within } from '@testing-library/react'\nimport { REMOVE_BUTTON_LABEL } from './ResourceAccessItem'\nimport {\n AUTHENTICATED_GROUP_DISPLAY_TEXT,\n PUBLIC_GROUP_DISPLAY_TEXT,\n} from '../TeamBadge'\nimport {\n ADD_PRINCIPAL_TO_ACL_COMBOBOX_LABEL,\n ADD_PUBLIC_PRINCIPALS_BUTTON_TEXT,\n} from './AclEditor'\n\n/**\n * Find a row in the ACL editor that contains the specified principal name.\n * @param rows\n * @param principalName\n */\nexport function queryForRowWithPrincipalName(\n rows: HTMLElement[],\n principalName: string,\n) {\n return rows.find(row => {\n return within(row).queryByText(principalName, { exact: false })\n })\n}\n\n/**\n * Verify that a row in the ACL editor contains the expected principal name and access type.\n * @param rows\n * @param principalName\n * @param accessTypeLabel\n */\nexport async function confirmItemViaQuery(\n rows: HTMLElement[],\n principalName: string,\n accessTypeLabel: string,\n) {\n let row: HTMLElement | undefined\n try {\n await waitFor(() => {\n row = queryForRowWithPrincipalName(rows, principalName)!\n expect(row).toBeInTheDocument()\n })\n } catch (e) {\n screen.debug()\n throw new Error(`Principal ${principalName} not found in ACL`, { cause: e })\n }\n\n const editorCombobox = within(row!).queryByRole('combobox')\n if (editorCombobox) {\n expect(editorCombobox).toHaveTextContent(accessTypeLabel)\n } else {\n within(row!).getByText(accessTypeLabel)\n }\n return row!\n}\n\n/**\n * Verify that a row in the ACL editor contains the expected principal name and access type.\n * @param row\n * @param principalName\n * @param accessTypeLabel\n */\nexport function confirmItem(\n row: HTMLElement,\n principalName: string,\n accessTypeLabel: string,\n) {\n expect(within(row).queryByRole('link') ?? row).toHaveTextContent(\n principalName,\n )\n const editorCombobox = within(row).queryByRole('combobox')\n if (editorCombobox) {\n expect(editorCombobox).toHaveTextContent(accessTypeLabel)\n } else {\n within(row).getByText(accessTypeLabel)\n }\n}\n\n/**\n * Remove a particular row from the HTML editor.\n * @param row\n * @param user\n * @param verifyRemoval\n */\nexport async function removeItem(\n row: HTMLElement,\n user: ReturnType<(typeof userEvent)['setup']>,\n verifyRemoval = true,\n) {\n const removeButton = within(row).getByRole('button', {\n name: REMOVE_BUTTON_LABEL,\n })\n await user.click(removeButton)\n if (verifyRemoval) {\n await waitFor(() => {\n expect(removeButton).not.toBeInTheDocument()\n expect(row).not.toBeInTheDocument()\n })\n }\n}\n\n/**\n * Updates the permission level of a particular row in the ACL editor.\n * @param row\n * @param user\n * @param updatedPermissionLevelLabel\n */\nexport async function updatePermissionLevel(\n row: HTMLElement,\n user: ReturnType<(typeof userEvent)['setup']>,\n updatedPermissionLevelLabel: string,\n) {\n const menu = within(row).getByRole('combobox')\n await user.click(menu)\n\n const option = screen.getByRole('option', {\n name: updatedPermissionLevelLabel,\n })\n await user.click(option)\n\n await waitFor(() => {\n expect(option).not.toBeInTheDocument()\n })\n}\n\nexport function queryForAddUserCombobox() {\n return screen.queryByRole('combobox', {\n name: ADD_PRINCIPAL_TO_ACL_COMBOBOX_LABEL,\n })\n}\n\n/**\n * Adds a user to the ACL editor.\n * @param user\n * @param userName\n */\nexport async function addUserToAcl(\n user: ReturnType<(typeof userEvent)['setup']>,\n userName: string,\n) {\n const userInput = queryForAddUserCombobox()!\n expect(userInput).toBeInTheDocument()\n await user.type(userInput, userName)\n\n const option = await screen.findByText(new RegExp(`\\\\(@${userName}\\\\)`))\n await user.click(option)\n\n await waitFor(() => expect(option).not.toBeInTheDocument())\n const rows = screen.getAllByRole('row')\n return rows[rows.length - 1]\n}\n\n/**\n * Adds public / authenticated groups to the ACL editor.\n * @param user\n */\nexport async function addPublicToAcl(\n user: ReturnType<(typeof userEvent)['setup']>,\n) {\n const makePublicButton = screen.getByRole('button', {\n name: ADD_PUBLIC_PRINCIPALS_BUTTON_TEXT,\n })\n await user.click(makePublicButton)\n\n let rows: HTMLElement[] = []\n let publicRow: HTMLElement | undefined = undefined\n let authenticatedUsersRow: HTMLElement | undefined = undefined\n await waitFor(() => {\n rows = screen.getAllByRole('row')\n publicRow = queryForRowWithPrincipalName(rows, PUBLIC_GROUP_DISPLAY_TEXT)\n authenticatedUsersRow = queryForRowWithPrincipalName(\n rows,\n AUTHENTICATED_GROUP_DISPLAY_TEXT,\n )\n expect(publicRow).toBeInTheDocument()\n expect(authenticatedUsersRow).toBeInTheDocument()\n })\n\n return {\n publicRow: rows[rows.length - 2],\n authenticatedUsersRow: rows[rows.length - 1],\n }\n}\n"],"names":["queryForRowWithPrincipalName","rows","principalName","row","within","confirmItemViaQuery","accessTypeLabel","waitFor","e","screen","editorCombobox","confirmItem","removeItem","user","verifyRemoval","removeButton","REMOVE_BUTTON_LABEL","updatePermissionLevel","updatedPermissionLevelLabel","menu","option","queryForAddUserCombobox","ADD_PRINCIPAL_TO_ACL_COMBOBOX_LABEL","addUserToAcl","userName","userInput","addPublicToAcl","makePublicButton","ADD_PUBLIC_PRINCIPALS_BUTTON_TEXT","publicRow","authenticatedUsersRow","PUBLIC_GROUP_DISPLAY_TEXT","AUTHENTICATED_GROUP_DISPLAY_TEXT"],"mappings":";;;;AAiBO,SAASA,EACdC,GACAC,GACA;AACA,SAAOD,EAAK,KAAK,CAAAE,MACRC,EAAOD,CAAG,EAAE,YAAYD,GAAe,EAAE,OAAO,IAAO,CAC/D;AACH;AAQA,eAAsBG,EACpBJ,GACAC,GACAI,GACA;AACA,MAAIH;AACJ,MAAI;AACF,UAAMI,EAAQ,MAAM;AAClB,MAAAJ,IAAMH,EAA6BC,GAAMC,CAAa,GACtD,OAAOC,CAAG,EAAE,kBAAA;AAAA,IACd,CAAC;AAAA,EACH,SAASK,GAAG;AACV,UAAAC,EAAO,MAAA,GACD,IAAI,MAAM,aAAaP,CAAa,qBAAqB,EAAE,OAAOM,GAAG;AAAA,EAC7E;AAEA,QAAME,IAAiBN,EAAOD,CAAI,EAAE,YAAY,UAAU;AAC1D,SAAIO,IACF,OAAOA,CAAc,EAAE,kBAAkBJ,CAAe,IAExDF,EAAOD,CAAI,EAAE,UAAUG,CAAe,GAEjCH;AACT;AAQO,SAASQ,EACdR,GACAD,GACAI,GACA;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CAAM,EAAE,IAAI,mBAAmB;AAC1D,QAAMnB,IAAOQ,EAAO,aAAa,KAAK;AACtC,SAAOR,EAAKA,EAAK,SAAS,CAAC;AAC7B;AAMA,eAAsByB,EACpBb,GACA;AACA,QAAMc,IAAmBlB,EAAO,UAAU,UAAU;AAAA,IAClD,MAAMmB;AAAA,EAAA,CACP;AACD,QAAMf,EAAK,MAAMc,CAAgB;AAEjC,MAAI1B,IAAsB,CAAA,GACtB4B,GACAC;AACJ,eAAMvB,EAAQ,MAAM;AAClB,IAAAN,IAAOQ,EAAO,aAAa,KAAK,GAChCoB,IAAY7B,EAA6BC,GAAM8B,CAAyB,GACxED,IAAwB9B;AAAA,MACtBC;AAAA,MACA+B;AAAA,IAAA,GAEF,OAAOH,CAAS,EAAE,kBAAA,GAClB,OAAOC,CAAqB,EAAE,kBAAA;AAAA,EAChC,CAAC,GAEM;AAAA,IACL,WAAW7B,EAAKA,EAAK,SAAS,CAAC;AAAA,IAC/B,uBAAuBA,EAAKA,EAAK,SAAS,CAAC;AAAA,EAAA;AAE/C;"}
|
|
1
|
+
{"version":3,"file":"AclEditor.test-utils.js","sources":["../../../src/components/AclEditor/AclEditor.test-utils.ts"],"sourcesContent":["import userEvent from '@testing-library/user-event'\nimport { screen, waitFor, within } from '@testing-library/react'\nimport { REMOVE_BUTTON_LABEL } from './ResourceAccessItem'\nimport {\n AUTHENTICATED_GROUP_DISPLAY_TEXT,\n PUBLIC_GROUP_DISPLAY_TEXT,\n} from '../TeamBadge'\nimport {\n ADD_PRINCIPAL_TO_ACL_COMBOBOX_LABEL,\n ADD_PUBLIC_PRINCIPALS_BUTTON_TEXT,\n} from './AclEditor'\n\n/**\n * Find a row in the ACL editor that contains the specified principal name.\n * @param rows\n * @param principalName\n */\nexport function queryForRowWithPrincipalName(\n rows: HTMLElement[],\n principalName: string,\n) {\n return rows.find(row => {\n return within(row).queryByText(principalName, { exact: false })\n })\n}\n\n/**\n * Verify that a row in the ACL editor contains the expected principal name and access type.\n * @param rows\n * @param principalName\n * @param accessTypeLabel\n */\nexport async function confirmItemViaQuery(\n rows: HTMLElement[],\n principalName: string,\n accessTypeLabel: string,\n) {\n let row: HTMLElement | undefined\n try {\n await waitFor(() => {\n row = queryForRowWithPrincipalName(rows, principalName)!\n expect(row).toBeInTheDocument()\n })\n } catch (e) {\n screen.debug()\n throw new Error(`Principal ${principalName} not found in ACL`, { cause: e })\n }\n\n const editorCombobox = within(row!).queryByRole('combobox')\n if (editorCombobox) {\n expect(editorCombobox).toHaveTextContent(accessTypeLabel)\n } else {\n within(row!).getByText(accessTypeLabel)\n }\n return row!\n}\n\n/**\n * Verify that a row in the ACL editor contains the expected principal name and access type.\n * @param row\n * @param principalName\n * @param accessTypeLabel\n */\nexport function confirmItem(\n row: HTMLElement,\n principalName: string,\n accessTypeLabel: string,\n) {\n expect(within(row).queryByRole('link') ?? row).toHaveTextContent(\n principalName,\n )\n const editorCombobox = within(row).queryByRole('combobox')\n if (editorCombobox) {\n expect(editorCombobox).toHaveTextContent(accessTypeLabel)\n } else {\n within(row).getByText(accessTypeLabel)\n }\n}\n\n/**\n * Remove a particular row from the HTML editor.\n * @param row\n * @param user\n * @param verifyRemoval\n */\nexport async function removeItem(\n row: HTMLElement,\n user: ReturnType<(typeof userEvent)['setup']>,\n verifyRemoval = true,\n) {\n const removeButton = within(row).getByRole('button', {\n name: REMOVE_BUTTON_LABEL,\n })\n await user.click(removeButton)\n if (verifyRemoval) {\n await waitFor(() => {\n expect(removeButton).not.toBeInTheDocument()\n expect(row).not.toBeInTheDocument()\n })\n }\n}\n\n/**\n * Updates the permission level of a particular row in the ACL editor.\n * @param row\n * @param user\n * @param updatedPermissionLevelLabel\n */\nexport async function updatePermissionLevel(\n row: HTMLElement,\n user: ReturnType<(typeof userEvent)['setup']>,\n updatedPermissionLevelLabel: string,\n) {\n const menu = within(row).getByRole('combobox')\n await user.click(menu)\n\n const option = screen.getByRole('option', {\n name: updatedPermissionLevelLabel,\n })\n await user.click(option)\n\n await waitFor(() => {\n expect(option).not.toBeInTheDocument()\n })\n}\n\nexport function queryForAddUserCombobox() {\n return screen.queryByRole('combobox', {\n name: ADD_PRINCIPAL_TO_ACL_COMBOBOX_LABEL,\n })\n}\n\n/**\n * Adds a user to the ACL editor.\n * @param user\n * @param userName\n */\nexport async function addUserToAcl(\n user: ReturnType<(typeof userEvent)['setup']>,\n userName: string,\n) {\n const userInput = queryForAddUserCombobox()!\n expect(userInput).toBeInTheDocument()\n await user.clear(userInput)\n await user.type(userInput, userName)\n\n const option = await screen.findByText(new RegExp(`\\\\(@${userName}\\\\)`))\n await user.click(option)\n\n await waitFor(() => expect(option).not.toBeInTheDocument())\n const rows = screen.getAllByRole('row')\n return rows[rows.length - 1]\n}\n\n/**\n * Adds public / authenticated groups to the ACL editor.\n * @param user\n */\nexport async function addPublicToAcl(\n user: ReturnType<(typeof userEvent)['setup']>,\n) {\n const makePublicButton = screen.getByRole('button', {\n name: ADD_PUBLIC_PRINCIPALS_BUTTON_TEXT,\n })\n await user.click(makePublicButton)\n\n let rows: HTMLElement[] = []\n let publicRow: HTMLElement | undefined = undefined\n let authenticatedUsersRow: HTMLElement | undefined = undefined\n await waitFor(() => {\n rows = screen.getAllByRole('row')\n publicRow = queryForRowWithPrincipalName(rows, PUBLIC_GROUP_DISPLAY_TEXT)\n authenticatedUsersRow = queryForRowWithPrincipalName(\n rows,\n AUTHENTICATED_GROUP_DISPLAY_TEXT,\n )\n expect(publicRow).toBeInTheDocument()\n expect(authenticatedUsersRow).toBeInTheDocument()\n })\n\n return {\n publicRow: rows[rows.length - 2],\n authenticatedUsersRow: rows[rows.length - 1],\n }\n}\n"],"names":["queryForRowWithPrincipalName","rows","principalName","row","within","confirmItemViaQuery","accessTypeLabel","waitFor","e","screen","editorCombobox","confirmItem","removeItem","user","verifyRemoval","removeButton","REMOVE_BUTTON_LABEL","updatePermissionLevel","updatedPermissionLevelLabel","menu","option","queryForAddUserCombobox","ADD_PRINCIPAL_TO_ACL_COMBOBOX_LABEL","addUserToAcl","userName","userInput","addPublicToAcl","makePublicButton","ADD_PUBLIC_PRINCIPALS_BUTTON_TEXT","publicRow","authenticatedUsersRow","PUBLIC_GROUP_DISPLAY_TEXT","AUTHENTICATED_GROUP_DISPLAY_TEXT"],"mappings":";;;;AAiBO,SAASA,EACdC,GACAC,GACA;AACA,SAAOD,EAAK,KAAK,CAAAE,MACRC,EAAOD,CAAG,EAAE,YAAYD,GAAe,EAAE,OAAO,IAAO,CAC/D;AACH;AAQA,eAAsBG,EACpBJ,GACAC,GACAI,GACA;AACA,MAAIH;AACJ,MAAI;AACF,UAAMI,EAAQ,MAAM;AAClB,MAAAJ,IAAMH,EAA6BC,GAAMC,CAAa,GACtD,OAAOC,CAAG,EAAE,kBAAA;AAAA,IACd,CAAC;AAAA,EACH,SAASK,GAAG;AACV,UAAAC,EAAO,MAAA,GACD,IAAI,MAAM,aAAaP,CAAa,qBAAqB,EAAE,OAAOM,GAAG;AAAA,EAC7E;AAEA,QAAME,IAAiBN,EAAOD,CAAI,EAAE,YAAY,UAAU;AAC1D,SAAIO,IACF,OAAOA,CAAc,EAAE,kBAAkBJ,CAAe,IAExDF,EAAOD,CAAI,EAAE,UAAUG,CAAe,GAEjCH;AACT;AAQO,SAASQ,EACdR,GACAD,GACAI,GACA;AACA,SAAOF,EAAOD,CAAG,EAAE,YAAY,MAAM,KAAKA,CAAG,EAAE;AAAA,IAC7CD;AAAA,EAAA;AAEF,QAAMQ,IAAiBN,EAAOD,CAAG,EAAE,YAAY,UAAU;AACzD,EAAIO,IACF,OAAOA,CAAc,EAAE,kBAAkBJ,CAAe,IAExDF,EAAOD,CAAG,EAAE,UAAUG,CAAe;AAEzC;AAQA,eAAsBM,EACpBT,GACAU,GACAC,IAAgB,IAChB;AACA,QAAMC,IAAeX,EAAOD,CAAG,EAAE,UAAU,UAAU;AAAA,IACnD,MAAMa;AAAA,EAAA,CACP;AACD,QAAMH,EAAK,MAAME,CAAY,GACzBD,KACF,MAAMP,EA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CAAyB,GACxED,IAAwB9B;AAAA,MACtBC;AAAA,MACA+B;AAAA,IAAA,GAEF,OAAOH,CAAS,EAAE,kBAAA,GAClB,OAAOC,CAAqB,EAAE,kBAAA;AAAA,EAChC,CAAC,GAEM;AAAA,IACL,WAAW7B,EAAKA,EAAK,SAAS,CAAC;AAAA,IAC/B,uBAAuBA,EAAKA,EAAK,SAAS,CAAC;AAAA,EAAA;AAE/C;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as s,
|
|
1
|
+
import { jsxs as s, Fragment as d, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "../../synapse-client/SynapseClient.js";
|
|
3
3
|
import "@sage-bionetworks/synapse-client/generated/models/ErrorResponseCode";
|
|
4
4
|
import "@sage-bionetworks/synapse-client/generated/models/TwoFactorAuthErrorResponse";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwoFactorEnrollmentForm.d.ts","sourceRoot":"","sources":["../../../src/components/Authentication/TwoFactorEnrollmentForm.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"TwoFactorEnrollmentForm.d.ts","sourceRoot":"","sources":["../../../src/components/Authentication/TwoFactorEnrollmentForm.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAW5D;;;;GAIG;AACH,iBAAS,YAAY,CAAC,MAAM,EAAE,UAAU,UAEvC;AA6BD,eAAO,MAAM,oBAAoB,+HAC6F,CAAA;AAE9H,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,EAAE,UAAU,CAAA;IACtB,4BAA4B,EAAE,MAAM,IAAI,CAAA;IACxC,aAAa,EAAE,MAAM,IAAI,CAAA;CAC1B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,KAAK,EAAE,4BAA4B,2CA6NpC;AAED,eAAO,MAAM,yBAAyB;;CAAmB,CAAA"}
|
|
@@ -2,13 +2,14 @@ import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { StyledOuterContainer as I } from "../styled/LeftRightPanel.js";
|
|
3
3
|
import { useFinishTwoFactorEnrollment as k } from "../../synapse-queries/auth/useTwoFactorEnrollment.js";
|
|
4
4
|
import { styled as S, Box as s, Paper as E, IconButton as O, Typography as i, Link as a, Stack as y, Divider as x, Button as D } from "@mui/material";
|
|
5
|
-
import
|
|
5
|
+
import * as G from "qrcode";
|
|
6
6
|
import { useState as p, useRef as R, useEffect as B } from "react";
|
|
7
7
|
import W from "../FullWidthAlert/FullWidthAlert.js";
|
|
8
8
|
import _ from "../IconSvg/IconSvg.js";
|
|
9
9
|
import { SynapseSpinner as M } from "../LoadingScreen/LoadingScreen.js";
|
|
10
10
|
import Q from "../TextField/TextField.js";
|
|
11
11
|
import $ from "./TwoFactorSecretDialog.js";
|
|
12
|
+
const { toCanvas: j } = G;
|
|
12
13
|
function v(e) {
|
|
13
14
|
return `otpauth://totp/Synapse:${e.username}?secret=${e.secret}&issuer=Sage%20Bionetworks&algorithm=${e.alg}&digits=${e.digits}&period=${e.period}`;
|
|
14
15
|
}
|
|
@@ -36,7 +37,7 @@ const c = S(
|
|
|
36
37
|
gap: "18px"
|
|
37
38
|
}
|
|
38
39
|
})
|
|
39
|
-
),
|
|
40
|
+
), L = "https://help.synapse.org/docs/Managing-Your-Account.2055405596.html#Adding-Two-Factor-Authentication-(2FA)-to-your-account";
|
|
40
41
|
function J(e) {
|
|
41
42
|
const { onTwoFactorEnrollmentSuccess: b, onBackClicked: u, totpSecret: r } = e, [l, w] = p(""), [m, C] = p(!1), [A, f] = p(!1), d = R(null), {
|
|
42
43
|
mutate: F,
|
|
@@ -47,7 +48,7 @@ function J(e) {
|
|
|
47
48
|
});
|
|
48
49
|
return B(() => {
|
|
49
50
|
async function n() {
|
|
50
|
-
r && d.current && (await
|
|
51
|
+
r && d.current && (await j(d.current, v(r), {
|
|
51
52
|
version: 10,
|
|
52
53
|
margin: 0,
|
|
53
54
|
scale: 3.5
|
|
@@ -95,7 +96,7 @@ function J(e) {
|
|
|
95
96
|
" or ORCiD account, you may need to use 2FA as part of",
|
|
96
97
|
"that process as well.",
|
|
97
98
|
" ",
|
|
98
|
-
/* @__PURE__ */ t(a, { href:
|
|
99
|
+
/* @__PURE__ */ t(a, { href: L, children: "Learn more about 2FA" }),
|
|
99
100
|
"."
|
|
100
101
|
] })
|
|
101
102
|
] }),
|
|
@@ -251,7 +252,7 @@ function J(e) {
|
|
|
251
252
|
const Z = { toOtpAuthUrl: v };
|
|
252
253
|
export {
|
|
253
254
|
Z as EXPORTED_FOR_UNIT_TESTING,
|
|
254
|
-
|
|
255
|
+
L as TWO_FACTOR_DOCS_LINK,
|
|
255
256
|
J as default
|
|
256
257
|
};
|
|
257
258
|
//# sourceMappingURL=TwoFactorEnrollmentForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwoFactorEnrollmentForm.js","sources":["../../../src/components/Authentication/TwoFactorEnrollmentForm.tsx"],"sourcesContent":["import { StyledOuterContainer } from '@/components/styled/LeftRightPanel'\nimport { useFinishTwoFactorEnrollment } from '@/synapse-queries/auth/useTwoFactorEnrollment'\nimport { StyledComponent } from '@emotion/styled'\nimport {\n Box,\n BoxProps,\n Button,\n Divider,\n IconButton,\n Link,\n Paper,\n Stack,\n styled,\n Typography,\n} from '@mui/material'\nimport { TotpSecret } from '@sage-bionetworks/synapse-types'\nimport { toCanvas } from 'qrcode'\nimport { useEffect, useRef, useState } from 'react'\nimport FullWidthAlert from '../FullWidthAlert/FullWidthAlert'\nimport IconSvg from '../IconSvg/IconSvg'\nimport { SynapseSpinner } from '../LoadingScreen/LoadingScreen'\nimport TextField from '../TextField/TextField'\nimport TwoFactorSecretDialog from './TwoFactorSecretDialog'\n\n/**\n * Returns a URL that can be used to generate a QR code that 2FA authenticator apps can interpret.\n * This uses the username fro TotpSecret to create the friendly name for the account in the authenticator app.\n * @param secret\n */\nfunction toOtpAuthUrl(secret: TotpSecret) {\n return `otpauth://totp/Synapse:${secret.username}?secret=${secret.secret}&issuer=Sage%20Bionetworks&algorithm=${secret.alg}&digits=${secret.digits}&period=${secret.period}`\n}\n\nconst Section: StyledComponent<BoxProps> = styled(\n (props: BoxProps) => (\n <Box\n sx={{\n my: 3,\n ...props.sx,\n }}\n {...props}\n />\n ),\n {\n label: 'Section',\n },\n)(() => ({}))\n\nconst SectionInnerGrid = styled(Box, { label: 'SectionInnerGrid' })(\n ({ theme }) => ({\n display: 'grid',\n gridTemplateColumns: 'auto 200px',\n columnGap: theme.spacing(5),\n [theme.breakpoints.down('sm')]: {\n gridTemplateColumns: '1fr',\n gap: '18px',\n },\n }),\n)\n\nexport const TWO_FACTOR_DOCS_LINK =\n 'https://help.synapse.org/docs/Managing-Your-Account.2055405596.html#Adding-Two-Factor-Authentication-(2FA)-to-your-account'\n\nexport type TwoFactorEnrollmentFormProps = {\n totpSecret: TotpSecret\n onTwoFactorEnrollmentSuccess: () => void\n onBackClicked: () => void\n}\n\nexport default function TwoFactorEnrollmentForm(\n props: TwoFactorEnrollmentFormProps,\n) {\n const { onTwoFactorEnrollmentSuccess, onBackClicked, totpSecret } = props\n\n const [totp, setTotp] = useState('')\n const [hasQrCode, setHasQrCode] = useState(false)\n const [showSecretInModal, setShowSecretInModal] = useState(false)\n const qrCodeCanvasElement = useRef<HTMLCanvasElement>(null)\n\n const {\n mutate: finishEnrollment,\n isPending: isFinishingEnrollment,\n error,\n } = useFinishTwoFactorEnrollment({\n onSuccess: onTwoFactorEnrollmentSuccess,\n })\n\n useEffect(() => {\n async function createQrCode() {\n if (totpSecret && qrCodeCanvasElement.current) {\n await toCanvas(qrCodeCanvasElement.current, toOtpAuthUrl(totpSecret), {\n version: 10,\n margin: 0,\n scale: 3.5,\n })\n setHasQrCode(true)\n }\n }\n void createQrCode()\n }, [totpSecret])\n\n return (\n <StyledOuterContainer>\n <Paper\n sx={{\n position: 'relative',\n width: { xs: '100%', md: '800px' },\n py: 6.5,\n px: 8,\n mx: 'auto',\n }}\n >\n {onBackClicked && (\n <IconButton\n type=\"button\"\n onClick={() => {\n onBackClicked()\n }}\n sx={theme => ({\n position: 'absolute',\n top: theme.spacing(2),\n left: theme.spacing(2),\n })}\n >\n <IconSvg\n icon=\"arrowBack\"\n wrap={false}\n sx={{ height: '24px', width: '24px' }}\n />\n </IconButton>\n )}\n <Section>\n <Typography variant=\"headline2\" sx={{ mb: 3 }}>\n Activate Two-factor Authentication\n </Typography>\n <Typography variant=\"body1\">\n After setting up 2FA, you’ll use an authenticator app as part of\n your login process, in addition to your existing password. If you\n log in using your Google\n {/* eslint-disable-next-line no-constant-binary-expression -- Remove conditionality when NIH RAS login is supported */}\n {false && ', NIH RAS,'} or ORCiD account, you may need to use 2FA as\n part of\n {/*those processes*/}\n that process as well.{' '}\n <Link href={TWO_FACTOR_DOCS_LINK}>Learn more about 2FA</Link>.\n </Typography>\n </Section>\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 1. Get one of these apps\n </Typography>\n <Typography variant=\"body1\">\n Download and install one of these authentication apps to set up\n 2FA on your mobile device, tablet, or desktop. If you have one\n of these apps already installed, you can skip this step.\n </Typography>\n </Box>\n <Stack\n sx={theme => ({\n justifyContent: 'space-between',\n flexShrink: 0,\n [theme.breakpoints.down('sm')]: {\n gap: '20px',\n },\n })}\n >\n <Link href={'https://authy.com/download/'}>Authy</Link>\n <Link\n href={\n 'https://duo.com/product/multi-factor-authentication-mfa/duo-mobile-app'\n }\n >\n DUO Mobile\n </Link>\n <Link href={'https://googleauthenticator.net/'}>\n Google Authenticator\n </Link>\n <Link\n href={\n 'https://www.microsoft.com/en-us/security/mobile-authenticator-app'\n }\n >\n Microsoft Authenticator\n </Link>\n </Stack>\n </SectionInnerGrid>\n </Section>\n <Divider />\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 2. Scan the QR Code\n </Typography>\n <Typography component=\"ol\" variant=\"body1\" sx={{ pl: 2, my: 1 }}>\n <li>Open your authenticator app</li>\n <li>Tap the "+" button</li>\n <li>Use your camera to scan the image to the right</li>\n </Typography>\n <Link\n onClick={() => {\n setShowSecretInModal(true)\n }}\n >\n Can't use your camera?\n </Link>\n <TwoFactorSecretDialog\n secret={totpSecret?.secret ?? ''}\n open={showSecretInModal}\n onClose={() => setShowSecretInModal(false)}\n />\n </Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'middle',\n height: 'auto',\n }}\n >\n {!hasQrCode && <SynapseSpinner size={50} />}\n <canvas\n style={{ display: hasQrCode ? undefined : 'none' }}\n ref={qrCodeCanvasElement}\n />\n </Box>\n </SectionInnerGrid>\n </Section>\n <Divider />\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 3. Enter the Verification Code\n </Typography>\n <Typography variant=\"body1\">\n After scanning in the QR code in step 2, your app will provide a\n 6-digit code. Enter it in in the field to the right.\n </Typography>\n </Box>\n <form\n onSubmit={e => {\n e.preventDefault()\n finishEnrollment({\n secretId: totpSecret.secretId,\n totp,\n })\n }}\n >\n <Stack\n direction={'row'}\n sx={{\n gap: 2,\n height: '48px',\n }}\n >\n <TextField\n noWrapInFormControl\n autoFocus\n inputProps={{ maxLength: totpSecret?.digits }}\n value={totp}\n onChange={e => {\n setTotp(e.target.value)\n }}\n />\n <Button\n type={'submit'}\n variant={'contained'}\n sx={{ flexShrink: 0 }}\n disabled={\n isFinishingEnrollment || totp.length != totpSecret?.digits\n }\n >\n Activate\n </Button>\n </Stack>\n </form>\n </SectionInnerGrid>\n </Section>\n {error && (\n <FullWidthAlert\n variant={'danger'}\n isGlobal={false}\n description={error.reason}\n />\n )}\n </Paper>\n </StyledOuterContainer>\n )\n}\n\nexport const EXPORTED_FOR_UNIT_TESTING = { toOtpAuthUrl }\n"],"names":["toOtpAuthUrl","secret","Section","styled","props","jsx","Box","SectionInnerGrid","theme","TWO_FACTOR_DOCS_LINK","TwoFactorEnrollmentForm","onTwoFactorEnrollmentSuccess","onBackClicked","totpSecret","totp","setTotp","useState","hasQrCode","setHasQrCode","showSecretInModal","setShowSecretInModal","qrCodeCanvasElement","useRef","finishEnrollment","isFinishingEnrollment","error","useFinishTwoFactorEnrollment","useEffect","createQrCode","toCanvas","StyledOuterContainer","jsxs","Paper","IconButton","IconSvg","Typography","Link","Stack","Divider","TwoFactorSecretDialog","SynapseSpinner","e","TextField","Button","FullWidthAlert","EXPORTED_FOR_UNIT_TESTING"],"mappings":";;;;;;;;;;;AA6BA,SAASA,EAAaC,GAAoB;AACxC,SAAO,0BAA0BA,EAAO,QAAQ,WAAWA,EAAO,MAAM,wCAAwCA,EAAO,GAAG,WAAWA,EAAO,MAAM,WAAWA,EAAO,MAAM;AAC5K;AAEA,MAAMC,IAAqCC;AAAA,EACzC,CAACC,MACC,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,QACF,IAAI;AAAA,QACJ,GAAGF,EAAM;AAAA,MAAA;AAAA,MAEV,GAAGA;AAAA,IAAA;AAAA,EAAA;AAAA,EAGR;AAAA,IACE,OAAO;AAAA,EAAA;AAEX,EAAE,OAAO,CAAA,EAAG,GAENG,IAAmBJ,EAAOG,GAAK,EAAE,OAAO,oBAAoB;AAAA,EAChE,CAAC,EAAE,OAAAE,EAAA,OAAa;AAAA,IACd,SAAS;AAAA,IACT,qBAAqB;AAAA,IACrB,WAAWA,EAAM,QAAQ,CAAC;AAAA,IAC1B,CAACA,EAAM,YAAY,KAAK,IAAI,CAAC,GAAG;AAAA,MAC9B,qBAAqB;AAAA,MACrB,KAAK;AAAA,IAAA;AAAA,EACP;AAEJ,GAEaC,IACX;AAQF,SAAwBC,EACtBN,GACA;AACA,QAAM,EAAE,8BAAAO,GAA8B,eAAAC,GAAe,YA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sBAAA;AAAA,oBAAA;AAAA,oBAEF,gBAAApC;AAAA,sBAACsC;AAAA,sBAAA;AAAA,wBACC,MAAM;AAAA,wBACN,SAAS;AAAA,wBACT,IAAI,EAAE,YAAY,EAAA;AAAA,wBAClB,UACEnB,KAAyBV,EAAK,UAAUD,GAAY;AAAA,wBAEvD,UAAA;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAED;AAAA,gBAAA;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QACF,EAAA,CACF,EAAA,CACF;AAAA,QACCY,KACC,gBAAApB;AAAA,UAACuC;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT,UAAU;AAAA,YACV,aAAanB,EAAM;AAAA,UAAA;AAAA,QAAA;AAAA,MACrB;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;AAEO,MAAMoB,IAA4B,EAAE,cAAA7C,EAAA;"}
|
|
1
|
+
{"version":3,"file":"TwoFactorEnrollmentForm.js","sources":["../../../src/components/Authentication/TwoFactorEnrollmentForm.tsx"],"sourcesContent":["import { StyledOuterContainer } from '@/components/styled/LeftRightPanel'\nimport { useFinishTwoFactorEnrollment } from '@/synapse-queries/auth/useTwoFactorEnrollment'\nimport { StyledComponent } from '@emotion/styled'\nimport {\n Box,\n BoxProps,\n Button,\n Divider,\n IconButton,\n Link,\n Paper,\n Stack,\n styled,\n Typography,\n} from '@mui/material'\nimport { TotpSecret } from '@sage-bionetworks/synapse-types'\nimport * as qrcode from 'qrcode'\n// qrcode is CJS-only; use namespace import for Vite dev mode CJS interop.\nconst { toCanvas } = qrcode\nimport { useEffect, useRef, useState } from 'react'\nimport FullWidthAlert from '../FullWidthAlert/FullWidthAlert'\nimport IconSvg from '../IconSvg/IconSvg'\nimport { SynapseSpinner } from '../LoadingScreen/LoadingScreen'\nimport TextField from '../TextField/TextField'\nimport TwoFactorSecretDialog from './TwoFactorSecretDialog'\n\n/**\n * Returns a URL that can be used to generate a QR code that 2FA authenticator apps can interpret.\n * This uses the username fro TotpSecret to create the friendly name for the account in the authenticator app.\n * @param secret\n */\nfunction toOtpAuthUrl(secret: TotpSecret) {\n return `otpauth://totp/Synapse:${secret.username}?secret=${secret.secret}&issuer=Sage%20Bionetworks&algorithm=${secret.alg}&digits=${secret.digits}&period=${secret.period}`\n}\n\nconst Section: StyledComponent<BoxProps> = styled(\n (props: BoxProps) => (\n <Box\n sx={{\n my: 3,\n ...props.sx,\n }}\n {...props}\n />\n ),\n {\n label: 'Section',\n },\n)(() => ({}))\n\nconst SectionInnerGrid = styled(Box, { label: 'SectionInnerGrid' })(\n ({ theme }) => ({\n display: 'grid',\n gridTemplateColumns: 'auto 200px',\n columnGap: theme.spacing(5),\n [theme.breakpoints.down('sm')]: {\n gridTemplateColumns: '1fr',\n gap: '18px',\n },\n }),\n)\n\nexport const TWO_FACTOR_DOCS_LINK =\n 'https://help.synapse.org/docs/Managing-Your-Account.2055405596.html#Adding-Two-Factor-Authentication-(2FA)-to-your-account'\n\nexport type TwoFactorEnrollmentFormProps = {\n totpSecret: TotpSecret\n onTwoFactorEnrollmentSuccess: () => void\n onBackClicked: () => void\n}\n\nexport default function TwoFactorEnrollmentForm(\n props: TwoFactorEnrollmentFormProps,\n) {\n const { onTwoFactorEnrollmentSuccess, onBackClicked, totpSecret } = props\n\n const [totp, setTotp] = useState('')\n const [hasQrCode, setHasQrCode] = useState(false)\n const [showSecretInModal, setShowSecretInModal] = useState(false)\n const qrCodeCanvasElement = useRef<HTMLCanvasElement>(null)\n\n const {\n mutate: finishEnrollment,\n isPending: isFinishingEnrollment,\n error,\n } = useFinishTwoFactorEnrollment({\n onSuccess: onTwoFactorEnrollmentSuccess,\n })\n\n useEffect(() => {\n async function createQrCode() {\n if (totpSecret && qrCodeCanvasElement.current) {\n await toCanvas(qrCodeCanvasElement.current, toOtpAuthUrl(totpSecret), {\n version: 10,\n margin: 0,\n scale: 3.5,\n })\n setHasQrCode(true)\n }\n }\n void createQrCode()\n }, [totpSecret])\n\n return (\n <StyledOuterContainer>\n <Paper\n sx={{\n position: 'relative',\n width: { xs: '100%', md: '800px' },\n py: 6.5,\n px: 8,\n mx: 'auto',\n }}\n >\n {onBackClicked && (\n <IconButton\n type=\"button\"\n onClick={() => {\n onBackClicked()\n }}\n sx={theme => ({\n position: 'absolute',\n top: theme.spacing(2),\n left: theme.spacing(2),\n })}\n >\n <IconSvg\n icon=\"arrowBack\"\n wrap={false}\n sx={{ height: '24px', width: '24px' }}\n />\n </IconButton>\n )}\n <Section>\n <Typography variant=\"headline2\" sx={{ mb: 3 }}>\n Activate Two-factor Authentication\n </Typography>\n <Typography variant=\"body1\">\n After setting up 2FA, you’ll use an authenticator app as part of\n your login process, in addition to your existing password. If you\n log in using your Google\n {/* eslint-disable-next-line no-constant-binary-expression -- Remove conditionality when NIH RAS login is supported */}\n {false && ', NIH RAS,'} or ORCiD account, you may need to use 2FA as\n part of\n {/*those processes*/}\n that process as well.{' '}\n <Link href={TWO_FACTOR_DOCS_LINK}>Learn more about 2FA</Link>.\n </Typography>\n </Section>\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 1. Get one of these apps\n </Typography>\n <Typography variant=\"body1\">\n Download and install one of these authentication apps to set up\n 2FA on your mobile device, tablet, or desktop. If you have one\n of these apps already installed, you can skip this step.\n </Typography>\n </Box>\n <Stack\n sx={theme => ({\n justifyContent: 'space-between',\n flexShrink: 0,\n [theme.breakpoints.down('sm')]: {\n gap: '20px',\n },\n })}\n >\n <Link href={'https://authy.com/download/'}>Authy</Link>\n <Link\n href={\n 'https://duo.com/product/multi-factor-authentication-mfa/duo-mobile-app'\n }\n >\n DUO Mobile\n </Link>\n <Link href={'https://googleauthenticator.net/'}>\n Google Authenticator\n </Link>\n <Link\n href={\n 'https://www.microsoft.com/en-us/security/mobile-authenticator-app'\n }\n >\n Microsoft Authenticator\n </Link>\n </Stack>\n </SectionInnerGrid>\n </Section>\n <Divider />\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 2. Scan the QR Code\n </Typography>\n <Typography component=\"ol\" variant=\"body1\" sx={{ pl: 2, my: 1 }}>\n <li>Open your authenticator app</li>\n <li>Tap the "+" button</li>\n <li>Use your camera to scan the image to the right</li>\n </Typography>\n <Link\n onClick={() => {\n setShowSecretInModal(true)\n }}\n >\n Can't use your camera?\n </Link>\n <TwoFactorSecretDialog\n secret={totpSecret?.secret ?? ''}\n open={showSecretInModal}\n onClose={() => setShowSecretInModal(false)}\n />\n </Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'middle',\n height: 'auto',\n }}\n >\n {!hasQrCode && <SynapseSpinner size={50} />}\n <canvas\n style={{ display: hasQrCode ? undefined : 'none' }}\n ref={qrCodeCanvasElement}\n />\n </Box>\n </SectionInnerGrid>\n </Section>\n <Divider />\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 3. Enter the Verification Code\n </Typography>\n <Typography variant=\"body1\">\n After scanning in the QR code in step 2, your app will provide a\n 6-digit code. Enter it in in the field to the right.\n </Typography>\n </Box>\n <form\n onSubmit={e => {\n e.preventDefault()\n finishEnrollment({\n secretId: totpSecret.secretId,\n totp,\n })\n }}\n >\n <Stack\n direction={'row'}\n sx={{\n gap: 2,\n height: '48px',\n }}\n >\n <TextField\n noWrapInFormControl\n autoFocus\n inputProps={{ maxLength: totpSecret?.digits }}\n value={totp}\n onChange={e => {\n setTotp(e.target.value)\n }}\n />\n <Button\n type={'submit'}\n variant={'contained'}\n sx={{ flexShrink: 0 }}\n disabled={\n isFinishingEnrollment || totp.length != totpSecret?.digits\n }\n >\n Activate\n </Button>\n </Stack>\n </form>\n </SectionInnerGrid>\n </Section>\n {error && (\n <FullWidthAlert\n variant={'danger'}\n isGlobal={false}\n description={error.reason}\n />\n )}\n </Paper>\n </StyledOuterContainer>\n )\n}\n\nexport const EXPORTED_FOR_UNIT_TESTING = { toOtpAuthUrl }\n"],"names":["toCanvas","qrcode","toOtpAuthUrl","secret","Section","styled","props","jsx","Box","SectionInnerGrid","theme","TWO_FACTOR_DOCS_LINK","TwoFactorEnrollmentForm","onTwoFactorEnrollmentSuccess","onBackClicked","totpSecret","totp","setTotp","useState","hasQrCode","setHasQrCode","showSecretInModal","setShowSecretInModal","qrCodeCanvasElement","useRef","finishEnrollment","isFinishingEnrollment","error","useFinishTwoFactorEnrollment","useEffect","createQrCode","StyledOuterContainer","jsxs","Paper","IconButton","IconSvg","Typography","Link","Stack","Divider","TwoFactorSecretDialog","SynapseSpinner","e","TextField","Button","FullWidthAlert","EXPORTED_FOR_UNIT_TESTING"],"mappings":";;;;;;;;;;;AAkBA,MAAM,EAAE,UAAAA,MAAaC;AAarB,SAASC,EAAaC,GAAoB;AACxC,SAAO,0BAA0BA,EAAO,QAAQ,WAAWA,EAAO,MAAM,wCAAwCA,EAAO,GAAG,WAAWA,EAAO,MAAM,WAAWA,EAAO,MAAM;AAC5K;AAEA,MAAMC,IAAqCC;AAAA,EACzC,CAACC,MACC,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,QACF,IAAI;AAAA,QACJ,GAAGF,EAAM;AAAA,MAAA;AAAA,MAEV,GAAGA;AAAA,IAAA;AAAA,EAAA;AAAA,EAGR;AAAA,IACE,OAAO;AAAA,EAAA;AAEX,EAAE,OAAO,CAAA,EAAG,GAENG,IAAmBJ,EAAOG,GAAK,EAAE,OAAO,oBAAoB;AAAA,EAChE,CAAC,EAAE,OAAAE,EAAA,OAAa;AAAA,IACd,SAAS;AAAA,IACT,qBAAqB;AAAA,IACrB,WAAWA,EAAM,QAAQ,CAAC;AAAA,IAC1B,CAACA,EAAM,YAAY,KAAK,IAAI,CAAC,GAAG;AAAA,MAC9B,qBAAqB;AAAA,MACrB,KAAK;AAAA,IAAA;AAAA,EACP;AAEJ,GAEaC,IACX;AAQF,SAAwBC,EACtBN,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AAzB,EAAQyB,EAAE,OAAO,KAAK;AAAA,wBACxB;AAAA,sBAAA;AAAA,oBAAA;AAAA,oBAEF,gBAAAnC;AAAA,sBAACqC;AAAA,sBAAA;AAAA,wBACC,MAAM;AAAA,wBACN,SAAS;AAAA,wBACT,IAAI,EAAE,YAAY,EAAA;AAAA,wBAClB,UACElB,KAAyBV,EAAK,UAAUD,GAAY;AAAA,wBAEvD,UAAA;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAED;AAAA,gBAAA;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QACF,EAAA,CACF,EAAA,CACF;AAAA,QACCY,KACC,gBAAApB;AAAA,UAACsC;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT,UAAU;AAAA,YACV,aAAalB,EAAM;AAAA,UAAA;AAAA,QAAA;AAAA,MACrB;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;AAEO,MAAMmB,IAA4B,EAAE,cAAA5C,EAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._BasePortalCard__root_1hm6w_1.MuiCard-root{position:relative;display:flex;flex-direction:column}._BasePortalCard__contentBelow_1hm6w_7{margin-top:15px}._BasePortalCard__content_1hm6w_7.MuiCardContent-root:last-child{padding:0;flex:1;display:flex;flex-direction:column}._BasePortalCard__media_1hm6w_18{height:50%;flex-shrink:0;overflow:hidden;border-bottom:1px solid rgba(0,0,0,.05)}@media(min-width:768px){._BasePortalCard__media_1hm6w_18{height:60%}}._BasePortalCard__media_1hm6w_18 .MuiCardMedia-root{height:100%}._small_1hm6w_33{width:100%;height:250px;min-height:150px}@media(min-width:768px){._small_1hm6w_33{width:250px}}._medium_1hm6w_44{width:100%;height:400px;min-height:200px}@media(min-width:768px){._medium_1hm6w_44{width:400px}}._large_1hm6w_55{width:100%;height:500px;min-height:300px}@media(min-width:768px){._large_1hm6w_55{width:600px}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasePortalCard.d.ts","sourceRoot":"","sources":["../../../src/components/BasePortalCard/BasePortalCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxC,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,gBAAgB,CAAC,EAAE,SAAS,CAAA;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACvC,eAAe,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"BasePortalCard.d.ts","sourceRoot":"","sources":["../../../src/components/BasePortalCard/BasePortalCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxC,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,gBAAgB,CAAC,EAAE,SAAS,CAAA;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACvC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,QAAA,MAAM,cAAc,GAAI,mHASrB,mBAAmB,KAAG,KAAK,CAAC,SA2B9B,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Stack as C, Card as _, CardMedia as p, CardContent as
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as C, Card as _, CardMedia as p, CardContent as f } from "@mui/material";
|
|
3
3
|
import t from "@mui/material/Box";
|
|
4
4
|
import a from "./BasePortalCard.module.scss.js";
|
|
5
5
|
const N = ({
|
|
6
6
|
borderRadiusPx: m,
|
|
7
7
|
boxShadow: d,
|
|
8
|
-
children:
|
|
9
|
-
contentBelowCard:
|
|
10
|
-
cardSize:
|
|
8
|
+
children: i,
|
|
9
|
+
contentBelowCard: s,
|
|
10
|
+
cardSize: l = "medium",
|
|
11
11
|
className: c,
|
|
12
|
-
backgroundImage:
|
|
12
|
+
backgroundImage: e,
|
|
13
13
|
backgroundColor: n
|
|
14
|
-
}) => /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
14
|
+
}) => /* @__PURE__ */ o(C, { children: [
|
|
15
|
+
/* @__PURE__ */ o(
|
|
16
16
|
_,
|
|
17
17
|
{
|
|
18
|
-
className: `${c} ${a.BasePortalCard__root} ${a[
|
|
18
|
+
className: `${c} ${a.BasePortalCard__root} ${a[l]}`,
|
|
19
19
|
sx: {
|
|
20
20
|
backgroundColor: n,
|
|
21
21
|
borderRadius: m,
|
|
22
22
|
boxShadow: d
|
|
23
23
|
},
|
|
24
24
|
children: [
|
|
25
|
-
/* @__PURE__ */ r(t, { className: a.BasePortalCard__media, children:
|
|
26
|
-
/* @__PURE__ */ r(
|
|
25
|
+
/* @__PURE__ */ r(t, { className: a.BasePortalCard__media, children: typeof e == "string" ? /* @__PURE__ */ r(p, { image: e, component: "img" }) : e }),
|
|
26
|
+
/* @__PURE__ */ r(f, { className: a.BasePortalCard__content, children: i })
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
29
|
),
|
|
30
|
-
|
|
30
|
+
s && /* @__PURE__ */ r(t, { className: a.BasePortalCard__contentBelow, children: s })
|
|
31
31
|
] });
|
|
32
32
|
export {
|
|
33
33
|
N as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasePortalCard.js","sources":["../../../src/components/BasePortalCard/BasePortalCard.tsx"],"sourcesContent":["import { Card, CardContent, CardMedia, Stack } from '@mui/material'\nimport Box from '@mui/material/Box'\nimport React, { ReactNode } from 'react'\nimport styles from './BasePortalCard.module.scss'\n\ntype BasePortalCardProps = {\n children?: ReactNode\n contentBelowCard?: ReactNode\n borderRadiusPx?: number\n boxShadow?: string\n cardSize?: 'small' | 'medium' | 'large'\n backgroundImage?: string\n backgroundColor?: string\n className?: string\n}\n\nconst BasePortalCard = ({\n borderRadiusPx,\n boxShadow,\n children,\n contentBelowCard,\n cardSize = 'medium',\n className,\n backgroundImage,\n backgroundColor,\n}: BasePortalCardProps): React.ReactNode => (\n <Stack>\n <Card\n className={`${className} ${styles.BasePortalCard__root} ${styles[cardSize]}`}\n sx={{\n backgroundColor: backgroundColor,\n borderRadius: borderRadiusPx,\n boxShadow: boxShadow,\n }}\n >\n <Box className={styles.BasePortalCard__media}>\n {backgroundImage
|
|
1
|
+
{"version":3,"file":"BasePortalCard.js","sources":["../../../src/components/BasePortalCard/BasePortalCard.tsx"],"sourcesContent":["import { Card, CardContent, CardMedia, Stack } from '@mui/material'\nimport Box from '@mui/material/Box'\nimport React, { ReactNode } from 'react'\nimport styles from './BasePortalCard.module.scss'\n\ntype BasePortalCardProps = {\n children?: ReactNode\n contentBelowCard?: ReactNode\n borderRadiusPx?: number\n boxShadow?: string\n cardSize?: 'small' | 'medium' | 'large'\n backgroundImage?: string | ReactNode\n backgroundColor?: string\n className?: string\n}\n\nconst BasePortalCard = ({\n borderRadiusPx,\n boxShadow,\n children,\n contentBelowCard,\n cardSize = 'medium',\n className,\n backgroundImage,\n backgroundColor,\n}: BasePortalCardProps): React.ReactNode => (\n <Stack>\n <Card\n className={`${className} ${styles.BasePortalCard__root} ${styles[cardSize]}`}\n sx={{\n backgroundColor: backgroundColor,\n borderRadius: borderRadiusPx,\n boxShadow: boxShadow,\n }}\n >\n <Box className={styles.BasePortalCard__media}>\n {typeof backgroundImage === 'string' ? (\n <CardMedia image={backgroundImage} component=\"img\" />\n ) : (\n backgroundImage\n )}\n </Box>\n <CardContent className={styles.BasePortalCard__content}>\n {children}\n </CardContent>\n </Card>\n {contentBelowCard && (\n <Box className={styles.BasePortalCard__contentBelow}>\n {contentBelowCard}\n </Box>\n )}\n </Stack>\n)\n\nexport default BasePortalCard\n"],"names":["BasePortalCard","borderRadiusPx","boxShadow","children","contentBelowCard","cardSize","className","backgroundImage","backgroundColor","Stack","jsxs","Card","styles","jsx","Box","CardMedia","CardContent"],"mappings":";;;;AAgBA,MAAMA,IAAiB,CAAC;AAAA,EACtB,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AACF,wBACGC,GAAA,EACC,UAAA;AAAA,EAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAW,GAAGL,CAAS,IAAIM,EAAO,oBAAoB,IAAIA,EAAOP,CAAQ,CAAC;AAAA,MAC1E,IAAI;AAAA,QACF,iBAAAG;AAAA,QACA,cAAcP;AAAA,QACd,WAAAC;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAA,gBAAAW,EAACC,GAAA,EAAI,WAAWF,EAAO,uBACpB,iBAAOL,KAAoB,WAC1B,gBAAAM,EAACE,GAAA,EAAU,OAAOR,GAAiB,WAAU,MAAA,CAAM,IAEnDA,GAEJ;AAAA,QACA,gBAAAM,EAACG,GAAA,EAAY,WAAWJ,EAAO,yBAC5B,UAAAT,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAAA,EAEDC,KACC,gBAAAS,EAACC,GAAA,EAAI,WAAWF,EAAO,8BACpB,UAAAR,EAAA,CACH;AAAA,EAAA,CAEJ;"}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
.BasePortalCard__root:global(.MuiCard-root) {
|
|
5
5
|
position: relative;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
.BasePortalCard__contentBelow {
|
|
@@ -11,10 +13,14 @@
|
|
|
11
13
|
|
|
12
14
|
.BasePortalCard__content:global(.MuiCardContent-root):last-child {
|
|
13
15
|
padding: 0;
|
|
16
|
+
flex: 1;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
.BasePortalCard__media {
|
|
17
22
|
height: 50%;
|
|
23
|
+
flex-shrink: 0;
|
|
18
24
|
overflow: hidden;
|
|
19
25
|
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
|
20
26
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './BasePortalCard.css';const a = "
|
|
1
|
+
import './BasePortalCard.css';const a = "_BasePortalCard__root_1hm6w_1", _ = "_BasePortalCard__contentBelow_1hm6w_7", t = "_BasePortalCard__content_1hm6w_7", o = "_BasePortalCard__media_1hm6w_18", e = "_small_1hm6w_33", r = "_medium_1hm6w_44", l = "_large_1hm6w_55", s = {
|
|
2
2
|
BasePortalCard__root: a,
|
|
3
3
|
BasePortalCard__contentBelow: _,
|
|
4
4
|
BasePortalCard__content: t,
|
package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._ColorfulPortalCardWithChips__root_1mhpo_1{position:relative}._ColorfulPortalCardWithChips__container_1mhpo_5{height:100%;display:flex;justify-content:center;flex-direction:column;align-items:center;gap:20px;flex-wrap:wrap}@media(min-width:1024px){._ColorfulPortalCardWithChips__container_1mhpo_5{flex-direction:row;align-items:flex-start;padding:40px 100px 20px}}._ColorfulPortalCardWithChips__titleSection_1mhpo_22{color:#fff;max-width:310px;top:0;position:absolute;padding-left:30px;padding-top:65px}._ColorfulPortalCardWithChips__title_1mhpo_22.MuiTypography-root{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow-wrap:break-word;max-width:225px;font-weight:600}._ColorfulPortalCardWithChips__sectionTitle_1mhpo_42.MuiTypography-root{color:var(--synapse-black);margin-bottom:25px;font-size:48px;line-height:80px;text-align:center}._ColorfulPortalCardWithChips__backgroundImage_1mhpo_50.MuiCardMedia-root{background-size:contain}._ColorfulPortalCardWithChips__challengeName_1mhpo_54.MuiTypography-root{font-weight:300;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:break-word}._ColorfulPortalCardWithChips__sectionContainer_1mhpo_64{flex:1}._ColorfulPortalCardWithChips__bottomSection_1mhpo_68{min-height:0;flex:1;gap:12px;padding:30px;align-items:flex-start}._ColorfulPortalCardWithChips__descriptionTitle_1mhpo_76.MuiTypography-root{color:var(--synapse-black);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}._ColorfulPortalCardWithChips__registrationStatus_1mhpo_85.MuiChip-root{color:var(--synapse-gray-900);position:absolute;top:0;right:0;margin:26px 20px 0 0}._ColorfulPortalCardWithChips__chipsContainer_1mhpo_94{display:flex;gap:5px;flex-wrap:wrap;max-width:400px}._ColorfulPortalCardWithChips__learnMoreButton_1mhpo_101.MuiButton-root{display:flex;margin-top:auto;height:36px;padding:6px 16px;border-radius:8px;color:var(--synapse-black)!important;border:1px solid var(--synapse-black)!important}@media(max-width:768px){._ColorfulPortalCardWithChips__learnMoreButton_1mhpo_101.MuiButton-root{width:100%}}._ColorfulPortalCardWithChips__chip_1mhpo_94{flex-direction:row-reverse;padding-right:0;gap:5px;margin-bottom:5px}._ColorfulPortalCardWithChips__chip_1mhpo_94.MuiChip-root .MuiChip-label{padding-right:0;color:var(--synapse-gray-900)}._ColorfulPortalCardWithChips__chip_1mhpo_94.MuiChip-root .MuiChip-icon{margin-left:0;margin-right:5px;padding-right:5px;color:var(--synapse-black)}._ColorfulPortalCardWithChips__triangleImage_1mhpo_135{position:absolute;left:10%;bottom:100%;transform:translate(-50%);z-index:1}@media(min-width:1024px){._ColorfulPortalCardWithChips__triangleImage_1mhpo_135{left:35%}}._ColorfulPortalCardWithChips__circleImage_1mhpo_148{position:absolute;left:10%;top:4%;transform:translate(-50%);z-index:1}@media(min-width:1024px){._ColorfulPortalCardWithChips__circleImage_1mhpo_148{left:35%;top:7%}}._ColorfulPortalCardWithChips__doubleLineImage_1mhpo_162{display:flex;position:absolute;left:42%;top:5%;transform:translate(-50%);z-index:1}@media(min-width:1024px){._ColorfulPortalCardWithChips__doubleLineImage_1mhpo_162{left:45%;top:10%}}._ColorfulPortalCardWithChips__longLineImage_1mhpo_177{position:absolute;right:10%;bottom:100%;transform:translate(-50%);z-index:1}@media(min-width:1024px){._ColorfulPortalCardWithChips__longLineImage_1mhpo_177{right:5%;left:62%}}._ColorfulPortalCardWithChips__shortLineImage_1mhpo_191{position:absolute;right:7%;transform:translate(-50%);z-index:1}@media(min-width:1024px){._ColorfulPortalCardWithChips__shortLineImage_1mhpo_191{right:2%;left:63%}}._ColorfulPortalCardWithChips__description_1mhpo_76 .markdown{--description-line-height: 20px;--description-max-lines: 3;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:var(--description-max-lines);-webkit-box-orient:vertical;min-height:calc(var(--description-max-lines) * var(--description-line-height))}._ColorfulPortalCardWithChips__description_1mhpo_76 .markdown p{color:var(--synapse-black)!important;font-size:14px;line-height:var(--description-line-height)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorfulPortalCardWithChips.d.ts","sourceRoot":"","sources":["../../../../src/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorfulPortalCardWithChips.d.ts","sourceRoot":"","sources":["../../../../src/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,KAAK,gCAAgC,GAAG;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;CACxC,CAAA;AA6BD,QAAA,MAAM,2BAA2B,GAAI,0KAclC,gCAAgC,KAAG,KAAK,CAAC,SAqE3C,CAAA;AAED,eAAe,2BAA2B,CAAA"}
|
package/dist/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import b from "
|
|
6
|
-
import
|
|
7
|
-
import k from "
|
|
2
|
+
import { ReactComponent as W } from "../../../assets/DefaultColorfulPortalCardBackground.svg.js";
|
|
3
|
+
import { Markdown as v } from "../../Markdown/MarkdownSynapse.js";
|
|
4
|
+
import { hashCode as x } from "../../../utils/functions/StringUtils.js";
|
|
5
|
+
import { useImageUrl as b } from "../../../utils/hooks/useImageUrlUtils.js";
|
|
6
|
+
import w from "@mui/icons-material/ArrowForward";
|
|
7
|
+
import { Stack as s, Chip as f, Typography as i, Button as B, Box as k } from "@mui/material";
|
|
8
|
+
import y from "../BasePortalCard.js";
|
|
8
9
|
import a from "./ColorfulPortalCardWithChips.module.scss.js";
|
|
9
|
-
const C = ["#F8CC7D", "#BFE8F4", "#CEFBDD"],
|
|
10
|
-
const l =
|
|
10
|
+
const C = ["#F8CC7D", "#BFE8F4", "#CEFBDD"], F = (o) => o.map((e) => {
|
|
11
|
+
const l = x(e), t = Math.abs(l) % C.length;
|
|
11
12
|
return C[t];
|
|
12
|
-
}),
|
|
13
|
-
const e =
|
|
14
|
-
return /* @__PURE__ */ r(
|
|
15
|
-
|
|
13
|
+
}), S = ({ values: o }) => {
|
|
14
|
+
const e = F(o);
|
|
15
|
+
return /* @__PURE__ */ r(k, { className: a.ColorfulPortalCardWithChips__chipsContainer, children: o.map((l, t) => /* @__PURE__ */ r(
|
|
16
|
+
f,
|
|
16
17
|
{
|
|
17
18
|
label: /* @__PURE__ */ r(i, { variant: "smallText1", children: l }),
|
|
18
19
|
variant: "filled",
|
|
@@ -21,13 +22,13 @@ const C = ["#F8CC7D", "#BFE8F4", "#CEFBDD"], w = (o) => o.map((e) => {
|
|
|
21
22
|
},
|
|
22
23
|
l
|
|
23
24
|
)) });
|
|
24
|
-
},
|
|
25
|
+
}, q = ({
|
|
25
26
|
title: o,
|
|
26
27
|
subtitle: e,
|
|
27
28
|
description: l,
|
|
28
29
|
descriptionTitle: t,
|
|
29
30
|
learnMoreLink: c,
|
|
30
|
-
buttonOverrideText:
|
|
31
|
+
buttonOverrideText: u,
|
|
31
32
|
chips: h,
|
|
32
33
|
backgroundImage: d,
|
|
33
34
|
backgroundColor: m,
|
|
@@ -36,19 +37,19 @@ const C = ["#F8CC7D", "#BFE8F4", "#CEFBDD"], w = (o) => o.map((e) => {
|
|
|
36
37
|
borderRadiusPx: g,
|
|
37
38
|
cardSize: P = "medium"
|
|
38
39
|
}) => {
|
|
39
|
-
const N =
|
|
40
|
+
const N = b(d ?? "", _ ?? "") || d;
|
|
40
41
|
return /* @__PURE__ */ r(
|
|
41
|
-
|
|
42
|
+
y,
|
|
42
43
|
{
|
|
43
44
|
cardSize: P,
|
|
44
45
|
borderRadiusPx: g,
|
|
45
|
-
backgroundImage: N,
|
|
46
|
+
backgroundImage: N || /* @__PURE__ */ r(W, {}),
|
|
46
47
|
backgroundColor: m || C[0],
|
|
47
|
-
contentBelowCard: h && h.length > 0 && /* @__PURE__ */ r(
|
|
48
|
+
contentBelowCard: h && h.length > 0 && /* @__PURE__ */ r(S, { values: h }),
|
|
48
49
|
children: /* @__PURE__ */ n(s, { className: a.ColorfulPortalCardWithChips__sectionContainer, children: [
|
|
49
50
|
/* @__PURE__ */ n(s, { children: [
|
|
50
51
|
p && /* @__PURE__ */ r(
|
|
51
|
-
|
|
52
|
+
f,
|
|
52
53
|
{
|
|
53
54
|
color: "secondary",
|
|
54
55
|
variant: "filled",
|
|
@@ -90,7 +91,7 @@ const C = ["#F8CC7D", "#BFE8F4", "#CEFBDD"], w = (o) => o.map((e) => {
|
|
|
90
91
|
{
|
|
91
92
|
variant: "smallText1",
|
|
92
93
|
className: a.ColorfulPortalCardWithChips__description,
|
|
93
|
-
children: /* @__PURE__ */ r(
|
|
94
|
+
children: /* @__PURE__ */ r(v, { markdown: l ?? "" })
|
|
94
95
|
}
|
|
95
96
|
),
|
|
96
97
|
c && /* @__PURE__ */ r(
|
|
@@ -98,11 +99,11 @@ const C = ["#F8CC7D", "#BFE8F4", "#CEFBDD"], w = (o) => o.map((e) => {
|
|
|
98
99
|
{
|
|
99
100
|
className: a.ColorfulPortalCardWithChips__learnMoreButton,
|
|
100
101
|
variant: "outlined",
|
|
101
|
-
endIcon: /* @__PURE__ */ r(
|
|
102
|
+
endIcon: /* @__PURE__ */ r(w, {}),
|
|
102
103
|
href: c,
|
|
103
104
|
target: "_blank",
|
|
104
105
|
rel: "noopener noreferrer",
|
|
105
|
-
children:
|
|
106
|
+
children: u ?? "Learn more"
|
|
106
107
|
}
|
|
107
108
|
)
|
|
108
109
|
] })
|
|
@@ -111,6 +112,6 @@ const C = ["#F8CC7D", "#BFE8F4", "#CEFBDD"], w = (o) => o.map((e) => {
|
|
|
111
112
|
);
|
|
112
113
|
};
|
|
113
114
|
export {
|
|
114
|
-
|
|
115
|
+
q as default
|
|
115
116
|
};
|
|
116
117
|
//# sourceMappingURL=ColorfulPortalCardWithChips.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorfulPortalCardWithChips.js","sources":["../../../../src/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.tsx"],"sourcesContent":["import MarkdownSynapse from '@/components/Markdown/MarkdownSynapse'\nimport { hashCode } from '@/utils/functions/StringUtils'\nimport { useImageUrl } from '@/utils/hooks/useImageUrlUtils'\nimport ArrowForwardIcon from '@mui/icons-material/ArrowForward'\nimport { Box, Button, Chip, Stack, Typography } from '@mui/material'\nimport React from 'react'\nimport BasePortalCard from '../BasePortalCard'\nimport styles from './ColorfulPortalCardWithChips.module.scss'\n\ntype ColorfulPortalCardWithChipsProps = {\n title?: string\n subtitle?: string\n description?: string\n descriptionTitle?: string\n learnMoreLink?: string\n buttonOverrideText?: string\n chips?: string[]\n backgroundImage?: string\n backgroundColor?: string\n tag?: string\n entityId?: string\n borderRadiusPx?: number\n cardSize?: 'small' | 'medium' | 'large'\n}\n\nconst colors = ['#F8CC7D', '#BFE8F4', '#CEFBDD']\n\nconst getChicletColors = (chips: string[]) => {\n return chips.map(chip => {\n const hash = hashCode(chip)\n const index = Math.abs(hash) % colors.length\n return colors[index]\n })\n}\n\nconst Chips = ({ values }: { values: string[] }): React.ReactNode => {\n const chipColors = getChicletColors(values)\n return (\n <Box className={styles.ColorfulPortalCardWithChips__chipsContainer}>\n {values.map((chip, index) => (\n <Chip\n key={chip}\n label={<Typography variant=\"smallText1\">{chip}</Typography>}\n variant=\"filled\"\n style={{ backgroundColor: chipColors[index] }}\n className={styles.ChallengePortalCard__chip}\n />\n ))}\n </Box>\n )\n}\n\nconst ColorfulPortalCardWithChips = ({\n title,\n subtitle,\n description,\n descriptionTitle,\n learnMoreLink,\n buttonOverrideText,\n chips,\n backgroundImage,\n backgroundColor,\n tag,\n entityId,\n borderRadiusPx,\n cardSize = 'medium',\n}: ColorfulPortalCardWithChipsProps): React.ReactNode => {\n const imageUrl = useImageUrl(backgroundImage ?? '', entityId ?? '')\n const backgroundImageValue = imageUrl
|
|
1
|
+
{"version":3,"file":"ColorfulPortalCardWithChips.js","sources":["../../../../src/components/BasePortalCard/ColorfulPortalCardWithChips/ColorfulPortalCardWithChips.tsx"],"sourcesContent":["import { ReactComponent as DefaultBackground } from '@/assets/DefaultColorfulPortalCardBackground.svg'\nimport MarkdownSynapse from '@/components/Markdown/MarkdownSynapse'\nimport { hashCode } from '@/utils/functions/StringUtils'\nimport { useImageUrl } from '@/utils/hooks/useImageUrlUtils'\nimport ArrowForwardIcon from '@mui/icons-material/ArrowForward'\nimport { Box, Button, Chip, Stack, Typography } from '@mui/material'\nimport React from 'react'\nimport BasePortalCard from '../BasePortalCard'\nimport styles from './ColorfulPortalCardWithChips.module.scss'\n\ntype ColorfulPortalCardWithChipsProps = {\n title?: string\n subtitle?: string\n description?: string\n descriptionTitle?: string\n learnMoreLink?: string\n buttonOverrideText?: string\n chips?: string[]\n backgroundImage?: string\n backgroundColor?: string\n tag?: string\n entityId?: string\n borderRadiusPx?: number\n cardSize?: 'small' | 'medium' | 'large'\n}\n\nconst colors = ['#F8CC7D', '#BFE8F4', '#CEFBDD']\n\nconst getChicletColors = (chips: string[]) => {\n return chips.map(chip => {\n const hash = hashCode(chip)\n const index = Math.abs(hash) % colors.length\n return colors[index]\n })\n}\n\nconst Chips = ({ values }: { values: string[] }): React.ReactNode => {\n const chipColors = getChicletColors(values)\n return (\n <Box className={styles.ColorfulPortalCardWithChips__chipsContainer}>\n {values.map((chip, index) => (\n <Chip\n key={chip}\n label={<Typography variant=\"smallText1\">{chip}</Typography>}\n variant=\"filled\"\n style={{ backgroundColor: chipColors[index] }}\n className={styles.ChallengePortalCard__chip}\n />\n ))}\n </Box>\n )\n}\n\nconst ColorfulPortalCardWithChips = ({\n title,\n subtitle,\n description,\n descriptionTitle,\n learnMoreLink,\n buttonOverrideText,\n chips,\n backgroundImage,\n backgroundColor,\n tag,\n entityId,\n borderRadiusPx,\n cardSize = 'medium',\n}: ColorfulPortalCardWithChipsProps): React.ReactNode => {\n const imageUrl = useImageUrl(backgroundImage ?? '', entityId ?? '')\n const backgroundImageValue = imageUrl || backgroundImage\n\n return (\n <BasePortalCard\n cardSize={cardSize}\n borderRadiusPx={borderRadiusPx}\n backgroundImage={backgroundImageValue || <DefaultBackground />}\n backgroundColor={backgroundColor || colors[0]}\n contentBelowCard={chips && chips.length > 0 && <Chips values={chips} />}\n >\n <Stack className={styles.ColorfulPortalCardWithChips__sectionContainer}>\n <Stack>\n {tag && (\n <Chip\n color=\"secondary\"\n variant=\"filled\"\n className={styles.ColorfulPortalCardWithChips__registrationStatus}\n sx={{ backgroundColor }}\n label={tag}\n />\n )}\n <Stack className={styles.ColorfulPortalCardWithChips__titleSection}>\n <Typography\n variant=\"headline1\"\n className={styles.ColorfulPortalCardWithChips__title}\n >\n {title}\n </Typography>\n <Typography\n variant=\"headline1\"\n className={styles.ColorfulPortalCardWithChips__challengeName}\n >\n {subtitle}\n </Typography>\n </Stack>\n </Stack>\n <Stack className={styles.ColorfulPortalCardWithChips__bottomSection}>\n {descriptionTitle && (\n <Typography\n variant=\"headline1\"\n className={styles.ColorfulPortalCardWithChips__descriptionTitle}\n >\n {descriptionTitle}\n </Typography>\n )}\n <Typography\n variant=\"smallText1\"\n className={styles.ColorfulPortalCardWithChips__description}\n >\n <MarkdownSynapse markdown={description ?? ''} />\n </Typography>\n {learnMoreLink && (\n <Button\n className={styles.ColorfulPortalCardWithChips__learnMoreButton}\n variant=\"outlined\"\n endIcon={<ArrowForwardIcon />}\n href={learnMoreLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {buttonOverrideText ?? 'Learn more'}\n </Button>\n )}\n </Stack>\n </Stack>\n </BasePortalCard>\n )\n}\n\nexport default ColorfulPortalCardWithChips\n"],"names":["colors","getChicletColors","chips","chip","hash","hashCode","index","Chips","values","chipColors","jsx","Box","styles","Chip","Typography","ColorfulPortalCardWithChips","title","subtitle","description","descriptionTitle","learnMoreLink","buttonOverrideText","backgroundImage","backgroundColor","tag","entityId","borderRadiusPx","cardSize","backgroundImageValue","useImageUrl","BasePortalCard","DefaultBackground","jsxs","Stack","MarkdownSynapse","Button","ArrowForwardIcon"],"mappings":";;;;;;;;;AA0BA,MAAMA,IAAS,CAAC,WAAW,WAAW,SAAS,GAEzCC,IAAmB,CAACC,MACjBA,EAAM,IAAI,CAAAC,MAAQ;AACvB,QAAMC,IAAOC,EAASF,CAAI,GACpBG,IAAQ,KAAK,IAAIF,CAAI,IAAIJ,EAAO;AACtC,SAAOA,EAAOM,CAAK;AACrB,CAAC,GAGGC,IAAQ,CAAC,EAAE,QAAAC,QAAoD;AACnE,QAAMC,IAAaR,EAAiBO,CAAM;AAC1C,SACE,gBAAAE,EAACC,KAAI,WAAWC,EAAO,6CACpB,UAAAJ,EAAO,IAAI,CAACL,GAAMG,MACjB,gBAAAI;AAAA,IAACG;AAAA,IAAA;AAAA,MAEC,OAAO,gBAAAH,EAACI,GAAA,EAAW,SAAQ,cAAc,UAAAX,GAAK;AAAA,MAC9C,SAAQ;AAAA,MACR,OAAO,EAAE,iBAAiBM,EAAWH,CAAK,EAAA;AAAA,MAC1C,WAAWM,EAAO;AAAA,IAAA;AAAA,IAJbT;AAAA,EAAA,CAMR,GACH;AAEJ,GAEMY,IAA8B,CAAC;AAAA,EACnC,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,OAAAnB;AAAA,EACA,iBAAAoB;AAAA,EACA,iBAAAC;AAAA,EACA,KAAAC;AAAA,EACA,UAAAC;AAAA,EACA,g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