Commit Graph

164 Commits

Author SHA1 Message Date
Omar Gerardo Soto-Fortuño d96f950a5b Fixes to ManageOutcomeItem.test.js
flag=none

test plan:
  - Specs pass

qa risk: low

Change-Id: I177bc065e706adad9147a9c2ace7e938cb2520ba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274122
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-09-22 17:38:25 +00:00
Omar Gerardo Soto-Fortuño cf0045a411 Add updateDeveloperKey to Scopes.test.js
flag=none

test plan:
  - Specs pass

qa risk: low

Change-Id: Ie6c6730126b888de549d7c5668e5bd7794e2990d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274114
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-09-22 15:54:05 +00:00
Davis Hyer 42c2e16189 provide correct courseId prop type
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: I849d3309893b96d2c79b280af6d23718d3e4faff
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274042
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-22 14:58:14 +00:00
Omar Gerardo Soto-Fortuño 283f8dafcd Add url to SVGWithTextPlaceholder.test.js
flag=none

test plan:
  - Specs pass

qa risk: low

Change-Id: I337968cfbf95ed443e0f9e51e7257aa69654d6dc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274109
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-09-22 14:56:54 +00:00
Omar Gerardo Soto-Fortuño 329cefcac3 Add innerHeight to ExternalToolDialog.test.js
flag=none

test plan:
  - Specs pass

qa risk: low

Change-Id: I14145c2211df94ac9c116689fbc35cfd6b73fba6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274108
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-09-22 13:28:37 +00:00
Davis Hyer bb6ef9e2c2 document editorOptions.toolbar prop type fix
refs MAT-453
flag=none

test plan:
  - n/a

qa risk: low

Change-Id: Ia419b06bc994480da5ede82ae1345edf62d23f21
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274075
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-22 13:20:38 +00:00
Davis Hyer 4eeadead61 document heading prop type fix
refs QUIZ-8870
flag=none

test plan:
  - n/a

qa risk: low

Change-Id: I1c8161f26f5c7e91b9de8383cebabc083f9055bc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274065
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-22 13:20:25 +00:00
Davis Hyer 64809fc4b0 provide correct label prop type
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: I3e715619857e027401dedf7ef72d8241585c39fd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274050
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-22 13:20:11 +00:00
Davis Hyer b7086d4ce6 provide correct options prop type
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: Ieefcedb7203d7d3dd291b69be43e1d1ec1a11656
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274051
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-22 13:20:00 +00:00
Davis Hyer 5ebdf0a79d provide correct outcomes.1._id prop type
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: I278452d0905fbc07f3ffdca1e2d96437fa63dfbc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274052
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-22 13:19:48 +00:00
Davis Hyer 9e902ed2d6 provide correct selectedGroupId prop type
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: Ie76f0930218fa481ba95068f589dfe04ab72487d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274055
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-22 13:19:36 +00:00
Davis Hyer d90cbb72a6 provide correct StudentLastAttended props
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: Iec1be0b258ff0105c180e285c5ef822831cdbceb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274056
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-22 13:19:26 +00:00
Davis Hyer 02da0f9f34 provide correct tool.id prop type
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: Id113e7e76bda9378a7cafbf70ac7cab475d04bd1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274057
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-22 13:19:04 +00:00
Davis Hyer 0751b302a7 provide correct rceBodyRef prop type
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: Ida72f9874e08caeb7dddad4df8842e01ff42d1ad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274053
Reviewed-by: Jeffrey Johnson <jeffrey.johnson@instructure.com>
QA-Review: Jeffrey Johnson <jeffrey.johnson@instructure.com>
Product-Review: Jeffrey Johnson <jeffrey.johnson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-09-22 00:30:27 +00:00
Davis Hyer a77ada4722 provide correct disabled prop type
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: Ib99124d9d392a472fe605d4935ed6ce97536ba97
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274045
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-09-21 23:12:52 +00:00
Davis Hyer 282ed0d790 provide correct selected prop type
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: I5d8a978c207e6a81e61312b3dd1bd2f62f5bb90c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274054
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-21 23:12:39 +00:00
Davis Hyer 4939a73400 provide correct prop types to StudentFooter
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: I92734176989135d0c4e05b9f63288290e64c2172
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274037
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-21 21:42:56 +00:00
Omar Gerardo Soto-Fortuño 5c9bd1052c Add onCompose to MessageListActionContainer.test.js
test plan:
  - Spec pass

