Skip to content
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

Merged
merged 2 commits into from
Sep 19, 2022

Conversation

amit-mnnit
Copy link
Contributor

@amit-mnnit amit-mnnit commented Aug 23, 2022

add thankyoumessage & thankyoupage post submit for headless

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@amit-mnnit amit-mnnit changed the title [CQ-4347128] add thankyoumessage & thankyoupage post submit [CQ-4347128] add thankyoumessage & thankyoupage post submit for headless Aug 24, 2022
if(thankyouPage){
window.open(thankyouPage, '_blank');
}else if(thankyouMessage){
alert(thankyouMessage);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no alerts

Copy link
Contributor Author

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');
Copy link

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

Copy link
Contributor Author

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'];
Copy link

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Copy link
Contributor Author

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"

@rismehta rismehta merged commit 595006e into adobe:develop Sep 19, 2022
@vladbailescu vladbailescu added this to the 39 milestone Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants