Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
mns-core-ui-header
Advanced tools
A NodeJS NPM module that contains the client code for the global header including level 1-3 navigation and enables sharing of common assets in this module between code bases. These code bases are currently:
A NodeJS NPM module that contains the client code for the global header including level 1-3 navigation and enables sharing of common assets in this module between code bases. These code bases are currently:
This is a temporary step to extract original FEAR header code in to a self contained reusable module. Also to migrate from deprecated fear-core-ui to mns-core-ui. This module also has no dependency on a javascript framework.
UPDATE: The module no longer has dependency on fear-core-ui as a result of https://github.com/DigitalInnovation/mns-core-ui-header/pull/92.
For more info:
Install the module in your application npm install mns-core-ui-header --save
The following steps would usually be performed as part of a build process:
src/mns-core-ui-header/templates/header/assets
to desired location in your application.@import 'templates/header/bundle';
import Header from 'mns-core-ui-header/dist/templates/header/bundle';
define([
'mns-core-ui-header'
], function (Header) {});
new Header.Top();
new Header.Navigation();
globalHeader.topNavLevel3
(A subsequent client side call is made in addition to this so that any recent content changes appear in the page navigation)The src folder contains the partials needed for the header and these partials have a .hbs
(handlebars) extension for consumption in newer M&S codebases (e.g FESK projects).
The partials are made available also in the dist folder with a .html
extension for consumption in legacy codebases (e.g FEAR) that require templates to have this extension.
It is important to note is that currently the partials only use mustache syntax (i.e the engine used in FEAR) and hence are compatible with handlebars template engines as handlebars is a superset of mustache. Care should be taken if introducing handlebars functionality to the templates whilst they are being consumed by a FEAR page for this reason.
mns-core-ui-header/src/mns-core-ui-header/templates/header/partials
needs to be added to your handlebars partialsDir config property (see docs path)const headerService = require('mns-fe-unicorn-platform/lib/services/getHeaderContent.js');
import configuration from 'path/to/fesk-configuration';
res.render('yourPage', {
header: headerService.getConfig(header.config, configuration)
});
{{> templates/header/partials/default/header header }}
$mns-core-ui-header-images-dir
variable that contains path to where assets have been copied to in above steps@import 'mns-core-ui-header/templates/header/sass/module_images';
$mns-london-font-path
variable with path to font asset location e.g mns-core-ui/dist/fonts/mns-london
$mns-london-font-name
e.g mns-london
@import 'mns-core-ui/globals/typography/fonts/mns-london/module_mns-london';
$mns-core-ui-header-icon-font-family
variable e.g mns-icons
$mns-core-ui-header-fonts-dir
e.g ~mns-core-ui/dist/fonts/
@import 'mns-core-ui-header/templates/header/sass/module_font-icons';
The module exposes a config object:
require('mns-core-ui-header).config
There is core configuration of the header (data) and the associated key (key). This is data that is deemed to not need business control.
* core configuration require('mns-core-ui-header).config.data
- contains link data for flags and dropdowns.
A decorators object is also exposed, so this data can be optionally added the full config object. This is data that does/could need business control and could be replaced by an API when thats implemented. Current decorators are:
* labels - labels for dropdown menu items.
For detail on above see /index.js
There are some events that can/should be fired from a client page/application that the header listens to.
updateItemCount
passing an integer of new page count in variable myBagCount
i.e event.myBagCount
The development environment is based on mns-fe-starter-kit and documentation for how that works can be found here
Mocked endpoints can be added to your express app by using the ExposeRoutes functionality. Add the following lines to your server.js file. Note that the "ExposeRoutes" line must be added above the current routes that your app defines.
const indexFile = require('../../index');
const ExposeRoutes = indexFile.ExposeRoutes;
server = new ExposeRoutes(server).attachToServer();
You must also make sure that your config file containing the api endpoints is setup with the following:
"loyaltyService": "http://127.0.0.1:3002/loyalty-service/"
"loyaltyServiceStub": "http://127.0.0.1:3002/loyalty-service/"
To run the UI tests locally:
npm start
npm run test:ui
This will test against localhostTo run the UI tests in the cloud against a range of browsers and connect to your localhost:
npm start
npm run test:ui:sauce
Visual Tests Admin Panel
To run the Visual tests locally:
npm start
To run the Visual tests against sauce labs:
npm start
npm run test:visual:sauce
To run the Visual tests against another id:
npm start
This will pull the baseline from another id and push the results to your id
Shrinkwrap the module
Publish the module to NPM
(https://confluence.platform.mnscorp.net/display/FF/publishing+npm+modules)
FAQs
A NodeJS NPM module that contains the client code for the global header including level 1-3 navigation and enables sharing of common assets in this module between code bases. These code bases are currently:
The npm package mns-core-ui-header receives a total of 24 weekly downloads. As such, mns-core-ui-header popularity was classified as not popular.
We found that mns-core-ui-header demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.