RingCentral integration widgets aim to provide reusable UI components to allow developers to integrate RingCentral unified communication service into third party processes or tools more easily.
This project is built based on RingCentral Integration Common Library and React. The basic idea is to connect modules in RingCentral Integration Common Library with React components to provide ready to use UI widgets.
A development server is delivered with source so that developers can use it to get familiar with the project or do further development. To get development server running:
Clone the repo:
$ git clone https://github.com/ringcentral/ringcentral-js-widgets.git
$ cd ringcentral-js-widgets
Install dependent libraries:
$ yarn install
Create a file named api-config.js
in following format in folder dev-server
to specify app related info
export default {
appKey: ${app key},
appSecret: ${app secret},
server: ${server url},
};
Run following command to start development server
$ yarn dev-server
The development server is listening on port 8191
by default.
Open up your browser and access http://localhost:8191 to see how it works.
Note that the development server is using OAuth for authorization process.
Please make sure the app you specified in configuration above is setup with Redirect Uri http://localhost:8191/redirect.html
.
Create .env
file in ./test/
folder, with the following content:
appKey=your-appKey
appSecret=your-appSecret
server=sever-url
username=your-phone-number
extension=your-extension
password=your-password
receiver=testing-phone-number-to-receive-sms-fax-etc
Run:
$ yarn test
If you want to run it in watch mode:
$ brew install watchman
$ yarn test:watch
Whenever there is major change to the design, you might need to update test/state.json
and test/storage.json
.
Launch the dev-server and visit the app in chrome browser. In console:
Run JSON.stringify(phone.store.getState(), null, 2)
to generate content for test/state.json
.
Run JSON.stringify(localStorage, null, 2)
to generate content for test/storage.json
WebRTC code is excluded from test coverage report. Because we are unable to run WebRTC in node.js.
We might need to do some mocking to cover this part in the future.