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

Amend slices that use labels, so they work with slice machine #10791

Closed
2 tasks done
gestchild opened this issue Apr 11, 2024 · 2 comments
Closed
2 tasks done

Amend slices that use labels, so they work with slice machine #10791

gestchild opened this issue Apr 11, 2024 · 2 comments
Assignees
Labels
epic: slice machine prismic anything to do with our use of Prismic

Comments

@gestchild
Copy link
Contributor

gestchild commented Apr 11, 2024

Relates to #10789

Background

We currently make use of slice labels to allow content editors to label a particular slice. We then use this label to choose how the slice should be displayed. For example, a quote slice can be displayed as a 'pull' quote or a 'review' quote.

Labels are not supported by slice machine (it uses the concept of variations, which will allow the editors to see what each variation looks like when making a choice).

It is likely we will eventually move to using variations (issue to come), but in the interim we need to make things work with the current model.

Task

When we convert our legacy slices to slice machine slices within our custom types all the data should map across (to be verified with our prismic dev environment). However, label data will have nowhere to go.

  • Establish which of our slices currently use labels
  • Create a select field on those slices with the same API id and choices as the current label field
@rcantin-w
Copy link
Contributor

rcantin-w commented Apr 22, 2024

This is where I could find labels, keeping in mind that not selecting any (think it shows as ... on the UI) is also a valid option;

  • Article-body
    • editorialImage: Featured, Supporting, Standalone
    • gifVideo: Supporting
    • iframe: Supporting, Standalone
    • editorialImageGallery: Standalone, Frames
    • quoteV2: Pull, Review (as we know, these two seem to be doing the same thing)
  • Body
    • editorialImage: Supporting, Standalone
    • quote: Pull, Review (same as quoteV2)

Ran a sliceAnalysis to find all of these that are using a label (so not set to undefined or default):

  • editorialImage found 1215 times in 410 articles and pages
  • quote found 102 times in 79 exhibitions, books, pages and event-series
  • quoteV2 found 452 times in 387 articles
  • gifVideo found 5 times in 3 articles
  • iframe 4 times in 3 articles
  • editorialImageGallery 449 times in 449 articles and webcomics

So iframe and gifVideo are probably good ones to test with.
Interesting that the editorialImage in article offered more labels than in the other types, but that's why we're excited about Shared slices!

@rcantin-w
Copy link
Contributor

rcantin-w commented Apr 22, 2024

Looking at the code, I don't think iframe nor gifVideo uses it at all though, if we want to test removing it fully, here's where they are used:

gifVideo

[
  {
    id: 'XzVOJxEAACEAzZ8b',
    type: 'articles',
    format: 'article',
    title: 'When contemporary dance meets dyspraxia',
    label: [ 'supporting' ],
    url: 'http://wellcomecollection.org/articles/XzVOJxEAACEAzZ8b'
  },
  {
    id: 'WilSbykAANoWFUhP',
    type: 'articles',
    format: undefined,
    title: 'Getting sexy with cinnamon',
    label: [ 'supporting' ],
    url: 'http://wellcomecollection.org/articles/WilSbykAANoWFUhP'
  },
  {
    id: 'WmYSMCQAACQAn-Ke',
    type: 'articles',
    format: undefined,
    title: 'Yoga gets physical',
    label: [ 'supporting', 'supporting', 'supporting' ],
    url: 'http://wellcomecollection.org/articles/WmYSMCQAACQAn-Ke'
  }
]

iframe

[
  {
    id: 'WcvPmSsAAG5B5-ox',
    type: 'articles',
    format: undefined,
    title: 'The Key to Memory: Follow your nose',
    label: [ 'standalone', 'standalone' ],
    url: 'http://wellcomecollection.org/articles/WcvPmSsAAG5B5-ox'
  },
  {
    id: 'WcvK4CsAANQR59Up',
    type: 'articles',
    format: undefined,
    title: 'The Key to Memory: Write it down',
    label: [ 'standalone' ],
    url: 'http://wellcomecollection.org/articles/WcvK4CsAANQR59Up'
  },
  {
    id: 'WvQF4SIAAFNX_7Uf',
    type: 'articles',
    format: undefined,
    title: 'The art of scientific glassblowing',
    label: [ 'standalone' ],
    url: 'http://wellcomecollection.org/articles/WvQF4SIAAFNX_7Uf'
  }
]

Otherwise I think this is all about editorialImage, editorialImageGallery as well as quote[V2] , really. @davidpmccormick and I remember conversations we'd've had with @gestchild about editorialImage maybe needing a different tweak though. To quote David's reason, it's:

Because they don’t always work as expected on account of how we limit our image heights based on vh

@davidpmccormick davidpmccormick self-assigned this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic: slice machine prismic anything to do with our use of Prismic
Projects
Status: Archive
Development

No branches or pull requests

5 participants