Commit Graph

537 Commits

Author SHA1 Message Date
Ryan Shaw eeb7e37fcf Update instUI from 6.14.0 to 6.15.0
Test plan:
* automated tests should pass
* check this changelog https://instructure.design/#CHANGELOG
  and see if you can see anything that might have broke

Change-Id: I97024e87d5e8af6715b68da7010da140af049335
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218787
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-12-02 17:11:49 +00:00
Ed Schiebel d91b3240e3 Update yarn.lock
whenever canvas-lms is updated, we get a new yarn.lock with a
subtly different node-sass entry. Let's finally check it in

closes: LA-243

test plan: n/a

Change-Id: I76de33c59aef5380d85df290132be86fac8b2660
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218133
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-11-21 16:05:43 +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
Ed Schiebel df0c660ada Better state handling in Media Upload modal
- depends on COREFE-325
- remember values in each tab when user changes tabs
- disable Submit button when current tab does not have complete data

closes LA-106
AKA COREFE-376

test plan:
  - open a page with the RCE
  - click on media > Upload/Record Media toolbar item
  > expect the Submit button to be disabled
  - select a file in the computer tab
  > expect the Submit button to be enabled
  - switch to the Embed Tab
  > expect the Submit button to be disabled
  - enter text in the embed code textarea
  > expect the Submit button to be enabled
  - switch among the tabs
  > expect the Computer and Embed
    Tabs to retain their data (subtitles are not
    retained in the computer tab and recorded video is
    not retained in the record tab. see COREFE-377)
  > expect the submit button to be enabled where there is
    data
  > expect clicking Submit to do insert the corresponding
    media into the rce

Change-Id: I6833bb99f66ef7e4b738531dd34d4411b54d2dd2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/214263
Reviewed-by: Carl Kibler <ckibler@instructure.com>
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-11-11 22:06:57 +00:00
Ryan Shaw 3f095beddd Don’t wait for window.load if jQuery is loaded after domready
See https://github.com/ryankshaw/jquery/commit/3a48a84c for the
Actual changes

If this jQuery code was initialized after the DOMContentLoaded event
But before the window.load event, it would wait until the window.load
Fallback to run everything that was using $.ready() (aka $(fn))

this change make it so it executes all those callbacks now instead
Of waiting for window.load

Test plan:
* turn streaming on
* profile a page
* you should notice that jQuery is initialized as part of main.js
  Sometime after DOMContentLoaded
* but you should see all the callbacks run then instead of after the 
  Window.load event

Change-Id: Ie75f3475f21ac9e7f7503c91e9c5d5700ff28b11
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/215873
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
2019-11-07 00:08:24 +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
Ed Schiebel 82f3603f95 Add Embed tab to Upload Media modal
closes LA-109
formerly COREFE-325

test plan:
  - load up the RCE
  - click on Media > Upload/Record medoa
  - select the Embed tab
  - enter some embed code in the textarea
    I copied this from youtube:
<iframe width="560" height="315" src="https://www.youtube.com/embed/Nuzi7LlSDVo"
frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
  > expect the Jon Oliver video in the RCE
  > expect the yellow box highlighting the video to be the right size
  - you can actually put anything in the textarea and it will show up in
    the RCE, as if you typed it in the HTML view. You should test typing
    in the textarea too, since there is some bad interaction between
    the TextArea and the Tabs I worked around.

Change-Id: I3225ae192ca054becb03f570e34d30817c06faec
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/211690
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-11-05 19:23:53 +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
Ryan Shaw 7c49462fe7 Remove jQuery dead code now that $.support is hardcoded
closes: COREFE-387

See this for the actual changes:
https://github.com/ryankshaw/jquery/commit/1529762158a452fecdeb31b826

Test plan:
* jQuery should work the same but the main bundle should be smaller

Change-Id: I246a34ee67e4c90caef5a9dc99ca87f58baa757d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/214806
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-10-28 15:33:25 +00:00
Ryan Shaw dfdd9382b3 upgrade instUI from 6.13.0 to 6.14.0
closes: COREFE-365

this version of InstUI no longer appends the data-cid attributes from
instUI's testable when NODE_ENV===production. that is because it slows
things down in produciton. and since our selenium build runs with
NODE_ENV=production when it runs webpack we can't use those in our
selenium tests. you need to use semantic stuff or data-test-ids or
something else to find things instead.

test plan:
* automated tests should pass

Change-Id: Id346d6c4e25d8b7b148ebf9ad9fd09cbab6e7dfb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/213301
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-10-18 16:54:09 +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
Ryan Shaw a8073a5124 Update MediaElement to get faster pointerEvent check
test plan:
* see the commit msg from the pull request
  https://github.com/instructure/mediaelement/pull/52
* that forced RecalculateStyle should not happen anymore
* media element should work the same as before

Change-Id: I779d9aa193841bfe6e6f27004c3e0c85e0b734ea
Reviewed-on: https://gerrit.instructure.com/213061
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-10-15 17:15:48 +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
Ryan Shaw 96dc07a4cf upgrade all the npm things
In a future commit, we need to see why the tests in CanvasContentTray
In canvas-rce are so brittle and fix them

Change-Id: I890f47a0cae2758f2f91a3366066fe409c5ce056
Reviewed-on: https://gerrit.instructure.com/211956
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-10-03 20:15:31 +00:00
Ryan Shaw b44cbc5d47 Upgrade react
Change-Id: Ibd390abf8ee503aa120f5d72dcf8b9c500e7c919
Reviewed-on: https://gerrit.instructure.com/211955
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-10-03 19:59:21 +00:00
Ryan Shaw 98517b0d51 Upgrade InstUI 6.12.0 to 6.13.0
Change-Id: Ice3b1f6477586b1021651225fa0fcb8d64d9c3df
Reviewed-on: https://gerrit.instructure.com/211954
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-10-03 19:58:56 +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 a159af4d52 Fix analytics pagination caused by jQuery bug
Fixes: ADMIN-2950

See: https://github.com/ryankshaw/jquery/commit/637babee7ed47a532c962d
For the actual fix

Test plan:
* root cause check:
Open your browser devtools:
Type: $(window).is(':hidden')
That should return `false` and not throw this error:
Uncaught TypeError: Cannot read property 'defaultView' of undefined

Type: $(window).is(':visible')
That should return `true` and not throw this error:
Uncaught TypeError: Cannot read property 'defaultView' of undefined

Manual check for the jira
 - have analytics plugin configured
 - have more than 10 students enrolled in a course
 - scroll down in course analytics
 - students beyond the first 10 should appear as you scroll

Change-Id: I0e6e3ae2f8b5758f02611273018b751b9e20f758
Reviewed-on: https://gerrit.instructure.com/211192
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-09-26 21:55:37 +00:00
Clay Diffrient e596520374 Add filtering to the LTI app modal
Test Plan:
  - Go to the RCE and click the plug toolbar icon
  	- This won't appear if you don't have some
          tools installed
  - The LTI tool window should appear
  - Search for items in the search box and it will
    filter to them.

closes COREFE-254

flag = rce_enhancements

Change-Id: Ifc9844f4a2db21b7217c3df615d0c478faa28806
Reviewed-on: https://gerrit.instructure.com/210331
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Lauren Williams <lcwilliams@instructure.com>
2019-09-25 19:00:35 +00:00
Ryan Shaw 3df20d6c5d Upgrade instUI from 6.10.0 to 6.12.0
Closes: COREFE-301

Test plan:
* all the instUI things should still work
* specifically check to make sure that bowser is no longer in prod build
  And that objectSpread thing is fixed so it uses babel helpers

Change-Id: Ie30edddba6ff7c9f37852ea13a65dddc42f93d65
Reviewed-on: https://gerrit.instructure.com/209745
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-09-24 18:44:22 +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 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
Ed Schiebel bd2211f35d User and Course Images
closes COREFE-203

Adds ability for a teacher to switch between course and user files.
Changes the images query logic to piggyback on the /documents api
so docuents, media, and images will all share the same query logic

test plan:
  - have a course with some images
  - have a teacher and a student with personal images

  - go to the course as a teacher
  > expect rce images toolbar button menus to
    show Upload, Course images, and My images
  - upload an image
  > expect it to succeed
  > expect the new image to appear in the Course images
    tray
  > expect the images to appear in the course's upload media  folder

  - select My Images from the toolbar menu
  > expect my Images to be shown in the tray
  - use the filter to switch to Course Images
  > expect course Images to be shown in the tray
  - repeat, starting with Course Images and flipping to My Images

  - go to the course as a student
  > expect rce Images toolbar button menus to
    show Upload and My Images
  - upload Image(s)
  > expect it to succeed
  > expect the new imsges to appear in the user's file page's
    My Files (/files).
  > do NOT expect the imsges to show up in the course's Files page
    (/courses/:id/files)
  - click on Images > My Images
  > expect to see Links and My Images in the top select of the tray
  > do NOT expect to see the Course Files option in tray

Change-Id: If7f4e6b6f90b445e497be81b9cb940da71a8cf74
Reviewed-on: https://gerrit.instructure.com/206788
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-09-05 15:28:54 +00:00
Ryan Shaw f29990694b one more update to all the npm things
Just making sure there’s not something fixed in a package we use
That could help with build flakiness

Test plan:
* builds should pass

Change-Id: I67d738063dd1170612846673623455b7c62f71d5
Reviewed-on: https://gerrit.instructure.com/207712
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 21:52:59 +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
James Butters 1f73f600a2 spec: add html results for i18n gem
add cleanup for spec_results folder on nodes.
add jasmine-pretty-html-reporter to get html reports
for i18n tests.

refs: CORE-3254

Change-Id: Ifa1724e368c5c91dc69e854ae98a1a13abe33aa0
Reviewed-on: https://gerrit.instructure.com/207203
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-08-29 18:58:13 +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
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
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
Jeremy Neander 62c92a2264 allow custom sizes of images
closes CORE-2654

Testing Notes:
 * Max dimensions per size are as follows
    * Small: 200 x 200px
    * Medium: 320 x 320px
    * Large: 400 x 400px
    * Extra Large: 640 x 640px
 * Images must be at least 10 x 10px

test plan:
 1. Add an image to TinyMCE
 2. Select the image
 3. Click the "Options" button in the popover

 4. For each of the preset sizes:
    a. Select the size
    b. Click the Done button
    c. Verify the image fits that size

 5. For the Custom size:
    a. Enter a width
    b. Verify the height maintains the aspect ratio
    c. Enter a height
    d. Verify the width maintains the aspect ratio
    e. Verify the image cannot be saved when:
       * The image is too small
       * The dimensions are not numbers

  6. Integration with tinymce
    a. add an image
    b. click in it, then on the Options button
       to open the tray
    c. resize and click Done
    e. Verify the Options button/toolbar realigns
       itself with the newly sized image

Change-Id: I1c1456b33c355d2d17a5430cd3d6d1687ff6ecdc
Reviewed-on: https://gerrit.instructure.com/198540
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Jenkins
2019-08-24 18:42:10 +00:00
Ryan Shaw d631de2f21 Update the rest of the npm deps
This is the rest of the npm deps except for the ones we know we have to
hold back like the graphql/apollo stuff and canvas-rce’s tinymce

Test plan:
* builds should pass

Change-Id: I985cf8915540af8377d5b83bb3c114a58ccfce4d
Reviewed-on: https://gerrit.instructure.com/206060
Tested-by: Jenkins
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-22 20:30:30 +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 088d703b08 upgrade rest of npm deps
Change-Id: Iec484ae47eae9eb56a1e11e1f749385925e4fb30
Reviewed-on: https://gerrit.instructure.com/205775
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-21 16:40:54 +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
Ed Schiebel cd4a8e834d Update yarn.lock
the entry to ui-focusable unexpectedly changed.

Change-Id: Iba491ab95d415d5bb37677da8ebeae9aeb36dffc
Reviewed-on: https://gerrit.instructure.com/205624
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-19 20:07:48 +00:00
Ryan Shaw 0bf6e0d5be Make it so i18nliner understands React fragments
This also upgrades it to babel 7 so it should be able to handle other
Modern features that it used to not.

I will try to get jon to merge the pull request for this
https://github.com/jenseng/i18nliner-js/pull/27
And use the official version but for now we can just use it directly
From my pull request branch.


Test plan:
* with the next commit applied (which changes all the <Fragment>s to <>)
* Run bin/rake i18n:generate_js
* It should work

Change-Id: I2752ff4c18c8e71b8b0530e0572596fa7da9ea8e
Reviewed-on: https://gerrit.instructure.com/205377
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-15 22:26:11 +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
Steven Burnett 1f7bf02c4d add canvas media package
fixes COMMS-2290
flag Assignments 2

Test Plan:
- create a media upload assignment
- in a2 as a sutdent go submit an assignment
- notice a video upload button
- click button
- notice the modal is shown and you can drag and drop video files
  or record yourself
- close modal
- notice no console errors or crashes

Change-Id: I9a6184efb99aa05d0d634d2744cca00abf5ae26e
Reviewed-on: https://gerrit.instructure.com/204375
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
2019-08-13 20:17:06 +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 f847258802 canvas-planner: upgrade to instUI 6
Change-Id: I60ae49a1a913d0aaffa3891077b051bdbea6fb6b
Reviewed-on: https://gerrit.instructure.com/204307
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-08 23:10:29 +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 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
Ed Schiebel 62ebbad0ae Upgrade instui to 6.8.1 for canvas-rce
closes COREFE-193

test plan:
  - the RCE still works and the tests pass
  - in particular, be sure trays and dialogs open (this was
    broken by instui 6.8.0)

Change-Id: Ic4bc52686adbe1ae182f706e2146d7cae57ffb98
Reviewed-on: https://gerrit.instructure.com/203461
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-05 19:30:20 +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
Clay Diffrient 63be4cd220 Update canvas-rce InstUI to 6.7
Change-Id: I7b49f95daa7b2ee74ccc11cdf99d8c663bf6995c
Reviewed-on: https://gerrit.instructure.com/201497
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-07-19 15:25:44 +00:00
Ryan Shaw 98d92f1871 Upgrade more NPM things
Test plan:
* automated tests should pass

