Skip to content

Commit

Permalink
feat(decline login): add button to logout user (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhigarg-bmw authored Feb 20, 2024
1 parent 16d5f50 commit aa2a2d9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- User Management
- Removed quotation marks from technical user details
- Decline Status
- added button in overlay to logout deom portal
- Dataspace
- Updated dataspace provider links with quick links
- Delete ownuser Redirect URL
Expand Down
3 changes: 2 additions & 1 deletion src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@
},
"registrationDeclined": {
"title": "Registration Status",
"description": "<strong>After careful consideration, we regret to inform you that we are unable to approve your registration at this time.</strong><br /><br />Details/reasons for the cancellation have been provided via email.Your account will get disabled soon."
"description": "<strong>After careful consideration, we regret to inform you that we are unable to approve your registration at this time.</strong><br /><br />Details/reasons for the cancellation have been provided via email.Your account will get disabled soon.",
"close": "Close the Page"
},
"admin": {
"registration-requests": {
Expand Down
3 changes: 2 additions & 1 deletion src/assets/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@
},
"registrationDeclined": {
"title": "Registration Status",
"description": "<strong style='color: red'>After careful consideration, we regret to inform you that we are unable to approve your registration at this time.</strong><br /><br />Details/reasons for the cancellation have been provided via email.Your account will get disabled soon."
"description": "<strong style='color: red'>After careful consideration, we regret to inform you that we are unable to approve your registration at this time.</strong><br /><br />Details/reasons for the cancellation have been provided via email.Your account will get disabled soon.",
"close": "Close the Page"
},
"admin": {
"registration-requests": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,23 @@ import {
DialogHeader,
DialogActions,
Typography,
Button,
} from '@catena-x/portal-shared-components'
import { useDispatch } from 'react-redux'
import { exec } from 'features/control/overlay'
import { ACTIONS } from 'types/Constants'

export type StatusTagIcon = {
type?: 'confirmed' | 'pending' | 'declined' | 'label'
}

export type RegistrationDeclinedProps = {
openDialog: boolean
handleOverlayClose: React.MouseEventHandler
}

const RegistrationDeclinedOverlay = ({
openDialog,
handleOverlayClose,
}: RegistrationDeclinedProps) => {
}: {
openDialog: boolean
}) => {
const { t } = useTranslation()
const dispatch = useDispatch()

return (
<Dialog
Expand All @@ -63,9 +64,14 @@ const RegistrationDeclinedOverlay = ({
</Trans>
</div>
</DialogContent>
<DialogActions
helperText={t('content.registrationInreview.helperText')}
></DialogActions>
<DialogActions helperText={t('content.registrationInreview.helperText')}>
<Button
variant="contained"
onClick={() => dispatch(exec(ACTIONS.SIGNOUT))}
>
{t('content.registrationDeclined.close')}
</Button>
</DialogActions>
</Dialog>
)
}
Expand Down
11 changes: 3 additions & 8 deletions src/components/shared/frame/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ export const Header = ({ main, user }: { main: Tree[]; user: string[] }) => {
const [submittedOverlayOpen, setSubmittedOverlayOpen] = useState(
companyData?.applicationStatus === ApplicationStatus.SUBMITTED
)
const [declinedOverlayOpen, setDeclinedOverlayOpen] = useState(
companyData?.applicationStatus === ApplicationStatus.DECLINED
)
const [headerNote, setHeaderNote] = useState(false)

const addTitle = (items: Tree[] | undefined) =>
Expand Down Expand Up @@ -220,11 +217,9 @@ export const Header = ({ main, user }: { main: Tree[]; user: string[] }) => {
}}
/>
<RegistrationDeclinedOverlay
openDialog={declinedOverlayOpen}
handleOverlayClose={() => {
setDeclinedOverlayOpen(false)
setHeaderNote(true)
}}
openDialog={
companyData?.applicationStatus === ApplicationStatus.DECLINED
}
/>
</>
)
Expand Down

0 comments on commit aa2a2d9

Please sign in to comment.