-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
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>
There was a problem hiding this 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
There was a problem hiding this 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.
...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), | ||
} | ||
}), | ||
] |
There was a problem hiding this comment.
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?
- If the answer is yes, we could leave this code untouched and adjust other code to settle on one approach.
- 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 itentityUrl.path
.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
)
}
There was a problem hiding this comment.
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:
- As is here. Leave it as a "listing resource" but hard-code
totalPages
to1
. - 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.
There was a problem hiding this comment.
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
// This populates the whole events widget, even upcoming events. IDK! | ||
window.pastEvents = { entities: events } | ||
}, [menu, events]) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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
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>
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:
Lovell:
Outreach and Events (no menu)
QA steps
Tasks