Change-Id: Iedbf82c5addaa0842b1bb83f9baa71dbcf6e3d55
Reviewed-on: https://gerrit.instructure.com/201476
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-07-18 22:58:11 +00:00
Ryan Shaw ebf684c78a Upgrade all the NPM things
Test plan:
* automated tests should pass

Change-Id: Idb126e0a80bceb948862d4d0a504af2340520aaf
Reviewed-on: https://gerrit.instructure.com/201213
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-17 16:00:20 +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
Ryan Norton 860330679f update media-capture version to 5.53.2
Change-Id: Ic0de0de029931c450ec69f0de8b29a0ada2f24a4
Reviewed-on: https://gerrit.instructure.com/200182
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-07-05 15:55: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
Ryan Shaw ece2a5cc71 Don’t use special eslint for canvas-planner
…instead, just use the default config for the rest of the repo

Test plan:
* cd packages/canvas-planner
* yarn eslint src/components/BadgeList/index.js
* you should not see an error about not being able to find flowtype

Change-Id: I48c4ab3ac20a60352c20c489addb4d4b4a32e83a
Reviewed-on: https://gerrit.instructure.com/199060
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2019-06-25 22:22:12 +00:00
Clay Diffrient 3664d5ddea Update yarn.lock to have 6.4 version of pagination
Test Plan:
  - Automated tests pass

Change-Id: I0776d792e5c8befbc60e1b99f112fc90dab5e463
Reviewed-on: https://gerrit.instructure.com/199008
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-25 20:33:49 +00:00
Ryan Shaw c0f8191be8 Upgrade the instUI used by new canvas-rce to 6.4.0
Closes: CORE-3076

Test plan:
* verify that the “View with the focused prop” mentioned in the jira
  ticket is in this release

Change-Id: Ic0d1763d408341ac395f9b23c61b381c6ae59cda
Reviewed-on: https://gerrit.instructure.com/198067
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-06-21 23:14:36 +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
Mysti Lilla 6dc10e6aa5 Clean duplicate in yarn.lock
Change-Id: Ic9d137ae766faa72b84d1b0eeda26c12b60ff163
Reviewed-on: https://gerrit.instructure.com/198492
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
2019-06-20 22:15:49 +00:00
Jon Willesen ad896b2d71 rce: hook up the a11y checker button
This requires an update to the tinymce-a11y-checker package for it to
actually work.

closes CORE-2638

test plan:
- click the a11y checker button in the rce status bar
- the a11y checker tray should open up and run

Change-Id: Ic5afc94e14869e58976e67ba71023ccbc4347f5e
Reviewed-on: https://gerrit.instructure.com/197336
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-06-19 20:15:23 +00:00
Clay Diffrient f8711628fc UploadImage: Unsplash Panel
refs CORE-2626

Test Plan:
  - Start RCE API using the proper ENV variables, I can provide
    those upon request
  - Go to the Upload Image dialog
  - Click the Unsplash Panel
  - Type in a search phrase
  - You should be able to do a search and get results back
  - NOTE: At this point, you can't select an image and have
    it be inserted into the RCE

Change-Id: I06832be6ef1c2e299c531c68a8d34782c3cebee0
Reviewed-on: https://gerrit.instructure.com/195273
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-06-18 17:37:20 +00:00
Ed Schiebel a690a93c6d Make RCE StatusBar behave like a toolbar
closes CORE-2903

test plan:
  - load a page with the rce
  - TAB into the RCE and into the StatusBar
  > expect right/left arrows to move focus from one button to
    the next.
  > expect focus to cycle back to the other
    end when you go too far
  - tab out of the status bar
  - click one of the buttons to give it focus
  - use the arrow keys again
  > expect focus to move right|left from the starting point
  - give he drag handle focus
  > expect up/down arrows to resize the RCE w/o scrolling the page
  - fire up a screenreader
  > expect the button area of the status bar to be announced as a
    toolbar

Change-Id: I00e5a761ebc25ae784267c57bb5a653b68ccacba
Reviewed-on: https://gerrit.instructure.com/197059
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Jon Willesen <jonw+gerrit@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-06-17 22:12:57 +00:00
Jon Willesen 4e9c702d45 rce: add the resize handle to the status bar
One technical issue was the rce's iframe would swallow mouse events if
the mouse was dragged fast enough to wind up over the iframe before it
was resized. The solution was to temporarily add a div that covers the
window so that iframes won't take over mouse events.

closes CORE-2882

test plan:
- Find the new drag handle in the lower right corner and drag it around.
  The editor should resize vertically.
- Quickly drag into the RCE window. The resize should continue to work
  and not get stuck.

Change-Id: Id915f013737d98f0bf5e2b54a7e856a060d0c7e3
Reviewed-on: https://gerrit.instructure.com/194118
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-06-06 14:54:36 +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
Ryan Shaw 95275abd5d Speed up $.support checks that were for old IE versions
closes: CORE-3020

Doing these feature detections takes my chrome browser on a fast
MacBookPro 21ms. See: https://cl.ly/868790d66a8f

I hate to actually make any changes here but these are all things
That no browser that we support doesn’t support. And getting a flat
21ms boost on every pageload I think might be worth it.

To see the actual changes, look at this commit on GitHub:
https://github.com/ryankshaw/jquery/commit/dadf794ebc4c4dcf94c344dab7d9

Change-Id: I836f0ac19ae234fc789423d833a20b760fd42dc7
Reviewed-on: https://gerrit.instructure.com/195704
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-05-30 17:01:20 +00:00
Brent Burgoyne 401b732170 upgrade tinymce-a11y-checker to v2.1.0
fixes CORE-2505
fixes CORE-1747
fixes CORE-2847

test plan:
- create a new quiz
- enter an image without alt text in the rce
- run the checker, it should find the issue
- go to questions and add one
- enter an image without alt text in the rce
- run the checker, it should find the issue in the correct editor
- add an additional error to the editor
- run the checker, fix the error and click "Apply"
- focus should move to the close icon
- add an image by clicking on a thumbnail in the images sidebar
- run the checker, it should have an alt text filename error for the
  image

Change-Id: I3c81251c0fa11fa0637d59b01ef2b40e670eae01
Reviewed-on: https://gerrit.instructure.com/195733
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-05-30 15:31:54 +00:00
Ryan Shaw 86fdc49c1c make k5uploader work without jQuery
Change-Id: I28a525a9383cb47df10938dd007d6fbe3de221c7
Reviewed-on: https://gerrit.instructure.com/195077
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-05-23 23:54:02 +00:00
Steven Burnett cd3e069919 print canvas-rce errors in linter-js
Change-Id: I95410a3d5fc02fe0d0ad1e16180110d6a7dd32cc
Reviewed-on: https://gerrit.instructure.com/194947
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-05-23 19:41:26 +00:00
Ryan Shaw 6bb548e84c the usual ‘update all the npm things’ commit
test plan:
* automated tests should pass

Change-Id: Iee1572fb9721ac625cf90a2a209675bdd4df12cc
Reviewed-on: https://gerrit.instructure.com/194672
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-05-22 22:50:04 +00:00
Jon Willesen fe5f4b86cd rce: add path and word count to new status bar
This also replaces our old react-tinymce package with the official
@tinymce/tinymce-react package.

closes CORE-2836

test plan:
- typing in the rce should update the word count in the status bar
- the html path of the current cursor position should also be shown in
  the status bar
- generally test all the rce things because of the package replacement

Change-Id: Ibe2b182ff55ba2dc77988dcd4c1865a28667db95
Reviewed-on: https://gerrit.instructure.com/193154
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-05-17 13:27:35 +00:00
Ryan Shaw 3864abfe6d upgrade canvas-rce to instUI 6 and consume it as esModules
closes: CORE-2922 CORE-2951 CORE-2950 CORE-2952

Also, since we are using the new @instructure/ui-icons we can pull
In the latest icons that design wants us to use for the toolbar buttons

test plan:
* canvas-rce build should pass and canvas webpack should consume it
  as a “harmony export”
* check the “text color” button in the toolbar, it should
  Update it’s color to match the color you picked
* the bulleted list icons in the toolbar should use instUI icons
* run `yarn webpack:analyze`, the canvas-rce chunk should be a lot
  Smaller than it was. and everything from @instructure/ui-whatever
  Should be coming from the /es dir.

Change-Id: I13c670bdd174a9bc10aca4a7f9c5bc9208883ac9
Reviewed-on: https://gerrit.instructure.com/192569
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-05-16 20:49:42 +00:00
Ryan Shaw 4944bccb2d upgrade webpack to v4
Closes: CORE-1143

Test plan:
* load canvas in prod mode in a non-English language. Click around
  And make sure everything works
* in prod mode, do a test to compare load time to what’s on beta.
* page load time and js bundle size should be smaller
* click around in the quizzes client apps and the ember grade book
  And make sure those things work

Change-Id: I93c28c4a6d22db95cd1c7e59cd3f5221d46fe1ed
Reviewed-on: https://gerrit.instructure.com/143422
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
2019-05-16 15:59:04 +00:00
Ed Schiebel b9a70dbc11 skin rce using themeable
closes CORE-2630

test plan:
  - does the rce look like the mockup with the default theme?
  - does the rce look like the current custom canvas theme?
  - does the rce look right in high contrast?
  - do all the toolbar buttons work?
  - does kb nav among the toolbar buttons work?
     1. tab between toolbar button groups
     2. arrow between buttons in a group

you may ask "Why am I testing that buttons work?" Because simple changes
like adding a background to a button breaks kb nav.

Change-Id: Ie36335b36ac3a27a0d49314310fe7e338bef411f
Reviewed-on: https://gerrit.instructure.com/192410
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Laura Leavitt <lleavitt@instructure.com>
2019-05-13 17:24:48 +00:00
Ryan Shaw dca7832aeb Move k5uplodaer to /packages
Change-Id: Iee63af909559285316b4cba4bdc1a62ba8fd34a3
Reviewed-on: https://gerrit.instructure.com/192280
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-05-10 18:30:51 +00:00
Jon Willesen 81f7c56011 rce: add testcafe
closes CORE-2895

test plan:
- specs pass

Change-Id: I216436be045c1180c6601f4bf86ad9022dfc60d0
Reviewed-on: https://gerrit.instructure.com/192299
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Jon Willesen <jonw+gerrit@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-05-07 19:38:27 +00:00
Ryan Shaw 3bad0a160b Remove add-module-exports babel plugin & use esModules
Closes: CORE-2868 CORE-2869

This is needed because without
Doing that, our bundle sizes are going to blow up from the things we
Import from InstUI

Test plan:
* the result of a dynamic export will now give you a object grab bag
  That has a “default” property. Not just the thing of whatever the
  “default" export was.
* so to test this, go to some page that does a dynamic import (like
  the dashboard page) and make sure that still works\

* run a prod build
* make sure that translations still work as before

Change-Id: I3dd1b32216052afd5fbc5d6cec40ea18264f65e9
Reviewed-on: https://gerrit.instructure.com/191578
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-05-03 22:49:58 +00:00
Steven Burnett 95474fbf9b add arc media player to canvas
fixes CORE-2871

Test Plan:
- go to a2 student view
- have a video comment added to the submission
- view the comments tab
- notice the new video player

Change-Id: I58a947fb2b5b31dd7fcb1fc63ae582b7e1038201
Reviewed-on: https://gerrit.instructure.com/191671
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-05-02 17:14:40 +00:00
Ryan Shaw cd839b6f90 Revert "Upgrade node-sass since it has fixed bug we needed"
...Because it has NOT fixed the bug we needed it to

Closes: CORE-2817

This reverts commit e7c110f88a.

Test plan:
* open any page in canvas
* in the dev console, type $.flashError(“whatever”)
* the error message that appears should be styled correctly

Change-Id: I748b0f4607f671ba22ec0a38f9422e6179be24ab
Reviewed-on: https://gerrit.instructure.com/191538
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-04-30 21:33:20 +00:00
Ryan Shaw cc1d87dd7b Update yarn.lock
Some things in yarn.lock got out of sync. This fixes that.

Change-Id: Ib9b9415bbca6de1f0c28aa11361fe9740cfaa838
Reviewed-on: https://gerrit.instructure.com/191471
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-04-30 19:39:34 +00:00
Ryan Shaw a4160b13f1 the regular “upgrade all the npm things” commit
Change-Id: Ia0b14f9778847690733edc545f9d405131041d8d
Reviewed-on: https://gerrit.instructure.com/191216
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-04-30 01:36:54 +00:00
Clay Diffrient ca8e9413d5 Add URL modal to the Upload Images plugin
refs CORE-2627

Test Plan:
  - Click images toolbar button
  - Select upload image
  - Click the URL tab panel option
  - A box should allow entering a URL
  - NOTE: It should not submit or embed the URL at this point

Change-Id: Ib1022198a23d291dff990cb0b91cefe163229702
Reviewed-on: https://gerrit.instructure.com/190035
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-04-29 15:48:53 +00:00
Jon Willesen 605fc86ec9 add apollo graphql query validation tools
These tools allow unit tests to validate that the graphql queries being
run using Apollo are valid according to the server's schema. This
includes validating the variables.

This commit includes a fix that the validator found with overrides where
a Section requires a name (String!), but a Group does not (String). To
fix the validation error, we have to have separate names for these
fields and handle the possibility that the group might have a null name.

closes ADMIN-2561

test plan:
- specs pass
- can still display the "Everyone" override (when there are no overrides)
- can still display the "Everyone Else" override

Change-Id: Ic19605e5ee12075e9abb5bb089e0285639957b69
Reviewed-on: https://gerrit.instructure.com/188602
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-04-23 19:51:10 +00:00
Ryan Shaw 25bd35cf79 Load Lato font from google
closes: CORE-2746

THis is an attempt to make loading our Lato font faster for our end
users. From talking to @pam, it is our understanding that at the time
we introduced this, google did not have all the extended latin 
characters, and that is why we served it ourselves.

But now google *does* include the extended latin characters so
it should be fine?

The good thing about loading it from google is that there is more of a
Likelihood that our users will already have this cached.

Also, to be honest, I still think we should just not download a webfont
and rely on system fonts that users already have. But this is my attempt
to try to see if we can make it faster before resorting that. Because I
know design really likes it :)


