-
Notifications
You must be signed in to change notification settings - Fork 105
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
chore: [IOBP-316] Add return to origin page after payment flow completion #5399
Merged
Merged
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
180dfb2
Merge remote-tracking branch 'origin/master' into IOBP-316-resume-sta…
Hantex9 083a3e8
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 3cc0b68
feat: Add return to origin page after payment flow completion
Hantex9 4f90967
chore: added popToTop before to navigate
Hantex9 f9f8912
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 2102d66
chore: added sub-route handling navigation
Hantex9 3bfd87d
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 832a611
chore: changed orchestration to get current route when starting payme…
Hantex9 7a0f24a
typo: route name
Hantex9 29e02b6
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 34fbc2b
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 0c4e545
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 8890b61
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 46229af
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 1c7a0e3
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 1e9b038
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 9db9856
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
mastro993 5ca24f7
chore: addressed review feedback
Hantex9 e963a35
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 eea52e1
Merge branch 'master' into IOBP-316-resume-start-point-after-payment
Hantex9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -27,6 +27,7 @@ import { | |||||||||||||||||||||||||||||||||
import { WalletInfo } from "../../../../../../definitions/pagopa/walletv3/WalletInfo"; | ||||||||||||||||||||||||||||||||||
import { WalletPaymentFailure } from "../../types/failure"; | ||||||||||||||||||||||||||||||||||
import { RptId } from "../../../../../../definitions/pagopa/ecommerce/RptId"; | ||||||||||||||||||||||||||||||||||
import NavigationService from "../../../../../navigation/NavigationService"; | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
export type WalletPaymentState = { | ||||||||||||||||||||||||||||||||||
rptId?: RptId; | ||||||||||||||||||||||||||||||||||
|
@@ -44,6 +45,10 @@ export type WalletPaymentState = { | |||||||||||||||||||||||||||||||||
NetworkError | WalletPaymentFailure | ||||||||||||||||||||||||||||||||||
>; | ||||||||||||||||||||||||||||||||||
authorizationUrl: pot.Pot<string, NetworkError>; | ||||||||||||||||||||||||||||||||||
startRoute?: { | ||||||||||||||||||||||||||||||||||
routeName: string; | ||||||||||||||||||||||||||||||||||
routeKey: string; | ||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
const INITIAL_STATE: WalletPaymentState = { | ||||||||||||||||||||||||||||||||||
|
@@ -64,7 +69,19 @@ const reducer = ( | |||||||||||||||||||||||||||||||||
): WalletPaymentState => { | ||||||||||||||||||||||||||||||||||
switch (action.type) { | ||||||||||||||||||||||||||||||||||
case getType(walletPaymentInitState): | ||||||||||||||||||||||||||||||||||
return INITIAL_STATE; | ||||||||||||||||||||||||||||||||||
const currentRouteName = NavigationService.getCurrentRouteName(); | ||||||||||||||||||||||||||||||||||
const currentRouteKey = NavigationService.getCurrentRouteKey(); | ||||||||||||||||||||||||||||||||||
const startRoute = | ||||||||||||||||||||||||||||||||||
currentRouteKey && currentRouteName | ||||||||||||||||||||||||||||||||||
? { | ||||||||||||||||||||||||||||||||||
routeName: currentRouteName, | ||||||||||||||||||||||||||||||||||
routeKey: currentRouteKey | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
: undefined; | ||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about using fp-ts here?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's cool! Addressed into 5ca24f7 |
||||||||||||||||||||||||||||||||||
return { | ||||||||||||||||||||||||||||||||||
...INITIAL_STATE, | ||||||||||||||||||||||||||||||||||
startRoute | ||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
// Payment verification and details | ||||||||||||||||||||||||||||||||||
case getType(walletPaymentGetDetails.request): | ||||||||||||||||||||||||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 believe this type casting is better done inside the store; what do you think?
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.
Yes, maybe it could be more type-safe. Addressed into 5ca24f7