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

model display hint, centralise special format definitions #491

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

Conversation

dblatcher
Copy link
Contributor

What does this change?

  • Adds the "displayHint" property to the Stub model so that it can be posted to the backend when creating new stubs for articles with special formats - see https://github.com/guardian/workflow/pull/1130 for the backend & DB changes to support the new property.
  • Creates a ts type SpecialArticleFormat and a central list of the current formats available. Uses this list to create a collection of helpers to replace the code that was using hard coded values for the names or values of the formats - this should allow us to more easily add new formats in future

How to test

DisplayHint property

special format list

  • Run this branch locally
  • comment out on of the formats in public/lib/model/special-formats.ts, or set its behindFeatureSwitch property
  • the format should be removed from the UI everywhere the formats appear (eg "create new" drop down, stub form) but the others should work as before
  • add a new item to the list (an include its value in the SpecialFormatContentType type ), reload the page
  • your new format should appear in the UI alongside the real once

How can we measure success?

Have we considered potential risks?

Images

Accessibility

@dblatcher dblatcher requested a review from a team as a code owner January 22, 2025 14:23
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.

1 participant