Commit Graph

385 Commits

Author SHA1 Message Date
Brent Burgoyne b9174e5f76 fix pre-commit hook with unfixable eslint error
test plan:
- have a local yarn install
- add an unfixable lint error (unused var) to a file in the prettier
  whitelist
- try to commit the file
- it should not try to run in docker after the lint error

Change-Id: If1fcfc6693be26c6f6fdddb8cfa4c54a73512ebe
Reviewed-on: https://gerrit.instructure.com/173469
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
2018-11-27 23:28:12 +00:00
Clay Diffrient 93a6d18046 Add precommit hook for auto fixing files
This only affects javascript files and only affects things
from the prettier whitelist

This will run slowly if you don't have node_modules installed
locally (e.g., in Docker), but it will gladly attempt to
run things in Docker for you.

This adds a new githook_installer image that will install
the githook whenever a docker-compose up happens in the
repo.  It will also install the hook whenever a `yarn`
occurs locally (as a postinstall hook).

This commit should also not fail things.  For example
having unused variables is an ESLint error, but it isn't
autofixable.  It will log the error, but will otherwise
continue.  However, it will make this pretty with prettier
as well as fix any other autofixable ESLint errors.

closes CORE-2118

Test Plan:
  - Run `yarn`
  - Add some semicolons to something from the whitelist
  - git add that file
  - git commit and it will strip semicolons
  - In a dockerized Canvas:
     - docker-compose up
     - Add semicolons to a file
     - git add that file
     - git commit, it will take forever (~60s)
     - It should have stripped out semicolons

Change-Id: Id9198aa008808e898f29acb9ed64dd14ff843222
Reviewed-on: https://gerrit.instructure.com/171510
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2018-11-27 21:07:31 +00:00
Steven Burnett ce931bd2b8 get basic assignment data for students
fixes COMMS-1764

Test Plan:
- Visit an individual assignment page as a student
- notice your data is no longer mocked and shows correctly

Change-Id: I7810db47fa81c6120285359d754e1d9465ad3fe5
Reviewed-on: https://gerrit.instructure.com/173177
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2018-11-26 22:28:39 +00:00
Clay Diffrient 36ff81bcd8 Remove npm-run-all because it is unused
Test Plan:
  - Automated tests pass

Change-Id: Iefc64451fc20680afd9a77c594eba5df677cf66e
Reviewed-on: https://gerrit.instructure.com/173299
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-11-26 22:26:33 +00:00
Gary Mei 58321400d2 bump npm-run-all version
Change-Id: Ieae7ac480124e52050c79ca83c99a7fe698c48d5
Reviewed-on: https://gerrit.instructure.com/173262
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Gary Mei <gmei@instructure.com>
2018-11-26 19:03:17 +00:00
Landon Gilbert-Bland f019c9a045 upgrade instUI to 5.33.0
Refs COMMS-1522

Test Plan:
  * Jenkins passes

Change-Id: I6fd52c80375d10b6cbb69c1146004a9daaf5442c
Reviewed-on: https://gerrit.instructure.com/172594
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2018-11-16 22:25:34 +00:00
Jon Willesen 1898f2aa06 A2: teacher toolbox and code reorg
This is the first stab at implementing the teacher toolbox.

It also moves code toward the desired organization and frameworks.

closes ADMIN-1507

test plan:
- assignments 2 teacher view shows data on the right side of the header
  -> "X" is used as a placeholder value for values we don't have yet
- "X to grade" goes to the speedgrader for the assignment
- clicking on "Published" toggle shows a placeholder alert for the
  action
- clicking on "X unsubmitted" shows a placeholder alert for the action

Change-Id: I45f51789e2c3722f14482ab57d8d12244cff31b4
Reviewed-on: https://gerrit.instructure.com/170766
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2018-11-12 22:09:31 +00:00
Clay Diffrient 02fde29575 Fix up xsslint to work
This also moves us temporarily to a git branch version of xsslint until the
official package gets a new release with the appropriate fixes in place.

closes CORE-2125

Test Plan:
  - Automated tests pass
  - xsslint output shows that it linted many files

Change-Id: Id87e872dd2b7a08f11c0ddfaebdfc3f44e86c724
Reviewed-on: https://gerrit.instructure.com/171702
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-11-12 16:42:28 +00:00
Clay Diffrient 292b50a49b Update a11y checker to 1.9.2
closes CORE-1972

