New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@coveops/case-context-trigger

Package Overview
Dependencies
Maintainers
12
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coveops/case-context-trigger

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:

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-77.78%
Maintainers
12
Weekly downloads
 
Created
Source

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].

  • See Trigger - Query Pipeline Feature
  • Refer also to ResponsiveCaseContextTrigger
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:

OptionRequiredTypeDefaultNotes
notificationMsgNolocalized stringCaseContextTrigger_NotificationMsgSpecifies the notification message of the Case Context Banner.
enableNotificationMsgNobooleantrueSpecifies whether to display the notification message in the Case Context Banner when large mode is activated.
caseNumberNostring Specifies the case Number that will be displayed in the Case Context Banner.
caseSubjectNostring Specifies the case Subject / title that will be displayed in the Case Context Banner.
enableResponsiveModeNobooleantrueSpecifies 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

FAQs

Package last updated on 08 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc