5.13.3 • Published 3 years ago

@mentor-medier/alert-bar-block v5.13.3

Weekly downloads
178
License
CC-BY-NC-ND-4.0
Repository
github
Last release
3 years ago

@wpmedia/alert-bar-block

This is the alert bar block that feeds from the alert-bar-content-source-block. It will refresh every 30 seconds by default, but the content source will return cached results every two minutes. This is to not overwhelm the content API with simultaneous refreshes for any less intervals.

Acceptance Criteria

  • Add AC relevant to the block

Props

PropRequiredTypeDescription
required propyes
optional propno
contentConfig examplePlease specify which content sources are compatible

ANS Schema

This block consumes data returned from the alert-bar-content-source-block content source. The following is an example of that response.

{ _id: 'VTKOTRJXEVATHG7MELTPZ2RIBU',
   type: 'collection',
   version: '0.7.0',
   canonical_website: 'the-sun',
   content_elements:
    [ { _id: '55FCWHR6SRCQ3OIJJKWPWUGTBM',
        type: 'story',
        version: '0.10.4',
        canonical_url:
         '/news/2020/01/30/august-may-feel-like-washingtons-hottest-month-but-its-not/',
        headlines: [Object],
        subheadlines: [Object],
        description: [Object],
        language: '',
        label: [Object],
        taxonomy: [Object],
        promo_items: [Object],
        distributor: [Object],
        canonical_website: 'the-sun',
        display_date: '2020-01-30T14:47:46.926Z',
        credits: [Object],
        subtype: 'right-rail-template',
        websites: [Object],
        publish_date: '2020-02-21T16:23:46.063Z' } ],
   content_aliases: [ 'alert-bar' ],
   owner: { id: 'corecomponents' },
   revision: { branch: 'default', published: true },
   last_updated_date: '1970-01-01T00:00:00.000Z',
   created_date: '1970-01-01T00:00:00.000Z',
   website: 'the-sun' 
}

ANS fields

  • content_elements[0] only uses first content element. used to check whether to render headline
  • content_elements[0].websites[arcSite] Uses website_url
  • content_elements[0].headlines.basic
{
  content_elements: [
    {
      websites: {
        "the post": "http://washpost.com/huge-story"
      },
      headlines: {
        "basic": "Man Bites dog"
      }
    },
    ...
  ]
}

Internationalization fields

  • Add all internationalization fields used in the block

Events

Blocks can emit events. The following is a list of events that are emitted by this block.

Event NameDescription
eventNameDescribe the event

Event Listening

Include block specific instructions for event listening.

OR

This block does not emit any events.

Additional Considerations

Optional

5.13.2

3 years ago

5.13.3

3 years ago

5.11.3

3 years ago

5.11.2

3 years ago

5.10.4

3 years ago

5.10.2

3 years ago

5.10.0

3 years ago

5.9.15

3 years ago