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

feat: Add Guardian Directory page #1127

Merged
merged 18 commits into from
Oct 31, 2023
Merged

feat: Add Guardian Directory page #1127

merged 18 commits into from
Oct 31, 2023

Conversation

abbyoung
Copy link
Contributor

@abbyoung abbyoung commented Oct 18, 2023

SC-2303

Related PR: https://github.com/USSF-ORBIT/ussf-personnel-api/pull/18

Proposed changes

Add guardian directory page and table. Reads from personnel api. New launch darkly flag to control visibility.


Reviewer notes

Due to changes needed in the shared e2e build workflow the e2e tests won't run for this branch until after those updates are merged. You can see that the tests are green though in this branch https://github.com/USSF-ORBIT/ussf-portal/pull/324

Setup

Run the system as normal and go to the guardian directory via the link

First you will need to clone and checkout the matching branch of the USSF-ORBIT/ussf-personnel-api

Second edit the docker-compose.services.yml file in this repo to use the local checkout of the personnel api

diff --git a/docker-compose.services.yml b/docker-compose.services.yml
index 66c804f5..e6649320 100644
--- a/docker-compose.services.yml
+++ b/docker-compose.services.yml
@@ -13,8 +13,8 @@ services:
     container_name: personnel-api
     build:
       # Uncomment the below line to work with local check out
-      # context: ../ussf-personnel-api/
-      context: https://github.com/USSF-ORBIT/ussf-personnel-api.git#main
+      context: ../ussf-personnel-api/
+      # context: https://github.com/USSF-ORBIT/ussf-personnel-api.git#main
       dockerfile: Dockerfile
       target: builder
     restart: always

Start the system

yarn services:up --build
yarn dev
cd ../ussf-portal-cms
yarn dev

Login to the portal http://localhost:3000

Start storybook

yarn storybook

Login to storybook http://localhost:6006, though the command above should open it for you


Code review steps

As the original developer, I have

  • Met the acceptance criteria
  • Created new stories in Storybook if applicable
  • Created/modified automated unit tests in Jest
  • Created/modified automated E2E tests
  • Followed guidelines for zero-downtime deploys, if applicable
  • Use ANDI to check for basic a11y issues

As a reviewer, I have

Check out our How to review a pull request document.


Screenshots

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #2303: Create a Guardian Directory page and add pagination.

@gidjin gidjin force-pushed the sc-2303-guardian-directory branch from 9fd7bbd to 21ca464 Compare October 27, 2023 08:38
@gidjin gidjin marked this pull request as ready for review October 27, 2023 21:37
@gidjin gidjin requested review from a team as code owners October 27, 2023 21:37
@AnnaGingle
Copy link

Great work! I do see some conflicts with the design.

  • Light mode ... button should have the color fill #424242 rather than #cfd3da
  • Dark mode ... button should have the color fill #BBBFD2. Currently, it's failing color contrast guidelines.

@@ -35,6 +37,13 @@ const DefaultLayout = ({
},
{ path: '/ussf-documentation', label: 'USSF documentation' },
]
if (flags.guardianDirectory) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

awesome, thank you!

} = await dataSources.personnelAPI.getGuardianDirectory()

const guardianDirectory: GuardianDirectory[] = []
// Pull out and format relevant data to return for directory
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gidjin I noticed the formatting is gone and all the text is rendering as-is from the spreadsheet / mostly in caps. This might not be the best place to handle it (where I had it before), but maybe we should add it back somewhere else? Plain CSS wasn't working for me. Lmk what you think!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

never mind! i just saw it's in the personnel-api branch -- missed it before :) thank you!

Copy link
Contributor

Choose a reason for hiding this comment

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

The formatting moved to the personnel API see PR https://github.com/USSF-ORBIT/ussf-personnel-api/pull/18. I did that because I don't know what data formatting we will need to do once we have access to the real API we may still have to do data transformation and it felt best to do that in our personnel API since I see it as place to transform external APIs into what we need for this. Sorry for not flagging that in the description! If you have questions or can't get that to work let me know

@AnnaGingle
Copy link

This is the button I am referring to
Screenshot 2023-10-30 at 9 06 36 AM

@AnnaGingle
Copy link

I don't know the state we want to leave this in. I see some styling inconsistencies we will want to address after we finish our current priorities.

Table header

Screenshot 2023-10-31 at 8 18 26 AM

  • Fill is #091321 should be #000000
  • Table header missing filter icon
  • Table header padding is incorrect. The text should align with table data. See img below.
Screenshot 2023-10-31 at 8 12 27 AM
  • Text color should be #FFF8E7 in dark & light mode.

Table data cell

  • The padding is off. See Figma
Screenshot 2023-10-31 at 8 13 20 AM

Table

  • Border should be light mode: #192766 dark mode: #00000
  • Table should have a top left and right corner radius of 8px. Bottom left and right corner radius 4px.
Screenshot 2023-10-31 at 8 14 20 AM

Copy link
Contributor

@jcbcapps jcbcapps left a comment

Choose a reason for hiding this comment

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

LGTM! Great work

Comment on lines +27 to +29
if (flags.guardianDirectory === false) {
router.replace('/404')
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this approach! Hadn't considered using a flag like this before. I'll be stealing this for future features 🙂

@mergify mergify bot merged commit 99bd917 into main Oct 31, 2023
@mergify mergify bot deleted the sc-2303-guardian-directory branch October 31, 2023 16:01
@AnnaGingle
Copy link

accessibility review

  • data table has no accessible name fail for 1.3.1-table-identification
  • Page title is USSF should be Guardian Directory - USSF portal

@gidjin
Copy link
Contributor

gidjin commented Oct 31, 2023

Added a story for this sc-2666

gidjin pushed a commit that referenced this pull request Nov 2, 2023
## [4.24.0](4.23.3...4.24.0) (2023-10-31)


### Features

* Add Guardian Directory page ([#1127](#1127)) ([99bd917](99bd917))


### Documentation

* move docs to the ussf-portal repo ([#1129](#1129)) ([6d6a740](6d6a740))


Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

4 participants