Test plan:
* the Lato font on pages should show up the same as it did before but
  page
* load speeds should be faster as reported by lighthouse or our real
  user monitoring

Change-Id: Ibcf75c74f569b6b457fe42d3be91cf6006e560fa
Reviewed-on: https://gerrit.instructure.com/188464
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-04-16 21:33:14 +00:00
Ryan Shaw 2d39d8e0a5 update inst-ui to 5.52.1
closes: CORE-2769

test plan:
* automated tests pass

Change-Id: Ie9b502c5eb86c11b95897e655e959d95cd7f67b5
Reviewed-on: https://gerrit.instructure.com/188957
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-04-15 15:39:47 +00:00
Ryan Shaw e28bb762a9 Don’t load sanitize-html in the browser
This approach solves the same xss vulnerability, but by doing it a way
we can guarantee that what we are trying to .html() onto the page is
safe (and not just arbitrary user content) instead of having to load the
_huge_ sanitize-html npm package and all of it’s deps
(like postcss, source-map, htmlparser2, buffer, and a bunch of others)
On the frontend so we can use it to sanitize all the untrusted
data-mathml content.

closes: CORE-2748
refs COMMS-1846

Test Plan:
* Go to the calendar, click on a day to add an event, and click on the
  "More Options" button.

* Switch to the html editor, and add the following:

  <img class='equation_image'
  data-mathml='<img src=x onerror=prompt(document.cookie); />'>

* Save the event. Go back to the calendar and click on the newly saved
  event, and notice that you don't get XSS'd

* Create another event in the calendar, and this time add the
  following via the html editor:

  <img class="equation_image" title="(-\infty,\infty)"
  src="/equation_images/(-%255Cinfty%252C%255Cinfty)"
  alt="Infinities: (-\infty,\infty)"
  data-equation-content="(-\infty,\infty)" />

* Save the event, and load it in the calendar. Notice that it still
  properly displays this mathml image properly.

* Test the same calendar event with a screen reader, and notice that
  it is still accessible

Change-Id: I5fc1e17ecfc8576dfeaffacff8efcb08873bdd5e
Reviewed-on: https://gerrit.instructure.com/188609
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-04-12 20:30:55 +00:00
Ryan Shaw 2b8e4c1c2e don’t include really old timezone data in JS bundle
closes: CORE-2770

we don’t need timezone data from before canvas was created (pre 2011)
or, realistically, 15 years from now. by using this
moment-timezone-data-webpack-plugin we can strip them out of our webpack
bundle and our common vendor JS file will be smaller.

and smaller js bundles = faster page loads

test plan:
* try to think of a compelling reason why we would need to properly
  handle timezone weirdness that is either older than 2011 or more than
  15 years from now
* if you can think of something, then we can’t do this
* run the prod webpack build, the vendor file should be smaller

Change-Id: I1823fb48cc14bc0687f5222d7f4344118825698e
Reviewed-on: https://gerrit.instructure.com/188810
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-04-11 21:32:03 +00:00
Ryan Shaw 72b517b117 add @babel/plugin-transform-react-inline-elements
closes: CORE-2749

Now that we use babel-transform-runtime, we can also do this to improve
performance over the existing React.createElement calls by inlining the
result of what it would have returned.

see https://github.com/facebook/react/issues/3228 for why this improves
runtime perf

so for an example, say you have:
const foo = <div className="bar" style={{color: 'red'}}>The Text</div>

normally babel would transform that to:
var foo = React.createElement("div", {
  className: "bar",
  style: {
    color: 'red'
  }
}, "The Text");


but this will transform it to:
var foo = _jsx("div", {
  className: "bar",
  style: {
    color: 'red'
  }
}, void 0, "The Text");

That React.createElement is a lot more complex and slower at runtime,
This should make things faster at runtime


TEST PLAN:

* bundle sizes should stay the same but js runtime for react “render”ing
  Should be faster in production mode

Change-Id: I075d249b9effd0af1b16b9e35c1ddd27696c6955
Reviewed-on: https://gerrit.instructure.com/188865
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-04-11 21:01:51 +00:00
Clay Diffrient d237c8634d Bump wsrun to the latest version
Test Plan:
  - All workspaces run their tests on jenkins

Change-Id: I66fa941a11cdd6306a27b5a374af88755d593472
Reviewed-on: https://gerrit.instructure.com/188718
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-04-09 14:33:53 +00:00
Jon Willesen e01c5ddf6c A2: search and sort on teacher view students tab
closes ADMIN-2510

test plan:
- on the students tab of teacher view:
- type in the search field, at least 3 characters
  - the search should happen after a short delay and display results
- the name, score, and submission date columns are sortable in ascending
  and descending order
  - sorting causes another load
- enter less than 3 characters in the search field
  - after a short delay, a message should be displayed about needing
    3 characters
- clearing the search field should go back to original search of all
  students

Change-Id: Ibaaeff175089003a4a5fcbb27db32c9510330e25
Reviewed-on: https://gerrit.instructure.com/186995
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-04-05 20:01:08 +00:00
Ryan Shaw 9ddd8269b2 upgrade tinymce to 5.x
Closes: CORE-2599

Test plan:
* with the rce_enhancements feature flag turned off, nothing should 
  change
* turn on the rce_enhancements feature flag
* go to an editor
* it should load without throwing any errors
  - note, you will see some “bomb” icons that we will need to update
    And the formatting/styling of the toolbar will need some work.
    But that is ok for this commit because it is all behind the feature
    Flag and we will get address those in a future commit

Change-Id: If28167731b5b285005143861e19fdb2fc0c34def
Reviewed-on: https://gerrit.instructure.com/187179
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2019-04-05 19:17:03 +00:00
Ryan Shaw ec693f6edb upgrade tinymce-a11y-cheker to work with tinyMCE 5
Closes: CORE-2727 CORE-2728 CORE-2729

This version works with both 5.x and 4.x of tinymce, so it will be fine
To use for both the old code and the new code

Test plan:
* smoke test to make sure that the a11y checker works just like it used
  to
* in my following commit that upgrades to tinymce 5, you should not see
  Errors about the a11y_checker plugin not working with tinymce 5

Change-Id: I220e79a5c5e04fc589d906adde83ab4c7ebb5794
Reviewed-on: https://gerrit.instructure.com/188187
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-04-04 18:19:29 +00:00
Ryan Shaw 4f97c6df56 remove all the legacy RCE code
closes: CORE-2588 CORE-2591

This completely removes the legacy RCE codepath. So you will need to
Have an https://github.com/instructure/canvas-rce-api running to use
sidebar in any Rich Content Editors.

Test plan:
* smoke test to make sure that the editor and sidebar work as it did
  When you had the RCS feature flag on.
* there should not be any more settings or feature flags around turning
  on the RCS service

Change-Id: I1c3e7f5a45eed5e010d8e425ae561e45f739fd3a
Reviewed-on: https://gerrit.instructure.com/186525
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
2019-04-04 18:19:12 +00:00
Ryan Shaw ed46527652 Upgrade to babel 7 & allow any js file to be themeable
closes: CORE-2699 CORE-2700 UIDEV-99

