canvas-lms/packages/canvas-rce
Jared Amen f8cc3c64ed Add a flag to disable toast notification timeouts
test plan:
  * Go to account settings
  * Enable the flag to disable toast notification timeouts
  * Do something that would force a toast notification to pop up
    (remove a user from/add a user to a course, join a course, etc.)
  * Wait *roughly* seven seconds - the toast notification should not
    disappear. It will take a day for this notification to disappear.
  * Disabling the flag and repeating steps 3 and 4 should result
    in the toast notification disappearing after *roughly* seven
    seconds as expected.

closes LS-1138

flag = none

Change-Id: I2cacf0bf48568c9b5e88743c44bfd1faececfc51
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242612
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2020-07-23 18:24:30 +00:00
..
bin move canvas-rce to canvas-lms/packages/canvas-rce 2018-05-01 13:46:18 +00:00
demo Run prettier on packages/ 2019-10-11 19:29:16 +00:00
github-pages Give RCEWrapper onFocus/onBlur handlers 2019-07-05 21:22:37 +00:00
jest Add video options tray to the rce 2019-10-30 13:14:42 +00:00
locales Use new translation package for packages 2020-01-03 20:34:46 +00:00
scripts update build to load es modules from subpackages 2020-06-03 13:41:38 +00:00
src Add a flag to disable toast notification timeouts 2020-07-23 18:24:30 +00:00
test Update RCE autosave when editing in html view 2020-07-22 19:47:09 +00:00
testcafe Run prettier on packages/ 2019-10-11 19:29:16 +00:00
.dockerignore move canvas-rce to canvas-lms/packages/canvas-rce 2018-05-01 13:46:18 +00:00
.eslintrc upgrade eslint & don’t use unique one in canvas-rce 2019-08-15 17:17:30 +00:00
.gitignore rce: add testcafe 2019-05-07 19:38:27 +00:00
.npmignore move canvas-rce to canvas-lms/packages/canvas-rce 2018-05-01 13:46:18 +00:00
.prettierignore move canvas-rce to canvas-lms/packages/canvas-rce 2018-05-01 13:46:18 +00:00
DEVELOPMENT.md Revert "Add new font to RCE" 2020-05-02 00:19:16 +00:00
Dockerfile fix canvas-rce translations build 2019-04-02 14:23:49 +00:00
LICENSE move canvas-rce to canvas-lms/packages/canvas-rce 2018-05-01 13:46:18 +00:00
README.md Minor readme change 2020-07-16 19:05:51 +00:00
babel.config.js update build to load es modules from subpackages 2020-06-03 13:41:38 +00:00
build.sh move canvas-rce to canvas-lms/packages/canvas-rce 2018-05-01 13:46:18 +00:00
docker-compose.yml move canvas-rce to canvas-lms/packages/canvas-rce 2018-05-01 13:46:18 +00:00
jest.config.js Run prettier on packages/ 2019-10-11 19:29:16 +00:00
mocha-reporter-config.json Add junit reporting for canvas-rce 2018-11-19 21:51:04 +00:00
package.json Fix RCE status bar button focus issues 2020-07-15 15:57:14 +00:00
webpack.config.js rce: add testcafe 2019-05-07 19:38:27 +00:00
webpack.shared.config.js rce: add testcafe 2019-05-07 19:38:27 +00:00
webpack.testcafe.config.js rce: add testcafe 2019-05-07 19:38:27 +00:00

README.md

Canvas Rich Content Editor

WARNING: While our intent is to make the RCE avaiable outside of canvas-lms, it currently has dependencies on canvas that make that impossible. Please be patient.


The Canvas LMS Rich Content Editor extracted in it's own npm package for use across multiple services. This npm module is used in pair with a running canvas-rce-api microservice.

You need a running instance of the canvas-rce-api in order to utilize the canvas-rce npm module, but you do not need that instance in order to do development on canvas-rce. (see docs/development.md)

The first customer of the canvas-rce was the canvas-lms LMS so documentation and references throughout documentation might reflect and assume the use of canvas-lms.

Install and setup

As a published npm module, you can add canvas-rce to your node project by doing the following:

npm install canvas-rce --save

Please reference the canvas-lms use of canvas-rce to get an idea on how to incorporate it into your project. Pay special attention to the RichContentEditor.js and serviceRCELoader.js.

Tests

Jest tests are run against the .cjs version of the source, so make sure you've built the .cjs assets before running tests:

npm run build:canvas
npm run test:jest

Polyfills

This project makes use of modern JavaScript APIs like Promise, Object.assign, Array.prototype.includes, etc. which are present in modern browsers but may not be present in old browsers like IE 11. In order to not send unnecessarily large and duplicated code bundles to the browser, consumers are expected to have already globally polyfilled those APIs. Canvas already does this but if you need suggestions for how to this in your own app, you can just put this in your html above the script that includes canvas-rce:

<script src="https://cdn.polyfill.io/v2/polyfill.min.js?rum=0"></script>

(See: https://polyfill.io/v2/docs/ for more info)

Development

See DEVELOPMENT.md