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

VACMS-16290 Event Listing #322

Merged
merged 29 commits into from
Jan 22, 2024
Merged

VACMS-16290 Event Listing #322

merged 29 commits into from
Jan 22, 2024

Conversation

jtmst
Copy link
Contributor

@jtmst jtmst commented Jan 4, 2024

Description

Closes #16290.

Testing done

Tested a variety of event listing pages + the different filters on the event list widget
Tested Lovell event listing

Screenshots

Standard Event List:
Screenshot 2024-01-10 at 9 57 46 AM

Lovell:
Screenshot 2024-01-10 at 9 57 20 AM
Screenshot 2024-01-10 at 9 57 26 AM

Outreach and Events (no menu)
Screenshot 2024-01-10 at 9 57 36 AM

QA steps

Tasks

Preview Give feedback

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 4, 2024 21:32 Destroyed
src/data/queries/eventListing.ts Fixed Show fixed Hide fixed
src/data/queries/eventListingTeaser.ts Fixed Show fixed Hide fixed
src/data/queries/eventListingTeaser.ts Fixed Show fixed Hide fixed
src/data/queries/eventListingTeaser.ts Fixed Show fixed Hide fixed
src/data/queries/eventListingTeaser.ts Fixed Show fixed Hide fixed
src/data/queries/eventListingTeaser.ts Fixed Show fixed Hide fixed
src/templates/layouts/eventListing/index.tsx Fixed Show fixed Hide fixed
ryguyk and others added 15 commits January 8, 2024 14:55
Co-authored-by: Tim Cosgrove <timcosgrove@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… 33.0.0 (#325)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…330)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 9, 2024 23:49 Destroyed
@tjheffner tjheffner marked this pull request as ready for review January 9, 2024 23:50
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 9, 2024 23:50 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 10, 2024 00:54 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 10, 2024 00:59 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 10, 2024 01:01 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 10, 2024 20:38 Destroyed
@tjheffner tjheffner requested a review from ryguyk January 10, 2024 20:54
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 10, 2024 22:26 Destroyed
timcosgrove
timcosgrove previously approved these changes Jan 10, 2024
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 11, 2024 22:28 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 11, 2024 23:33 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 11, 2024 23:41 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 11, 2024 23:43 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 11, 2024 23:52 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 00:01 Destroyed
Copy link
Contributor Author

@jtmst jtmst left a comment

Choose a reason for hiding this comment

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

@tjheffner This looks good to me but I cant approve as its originally my PR

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 18:54 Destroyed
Copy link
Contributor

@ryguyk ryguyk left a comment

Choose a reason for hiding this comment

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

This looks good overall. I have the one small question about link vs entityPath which I think we can consider, but the much larger question is around how Events is currently working (content-build and vets-website), whether it's correct, and whether we need to/should mimic that or, perhaps, if we should try to get this thing correct while we build it here. That is a much larger issue to consider.

Comment on lines +133 to 154
...federalPage[itemProp].map((item) => {
// Event Listing pages have the list items constructed a little differently.
// See queries/eventTeaser.ts
if (
itemProp ===
LISTING_RESOURCE_TYPE_URL_SEGMENTS[RESOURCE_TYPES.EVENT_LISTING]
) {
return {
...item,
link: getLovellVariantOfUrl(
item.entityUrl.path,
context.lovell.variant
),
}
}
// See queries/newsStoryTeaser.ts
return {
...item,
link: getLovellVariantOfUrl(item.link, context.lovell.variant),
}
}),
]
Copy link
Contributor

Choose a reason for hiding this comment

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

I find myself wondering why we have these defined differently. News stories normalize to link whereas events normalize to entityUrl.path.

Should we try to keep that consistent between entity types?

  1. If the answer is yes, we could leave this code untouched and adjust other code to settle on one approach.
  2. If the answer is no, and there's a good reason to normalize these differently, I wonder why we are setting a link value here rather than keeping it entityUrl.path.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would love this to be consistent across entity types, but I think events as currently constructed would be a larger refactor to do so. I would like to punt on this as I don't think "fixing" events is necessarily within the scope of AP. We should provide the framework for the other product teams to update their products as they are able to do so.

Coordinating events changes between content-build, vets-website, and next-build feels like a larger rabbit hole than we have time for. Ideally, the events changes can happen in vets-website and next-build after content-build is retired.

const LISTING_RESOURCE_TYPES = [RESOURCE_TYPES.STORY_LISTING] as const
const LISTING_RESOURCE_TYPES = [
RESOURCE_TYPES.STORY_LISTING,
RESOURCE_TYPES.EVENT_LISTING,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we aren't treating event listings the same as story listings with regard to generating subsequent pages, I initially wondered if we actually wanted to consider it a listing resource and add to LISTING_RESOURCE_TYPES. But, there's this code block from src/lib/drupal/staticPaths.ts that reminds me it's important to treat it as a listing resource from the standpoint of removing Lovell federal pages from the build:


  if (isListingResourceType(resourceType)) {
    const lovellFederalRemoved = removeLovellFederalPathResources(resources)
    return await getAllPagedListingStaticPathResources(
      lovellFederalRemoved,
      resourceType as ListingResourceType
    )
  }

Copy link
Contributor

Choose a reason for hiding this comment

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

So there are really two approaches:

  1. As is here. Leave it as a "listing resource" but hard-code totalPages to 1.
  2. Do not consider it a "listing resource" and then change checks like the one shown in the above comment to instead check another config value like LOVELL_REMOVE_FEDERAL_RESOURCE_TYPES.

For now, I like sticking with option 1, but I'm noting here because it might be the case in the future that additional business logic for "listing resources" could possibly make us have to do additional things for "real" listing resources (i.e. multiple static pages generated in staticPaths) vs. "browser-widget" listing resources (i.e. single page generated and uses a client-side UI to navigate pages) that would make them more different than they are similar. In that case, it would maybe make sense to separate them more completely and handle their similarities as the exception rather than their differences as the exception.

Copy link
Contributor

Choose a reason for hiding this comment

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

I lean towards option 1. Personally, I think it makes more sense conceptually to treat "browser-widget" listing resources as "listing resources" with a hardcoded totalPages of 1.

essentially, listing page without extra generated pages for pagination

Comment on lines +41 to +43
// This populates the whole events widget, even upcoming events. IDK!
window.pastEvents = { entities: events }
}, [menu, events])
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is enough. In content-build, both pastEvents and allEventTeasers are populated. However, it's not clear if that is actually working correctly either. See this Slack discussion.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is working correctly in that the functionality of the filters matches what prod does. The list appears to filter to the same results whether allEventTeasers is included or not. Open to opinions otherwise, but again, I think refactoring the Events Listing widget from vets-website is out of scope for our team.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2024 17:22 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2024 17:34 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2024 18:49 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2024 19:05 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.

approving, will follow up in future PRs

@tjheffner tjheffner merged commit 65f6e78 into main Jan 22, 2024
7 checks passed
@tjheffner tjheffner deleted the 16290-event-listings branch January 22, 2024 21:07
timcosgrove added a commit that referenced this pull request Jan 24, 2024
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Ryan Koch <6863534+ryguyk@users.noreply.github.com>
Co-authored-by: Tanner Heffner <tannerjheffner@gmail.com>
Co-authored-by: Tim Cosgrove <timcosgrove@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tanner Heffner <tanner.heffner@agile6.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.

5 participants