twilio-professional-services / plugin-team-view-filters

Flex Team View sample custom filters
4 stars 7 forks source link

Custom Twilio Flex Team View Filters

Notice

This plugin is no longer maintained as of October 17th, 2022. Work to maintain this feature in Flex V2 has been moved over to the Twilio Professional Services Flex Project Template where it is an optional feature

Flex Plugins

Twilio Flex Plugins allow you to customize the appearance and behavior of Twilio Flex. If you want to learn more about the capabilities and how to use the API, check out our Flex documentation.

Overview

The Twilio Flex Team View allows for real-time monitoring of Flex agents and supports filtering those agents based on Twilio TaskRouter worker attributes. This plugin provides samples for creating three types of Team View filters:

Multi-Option Checkbox Filter

Multi-Option Checkbox Filter

Free Text Filter

Free Text Filter

Autocomplete Multi-Select Filter

Autocomplete Multi-Select Filter

Requirements

Team View Filters

To use this plugin, you should enable the Team View Filters feature on your Flex instance, and you can do that on the pre-release features page. On the Feature Settings page, go to the Pilot tab, and enable the Advanced Teams Views Filters.

Enable Advanced Teams Views Filters

Setup

Make sure you have Node.js as well as npm installed.

Afterwards, install the dependencies by running npm install:

cd 

# If you use npm
npm install

Development

In order to develop locally, you can use the Webpack Dev Server by running:

npm start

This will automatically start up the Webpack Dev Server and open the browser for you. Your app will run on http://localhost:3000. If you want to change that you can do this by setting the PORT environment variable:

PORT=3001 npm start

When you make changes to your code, the browser window will be automatically refreshed.

Deploy

When you are ready to deploy your plugin, in your terminal run:

twilio flex:plugins:deploy --major --changelog "Notes for this version"

If the deployment succeeds, you will get a success message like the example below. Make sure to run the "Next Steps" section to enable the newly published version of your plugin:

Using profile acme-inc (ACXXXXXXXXXXXXXXXXXXXXXXXXXXXX)

✔ Validating deployment of plugin plugin-team-view-filters
✔ Compiling a production build of plugin-team-view-filters
   ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
   │                                                                                                                                   │
   │   ⚠ Plugins API is currently offered as a Pilot; it is very likely to change before the product reaches general availability. ⚠   │
   │                                                                                                                                   │
   └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

✔ Uploading plugin-team-view-filters
✔ Registering plugin plugin-team-view-filters with Plugins API
✔ Registering version v1.0.0 with Plugins API

🚀 Plugin (private) plugin-team-view-filters@1.0.0 was successfully deployed using Plugins API

Next Steps:
Run $ twilio flex:plugins:release --plugin plugin-team-view-filters@1.0.0 --name "Autogenerated Release 1627069953647" --description "The description of this Flex Plugin Configuration." to enable this plugin on your Flex application

For more details on deploying your plugin, refer to the deploying your plugin guide.

Note: Common packages like React, ReactDOM, Redux and ReactRedux are not bundled with the build because they are treated as external dependencies so the plugin will depend on Flex to provide them globally.

Disclaimer

This software is to be considered "sample code", a Type B Deliverable, and is delivered "as-is" to the user. Twilio bears no responsibility to support the use or implementation of this software.