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-4488] GRB Review supporting docs table #2776

Merged
merged 15 commits into from
Aug 28, 2024

Conversation

mynar7
Copy link
Contributor

@mynar7 mynar7 commented Aug 22, 2024

EASI-4488

Description

  • Adds the supporting documents table to the GRB Review page (Figma).
  • Note: Navigation link work was separated out into 4583.

How to test this change

  • Start the app
  • Run the seed scripts with scripts/dev db:clean && scripts/dev db:seed
  • Clean the documents so you can see the view/delete buttons with scripts/dev minio:clean
  • Navigate to this intake GRB Review page with multiple reviewers.
    • USR1 is the requester for this intake, but you may sign in with A11Y who is assigned as a reviewer to verify you cannot delete documents. You can also add documents as an admin that is not the requester with this job code for additional testing.

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.

@mynar7 mynar7 requested review from a team as code owners August 22, 2024 21:54
@mynar7 mynar7 requested review from samoddball, aterstriep and downeyn-cms and removed request for a team August 22, 2024 21:54
@mynar7 mynar7 changed the base branch from main to feature/EASI-4485 August 22, 2024 21:55
@mynar7 mynar7 removed the request for review from downeyn-cms August 22, 2024 21:55
Copy link
Contributor

@samoddball samoddball left a comment

Choose a reason for hiding this comment

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

looks good! few comments, none blocking

@@ -27,17 +27,17 @@ func GetSystemIntakeDocumentsByRequestID(ctx context.Context, id uuid.UUID) ([]*
}