Test Plan:
  - Open the a11y checker in IE 11
  - It should open and work

Change-Id: Iacfef1e90e255ddf795bb84de430af4f4c39624d
Reviewed-on: https://gerrit.instructure.com/171292
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-11-07 22:46:32 +00:00
Clay Diffrient 58ab36e5d8 ESLint standardization
This commit introduces a better more reasonable ESLint configuration.
It removes all concerns with styling in favor of using prettier to handle
those things.

closes CORE-2096

Test Plan:
  - ESLint works

Change-Id: I50b90b7191b576bce4817d885d14f18c4c72d208
Reviewed-on: https://gerrit.instructure.com/170874
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-11-06 17:46:21 +00:00
Derek Bender df371fb19c turn off webpack progress for less noisy builds
This patchset also enables linting of webpack development to ensure es6
compatability. Before this patchset, gulp was invoked with an ampersand
to make it a background process. However since it only takes a few
seconds to run, it's success messages would be interlaced with webpack's
output. This reads rather odd in our logs. Since gulp is a low-churn
tool in canvas, let's mute stdout but still display stderr if an error
should appear.

Change-Id: I48846758e839480c9bc5779bfe64201e90713e2b
Reviewed-on: https://gerrit.instructure.com/170833
Tested-by: Jenkins
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2018-11-05 16:33:29 +00:00
Jeremy Neander be2db93ffe track anonymous grading in the audit trail ui
closes GRADE-1668

test plan:
 A. Setup
    1. Create an assignment
       * With moderated grading
       * With anonymous grading
       * Worth 10 points
       * Three graders (A, B, and C)
       * Teachers as final grader (not admin)
       * Assigned to only one or two students
          * just for less work in QA

    2. As each student, submit to the assignment

    3. As Grader A:
       a. Assign provisional grades
       b. Maybe leave a submission comment or two

    4. As the teacher, disable anonymous grading
       * The related event will have a warning badge

    5. As Grader B:
       a. Assign provisional grades
       b. Maybe leave a submission comment or two
       * The related events will have warning badges

    6. As the teacher, re-enable anonymous grading

    7. As Grader C:
       a. Assign provisional grades
       b. Maybe leave a submission comment or two

    8. As the final grader:
       a. Visit the moderation page
       b. Select provisional grades
       c. Post grades
       d. Display grades to students

 B. Verify
    1. Log in as a user with "view audit trail" permission (admin)
    2. Open the assignment in SpeedGrader
    3. Open the assessment audit trail

    4. For Grader A
       a. Expand the user event group for Grader A
       b. Verify there is no non-anonymous warning icon to the side of
          the user name
       c. Verify there are no non-anonymous warning badges to the side
          of the user's grading actions

    5. For Grader B
       a. Expand the user event group for Grader B
       b. Verify there is a non-anonymous warning icon to the side of
          the user name
       c. Verify the non-anonymous warning icon triggers a sensible
          tooltip
       d. Verify there are some non-anonymous warning badges to the side
          of the user's grading actions
       e. Verify the badged icons trigger sensible tooltips

    6. For Grader C
       a. Expand the user event group for Grader C
       b. Verify there is no non-anonymous warning icon to the side of
          the user name
       c. Verify there are no non-anonymous warning badges to the side
          of the user's grading actions

    7. For the teacher
       a. Expand the user event group for the teacher
       b. Verify there is a non-anonymous warning icon to the side
          of the user name
       c. Verify there is a non-anonymous warning badge to the side
          side of the user's action disabling anonymous grading
       d. Verify there are no non-anonymous warning badges to the side
          of the user's moderation actions (after enabling anonymous)

Change-Id: I2e675b84dc3e6b59e3111ed39b7a814f38f19f5c
Reviewed-on: https://gerrit.instructure.com/170684
Tested-by: Jenkins
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
2018-11-05 16:19:55 +00:00
Brent Burgoyne 23bd3885ff don't pin yarn to a specific version
at this point the lock file should be stable enough to relax the
exact version requirement.

