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

[FALL] Fix File Persistence on Page Reload for Single and Multiple File Uploads #1759

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

sanjacornelius
Copy link
Contributor

Issue & Reproduction Steps

This PR addresses two key issues related to file persistence within File Upload components in Screen Builder:

  1. Ensures that uploaded files remain persisted after a page reload.
  2. For multiple file uploads, ensures that the initial uploaded file persists after page reload when additional files are uploaded.

The solution introduces a fetchFile function, which retrieves uploaded files by their ID on component mount if this.value exists, providing consistent file persistence across reloads.

Changes:

  • Implement fetchFile logic to retrieve uploaded files by ID when this.value is present during component mount.
  • Update file handling logic to support both single and multiple file upload configurations.

How to Test:

  • Ensure you have package-versions installed to utilize the Autosave functionality
  • Create a screen with two File Upload controls:
    - Single File Upload
    - Multiple File Upload
  • Add two File Preview controls
  • Configure the File Previews to display uploaded files from the Single and Multiple File upload controls
  • Create and run a process using the configured screen
  • Upload files for both single and multiple file controls
  • Verify that all uploaded files display correctly in the File Previews.
  • Reload the page.
  • File uploaded to the Single File Upload control remain in the upload control
  • File uploaded to the Multiple File upload control persist after reload.
  • Check that the File Previews to ensure all uploaded files are displayed correctly.

Note: Due to unsupported autosave functionality, file persistence will not work in Web Entry and Collection screens.

Related Tickets & Packages

- FOUR-19799
- FOUR-14168

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.

Copy link

cypress bot commented Oct 25, 2024

screen-builder    Run #1615

Run Properties:  status check passed Passed #1615  •  git commit 34b0fbccc4: [FALL] Fix File Persistence on Page Reload for Single and Multiple File Uploads
Project screen-builder
Branch Review bugfix/FOUR-19799-fall
Run status status check passed Passed #1615
Run duration 08m 39s
Commit git commit 34b0fbccc4: [FALL] Fix File Persistence on Page Reload for Single and Multiple File Uploads
Committer Sanja
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 19
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 341
View all changes introduced in this branch ↗︎

@ryancooley ryancooley merged commit 9e36c54 into release-2024-fall Oct 29, 2024
15 checks passed
@ryancooley ryancooley deleted the bugfix/FOUR-19799-fall branch October 29, 2024 16:25
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.

3 participants