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

@uportal/notification-icon

v1.0.4

Published

[![NPM Version](https://img.shields.io/npm/v/@uportal/notification-icon.svg)](https://www.npmjs.com/package/@uportal/notification-icon) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.webjars.npm/uportal__notification-icon/badge.svg

Downloads

14

Readme

Notification Icon

NPM Version Maven Central Build Status

Development

# clone the repository if you haven't already
git clone https://github.com/uPortal-contrib/notification-web-components

# navigate to the notification-icon folder
cd uPortal-web-components/@uportal/notification-icon

# install the goods
npm install

# start the app
npm start

Build

Pretty simple:

npm run build

This will compile your JavaScript in to build/static/js/main.{buildnumbers}.js

Usage

After building, grab the compiled javascript files and place it on your page. You can now place <notification-icon> anywhere on your page.

Here's the guts of that html file:

<notification-icon> </notification-icon>
  • Note: The component includes bootstrap, so that you can use bootstrap's styles in your content slots. However, font-awesome has issues crossing the shadow-dom boundry, so that if you include an icon in the content slot, you also need to include a <link> to the font-awesome stylesheet from uPortal (or elsewhere if you wish).
Notice

We have a /proxy/ leading the oidc-url attribute. This is a developer convenience to be able to query against your local running instance of uPortal. The proxy is configured in package.json:

  "proxy": {
    "/proxy": {
      "target": "http://localhost:8080",
      "changeOrigin": true,
      "pathRewrite": {
        "^/proxy": "/"
      }
    }
  },

Attributes

<notification-icon> takes the following attributes:

notification-api-url

Url to connect notification-endpoint. Defaults to /NotificationPortlet/api/v2/notifications.

<notification-icon
    notification-api-url="/NotificationPortlet/api/v2/notifications"
></notification-icon>

user-info-api-url

Url to connect to oidc. The default for this value is /uPortal/api/v5-1/userinfo.

<notification-icon user-info-api-url="/uPortal/api/v5-1/userinfo"></notification-icon>

see-all-notifications-url

Path to a page in uportal to navigate to for "see all notifications" link.

<notification-icon see-all-notifications-url="/uPortal/p/notification"></notification-icon>

count-all-notifications

Flag to tell component to count all notifications vs unread notifications in alert icon.

<notification-icon count-all-notifications="true"></notification-icon>

navigation-strategy

A flag to tell the component to navigate to an external link from data or a provided uPortal page (likely the notification-list).

Options: list, link

<notification-icon navigation-strategy="list"></notification-icon>

debug

Skips oidc call for api token.

<notification-icon debug></notification-icon>

Project setup

npm install

Compiles and hot-reloads for development

npm run start

Compiles and minifies for production

npm run build

Run your tests

npm run test

Lints and fixes files

npm run lint

Options

  • count-all-notifications (optional, boolean): by default the notifications icon will display a count of unread items, true will display a count of all (read and unread) items for the user.

Customize configuration

See Configuration Reference.