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

FOUR-13361: Incorrect Redirection After Completing a Guided Template Process #6127

Merged
merged 6 commits into from Feb 1, 2024

Conversation

eiresendez
Copy link
Contributor

@eiresendez eiresendez commented Jan 31, 2024

Issue and Reproduction Steps:

Currently, when the Guided Templates process is completed and "Save and Finish" is clicked, it redirects to the assets page. However, the assets do not load and an error window.history.state is undefined appears in the console.

Solution:

  • The problem is related to the use of history.pushState. Redirecting causes these data to be lost.
  • The suggested solution is to use localStorage instead.
  • Other adjustments are formatting changes made by eslint and php-cs-fixer.

How to Test:

  • Update your Guided Templates with the latest version from the 2023-winter branch.
  • Run the "Guided invoice approval" wizard.
  • Ensure that the existing assets are correctly displayed on the /template/assets screen.
  • Check that the "continue" button functions properly and that the template is created without issues.

Related Tickets & Packages

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

This commit refactors the TemplateAssetsView component and assets.js file. It adds new props to the TemplateAssetsView component, including "request", "redirectTo", and "wizardTemplateUuid".

It also updates the usage of these props in the component. In assets.js, it updates the initialization of the "responseId" and "redirectTo" variables.
Copy link

Quality Gate failed Quality Gate failed

Failed conditions

1 New Code Smells (required ≤ 0)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@eiresendez
Copy link
Contributor Author

The failure reported by SonarLint is expected due to a // TODO comment that is not related to the changes made nor to the issue addressed in this PR.

Copy link
Contributor

@estebangallego estebangallego left a comment

Choose a reason for hiding this comment

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

Approved!

@ryancooley ryancooley merged commit 530dddb into next Feb 1, 2024
7 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants