Skip to content

Commit

Permalink
Merge pull request #529 from jay-hodgson/PORTALS-2838
Browse files Browse the repository at this point in the history
PORTALS-2838, PORTALS-2837: Add Close button to Access Requirement List, and fix Close button for step in Challenge Wizard
  • Loading branch information
jay-hodgson authored Oct 27, 2023
2 parents 419bb17 + 739a019 commit e85c2b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import DataAccessRequestAccessorsFilesForm from './ManagedACTAccessRequirementRe
import RequestDataAccessSuccess from './ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess'
import {
Box,
Button,
Dialog,
DialogContent,
DialogTitle,
Expand All @@ -41,6 +42,7 @@ import TwoFactorAuthEnabledRequirement from './RequirementItem/TwoFactorAuthEnab
import { AccessRequirementListItem } from './AccessRequirementListItem'
import { useSynapseContext } from '../../utils/context/SynapseContext'
import { useCanShowManagedACTWikiInWizard } from './AccessRequirementListUtils'
import { DialogActions } from '@mui/material'

export type AccessRequirementListProps = {
entityId: string // will show this entity info
Expand Down Expand Up @@ -369,10 +371,17 @@ export default function AccessRequirementList(
renderContent = <RequestDataAccessSuccess onHide={onHide} />
break
case RequestDataStep.SHOW_ALL_ARS:
renderContent = content
break
default:
renderContent = content
renderContent = (
<>
{content}
<DialogActions>
<Button variant="contained" onClick={onHide}>
Close
</Button>
</DialogActions>
</>
)
}
return (
<Dialog maxWidth={dialogWidth} fullWidth open={true} onClose={onHide}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,16 @@ const ChallengeTeamWizard: React.FunctionComponent<
onClose()
}

const onConfirmHandlerMap: Record<string, () => Promise<void>> | void = {
const onConfirmHandlerMap: Record<
string,
(() => Promise<void>) | (() => undefined)
> | void = {
CREATE_NEW_TEAM: handleCreateTeam,
JOIN_REQUEST_FORM: handleRequestMembership,
JOIN_REQUEST_SENT: () => {
hide()
return undefined
},
}

// Determine modal content based on step.id
Expand Down

0 comments on commit e85c2b6

Please sign in to comment.