Giter Club home page Giter Club logo

flex-ui-sample's Introduction

Twilio Flex UI Sample

This project was bootstrapped with Create React App.

NOTE This branch of Flex UI sample app is compatible with Flex UI version 2.0.0 and newer. For sample app compatible with Flex UI 1.x.x versions, use -v1 branch.

You can find the most recent version of the guide on how to perform common tasks here.

This package can only be consumed together with Twilio Flex. Visit http://twilio.com/flex to find out more.

Instructions

  1. Install all dependencies by running:
npm install
  1. Copy appConfig.sample.js in public/assets folder and configure accordingly to use your Twilio account
cp public/assets/appConfig.sample.js public/assets/appConfig.js
  1. Start Flex UI by running:
npm start

flex-ui-sample's People

Contributors

amolokov avatar andreasonny83 avatar george-cz avatar ktalebian avatar kureev avatar raffaele-abramini avatar theryankennedy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flex-ui-sample's Issues

react-router-redux is deprecated

as mentioned in the react-router-redux repo:

This project is no longer maintained. For your Redux <-> Router syncing needs with React Router 4+, please see one of these libraries instead:

- connected-react-router: https://github.com/supasate/connected-react-router

Not able to add custom redux store

I'm trying to use twilio flex in my application, but every time i tries to logout and login to my application whole redux store crashes with error:
TypeError: Cannot read property 'getState' of null

With new release we can add custom store for flex, and since i'm using typescript in my application it is failing with the error:

Type 'Reducer<AppState>' is not assignable to type 'Reducer<AppState, AnyAction>'.
  Types of parameters 'state' and 'state' are incompatible.
    Type 'AppState | undefined' is not assignable to type 'AppState'.
      Type 'undefined' is not assignable to type 'AppState'.ts(2322)
rootReducer.tsx(45, 3): The expected type comes from property 'flex' which is declared here on type 'ReducersMapObject<{ flex: AppState; }, AnyAction>'

Response to preflight request doesn't pass access control check

When running locally the flex ui, there is an error:

Failed to load resource: the server responded with a status of 403 ()
:1 Failed to load https://flex.twilio.com/plugins?roles=agent&serviceBaseUrl=http:%2F%2Flocalhost:8080%2F&version=1.0.1: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
index.js:1452 failed to reach plugin service at https://flex.twilio.com/plugins Error: Network Error
at createError (createError.js:17)
at XMLHttpRequest.handleError (xhr.js:87)

Not Found: @twilio/frame-ui@^0.16.0

I'm asking here because I have no idea where to ask...

I'm working on an "old" projects which was using frame-ui package and I'm getting this error:
npm ERR! 404 Not Found: @twilio/frame-ui@^0.16.0

I think (as far as I know) that I should move to this new package: https://www.npmjs.com/package/@twilio/flex-ui
but it has frame-ui as a dependency as well as @twilio/twilio-flex-insights, which also gives me an error.

What should I use?

Project failed to compile using node v16.13.1 and npm v8.1.2

Expected Behavior

The project is launched after executing the npm start command.

Current Behavior

The projet failed to compile with the error message

./node_modules/value-or-promise/build/module/ValueOrPromise.js 8:7
Module parse failed: Unexpected token (8:7)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| };
| export class ValueOrPromise {
>   state;
|   constructor(executor) {
|     let value;

Steps to Reproduce

  1. Install node v16.13.1 and npm v8.1.2
  2. Clone flex-ui-sample from the main branch.
  3. Runnpm install at the root of the project.
  4. Run npm start at the root of the project.

Context (Environment)

node: v16.13.1

npm: v8.1.2

package.json:

{
  "name": "@twilio/flex-ui-sample",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@twilio/flex-ui": "^2.0.0-beta.1",
    "history": "4.7.2",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "3.2.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

npm install fails on attempt to install @twilio/twilio-flex-insights

twilio/twilio-flex-insights is listed in dependencies for @twilio/flex-ui

however there is no way to install this package, what breaks overall ability to run the sample.

[npm-debug.log](https://github.com/twilio/flex-ui-sample/files/2808532/npm-debug.log)
$ npm install @twilio/twilio-flex-insights
npm ERR! Linux 4.15.0-43-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "@twilio/twilio-flex-insights"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code E404

npm ERR! 404 Not found : @twilio/twilio-flex-insights
npm ERR! 404 
npm ERR! 404  '@twilio/twilio-flex-insights' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/dima/Projects/learn_twilio/npm-debug.log

//edit
in case anyone would encounter this kind of bug, it's due to old npm version.

Where to instantiate a flex plugin in this sample?

Hello,

I've brought in a custom component developed separately into this UI. How do we load it up?

In the plugin source code, it was doing:

import * as FlexPlugin from 'flex-plugin';
import RlPlugin from './RlPlugin';

FlexPlugin.loadPlugin(RlPlugin);

However, when trying to do this inside of the index.js file, if I place it at the top of the code, nothing happens. It's supposed to be modifying the CRM container.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.