-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(portal login): handle navigation as per status #111
feat(portal login): handle navigation as per status #111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small change for readability
src/helpers/utils.ts
Outdated
} | ||
if (([ApplicationStatus.SUBMITTED, ApplicationStatus.DECLINED, ApplicationStatus.APPROVED].indexOf(status) === -1) && Object.values(ApplicationStatus).includes(status)) | ||
(applicationType === ApplicationType.INTERNAL) ? history.push('/landing') : history.push('/?overlay=consent_osp') | ||
else if ([ApplicationStatus.SUBMITTED, ApplicationStatus.APPROVED, ApplicationStatus.DECLINED].indexOf(status) !== -1) window.location.replace('/home') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 276 and 278 contain a lot of duplication. Write
const isADS = [...].includes(status)
and then use that value true or false in those lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oyo I made some changes and make it less complicated. Please recheck once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some quick changes
public/index.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't check in this file - because it contains env specific values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh sorry, it was done my mistake
src/helpers/utils.ts
Outdated
} | ||
if ([ApplicationStatus.SUBMITTED, ApplicationStatus.CONFIRMED, ApplicationStatus.DECLINED].includes(status)) | ||
location.href = '/' | ||
else if (Object.values(ApplicationStatus).includes(status) && !location.search.includes('overlay=consent_osp')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need this here - because this is specific to the frontend app
&& !location.search.includes('overlay=consent_osp')
src/helpers/utils.ts
Outdated
if (applicationType === ApplicationType.INTERNAL) | ||
history.push('/landing') | ||
else | ||
location.href = '/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here I was wrong with my comment earlier - we must specify the parameter because the frontend app checks for it:
location href = '/?overlay=consent_osp'
Quality Gate passedIssues Measures |
Description
Handle portal login navigation as per applicationStatus and applicationType
Why
Portal login navigation handling
Issue
eclipse-tractusx/portal-frontend#468
Checklist
Please delete options that are not relevant.