🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@mentor-medier/alert-bar-block

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mentor-medier/alert-bar-block

Fusion News Theme alert bar block

latest
stable
Source
npmnpm
Version
5.13.3
Version published
Maintainers
1
Created
Source

@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

FAQs

Package last updated on 05 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts