Commit Graph

587 Commits

Author SHA1 Message Date
Jeffrey Johnson 408999d667 Introduce Storybook to Canvas + i18N Canvas Inbox fixes VICE-947
This story contains work to move Canvas Inbox and Storybook to `app/jsx` inside our Monolith. Storybook should now be enabled for all of `app/jsx` and works with our existing I18n code after updating webpack to load translations correctly.

Test Plan
1. Install node modules with `yarn`
2. At Canvas-LMS root, run `yarn storybook`
3. Storybook should open, test that Canvas Inbox components work as expected

Change-Id: Iccd2b103164a2da4e37b5746f4d9d2b5faf5f29d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253024
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
2020-12-02 18:44:09 +00:00
Ahmad Amireh bf02bf13cb [node12] upgrade gulp
refs FOO-1116
flag = none

verified contents of public/dist/ are intact across versions with a cmd
like this:

    find ./public/dist -type f -exec md5sum {} + | awk '{print $1}' | md5sum

== TEST PLAN

run "npx gulp rev" and verify it still works

== BONUS TEST PLAN

wipe out node_modules/, run "rake canvas compile:assets" and verify that
still works.

Change-Id: Ie072e415a89478e58a98b04b7826f974ba63f904
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253041
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-11-20 23:52:44 +00:00
Ed Schiebel 83aebb83d7 Fix kb nav in RCE tray's filter drop-downs
closes LS-1621
flag=none

Strictly speaking, the bug this fixes was addressed by updating
the <Select> in the RCE's Filter component by changing it to
<SimpleSelect>, but there was a bug in an earlier version that
had me update instui v7 components in canvas to the latest versions.

You need to run yarn (canvas:compile_assets does this for you), or
maybe even nuke_node before moving forward.

test plan:
  - in the RCE, open the content tray (e.g. Documents > Course Documents)
  - use the keyboard to navigate thru the filter area
  - use arrow keys to open the various dropdowns and make changes
  > expect it to work, and for the tray not to unexpectedly close

Change-Id: Id48441ef51ca2053b2b4b4cae27b90fcab6f4308
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252965
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2020-11-20 17:06:30 +00:00
August Thornton a4b36ec653 convert group edit JQueryUI dialog to InstUI modal
This commit covers the teacher/admin view of editing user
groups. Need to look into removing the old code in a followup
change.

closes FOO-909
flag = none

test plan:
 - Verify the test plan in the following gerrit still plays out:
   - https://gerrit.instructure.com/c/canvas-lms/+/247628
 - You'll need a student created group set and an admin created
   group set to test all the angles
 - Student Group Set
   - Create a group and remember its state
   - Go to edit said group
     - Verify the Group Name field is populated
     - Verify the Joining select is populated with prior choice
   - Edit the Group Name and Joining select dropdown
     - Verify the group collection is refreshed with your newly
       updated group
     - Go to edit the group and verify your changes saved
       successfully
 - Admin Group Set
   - Create a group and remember its state
   - Go to edit said group
     - Verify the Group Name field is populated
     - Verify the Group Membership Limit is populated
   - Verify as you did with the Student Group Set
   - Ensure the group has a member count
     - Edit the group and set the Group Membership Limit lower
       than your member count
       - Verify you get a descriptive error
 - The updated group modal should behave as it did before and
   be accessible and keyboard navigable

Change-Id: I6bd4c6983239c9ed779fa41d297dab81c364fcbe
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250185
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-10-19 22:26:16 +00:00
Clint Furse 146d27fae3 update Microsoft Immersive Reader SDK
closes LS-1377
flag = immersive_reader_wiki_pages

Test Plan:
- Enable immersive reader.
- Because there doesn't seem to be a way to run this locally
  (without consul), I had to temporarily modify the
  immersive_reader_controller.rb and added
  prod creds to get this to test.  see me for more details

Change-Id: Ifaa7edfa94ff29856ae6b474548e0f450b9d4c6c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245869
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: Clint Furse <cfurse@instructure.com>
2020-08-27 15:41:17 +00:00
Aaron Ogata e5e6fa54f1 move packages into dependencies layer for caching
refs DE-216

[change-merged]
[build-registry-path=jenkins/canvas-lms/de-216]

Test Plan:
1. Ensure that docker-compose build works locally
2. Ensure that packages building is cached when files aren’t changed
3. Packages build correctly when modified

Change-Id: I3e775e5d7eb51ba06078314b50bf2f8efb6d7d0b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245423
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-08-24 14:40:21 +00:00
Aaron Ogata 99d0010d86 minimize yarn caching dependencies
refs DE-209

[change-merged]
[build-registry-path=jenkins/canvas-lms-de-209]

Test Plan:
1. Ensure that `docker-compose build` works locally
2. Ensure that yarn is cached on Jenkins when run on a separate node

Change-Id: Icadf02b9e999eafd14f493ae1c0649ed0ffe58bf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245336
QA-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-08-18 15:53:28 +00:00
Ed Schiebel a0dfe0a334 Update ui-media-player to v7
This change bumps the ui-media-player from v5 to v7.
I also found a bug in the logic for retrying fetching the video sources
that's fixed here so we don't call fetch unneeded extra times. Learned
a lot about the interaction between useEffect and timers used to retry
actions.

Updated the @testing-library components in canvas-rce. waitFor in the new
version uses a mutation observer, not just a timer which helped make specs
more reliable.

Also did some significant rework of CanvasMediaPlayer.test to get it to
pass, especially without a bunch of react or testing-library warnings.

With PS13, I finally figure out how to listen for the onLoadedMetedata
out of <MediaPlayer> without having to reach under the hood and grab
the <video> element

closes LS-1077
flag=none

test plan:
  - audio and video still works, but with the new player
  - record a longish (30s+) video
  > expect to see the
    "Your media has been uploaded and will appear here after processing"
    message, and for the video to eventually play.
  - record or insert a portrait oriented video
  > expect it to be letterboxed in the player
  - record or insert audio
  > expect it to be loaded in the player

Change-Id: I797e6f16e763d7029eaf19149439e973590e978c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244463
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Anderson <raanderson@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2020-08-17 16:02:52 +00:00
Jacob Fugal 2b3886c5f4 extend client_credentials oauth2 grants for CD2
refs SAS-1540

* adds an audience setting to developer keys, so a key can be set to
  target external audiences with its credentials grants
* when a key with an external audience grants credentials, the token is
  signed with an asymmetric key instead of the internal symmetric key
* external audiences can retrieve the corresponding public keys from
  /login/oauth2/jwks
* credentials issued by developer keys with an account id include the
  account's guid in a custom claim

includes a refactor of key storage and rotation in consul, which had
already been done for LTI. but it wasn't really a feature of lti, just
something used by LTI, and we needed the same for key management for
this. moved it to be part of Canvas::Security

Change-Id: Ie5c0fcee6fc21687f31c109389a3bcc1ed349c5d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243606
QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2020-08-13 18:52:47 +00:00
Alex Anderson 590f43aa32 Enables adding alt text to image uploads
It also allows editing other a11y features, like making
the image presentational or embedding it as a link.

It splits out the Image Options form from the editor tray
to avoid copy/pasting too much. The logic and state are
still separated between the upload and edit forms, since
they don't overlap super well.

It also edits the logic around uploading and embedding
images to support the extra attributes.

A few Jest tests were added to check for appropriate
attributes being added.

Test Plan:
With RCE Enhancements enabled, visit an RCE page
Open the image upload modal and choose an image
Notice the image attributes form underneath.
Add alt text. Adjust the other attributes as desired.
Upload the image
Open the Raw HTML Editor.
Notice that the alt text is added to your image, along
with whatever other attributes you changed.
Decoration Images are given the `role="presentation"`
attribute; Display As "Link" embeds the image as a
link.

Fixes LS-445

flag = rce_enhancements

Change-Id: I462e2c322a3b39fc4fa9f47b675426c581c3a398
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242736
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2020-07-28 19:48:17 +00:00
Drake Harper 0469b0227a Change inbox avatar to use inst-ui
Test Plan:
-inspect avatar on inbox message is rendered from inst-ui

fixes VICE-17

flag=none

Change-Id: I92941e079b63a3a60468e1e894059c20e15b1251
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241435
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeffrey Johnson <jeffrey.johnson@instructure.com>
QA-Review: Jeffrey Johnson <jeffrey.johnson@instructure.com>
Product-Review: Jeffrey Johnson <jeffrey.johnson@instructure.com>
2020-07-01 17:22:03 +00:00
Ed Schiebel c603d6e9f2 fix audio player and video player sizing
closes LA-729
flag=rce_enhancements

The original intent for the audio player was to size it so the buttons
just fit. This ignored the fact that it's rendered w/in an iframe,
so popup menus are clipped. This change sizes the player to leave
room for those popups.

While the ticket was written against the audio player, the same issues
may occur in the video player, either for portrait videos or videos < 400px
wide when closed captions are present.  The original code for
sizing the video player shrank the width to fit
thea video's size, which clipped the buttons. This change sets a minimum
width for the player and letter-boxes the video.

test plan:
  - in the new rce
  - add an audio file
  > expect it to be wide enough to show all the buttons and
    tall enough for the speed and volume popups

  - add a vertical video
  > expect the video sized to fit in the available space in the Computer
    tab of the Upload Media modal
  - Submit to upload
  > expect the player to be wide enough to show all the buttons
  - click the fullscreen button
  > expect the video to be the height of the screen and letterboxed
  - restore to windowed size
  > expect the video to return to its letterboxed size
  - click the video, then the Options button
  - change the video's size
  > expect the video to remain letterboxed

  - add a horizontal video
  > expect the video sized to fit in the available space in the Computer
    tab of the Upload Media modal
  - submit to upload
  > expect the player to be sized to the size of the video
  - fullscreen
  > expect the video to be letterboxed in the fullscreen player
    (if the aspect ration of the video !== that of your monitor,
     or fill the screen if they match)

  - for the horizontal video, select Opitons and
    change the size to be "medium" or "custom" and < 400px wide
    and add subtitles
  > expect the video to be letterboxed in a 400px wide iframe.

Change-Id: Ib5d08dbd7796985d00f656e38a642ab92939d614
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238432
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Anderson <raanderson@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2020-06-04 12:58:00 +00:00
Ed Schiebel 656de86a31 update build to load es modules from subpackages
closes LA-995
flag=none

1. unify the instui ui-babel-preset options across sub-packages
2. include "@instructure" as part of each sub-package name
3. unify the commonjs and es module directory structure
4. use index.js to export anything needed to be imported from
   outside the package. This removes any dependency on the
   package's internal directory structure and makes importing
   independent of commonjs vs es module simple