Change-Id: If26e59e6fdf938458507e8a1d16def5bda0971b7
Reviewed-on: https://gerrit.instructure.com/170635
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2018-11-01 16:55:58 +00:00
Clay Diffrient 6764aa5cd2 Bump react to 16.6
closes CORE-2037

Change-Id: I1c00623f789a3a5e377fb0529144a6ebd84a1546
Reviewed-on: https://gerrit.instructure.com/169535
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-10-29 15:39:21 +00:00
Cody Cutrer a92b014b7f bump bigeasy/timezone to 1.0.18 (2018e)
fixes CORE-1985

Change-Id: Ia9d5eddf1462de2226e43012f4756fc1f9b93c25
Reviewed-on: https://gerrit.instructure.com/168277
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2018-10-15 20:38:42 +00:00
Derek Bender 0104c229b3 revert uglifyjs webpack upgrade
Change-Id: I3186254e5916fb335e9b6854f4adfe53f222abad
Reviewed-on: https://gerrit.instructure.com/167985
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
Product-Review: Derek Bender <djbender@instructure.com>
2018-10-11 23:27:57 +00:00
Ryan Shaw ebac5a3ad8 the regular “update all the npm things” commit
this updates all the stuff we get from npm that we _can_ upgrade to
the newest versions available.

test plan:
* all the builds should pass

Change-Id: Icf1cc3cd02d66e6e1f999ea5f5fc3b5b28775881
Reviewed-on: https://gerrit.instructure.com/167282
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-10-09 22:04:49 +00:00
Jon Willesen 3fddcf98e2 add enzyme snapshot serializer to jest
converts all the existing
`expect(component.debug()).toMatchSnapshot()`
to:
`expect(component).toMatchSnapshot()`
which creates more detailed and more diff-able snapshots

test plan:
- specs pass -- this only affects js test code

Change-Id: Ib6dbcc1e3f87e61a251e4635dc68353aca57aeac
Reviewed-on: https://gerrit.instructure.com/167651
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-10-09 21:16:59 +00:00
Dan Minkevitch 3787616c28 Upgrade Yarn version to 1.10.1
if you are having problems after this commit you need
to either: `brew upgrade yarn` or` apt-get install yarn`
or rebuild your docker container or do whatever else you
use to manage software versions

Change-Id: I5c163baa8c4c814eeabca9a46501d508736a4ca1
Reviewed-on: https://gerrit.instructure.com/167252
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Dan Minkevitch <dan@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2018-10-08 17:14:57 +00:00
Aaron Kc Hsu 075f242a44 Replace flash with arc html5 media recorder
fixes COMMS-1462 COMMS-1420 COMMS-1418 COMMS-1417

Test Plan
* Navigate to /accounts/1/settings and notice that there is
a new Arc in RCE feature flag
* Setup notorious using the gerrit project and README
* Navigate to /plugins/kaltura and make sure local
notorious and also js_uploader html5 is turned on
* Now go to discussions/assignments show and speedgrader
/courses/1/gradebook/speed_grader
* Make sure turning off and on the feature flag fits the
way we need this to work

Change-Id: I883b0bb33e9f4bff134b22b4a192884c9aa9db29
Reviewed-on: https://gerrit.instructure.com/162819
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
Product-Review: Steven Burnett <sburnett@instructure.com>
2018-10-02 02:58:15 +00:00
Ryan Shaw d4334bec3b [spec] ensure MutationObserver exists to fix flaky jest test
see: 
http://jenkins.instructure.com/job/canvas__linters-and-js/50286/testReport/junit/(root)/KeyboardShortcutModal%20appears%20when%20shift%20+%20_%20is%20pressed/KeyboardShortcutModal_appears_when_shift_____is_pressed/
for a bad example

Change-Id: I09e303fdad1d9d63f1bbf61ea01be9dff165d1d8
Reviewed-on: https://gerrit.instructure.com/166029
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-27 16:16:03 +00:00
Ryan Shaw 351ebd6652 upgrade react from 15.x to 16.x
closes: CORE-1874

test plan:
Now that the automated selenium & javascript specs pass for this the
last thing we need to do is to go manually click around and see if
anything breaks.

The best thing to do would be to open your browser console and look
for errors. Deprecation warnings or propType errors  or react warnings
are fine but if any actual errors get thrown that is something we want
to look into.

specific things to look at:
* all the gradezilla/gradebook/grading stuff (specifically things that
  have instUI <NumberInput>s and <Select>s)
  * look at the submission cell editor
  * the gb headers (especially make sure keyboard navigation works how
  it should)
  * moderated grading
  * grading perid edit page / enrollment terms
  * speedgrader
  * grading standards
  * gradebook history
* theme editor
* new discussions/announcements
* the new permissions page
* the dasboard
  * student planner
  * dashcards
* global nav trays
  * help menu
* assignment edit page
* account user/course search

Change-Id: I6a1fe7df9379d9c601eda932bd8cef9c06d10cd2
Reviewed-on: https://gerrit.instructure.com/163913
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-09-26 19:04:47 +00:00
Ryan Shaw 46a98181fb dowgrade format-message so canvas-planner works
if we allow format-message to upgrade, then `yarn extract` inside
canvas-planner will break.


test plan:
* cd packages/canvas-planner
* yarn extract
* it should work

Change-Id: Icb10b2ec8d63d4afd618aa0f21b918dab14e37fe
Reviewed-on: https://gerrit.instructure.com/165325
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
QA-Review: Mysti Sadler <mysti@instructure.com>
Tested-by: Jenkins
2018-09-20 23:57:16 +00:00
Clay Diffrient 873c7e76bb Bump tinymce-a11y-checker to 1.9.1
closes CORE-1838 CORE-1888

Test Plan:
  - Smoke test the a11y checker
  - Check out the changelog at https://github.com/instructure/tinymce-a11y-checker/releases/tag/v1.8.0
    and make sure those things work inside Canvas

Change-Id: I13507afaae53e0eeefbeb11a1972112373539dc1
Reviewed-on: https://gerrit.instructure.com/164357
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
2018-09-19 20:46:13 +00:00
Ryan Shaw 5590efa875 update react-redux so it can be used w/ react 16
we need all these:

v4.4.9
Update hoist-non-react-statics to 2.x
v4.4.8
Fix deprecation warnings with React 15.5.0
v4.4.7
Allow React 16 as peerDependency

test plan:
* pages that use redux should work the same as before and automated
  tests should pass

Change-Id: Id06bf4eaaa6f884996690889b442ad98584c78b0
Reviewed-on: https://gerrit.instructure.com/164990
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-19 14:14:18 +00:00
Ryan Shaw e73289e507 Yarn.lock: update all our npm dependencies
closes:  CORE-1909 

This is the result of running:
`yarn upgrade-and-dedupe`
and then fixing any specs/changes that needed to happen as a result of
the new versions

Test plan:
* automated tests should pass

Change-Id: I79ec63d8eb9d7bce4d48af0cff7cee369be58884
Reviewed-on: https://gerrit.instructure.com/164790
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-18 23:08:30 +00:00
Ryan Shaw aca3e04e7a Disable happypack for concurrent karma runs
If we are splitting up our specs and running different groups across
different cores, we don’t need to also use happypack to distribute
that work to multiple cores. In fact, if we do, it’ll be slower because
of cpu thrashing

Change-Id: If000c59d73d46961bffebacab9f7b0291a01bda6
Reviewed-on: https://gerrit.instructure.com/164889
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-18 22:35:43 +00:00
Ryan Shaw 23287c6969 react 16: get test-utils from react-dom/test-utils
closes: CORE-1890

from the react-addons-test-utils readme:

This package is deprecated as of version 15.5.0:

TestUtils have been moved to react-dom/test-utils

Change-Id: Ica0bb0c798aa80288d37b1810dc78eedad100d18
Reviewed-on: https://gerrit.instructure.com/164127
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-18 14:41:50 +00:00
Ryan Shaw 666b82253c make filePreview work w/ react 16
closes: CORE-1889

aka: combine into one es6 class so it can use React.PureComponent

this is because react 16 doesn’t have pureRenderMixin

test plan:
* the file preview page should work exactly as it did before

Change-Id: I64aa30653a82afb3e237a25d337137ed7c234858
Reviewed-on: https://gerrit.instructure.com/163914
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-17 20:25:55 +00:00
Ryan Shaw 8e57d0bcb2 replace react-addons-transition-group
closes: CORE-1875

from the react-addons-css-transition-group readme:

The code in this package has moved. We recommend you to use
CSSTransitionGroup from react-transition-group instead.

