-
Notifications
You must be signed in to change notification settings - Fork 408
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
[CQ-4347128] add thankyoumessage & thankyoupage post submit for headless #972
Conversation
if(thankyouPage){ | ||
window.open(thankyouPage, '_blank'); | ||
}else if(thankyouMessage){ | ||
alert(thankyouMessage); |
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 alerts
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.
How to show thankyouMessage?
const thankyouMessage = state?.properties?.['afs:thankyouMessage']; | ||
const thankyouPage = state?.properties?.['afs:thankyouPage']; | ||
if(thankyouPage){ | ||
window.open(thankyouPage, '_blank'); |
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.
Instead of opening a new window, we should change the URL in the same window
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.
changed
const onSubmit= (action: Action) => { | ||
const state = action.target.getState(); | ||
const thankyouMessage = state?.properties?.['afs:thankyouMessage']; | ||
const thankyouPage = state?.properties?.['afs:thankyouPage']; |
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.
use action.payload. It will not be part of properties.
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.
also add tests
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.
changed
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 is no setup of the test cases in "ui.frontend.react.forms.af"
add thankyoumessage & thankyoupage post submit for headless
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: