@visual-framework/embl-notifications

1.2.2 • Public • Published

EMBL Notifications component

npm version

Fetches notifications from the EMBL contentHub URL of https://www.embl.org/api/v1/notifications?_format=json&source=contenthub and will display them, if a matching URL is found.

Usage

This will also check a backup URL for cases of major outages.

Possible features not currently planned:

  • Only show if a wrapping element has data-vf-js-embl-notifications
  • Also load messages from EBI's existing announcement JS at https://ebi.emblstatic.net/announcements.js
  • Use the vf-banner precompiled njk template to render output
  • Test for better support on non-VF 2.0 sites

Install

This repository is distributed with npm. After installing npm, you can install embl-notifications with this command.

$ yarn add --dev @visual-framework/embl-notifications

Sass/CSS

Add this to your ./components/vf-component-rollup/scripts.js:

import { emblNotifications } from 'embl-notifications/embl-notifications';
// if you use embl-content-hub-loader, it will automatically invoke emblNotifications
// emblNotifications(); // invoke embl notifications

You can masquerade as another page or URL for adhoc use cases or testing:

// emblNotifications(currentHost = 'www.embl.org', currentPath = 'my/test/path`);
emblNotifications('www.embl.org','/')

Help

Readme

Keywords

Package Sidebar

Install

npm i @visual-framework/embl-notifications

Weekly Downloads

394

Version

1.2.2

License

Apache 2.0

Unpacked Size

41.6 kB

Total Files

15

Last publish

Collaborators

  • bhushan-ebi
  • pacope92
  • ebiwebdev
  • sandykadam
  • khawkins98