-
Notifications
You must be signed in to change notification settings - Fork 395
Add Requisition Submission feature #20125
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
Conversation
@@ -39,7 +43,9 @@ export abstract class PunchoutFacade { | |||
* Abstract method used to get Punchout Session Requisition data | |||
* @param sessionId is the sesssion Id given by ARIBA via url param | |||
*/ | |||
abstract getPunchoutSessionRequisition( | |||
sessionId: string |
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.
No need to provide the sessionId as parameter, the facade method now gets it from the state (within punchoutStoreService ) directly.
tap((punchoutRequisition) => { | ||
this.listenAndSubmitForm(punchoutRequisition).subscribe({ | ||
next: () => { | ||
this.punchoutFormElement.nativeElement.submit(); |
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.
It is the only way to submit a POST form with 'action' attribute programmatically.
As long as nativeElement is not being modified, it is safe.
|
||
protected isFormNativeElementAccessible(): Observable<boolean> { | ||
// timer(0) wait for next Javascript event loop, this way DOM native elements becomes accessible. | ||
return timer(0).pipe( |
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.
Reliable, I tested with all network speeds, nativeElement (line 45) is always accessible a expected, no race condition observed.
Add CMS cpnt: cart btns and requisition page
in Punchout-Requisition cpnt:
Fetch Requisition data from server
logout user
submit hidden form programmatically
in PunchoutButtons cpnt:
2 btns added on cart page
Only displayed when user is logged and punchoutSessionId exists.
click on btn redirect user to Requisition Page (which loads punchoutRequisition cpnt above)
Added translation