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: UI modifications to the article template #856

Merged
merged 18 commits into from
Nov 18, 2022

Conversation

jcbcapps
Copy link
Contributor

@jcbcapps jcbcapps commented Nov 8, 2022

SC-1115

Proposed changes

A user will see the following new components on the article UI:

  • Label(s)
  • Byline
  • Location
  • Tags

Reviewer notes

To see these changes in the UI:

  • Create an article (category can be either Internal News or ORBIT Blog)
  • Add a label, byline, location and tag
  • On the portal, navigate to your article and verify that each of the items are displayed in the article and match the screenshot below

Setup

As always, run both the portal client and the CMS on your local machine


Code review steps

As the original developer, I have

  • Met the acceptance criteria, or will meet them in subsequent PRs or stories
    • ...
  • Created new stories in Storybook if applicable
    • Checked that all Storybook accessibility checks are passing
  • Created/modified automated unit tests in Jest
    • Including jest-axe checks when UI changes
  • Created/modified automated E2E tests in Cypress
    • Including cypress-axe checks when UI changes
    • Checked that the E2E test build is not failing
  • Performed a11y testing:
    • Checked responsiveness in mobile, tablet, and desktop
    • Checked keyboard navigability
    • Tested with VoiceOver in Safari
    • Checked VO's rotor menu for landmarks, page heading structure and links
    • Used a browser a11y tool to check for issues (WAVE, axe, ANDI or Accessibility addon tab for Storybook)
  • Requested a design review for user-facing changes
  • For any new migrations/schema changes:
    • Followed guidelines for zero-downtime deploys

As code reviewer(s), I have

  • Pulled this branch locally and tested it
  • Reviewed this code and left comments
  • Checked that all code is adequately covered by tests
    • Checked that the E2E test build is not failing
  • Made it clear which comments need to be addressed before this work is merged
  • Considered marking this as accepted even if there are small changes needed
  • Performed a11y testing:
    • Checked responsiveness in mobile, tablet, and desktop
    • Checked keyboard navigability
    • Tested with VoiceOver in Safari
    • Checked VO's rotor menu for landmarks, page heading structure and links
    • Used a browser a11y tool to check for issues (WAVE, axe, ANDI or Accessibility addon tab for Storybook)

As a designer reviewer, I have

  • Checked in the design translated visually
  • Checked behavior
  • Checked different states (empty, one, some, error)
  • Checked for landmarks, page heading structure, and links
  • Tried to break the intended flow
  • Performed a11y testing:
    • Checked responsiveness in mobile, tablet, and desktop
    • Checked keyboard navigability
    • Tested with VoiceOver in Safari
    • Checked VO's rotor menu for landmarks, page heading structure and links
    • Used a browser a11y tool to check for issues (WAVE, axe, ANDI or Accessibility addon tab for Storybook)

As a test user, I have

  • Run through the Test Script:
    • On commercial internet in IE11
    • On commercial internet in Firefox
    • On commercial internet in Chrome
    • On commercial internet in Safari
    • On NIPR in IE11
    • On NIPR in Firefox
    • On NIPR in Chrome
    • On NIPR in Safari
    • On a mobile device in Firefox
    • On a mobile device in Chrome
    • On a mobile device in Safari
  • Added any anomalous behavior to this PR

Screenshots

tags+labels

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #1115: UI modifications to the article template.

Comment on lines 13 to 17
// TODO: Find a way to destructure this.
// I think I need to use nullish coalescing here,
// but can't figure out how to write it properly
// byline: { name: byline },
// location: { name: location },
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 made byline and location optional in the type, but can't figure out how to destructure them properly. I tried a few things: a ternary, default params, nullish coalescing, but none of that worked. Would love some input on this, but if we can't get it, then it works just fine declaring the old way as you can see below on lines 52, 55, 59 and 62.

Copy link
Contributor

Choose a reason for hiding this comment

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

destructuring all the way would be nice, but I'm fine if we just keep it to the following and then byline.name / location.name down in the code later. No need to get too complex with the destructuring, imo.

Suggested change
// TODO: Find a way to destructure this.
// I think I need to use nullish coalescing here,
// but can't figure out how to write it properly
// byline: { name: byline },
// location: { name: location },
byline,
location,

Copy link
Contributor

Choose a reason for hiding this comment

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

Guess the other option is to not make them optional, but that feels unnecessary since they are optional fields on article.

