Commit Graph

159 Commits

Author SHA1 Message Date
Jake Oeding 7d1e4e132b migrate timelateinput tests to rtl
closes EVAL-1855
flag=none

test plan:
  - specs pass

Change-Id: I70fddb5ac0120fa3ab77d7b9039a424fd4e78184
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271521
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
QA-Review: Jake Oeding <jake.oeding@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-08-20 15:36:09 +00:00
Jake Oeding 7c58b26d5d migrate lateness handling to new component
Extract the logic that handles entering an
amount late in the SubmissionTrayRadioInput.
Move  new component to a ui/shared directory
so that the logic can be reused elsewhere in
Canvas.

closes EVAL-1851
flag=none

Test plan:
- open up tray in gradebook for a student's
  submission
- change the status of consecutive student
  submissions to late and enter different
  values for each
- ensure the TimeLateInput functions as
  expected (i.e. has a default value, you can
  enter a new value, request fired on blur if
  a new value is entered)
- swap between the students via the arrows in the
  tray and confirm that the value in the
  TimeLateInput updates

Change-Id: I2e7d2f6448acc40800c898286023e537d7a387db
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270345
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-08-10 19:46:11 +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
Jackson Howe 052e049d95 Add learning mastery gradebook tab to k5 grades
If the learning mastery gradebook is enabled for a course, show
secondary tabs on the k5 gradebook to allow students to switch between
assignments view and LMGB. Moves the associated components into the
grading-summary package.

closes LS-2193
flag=canvas_for_elementary

Test plan:
 Setup:
 - Enable `Learning Mastery Gradebook` and `Student Learning Mastery
   Gradebook` course flags and `Account and Course Level Outcome
   Mastery Scales` account flag
 - Set up a k5 subject with several assignments
 - Add some outcomes to the course
 - Create some rubrics and import those outcomes into the rubric (i.e.
   click `Find Outcome`)
 - Align those outcomes with the assignments (i.e. on each assignment
   click `+ Rubric` and select one of the rubrics)
 - Grade a student on each assignment against the rubrics

 Test:
 - As a student, open classic grades and k5 grades in separate tabs
 - Click `Learning Mastery` tab
 - Expect LMGB content to be the same in classic and k5 canvas (the
   content in k5 mode will be larger per k5 theming)
 - As teacher, go to course outcomes, select mastery tab, and give one
   of the mastery levels a custom name
 - As a student, load the k5 LMGB again and expect the mastery level
   name change to be reflected

Change-Id: I0b4d1c2c21d0756552d04e5c7cbaa869cfc49aeb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/264488
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: Peyton Craighill <pcraighill@instructure.com>
2021-05-12 14:57:40 +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
Edwin Ramirez e03e41dc4d reset message student modal to open after closed
closes: EVAL-1459
flag = none

Test Plan:
1.  Log in as Admin or Teacher
2.  Go to Feature Options tab in root account settings.
3.  Make sure "Student Context Card" is ON.
4.  Navigate to a Grade book view.
5.  Click on a student's name.
6.  On the Student detail pane, click on the Message button.
7.  Click on the "Close" button (not the "X").
8.  Click on the Message button again.
9.  Confirm the message modal does open again.

Change-Id: I366cfed33498a11937777ac95d86fed8c780f810
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258466
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-02-09 21:05:36 +00:00
Jeremy Stanley 5566323f4f rip out conditional_release service
this commit removes Canvas's ability to talk to the
conditional_release service. before applying this patch set,
if you have data stored in a conditional_release service, run
the following to import its data into your canvas database:

 ConditionalRelease::Assimilator.run(root_account)

test plan:
 - smoke test all mastery paths functionality (editing,
   unlocking, path selection, mastery path stats)

closes LS-1071

Change-Id: I2e33129a5af50c1b92ba8ba7a233e0a3ad66ecc4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242961
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2020-07-28 18:04:55 +00:00
Jared Amen f8cc3c64ed Add a flag to disable toast notification timeouts
test plan:
  * Go to account settings
  * Enable the flag to disable toast notification timeouts
  * Do something that would force a toast notification to pop up
    (remove a user from/add a user to a course, join a course, etc.)
  * Wait *roughly* seven seconds - the toast notification should not
    disappear. It will take a day for this notification to disappear.
  * Disabling the flag and repeating steps 3 and 4 should result
    in the toast notification disappearing after *roughly* seven
    seconds as expected.

