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

Fix AudienceTopics styles and add types #367

Merged
merged 3 commits into from
Jan 30, 2024

Conversation

jtmst
Copy link
Contributor

@jtmst jtmst commented Jan 29, 2024

Description

department-of-veterans-affairs/va.gov-cms#16617

Tags for resource and support taxonomies were largely already done. This PR fixes up some styling and adds type safety to the getTags function.

Changes

  • Styling for tag borders
  • Styling for spacing
  • Types in query function

Testing done

Local

Screenshots

image

QA steps

Verify tags render as expected in storybook

Is this PR blocked by another PR?

  • Add the DO NOT MERGE label
  • Add links to additional PRs here:

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 29, 2024 14:37 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 29, 2024 22:05 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 29, 2024 23:40 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 30, 2024 00:04 Destroyed
@@ -6,10 +6,11 @@ export function AudienceTopics({ tags }: FormattedAudienceTopics) {
if (isEmpty(tags)) return null
const tagsList = tags.map(({ id, href, name }) => (
<div key={id}>
<div className="vads-u-margin-right--1 vads-u-margin-bottom--1 medium-screen:vads-u-margin-bottom--0">
<div className="vads-u-margin-right--1 vads-u-margin-bottom--1 medium-screen:vads-u-margin-bottom--1p5">
<Link
href={`${href}/${encodeURI(name)}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't think this href is correct. the /${encodeURI(name)} portion can be dropped.

looking at va.gov:
Screenshot 2024-01-30 at 8 29 26 AM

this pr:
/resources/tag/all-veterans/All%20Veterans

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, ty

@@ -3,14 +3,21 @@ import { ParagraphAudienceTopics } from '@/types/drupal/paragraph'
import { QueryFormatter } from 'next-drupal-query'
import { AudienceTopic } from '@/types/formatted/audienceTopics'

const getTagsList = (fieldTags) => {
if (!fieldTags) return null
interface Tag {
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 needed?

if the formatter is returning AudienceTopic[] but it just calls getTagsList which returns Tag[], can we re-use one or the other?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missed that, thanks

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 30, 2024 16:56 Destroyed
@jtmst jtmst requested a review from tjheffner January 30, 2024 16:56
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 30, 2024 17:04 Destroyed
@tjheffner tjheffner merged commit ce5dc31 into main Jan 30, 2024
7 checks passed
@tjheffner tjheffner deleted the 16617-taxonomy--resources_support_categories branch January 30, 2024 17:11
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