In particular, its version 1.x is a drop-in replacement for the last
released version of react-addons-css-transition-group.

Run npm install --save react-transition-group@1.x, and replace the
imports in your code:

test plan:
* the theme cards should have the exact same css transition effects
  as before

Change-Id: I33eb34c941bb0999cc600a3abe793e0603183b35
Reviewed-on: https://gerrit.instructure.com/163912
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-17 18:45:07 +00:00
Ryan Shaw 32667d33e2 upgrade react from 0.14.9 to 15.x
closes: CORE-1857 CORE-294
also closes: CORE-1856 CORE-294 CORE-1841 CORE-71 CORE-302 CORE-301
also closes: CORE-300 CORE-299 CNVS-34315 CORE-298 CORE-243 CORE-297
also closes: CORE-296 CORE-295

test plan:
now that the automated selenium & javascript specs pass for this the
last thing we need to do is to go manually click around and see if
anything breaks.

the best thing to do would be to open your browser console and look
for errors. deprecation warnings or propType errors  or react warnings
are fine but if any actual errors get thrown that is something we want
to look into.

specific things to look at:
* account user/course search
* all the gradezilla/gradebook/grading stuff (specifically things that
  have instUI <NumberInput>s)
  * look at the submission cell editor
  * the gb headers
  * moderated grading
* the stuff for adding external apps
* theme editor
* new discussions/announcements
* the new permissions page
* the dasboard
  * student planner
  * dashcards
* global nav trays
  * help menu

Change-Id: I0d71ffda08e306927616d3e976b09cd1775fba10
Reviewed-on: https://gerrit.instructure.com/163518
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-17 15:42:14 +00:00
Ryan Shaw 3a7d2e2713 upgrade react-token-input so it supports react 16
closes: CORE-1885

Test plan:
* make sure the token input that appears when you edit assignment
  due date Overrides on the assignment overrides page still works
  Like it did before. Here’s it’s original test plan:
new due dates selection UI
  - on assignments, quizzes & discussions pages
  - with DA on and off
  - assign various due dates/(un)lock dates
    to source sections, individuals, and everybody

  - these should create overrides that properly take
    students/sections and dates
  - validations should work for all dates as normal
    and not let empty overrides get created (with no
    students or sections)
  - the names of overrides should properly update as
    students change
  - as more overrides get created, saving assignments
    should not slow down significantly
  - the student/section selector should be intuitive


* the “new grading period set” form should work as it did before.
  Here’s it’s original test plan:

A new button "+ Add Grading Period Set" is on the
Grading Period Sets page. This allows a new set to
be named and associated with as many terms as needed.

To begin, visit the Grading page for an account
(e.g. /accounts/1/grading_standards) and click "+ Set of
Grading Period" and within this form ensure the following:

1. Given no name in the "Set name" field, when clicking
   the "Create" button a flash message is displayed and the
   set is not saved
2. Given no enrollment terms in the "Attach terms", when
   clicking the "Create" button a flash message is displayed
   and the set is not saved
3. Given a name and at least one attached enrollment term,
   when clicking the "Create" button an AJAX call successfully
   persists to the database and the new set is displayed on
   the page along with a successful flash message
4. When the form is open, the "+ Set of Grading Periods"
   button is disabled
5. When the form is in the process of creating a new set,
   the "Create" and "Cancel" button is disabled
6. Clicking close at any other time closes the form and
   re-enables the "+ Set of Grading Periods" button and
   all data in the form is cleared

Change-Id: Ibb0290202b5dcf00ec42a4bb6d1c3d2e3d7a3b2b
Reviewed-on: https://gerrit.instructure.com/164492
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-14 19:27:28 +00:00
Ryan Shaw 1348da53b9 Update `react-crop` dependency
closes: CORE-1886 CORE-1887

I forked react-crop, added it to the @instructure GitHub/npm group
converted all the React.createClass code to es6 classes and set it up
To use modern react/babel/webpack


Test Plan:

