Closes USERS-515
flag=none
This makes the "Filter by term" select box on the main courses
page searchable by typing into the box to narrow down the
choices. Similar functionality is already present in the
corresponding selections in the New Course modal.
Because this selection dropdown includes groups, it necessitated
a complete rewrite of the SearchableSelect component so that it
works a little more like CanvasSelect in handling its children.
It no longer depends on CanvasAsyncSelect.
SearchableSelect was almost completely rewritten from scratch so
I would recommend just reviewing the new module an ignoring the
diff from the old one. Hopefully it is more generally useful now
like CanvasSelect is.
In the course of writing tests for this, I discovered that all
our supported browsers implement Array.prototype.flat(), so it
is safe to use. What does NOT implement it, however is Jest 🤦
so I also implemented them as polyfills in the jest-setup.js
and now everyone can use them in the future.
Test plan:
* Have a bunch of terms
* Go to /accounts/default
* Click on "Filter by term" to bring up the selection dropdown
* It should work just like it used to to filter the courses list
* Now try typing in the box... it should filter the available
selections in the dropdown while you type
* If no terms match what you're typing, the dropdown should go
away altogether and the select box itself should get a red
highlight with red error text
* A11y should be okay
Change-Id: I3da8dd681645f83f858996fe42030ad400eada01
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237585
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Matt Meservey
QA-Review: August Thornton <august@instructure.com>
closes LA-847
flag=assignment_bulk_edit
test plan:
- Assignments and their overrides should be displayed with their dates
- Each date input should function and work independently
Change-Id: Ia2206bcae8b462535e3bcc99bf024bfaae39bc3e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230953
QA-Review: Anju Reddy <areddy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
This was broken because jest would die on the
`import _Handlebars from 'handlebars/runtime’`
In frontend_build/i18nLinerHandlebars.js
Test plan:
* you should be able to import a file that imports a handlebars file
In jest tests
Change-Id: I021de6650dd97270e10709495a42b84b6b4a4505
Reviewed-on: https://gerrit.instructure.com/208112
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
I did this first for canvas’s jest tests, but this does it for
karma/qUnit, canvas-rce, canvas-planner and dev mode too.
test plan:
* run `yarn test`
* you should see a lot less react deprecation messages
Change-Id: I5f5cee08d705b749526be87fd79cfc937c015145
Reviewed-on: https://gerrit.instructure.com/206879
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Also, fix some
Test plan:
* run `yarn jest`
* you should see less of those react 16.9.x lifestyle deprecations
In the console output
Change-Id: Ic63e977fe8067756d0a276e316b23dab004da94f
Reviewed-on: https://gerrit.instructure.com/206813
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
This will prevent Raven from mocking out the global fetch function.
Tests that rely on the mocking functionality will pass. This also
removes a console.log statement that led to this discovery
Test Plan:
- Provide a valid DEPRECATION_SENTRY_DSN environment variable
- Run Navigation.test.js and it should pass
closes CORE-214
flag = none
Change-Id: I7e229c39808ca0bffed7caf2e2ed25755c7f6185
Reviewed-on: https://gerrit.instructure.com/205914
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Test Plan:
- Errors don't show in Slack
closes CORE-2894
flag = none
Change-Id: Ib4fe995fc54372ffed635751cde08ce4d1a92772
Reviewed-on: https://gerrit.instructure.com/204502
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
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>
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
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>
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>
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>
coffeescript and amd files are supported now, so this is not needed.
test plan:
- all existing jest tests pass
Change-Id: If1d0a110451d6c87dca0aaf5fccdf011c3fd02ca
Reviewed-on: https://gerrit.instructure.com/186472
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
Tested-by: Jenkins
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
Test Plan:
- tests pass and errors are still shown in console
that aren't of the type "0 focusable"
Change-Id: I451a363e70bd36c83eaa76ac0fec7aaeec0c5952
Reviewed-on: https://gerrit.instructure.com/186282
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
refs ADMIN-1512
This is just the basic "show the modal" work. The modal doesn't actually
accomplish anything yet. That work will be done in a separate commit, as
this one was getting large.
test plan:
- unsubmitted button should open a message students who modal that more
or less looks like the mockup.
- when there is no submission or a paper submission, the unsubmitted
button is replaced with a "message students" button.
- the list of students in the course is shown. It may not be completely
accurate yet. For example, we're not filtering out the test student.
- The dropdown doesn't work yet.
- you can delete students from the list, and add students back into the
list.
- you can close and cancel the dialog.
- when you click save, the modal pretends to work for a few seconds, and
then there is an alert indicating nothing really happened.
Change-Id: I815139c1d6c5b6108fda34c319de2686bb8c6ebd
Reviewed-on: https://gerrit.instructure.com/179827
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
closes ADMIN-2416
test plan:
- automated tests pass
- assignment data still loads
- assignment can still be published/unpublished
- new feature: toggle is disabled while the operation is in progress
- assignment can still be deleted
Change-Id: I03d877bfaa1693d665590ea615dcaa8b51b77e61
Reviewed-on: https://gerrit.instructure.com/181027
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
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>
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>
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>
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>
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>
refs CORE-1460
This expands reporting away from just selenium specs to JS specs as
well, both Jest and QUnit.
It also moves the console plugin bit out to a separate module for
better reusability.
Test Plan:
- Specs pass, sentry picks stuff up.
Change-Id: Ie6dcf24de4ddeb3797244e1d9a48f0d56ff5574c
Reviewed-on: https://gerrit.instructure.com/162009
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
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>
Test plan:
* run `yarn run jest`
* you should not see any of these warnings:
Warning: [themeable] component styles require setting a 'dir' attribute
on the HTML element. To prevent breaking changes, we'll set it to a
default value: 'ltr'.
Change-Id: I5e63f069772dc305ba91d4033e0922f2b6fdefc5
Reviewed-on: https://gerrit.instructure.com/153561
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
…and prevent a giant error from being logged from ui-themable
test plan:
* the “Add Ability To Add External RSS Feeds…” commit that is based
on top of this should pass jest
* you should not see an errors like this when jest runs:
console.error node_modules/@instructure/ui-themeable/lib/registry.js:342
TypeError: Cannot read property 'porcelain' of undefined
Change-Id: I8a9583a3d16394a919a223cedfd577aef7f70ec1
Reviewed-on: https://gerrit.instructure.com/137778
Product-Review: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
closes: CNVS-34337
* For now, you can only test things that don’t require any coffeescript
files
* Write your tests using es6 module syntax
* see app/jsx/shared/helpers/__tests__/parseLinkHeader.test.js for an
example
test plan:
* run `yarn run jest`
* you should see some output like:
PASS app/jsx/shared/helpers/__tests__/parseLinkHeader.test.js
PASS app/jsx/actAs/__tests__/ActAsModal.test.js
Test Suites: 2 passed, 2 total
Tests: 5 passed, 5 total
Snapshots: 1 passed, 1 total
Time: 3.072s
Ran all test suites.
* make sure it runs on jenkins build
Change-Id: Ia79cd8ce35dc863c4cc5ce7512998320c7cfdb84
Reviewed-on: https://gerrit.instructure.com/100685
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>