This commit gets canvas-lms itself upgraded to babel 7. To do that we
also had to upgrade jest to v24. We had already got canvas-rce and
canvas-planner on jest24/babel7 but now this gets everything to babel 7.
so you will see a lot of things removed from yarn.lock since we don’t
don’t have to have different versions of everything for babel and jest

The other major thing this does is make it so any JS file in canvas
can become an @instructure/ui-themeable themeable component. This means
you no longer should have to put your css in app/stylesheets for any new
react components that you are writing.

Test plan:
1. Make sure that the perf of `yarn build:js` is on-par with what it was
   before. We pass everything through the themeable babel transform now
   so there is a chance it is slower. If it is majorly slower, we’ll have
   to figure something out.
2. run a production weback build. The common (or any bundle for that
   matter should get output exactly the same as it did before)

things to manually qa check:
* in a NODE_ENV=production enviornment, go to
  /accounts/site_admin/developer_keys
* click the "+ Developer Key" button, it should open the modal.
  (there are selenium tests that do this, but it was one thing that had
  to be fixed to get jenkins to pass)

* on a course that is set up as a master course, click on the thing that
  opens the blueprint courses tray.
* verify that when you click "Associations" and "Sync History" links in
  that tray, that they dynamically load the webpack chunk for the
  modal contents for that thing and then the modal is shown
  (again, there are selenium specs that test that exact thing but it
  is always good to manually test it too)

Change-Id: I802584228962b54480a500f8fe422f45c2dcac4c
Reviewed-on: https://gerrit.instructure.com/183965
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-04-02 14:59:20 +00:00
Clay Diffrient b709adbec9 Bump @instructure/canvas-rce-old to 4.1.2
closes CORE-2712

Test Plan:
  - Automated tests pass

Change-Id: I7ea688ed7fba1212f74676a0f52784e32b80baae
Reviewed-on: https://gerrit.instructure.com/187345
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-03-28 18:40:43 +00:00
Clay Diffrient 2561dd8a2f Switch to using @instructure/canvas-rce-old
closes CORE-2587

Test Plan:
  - Automated tests pass
  - RCE instances work

Change-Id: Ia128443f5929898937848587a83a853e36b5562d
Reviewed-on: https://gerrit.instructure.com/186624
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-03-22 23:11:36 +00:00
Steven Burnett 004ac8108c add media player to submission comments
fixes COMMS-1867

Test Plan:
- In old assignments/submission works flow
  add a couple comments that are either video
  only or audio only
- in A2 as a student visit the comments tab
- notice the videos show up in the new player
  and work as expected

Change-Id: Ibbb87dd6e264fe49431045e3365771b21111134c
Reviewed-on: https://gerrit.instructure.com/185633
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-03-22 16:57:45 +00:00
Ryan Shaw 4b0c45889d update inst-ui
Nothing major here. They just released a couple new versions so while we
are pretty current I want to stay up-to-date

Test plan:
* I am comfortable saying if the builds pass, shipit

Change-Id: I955dce0e74f7b86710f9a5956c12ad5a244a0c21
Reviewed-on: https://gerrit.instructure.com/186130
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-03-20 18:13:10 +00:00
Ryan Shaw b6a26453d8 prevent xss in media element from dfxp captions
Fixes: CORE-2527 

dfxp captions can be used to create an xss attack. so the mediaelement
that the arc team maintains removed that functionality. By pulling in
The new version we prevent the xss attack vector too.

Note: looking at the wording on the page where you can add captions
We have always said:
“Once you have a subtitle track in either the SRT or WebVTT format,
you can upload it here.”
And the api docs say:
“The contents of the track, in SRT or WebVTT format”

So we have never “officially” supported dfxp files.

Test plan:
* prepare a SRT file as explained in SEC-2176
* either upload/record a new video or find a page with one on it already
* try to upload that as a subtitle track to that video
* you should see an “Oops, something went wrong” error.
* if you had malicious TTML/dfxp caption tracks (like something as
  explained in SEC-2176) added to that video, they should not show
  Up as options in the available tracks to show for that video.
  and you should not see the malicious javascript alert like it did
  before

Change-Id: Id55e6b999c209bf8fa505c60aa459d60e9326ee9
Reviewed-on: https://gerrit.instructure.com/184843
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-03-20 17:19:07 +00:00
Steven Burnett 9f8870f23a upgrade proptypes
test plan:
- jenkins passes

Change-Id: If447ae4112622f5cdd2e3533ec4764695b713822
Reviewed-on: https://gerrit.instructure.com/186058
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-03-20 12:31:22 +00:00
Ryan Shaw 1f02d86f68 Upgrade canvas-planner & rce to not use ui-presets
This gets canvas planner and canvas-rce on babel 7, which is a 
prerequisite to canvas doing the same. Also, by not depending on the
Kitchen sink of ui-presets, it cleans a ton of unused stuff from our
node_modules/yarn.lock. It was originally 2 different commits but
in order to get the yarn.lock right, we have to do them all as one.

This also made it so we needed to have less “resolutions” in our
package.json since the newer versions of those things work fine with
the newer version of babel

So there are 2 test plan areas:

1. Canvas-planner
Closes:  CORE-2575

Test plan:
* smoke test to make sure everything in canvas-planner still works/looks
  like it used to in the canvas ui
* make sure the translation task (yarn check-transifex) still works

canvas-rce: upgrade to babel 7 & @instructure/ui-babel-preset

2. canvas-rce
Closes: CORE-2576

Test plan:
* smoke test the RCE editor
  * theming should still work/look exactly as before
* make sure all the various build tasks (eg yarn test, test:coverage,
  debug, lint, extract, etc) all still work as before

Change-Id: Id896687e3905f4df4627b181cad3f67ffe4417a5
Reviewed-on: https://gerrit.instructure.com/183877
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-03-18 20:48:42 +00:00
Ryan Shaw 851fda89a4 upgrade react to latest version
Change-Id: I5ddef17ef739bdd0b9afbe422447cb68de38aff5
Reviewed-on: https://gerrit.instructure.com/185275
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-03-18 15:53:54 +00:00
Ryan Shaw 06f33590e8 upgrade instUI to 5.46.1
Closes: CORE-2560 CORE-2569

Refs: ADMIN-2453

Test plan:
* general spot check to make sure things look the same
  (Specifically check the publish/unpublish button on the modules page)
* verify that the total size of the vendor & common production webpack
  bundles is smaller

Change-Id: I734e9723917c14778cdc5fc4e22dcd1011b5e77e
Reviewed-on: https://gerrit.instructure.com/184911
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-03-13 22:23:51 +00:00
Jeremy Neander 47d2b83f9f update qs dependency
test plan:
 * Verify Jenkins passes?

Change-Id: If472d2f898e4241d0d10dfd7f1ca5094ecf9d811
Reviewed-on: https://gerrit.instructure.com/184039
Tested-by: Jenkins
Reviewed-by: KC Naegle <knaegle@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
2019-03-06 19:07:48 +00:00
Ryan Shaw e7c110f88a Upgrade node-sass since it has fixed bug we needed
Since node-sass has fixed the bug that was causing this issue, we can
let it upgrade like normal and don’t need to pin it to a specific
version.

refs: SIS-3125, COMMS-1328
Also see: g/157921


Test plan:

