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

[EASI-4531] GRB presentation links form #2972

Conversation

aterstriep
Copy link
Contributor

@aterstriep aterstriep commented Jan 28, 2025

EASI-4531

Figma

Description

  • Presentation links form to add or edit links
    • /:systemId/grb-review/presentation-links
  • Created FileUpload custom component to handle pre-filled file fields
    • This differs slightly from the Figma and displays a "clear file" button instead of "change file" when field has default value. This change was cleared with Zoe.
  • Unit tests

How to test this change

I created a testing branch (EASI-4531/grb-presentation-links-form-test) with the branches for #2966 and #2958 merged into this work. Use that branch for testing so that the form mutation works and links are displayed on the "GRB review" admin tab.

  • Log in with GOVTEAM job code
  • Go to the presentation links form for an IT Gov request (/:systemId/grb-review/presentation-links)
  • Test "Add presentation links" form
    • Form button should be disabled unless either the recording link or presentation deck file fields are filled out
    • If you fill the transcript link or document field, that field value should clear if you navigate to the other tab
  • After submitting, scroll to the presentation links card and click "Edit presentation links"
  • Test "Edit presentation link" form

PR Author Checklist

  • I have provided a detailed description of the changes in this PR.
  • I have provided clear instructions on how to test the changes in this PR.
  • I have updated tests or written new tests as appropriate in this PR.

PR Reviewer Guidelines

  • It's best to pull the branch locally and test it, rather than just looking at the code online!
  • When approving a PR, provide a reason why you're approving it
    • e.g. "Approving because I tested it locally and all functionality works as expected"
    • e.g. "Approving because the change is simple and matches the Figma design"
  • Don't be afraid to leave comments or ask questions, especially if you don't understand why something was done! (This is often a great time to suggest code comments or documentation updates)
  • Check that all code is adequately covered by tests - if it isn't feel free to suggest the addition of tests.

@aterstriep aterstriep changed the base branch from main to feature/EASI-4521_grb_presentation_links January 28, 2025 19:54
Copy link

EKS Ingress URLs

@aterstriep aterstriep marked this pull request as ready for review January 31, 2025 18:43
@aterstriep aterstriep requested a review from a team as a code owner January 31, 2025 18:43
@aterstriep aterstriep requested review from adamodd and removed request for a team January 31, 2025 18:43
Copy link
Contributor

@patrickseguraoddball patrickseguraoddball left a comment

Choose a reason for hiding this comment

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

After adding a link to a transcript (or an upload), saving, then going back in to edit, the link/upload isn't pre-populated. Additionally, every other hit on the form to edit, the presentation deck file isn't show/empty, even though I uploaded the file. Not sure if this matters or in scope since we are changing the behavior of the presentation deck, but the transcript link should be in scope.

Screenshot 2025-02-04 at 12 07 16 PM

It actually looks like the input value for the presentationDeckFileData and `` are both null despite adding both of those files

Screenshot 2025-02-04 at 12 16 10 PM

Getting a ts error here, didn't seem to be caught in CI/am using the workspace version of TS in the editor.

Screenshot 2025-02-04 at 1 18 55 PM
Screenshot 2025-02-04 at 1 13 06 PM

Comment on lines +41 to +47

// Display default filename with button to clear file
return (
<div className="maxw-none border border-dashed border-base-light font-body-2xs margin-top-1">
<div className="display-flex flex-justify padding-1 bg-primary-lighter">
<span className="text-bold">{t('selectedFile')}</span>
<Button
Copy link
Contributor

Choose a reason for hiding this comment

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

Might want to add a test for this to ensure that the name gets displayed if it's present

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this! I had a unit test for this in the presentation links form but forgot to add unit tests for the actual component. Tests have been added here.

- Submit button was disabled on edit if presentation deck file was previously uploaded, and a different field was updated
- Updated form to set default values for file upload fields
@aterstriep
Copy link
Contributor Author

Adding details from syncing on this PR for visibility:

After adding a link to a transcript (or an upload), saving, then going back in to edit, the link/upload isn't pre-populated.

This is caused by the transcriptLink field not being included in the GetSystemIntake query, so the data isn't available to populate the field when editing. This should be fixed with changes to #2958.

every other hit on the form to edit, the presentation deck file isn't show/empty, even though I uploaded the file

The mutation currently clears previously uploaded files from the database if the edit form is submitted without touching those fields. See Slack thread for details. The backend mutation is being fixed in #2966, and this will be fixed on the frontend in a separate ticket (EASI-4715).

Copy link
Contributor

@patrickseguraoddball patrickseguraoddball left a comment

Choose a reason for hiding this comment

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

Mobile sizing seems to be off

Screenshot 2025-02-05 at 12 45 50 PM

Copy link
Contributor

@patrickseguraoddball patrickseguraoddball left a comment

Choose a reason for hiding this comment

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

LG Thanks for all the help sorting everything out!

@aterstriep aterstriep merged commit 082e3b3 into feature/EASI-4521_grb_presentation_links Feb 5, 2025
14 checks passed
@aterstriep aterstriep deleted the EASI-4531/grb-presentation-links-form branch February 5, 2025 19:02
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.

2 participants