Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

solution-center-navigation

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solution-center-navigation

Reusable navigation header for software connecting to the Zalando Solution Center

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

Solution Center Navigation

Reusable navigation header for software connecting to the Zalando Solution Center

Build Status

Demo

Changelog

Dependencies

  • angular
  • angular-cookies
  • dress-code
  • ngstorage
  • solution-center-communicator
  • solution-center-login

Installation

Install via npm or yarn

npm install solution-center-navigation 

OR

yarn add solution-center-navigation

Usage

  1. Load the script in your <head>, with dependencies:

    <script src="../node_modules/angular/angular.js"></script>
    <script src="../node_modules/angular-cookies/angular-cookies.js"></script>
    <script src="../node_modules/solution-center-communicator/dist/solutioncenter.communicator.min.js"></script>
    <script src="../node_modules/solution-center-login/dist/solutioncenter.login.min.js"></script>
    <script src="../node_modules/solution-center-navigation/dist/solutioncenter.navigation.js"></script>
    
  2. Include the solution-center-navigation module as a dependency in your app.

  3. Insert the component at the top of your application:

    <sc-navigation
        application-id="applicationId"
        product-id="productId"
        user="user"
        products="products"
        business-partners="businessPartners"”
     />
    </sc-navigation>
    

Parameters

The following two parameters are strictly required for the navigation in order to know the current navigation context and work as expected:

  • application-id: A string representing the id of the current application displayed.

    application-id = "APPLICATION"
    
  • product-id: A string representing the id of the current product the displayed application belongs to.

    product-id = "PRODUCT"
    

However, some more optional parameters are allowed:

  • business-partner-id: A string representing the id of the current business partner in case the current applications needs to set it programmatically

    business-partner-id = "BP"
    
  • on-business-partner-change: A callback function to be called every time the current business partner changes in order to notify the client application so it can adapt to the new context

    on-business-partner-change = "$ctrl.callbackMethod(businessPartner)"
    
  • hide-business-partner: A boolean to be used to hide the business partner and its selection menu on the navigation in case the client application does not work on the context of business partners at some stage

    hide-business-partner = "true"
    

Last, there is a set of three optional parameters, helpful for development purposes of client applications so they can override the values returned by the backend endpoints usually called by the Solution Center Navigation and skip those calls.

Only if ALL of them are set and the library determines that the current environment is LOCAL or INTEGRATION (see Solution Center documentation in case of doubt about the environments), the library uses the content of the parameters to mock its normal behaviour and skips the call to the predefined backend endpoints.

  • user: A user object which controls the display of the user name with submenu allowing access to the user account pages. Additionally it's used for determining which business partners it has access to.

    {
      "id": "1111",
      "email": "chuck@norris",
      "firstName": "Chuck",
      "lastName": "Norris"
    }
    
  • products: An array of objects which holds information about all the products and applications accessible by the user within the Solution Center.

    [{
      "id": "prodId",
      "name": "PRODUCT",
      "applications": [
        {
          "id": "appId",
          "name": "APPLICATION",
          "product_id": "prodId",
          "business_partner_roles": ["ROLE_1", "ROLE_2"],
          "url": "https://www.myurl.com" 
        }
      ]
    }]
    
  • business-partners: An array of business partners objects which contains a list of all the business partners the user can access in the current application.

    [{
      "id": "businessPartnerId",
      "name": "BP",
      "roles": [
        {
         "name": "ROLE_1"
       }
      ]
    }]
    

Style

The Solution Center Navigation is intended to be used with the dress code style. That package is included as a dependency.

Demo

See the demo folder. To run the demo locally, follow the Develop instructions below.

Develop

Clone the repository, then run:

npm install

OR

yarn

License

MIT

Changelog

You can check the new changes implemented in every version in the changelog

FAQs

Package last updated on 20 Jun 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc