-
Notifications
You must be signed in to change notification settings - Fork 6
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
Play back what file has been uploaded to users, and allow them to change file #1160
Draft
stephencdaly
wants to merge
11
commits into
main
Choose a base branch
from
add-file-upload-preview-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We will need to have the logic to check whether a file has been uploaded for the question in multiple places, so adding a method for code sharing. Co-authored-by: Jamie Wilkinson <[email protected]>
Add a component containing the table to review the uploaded file name along with a remove button for file upload questions. We're using a component that inherits the Question::Base component as we need to use the methods on this to render the question text heading and hint text, if it's present. Co-authored-by: Jamie Wilkinson <[email protected]>
stephencdaly
force-pushed
the
add-file-upload-preview-page
branch
2 times, most recently
from
January 24, 2025 17:28
b1cddb6
to
5cd4cad
Compare
Add routes and page to review a file after it's been uploaded. This page plays back the uploaded filename with a button to remove the file. The continue button on the page posts to a route which will just redirect to the next question. We do not need to save anything at this point as the answer has already been saved. The route to remove the file has been added, but we have not added the implementation for this yet. Co-authored-by: Jamie Wilkinson <[email protected]>
Add a method to the file question model to delete the file from S3. This will be called when the remove button is clicked on the review file page.
Implement the remove file route, which is POSTed to when the user clicks the remove button on the file review page. This calls S3 to delete the file and removes the answer from the session. This does not take into account the the question having multiple answers, as we do not currently support "add another answer" for file upload questions. The logic to remove the answer from the session will need to be modified if we want to support this in the future. Co-authored-by: Jamie Wilkinson <[email protected]>
Co-authored-by: Jamie Wilkinson <[email protected]>
After saving the answer to a question, if the question is a file upload question, and is not an optional question that has been skipped, redirect to the new review file route. We've added a new private method `save_redirect_path` for this logic, as we use the `next_page` method in other subclasses of the PageController, such as the ReviewFileController, and in these use cases, we always want to go to the next step in the form. Co-authored-by: Jamie Wilkinson <[email protected]>
If attempting to visit the page for a file upload question, redirect to the review file page if the question has already been answered. On this page, the user is shown the file that has already been uploaded with the option to remove the file and then upload another one.
Pass through the `changing_existing_answer` query parameter when moving between pages when reviewing an changing the answer to a file upload. This means that the user will get returned to the check your answers page when they click "Continue" on the file review page after they have made any changes they need to.
Display a success notification banner on a page if there is a `success` flash message present on a request.
stephencdaly
force-pushed
the
add-file-upload-preview-page
branch
from
January 24, 2025 17:35
5cd4cad
to
0764121
Compare
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this pull request solve?
Trello card: https://trello.com/c/mfhj3ufe/2068-play-back-what-file-has-been-uploaded-to-users-and-allow-them-to-change-file
Things to consider when reviewing