Skip to content

fix: gas-tags-not-showing #1604

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

Closed
wants to merge 1 commit into from
Closed

Conversation

BhattaraiSijan
Copy link

@BhattaraiSijan BhattaraiSijan commented Apr 9, 2025

Related Ticket: NASA-IMPACT/veda-ui#1597

Description of Changes

This pull request resolves the issue where the "Gas" taxonomy pills (e.g., CH₄, CO₂) were not being rendered in the footer of story cards. The following changes were made:

  • Updated the HubContent component to retrieve the "Gas" taxonomy using the getTaxonomy function.
  • Added conditional rendering logic to display the "Gas" pills in the footer of each story card if the taxonomy values exist.
  • Ensured that each gas pill links to a filtered view of stories based on the selected gas.

Notes & Questions About Changes

  • The getTaxonomy function was already available and used to retrieve taxonomy data for "Topics." It was reused to fetch the "Gas" taxonomy.
  • The rendering logic for the "Gas" pills mirrors the existing logic for "Topics" pills, ensuring consistency in design and functionality.
  • No additional styles were added, as the existing CardTopicsList and Pill components were sufficient for rendering the pills.

Validation / Testing [Link : deploy preview]

  • Validate that the "Gas" pills (e.g., CH₄, CO₂) are displayed in the footer of story cards when the "Gas" taxonomy is present in the story metadata.
  • Verify that clicking on a gas pill filters the stories by the selected gas and updates the URL query parameters accordingly.
  • Ensure that the addition of "Gas" pills does not affect the rendering or functionality of "Topics" pills or other card elements.

Copy link

netlify bot commented Apr 9, 2025

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit 3fe9714
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/67f6f12f7b532c0008ec8b1b
😎 Deploy Preview https://deploy-preview-1604--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@BhattaraiSijan BhattaraiSijan changed the title fix:gas-tags-not-showing fix: gas-tags-not-showing Apr 9, 2025
Copy link
Collaborator

@dzole0311 dzole0311 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing @BhattaraiSijan! Adding a few nit comments, the rest seems to work as expected.

@@ -153,6 +153,7 @@ export default function HubContent(props: HubContentProps) {
{displayStories.map((d) => {
const pubDate = new Date(d.pubDate);
const topics = getTaxonomy(d, TAXONOMY_TOPICS)?.values;
const gases = getTaxonomy(d, 'Gas')?.values; // Retrieve the Gas taxonomy
Copy link
Collaborator

Choose a reason for hiding this comment

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

@BhattaraiSijan Can we please add a new taxonomy type TAXONOMY_GASES here:

export const TAXONOMY_GRADE = 'Grade';
and use that to retrieve the values: const gases = getTaxonomy(d, TAXONOMY_GASES)?.values

@@ -225,6 +226,37 @@ export default function HubContent(props: HubContentProps) {
))}
</CardTopicsList>
) : null}
{gases?.length ? ( // Render Gas pills
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we please remove obsolete comments like this?

@@ -153,6 +153,7 @@ export default function HubContent(props: HubContentProps) {
{displayStories.map((d) => {
const pubDate = new Date(d.pubDate);
const topics = getTaxonomy(d, TAXONOMY_TOPICS)?.values;
const gases = getTaxonomy(d, 'Gas')?.values; // Retrieve the Gas taxonomy
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, can we also please make sure to clean up obsolete comments like // Retrieve the Gas taxonomy?

@BhattaraiSijan
Copy link
Author

Closed PR because it turns out it was the intended behavior that only TOPICS be shown as those pills.

@slesaad slesaad deleted the fix/gas-tags-on-stories-page branch April 30, 2025 14:23
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