QA:
* go to courses/x/assignments
* add a new assignment group
* the green little notification that appears should be styled correctly,
  Exactly as before

DEV:
* ensure that the output from this code in g_instructure.scss:
  …
  li:not(.ic-flash-info, .ic-flash-success, .ic-flash-warning, .ic-flash-error) {
    …

doesn’t erroneously get output as:
  ...
}

Change-Id: I0bd7a42ee4026faea7327270df7413036f77c809
Reviewed-on: https://gerrit.instructure.com/183688
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
2019-03-05 22:44:07 +00:00
Ed Schiebel 984088748f Update assignment as it's edited
closes ADMIN-2343

test plan:
  - load an assignment in the A2 teacher view, add #edit to the url and
    refresh the page
  - change each field on the page (modules, group, name, points,
    description, submission type, attempts allowed. others are not
    wired up yet since the UI for these either isn't built yet, or has
    changed recently)
  > expect the Cancel/Save/Publish foot er to appear. buttons on the
    right
  > on clicking cancel, expect the changed value(s) to revert and the footer to disappear
  > on clicking save, expect the footer to disappear
  > on clicking publish, if previously unpublished expect footer to
    disappear and the toggle to flip to published
  - flip the publish toggle
  > expect the footer _not_ to appear
  - flip to rtl
  > expect the footer buttons to be on the left, even in Edge
  - enter an invalid value for Points
  > expect an error message, and for the field to remain in edit mode
  - delete the assignment's name and TAB
  > expect an error message that the name is required

Disabling the Save and Publish buttons when there are invalid fields on
the page is left to ADMIN-2443

Change-Id: I016af6dc6e0e18d9aed1c364a328f9107a4d2762
Reviewed-on: https://gerrit.instructure.com/180831
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-02-26 18:35:10 +00:00
Brent Burgoyne d1be7c5d27 make test:jest:debug open dev tools automatically
Change-Id: Ie98f6055f848a4605b4f3276a403f05d345ae2a7
Reviewed-on: https://gerrit.instructure.com/182603
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-02-25 17:57:42 +00:00
Brent Burgoyne 96315b8626 support testing coffeescript with jest
Change-Id: I540ad44c033e489ff49c251256263d547ca258cd
Reviewed-on: https://gerrit.instructure.com/182600
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-02-25 17:57:15 +00:00
Ed Schiebel 0f6321312c Add graphiql-explorer to canvas' graphiql instance
The graphiql-explorer makes it easy to explore the schema and build
queries simply by checking the boxes next to fields from the schema

test plan:
  - /graphiql still works as expected, but includes the explorer panel
  - canvas features that leverage graphql still work as expected
    (since the version of the graphql js client was updated)

Change-Id: Ief625c6fb59e4e32e23a177f3b566aae271ab108
Reviewed-on: https://gerrit.instructure.com/181586
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-02-15 16:42:12 +00:00
Ed Schiebel 0a3cc60ca7 upgrade instUI to 5.41.1
test plan:
  - tests pass and everything still works

Change-Id: I73540f1b5e4647c19f3446ce558bce7e4dfde684
Reviewed-on: https://gerrit.instructure.com/180736
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-02-09 15:52:58 +00:00
Steven Burnett 37cc468cb9 dynamic import comments
refs COMMS-1844

Test Plan:
- Click on comments on an A2 student view
- notice there is a loading indicator then
  the comments load
Change-Id: I43ed778b826153b5cb4e58b9365a0016dec10897
Reviewed-on: https://gerrit.instructure.com/180618
Tested-by: Jenkins
Reviewed-by: Aaron Hsu <ahsu@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-02-06 20:36:20 +00:00
Ed Schiebel 3b006a6fc1 Make A2 header content editable
waiting on an instui release. without it
  1. the Points edit has the wrong font size
  2. you cannot delete a module

closes ADMIN-2303

test plan:
  - create an assignment, open it, click the assignments 2 button,
    then add #edit to the url and refresh (this forces the assignment
     into edit mode)
  > expect the assignment type to be "Assignment" and to be editable
    - on selecting any value other than "Assignment", expect to be
      sent to the corresponding page in canvas after confirmation
  > expect the correct module(s) to be selected, and to be editable
    - expect to be able to select > 1 module
    - when all modules are deleted, expect th "No Module Assigned"
      placeholder
  > expect the correct assignment group to be selected, and to be
    editable
  > expect the assignment name to be correct and editable
  - edit and delete the name
  > expect a "name is required" message
  > expect the points to be correct and editable
    - entering anything that's not a number should result in an
      error message

Change-Id: Ief36b01d7f5380f16d3e76b7afeb7d7d8e38b3bc
Reviewed-on: https://gerrit.instructure.com/176293
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-02-05 15:47:27 +00:00
Ed Schiebel 9bb68cb4a7 Add override details to teacher view
closes ADMIN-1510

This change includes some code to flip some of the elements into edit
mode, but that's not part of this ticket (though if you want to see
it, add #edit to the URL)

test plan:
  - have an assignment with some submission types, specified allowed
    filename extensions, due, lock, unlock dates
  - load /courses/:course_id/assignments/:assignmen_id?assignments_2=true
  - click the ">" to expand the override summary to see the details
  > expect the data to match your assignment

notes:
  - "score to keep" and submission requirements are hard-coded for now
    until we get the data
  - the attempts input only appears when attempts allowed is limited
    (e.g. non null)
  - Submission Requirement only appears when there are > 1
    submission types
  - the UI mostly matches the mockup. Mary's design is changing, so
    it may not be 100% exact.

Change-Id: Ia385ec7880e3d834658d412a4c7ac5afc9091fac
Reviewed-on: https://gerrit.instructure.com/175098
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
2019-02-01 19:22:57 +00:00
Jon Willesen d82b5fafe6 A2: implement delete button
closes ADMIN-2233

test plan:
- click the delete button which will open a confirmation dialog that
  roughly matches the design
- a11y for the dialog should make sense
- the close button should dismiss the dialog with no effect
- the cancel button should dismiss the dialog with no effect
- the delete button should start a delete operation
- when the delete operation completes, you should be redirected to the
  assignment index screen with a message indicating the assignment has
  been deleted
- if your user does not have permission to delete the assignment, or
  some other error occurs, then the in-development error screen should
  be shown

Change-Id: I0c3304360d3c389296bd0910d02d8215bdb0ac9e
Reviewed-on: https://gerrit.instructure.com/177754
Reviewed-by: Carl Kibler <ckibler@instructure.com>
Tested-by: Jenkins
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-01-30 22:23:46 +00:00
Landon Gilbert-Bland 466afa70be Fix XSS in calander
Fixes COMMS-1846

Test Plan:
  * Go to the calendar, click on a day to add an event, and click on the
    "More Options" button.

  * Switch to the html editor, and add the following:

    <img class='equation_image'
    data-mathml='<img src=x onerror=prompt(document.cookie); />'>

  * Save the event. Go back to the calendar and click on the newly saved
    event, and notice that you don't get XSS'd

  * Create another event in the calendar, and this time add the
    following via the html editor:

    <img class="equation_image" title="(-\infty,\infty)"
    src="/equation_images/(-%255Cinfty%252C%255Cinfty)"
    alt="Infinities: (-\infty,\infty)"
    data-equation-content="(-\infty,\infty)" />

  * Save the event, and load it in the calendar. Notice that it still
    properly displays this mathml image properly.

  * Test the same calendar event with a screen reader, and notice that
    it is still accessible