ensure Admin > <your account> > Settings > Enable Profiles and
User Avatars are checked
navigate to Account > Profile
using keyboard:
TAB (displays "skip to main content")
ENTER (focuses on the main content of the profile page
TAB (focuses avatar image)
ENTER (displays Select Profile Picture dialog)
TAB 4 times (focuses "choose a picture")
ENTER (displays system file open dialog)
Select a photo
The selected photo and crop-box are displayed and have focus
Use arrow keys to move the crop box around
Use shift-arrow keys to size the crop box
TAB twice to focus Save button
ENTER closes dialog
cropped image should be displayed on the profile page

Change-Id: I68647b3375c480b77d422e115d3ea8c92dd5b79f
Reviewed-on: https://gerrit.instructure.com/164443
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-14 17:08:42 +00:00
Ryan Shaw ec49145559 Upgrade react-modal so it works with react 16
I know I said that the way forward was to just not use react-modal
and use instUI modal instead but there are a bunch of things that _are_
Using it and I don’t want changing all those to be blockers for react16
if this will work.


I still want us to get rid of react-modal, just don’t want it to be a 
blocker for react 16


Test plan:
Things that use react-modal should still work the same as before. Check:
* the color picker used on the calendar sidebar
* the external apps stuff that has modals
* the file preview modal in files
* the “find appointment” modal in scheduler

Change-Id: I606eda110782cd3300fcbb2f8052681fa5048050
Reviewed-on: https://gerrit.instructure.com/164232
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-13 17:51:34 +00:00
Ryan Shaw d44185e430 react 16: use createReactClass for things that can’t be es6 classes
these components can’t be converted to the react es6 class syntax
because they use Mixins which aren’t supported by es6 classes.

Change-Id: I8541b08518cd335c7a711bab117efcda65ac6b2c
Reviewed-on: https://gerrit.instructure.com/164135
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-12 16:03:38 +00:00
Ryan Shaw 1441758ddd Upgrade react-dnd so it works w/ react 16
Closes: CORE-1871

The react-dnd commit that first added react 16 to its peerDeps
(https://github.com/react-dnd/react-dnd/commit/c6123fad317)
First appeared in v2.5.2 so we need at least that version
If we are going to use react 16

Test plan:
* dashboard card and discussion reordering should still work like they
  always have

Change-Id: I74b47949f3d0f7084c350d24a8de41139f535732
Reviewed-on: https://gerrit.instructure.com/164071
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-12 04:11:54 +00:00
Ryan Shaw a49723beab remove react-select-box, nothing uses it
from grepping around, it appears nothing uses this.

This will will make it easier to upgrade to react 16 since there is one
Less thing to keep track of

Test plan:
* can anybody else think of a place where this is used
* if not, removing this doesn’t change anything since nothing uses it

Change-Id: I1ebe3147bdef39342a0deb11ab145fb0740e4c28
Reviewed-on: https://gerrit.instructure.com/164051
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-11 22:15:43 +00:00
Ryan Shaw 4fcfeb828f put accidentally deleted comments back in package.json
Change-Id: I6b00f817afbf46c6cfa48ed0f389aede78c9c3f3
Reviewed-on: https://gerrit.instructure.com/163733
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-10 14:18:10 +00:00
Ryan Shaw e1454a761c add jest-canvas-mock to silence a bunch of warnings
without this we get a bunch of warnings from our jest tests like:
Error: Not implemented: HTMLCanvasElement.prototype.getContext …

test plan:
you shouldn’t see those ^ messages in the jest logs

Change-Id: Ib257d4a6b40f4b4118f273729080e722afa3432a
Reviewed-on: https://gerrit.instructure.com/163515
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-07 15:18:15 +00:00
Ryan Shaw d5681a84e8 get back on the release version of instUI (5.25.0)
this sets us back up to track the latest actual
release instead of the “rc” version

test plan:
* automated tests should pass

Change-Id: I9e668828acc99bcb49c7071ca0ccb898c55f0d99
Reviewed-on: https://gerrit.instructure.com/162867
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-08-31 19:43:51 +00:00
Ed Schiebel c5c50c760c Pass correct locale to Planner
Sometimes ENV.LOCALE and ENV.MOMENT_LOCALE are different
(zh-Hans v zh-cn or mi v mi-nz). We were passing the former to planner,
but moment needs the full locale, including language and region
identifiers, and formatMessage copes with the full locale just fine,
so we really need to pass in the latter or moment eventually
blows up.

So mi-nz month names would successfully parse, had to both bump our
version of moment and tweak the canvas customized mi-nz locale data.

to test, you'll have to run yarn to update moment, then build with
RAILS_LOAD_ALL_LOCALES=1 yarn build

Note on the changes to timezoneSpec.js:
- some of the specs were parsing dates like "Mon, Aug 3", which are
  being interpreted in the current year, when Aut 3 is not a Monday.
  Resolved this by using MockDate to pretend today is 2/1/2015
- moment does not always interpret the Chinese characters for evening as
  implying PM.  I'm assuming canvas will never need that particular
  construct and commented out the failing string.
- there's one date-time that's getting the date totally wrong.
- Fixed grammatically incorrect instances of
  '8月 3, 2015' to ''8月 3日, 2015'
- fix cases where the year is coming after the month and day, which
  would never really happen

fixes ADMIN-1331

test plan:
  - have a student in course so planner is enabled.
  - go to /profile/settings and Edit
  - change the Language to Reo Māori (Aotearoa) and "Update Settings"
  - go to the planner dashboard
  - click on + to create a new todo
  > expect you can create a todo.

If you want, you can repeat with any of the languages listed in the
ticket just to prove ^that wasn't a fluke.

Change-Id: I9ba069ef61529088ab92271d7857998df6bbc409
Reviewed-on: https://gerrit.instructure.com/161206
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2018-08-27 20:51:33 +00:00
Ryan Shaw 354bf2df06 upgrade enzyme to 3.x
Closes: CORE-1758

After this commit, if you or your team have any specs that import
from old-enzyme-2.x-you-need-to-upgrade-this-spec-to-enzyme-3.x-by-importing-just-enzyme
That means you need to upgrade those spec files to use the new enzyme
by changing that to `import {mount, shallow, whatever} from ‘enzyme’`.
Refer to http://airbnb.io/enzyme/docs/guides/migration-from-2-to-3.html
for details

Test plan:
* all linters-and-js-specs should pass
* since this only effects js specs, that is all that really matters. 
  no app code to QA

Change-Id: I46c5d815e9d95683832d70b64e31526b943d07e5
Reviewed-on: https://gerrit.instructure.com/135136
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-08-23 14:44:23 +00:00
Ryan Shaw 925c22a7fc Move the pretranslated babel stuff into own pkg
closes: CORE-1725

This is so we don’t have to pull in all of the deps of quiz-presets
just to do the pretranslated stuff for canvas-rce. because without
this, it was going to be a pain to deal with the version of
`@instructure/ui-presets` that `quiz-presets` wanted if we wanted to
always be on the latest instUI rc.

It also makes it so we have to yarn install less stuff into node_modules

Test plan:
* before checking this out, go to packages/canvas-rce and run
  `yarn build:all`
* run `find -s lib -type f -exec md5sum {} \; | md5sum`
* check this out, run `yarn` then run `yarn build:all` again
* run `find -s lib -type f -exec md5sum {} \; | md5sum` again
* the 2 checksums should match, meaning they produced exactly the
  same code


Change-Id: Ife3116b43cae51bcd92c725ab68c6d1fd621dce5
Reviewed-on: https://gerrit.instructure.com/160832
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-08-17 20:34:19 +00:00
Ryan Shaw ced4d9b501 Upgrade instUI to 5.24.0 & ally-checker to 1.7.0
Closes: CORE-1697

Test plan:
* do a basic regression test of things that use instUI components.
  Specifically: the new developer keys page and the gradebook grade
  details tray since those had the most specs that needed to be fixed
* do a basic regression test of the a11y checker to make sure the
  instUI components work the same as before

Change-Id: Ie88c4fc1b01eadeecceb7536944da986e37bf3dd
Reviewed-on: https://gerrit.instructure.com/156473
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-08-17 20:33:49 +00:00
Ryan Shaw e8a88cceea A script to just update instUI
Closes: CORE-1709

This is what our Jenkins job to pull in every instui RC commit will use

Test plan:
* run `yarn upgrade-instructure-ui`
* it should make a commit that has new entries in yarn.lock for all the
  instUI packages that uses the latest rc version on the npm registry
* it should not affect anything else besides yarn.lock

Change-Id: I78cce6e801015819c4e4b27e26ede352deceebb9
Reviewed-on: https://gerrit.instructure.com/160435
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-08-15 20:21:10 +00:00
Ryan Shaw fd33fdf2b5 Upgrade yarn from 1.7.0 to 1.9.4
if you are having problems after this commit you need to either:
`brew upgrade yarn` Or `apt-get install yarn` or rebuild your docker
container or do whatever else you use to manage software versions

Change-Id: Ie338a24544bd4677f68222b69cfa178c0ef21ca9
Reviewed-on: https://gerrit.instructure.com/160616
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-08-14 16:11:54 +00:00
Ryan Shaw 6f910dbc43 treat anything in gems/plugins/* as a workspace
Fixes: https://github.com/instructure/canvas-lms/issues/1323

This lets open source users continue putting their own plugins with npm 
deps In gems/plugins. They will still have to have a forked version
Of yarn.lock though since that will be different for them than a
“Default” install.

Also, this means that everyone will see a bunch of warnings like this
Every time they yarn install:
Warning: gems/plugins/academic_benchmark is a dir… no package.json
Warning: gems/plugins/account_reports is a dir.. has no package.json
Warning: gems/plugins/canvas_geoip is a …, but has no package.json
Warning: gems/plugins/demo_site is a directory, but has no package.json
Warning: gems/plugins/instructure_misc_plugin is … has no package.json
Warning: gems/plugins/moodle_importer is a d.., but has no package.json
Warning: gems/plugins/qti_exporter is a dir…, but has no package.json
Warning: gems/plugins/respondus_soap_endpoint is … no package.json
Warning: gems/plugins/simply_versioned is a …, but has no package.json


Test plan:
* yarn install should work

Change-Id: Ie65c8faf8b1022210cfb7eda8c25107facfe83b5
Reviewed-on: https://gerrit.instructure.com/158043
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-07-20 21:20:56 +00:00
Ryan Shaw e09c9f9afa Downgrade node-sass to fix styling of flashMessage
Fixes: SIS-3125, COMMS-1328

In g_instructure.scss, we have some scss that looks like:

#flash_message_holder, #flash_message_buffer {
  …
  li:not(.ic-flash-info, .ic-flash-success, .ic-flash-warning, .ic-flash-error) {
    …

In recent versions of node-sass that gets output as:
#flash_message_holder li, 
#flash_message_buffer li {
  ...
}

Instead of how it should be:
#flash_message_holder li:not(.ic-flash-info, .ic-flash-success, .ic-flash-warning, .ic-flash-error), 
#flash_message_buffer li:not(.ic-flash-info, .ic-flash-success, .ic-flash-warning, .ic-flash-error) {
  ...
}

Change-Id: I6aad4a6793228c97114220f5f2b2ec85ac9ae61d
Reviewed-on: https://gerrit.instructure.com/157921
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-07-19 19:46:03 +00:00
Clay Diffrient 2dc1d7fa86 Add a way to generate better js coverage
This should pick up coverage from both karma and jest
in Canvas proper.  It should also pick up coverage from anything under
packages/*

closes CORE-1265

Test Plan:
  - Run `COVERAGE=true yarn test`
     - Coverage reports (coverage-final.json) should generate in all
       packages such as (canvas-planner) as well as in coverage-karma
       and coverage-jest
  - Run `yarn run test:coverage`
     - coverage-js folder should be generated.  Opening index.html
       should show the full coverage report
  - Remove coverage-{js, karma, jest} and
    packages/canvas-planner/coverage as well as .nyc_output to get back
    to a clean state
  - Run `RUN_TESTS_FIRST=true yarn run test:coverage`
     - All tests should run and generate the appropriate report just
       like the last time in coverage-js

Change-Id: I50744b8977e0683e079af5bdd2865dbcd6ad9066
Reviewed-on: https://gerrit.instructure.com/146098
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-07-17 14:19:03 +00:00
Ryan Shaw 4e012e178e Upgrade tinymce to 4.8.0
Fixes: CORE-1518

Test plan:
when using newest version of Microsoft Edge:
In the RCE, add a table.
After adding the table, attempt to edit the table.
You should be able to edit tables using the RCE when using MS Edge

Change-Id: Ibbc38ac11c6fbb808a31e16a84fe24a87a979e5b
Reviewed-on: https://gerrit.instructure.com/157456
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-07-17 02:04:59 +00:00