// GetURLForSystemIntakeDocument queries S3 for a presigned URL that can be used to fetch the document with the given s3Key
func GetURLForSystemIntakeDocument(ctx context.Context, store *storage.Store, s3Client *upload.S3Client, s3Key string) (string, error) {
func GetURLForSystemIntakeDocument(ctx context.Context, store *storage.Store, s3Client *upload.S3Client, s3Key string) (*string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

curious - why ptr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I needed to allow for null document URLs in case the user is not allowed to view them. I modified the permissions code to not throw errors if the user can't view.

S3Key: s3Key,
Bucket: s3Client.GetBucket(),
UploaderRole: uploaderRole,
SystemIntakeID: input.RequestID,
Copy link
Contributor

Choose a reason for hiding this comment

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

nice rename

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was my bad, I didn't realize GQL needed the names to match to auto-resolve.

@@ -1780,9 +1780,10 @@ type SystemIntakeDocument {
status: SystemIntakeDocumentStatus!
version: SystemIntakeDocumentVersion!
uploadedAt: Time!
url: String!
url: String
Copy link
Contributor

Choose a reason for hiding this comment

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

is this why ptr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I need to be able to return null for URLs the user isn't allowed to view.

Comment on lines +15 to +16
canView
canDelete
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

export function downloadFileFromURL(downloadURL: string, fileName: string) {
return axios
export function downloadFileFromURL(
downloadURL: string | null,
Copy link
Contributor

Choose a reason for hiding this comment

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

going back to the ptr questions above - i am wondering if it might be easier to just len check instead of introducing null here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Idk, probably a question for @aterstriep

Copy link
Contributor

Choose a reason for hiding this comment

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

I think returning null if there isn't a URL makes sense. We could forget to check the string length to account for an empty string, but having it nullable makes sure we get a ts error if we try to use the URL without checking that it exists.

src/views/GovernanceReviewTeam/GRBReview/index.tsx Outdated Show resolved Hide resolved
{/* Business Case Card */}
<div className="usa-card__container margin-left-0">
<CardHeader>
<h3 className="display-inline-block margin-right-2">
Copy link
Contributor

Choose a reason for hiding this comment

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

The "last updated" text breaks on mobile, so you could update this class to tablet:display-inline-block to keep that from happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in f2c84ba

src/views/GovernanceReviewTeam/GRBReview/index.tsx Outdated Show resolved Hide resolved
src/views/GovernanceReviewTeam/GRBReview/index.tsx Outdated Show resolved Hide resolved
src/views/GovernanceReviewTeam/GRBReview/index.tsx Outdated Show resolved Hide resolved
Comment on lines 192 to 197
<h3 className="display-inline-block margin-right-2 margin-bottom-0">
{t('businessCaseOverview.title')}
</h3>
{/* TODO: update these checks to use submittedAt when implemented */}
{businessCase.id && businessCase.updatedAt && (
<span className="text-base tablet:display-inline-block">
Copy link
Contributor

Choose a reason for hiding this comment

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

The "last updated" text is still breaking on mobile:

Screenshot 2024-08-28 at 10 22 21 AM

The tablet:display-inline-block class needs to be on the h3 tag, not the span.

Suggested change
<h3 className="display-inline-block margin-right-2 margin-bottom-0">
{t('businessCaseOverview.title')}
</h3>
{/* TODO: update these checks to use submittedAt when implemented */}
{businessCase.id && businessCase.updatedAt && (
<span className="text-base tablet:display-inline-block">
<h3 className="tablet:display-inline-block margin-right-2 margin-bottom-0">
{t('businessCaseOverview.title')}
</h3>
{/* TODO: update these checks to use submittedAt when implemented */}
{businessCase.id && businessCase.updatedAt && (
<span className="text-base">

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not able to reproduce this locally with display-inline-block set on both the span and h3. I'll test further, though.

Comment on lines 241 to 243
<Alert type="info" className="margin-left-5 margin-bottom-5">
{t('businessCaseOverview.unsubmittedAlertText')}
</Alert>
Copy link
Contributor

Choose a reason for hiding this comment

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

This Alert should have the slim prop, and needs some padding on the right side to keep it from extending to the edge of the Card.

Current:
Screenshot 2024-08-28 at 10 50 20 AM

Figma:
Screenshot 2024-08-28 at 10 52 45 AM

You can remove the util classes and wrap it in a CardBody component to fix the padding:

Suggested change
<Alert type="info" className="margin-left-5 margin-bottom-5">
{t('businessCaseOverview.unsubmittedAlertText')}
</Alert>
<CardBody>
<Alert type="info" slim>
{t('businessCaseOverview.unsubmittedAlertText')}
</Alert>
</CardBody>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in e4f760e.

Comment on lines 203 to 205
{businessCase.id &&
businessCase.businessNeed &&
businessCase?.preferredSolution?.summary ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

If you submit a draft business case without the preferred solution fields filled in, it's showing the "there is not yet a Business Case for this request" alert. It should still display the business case as submitted even if those fields are empty. (Go to /governance-review-team/69357721-1e0c-4a37-a90f-64bb29814e7a/grb-review to see a mock data example)

The businessCase?.preferredSolution?.summary condition just needs to be removed here since that field is optional on a draft business case.

The businessCase.businessNeed field is required so you could leave that condition, but it's unnecessary as long as you're checking for the business case ID.

Suggested change
{businessCase.id &&
businessCase.businessNeed &&
businessCase?.preferredSolution?.summary ? (
{businessCase.id ? (

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be a Zoe question, but should I hide the preferred solution UI if there is none?

Copy link
Contributor

Choose a reason for hiding this comment

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

We leave it blank on the Business Case tab but might be worth checking with Zoe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Spoke with Zoe, added in e4f760e.

@mynar7 mynar7 merged commit 571bb8a into feature/EASI-4485 Aug 28, 2024
12 checks passed
@mynar7 mynar7 deleted the EASI-4488/grb-docs-table branch August 28, 2024 19:57
mynar7 added a commit that referenced this pull request Sep 6, 2024
* [EASI-4488] Add new document types to intake form (#2748)

* add new document types, adjust form and table, fix minio scripts

* fix cypress, remove commented code

* use translation to enforce enum options

* [EASI-4488] Add permissions to GQL schema for intake documents (#2756)

add permissions to GQL schema for intake documents

* [EASI-4489] System intake document upload form (#2760)

* Add version help text

* Update form to match Figma

* Add type prop to UploadForm

* Admin upload form

* Conditional return link

* Validation schema

* Easi 4580/email notifications (#2774)

* UI for selecting if notification should go out

* add bool check to BE

* fix bool radio

* typo

* add condition

* fix imports

* refs

* use `field.onChange` instead of `setValue`

* trying to fix snapshot

* put snap back

* added UI tests for UploadForm notification display

* add some tests for BE

* fix ref, error condition, text

* updates to validation

* [EASI-4488] GRB Review supporting docs table (#2776)

* update queries to include permissions for docs

* add documents table

* address feedback, update docs table in other places

* update snapshot

* fix failing cypress test

* fix biz case solution rendering and alert padding

* rename migration number

* [EASI-4591] IT Gov admin route updates (#2781)

* governance-review-team -> it-governance

* Update subNavItems + context

* Route updates

* Remove hidden nav links from array

* Unit test fixes

* Unit tests for action buttons

* Redirect for old admin links

* Update url in e2e tests

* Upload form route

* Test file routes

* [EASI-4597] Add software BOM to doc types (#2787)

add software BOM to doc types

* [EASI-4583] GRB review sub navigation links (#2792)

* SideNavigation component

* RequestOverview side nav

- Updated to use SideNavigation component
- Added Supporting Documents and Participants links

* Child nav link functionality

* AccordionNavigation updates

* Remove unused CSS

* Snapshot

Accordion navigation button no longer renders on desktop

* I definitely didn't forget this before

* e2e test fix

* e2e test fix - actions link selector

* e2e test fix - lcid link selector

* e2e test fix - dates link selector

* NOREF - change email link URLs to reference new path (#2795)

change email link URLs to reference new path

* Update pre-signed S3 url timeout to 90 minutes

---------

Co-authored-by: Ashley Terstriep <60187543+aterstriep@users.noreply.github.com>
Co-authored-by: samoddball <156127704+samoddball@users.noreply.github.com>
Co-authored-by: ClayBenson94 <clay.benson@oddball.io>
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