closes LS-1138

flag = none

Change-Id: I2cacf0bf48568c9b5e88743c44bfd1faececfc51
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242612
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2020-07-23 18:24:30 +00:00
Drake Harper 32446fe0f4 Remove one of the links on the announcement body
Test Plan:
-body of announcement on the all announcements page is not a link

fixes VICE-544

flag = none

Change-Id: I50d1780965c7e9d9ed26abb51583ef0a294e49c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242005
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2020-07-08 20:22:13 +00:00
James Williams 7b44b5f4ce port conditional release rules editor UI
test plan:
* enable native conditional release on the
 root account via the console by running:

Account.default.tap do |a|
  a.settings[:use_native_conditional_release] = true
  a.save!
end

* enable the "Mastery Paths" feature on the account
 or course if not already
* the "Mastery Paths" editor tab should be shown
 when editing an assignment
* the editor should load independent of the
 conditional release service
* it should allow selecting assignments and
 modifying scoring ranges
* it should save via the native rules API when
 the assignment is saved
* when the assignment is opened again for editing,
 it should pull the rules back from the native API
 and should appear as previously saved

closes #LA-1063

Change-Id: Iea3b2f8346b8989542010f9d571bf1eee5e03622
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239985
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-06-16 14:57:51 +00:00
Caleb Guanzon a693d3ca31 add alt to CourseItemRow Avatar
fixes VICE-539
- using safari + voiceover,
- create a course announcement
- view course announcements page
- traverse the page using voiceover until focus
is on avatar
- verify that voiceover reads user's name

Change-Id: I8c19adb04a6cf1a965f48d29c15b3ee5d31296e5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239975
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>
2020-06-12 15:31:14 +00:00
Michael Brewer-Davis f869f6b1f9 add ui for adding conference from calendar entry
closes CAL-4
flag=calendar_conferences

