refs LS-3017
flag=none
In regards to the BulkEditDateSelect change:
The previously used timezone library was formatting the date to null on
blur which was throwing the error. Switching to the new standard as it
both handles the formatting correctly and is the new preference
test plan:
- tests pass
qa risk: low
Change-Id: I8103cfdf2ccd9bc8ad4f4b58c192c05ae0e34596
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286329
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>
refs FOO-2696
flag = none
jest needs to explicitly load the _core_en translation file since its
i18nTransformer is no longer a thing (and it's what was doing that
before)
otherwise, this just cleans up the remaining references to i18n! in the
code, aside of eslintrc which we'll address in FOO-2738
Change-Id: Ie0a74b46c4d0a48188ba86765b46b2793eed94d7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286763
Tested-by: James Butters <jbutters@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
refs LS-3017
flag=none
Shape is not a valid prop type, but rather a function that returns a
valid prop type. Since no shape was being defined, requiring a simple
object seemed more appropriate.
test plan:
- tests pass
qa risk: low
Change-Id: I10d6743669c3138d6426a455868f5af1c33722fe
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286330
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>
refs LS-3017
flag=none
These warnings were not causing tests to fail for some reason. I wasn't
able to pin the reason down, my suspicion is that fetch-mock uses an
internal logging mechanism.
test plan:
- run `yarn test:jest ui/features/k5_`
- there should be no console output regarding unmatched requests
qa risk: low
Change-Id: I4e8eb876571ca74eb0b2edef6a62640387f15a15
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286391
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>
refs FOO-2697
flag = none
on "babel-plugin-transform-imports": the behavior of this plugin was
surprising to me in that it not only rewrote the specifiers to point to
the CommonJS instead of the ESM variants, but it actually changed the
specifiers to point to the exact file that exports the symbol through a
mixture of fs globbing and guesses.
Consider the following import:
import { DateTime } from '@instructure/ui-i18n'
Normally, you'd think we'll be loading the {main,module,browser} file of
the @instructure/ui-i18n package and refer to the `DateTime` symbol
exported by that file. With the plugin activated, however, the import
*itself* changes to:
import DateTime from '@instructure/ui-i18n/lib/DateTime.js'
This is no longer merely a variant rewrite in any way as we're no longer
loading the same file. This caused new problems to surface that up to
this point were not encountered, as now we're actually loading the
entrypoints as specified.
An example of this is in that specific package where it (its entrypoint)
loads a package `decimal.js` whose ESM variant doesn't work as-is but
its CJS variant does -- something neither we nor the InstUI team were
privy to as the plugin was simply clobbering this piece of information.
~ test plan ~
- jest suite runs and passes
Change-Id: I55d7db1ede742e0f588a84d54a761b7aba03729f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283543
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
fixes VICE-2255
flag=discussion_anonymity
note 1: changing this settings will not persist
as the backend portion will happen in a different ticket
note 2: I had to put checkbox inside view even if
checkbox group wants only checkbox children because
it was the best way i can indent it. i added it to jest's
ignored errors
test pilan:
- with discussion redesign ff off but discussion anonymity ff on,
- visit discussion index page as a teacher
- verify that when you open the top right cog menu
- you do not see a Create anonymous discussion topics checkbox
- turn on both react discussions post and discussion anonymity ff's
- revisit index
- verify that cog menu checkbox has a Create anonymous discussion topics
checkbox
- verify that it is only enabled if parent Create discussion topics
is checked
Change-Id: I8fb22b10955d952a90d7c6c03c137cfa9a097ffd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278783
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
minor QOL mainly for me; put webpack-specific configuration in its own
folder, make it portable, and make room for esbuild
the __webpack_public_path__ initializer no longer sources the value from
the build module, instead it uses a pre-defined global that webpack
injects
~ test plan ~
build is OK
Change-Id: I4ba4a3c0cb9175f96096f2b78022e152c04fc75d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276183
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>
This change stubs window.scrollTo and several window navigation
functions (window.location = '...', window.location.href = '...', and
window.location.reload()) with noops to suppress JSDOM messages
warning that these functions aren't implemented. E.g. these ones:
Error: Not implemented: scrollTo
Error: Not implemented: navigation (except hash changes)
While potentially useful if you're expecting those browser APIs to
work in a JSDOM environment, they noise up our Jest logs real good.
Test plan:
- Tests still pass
Change-Id: I9166d0ee05273cc07069b62a1a041eeb335fbfe6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275919
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeff Largent <jeff.largent@instructure.com>
Closes LS-2731
Test Plan: Does not emit error/warning now in Jenkins
Change-Id: Iccb58891d23f521acfe3b5ff78deb9c32269b7c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275882
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
refs LS-2655
flag=none
- this updates the files under ./ui, a few ancillary files and specs.
- Sadly the commit hook ran prettier and
fiddled with the formatting of a handful of files too.
- Also made a few changes to quiet lint errors
- Also updated OutcomeManagement.test.js. I don't understand why,
but 'renders ManagementHeader with lhsGroupId if selected a group in lhs'
started failing with this change, even though nothing obviously related
changed. The problem is that the modal isn't getting attached to the
document being tested. The spec changed to test that the modal contained
what it's supposed to contain.
test plan: jenkins passes and the RCE works
Change-Id: I48d85077bdbf7563cb07510d3e71d2b448c55e49
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275301
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>