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

@coveops/case-context-trigger

v1.0.0

Published

The CaseContextTrigger component renders **ONLY** if a Trigger Rule has been added into the corresponding query pipeline. The Trigger Rule must be an ``Execute`` Rule that will call the following JavaScript Function:

Downloads

14

Readme

CaseContextTrigger

The CaseContextTrigger component renders ONLY if a Trigger Rule has been added into the corresponding query pipeline. The Trigger Rule must be an Execute Rule that will call the following JavaScript Function:

CaseContextTrigger(notification_msg, case_number, case_subject)

image

Note: This Trigger Rule should ALWAYS be associated to a condition related to the current Context and you also do not want to see that notification if the query is not empty.

This component will allow you to execute CaseContextTrigger JavasScript Function from a Trigger Rule in your pipeline. When the Trigger Rule is being executed, depending on its current mode (Large or Small), this component renders a Banner (Large mode) or a Badge (Small mode) based on the infos passed to the JavaScript Function in order to notify the user that current query is using a certain context.

When caseNumber and/or caseSubject options are undefined, parameters case_number and case_subject that are passed to the CaseContextTrigger Function will be considered as Key value of the current Context Object which mean the Subject that will be displayed in the Banner will be the result of Context[case_subject].

| CaseContextTrigger (Large Mode) | | ---------------------------------------------------------------------- | | image |

| CaseContextTrigger (Small Mode) | | ---------------------------------------------------------------------- | | image |

Getting Started

  1. Install the component into your project.
npm i @coveops/case-context-trigger
  1. Use the Component or extend it

Typescript:

import { CaseContextTrigger, ICaseContextTriggerOptions } from '@coveops/case-context-trigger';

Javascript

const CaseContextTrigger = require('@coveops/case-context-trigger').CaseContextTrigger;
  1. You can also expose the component alongside other components being built in your project.
export * from '@coveops/case-context-trigger'
  1. Include the component in your template as follows:

Add the following markup to your template:

<div class="CoveoCaseContextTrigger"></div>

Options

The following options can be configured:

| Option | Required | Type | Default | Notes | | ----------------------- | -------- | ---------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------- | | notificationMsg | No | localized string | CaseContextTrigger_NotificationMsg | Specifies the notification message of the Case Context Banner. | | enableNotificationMsg | No | boolean | true | Specifies whether to display the notification message in the Case Context Banner when large mode is activated. | | caseNumber | No | string | | Specifies the case Number that will be displayed in the Case Context Banner. | | caseSubject | No | string | | Specifies the case Subject / title that will be displayed in the Case Context Banner. | | enableResponsiveMode | No | boolean | true | Specifies whether to enable responsive mode for CaseContextTrigger |

Extending

Extending the component can be done as follows:

import { CaseContextTrigger, ICaseContextTriggerOptions } from "@coveops/case-context-trigger";

export interface IExtendedCaseContextTriggerOptions extends ICaseContextTriggerOptions {}

export class ExtendedCaseContextTrigger extends CaseContextTrigger {}

Contribute

  1. Clone the project
  2. Copy .env.dist to .env and update the COVEO_ORG_ID and COVEO_TOKEN fields in the .env file to use your Coveo credentials and SERVER_PORT to configure the port of the sandbox - it will use 8080 by default.
  3. Build the code base: npm run build
  4. Serve the sandbox for live development npm run serve