Test plan:
- enable FFs ("Add Conferences fro Calendar" and
  "Allow Conference Selection LTI placement"
- enable BigBlueButton at /plugins/big_blue_button
- enroll a user in multiple courses
- add conference LTI tool to one course
- from calendar, add an event for one of the courses
- verify that option to add calendar event is present
  - for course with LTI tool, should be dropdown between LTI and BBB
  - for course without, should be button for BBB
- add BBB conference
- verify that conference link is added and button hidden
- save event
- verify that conference link shows on the event "show" dialog
  (on clicking in calendar, before clicking edit)
- verify that removing the event and saving persists
- add LTI conference in that course's context
- verify that dialog launches to go through LTI workflow
- verify that conference is added, saved, can be removed
- verify that when conference is selected, dropdown is shown
  allowing switching to BBB

Change-Id: I4892d49efcfd41e9c3a223faf071b677e26ba8fb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234639
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Ken McGrady <kmcgrady@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
2020-04-30 18:06:01 +00:00
Jeremy Neander dc203927b3 relocate naive request dispatch
This simply moves files in advance of the real work for
TALLY-498. The code which multiple implementations will
share needs to live in a shared location, instead of
within New Gradebook.

refs TALLY-498
flag = none

test plan:
 * Verify Jenkins passes

Change-Id: I653783a2efedf885a77ae855332838e89fb43e1f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/225932
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2020-02-12 21:03:11 +00:00
Michael Brewer-Davis 238b27aab8 truncate outcome titles in individ results
closes OUT-3381

Test plan:
- create outcomes and outcome groups with long
  and short titles
- align assignments to the created outcomes
- assess a student for some of those assignments
- visit the student's page in the learning mastery
  gradebook
  (go to learning mastery gradebook and click on
  student's name)
- verify that the long groups and outcomes are
  truncated and have tooltips with their complete names
- verify that short groups and outcomes do not
  have tooltips

Change-Id: Ibc3ae5a3234188219f1ffe56995344d117c7cb19
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217843
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Jody Sailor
2019-11-22 15:59:29 +00:00
Clay Diffrient 40292c2afa Run prettier on spec/javascripts/jsx/ from shared to webzip_export
This was achieved by turning the prettier rule on in .eslintrc.js
then running:

./node_modules/eslint spec/javascripts/jsx/<folder_name>/**/*.js

on each folder from the start directory to the end directory listed
above.

Test Plan:
- Automated tests pass

refs COREFE-347

flag = none

Change-Id: I41ba6f432b258dc2f0ac65fc56a1ff712be8eca6
Reviewed-on: https://gerrit.instructure.com/212653
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-10-10 19:34:15 +00:00
Xander Moffatt e73f1b60d9 add data attribute to all lti launches
closes PLAT-4835

test plan:
* specs

Change-Id: I4132f4209dd3d93520e8cea884adbd30a2a904d8
Reviewed-on: https://gerrit.instructure.com/209643
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
Tested-by: Jenkins
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2019-09-17 17:33:10 +00:00
Clay Diffrient b2c3c62724 Add js tests to new jenkins
Change-Id: Ia30e8fd105738a95fb10364e1643be179876b81b
Reviewed-on: https://gerrit.instructure.com/207502
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2019-09-04 20:06:02 +00:00
Jeremy Neander aaff474776 spec: [ci-coverage] use dialog reference for queries
This spec has been flaky. The theory is that it might not be acting on
the correct DOM elements, due to DOM pollution. The result is that it
ends up waiting on behavior that was never triggered, and times out.

Change-Id: I107aac0e9fe8185dcdf81137a71ca5a0e75ee7f9
Reviewed-on: https://gerrit.instructure.com/208056
Tested-by: Jenkins
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
2019-09-04 17:05:10 +00:00
Ryan Shaw 3718da12c5 Upgrade canvas-lms proper to instUI 6
closes: COREFE-209 COREFE-207 COREFE-230

this should help bugs, spec flakiness, and bundle sizes

test plan:
* make sure that the pages that are still using the old 5.x one from
  @instructure/ui-core still work, namely:
  app/jsx/account_course_user_search/components/CoursesToolbar.js
  app/jsx/blueprint_courses/components/CourseFilter.js
  app/jsx/grade_summary/SelectMenu.js
* make sure themeing of instUI components still works and picks up
  theme editor settings
* make sure bundle sizes are smaller, not bigger
* check tinymce-a11y-checker that it still works the same
  (With the rce-enhancements feature both on and off)

Perf test plan:
* make sure tree shaking is working
  load it up in one of the webpack bundle visualizers to see
* make sure we are not loading *all* of the icons


this commit also updates the instUI6 version we use from 6.9 6o 6.10
which has  fix for <Alert> unmounting that ed fixed:

Test plan:
* you should see less console arrows about react unmounting nodes
  Associated with the CanvasSelect component

Change-Id: Ied2ff1d1521b0900126136170f103dea27bc554a
Reviewed-on: https://gerrit.instructure.com/204545
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-30 14:36:53 +00:00
Gary Mei d9ee4f2309 add group filter to external tools assignment page
Assignments of type external tool should also have a student group
when "Launch SpeedGrader Filtered by Student Group" is enabled.

closes GRADE-2366

Test Plan
- Enable "Launch SpeedGrader Filtered by Student Group" from the
  course settings page.
- Add an LTI app to the course. Turnitin is available from this
  configuration url:
  https://www.eduappcenter.com/configurations/6h0yray8dt6cr2t8.xml
- Create an assignment from that external tool.
- Navigate to the assignment page.
- Verify that the student group filter is present and works.

Change-Id: I39055d8c9f79cb2977c755fc4ca6dc46897f20c6
Reviewed-on: https://gerrit.instructure.com/204911
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Tested-by: Jenkins
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-08-29 20:30:12 +00:00
Aaron Griffin 8ad72a6f1c Add numberHelper support for 'e' notation
Javascript's parseFloat supports this natively, so we can handle it if
all else fails.

Test Plan:
- As a teacher, create a quiz with a numeric question
- Enter `3e4` as an answer
- On blur, see it replaced with `3000`

Closes QO-512

Change-Id: Ia7c7e196ed0baa302fc6b6f79eda611955f75d2b
Reviewed-on: https://gerrit.instructure.com/206463
Tested-by: Jenkins
Product-Review: Kevin Dougherty III <jdougherty@instructure.com>
Reviewed-by: Connor Williams <cowilliams@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
2019-08-28 17:05:22 +00:00
Ryan Shaw 78a25bf4e8 [codemod] convert functions to fat arrows
This is the result of running:

jscodeshift -t ../js-codemod/transforms/arrow-function.js .

see: https://github.com/cpojer/js-codemod#arrow-function

Transforms callbacks only when it can guarantee it won't break this 
context in the function. 
Also transforms function() { }.bind(this) calls to () => {}.

jscodeshift -t js-codemod/transforms/arrow-function.js <file>


Change-Id: I04d20c818002b3dce5a43d8e91f01d904f966706
Reviewed-on: https://gerrit.instructure.com/205785
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-26 22:20:33 +00:00
Ryan Shaw afa9bfc624 fix a deprecation from sinon.sandbox
We get a lot of these in our logs:
`sandbox.create()` is deprecated. Use default sandbox at `sinon.sandbox`
or create new sandboxes with `sinon.createSandbox()`'

This should fix that

Change-Id: I3fda9d219dbcc768405763876924eef16d0d1c9b
Reviewed-on: https://gerrit.instructure.com/206013
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-21 16:04:42 +00:00
Ryan Shaw 0da4de9d32 fix more specs relying on babel ie11 transpilation
Change-Id: I8141f30b9da5ba2a91791f02e4755d5df13a0ea1
Reviewed-on: https://gerrit.instructure.com/203949
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-08-06 15:34:17 +00:00
Ed Schiebel 28ea3000ef Fix Select deprecations with CanvaSelect
this commit add the new CanvasSelect which wraps the new controlled-only
INSTUI Select (single select only) to provide a nearly drop-in
replacement for the deprecated INSTUI Select used in canvas.

This new CanvasSelect is then used in people_search.js and
TimeZoneSelect/index.js to resolve the
deprectation warnings.

changes include an upgrade to ui-select 6.8

closes ADMIN-2775, COREFE-186 COREFE-184

test plan:
  - nav to a course's people page
  - click on the +People button
  > expect the Role and Section selects to work as expected
  - nav to the account's people page
  - click on the pencil icon to the right of a user
  > expect the Time Zone select to show a blank line, then 2 groups
    of time zones
  > expect the select to work as expected
  > expect screenreaders to tell you interesting things as you
    interact with the select

Change-Id: I5dcfb2c1c8ca64071ce9dbf0a194777f10c711cf
Reviewed-on: https://gerrit.instructure.com/202508
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-08-05 19:30:43 +00:00
Ryan Norton e78c75364c handle Select deprecation in Conversation filter
as part of the instUI upgrade we are removing the Select
component in favor of native select

Test Plan:
* as a user, navigate to the conversations page (Inbox)
* in the top left, there are two select filters
** we are addressing the second one that defaults to Inbox
* Confirm that:
** the dropdown shows the various filter options (inbox, unread,
   starred, sent, archived, submission comments)
** changing the filter option shows the correct messages
** the ui looks "normal"

fixes COMMS-2239

Change-Id: I860601c4bac873677b0c66a7060176fc5426c4b1
Reviewed-on: https://gerrit.instructure.com/202665
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-07-29 16:43:52 +00:00
Gary Mei 9a278be3c3 add student group filter to assignment page
When the setting to filter SpeedGrader by student group is on, a
dropdown of student groups will appear on the assignment page and a
student group must be selected in order for the SpeedGrader link to
work.

closes GRADE-2242, GRADE-2243, GRADE-2244

Test Plan
- In the course settings, enable "Launch SpeedGrader filtered by
  student group".
- Reset any existing settings for gradebook filtering by student
  group, if exists:

  ```
  YOUR_USER.preferences.dig(:gradebook_settings, COURSE_ID,
  "filter_rows_by")["student_group_id"] = nil
  YOUR_USER.save!
  ```

- Navigate to the assignment page. Verify that a select menu appears
  above the SpeedGrader link.
- Verify that the SpeedGrader link is disabled, with a tooltip
  explaining why.
- Verify that the select menu says "Select One".
- Select a student group.
- Verify that the SpeedGrader link no longer has the tooltip, and is
  no longer disabled.
- Verify that, on refresh, the selection was persisted.
- Verify that New Gradebook has the same selection.

Change-Id: Iab18545eafaf82e2da07b322f8fb108d95f8db68
Reviewed-on: https://gerrit.instructure.com/199239
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-07-17 15:58:16 +00:00
Mysti Lilla cce8a7626e Show when no results found in ImageSearch
fixes ADMIN-2722

Test plan
- Ensure Unsplash image searching is
  enabled
- Search for a nonsense term or nsfw
  term
- Ensure you get the text "No Results
  found for {search term}"

Change-Id: I7147384b56a8b180498fbd6d5d406b77a5ebec6f
Reviewed-on: https://gerrit.instructure.com/197422
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Product-Review: Lauren Williams <lcwilliams@instructure.com>
2019-06-13 19:43:49 +00:00
Jeremy Stanley dc7a511c8a conditionally render prev/next in course card image search
test plan:
 - in a course card image search,
   - the prev/next buttons appear only at the bottom
   - the prev/next buttons are on the left/right sides of the page
     instead of the middle
   - the prev button does not appear on the first page
   - the next button does not appear on the last page
     (actually I don't think it's possible to find a last page)
   - after selecting the next page button, it should retain
     keyboard focus after the next page loads
   - after selecting the prev page button, it should retain
     keyboard focus, unless you just went to the first page,
     in which case the next page button should be focused
   - If the next/previous page direction fails for some
     reason and both next and previous buttons disappear
     it will go to the input

fixes ADMIN-2673

Change-Id: I65fb39454d2f736cd75b310af93c2e06ce7f28c8
Reviewed-on: https://gerrit.instructure.com/196101
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Product-Review: Lauren Williams <lcwilliams@instructure.com>
2019-06-10 17:13:27 +00:00
Mysti Lilla 1d9e6a1f51 Announce image search results
closes ADMIN-2674

Test plan
- Start up a search with Unsplash
  enabled
- Ensure that you get SR announcements
  when the image search returns results
  or when you click previous/next page

Change-Id: If1de1bb359dabb847b74c8b87b659b83db9cec2d
Reviewed-on: https://gerrit.instructure.com/195954
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Product-Review: Daniel Sasaki <dsasaki@instructure.com>
2019-06-05 19:52:21 +00:00
Mysti Lilla cd560cc435 Unsplash attribution
closes ADMIN-2244, ADMIN-2672

Test plan
- Ensure Unsplash is turned on
  for course card images
- Go to the course image search
  dialogue
- Search for an image
- On hover and focus, verify
  you can see the name of the person
  who uploaded the image
  and can click on the link
  to access their profile
- Ensure the alt text is showing
  correctly and the images are
  cropping so they're all
  about the same size as the course
  card image will be

Change-Id: I0985c6e607e58edc901041cb73a16a45403c01e5
Reviewed-on: https://gerrit.instructure.com/194861
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Laura Leavitt <lleavitt@instructure.com>
2019-05-29 20:06:12 +00:00
Carl Kibler e02bbed33c search unsplash instead of flickr for course cards
closes ADMIN-2630

test plan:
 - Enable Course Cards feature flag
 - Before adding an Unsplash plugin setting in SiteAdmin, go set a
   course image. It should show Flickr logo and work.
 - Now Add API KEY for Unsplash plugin in SiteAdmin
 - Go change course card and search for images
 - Verify:
 -   Unsplash logo shows
 -   search works
 -   next/previous buttons show up correctly and work
 -   verify on network tab that API calls are being made to Canvas and
     not to Flickr.

Change-Id: I4bed533de3cfb8afa4bb38b9eb1e7b3062de820b
Reviewed-on: https://gerrit.instructure.com/193521
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Tested-by: Jenkins
QA-Review: Daniel Sasaki <dsasaki@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
2019-05-15 18:43:21 +00:00
Carl Kibler 5477931b67 migrate course card search towards using Unsplash
closes ADMIN-2242

test plan:
 - enable 'Unsplash Image Searches' and Course Card Images flags
 - go to a Course and open modal to change photo
 - Should see:
   - Unsplash logo
   - the Flickr SafeSearch text is gone
   - Can search images (note... uses Flickr for search...)
 - Selecting image puts it in card spot for course
 - Diable Unsplash Image Searches and redo steps. Verify
   it goes back to normal Flickr text and logo.

Change-Id: I9a02608deee6fb2a3f13024aede1e90d197d915b
Reviewed-on: https://gerrit.instructure.com/191545
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Tested-by: Jenkins
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-05-14 18:11:54 +00:00
Matthew Lemon 0eeff06575 make unread part of the title for discusions/announcements
fixes COMMS-2038

When we have an object that's unread, we should include that information
as a part of the title, rather than as an independent piece of text for
SR users. This ensures that it's an intentional part of the object,
rather than just being associated to the object by proximity.

Test Plan
- create a course and add a student
- create several announcements and discussions in the course
- masquerade as the student
- use a SR to navigate through the discussions and announcements
- notice that the unread indicator is now part of the announcment and
discussion title

Change-Id: Ia3e469171c3b066cb17ad09ffa1bf504cdfca4cc
Reviewed-on: https://gerrit.instructure.com/192098
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2019-05-06 20:57:31 +00:00
Ryan Shaw 8598c07d94 eslint: remove some eslint-ignore comments
We really should only be writing eslint-ignore in files where we KNOW
We don’t want to do what it is suggesting.

If it is suggesting something that we probably should do, but it was
written before us so we want to be lazy and not do anything about it,
we should not just eslint-ignore it. We should fix it or leave it there
for someone else to fix. 

Having an eslint-ignore in a file is a signal that someone who knew what
They are doing saw that error and said “no I want to do it anyway”

We really should not be having lots of cases where you need to even 
write `eslint-ignore`. A rule should either be 99.9% always followed or
we should get rid of it (and as a side note, I think we are there now)

A lot of these were leftovers from before we did that ^

Change-Id: I1e515d486550ad3118d6d74e9c824d28ebf6e714
Reviewed-on: https://gerrit.instructure.com/183786
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-03-05 20:27:24 +00:00
Jeremy Neander 61e22da7eb auto-lint some of shared grading
refs GRADE-1934

test plan:
 * Verify Jenkins passes

Change-Id: Ia1ff199d686af5618a54e306d151fcd6914c1e73
Reviewed-on: https://gerrit.instructure.com/183350
Tested-by: Jenkins
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
2019-03-04 18:19:14 +00:00
Derek Bender 1b45674fb8 Fix setDefaultGradeDialog submission count logic
Fixes: GRADE-1898

Test Plan:
- Given a Course with 60 students (api page size is 50)
- Given a Group Set where students are split into 2 groups
- Given a Group Assignment using the previously created Group Set

- For Each Gradebook:
  - Given the Gradebook
  - Given Set Default Grade from the actions menu for the previously
  created assignment
  - Given a new grade value and the checkbox for overwrite selected
  - When Submit is clicked
  - Then the alert that is displayed shows the correct number of Student
    Submissions updated (i.e. 60)

  - Given the New Gradebook
  - Given Set Default Grade from the actions menu for the previously
  created assignment
  - Given a new grade value and the checkbox for overwrite selected
  - When Submit is clicked
  - Then the alert that is displayed shows the correct number of Student
    Submissions updated (i.e. 60)
  - Then the Actions Menu is focused for accessibility

  - Given the Individual Gradebook
  - Given Set Default Grade from the actions menu for the previously
  created assignment
  - Given a new grade value and the checkbox for overwrite selected
  - When Submit is clicked
  - Then the alert that is displayed shows the correct number of Student
    Submissions updated (i.e. 60)
  - Then the Set Default Grade button is focused for accessibility

Change-Id: I0e74cd7f488520af03d74b0a8d2a4393678d418e
Reviewed-on: https://gerrit.instructure.com/177564
Tested-by: Jenkins
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-01-23 15:36:31 +00:00
Derek Bender f6daf89444 Remove duplicate SetDefaultGradeDialog
refs: GRADE-1898

This is a prework refactor to make the changes for GRADE-1898 only
necessary in one place instead of two.

The only intended behavior change is to the existing
SetDefaultGradeDialog allow for an optional onChange param which is
reverse compatible if not used.

It appears that previously we were using a sledgehammer to remove the
dialog (`dialog.remove()`) and forgetting to invoke the jQuery UI API:

    @$dialog.dialog('close')

This meant that not only were we missing the teardown lifecycle events
that dialog wants us to use but we were also unable to add hooks to the
dialogclose lifecycle event. This also means we no longer needed the
one-off call to `$('set_default_grade').remove()` in
SetDefaultGradeDialog as was this essentially a noop in Gradebook and
New Gradebook and only used in Individual Gradebook. This focus callback
has been moved to Individual View specific code.

The open method option on dialog() was also a noop since we've hacked every
dialog to always focus the close button on render for accessibility.

The changes to the selenium specs are necessary because when the set
default grade accessibility spec failed, it was not possible to only run
that individual spec. It's a preferable practice to not abstract specs into
loops like this for this reason.

Test Plan:
 - set default grade still works in gradebook, new gradebook, and
   individual gradebook, and that the focus for each of them is correct
   upon closing or submission of the dialog

Change-Id: If08e8ce94b2aa0c9cf9735a8d18f30da63cbb8f3
Reviewed-on: https://gerrit.instructure.com/177563
Tested-by: Jenkins
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2019-01-17 16:27:20 +00:00
Ryan Shaw 52437a1137 Fix some invalid imports
These are all things that were improperly importing either:
* a “default” object when there was only named exports
* a named export when there is only a default export

They work now because we tell babel to transpile es modules down
to commonJS in the “env” preset in babelrc but we want to eventually
not do that and these will need to be fixed before then

Test plan:
* no functionality should actually change in the code generated by
  Webpack
* this build should pass
* but so should the build for the commit that follows this that
  sets the `“modules”: false` option for babel-preset-env in
  .babelrc

Change-Id: Ic6f49fb94ee0d0592ca5e34ef7ed0a5633c40d80
Reviewed-on: https://gerrit.instructure.com/167054
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-10-09 21:31:57 +00:00
Ryan Shaw 43938d075e [spec] amdtoes6 even more specs
Change-Id: I107245d4211f59b995e8ac8761df3fadca20467e
Reviewed-on: https://gerrit.instructure.com/166036
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-28 02:02:55 +00:00
Brent Burgoyne 96b11b7cf5 bulk update of localized date/time formats
including better test coverage for parsing/formatting and fixes for
bugs exposed by changes to the formats.

closes CORE-1557

test plan:
- spot check datepicker in each locale
- try dates in multiple months
- try current year and future/past
- make sure string below datepicker field shows correct date

Change-Id: I9857b6f84c4e98fdaff5a6d8e90568602f42e689
Reviewed-on: https://gerrit.instructure.com/164724
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2018-09-19 15:24:00 +00:00
Ryan Shaw 23287c6969 react 16: get test-utils from react-dom/test-utils
closes: CORE-1890

from the react-addons-test-utils readme:

This package is deprecated as of version 15.5.0:

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

Change-Id: Ica0bb0c798aa80288d37b1810dc78eedad100d18
Reviewed-on: https://gerrit.instructure.com/164127
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-18 14:41:50 +00:00
Ryan Shaw 75f2c92eb5 spec: fix DatetimeDisplaySpec to work with react 15
Change-Id: I476bc2122f80f5aa27bd8e3051a86d79f0e68c80
Reviewed-on: https://gerrit.instructure.com/163520
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-07 16:45:50 +00:00
Ryan Shaw 38ed053829 spec: fix LoadMore spec to work with react 15
Change-Id: Idd858766f72b4e17edfce3fb83af7861d59d6a6f
Reviewed-on: https://gerrit.instructure.com/163513
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-07 15:19:14 +00:00
Ryan Shaw 93d42ea028 spec: s/.getDOMNode/.instance/ for enzyme wrappers
.getDOMNode() goes away in react 15. the thing you should use when
Dealing with enzyme wrappers is now called .instance()

Test plan:
* these specs should still pass

Change-Id: I8588f489dbe98cf3be253bfb144455bf00c09ee4
Reviewed-on: https://gerrit.instructure.com/163405
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-06 21:24:59 +00:00
Augusto Callejas edc711d12a Add pagination to LMGB
closes OUT-2356

This includes support for sorting by student sortable name
and outcome rollup score, which was previously done on the
client-side.

test plan:
  - create course-level outcomes
  - create an assignment aligned to those outcomes
  - create around 30 student accounts, with different
    names (first and last names) to test sorting by student name later
  - create two course sections and split the students between them
  - submit to the assignment with all student accounts
  - provide a rubric assessment in speedgrader to most
    submissions, providing mostly unique scores, but
    some duplicate scores to test sorting by rollup
    score later
  - test using current gradebook and new gradebook:
    * confirm that pagination appears at the bottom of LMGB
    * confirm that by clicking on the header above the student
      column, sorting works both ascending and descending
    * confirm that by clicking on the header above an outcome
      column, sorting works on rollup score both ascending
      and descending. additionally confirm when two students
      have the same score, it then sorts by student name
    * confirm that sorting (both by student name and outcome)
      continues properly when you paginate to the second page
    * confirm that selecting a course section (or all sections)
      only displays results for students in that section

Change-Id: Ie68cdf7e68791fb27cd851347a260efae6212cde
Reviewed-on: https://gerrit.instructure.com/159749
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Dariusz Dzien <ddzien@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
2018-08-24 16:40:21 +00:00
Steven Burnett 2d901e43be fix a11y issues with terms link
fixes COMMS-1270

Test Plan:
- on the login page navigate to the acceptable use policy
  link on the footer (make sure you have instructure misc plugins
  checked out)
- notice it meets a11y standards
- login and notice at the fotter of canvas the same links appear
- navigate to them with keyboard only and notice they are accessible

Change-Id: I387f5a69a3de277b7ddc957a46478a9003b786d7
Reviewed-on: https://gerrit.instructure.com/156188
Tested-by: Jenkins
Reviewed-by: Aaron Kc Hsu <ahsu@instructure.com>
QA-Review: Aaron Kc Hsu <ahsu@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2018-07-05 21:23:09 +00:00
Jeremy Neander e5e5b90851 spec: change .jsx extension to .js
Change-Id: Ia42f102d859e02393a7fd25d8d00b229be72bbdd
Reviewed-on: https://gerrit.instructure.com/155352
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Product-Review: Jeremy Neander <jneander@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
2018-06-27 13:57:55 +00:00
Clay Diffrient 12f35e4da1 spec: add proper error condition
This makes it so that when the error branch is called in the
app code, it doesn't throw a error because errors is undefined

This should prevent errors like MASTER-JAVASCRIPT-BUILD-B from
happening in Sentry.

refs CORE-1563

Test Plan:
  - Run `yarn run jspec ./spec/javascripts/jsx/shared/MessageStudentsSpec.js`
  - You should see nothing about forEach of undefined

Change-Id: Ib9eeed45e830835222d451475395c79f9554985e
Reviewed-on: https://gerrit.instructure.com/154813
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-06-22 16:02:20 +00:00
Clay Diffrient 549f254f14 spec: use moxios to properly mock axios
This allows us to prevent requests from actually attempting
to go beyond the test.  It also removes a non-Error exception
that was being thrown and logged in Sentry.

refs CORE-1563

Test Plan:
  - Run `yarn run jspec ./spec/javascripts/jsx/shared/MessageStudentsSpec.js`
  - It should successfully run without logging out 404 messages
  - Post-merge, MASTER-JAVASCRIPT-BUILD-A should not occur anymore in Sentry

Change-Id: Iac91a20077302c00ecaa9ebbcdfcabca5aca66f7
Reviewed-on: https://gerrit.instructure.com/154686
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-06-21 16:04:54 +00:00