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

feat(SLB-512) Taxonomy filters content hub #391

Open
wants to merge 27 commits into
base: release
Choose a base branch
from

Conversation

elistone
Copy link
Member

@elistone elistone commented Jan 2, 2025

Description of changes

Adding and exposing taxonomy filters onto the content hub.

Motivation and context

To create better filtering for content.

How has this been tested?

  • Manually
  • Unit tests
  • Integration tests

@elistone elistone marked this pull request as draft January 2, 2025 15:20
@elistone elistone marked this pull request as ready for review January 20, 2025 14:15
Copy link
Contributor

@pmelab pmelab left a comment

Choose a reason for hiding this comment

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

That works pretty well already!
I added some suggestions on how to make the select box appear immediately.

@@ -0,0 +1,8 @@
query ContentHubTerms {
Copy link
Contributor

Choose a reason for hiding this comment

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

By adding this one as a static query and injecting it as an executor, the options could be fetched at build time and appear immediately when the page is opened. It should work the same way as the FrameQuery in layout.tsx:

const data = useStaticQuery(graphql(FrameQuery));
return (
<OperationExecutorsProvider
executors={[
{ executor: drupalExecutor(`/graphql`) },
{ executor: data, id: FrameQuery },

@@ -451,6 +501,9 @@ type Query {

stringTranslations: [TranslatableString!]
@gatsbyNodes(type: "TranslatableString")

contentHubTerms: TermContentHubResults!
@loadByVocabulary(bundle: "content_hub")
Copy link
Contributor

Choose a reason for hiding this comment

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

To make the above work, this would have to use @gatsbyNodes as well, so Gatsby knows about content hub terms.

"""
Content Hub Terms Results from query
"""
type TermContentHubResults
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 type required? Couldn't the Query.contentHubTerms field directly output [TermContentHub].

}

return [
'total' => count($items),
Copy link
Contributor

Choose a reason for hiding this comment

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

If the other changes are applied, we would also emit just the list of items directly, and no wrapping result opject.

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