-
Notifications
You must be signed in to change notification settings - Fork 106
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(MyPortal): [#174801172] Screen component for region service external webview #2204
Conversation
Affected stories
|
Codecov Report
@@ Coverage Diff @@
## master #2204 +/- ##
==========================================
+ Coverage 47.13% 47.15% +0.01%
==========================================
Files 492 493 +1
Lines 14790 14845 +55
Branches 2774 3017 +243
==========================================
+ Hits 6972 7000 +28
- Misses 7776 7803 +27
Partials 42 42
Continue to review full report at Codecov.
|
|
||
const initialInternalRouteNavigationState = null; | ||
const initialInternalRouteNavigationState = { |
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.
Is this change needed?
an empty object could be misleading if we want to represent that there is no internal route
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.
Yep you're right, i currently reverted the change
|
||
return { | ||
url: maybeParams.fold("", p => p.url), | ||
token: tokenFromSessionInfoSelector(state, "walletToken") |
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.
token: tokenFromSessionInfoSelector(state, "walletToken") | |
token: tokenFromNameSelector("walletToken")(state) |
see other suggestion about selector
const [isCookieAvailable, setIsCookieAvailable] = React.useState(false); | ||
const [cookieError, setCookieError] = React.useState(false); | ||
|
||
const onDidFocus = () => { |
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 did few test and this callback is never called (maybe a bug on navigation library)
Perhaps you could use React.useEffect
with a clean-up callback. I tested it and it works
ts/store/reducers/authentication.ts
Outdated
@@ -132,6 +136,17 @@ export const sessionInfoSelector = (state: GlobalState) => | |||
? some(state.authentication.sessionInfo) | |||
: none; | |||
|
|||
export const tokenFromSessionInfoSelector = ( |
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 const tokenFromSessionInfoSelector = ( | |
export const tokenFromNameSelector = ( | |
tokenName: keyof Omit<PublicSession, "spidLevel"> | |
): ((state: GlobalState) => Option<string>) => | |
createSelector<GlobalState, Option<PublicSession>, Option<string>>( | |
sessionInfoSelector, | |
maybeSessionInfo => maybeSessionInfo.map(si => si[tokenName]) | |
); |
…pagopa/io-app into 174801172-region-service-webview-screen
Short description
This PR adds the screen component for rendering the external webview of a service
How to test
Set the MYPORTAL_ENABLED env variable to true and navigate to the screen from a custom CTA component from dev-server, with action value set to:
ioit://SERVICE_WEBVIEW&?url=http://localhost:3000/myportal_playground.html