qa risk: low

Change-Id: I4acc3ab0c9e3ecd6bfb227fac9663cc72f110479
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274036
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-09-21 21:37:09 +00:00
Davis Hyer 7a9c633c2b provide correct borderColor type to View
flag=none

test plan:
  - specs pass

qa risk: low

Change-Id: Ib279b62f4bf0dde50886f0389db90db260ec0597
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274040
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-09-21 21:03:31 +00:00
Omar Gerardo Soto-Fortuño 84336e26d1 Add currentUser in GradesPage.test.js
test plan:
  - Spec pass

qa risk: low

Change-Id: Icca4ab6e36c7ac7a6c5905c7dee59cca52ac1a75
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274030
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-09-21 19:30:03 +00:00
Davis Hyer 95b5ec7e3c fail jest tests with console warnings/errors
This commit introduces the framework for failing tests when a console
warning or error is present. All current warnings/errors are ignored so
as to get to green and follow up changes will resolve the root issue
within our tests.

test plan:
  **BEFORE pulling**
  - run all jest tests
    - notice extraneous noise from console statements
    - notice tests should pass
  **AFTER pulling**
  - run all jest tests
    - notice extraneous noise is significantly reduced
    - notice tests should pass
  - add a console warning/error to any jest test
  - run that test
    - the test should fail

qa risk: low

Change-Id: I43bf605a98a0461426ab1a9d7df40b821f5868a7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273908
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-09-21 17:29:19 +00:00
Ahmad Amireh 7d9bacbde8 extract @canvas/timezone into a package
refs FOO-1891

DateTime parsing and formatting is now provided by the package datetime,
which is now the only module that interfaces with the timezone package.
Date math and utilities can now reside in the @canvas/datetime package,
which are free to utilize the parse and format routines as necessary.

    * packages/datetime: base parse & format routines
    * packages/datetime-moment-parser: a transitive dep of
      packages/datetime; used exclusively by it
    * ui/shared/datetime: canvas-specific math & utilities
    * ui/shared/timezone: deprecated and set to be removed later

Like datetime-moment-parser, datetime is configured in an initializer to
provide it with parameters coming from Canvas locale files as it is
no longer privy to that information.

CHANGES
-------

- date-time-moment-parser package has been renamed to
  datetime-moment-parser for consistency with the rest of the codebase
- hasMeridian has been renamed to hasMeridiem in the datetime package
  and will be renamed elsewhere in a later patch
- tests that rely on datetime formatting using locale-specific formats
  must now explicitly configure the datetime package with those formats
  using the API `getI18nFormats` exported by the initializer, which the
  tests do have access to, unlike the regular codebase
- conversely, tests no longer have to stub I18n phrases using the
  I18nStubber module merely to format datetimes

TEST PLAN
---- ----

The patch has no logical changes so the test suite should suffice, but
if you insist you can verify that any datepicker widget still works OK
using a locale other than en_US.

Change-Id: I8706556e329e8d931c4673d8f24582fc60a72565
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266897
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2021-08-24 17:43:05 +00:00
Jeff Largent 4fe9f01972 Add typescript support
This change adds support for typescript transpilation to our frontend
build via babel, and also updates eslint and canvas_i18nliner to be
able to understand typescript as well. The main goal of this PS is to
enable developers to add typescript code to the Canvas codebase but to
be unopinionated about how type-checking is done; at this stage types
will only be checked by running the new `check:ts` or `check:js`
scripts (which run the typescript compiler directly), or via
integration with an IDE like RubyMine or VS Code.

closes LS-2430
flag = none

Test plan:
  BUILD STEPS:
  - FE build, i18n build, and tests pass Jenkins
  - `bin/rails canvas:compile_assets` still works
  - `RAILS_ENV=production bin/rails convas:compile_assets` still works

  SPOT CHECKING:
  - Starting up rails and run `yarn build:js:watch`
  - Click around Canvas and make sure the frontend still loads as
    normal

