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

diu-angular-header

v0.0.401

Published

This Angular Library is to house the Header Components for applications managed by the Digital Intelligence Unit.

Downloads

21

Readme

DiuAngularHeader

This Angular Library is to house the Header Components for applications managed by the Digital Intelligence Unit.

Components

Header Bar (lib-diu-angular-header)

Example use:

<lib-diu-angular-header [strAppName]="appName" [strHome]="home" [alerts]="myAlerts" [messages]="myMessages" [tasks]="myTasks" [token]="tokenDecoded" (endSession)="logout($event) (changeSidebar)="toggleSidebar($event)"></lib-diu-angular-header>

Includes:

Logout Button

Outputs a boolean when the Logout button is selected. The event name is endSession and can be handled by calling the component like so:

(endSession)="logout($event)"

Where logout is a function that will end the User's current session and return them to the Login page.

Display Account

Default displays "Guest". Shows Display name of logged in user when a JWT is passed in as Input like so:

[token]="tokenDecoded"

Where tokenDecoded is a JWt that has been decoded using a library such as angular2-jwt:

import { JwtHelper } from "angular2-jwt";
...
const token = this.store.selectSnapshot(AuthState.getToken);
const jwtHelper = new JwtHelper();
this.tokenDecoded = jwtHelper.decodeToken(token);

Display Messages

Shows the top ten messages passed through as an array using the following input:

[messages]="myMessages"

Where myMessages is an array of Notifications which has the following structure:

export interface Notifications {
  _id: string;
  username?: string;
  teamcode?: string;
  method: string;
  type: string;
  sentdate: Date;
  acknowledgeddate?: Date;
  sender: string;
  header: string;
  message: string;
  link?: string;
  importance: string;
  archive: boolean;
}

Display Tasks

Shows the top ten tasks passed through as an array using the following input:

[tasks]="myTasks"

Where myTasks is an array of Tasks which has the following structure:

export interface Tasks {
  _id: string;
  username?: string;
  teamcode?: string;
  iscompleted: boolean;
  completedby?: string;
  enddate?: Date;
  sentdate: Date;
  acknowledgeddate?: Date;
  sender: string;
  header: string;
  message: string;
  link?: string;
  importance: string;
  archive: boolean;
  invite?: string;
  app_id?: string;
}

Display Alerts

Shows the top ten active alerts passed through as an array using the following input:

[alerts]="myAlerts"

Where myAlerts is an array of SystemAlerts which has the following structure:

export interface SystemAlerts {
  _id: string;
  name: string;
  message: string;
  startdate: Date;
  enddate: Date;
  status: string;
  icon: string;
  author?: string;
  archive: boolean;
}

Application Name

Shows the name of the application, passed through as a string called strAppName

Home Link

Provides a link to the main page of the application, passed through as a string called strHome. This page should reference a url where you wish the user to navigate to if they click the Application name.

Toggle Sidebar

Outputs a boolean when the toggle sidebar button selected. The event name is changeSidebar and can be handled by calling the component like so:

(changeSidebar)="toggleSidebar($event)"

Where toggleSidebar is a function that will minimize or expand the Side Menu.