npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

solution-center-navigation

v1.3.1

Published

Reusable navigation header for software connecting to the Zalando Solution Center

Downloads

28

Readme

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