@jcbcapps jcbcapps marked this pull request as ready for review November 8, 2022 20:07
@jcbcapps jcbcapps requested review from a team November 8, 2022 20:10
Copy link
Contributor

@malworks malworks left a comment

Choose a reason for hiding this comment

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

Hurray we have content identifiers! Two things I noticed:

  • It doesn't look like the category label is being displayed
  • The order of the content identifiers should go from global to more granular (Category, Label, Tag) Right now it looks like it is going (Tag, Label)

@jcbcapps jcbcapps requested a review from malworks November 15, 2022 20:16
Copy link
Contributor

@malworks malworks left a comment

Choose a reason for hiding this comment

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

🎉

Copy link
Contributor

@gidjin gidjin left a comment

Choose a reason for hiding this comment

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

Left a comment around the destructuring todo, but other than that looks good to me :)

{dateFormatter.format(publishedDateObj)}
</time>
</dd>
<div>
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: I was at first confused by the div in the dl but turns out it is valid html and there for grouping. https://www.stefanjudis.com/today-i-learned/divs-are-valid-elements-inside-of-a-definition-list/

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 mentioning this! I meant to add a comment about it, as I was initially having trouble grouping the dl elements until I found the same docs.

Comment on lines 13 to 17
// TODO: Find a way to destructure this.
// I think I need to use nullish coalescing here,
// but can't figure out how to write it properly
// byline: { name: byline },
// location: { name: location },
Copy link
Contributor

Choose a reason for hiding this comment

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

destructuring all the way would be nice, but I'm fine if we just keep it to the following and then byline.name / location.name down in the code later. No need to get too complex with the destructuring, imo.

Suggested change
// TODO: Find a way to destructure this.
// I think I need to use nullish coalescing here,
// but can't figure out how to write it properly
// byline: { name: byline },
// location: { name: location },
byline,
location,

Comment on lines 13 to 17
// TODO: Find a way to destructure this.
// I think I need to use nullish coalescing here,
// but can't figure out how to write it properly
// byline: { name: byline },
// location: { name: location },
Copy link
Contributor

Choose a reason for hiding this comment

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

Guess the other option is to not make them optional, but that feels unnecessary since they are optional fields on article.

@@ -21,16 +27,58 @@ export const SingleArticle = ({ article }: { article: ArticleRecord }) => {

return (
<article className={styles.SingleArticle}>
<div className={styles.title}>
<div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Where do ORBIT Blog articles fit into this? Is that considered internal news? I know there are two separate categories in the CMS for internal news vs orbit blog, but don't see ORBIT Blog reflected in the constants in this repo. Did we miss something in the past, or am I getting the information architecture confused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great question. I think we maybe missed this in the past? I think I added in the constants when creating the internal news page since we were trying to differentiate between what is public-facing and what isn't. But I don't believe the ORBIT Blog was available at that point? Since the blog is just updates that we are making, and the portal is open-source, it doesn't seem like it should be considered "internal." I guess this would ultimately be a design decision as to whether or not we need a new tag for this? Maybe we can discuss in our sync today.

@jcbcapps jcbcapps merged commit dc7402c into main Nov 18, 2022
@jcbcapps jcbcapps deleted the sc-1115/updates-to-article-template branch November 18, 2022 18:28
@gidjin gidjin mentioned this pull request Nov 30, 2022
gidjin added a commit that referenced this pull request Nov 30, 2022
## [4.11.0](4.10.0...4.11.0) (2022-11-30)


### Features

* Create USSF Documentation page ([#860](#860)) ([6c5d6b3](6c5d6b3))
* UI modifications to the article template ([#856](#856)) ([dc7402c](dc7402c))
@gidjin gidjin mentioned this pull request Dec 13, 2022
gidjin added a commit that referenced this pull request Dec 13, 2022
## [4.12.0](4.10.0...4.12.0) (2022-12-13)


### Features

* Add support for hero image in articles ([#862](#862)) ([56721db](56721db))
* add USSF Guardian Commitment Poster to docs page ([#888](#888)) ([07fb472](07fb472))
* Create USSF Documentation page ([#860](#860)) ([6c5d6b3](6c5d6b3))
* Display hero image in article layout ([#884](#884)) ([b2201ac](b2201ac))
* UI modifications to the article template ([#856](#856)) ([dc7402c](dc7402c))


### Bug Fixes

* **deps:** update dependency axios to v1 ([#851](#851)) ([de30320](de30320))


### Security Improvements

* **deps:** update node.js to v14.21.1 ([#849](#849)) ([46aba91](46aba91))
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