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: Allow exclude list of categories #259

Merged
merged 6 commits into from
Sep 10, 2023

Conversation

rhystmills
Copy link
Contributor

@rhystmills rhystmills commented Sep 6, 2023

What does this change?

Allow an exclude list of categories rather than allowing only an allowlist.

This means that, in order to an exclude an existing category (i.e. the dictionary category) from a consumer (i.e. Composer), we don't have to fetch the categories, filter it out, then add them to a MatcherService - which also means we can initialised the prosemirrorTyperighterPlugin, in order to apply the exclusions to the first request (preventing a race condition where we initialised the plugin, get the matcher service, then request a category change).

Dependant on a change in typerighter.

How to test

  1. Run Typerighter locally using this branch: Allow list of excluded categories rather than requiring an allowlist typerighter#427
  2. Build prosemirror-typerighter locally using this branch and use in flexible-content with yalc (npm run yalc in prosemirror-typerighter then yalc add @guardian/prosemirror-typerighter in flexible-content.
  3. Run Composer using this branch: https://github.com/guardian/flexible-content/pull/4391
  4. Activate the feature switch via shift-f12 and refresh Composer
  5. Try the toggle in both the liveblog and article views. Do matches refresh on enabling or disabling the dictionary, so that only the appopriate matches show?
  6. If Collins is disabled, and you de-active the feature switch, does it remain disabled?

rhystmills and others added 3 commits September 5, 2023 11:43
BREAKING: Always include categories argument, even if none are
provided
Co-authored-by: Jonathan Herbert <jonathan.herbert@guardian.co.uk>
Co-authored-by: Samantha Gottlieb <samantha.gottlieb@guardian.co.uk>
…t of categories

Co-authored-by: Jonathan Herbert <jonathan.herbert@guardian.co.uk>
Co-authored-by: Samantha Gottlieb <samantha.gottlieb@guardian.co.uk>
src/ts/createTyperighterPlugin.ts Outdated Show resolved Hide resolved
src/ts/services/MatcherService.ts Outdated Show resolved Hide resolved
rhystmills and others added 3 commits September 8, 2023 16:40
Co-authored-by: Jonathon Herbert <jonathon.herbert@guardian.co.uk>
Co-authored-by: Jonathon Herbert <jonathon.herbert@guardian.co.uk>
@rhystmills rhystmills merged commit b87b1f9 into main Sep 10, 2023
3 checks passed
@github-actions
Copy link

🎉 This PR is included in version 7.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants