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

Add events query/formatter/layout #264

Merged
merged 19 commits into from
Dec 12, 2023
Merged

Add events query/formatter/layout #264

merged 19 commits into from
Dec 12, 2023

Conversation

jtmst
Copy link
Contributor

@jtmst jtmst commented Dec 4, 2023

Description

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

Adds Events to next-build.

Changes:

  • Adds events query and formatter
  • formatter and query tests and mock data
  • Event layout
  • Event utl functions for date calculations
  • Unit tests
  • Google maps component
  • Adjusts social links component
  • Adds to storybook

Testing done

Local testing, unit tests

Screenshots

image

QA steps

Verify that event nodes (ie http://localhost:3000/central-iowa-health-care/events/52265/) render as expected
Verify that events data is properly brought in

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 December 4, 2023 19:11 Destroyed
src/pages/[[...slug]].tsx Fixed Show fixed Hide fixed
src/templates/layouts/event/index.tsx Fixed Show fixed Hide fixed
@jtmst jtmst marked this pull request as ready for review December 11, 2023 17:16
@jtmst jtmst changed the title WIP debugging Add events query/formatter/layout Dec 11, 2023
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 11, 2023 18:51 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 11, 2023 18:58 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 11, 2023 19:12 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 11, 2023 19:16 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 11, 2023 19:33 Destroyed
src/templates/layouts/event/util.tsx Outdated Show resolved Hide resolved
src/templates/common/socialLinks/index.tsx Outdated Show resolved Hide resolved
src/templates/layouts/event/index.tsx Fixed Show resolved Hide resolved
const formattedDates = formatDateObject(datetimeRange)

const mostRecentDate = deriveMostRecentDate(formattedDates)
const formattedTimestamp = deriveFormattedTimestamp(mostRecentDate)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if these should be handled inside the query formatter itself. fine here for now, just a thought

@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 12, 2023 16:37 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 12, 2023 16:54 Destroyed
@@ -5,5 +5,6 @@ import {

export const PAGE_SIZES = {
[RESOURCE_TYPES.STORY_LISTING]: 10,
[RESOURCE_TYPES.EVENT]: 10,
Copy link
Contributor

Choose a reason for hiding this comment

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

this will be for EVENT_LISTING instead of EVENT

const Template: ComponentStory<typeof Event> = (args) => <Event {...args} />

export const EventExample = Template.bind({})
EventExample.args = {
Copy link
Contributor

Choose a reason for hiding this comment

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

this feels like it's probably too many args, very likely doesn't need all of this data in order to render (like the nested breadcrumbs on facilityLocation, etc). not a blocker, we can clean it up later... i think most stories need some cleanup

src/types/dataTypes/drupal/node.ts Outdated Show resolved Hide resolved
src/types/dataTypes/drupal/node.ts Outdated Show resolved Hide resolved
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 12, 2023 20:48 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 12, 2023 21:02 Destroyed
Copy link
Contributor

@tjheffner tjheffner left a comment

Choose a reason for hiding this comment

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

wonderful work. there are a few small follow-up tasks, but those can be handled in a separate ticket & pr. this does a lot to get all of the event-related wiring in place and will be easy to iterate on.

the main follow up tasks i see:

  • event breadcrumbs are different from va.gov (home is hidden for us)
  • the "see more times" for recurring events shows all immediately, instead of initially trimming to 5
  • there appears to be some spacing differences at the bottom, but i like ours better.
  • some of the event field types still don't feel DRY to me. we can potentially re-use some things from paragraph.ts or field_types.d.ts
    Screenshot 2023-12-12 at 1 54 53 PM
    Screenshot 2023-12-12 at 1 55 19 PM

@tjheffner tjheffner merged commit e4ddfaa into main Dec 12, 2023
6 checks passed
@tjheffner tjheffner deleted the 15908-events branch December 12, 2023 22:06
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