Change-Id: I8bb1a0f065e09496a924708dead6fa4518b59496
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270401
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Jeff Largent <jeff.largent@instructure.com>
2021-08-18 18:21:17 +00:00
Ahmad Amireh 83e4f6d4ab extract date-time-moment-parser
refs FOO-1891

this is the start of a series to break apart the inter-dependencies
between timezone and moment.js

the formatting that is done by moment now stands alone in
packages/date-time-moment-parser and is used by ui/shared/timezone. The
formatter depends on phrases coming from the locale files, which are
available to ui/* but not to packages/*, so in an initializer we inject
our custom formats into the package, allowing it to make use of them.

there should be no breaking API changes, even though several APIs were
dropped, as they were all used in test but not in the app code. To
minimize the changes, a specHelpers.js file is now provided by the
timezone package that maintains backwards compat to a reasonable extent.

TEST PLAN
==== ====

although the tests should be covering this, it wouldn't hurt to manually
exercise any of the date picker widgets

Change-Id: I0c59ad2df8f7392425debb6ec448ec1b4fb029c6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265313
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
2021-08-05 21:53:25 +00:00
Ahmad Amireh 52fe84dbb2 rework handlebars dependency on brandable_css
refs FOO-1116

right now in order to build the javascript, we must run brandable_css
first for the specific purpose of injecting into handlebars templates
their corresponding stylesheet file with the checksum as reported by
brandable_css

this patch moves things around such that Rails provides this mapping of
"handlebars template" to "CSS variant file checksums" in a global
variable (Rails is privy to this information already), webpack then at
build time injects only a reference to that mapping into the template,
then our runtime brandable-css JS helper will resolve that reference
from the mapping and request the correct file based on the current
user's variant

[1] rails assigns window.BRANDABLE_CSS_HANDLEBARS_INDEX with content
like this:

    [
      [ "new_styles_normal_contrast", "new_styles_high_contrast", ... ],
      {
        "0c": ["0f4f01ab86", 0, 0, "e3e7211701", 3, ... ],
        ...
      }
    ]

the structure of the mapping is explained in brandable_css[1], it is
a bit overtuned to reduce the size as much as possible since this is
included for ALL pages even though the templates in question may never
be rendered (right now it's ~1.5kB and should never grow)

[2] webpack asks @canvas/brandable-css to loadStylesheetForJST using the
contrived id for that file (frontend_build/i18nLinerHandlebars.js:92)

[3] brandable-css/index.js will decode that structure to arrive at the
exact URL for the stylesheet for that template for the current user
variant

with this , we should be able to optimize "rake canvas:compile_assets"
to run both brandable_css and webpack in parallel, which will greatly
mitigate the performance decrease from moving from node-sass to
dart-sass

== test plan

go to some assignment's syllabus page, edit the file
app/stylesheets/jst/courses/Syllabus.scss with something fun like:

    #syllabus .day_date { background: $fire; }

rerun `npx brandable_css`, reload the page and verify it's on fire,
optionally change your setting to enable High Contrast mode, reload
the syllabus page and verify the color changes (it picks up the other
variant stylesheet)

[1]: 80af6e70af

Change-Id: Ie48cc71d4837ee02313b2d45a9ad2944725acad2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268615
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2021-07-14 22:19:20 +00:00
Ed Schiebel 04fe2556c3 Reorganize some of the CanvasRce properties
closes MAT-328
flag=rce_enhancements

It was very confusing having 2 components named CanvasRce, so
the one in the canvas-rce package was renamed to simply RCE.

That the props for menu, toolbar, and plugins were not consistent
between canvas' CanvasRce and the RCE's CanvasRce was a source
of confusion (and just wrong). This moves them into the editorOptions
property where are all the way through the component hierarchy.

test plan:
  - from the canvas-rce directory run yarn demo:dev
  > expect the custom toolbar and menu options to work
  > expect the readonly prop to work (something was broken there too)

  - enable the site_admin feature "Assignment Enhancements - Student"
  - create a text entry assignment
  - as a student, go to the assignment and submit you work
  > expect the page to work like before

Change-Id: I982c7c54750e7a3d9e230e0ab6d16bd078ce9030
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268505
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-07-10 13:23:49 +00:00
Jeff Largent d659447da7 Adds K-5 schedule tab jump to navigation button
Replaces the hidden duplicate weekly nav toolbar with a separate "Jump
to weekly navigation" button that returns focus to the lone navigation
toolbar (for better keyboard-only/screenreader usability).

fixes LS-2131
flag = canvas_for_elementary

Test plan:
  - As a student enrolled in a K-5 course, go to the dashboard
  - Switch to the schedule tab
  - Tab to the bottom of the planner
  - Expect a hidden button to appear reading "Jump to navigation
    toolbar"
  - Press enter, and expect the button to take you back to the "Today"
    button
  - Press left or right to switch to one of the next/previous buttons
  - Tab back to the "Jump to navigation toolbar" button
  - Press enter, expect focus to jump to whatever button was last
    active on the toolbar (next/previous)

Change-Id: Ic715d64603253412d2b97e961988ff9fcd6e92a5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263277
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeff Largent <jeff.largent@instructure.com>
2021-04-21 18:19:45 +00:00
Jeff Largent c71d37fc2b Add K-5 Manage course button and tray
This change adds a slide-out course navigation tray and associated
button to the K-5 course home page for teachers. Also renames the
Overview tab to "Home".

closes LS-2028
flag = canvas_for_elementary

Test plan:
  - Enroll as a teacher in a K-5 course
  - Go to /courses/:course_id
  - Expect to see a "Manage" button in the upper-left
  - Expect clicking that button to open a tray inside the global nav
    bar with the course's nav links inside it
  - Expect the links to be the same as the classic Canvas nav for that
    course, including the icons showing which links are hidden from
    students
  - Expect the order of the links to also be the same
  - Click a link, expect it to take you to a classic Canvas page
  - Click the "home" link on the classic Canvas nav, and expect it to
    take you back to the K-5 course home page

  - Also expect the "Overview" tab to be called "Home" now

Change-Id: I08a375d70f98a25948073be624432edbcd1b6d04
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262895
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jonathan Guardado <jonathan.guardado@instructure.com>
QA-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-04-15 19:56:28 +00:00
Ahmad Amireh 4243097b21 rename some things
fixes FOO-1265

[skip-eslint=true]
[pin-commit-analytics=7e49eefd7f59cbf43fd03bf8957bbbfa76f8d9d5]
[pin-commit-demo_site=adade2e38e46a358a4643cd3db2fe5ccffe39ec5]
[pin-commit-instructure_misc_plugin=47a3161102b0611af56d134fbd0c828ddc1b8abf]
[pin-commit-migration_tool=0dbac2f5b421d894395605ce4b583ef0f7d60b22]
[pin-commit-multiple_root_accounts=cc96d28c0d59bbe47acc64de4fdd8e1d2b029805]

Change-Id: I14c07f20bd260cf0de1f48ceb70b3c2313edf2d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258807
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-04-06 01:12:49 +00:00
Jeff Largent a2a795a823 Make K-5 Dashboard tabs sticky
Update the K-5 Dashboard tabs so they will stay fixed to the top of
the viewport when the user scrolls. Also added some logic to shrink
the "Welcome, <student>!" message at the top of the tabs when
scrolling so as to not take up too much vertical space.

closes LS-1862
flag = canvas_for_elementary

Test plan:
  - Load the K-5 dashboard as a student
  - Scroll down on the Homeroom tab (either enroll in a bunch of
    courses or make the window small so that scrolling is possible)
  - Expect the tabs to be fixed to the top of the screen and the
    welcome message to shrink to what looks like an h2
  - Scroll back to the top of the screen and expect the welcome
    message to enlarge back to the look of an h1
  - Switch to the Schedule tab
  - Scroll back in time to load more events
  - Expect the tabs to be fixed to the top of the screen and more
    events to be loaded
  - Also expect the planner view to still be centered on "Today",
    rather than the events from the past

Change-Id: If8b2297b0d1b05135a9b635588a6e8f7ac275c21
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258657
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
2021-02-16 16:07:01 +00:00
Ed Schiebel a0e985948e Update tinymce and @tinymce/tinymce-react
closes LS-1609
flag=rce_enhancements

Had to nohiost tinymce so it remains w/in canvas-rce
where RCEWrapper.js can require tinymce's stylesheets, but it
still needs to be a dev dep. of canvas-lms because there are
specs that import tinuymce.

Moved the matchMedia jsdon polyfill into jest-setup where it can be
used by everyone. Need it there since the new tinymce calls it.

test plan:
  - specs pass
  - the RCE still works and looks the same
    Sorry, I don't know what else to say

Change-Id: I8c956664176b7c25995a55e0c6fea4dafad3970f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/255604
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2020-12-21 22:23:52 +00:00
Charley Kline 0c21111e77 Make type filter searchable on courses main list
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>
2020-05-19 01:24:11 +00:00
jonw d48344a5e1 add overrides and editing to bulk assignment edit
closes LA-847
flag=assignment_bulk_edit

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

Change-Id: Ia2206bcae8b462535e3bcc99bf024bfaae39bc3e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/230953
QA-Review: Anju Reddy <areddy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
2020-04-06 21:36:14 +00:00
Ryan Shaw 2ef60dfc22 spec: fix handlebars transform for jest tests
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>
2019-09-05 15:03:54 +00:00
Ryan Shaw e782fb7012 filter non-actionable console logs everywhere else too
I did this first for canvas’s jest tests, but this does it for
karma/qUnit, canvas-rce, canvas-planner and dev mode too.

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

Change-Id: I5f5cee08d705b749526be87fd79cfc937c015145
Reviewed-on: https://gerrit.instructure.com/206879
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-27 19:54:09 +00:00
Ryan Shaw cfb60be2da Filter out unactionable console messages
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>
2019-08-26 22:17:54 +00:00
Clay Diffrient 6554a019d8 Remove autobreadcrumbs from xhr requests in Raven
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
2019-08-20 23:34:20 +00:00
Clay Diffrient d2c7180e12 spec: Mock fetch on global
refs COREFE-214

Test Plan:
  - Specs pass

flag = none

Change-Id: I6c7cbcb6fdc6771e56ff78b37a532948c19610c6
Reviewed-on: https://gerrit.instructure.com/205825
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-20 19:28:48 +00:00
Clay Diffrient a6def4ef80 Remove other places where sentry was being noisy
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>
2019-08-09 15:31:14 +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
Clay Diffrient e6f61f70bb Fix failing setupRavenConsoleLoggingPlugin on the master build
Change-Id: I0766d301653a6cf992cad5407c6e6d932aef65fc
Reviewed-on: https://gerrit.instructure.com/195853
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-30 20:56:41 +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
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
Brent Burgoyne 70bc10e80c un-mock RichContentEditor in jest tests
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>
2019-03-22 17:29:58 +00:00
Brent Burgoyne a7b07e869e make jest support files that import handlebars
Change-Id: I073ea3f8b54cf46cd2b4c2437aad5ee13c95dc7c
Reviewed-on: https://gerrit.instructure.com/186286
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2019-03-22 15:38:23 +00:00
Steven Burnett 637d2f6241 clean up jest-setup
Test Plan:
- tests pass

Change-Id: I2a536b3094f78270365a75122e0be1fb742bbd34
Reviewed-on: https://gerrit.instructure.com/186330
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-21 19:36:57 +00:00
Steven Burnett 0716aed60d silence instui focusable errors
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
2019-03-21 17:12:45 +00:00
Jon Willesen 559dc2953f A2: create message students who modal basics
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>
2019-02-28 16:12:39 +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
Jon Willesen eb570068d3 A2: convert teacher view to use apollo components
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>
2019-02-20 16:13:56 +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
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
Landon Gilbert-Bland 56f9882e41 Make core translations and svg imports available in jest
Refs COMMS-1751

Test Plan:
  - Jenkins is happy

Change-Id: Ibe3e7ce2b22f7acd4ba7a80a84eb5a4fff5bf645
Reviewed-on: https://gerrit.instructure.com/173628
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
2018-11-29 16:09:47 +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
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 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
Clay Diffrient 5abf86627b Enhance sentry deprecation reporting
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>
2018-08-24 17:20:41 +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 b991b7ed38 jest: mute instUI warning about needing dir attr
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>
2018-06-13 16:14:37 +00:00
Ryan Shaw a33231cf0a let jest know about some of our aliases
…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>
2018-01-12 19:16:18 +00:00
Ryan Shaw 88c1c61bdf Add Jest for testing JavaScript
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>
2017-12-14 22:08:09 +00:00