5. move canvas-rce's main entry from async.js to index.js
   (I'm 98% sure index.js was an artifact of the old rce)

test plan:
  - canvas-lms builds locally and in docker. (Jenkins builds
    the docker image, so I presume if it passes jenkins,
    the docker build wasn't broken)
  - sniff test the result, esp. student planner and the new rce.
  - yarn build:watch from canvas-rce, canvas-planner, and
    canvas-media packages should work, and yarn build:watch
    from canvas-lms should pick-up any changes.
    (I've verified this by finding a console.log statement
     and changing the message then use devtools to see it's in
     the new source after refreshing the browser)

Change-Id: I5f242d06ad655597cd416057d4b740d4bd86003b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238603
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Anderson <raanderson@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2020-06-03 13:41:38 +00:00
Michael Brewer-Davis d989afbf15 change outcomes alignment component
closes OUT-3593
flag=outcome_alignment_non_scoring_content

Test plan:
- with quiz_api, outcomes, canvas running,
  provision outcomes for account
  - in canvas rails console:
      Account.first.provision_outcomes
- in a course, create some outcomes and groups
- sync canvas outcomes to outcomes service
  - following instructions in outcomes-service canvas.rake
    re: canvas docker-compose config, run in outcomes-service:
      dc run --rm api bundle exec rake \
         canvas:dump_canvas_data[outcomes.docker,db.canvas.docker]
      dc run --rm api bundle exec rake canvas:sync[outcomes.docker,true]
- enable "Outcome alignment to non-scoring content" FF
- create canvas course with wiki page
- on wiki page show page, add outcomes to the page
- verify that outcomes are retained on reload
- in another course without outcomes, verify that outcomes widget does
  not appear

Change-Id: Ie3af07642d818eaa529bff76b1ac7d81e575622b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235665
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Jody Sailor
2020-05-29 00:50:27 +00:00
Ed Schiebel 9d779b3d7f Update eslint rules to allow optional chaining
closes LA-973
flag=none

test plan:
  - code with a?.b does not report no-unused-expressions eslint error

Change-Id: If31b5545c31a9a095176cee74a2173ba0eeceab8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235941
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
2020-05-07 12:38:29 +00:00
Charley Kline 2543084cc1 Add use-media-set responsive React hook to package.json
Refs USERS-549
flag=none

This will be used in places where responsive components
may have performance issues due to complexity.

Test plan:
* build passes

Change-Id: Icce432352b5eb5118fc258b7c2f0e3c730eaae86
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236255
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2020-05-06 15:59:14 +00:00
Derek Bender 1a5bb0a7e5 Point to instructure forks
Closes: CCI-351

flag = none

Test Plan:
- no behavioral changes
- build passes

Change-Id: I2e6bfa46b56ee2b59b8289fc90ef9c319757fc34
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235566
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2020-04-30 16:35:43 +00:00
Derek Bender 3d9bffdbfb Add ui-flex explicitly to package.json
Fixes: CCI-352

This resolves an issue with a plugin which includes it explicitly and
then changes the yarn.lock. This gets both package.json files in sync.

Test plan:
- yarn.lock does not change with or without plugins present

flag = none

Change-Id: I48452b2c542476b42cf1aae80605e267d0c62819
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235769
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-04-30 16:25:44 +00:00
Benjamin Christian Nelson 9a20868030 remove unused selinimum gem
Change-Id: I0adc219a6cab442226619d5bdd0814d7f09d0d52
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230713
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Jacob Powell <spowell@instructure.com>
2020-04-23 17:25:57 +00:00
Ed Schiebel 9e73b30345 Update instui and media-capture versions, reprise
instui -> 6.24.0
@instructure/media-capture -> 7.1.0

the update to @instructure/media-capture is necessary to
fix the audio recording bug described in LA-859.  This change
required a bump to INSTUI's version. Both updates are rolled
into this change.

closes LA-595
flag=none

test plan:
For the audio recording part:
prereq: have notorious running. you must be loading canvas
from localhost unless using https in order to enable
the mic and webcam.
  - create or edit something with the rce
  - select Media > Upload/Record media
  - change to the Record tab
  - click on the "WebCam" button and select "No video"
  - record some audio and save
  > expect the audio to be uploaded and appear in the RCE

  - go to the speedgrader for a graded object
  - click on  the Media Comment button
  - click on the "WebCam" button and select "No video"
  - record some audio and save
  > expec the audio comment to be uploaded and playable

For the instui upgrade part:
  - make sure everything still works as expected
  - check with instui changelog for changes since 6.21 for guidance

This commit reverts commit 7ede798549,
which reverted 81d493b722
which was prematurely merged.

Reason for revert: get the oritinal patchset back in the queue,
but hold off merging until after beta is cut from master. This
will give the INSTUI change a chance to soak in dev for longer
than the weekend before being deployed

Change-Id: Iada67ee10a796e4b4b967b27a64f3e527e78249a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/233037
Reviewed-by: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2020-04-21 17:44:46 +00:00
Ed Schiebel 7ede798549 Revert "Update instui and media-capture versions"
This reverts commit 81d493b722.

Reason for revert: <INSERT REASONING HERE>

Change-Id: I605acf8519f023c671e6bb52eb541434701bc52f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/233036
Tested-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-04-17 14:10:27 +00:00
Ed Schiebel 81d493b722 Update instui and media-capture versions
instui -> 6.24.0
@instructure/media-capture -> 7.1.0

the update to @instructure/media-capture is necessary to
fix the audio recording bug described in LA-859.  This change
required a bump to INSTUI's version. Both updates are rolled
into this change.

closes LA-595
flag=none

test plan:
For the audio recording part:
prereq: have notorious running. you must be loading canvas
from localhost unless using https in order to enable
the mic and webcam.
  - create or edit something with the rce
  - select Media > Upload/Record media
  - change to the Record tab
  - click on the "WebCam" button and select "No video"
  - record some audio and save
  > expect the audio to be uploaded and appear in the RCE

  - go to the speedgrader for a graded object
  - click on  the Media Comment button
  - click on the "WebCam" button and select "No video"
  - record some audio and save
  > expec the audio comment to be uploaded and playable

For the instui upgrade part:
  - make sure everything still works as expected
  - check with instui changelog for changes since 6.21 forguidance

Change-Id: I322b57f4addca16c989feeb9b74a1fc3f8c775e5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234155
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2020-04-17 13:46:24 +00:00
jonw e9a47c91f6 add progress bar and errors to asmt bulk edit
closes LA-898
flag=assignment_bulk_edit

test plan:
- Edit many dates and save
- The job should start and a progress bar should be displayed next to
  the cancel button
- The job progress should be polled and the progress bar updated
- When the job completes, polling stops (see network tab), the progress
  bar should be at 100%, and a success message should be displayed.
- There should be appropriate screen reader announcements.
- If there are any errors during the job, polling should stop and the
  error messages should be displayed.

Change-Id: Ifd9ec6224318a003317a66ce2460ccf3e9d45efa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/233136
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2020-04-10 16:35:19 +00:00
jonw d48344a5e1 add overrides and editing to bulk assignment edit
closes LA-847
flag=assignment_bulk_edit

test plan:
- Assignments and their overrides should be displayed with their dates
- Each date input should function and work independently

Change-Id: Ia2206bcae8b462535e3bcc99bf024bfaae39bc3e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230953
QA-Review: Anju Reddy <areddy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
2020-04-06 21:36:14 +00:00
Derek Bender fef18b228a require node 10.16 for brotli support
Fixes: CCI-312
flag = none

Test Plan:
- builds pass

Change-Id: I419c5f8a2572195c3b81bf51c8028ceabb7df1bd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/231945
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Powell <spowell@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-04-03 19:48:37 +00:00
Derek Bender 2cdf77e112 Pin instui to ~6.21.0
Since instructure-ui has published version 6.22, any developer who runs
`yarn` will result in a modified `yarn.lock` file. To prevent accidental
upgrading from 6.21 to 6.22, it would be prudent to pin these
dependencies in the `package.json`. This also is a good idea to help
reduce any confusion around _why_ the yarn.lock is being changed locally
as well.

Fixes: CCI-302

Test plan:
- manually verify no changes to the `resolved` fields of each
  git-changed package. Since this pins all instui deps, they should all
  be exactly the same.
- manually verify there are no @instructure prefixed packages that are
  version 6.22

Change-Id: Id1c061bc60f1922d330cfafab00b4ddc9e09f9ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/232255
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: Benjamin Christian Nelson <bcnelson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2020-03-31 17:28:00 +00:00
jonw 0bf9b8df9d add CanvasDateInput and bulk edit test table
The thrust of this commit is to implement a CanvasDateInput on top of
instui's DateInput field. The bulk editing table is just an instance
of it to test with.

closes LA-835
flag=assignment_bulk_edit

test plan:
- go to the assignment bulk editing page
- play around with the single date input component
  - selecting dates from the calendar
  - typing in dates
  - typing invalid dates
  - blank line
  - keyboard navigation
  - screen reader
- play around with your user locales and timezones and expect correct
  behavior showing the proper dates

Note that VO reads the date twice when you navigate with the keyboard. I
believe this is because it is reading the input value change and the
selected calendar date. I don't know that there's much to do about this.
The demo on instui's page does the same thing.

Change-Id: I9c66ccaa746fb91fecd20362e00a927c57f491b5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230609
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
2020-03-31 03:52:27 +00:00
Charley Kline 4a3e308105 Add <Responsive> component from InstUI
Refs UXS-49
Refs USERS-459

It will be generally useful to be able to use the InstUI
Responsive component to deal with browser breakpoints in
React. The immediate use case is something I'm working on
in multiple-root-accounts but it needs to be in core
Canvas.

Test Plan:
* You agree that the changes here, especially what happened
  to yarn.lock, are kosher.

Change-Id: Icad7db3de7fef94dd1eb292b02b30014a0facbd4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/232023
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chris Hart <chart@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2020-03-30 15:34:01 +00:00
Alex Anderson 66cd0c07f0 Add Teacher Tourpoints
Uses the "Product Tour" feature flag to selectively load
the bundle. It also grabs the user's role to only show
the tour to teachers. Admin and Student tours coming
soon.

To properly facilitate communication between the Navigation
component and the Tour component, I created a
simple PubSub engine which allows components to pass
messages between each other in an efficient and clean way.
This allows the tour to open the nav trays at certain
points in the tour.

Whether the tour shows is determined by a localStorage
key, set on the users browser. When they close the tour
if turns the flag on and uses that to now automatically
show the tour again.
The key is "canvas-tourpoints-shown-teacher"

This patchset also includes an update to the help links.
If the user is a teacher, it shows the "Show Welcome Tour"
link, allowing the tour to be re-opened from the help tray.

Test Plan:
Log into Canvas as a teacher
The tour should appear. Navigating through the tour properly
opens and highlights items in the navigation trays.
Reloading the page after closing the tour completely should
cause the tour not to appear. Removing the localstorage
key should cause the tour to reappear.

It should look like the designs linked below.
https://www.figma.com/file/BzfJcEbBaccu5lMsaZ08zK/Canvas-COVID19-Tourpoints?node-id=8%3A33

Refs UXS-22

Change-Id: I1164bc1fbe55fa5cbb5f4a9df271a0dcd772f045
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230614
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Laura Leavitt <lleavitt@instructure.com>
2020-03-27 16:36:59 +00:00
Chris Hart 2eb072efe1 Update new user tutorial tray content
flag=none
closes UXS-8

Adds new content (copy and links to Canvas Guides), as well as
updated images for each of the existing new user tutorial trays.

Test Plan:
Verify that the trays work as follows:
- All links should correctly resolve to the Canvas Guides page
  they name
- All trays should feature a Panda image
- All tray should open and close, and should be able to be
  dismissed permanently (no regressions from existing functionality)

Check the following index pages for trays: Announcements, Assignments,
Collaborations, Conferences, Discussions, Grades, Course Home Page,
Course Import page (under Settings), Modules, Pages, People, Quizzes,
Settings, Syllabus. There is a tray for Files, but it seems to be removed
from the Files index page on page load (not a result of this commit).

Change-Id: I873fdf9ceb6097d987f3e7da38e5fd615c1d98ea
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230372
QA-Review: David Tan <dtan@instructure.com>
Reviewed-by: Pam Hiett <phiett@instructure.com>
Product-Review: Pam Hiett <phiett@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-03-21 08:53:38 +00:00
August Thornton 403b13a4f8 run jest tests concurrently
closes USERS-376
fixes USERS-379
fixes USERS-385

test plan:
 - specs pass

Change-Id: I30d4c27a2c628858a207d4c0236345bad49b7bcf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228278
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2020-03-10 21:38:24 +00:00
Charley Kline b897df4336 Update INST-UI to v6.21
Closes USERS-336
flag=none

Test plan:
* should be wrung out in beta
* can someone please test the CanvasMediaPlayer in the RCE?
  I saw some weirdness there and had to skip a test.

Change-Id: I1663466aa411fc5e98e2a5e4f7384eb151364817
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228277
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2020-03-05 01:48:56 +00:00
Augusto Callejas 8f537e3594 Enable outcome alignment on Canvas pages
closes OUT-3401

flag = none

test plan:
  - check out/update canvas plugins needed for sharding:
    * multiple_root_accounts
    * demo_site
    * canvas_geoip
  - check out/update canvas plugin needed for provisioning:
    * uuid_provisioner
  - check out/update quiz repo:
    * quiz_api
  - check out/update outcomes service:
    * outcomes-service
  - add the following to the postgres container section
    of your docker-compose.override.yml in canvas:
    ===
    ports:
      - "5432:5432"
    environment:
      VIRTUAL_HOST: db.canvas.docker
    ===
  - update canvas configuration by adding example
    dynamic_settings to existing config/dynamic_settings.yml
    and by copying example uuid_provisioner.yml
  - in canvas rails console, enable the auto provision setting:
    > Setting.set('auto_provision_outcomes_service', 'true')
  - start up canvas, outcomes-service and quiz_api
  - create a new root account from canvas siteadmin
    http://canvas.docker/accounts/site_admin/root_accounts:
    * account name: outcomes
    * account domain: outcomes.canvas.docker
  - after a few minutes, verify in the outcomes rails console that a new
    shard has been created and registered for the second account, but
    not the first
    > ap AccountRegistry.all
  - create a course with outcomes in outcomes.canvas.docker
  - in the outcomes api docker container, dump canvas data and sync
    into the provisioned outcomes shard:
    > bundle exec rake canvas:dump_canvas_data[outcomes.outcomes.docker]
    > bundle exec rake canvas:sync[outcomes.outcomes.docker,true]
  - enable the outcome alignment feature flag:
    - http://canvas.docker/accounts/site_admin/settings
    - Feature Options tab
    - Find "Outcome alignment to non-scoring content" feature flag
    - Switch to "ON"
  - return to course created in new canvas account
  - create a canvas page in the course
  - load the newly created canvas page
  - confirm that an outcome alignment widget appears, and that
    it opens a side tray with course outcomes  when attempting to align

Change-Id: Ide6891493ea3c926d155d4aea9bc7aff5bdaa6fb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/227463
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
QA-Review: Michael Brewer-Davis <mbd@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2020-02-21 16:28:03 +00:00
Davis Hyer 74714095be add confetti when assignment is submitted
refs KNO-265
flag=confetti_for_assignments

Moving Steven's POC (https://gerrit.instructure.com/c/canvas-lms/+/224811)
to the original assignments implementation.

A followup commit will introduce the screenreader text as this commit
is already getting large, and there has been a few difficulties on
adding that behavior already.

test plan:
  - with confetti_for_assignments flag disabled
    - turn in a submission for an assignment before the due date
      - you should be redirected to /courses/:id/assignments/:id
        - no confetti should display
      - visit /courses/:id/assignments/:id?confetti=true
        - no confetti should display
  - with confetti_for_assignments flag enabled
    - turn in a submission for an assignment before the due date
      - you should be redirected to /courses/:id/assignments/:id?confetti=true
        - confetti should display
    - turn in a submission for an assignment after the due date
      - you should be redirected to /courses/:id/assignments/:id
        - no confetti should display
  - while confetti is displayed
    - you should be able to clear by pressing either `space` or `esc`
    - confetti should clear itself after 3 seconds

qa risk: low

Change-Id: Ie7743af9e2341eab26fbc3055e90bb0658463018
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/225929
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Johnny Le <jle@instructure.com>
Product-Review: Johnny Le <jle@instructure.com>
QA-Review: Johnny Le <jle@instructure.com>
2020-02-19 15:35:29 +00:00
Rex Fleischer 01165c1db3 spec: testing changes for js failures
Change-Id: I7b20ca53f0defdc78ffd285540e62d1b2bf51b86
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/223373
Tested-by: Rex Fleischer <rfleischer@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Rex Fleischer <rfleischer@instructure.com>
Product-Review: Rex Fleischer <rfleischer@instructure.com>
2020-01-15 22:18:14 +00:00
Charley Kline dcaf1fd4b6 Upgrade INST-UI dependencies to latest (6.16.0)
Closes USERS-205
flag=none

Also had to make a slight tweak to a Canvas Planner file to reflect
a change in ui-forms -> ui-checkbox

In addition, several imports from InstUI had to be changed from
their legacy locations to their currently-documented ones, in
order for all the tests to pass. Using the old import sources
apparently causes two components of the same name to be rendered
which breaks assumptions in some tests that there will be only one.

Eventually we'll have to fix up all the imports which will be a
bit of a slog.

INST-UI changes notes for 6.16.0:
---------------------------------

Bug Fixes:

ui-a11y-utils: fix ui-a11y-utils dependencies
ui-docs-client:
    remove unnecessary import of ScreenReaderContent
ui-modal: update deprecated lifecycles in modal
ui-tooltip: uncontrolled example broken

Features:

instui-cli,ui-scripts,ui-template-scripts:
    add a new ui-template-scripts package
instui-cli,ui-upgrade-scripts:
    add a new ui-upgrade-scripts package
ui-badge: add ui-badge package
ui-buttons: add a CondensedButton component
ui-buttons: add an IconButton component
ui-byline,ui-layout: add ui-byline package
ui-checkbox: add ui-checkbox package
ui-docs-client:
    make content within docs pages navigable via linking
ui-docs-client: updates to compileMarkdown for id generation
ui-drawer-layout: add ui-drawer-layout package
ui-elements: add isWithinText prop to ui-element Link
ui-elements,ui-truncate-text: add ui-truncate-text package
ui-expandable: add ui-expandable package
ui-forms,ui-radio-input: add ui-radio-input package
ui-forms,ui-text-area: add ui-text-area package
ui-navigation: remove experimental pill from AppNav
ui-range-input: ui-range-input package
ui-responsive: add ui-responsive package
ui-spinner: ui-spinner and design updates
ui-themeable: update deprecated lifecycles in themeable
ui-tray: ui-tray package

Test plan:
* Review changelog above
* Test on master thoroughly.

Change-Id: I9f4552f18b2a48a626e7bb2102f8b3def46eb775
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/221466
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2020-01-15 18:22:03 +00:00
S. Jacob Powell 85fe2246e9 Ensure all JS stages output test results
test plan:
See the following link for examples of failing in each stage,
as well as the test output being correctly loaded into
the Tests tab:
https://jenkins.inst-ci.net/blue/organizations/jenkins/Canvas%2Ftest-suites%2FJS/detail/JS/5082/pipeline

fixes: CCI-178

flag = none

Change-Id: I43c16ce7b589eb69cbe266c0929a722325ece2cf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/222604
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Powell <spowell@instructure.com>
Product-Review: Jacob Powell <spowell@instructure.com>
2020-01-15 06:01:08 +00:00
Charley Kline e8db468fdd Update InstUI imports for canvas planner
Refs USERS-205
flag=none

The InstUI folks are splitting up packages so to allay
future compatibility problems, and to get tests to pass
on future upgrades of InstUI, we should follow these as
they move rather than rely on the old locations. This
takes care of the Canvas Planner package.

Note that I cheated a bit here and brought CanvasSelect
over from the main Canvas app into this package. At
some point that should probably become a package of its
own, I guess.

And I had to add another test file because the tests
for CanvasSelect dragged the test coverage below 85%.
Sigh.

Test plan:
* tests pass
* canvas planner works

Change-Id: I40bbbe559f4928318b8ac1444649d97b09a281c0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/221741
Product-Review: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
2020-01-07 19:14:21 +00:00
Mysti Lilla 7ea5d98f47 Announce when items are loaded
fixes LA-292
flag=direct_share

Test plan
- Load the content shares and ensure the
  SR announces the load

Change-Id: I828c4ad23d5ebaf0879a7e3df56d2584b715c508
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220774
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Jon Willesen <jonw+gerrit@instructure.com>
Product-Review: Anju Reddy <areddy@instructure.com>
2019-12-18 23:02:33 +00:00
Ed Schiebel 8746eef1ff Fix course image dnd
closes LA-95
flag=none

test plan:
  - go to any course settings page
  - click "Choose Image"
  - drag an image file into the drop area
  > expect a spinner while it uploads
  > expect the image chooser modal to close
  > expect the image to show as the course image

  - repeat, but try to drop an image outside the drop area
  > expect nothing to happen

  - repeat, but try to drop a non-image file into the
    drop area
  > expect it to be rejected and the message
    "File must be an image"

Change-Id: I7c94a02090b2b806610637d6329cf301ca1d5237
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220548
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-12-16 13:39:54 +00:00
Ryan Shaw 202f0b80a3 Print a helpful message in yarn webpack:analyze
Change-Id: I7d73e8d482dc025d478597393c261b9807dae544
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220599
Reviewed-by: KC Naegle <knaegle@instructure.com>
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-12-13 16:13:55 +00:00
Mysti Lilla 3849cfad1c Prevent 404 error in Direct Share tray
fixes LA-325
flag=direct_share

Test plan
- In the direct share import tray
  select a course and then a module
  for that course
- Then search for a different course
  and select one from the searched list
- Verify that you don't get the "something
  went wrong" picture

Change-Id: I70b7614da7d9003c76bf3ebe3ff1290e4de98575
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219207
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-12-10 00:15:54 +00:00
Ryan Shaw ecfa985af1 Revert "Perf: use a minimal version of tinycolor2"
Closes: TALLY-318

This reverts commit 1db3924086.

Change-Id: Id59d17728734fc150bd3295684937fd88c9ae0a4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218038
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2019-11-20 21:36:10 +00:00
Ryan Norton 7051c0aa74 fix deprecated ellipsis warnings in A2
this fixes the following error that is showing up in the console
when using student view:

Warning: [Heading] `ellipsis` is deprecated and will be removed in
version 7.0.0. Use `<TruncateText />

Test Plan:
* when using A2, go to an assignment page and confirm that the
  warning is no longer showing

flag=assignments_2_student
fixes WOKE-90

Change-Id: I9fea740c04d9b4029d01a688a8b2f98c94d3fd8b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/215964
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-11-05 22:42:37 +00:00
Ryan Shaw 1db3924086 Perf: use a minimal version of tinycolor2
closes: COREFE-389

This version of tiny color has only what we need to provide the APIs
exposed by @instructure/ui-color-utils
Before: 15k, after 5k

See the difference
https://bundlephobia.com/result?p=@instructure/tinycolor2
Vs
https://bundlephobia.com/result?p=tinycolor2

Here’s the actual changes of what was removed:
https://github.com/instructure/TinyColor/commit/350479a

Change-Id: I591652bf95f2c1667f17da5c94b4e60df6fba0d5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/214768
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-11-01 21:00:38 +00:00
Brent Burgoyne 802645337e update timezone library for brazil dst change
temporarily using a fork of bigeasy/timezone since it does not build
with the latest releases of eggert/tz

fixes COREFE-308

test plan:
- set user timezone to brazilia
- create an assignment with a due date after 2019-11-03
- save the assignment
- the time should not be off by an hour on the details page

Change-Id: I7a15e92def90a5d83f8be079657a58894bd13822
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/215065
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-10-30 16:12:28 +00:00
Ed Schiebel 67e551c5e5 Add video options tray to the rce
closes COREFE-315

test plan:
  - load a page with the RCE and have a video in it
  - click on the video
  > expect the Options popup toolbar button
  - click it
  > expect the video options tray to open
  > expect the title to default to the video's file name
  > expect the default size to be Large (400px on the long side)
  - delete the title
  > expect the Done button to be disabled
  - set a new title
  - change the size to Custom
  - delete the width or height
  > expect an error message and the Done button to
    be disabled
  - enter a new size, or select one from the dropdown
  - click Done
  > expect the video to be resized to the new size
  - if you're using a screenreader, expect the video
    to be announced as "Video player for {your title}"

Change-Id: Id7e29520cc91c02645b92d666216e64f6619bbbb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/211355
Product-Review: Lauren Williams <lcwilliams@instructure.com>
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2019-10-30 13:14:42 +00:00
Jeremy Stanley cac818a878 files: turn off page.js click handler
because it prevents preventDefault on file links (sometimes)

then use it explicitly where we need it, on the left/right
preview buttons

test plan:
 - go to user files (/files)
 - have multiple image files in a folder
 - reload the page, then click an image file
 - it should preview, not download
 - clicking the left/right arrows at the
   side of the preview window should go to the
   previous/next image without reloading the page

fixes ADMIN-2923

Change-Id: Ib97d25d51e7c94fb962e5d24d3c763554e7fcdd4
Reviewed-on: https://gerrit.instructure.com/212876
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2019-10-17 20:47:47 +00:00
Clay Diffrient 5e5448f7aa Add ability to launch immersive reader from wiki pages
Test Plan:
  - Enable Immersive Reader Feature flag
  - Go to a wiki page with content
  - Click the immersive reader button
  - Immersive reader should open

closes COREFE-265

flag = immersive_reader_wiki_pages

Change-Id: I015fbbd72adf05177f3941890b5a04a7aa067ee2
Reviewed-on: https://gerrit.instructure.com/211546
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
2019-10-11 21:24:10 +00:00
Ed Schiebel d5a80a41a9 Update media upload
closes COREFE-268

test plan:
  - open a page with the rce
  - from the media toolbar button menu, select upload
  - pick a video from your computer
  > expect a preview to appear
    > expect the video to be about 75% the width of the modal
      and as tall as it needs to be for the video
  - click Submit
  > expect the modal to close
  > expect the video to show up in the rce
    > expect it to be 400px wide, and however tall it needs
      to be (try both portrait and landscape videos)
    > expect the grey placeholder while it's being uploaded
    > expect the yellow flash indicator when it's loaded
    > expect to see a "Loading..." message until the video player
      renders
  - from the documents toolbar button menu, select upload
    and upload a video
  > expect the video file to show up in the media>course media
    tray list
  - click on the video file
  > expect the video to show up in the rce
    > and for all the same constraints as the uploaded
      video to be true

  - you should try this with the video appended to the end of
    content and right in the middle
  - click on a video and delete.

  - if you loaded the page via http, there will probably be
    no fullscreen button

Change-Id: I934ad486b74689e81941e1fcf0cf6efd18e5f426
Reviewed-on: https://gerrit.instructure.com/209296
Tested-by: Jenkins
Product-Review: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2019-09-30 14:13:50 +00:00
Ryan Shaw 48c055ed0e Now that we have streaming, execute JS sooner
Closes: COREFE-302

This will actually start executing the JS as soon as it comes in
the <head> instead of waiting until after the </html> for it to start.

What this means is that for any page that is streamed, we will start
running our javascript sooner, as soon as the <head> is sent to the
browser. So we can begin executing code while the server is still
working on sending back the rest of the document.

Note: this change makes it necessary for any endpoint that is streamed
to have a check for DOMContentLoaded before doing anything that assumes
elements will be there. I added this `@instructure/ready` helper do to 
that in all the places I could see. If the DOM is already loaded,
`@instructure/ready` run the callback immediately (not in a setTimeout) 
so theoretically load/execution order should be _exactly_ the same for 
any response that is not streamed, even if it is wrapped 
in a “ready(…)” callback

QA test plan:
* click around in prod mode, especially on pages that are streamed
  make sure there are no thrown javascript errors or pages that
  fail to render
* try both on a fast network as well as simulating a slow network with
  browser caching turned off (if you don’t know how to change your
  network speed simulation settings in Chrome, I can show you)
* specifically look at pages that are streamed 
  (like courses/x/discussions/y, /courses, courses/x/modules) 

Change-Id: I49a74ab480095e50cfa08dca8e074848dce12012
Reviewed-on: https://gerrit.instructure.com/203198
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-09-19 23:10:43 +00:00
Ryan Shaw 857e37a73f allow prettier for ruby too
This does not mandate anything or -1 or anything like that, it just
makes it so if you hate figuring out how to format ruby code like I do
you can have prettier do it for you.

Test plan:
* First checkout this commit & run yarn and make sure you are using
  Ruby 2.5 or newer

To test on command line:
* `yarn prettier --write path/to/any/ruby/file.rb`

To test in vscode:
* After you checked out this commit and ran yarn, restart vscode
* Open a ruby file in vscode
* open the command pallet (command-shift+p)
* type “Format” so the “Format Document” command appears. Hit enter
* it should pretter format that ruby file

* or alternatively, trigger the “Format Document” command directly
  By typing “Shift+Alt+F”

Change-Id: Ifd0272f2c1bed3263473a1e7d5df13547e10dec4
Reviewed-on: https://gerrit.instructure.com/209982
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-09-18 19:24:43 +00:00
Jon Willesen 3f8f0fcf48 direct share user selection modal
closes ADMIN-2839
flag=direct_share

test plan:
- as a user with course management permissions (such as a teacher) go to
  the discussions index page and select "Send To..." from a discussion's
  kabob menu.
- this should open a modal where you can search for and select other
  course users who have course management permissions.
- clicking on the "Send" button only does a console log at the moment.

Change-Id: I67f823d0820283fd90e2aa6e3ae3ea5fe54d9b3d
Reviewed-on: https://gerrit.instructure.com/205967
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-09-17 19:20:57 +00:00
Landon Gilbert-Bland 8596433ff7 Add support for javascript optional chaining
Per https://github.com/tc39/proposal-optional-chaining

Test Plan:
  - Jenkins passes

flag = none

Change-Id: I7b9fde7e91a9bd00a85397bcf791b8eccd528a5b
Reviewed-on: https://gerrit.instructure.com/209826
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-09-17 17:33:46 +00:00
Ryan Shaw 566ecb6e9f Spec: fix jest timeouts on patchset/master bulds
Closes:  COREFE-293 COREFE-294

See:
https://til.hashrocket.com/posts/s9bzmmvbbz-fix-timeouts-and-speed-up-jest-on-ci
https://stackoverflow.com/questions/43864793/why-does-jest-runinband-speed-up-tests/44506948
For why

Test plan:
We should get less test timeouts on jest from the master build once this
Is merged

Change-Id: I74905cbd50ee0ea1c5e9e2cbcf563a5e0eb28721
Reviewed-on: https://gerrit.instructure.com/208975
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-09-11 17:14:02 +00:00
Ryan Shaw 20b962f5f5 Use native es modules for tinymce-a11y-checker
Change-Id: Ia17a47e50711abca1b6ca154995bfa2f6e5b1eb8
Reviewed-on: https://gerrit.instructure.com/208604
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-09-09 20:07:28 +00:00
Ryan Shaw f0d6f1a497 Remove rest of the $.support checks for old browsers
see: https://github.com/ryankshaw/jquery/commit/ce59a7f0b3c4fc6ff9a2176
for the diff of the actual changes

Copying from that commit message:

All of these checks only ever returned false in older browsers that
We no longer support. By getting rid of them, we can get rid of this
Chunk of javascript execution that happens on every page right before
The domcontentloaded event fires: https://cl.ly/d368d5c9388 which ends
Up being non-trivial because it causes a couple recalculate-styles
(As seen by the purple in that screenshot)

Test plan:
jQuery should work the same as before
* domcontentloaded should end 15-200ms sooner which means all pages
  Should load a little faster

Change-Id: I3efa8752708b9043107e9123d31cd509536e9993
Reviewed-on: https://gerrit.instructure.com/208606
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-09-09 17:19:47 +00:00
Jon Willesen 3fceef17cb basic direct share course selection tray
Note: There appears to be an issue with VoiceOver not announcing the
aria live updates. Going to ignore this for now and see if it is still a
problem when InstUI 6 lands. Another ticket will be created to check and
fix.

refs ADMIN-2811
flag=direct_share

test plan:
- should be able to search by name for courses you manage in the direct
  share course selection tray.
- copy button disabled until you select a course
- after selecting a course, the copy button just logs to the console
- cancel button closes the tray
- generally accessible, except for VO reading alerts.
  - could check the flash_screenreader_holder div in the inspector if
    you want to watch the DOM changes that should trigger the alert.

Change-Id: I5c102b25d277204a9929f780adbe94b9d3e46bcb
Reviewed-on: https://gerrit.instructure.com/205371
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
Reviewed-by: Carl Kibler <ckibler@instructure.com>
2019-09-06 20:58:59 +00:00
Clay Diffrient 8247f43008 Add linters to new Jenkins
This moves eslint, stylelint, and xsslint to be part of our
JS build pipeline.  It does not account for other linters that
are more general like tatl_tael linters and commit messages or
non-frontend language specific linters like rubocop.

Test Plan:
  - The linters-and-js build on New Jenkins should run and actually
    run the linters specified above.

closes COREFE-220

flag = none

Change-Id: I8f633caf9af025c83bbe68fbd1536276a838c159
Reviewed-on: https://gerrit.instructure.com/206106
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-09-03 19:18:30 +00:00
Ryan Shaw 926699be29 Isolate grade* specs from everything else
Trying to get the karma tests to have less flaky failures,
let’s see if running all the gradebook related specs isolated from
everything else helps solve anything


Test plan:
* the karma part of linters and js build passes

Change-Id: I2f25464129f71c019fe27267d1b0cfa5472a6481
Reviewed-on: https://gerrit.instructure.com/207700
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-30 20:13:21 +00:00
Ryan Shaw 3718da12c5 Upgrade canvas-lms proper to instUI 6
closes: COREFE-209 COREFE-207 COREFE-230

this should help bugs, spec flakiness, and bundle sizes

test plan:
* make sure that the pages that are still using the old 5.x one from
  @instructure/ui-core still work, namely:
  app/jsx/account_course_user_search/components/CoursesToolbar.js
  app/jsx/blueprint_courses/components/CourseFilter.js
  app/jsx/grade_summary/SelectMenu.js
* make sure themeing of instUI components still works and picks up
  theme editor settings
* make sure bundle sizes are smaller, not bigger
* check tinymce-a11y-checker that it still works the same
  (With the rce-enhancements feature both on and off)

Perf test plan:
* make sure tree shaking is working
  load it up in one of the webpack bundle visualizers to see
* make sure we are not loading *all* of the icons


this commit also updates the instUI6 version we use from 6.9 6o 6.10
which has  fix for <Alert> unmounting that ed fixed:

Test plan:
* you should see less console arrows about react unmounting nodes
  Associated with the CanvasSelect component

Change-Id: Ied2ff1d1521b0900126136170f103dea27bc554a
Reviewed-on: https://gerrit.instructure.com/204545
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-30 14:36:53 +00:00
Ryan Shaw 9b156aa314 add @instructure/ui-a11y to our package.json
…since we use it.

This way, once I start upgrading other things to instUI 6, it won’t 
Break by giving canvas-lms proper ui-a11y 6.x instead of 5.x

Test plan:
* if this is merged, the commit to update MRA to instUI 6 g/207102
  should pass

Change-Id: I30d1cce751635fb861feba12ea9649901887ebb9
Reviewed-on: https://gerrit.instructure.com/207135
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-28 22:48:46 +00:00
Ryan Shaw d1bc046578 Upgrade canvas-rce to 4.1.5
The only change is that some things that it actually used weren’t
In it’s package.json and they were added.

See 
https://diff.intrinsic.com/@instructure/canvas-rce-old/4.1.4/4.1.5

For the differences

Test plan:
* when we upgrade canvas’s instUI to 6.x we shouldn’t get failures
  about not being able to find 
  @instructure/ui-alerts/lib/packages/alert.js

Change-Id: Icff6d120bff55697defc73c092b2ca9782fc44e2
Reviewed-on: https://gerrit.instructure.com/207063
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-28 21:22:24 +00:00
Ryan Shaw 9668da881d silence some yarn warnings caused by Apollo stuff
Test plan:
* run `yarn`
* you should not see these warnings:
warning " > react-apollo@3.0.1" has unmet peer dependency "@types/react@^16.8.0".
warning "react-apollo > @apollo/react-common@3.0.1" has unmet peer dependency "@types/react@^16.8.0".
warning "react-apollo > @apollo/react-common@3.0.1" has unmet peer dependency "apollo-utilities@^1.3.2".
warning "react-apollo > @apollo/react-components@3.0.1" has unmet peer dependency "@types/react@^16.8.0".
warning "react-apollo > @apollo/react-components@3.0.1" has unmet peer dependency "apollo-cache@^1.3.2".
warning "react-apollo > @apollo/react-components@3.0.1" has unmet peer dependency "apollo-utilities@^1.3.2".
warning "react-apollo > @apollo/react-hoc@3.0.1" has unmet peer dependency "@types/react@^16.8.0".
warning "react-apollo > @apollo/react-hooks@3.0.1" has unmet peer dependency "@types/react@^16.8.0".
warning " > @apollo/react-testing@3.0.1" has unmet peer dependency "apollo-utilities@^1.3.2".

Change-Id: Icd38c4e742b00d3f31fe187b1bc915fd01169880
Reviewed-on: https://gerrit.instructure.com/207064
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2019-08-28 21:17:01 +00:00
Ryan Shaw e782fb7012 filter non-actionable console logs everywhere else too
I did this first for canvas’s jest tests, but this does it for
karma/qUnit, canvas-rce, canvas-planner and dev mode too.

test plan:
* run `yarn test`
* you should see a lot less react deprecation messages

Change-Id: I5f5cee08d705b749526be87fd79cfc937c015145
Reviewed-on: https://gerrit.instructure.com/206879
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-27 19:54:09 +00:00
Cameron Matheson 883c6d8925 upgrade graphiql
Test plan: graphiql works

flag = none

Change-Id: Ia8bd7100024cab45746a27f370d5423e6c5fa9e6
Reviewed-on: https://gerrit.instructure.com/206853
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-27 15:26:45 +00:00
Ryan Shaw 9d54094803 upgrade @testing-library npm deps
Change-Id: I5438f3895173d4b2b417835c6ac937dc65d160d3
Reviewed-on: https://gerrit.instructure.com/205774
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-27 14:49:48 +00:00
Ryan Shaw 78d5f6094f attempt #2 to try to get master js build working
my last thing fixed it in one spot but it fails in another now

lets see if we just give it more memory if that will work

Change-Id: Ia4a5aef21f3a07ac2d383682de1cfc4fe2d71f73
Reviewed-on: https://gerrit.instructure.com/206869
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-27 00:47:39 +00:00
Ben Nelson ff2055d08e upgrade react-apollo to 3.x.x
closes COMMS-2316

TEST PLAN
-------------------------------
all tests pass

Change-Id: I0c270bb7a8d5dfa166641648841e619a1a21c0f4
Reviewed-on: https://gerrit.instructure.com/206348
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
Tested-by: Jenkins
QA-Review: Ben Nelson <bnelson@instructure.com>
Product-Review: Ben Nelson <bnelson@instructure.com>
2019-08-26 23:28:25 +00:00
Ryan Shaw 60e8c8bbdd Clean up yarn.lock
If you ran yarn on master it would create a dirty yarn.lock

Test plan:
* after this is applied, if you run `yarn` it should not make any
  Changes to yarn.lock

Change-Id: I0303e6e9ca0032771b95497df4b39a3e26e2eed3
Reviewed-on: https://gerrit.instructure.com/206700
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-26 16:31:11 +00:00
Ryan Shaw e91e2340fe upgrade React to 16.9.0
note: this will start logging a lot of deprecation warnings from
React about stuff like componentWillMount and componentWillReceiveProps.
Teams should update their code to not use those things so those
Deprecations go away

Test plan:
* automated builds should pass

Change-Id: I42a340dacdb43d410c7246945c025e0eb83220fa
Reviewed-on: https://gerrit.instructure.com/205772
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-21 23:40:32 +00:00
Ryan Shaw d2a9d5eba7 upgrade immer and immutability-helper npm deps
here are 2->3 changes from immutability-helper
Huge thanks to @jedmao for converting the library to typescript!
New: TypeScript definitions are now generated from TypeScript source. 
meaning they will always be 100% in sync w/ the source code.
New: exported Context class.
Deprecated: stop using const myUpdate = newContext().update and start 
using const myContext = new Context(); myContext.update(...).
Deprecated: stop using update.extend and start using import { extend } 
from 'immutability-helper' or const { extend } = new Context().


test plan:
* the only thing that uses immer is the assignments_2 teacher stuff,
  that should still work
* discussions, gradingPeriods, and the CreateOrUpdateUserModal use
  immutability-helper, those should still all work

Change-Id: If6b62788be5d3929b5a0ddd64e1b63aa09916b84
Reviewed-on: https://gerrit.instructure.com/205773
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-21 16:12:52 +00:00
Ed Schiebel 1b1631c694 Add @instructure/uid dependency to canvas
test plan:
  yarn test:karma builds w/o errors

Change-Id: I631dabdf9214e2d44bedaa4f4ff1451fcc0e76b0
Reviewed-on: https://gerrit.instructure.com/206016
Reviewed-by: Carl Kibler <ckibler@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2019-08-21 16:08:30 +00:00
Ryan Shaw f4e36a93d6 upgrade some NPM dependencies
Change-Id: If2a90959713e292a46c9d5e9c75c89a37f7316b6
Reviewed-on: https://gerrit.instructure.com/205007
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-20 18:30:44 +00:00
Jon Willesen bd060bc291 start of direct share course selection tray
This includes some general utilities

Note: There is a bug in the instui Tray that mounts the contents of the
Tray twice, which results in multiple fetches for the managed courses.
We're going to ignore this for now since the right fix is to fix Tray
and not work around it.

flag=direct_share
refs ADMIN-2811

test plan:
- On the discussions index page, click on the kabob menu for a
  discussion and choose "Copy To...".
- A tray should open and load a list of the courses you are allowed to
  manage. There is no other functionality in the tray yet.

Change-Id: Ic0f5e841f61cd3cdaef7b681db2907089c561665
Reviewed-on: https://gerrit.instructure.com/204331
Tested-by: Jenkins
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
2019-08-20 16:05:09 +00:00
Ryan Shaw c5f62b811b Upgrade @instructure/media-capture and media-player
Test plan:
* use the media capture stuff from the new RCE
* it should look the same but use instUI 6 components

Change-Id: If5e41b75652898c0d2a4d51eedb4fc437d68f7d2
Reviewed-on: https://gerrit.instructure.com/205695
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-20 14:43:06 +00:00
Ryan Shaw bf446dd05f Now that i18nliner can understand it, turn back on fragments
The previous commit makes it so i18nliner can understand <> instead of
<React.Fragment>, so this turns back on the eslint rule we had to turn
Off

Test plan:
* run bin/rake i18n:generate_js (or let the Jenkins builds run)
* it should pass

Change-Id: Ia3204cd6c3147eb52ca612adbb3b20b2df8c6921
Reviewed-on: https://gerrit.instructure.com/205378
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-20 14:06:41 +00:00
Ryan Shaw 1d199b5e2f upgrade eslint & don’t use unique one in canvas-rce
instead of having our own eslint in canvas-rce, and maintaining all
future rules like react hooks and stuff we can just use the same one
that the rest of the repo uses.

test plan:
* cd packages/canvas-rce
* `yarn lint` should run

Change-Id: Idbe8af533f7a19035d1998538d2d6fd1a711f164
Reviewed-on: https://gerrit.instructure.com/204998
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-08-15 17:17:30 +00:00
Cameron Matheson 40b5c13a29 minor apollo update: take 2
Test plan:
  specs pass

flag = none

Change-Id: I8e816e4ff46148b586037aa2b6eb36b9e50a958f
Reviewed-on: https://gerrit.instructure.com/205109
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-14 22:13:15 +00:00
Ryan Shaw ebaf3a0951 Revert "minor apollo update"
whoops, I didn't notice that this was dependent on something
that is not merged yet. I had some stuff that depended on this
so I too-eargly merged it. I'll revert it until we get the
validated apollo stuff figured out

This reverts commit 27b6085218.

Change-Id: Ib6439daa8f26663ecd473bb4bb71f8dda2231eec
Reviewed-on: https://gerrit.instructure.com/205000
Reviewed-by: James Williams <jamesw@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-08-14 13:43:55 +00:00
Cameron Matheson 27b6085218 minor apollo update
we need to get on an up to date version, but this at least fixes some
bugs i was running into while writing specs for GQL-60

Test plan:
  * pages using graphql still work (assignments2, gradebook, context
    cards)

flag = none

Change-Id: I4b384c3724fc843132c9db34f044cd88aba227bb
Reviewed-on: https://gerrit.instructure.com/204276
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-14 01:38:07 +00:00
Ed Schiebel 6ccad53796 return focus to the status bar buttons
when the kb shortcut dialog or the a11y checker tray close,
return focus to the button that opened it.

closes COREFE-108

test plan:
  - in rce, click on the kb short cutton in the status bar
  - close the kb shortcut dialog
  > expect focus to return to the button
  - repeat for the a11y checker
  - tab until the show-on-focus kb shortcut button above the RCE
    appears, click it, then close the dialog
  > expect focus to return to the button

Change-Id: I27ea79930e643d9908a784fbcb89900918d3be01
Reviewed-on: https://gerrit.instructure.com/204283
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-08-13 16:06:49 +00:00
Ryan Shaw 34f9a944f3 Don’t include regenerator-runtime on account settings
`axios-cache-adapter`’s “browser” field in package.json says to use
A “dist” file that is prebuilt with webpack to handle old browsers
(github.com/RasCarlito/axios-cache-adapter/blob/master/dist/cache.js)
That means it has a copy of `regenerator-runtime` in it for the async
functions it uses. That is wasteful and is bytes that our users 
shouldn’t need to download.

Test plan:
* the CSP stuff on the account settings page should work the same
* but the webpack js bundle should be smaller

Change-Id: I671f2eb60b57c43e002b9a62fd92feb5c96cd00b
Reviewed-on: https://gerrit.instructure.com/204252
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-09 16:57:43 +00:00
Ryan Shaw 644e5bb4f1 rename canvas-supported-browsers to browserslist-config-canvas-lms
this is to get it to work with how browserslist/autoprefixer/babel/
@instructure/ui-babel-preset expect things to work.

We had to change the name because 
https://github.com/browserslist/browserslist#shareable-configs
Says:
For security reasons, external configuration only supports packages that
have the browserslist-config- prefix. npm scoped packages are also 
supported, by naming or prefixing the module with 
@scope/browserslist-config, such as @scope/browserslist-config or 
@scope/browserslist-config-mycompany

And we have to add:
"browserslist": ["extends @instructure/browserslist-config-canvas-lms"],
to all of our package.jsons that use @instructure/ui-babel-preset 
because that by default will use 
"extends @instructure/browserslist-config-instructure—ui" which would
still do all the stuff for IE11

Test plan:
* run `yarn`
* all those errors about browserslist and postcss should not show uo

* look at the code in public/dist for canvas-planner,
* It should not include regenerator-runtime and you should see native
  `async` functions

Change-Id: Ic84c13ac59d58963c12b8365b3068b5da3ee618d
Reviewed-on: https://gerrit.instructure.com/204251
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-08 20:12:31 +00:00
Ryan Shaw d00f74a2d7 Drop IE 11 support
closes: CORE-3175

based on our browser support documentation
(https://community.canvaslms.com/docs/doc-10720) "On August 3, 2019,
Internet Explorer 11 will no longer be supported as a Canvas browser."

and since any code being merged to master now won't hit prod until after
august 3rd, we can safely drop IE11 support now

test plan:
* look at the code generated by webpack
* you should see things like "class" and arrow functions "() => {}"
* if you go to canvas in IE 11, it should not work
* if you go to canvas in the next oldest browsers we support (which
  would probably be Edge 42 or Safari 11) it should still work the same
  as it did before

Change-Id: Ifc7f64902a333fd0f662ff6a68eb8f4353f01130
Reviewed-on: https://gerrit.instructure.com/197827
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-07 14:40:40 +00:00
Ed Schiebel 7e41826748 fix <Select> deprecation in NewCourseModal
Replace Select with CanvasSelect
Replace legacy TextInput with the new TextInput

fixes ADMIN-2771

test plan:
  - go to account courses page, /accounts/self
  - click the "+Course" button
  > expect the 2 TextInputs to accept input
  > expect the subaccount and term selects to work as expected
  > expect some nice screenreader messages as you interact with the
    selects
  > expect the course to be created with the right data
    when clicking on the "Add Course" button
  - try it again, but do something to make it fail (I set a breakpoint
    at courses_controller.rb line 791 and set @course=nil)
  > expect to get an error flash message
  - click on the "details" button
  > expect the details popup to be above the Modal's overlay and you
    can dismiss it.

Change-Id: I8612b086a8812660c82c9d243746ed211deb5a59
Reviewed-on: https://gerrit.instructure.com/202575
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-08-06 17:23:46 +00:00
Ryan Shaw f0858936ab Backport instUI fix to allow themeable w/ `class`es
We made this change in @instructure/ui-themeable in g/203714
but that is for the current master on instUI 6, we need it now even
though we are still on instUI 5 so this will back port it in so we can
use it now.

Test plan:
* Things that use `themeable` should work both with and without the
  “Drop ie11” commit applied.

Specifically:
bin/rspec ./spec/selenium/dashboard/planner/student_planner_assignments_spec.rb:88
Should not fail with
TypeError: Class constructor Yr cannot be invoked without 'new'

Change-Id: I7ef8ef9eda1057badabbb08fcdd6875ad8064e89
Reviewed-on: https://gerrit.instructure.com/203950
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-06 16:07:55 +00:00
Ryan Shaw 10a4516082 Use jsdom 14 instead of 11 in jest tests
Test plan:
* `yarn jest` should pass

Change-Id: I157a55be009bae71e574ed0e9b9ff18f9e2c048b
Reviewed-on: https://gerrit.instructure.com/203860
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-05 20:36:16 +00:00
Ed Schiebel 28ea3000ef Fix Select deprecations with CanvaSelect
this commit add the new CanvasSelect which wraps the new controlled-only
INSTUI Select (single select only) to provide a nearly drop-in
replacement for the deprecated INSTUI Select used in canvas.

This new CanvasSelect is then used in people_search.js and
TimeZoneSelect/index.js to resolve the
deprectation warnings.

changes include an upgrade to ui-select 6.8

closes ADMIN-2775, COREFE-186 COREFE-184

test plan:
  - nav to a course's people page
  - click on the +People button
  > expect the Role and Section selects to work as expected
  - nav to the account's people page
  - click on the pencil icon to the right of a user
  > expect the Time Zone select to show a blank line, then 2 groups
    of time zones
  > expect the select to work as expected
  > expect screenreaders to tell you interesting things as you
    interact with the select

Change-Id: I5dcfb2c1c8ca64071ce9dbf0a194777f10c711cf
Reviewed-on: https://gerrit.instructure.com/202508
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-08-05 19:30:43 +00:00
Ryan Shaw 8ae3033745 Update testing-library to use packages w/ @scoped names
See: 
github.com/testing-library/dom-testing-library/releases/tag/v4.0.0
For the reason behind why the specs had to change to findAllByText

Test plan:
* js tests should pass

Change-Id: Idc5b217a0923cf7d702f94dfd4f3393beaa14a19
Reviewed-on: https://gerrit.instructure.com/202009
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-07-22 16:26:15 +00:00
Landon Gilbert-Bland ea769fb488 New mocking foundation for A2 student view tests
Utilizing https://www.apollographql.com/docs/graphql-tools/mocking/

Benefits of this new approach:
  - Query, propTypes, and mocked data all exist in the same location, so
    it becomes much easier to modify.
  - You can easily mock data nested deeply in data without needing to
    manually drill down into it.
  - The mocked data comes from a FRD graphql query, so you cannot
    accidently put invalid fields into the testing data (for example,
    null for a string that is marked as not null).
  - Can save complex overrides into reusable pieces (graded submission)

Fixes COMMS-2224

Test Plan:
  - Jenkins passes

Change-Id: Ib6c3c6f3b3c16b8829d89061b41d8a4d308eb0ed
Reviewed-on: https://gerrit.instructure.com/201591
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
2019-07-20 23:53:11 +00:00
Ryan Shaw 772d1f6994 don’t count unread_count or dashcard indicators against newRelic load time
closes: CORE-3187

AKA:
Revert "Revert "don’t count unread_count or dashcard indicators 
against newRelic load time""

This reverts commit d754ff5ed1.

Test plan:
* the little badges that show unread discussion counts and stuff
  on each dashcard should work the same as before
* the badge on the global nav that shows how many unread inbox messages
  You have should work the same as before
  * if you have newRelic set up, neither should count against page load
  metrics

Change-Id: I3b869e7fb650f40f16f514db9d8b9f558443db5b
Reviewed-on: https://gerrit.instructure.com/201202
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-07-16 20:38:06 +00:00
gbeckmann d754ff5ed1 Revert "don’t count unread_count or dashcard indicators against newRelic load time"
This reverts commit aa977ecd2a.

Reverting based on belief that this is surfacing errors in the build:

"something went wrong updating unread count" TypeError: Failed to fetch

Change-Id: I842ad732d75c6ca83f31e140ddf5edb6f10e45fe
Reviewed-on: https://gerrit.instructure.com/201108
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2019-07-13 01:06:56 +00:00
Ryan Shaw aa977ecd2a don’t count unread_count or dashcard indicators against newRelic load time
closes: CORE-3084

Test plan:
* the little badges that show unread discussion counts and stuff
  on each dashcard should work the same as before
* the badge on the global nav that shows how many unread inbox messages
  You have should work the same as before
* if you have newRelic set up, neither should count against page load
  metrics

Change-Id: I03f81c30223355ce3e1a2632ba17bfd6f1ae658f
Reviewed-on: https://gerrit.instructure.com/197823
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-07-11 22:09:37 +00:00
Ed Schiebel 5e5120e566 Give RCEWrapper onFocus/onBlur handlers
closes ADMIN-2742

there are challanges
- RCEWrapper keeps track of whether it has focus. This is true if
  anything w/in its outermost div is the activeElement
- since the previously active element blurs
  before the new element becomes active. we need a timeout to wait and
  see where focus lands. this is true when:
  - focus moves to a tinymce popup, like a menu
  - focus moves to one of RCE's dialogs or trays
  - the user interacts with content in the CanvasContentTray. This
    is because a new instance of the CCT is created every time it
    renders as the user interacts with it. (An artifact of how it's
    wired into redux).

This also addresses a bug where the html-view textarea was the wrong
size when flipping between rich text and html views.

NOTE: if you close any of the Trays or Modals by typing "esc", it will
blur the RCE. This is a known bug that I'm hoping will be fixed
via INSTUi-2201. If not, then via another CORE ticket

test plan:
  - not necessary, but if you test in assignments2, you'll know it's
    working because the RCE will go away if it loses focus,
    so enable assignments2, create an assignment, then
    edit the assignment (you can't create an a2 assignment yet)
  - insert and edit an external link
  - insert and edit a course image
  - upload an image
  - insert and edit a course document
  - upload a document
  > in each case, expect focus to return to the RCE, and if applicable,
    the yellow indicator box is correctly positioned.
  - in any of the above cases, click on the yellow indicator while it's
    visible
  > expect focus to stay w/in the rce

  resizing:
  - click the "switch to html view" button
  > expect the textarea to fill the avaiable space
  - resize it and click the button to switch back
  > expect the rce to be the same (or really close) size

Change-Id: If85c5644558fbce27530e43bb71c2bdb7e91eb12
Reviewed-on: https://gerrit.instructure.com/199273
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-07-05 21:22:37 +00:00
Aaron Griffin 840cf27953 Support i18n numbers on quizzes edit page
Test Plan:
- Given a quiz in a locale with different number formatting
- Change the points of a question to '1234.5' in that locale
- See it accept and format points correctly on the question and the
  header

Closes QO-442

Change-Id: I75c353716718377bb26c1088a4db58aaa7c8f721
Reviewed-on: https://gerrit.instructure.com/198543
Tested-by: Jenkins
Reviewed-by: Jonathan Holt <jholt@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Kevin Dougherty III <jdougherty@instructure.com>
2019-06-27 18:05:20 +00:00
Jon Willesen debef8b978 add react-hooks linting and update react dep
Update the react dependency to 16.8 since we're starting to use react
hooks, which requires that version at minimum.

test plan:
- linting still works
- intentionally create a violation of rules-of-hooks. Linting should
  find and report the error.

Change-Id: I0baccd64397b31118b96eb390462acf56daeca96
Reviewed-on: https://gerrit.instructure.com/199053
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2019-06-26 16:24:49 +00:00
Clay Diffrient 71eb30a096 Update @instructure/canvas-rce-old to 4.1.4
closes CORE-3097

Test Plan:
  - Languages work properly on RCE

Change-Id: I35e0d913ddd229dc2bcd605c2c7ffc0ed2a65a80
Reviewed-on: https://gerrit.instructure.com/198643
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Jenkins
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-06-21 20:42:02 +00:00
Clay Diffrient 23050ed475 Update to @instructure/canvas-rce-old@4.1.3
closes CORE-3097

Test Plan:
  - Automated tests pass

Change-Id: If618a2f1c01ab221b74991134b3d91150b557afc
Reviewed-on: https://gerrit.instructure.com/198528
Tested-by: Jenkins
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
2019-06-20 22:25:51 +00:00
Cameron Matheson a6faeedf7f upgrade graphiql-explorer
Change-Id: Ie853ea9bbf0dbdbf58b0f0e572ff129ec6922577
Reviewed-on: https://gerrit.instructure.com/196594
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-06-05 20:06:06 +00:00