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

@orbis-cascade/primo-explore-custom-actions

v3.2.0

Published

adds custom actions to primo-explore's actions menu.

Downloads

8

Readme

primo-explore-custom-actions

npm version

Features

Custom links can be added to the actions menu visible on Primo brief results and full display. Links can extract properties of the item's PNX record and apply them to the link URL.

Screenshot

screenshot

Install

  1. Make sure you've installed and configured primo-explore-devenv.
  2. Navigate to your template/central package root directory. For example:
    cd primo-explore/custom/MY_VIEW_ID
  3. If you do not already have a package.json file in this directory, create one:
    npm init -y
  4. Install this package:
    npm install primo-explore-custom-actions --save

Alternatively, just copy the contents of dist/module.js into your custom.js file.

Usage

Once this package is installed, add customActions as a dependency for your custom module definition.

var app = angular.module('viewCustom', ['customActions'])

Note: If you're using the --browserify build option, you will need to first import the module with:

import 'primo-explore-custom-actions';

You can add new actions by adding <custom-action> elements to the template of prmActionListAfter. Each element needs the properties below:

| name | type | usage | |---|---|---| | name | string | a short, unique name for the action. don't include whitespace characters. | | label | string | the name that will display on the action button. whitespace ok. | | index | integer | where to insert the action. 0 would be "first", 1 would be "second", etc.| | icon | string | the icon on the button. must be chosen from https://material.io/icons/. should be in the form "ic_icon_name_with_underscores_24px". some icons may not display. | | icon-set | string | the set of icons from which the above icon is drawn.| | link | string | URL to open when the action is clicked. supports templating (see below). |

Templating

You can create interpolation expressions using { } in the link text and they will be replaced with corresponding values taken from the item - for example, {pnx.search.recordid[0]} would become the recordID of the item, taken from the pnx.

Example

The example below will generate a configuration similar to that visible in the screenshot above. It adds a "report problem" link that will navigate to the institution's "report problem" form and append the record ID as a GET parameter, and a link that will open the given record's PNX for viewing.

var app = angular.module('viewCustom', ['customActions'])

app.component('prmActionListAfter', {
  template: `<custom-action name="open_pnx"
                            label="Open PNX"
                            index=8
                            icon="ic_find_in_page_24px"
                            icon-set="action"
                            link="/primo_library/libweb/jqp/record/{pnx.search.recordid[0]}.pnx" />
            <custom-action  name="report_bug"
                            label="Report Bug"
                            index=7
                            icon="ic_bug_report_24px"
                            icon-set="action"
                            link="http://my.institution.edu/report_problem?record_id={pnx.search.recordid[0]}" />`
})