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

Cdc thematic views - Landing page for thematic views, filter/field exclusions, routing #53

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

openconcept
Copy link
Collaborator

Changes from last PR:

New functionality:

  • Added exclusion of fields/filters per thematic view, see src/utilities/thematicViews.ts. Filters can also be excluded on the index level. Current example is the publisher field hidden on the HumMingBird collection.
  • Added landing page displaying all available collections (thematic views), and there is also a new top menu item ("Collections") for this. The page is auto-generated from the configuration in src/utilities/thematicViews.ts (except for intro text at the top).
  • Improved layout/visuals for static information pages and harmonised some colour usage throughout.
  • Updated footers with CESSDA logo and links. It's possible to create a separate component for presumed common parts of the footer, but I don't think we yet know all possible scenarios for these and it's fairly easy to manage the footers at present. Currently only COORDINATE has a custom footer with the Horizon branding at the bottom.

Notes and fixes:

  • WAVE accessibility tests should now pass. Some fixes required hacking a couple of Instantsearch widget source files since they were incomplete in this regard, otherwise we'd have to create custom widgets just to get around Instantsearch WAI bugs. Several of these issues are also present in the original coordinate-portal repo.
  • The language reducer is gone in favor of the thematicView reducer The lang url parameter is still supported for backwards compatibility with the current CDC (and used when switching display language for a single study in detail view).
  • Routing and UI state management is buggy in the original coordinate-portal and has caused quite a lot of consternation during development, especially when combined with occasional issues with the ES indexes themselves making it difficult to troubleshoot.
  • Currently I have temporarily reverted to removing the key for Instantsearch routing and implemented the sortBy parameter on relevant links, but the behaviour is still on occasion inconsistent. We need to do a thorough audit of the routing and state handling and identify the source of the issues (some may be in Instantsearch itself or the route to state conversions).
  • ScrollRestoration should work except when there is an intermittent and unnecessary location change on the Detail page, see previous point.

Todos:

  • Audit and fix the routing / UI state properly.
  • Fix search field so it shows latest search on back navigation once routing / UI state is sorted.
  • Tests will take quite a bit of work and are still on hold since there are fundamental routing / state issues to be resolved.
  • Developer documentation for adding new thematic views (collections)
  • Thematic view CSS will be more normalised to simplify adding new views.

@markusjt markusjt self-requested a review February 3, 2025 08:49
Copy link
Contributor

@markusjt markusjt 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 this! Changes sound good and also look good from briefly checking on my dev server. Some notes:

  • I guess this is the same branch that was merged and deleted once on GitHub already so it resulted in some conflicts that need to be resolved before it can be merged into main. Probably better to do the merge/rebase locally and then push. I've never tried GitHub's 'Resolve conflicts' though so maybe it would be decent.
  • I think we should not hack Instantsearch widget source files but we should also not create custom widgets just to fix these small issues so instead we can just document these issues in accessibility statement.
  • Scroll restoration now seems to work on Chromium based browsers but not on Firefox. On Firefox the page will be slightly scrolled but still have part of search bar visible and focused instead of fully scrolling to where it was.

@@ -59,7 +58,7 @@
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-transform-runtime": "7.21.0",
"@babel/preset-env": "7.20.2",
"@babel/preset-react": "7.18.6",
"@babel/preset-react": "^7.26.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

This updated package is now not locked to this specific version.

export const thematicViews: readonly ThematicView[] = [
{
"key": "cdc",
"path": "/",
"defaultIndex": "cmmstudy_en",
"title": "Data Catalogue",
"longTitle": "CESSDA Data Catalogue",
"listDescription": "The CESSDA Data Catalogue master collection contains descriptions of more 40,000 data collections held by CESSDA’s Service Providers (SPs), originating from over 20 European countries.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Small mistake in text: missing 'than' in 'more than'.

}
]
],
excludeFields: ["publisher"],
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 publisher should still be shown on detail page, at least personally I was only talking about excluding filter.

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