Change-Id: If0f1ac8ad93f04ececb7aa2f7ef221204b1ce14f
Reviewed-on: https://gerrit.instructure.com/179783
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-01-30 16:39:43 +00:00
Clay Diffrient 8fcb27bc5d Add sub-account settings for CSP
closes CORE-2253

Test Plan:
  - Enable CSP settings
  - Go to a sub-account's settings page
  - You should see a security tab
  - Go to the security tab
  - CSP information should be displayed including a toggle
    between Off, Inherited, and On.
  - Behavior should match the description shown on the page.

Change-Id: If2a485cc3712f6af8d266401da67d4deaa845696
Reviewed-on: https://gerrit.instructure.com/177971
Tested-by: Jenkins
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-01-23 14:43:41 +00:00
Clay Diffrient 3938ab7550 Add CSP whitelist to the security settings
closes CORE-2109

Test Plan:
  - Enable the Content Security Policy feature flag
  - Go to account settings, security tab
  - Use the Add Domain form to add a domain
  - It should appear on the whitelist
  - Flip the CSP switch to enabled

Change-Id: Iaea578c52e9b8bb6541a4e13edc6a1702e907cdf
Reviewed-on: https://gerrit.instructure.com/174980
Tested-by: Jenkins
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
2019-01-18 23:10:26 +00:00
Clay Diffrient 66517541a5 Bump a11y checker to 1.11.0
closes CORE-2323
refs CORE-2115
refs CORE-2097

Test Plan:
  - Add something to an RCE instance that has a11y errors
  - Run the a11y checker
  - You should see errors show up.
  - Click the (?) hint button
  - The tooltip should contain a link for most rules
    that is descriptive (e.g, learn more about xyz)
  - The link should also be underlined

Change-Id: I1930f855d05ffa71f7e27c2943503371e6224175
Reviewed-on: https://gerrit.instructure.com/173487
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-01-15 21:05:07 +00:00
Clay Diffrient 6bccbbbc53 Update and remove duplicate version of lint-staged
Test Plan:
  - Automated tests pass

Change-Id: I905418abde9ce75b3d7f1b9e878faeaf7e288b9e
Reviewed-on: https://gerrit.instructure.com/177176
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-01-08 20:20:30 +00:00
Jeremy Neander 7144c8dce1 spec: add fetch polyfill for jsdom
Because JSDOM has … needs.

Change-Id: I3b929d96dc208c6b32802bbfa806cc22adff7fdf
Reviewed-on: https://gerrit.instructure.com/177129
Tested-by: Jenkins
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Keith Garner <kgarner@instructure.com>
2019-01-08 17:16:31 +00:00
Clay Diffrient 0f1cf5362f Upgrade node modules
closes CORE-2242
closes CORE-2303

Test Plan:
  - Automated tests pass

Change-Id: I7f9b248564d8a4dc034af3585581f6af2aa81702
Reviewed-on: https://gerrit.instructure.com/177078
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-01-08 16:07:06 +00:00
Jon Willesen 32a74f2278 upgrade instUI to 5.38.0
refs ADMIN-2277

test plan:
- Do some spot checking all around, esp. on newer stuff written with
  InstUI
- Do some specific spot checking on:
  - Assignments edit page. Esp. with moderated grading
  - Gradebook late policies
- Check the original bug (ADMIN-2211)

Change-Id: Iaaaeb9d86dc2d59cb2c9ccca2a8764a5adb0896b
Reviewed-on: https://gerrit.instructure.com/176912
Tested-by: Jenkins
Reviewed-by: Anju Reddy <areddy@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-01-07 21:24:50 +00:00
Landon Gilbert-Bland a6a40b99bc Display multiple modules in A2 student view
This also adds support for apollo-link-state. We are using this to move
data from the `ENV` into our apollo query results, to keep a single
source of truth and easier unit tests.

If there are more then two modules that an assignment belongs to
(which is abnormal) we are only rendering the first two modules with an
additional link to the modules page, indicating that there are more
modules this assignment belongs to.

Fixes COMMS-1800

Test Plan:
  - Create an assignment, and add it to four modules
  - Navigate to the assignment as a student
  - Notice that 2 of the four modules are displayed in the header

Change-Id: I9b797486ba56c8b827e5f76114c5a08d2f969f41
Reviewed-on: https://gerrit.instructure.com/174837
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>
2018-12-12 19:29:22 +00:00
Clay Diffrient 439af4080f Update redux-logger to 3.0.6
test plan:
      - automated tests pass

Change-Id: Iaf8b223e7c60a43f5b4e10561d5d66643a312992
Reviewed-on: https://gerrit.instructure.com/173817
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2018-12-05 18:29:35 +00:00
Clay Diffrient 41e58c5712 Update redux-thunk to 2.3.0
test plan:
      - automated tests pass

Change-Id: I3417cc46a9581dd4fe72fc96f8c8e995b90303fd
Reviewed-on: https://gerrit.instructure.com/173816
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2018-12-05 18:29:23 +00:00
Clay Diffrient 5a789aff54 Update redux-actions to 2.6.4
test plan:
      - automated tests pass

Change-Id: I82969f661e78370c8a2f9035c2bca7d2397fb377
Reviewed-on: https://gerrit.instructure.com/173815
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2018-12-05 18:29:11 +00:00
Clay Diffrient 4edcef8795 Update react-redux to 5.1.1
test plan:
      - automated tests pass

Change-Id: I6c1034ec8f443d10d39b5b551c1b7207e5191411
Reviewed-on: https://gerrit.instructure.com/173814
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2018-12-05 18:28:59 +00:00
Clay Diffrient 7d02e89263 Update redux to 4.0.1
test plan:
  - automated tests pass

Change-Id: I00260366f32e0407eaf4277b5b2d26d9896915ac
Reviewed-on: https://gerrit.instructure.com/173813
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
2018-12-05 18:28:44 +00:00
Clay Diffrient 1a4d8f39a9 Extract jest-moxios-utils to its own package
closes CORE-2217

Test Plan:
  - Automated tests pass

Change-Id: Icba5c61344e22e8a8e4929b9133c9a2b89a80ef9
Reviewed-on: https://gerrit.instructure.com/174135
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-12-04 22:38:28 +00:00
Cameron Matheson 1506e683c7 use apollo client instead of apollo boost
This prepares us for using apollo's instrospection fragment matcher
(which isn't supported with -boost).

Test plan:
  pages that use graphql still work

refs GQL-17

Change-Id: Ib6af304855e6c0e23b598344ac1d30f4d4aa03a5
Reviewed-on: https://gerrit.instructure.com/172936
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2018-12-03 06:43:30 +00:00
Clay Diffrient 0b2416a334 Add missing yarn entries
Test Plan:
  - Tests pass

Change-Id: I244b003cb61cc3a2d83f2d507c95c4ac1a6c4e7a
Reviewed-on: https://gerrit.instructure.com/173542
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-11-28 20:06:14 +00:00