-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add Session context and redirects #9908
Add Session context and redirects #9908
Conversation
Build succeeded.
|
)} seconds due to inactivity.` | ||
)} | ||
<Trans>You will be logged out in</Trans> {sessionCountdown}{' '} | ||
<Trans>seconds due to inactivity.</Trans> |
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.
Based on another open PR t
macro will be preferred syntax to select translation. See: #9897
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're OK with <Trans>
(and in fact I prefer it in some cases) -- though the full sentence including the sessionCountdown
should appear inside one <Trans>
so it can all be translated together
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.
This also needs plural
because when we get to 1 left we want You will be logged out in 1 second due to inactivity
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.
👍 Updated timeout message to use Plural macro.
awx/ui_next/src/contexts/Session.jsx
Outdated
return context; | ||
} | ||
|
||
// export default SessionContext; |
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.
// export default SessionContext; | |
// export default SessionContext; |
// export default SessionContext; |
I triggered an e2e test run. |
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 tested this code with different scenarios, and all of them worked. I like the usage of context API to this solution. I left minor comments. If e2e tests are green 🚢
awx/ui_next/src/contexts/Session.jsx
Outdated
}, [history, sessionTimeout]); | ||
|
||
const handleSessionContinue = useCallback(async () => { | ||
MeAPI.read(); |
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.
MeAPI.read(); | |
await MeAPI.read(); |
awx/ui_next/src/contexts/Session.jsx
Outdated
clearInterval(sessionIntervalId.current); | ||
}, []); | ||
|
||
const value = useMemo( |
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.
💯
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.
👍
That sounds good to me (there's probably overlap with that issue and this PR). If we end up moving that work to this PR I'll take another look. |
17c5f4f
to
99e82eb
Compare
Build succeeded.
|
99e82eb
to
7a4d31d
Compare
Build succeeded.
|
awx/ui_next/src/contexts/Session.jsx
Outdated
clearInterval(sessionIntervalId.current); | ||
}, []); | ||
|
||
const value = useMemo( |
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.
Why the useMemo here?
To test:
|
worth connecting #5278 (comment) |
I have decided not to roll my SSO work into this PR. Both PRs work in |
61e0ece
to
29f81c1
Compare
@marshmalien This looks pretty nice, we've found some feedback while verifying this: Note: that the
session1-2021-04-26_18.12.06.mp4
session4-2021-04-26_18.31.17.mp4
session2-2021-04-26_18.15.12.mp4
session3-2021-04-26_18.25.22.mp4We had 293 failures in e2e tests, I'm looking at the moment but seems to be the same issue. |
@marshmalien any update about this PR? |
@marshmalien I was looking into the e2e tests to understand what could be breaking the tests and I didn't found any reason why the Session modal is being displayed right after the login step, when all the cookies are being set test-2021-05-19_10.12.56.mp4 |
Build succeeded.
|
Build succeeded.
|
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.
We got in a call and we went over the different scenarios for third party auth providers. Good job @marshmalien.
@@ -26,6 +28,7 @@ import Metrics from './screens/Metrics'; | |||
|
|||
import getRouteConfig from './routeConfig'; | |||
import SubscriptionEdit from './screens/Setting/Subscription/SubscriptionEdit'; | |||
import { SESSION_REDIRECT_URL } from './constants'; |
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.
👍
Build succeeded.
|
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.
- Verified that all issues found were fixed
- Verified that all sub issues and added evidencies on each of them
- Fixed all broken e2e tests
Build succeeded (gate pipeline).
|
SUMMARY
Issues:
#8272 #9197 #8155 #9311
@AlexSCorey is looking at possibly rolling #9915 (SSO login redirect override URL is not working) into this PRISSUE TYPE
COMPONENT NAME