Commit Graph

46 Commits

Author SHA1 Message Date
Charley Kline 3c5e316883 Revert "Upgrade Canvas to InstUI version 8 (frd)"
Refs FOO-3862
flag=none
[pin-commit-multiple_root_accounts=9d1698853e352f7e023e196e80cc195215a2b98c]

This reverts commit 448f1eebef.

Reason for revert: downgrade to InstUI 7 per engineering leadership

Change-Id: I89c607d09c29885da77b4474b757c7f205e51f01
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/328102
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2023-09-22 01:35:06 +00:00
Aaron Shafovaloff 448f1eebef Upgrade Canvas to InstUI version 8 (frd)
Refs FOO-3190
Refs FOO-3708
flag=none
[fsc-max-nodes=30] [fsc-timeout=60]
[pin-commit-multiple_root_accounts=03b5f961bbaa28af3d43b0a6a2ab072654cc6468]

Uprevs InstUI and addresses all post-uprev tasks. Also now that
InstUI is fully TypeScript, a bunch of type errors appeared
which needed to be addressed.

NOTE:

This is an amalgam of g/314136 and g/326557 which will get abandoned
once this passes Jenkins and is merged.

It builds against the commit of MRA that will have to merge
concurrently with this.

Still to do: theme -> themeOverride which is a separate commit
off of this one that is ready to go.

Test plan:
* cross your fingers
* (this will need some extensive review before merging)

Change-Id: I860c3dc04d34237e32aeaa138f6c377a016ceeae
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/327683
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Paul Gray <paul.gray@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2023-09-14 14:34:45 +00:00
Aaron Shafovaloff 11b284327c move .js files with JSX to .jsx extension
- .js files without JSX reduces unnecessary AST transformation
 - also paves way for vitest

test plan:
  - existing tests pass

flag=none

Change-Id: I392daefdfefab89e7cf511477e16c860b05519ff
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/323393
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Build-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2023-07-24 14:59:37 +00:00
Jackson Howe 30fc2959b4 Remove files_dnd flag
Also removes UploadDropZone component (plus its spec file and css
resources) since it was only used when the flag was disabled.

closes LF-272
flag = none

Test plan:
 - Go to /files
 - Drag a file from your computer into the files list
 - Expect it to be uploaded
 - Drag the same file again
 - In the modal that appears (since you're uploading a duplicate file),
   expect to see a "Skip" button

Change-Id: I325f69fbaad0a40b411fa94189bfb89f1e267055
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318334
Reviewed-by: Sarah Gerard <sarah.gerard@instructure.com>
QA-Review: Sarah Gerard <sarah.gerard@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-05-18 21:26:12 +00:00
Yona Appletree d136523768 Upgrade eslint packages, clean up ignores
Update some eslint packages removing the need for
some eslint-disable directives.

Changed react/no-unknown-property to warning since
we have several instances of it already in the
codebase.

Refs CFA-5
flag=none

Test plan:
- Automated tests pass

Change-Id: I4967d53477de7c4effe8861ee71e735be33f6b14
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317894
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: Aaron Shafovaloff <ashafovaloff@instructure.com>
2023-05-10 23:22:15 +00:00
Aaron Shafovaloff 49d4a8fe6a decaf small .coffee files (3)
test plan:
  - existing tests pass

flag=none

refs FOO-3470

Change-Id: I8f356678b821a9e8e413723ef9f626cf97a211be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315858
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2023-04-13 14:25:00 +00:00
Aaron Shafovaloff dc7704ca3c move prevent-default package to ui/shared/util
test plan:
  - All existing tests pass

flag=none

Change-Id: I61ba44f35ac506eb939af823c275357b945c5cd0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315472
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: Aaron Shafovaloff <ashafovaloff@instructure.com>
2023-04-10 17:40:23 +00:00
Aaron Shafovaloff 51349dfa05 remove .coffee extension from coffeescript imports
this removes annoyances when decaffeinating files

test plan:
  - all tests pass

flag=none

Change-Id: Ie3af0faf13d64a4701bb917fbcae29cb10474df1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315484
Reviewed-by: Derek Williams <derek.williams@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-04-10 17:01:42 +00:00
Jackson Howe c9eb76a687 Rename componentWillReceiveProps to UNSAFE_ version
refs LS-3841
flag = none

Test plan: specs pass

Change-Id: I6f47afe056909d6b6e0803c6c9385e839ffadccf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314488
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>
2023-03-28 23:27:06 +00:00
Davis Hyer c1706b666e provide dates for FriendlyDatetime tests
refs LS-3571
flag=none

test plan:
  - tests pass

qa risk: low

Change-Id: I5e6d337f895cb43a03c1b9f7181f27e07ee44a6a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/304361
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2022-10-31 17:32:29 +00:00
Aaron Shafovaloff 07d238b148 Resolve or disable misc eslint errors
Test plan:
    - All existing tests pass

flag=none

Refs DE-1426

Change-Id: Ic0ac4708089120ad83a6e7bd24eec1eaf4b310a2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303859
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Williams <derek.williams@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Deborah Kwak <deborah.kwak@instructure.com>
2022-10-25 14:10:39 +00:00
Aaron Shafovaloff 3f92d08a65 Resolve or disable misc eslint errors
Test plan:
    - All existing tests pass

flag=none

Refs DE-1426

Change-Id: Id91ec404d4c10eb667312ff8f8567cb9508fc715
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303769
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Dustin Cowles <dustin.cowles@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Deborah Kwak <deborah.kwak@instructure.com>
2022-10-20 23:09:09 +00:00
Aaron Shafovaloff 36e62f2c0d Disable anchor-is-valid rule on some lines
Test plan:
    - All existing tests pass

flag=none

Refs DE-1426

Change-Id: I30b7b12ed645cead7a43a7c0c7205a810475cf67
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303677
Reviewed-by: Derek Williams <derek.williams@instructure.com>
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-10-20 14:33:03 +00:00
Aaron Shafovaloff ec9defc536 Prefix unsafe React methods
Test plan:
    - All existing tests pass

flag=none

Refs DE-1426

Change-Id: I02d348ea1746db648c4fae73a2e4996bb2d66ffa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303581
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
2022-10-19 13:51:13 +00:00
Aaron Shafovaloff f1c4d0546b Resolve or disable misc eslint errors
Test plan:
    - All existing tests pass

flag=none

Refs DE-1426

Change-Id: I806e470973b36f68ba928b0a6347bc43ce96277b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303511
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Derek Williams <derek.williams@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
2022-10-19 13:50:32 +00:00
Aaron Shafovaloff 7fabcbb33a Mark componentWillMount as unsafe
Test plan:
  - All existing tests pass

flag=none

Refs DE-1426

Change-Id: Ie39bd661647ea0e2aa76869e640b744c706c39ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303463
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Williams <derek.williams@instructure.com>
Reviewed-by: Christopher Soto <christopher.soto@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
2022-10-18 14:31:07 +00:00
Aaron Shafovaloff 5ef9b90458 Fix undefined variables
Also: ignore eslint in third-party mep-feature-tracks.js

Test plan:
  - All existing tests pass

flag=none

Refs DE-1426

Change-Id: I0598b278f117e301b4d7c9890d1b4a5e6f0de86b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303347
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Cameron Ray <cameron.ray@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-10-17 21:22:26 +00:00
Aaron Shafovaloff 648b91350a Remove redundant roles
Test plan:
  - All existing tests pass

Refs DE-1426

flag=none

Change-Id: Id3d1b3a226c72ff56c83f79568fecba71f3b0f61
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303321
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Eduardo Escobar <eduardo.escobar@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
2022-10-14 20:15:50 +00:00
Aaron Shafovaloff 8100ec3fc3 Use globals more explicitly
This reduces eslint errors

Test plan:
  - All existing tests pass

Refs DE-1426

flag=none

Change-Id: I9052162de78f2f139be34385daa3a4ca889ce35e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303306
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Eduardo Escobar <eduardo.escobar@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Deborah Kwak <deborah.kwak@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-10-14 19:50:37 +00:00
Aaron Shafovaloff 5f1ea550f2 Mark empty code blocks
This reduces eslint errors

Test plan:
  - Existing tests pass

Refs DE-1426

flag=none

Change-Id: I23097ae91c8f2d6711bdf8e276271ede694f2388
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303310
Reviewed-by: Eduardo Escobar <eduardo.escobar@instructure.com>
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
QA-Review: Cameron Ray <cameron.ray@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-10-14 17:36:05 +00:00
Aaron Shafovaloff 27886c270c Remove unused variables
Test plan
  - Existing tests pass

flag=none

Change-Id: I7ba9d75dea38b6c8b06e6d8d8109d67bdff11b20
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302580
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Deborah Kwak <deborah.kwak@instructure.com>
2022-10-06 16:01:10 +00:00
Aaron Shafovaloff 216c663d7a Use type-safe operators with non-falsy strings
Also uses triple-=equal for `.length === 0` checks

I do not use triple-equal for comparison with empty strings
  or variables on the right hand in this commit.

This improves type safety and reduces eslint warnings.

Test plan:
  - All existing tests pass

flag=none

Change-Id: I38a9dafa8a45cab28cfb04217325802695448939
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302645
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Deborah Kwak <deborah.kwak@instructure.com>
2022-10-06 15:56:52 +00:00
Aaron Shafovaloff c3929e0d89 Resolve react/jsx-boolean-value eslint issues
Test plan:
  - Existing tests pass

flag=none

Change-Id: I9648dde389197f266ce5dfb475ad994ecfb70221
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302634
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Christopher Soto <christopher.soto@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Deborah Kwak <deborah.kwak@instructure.com>
2022-10-05 20:50:20 +00:00
Aaron Shafovaloff 86d0e7ced2 Update JavaScript in ui/ to latest prettier config
Test plan:
  - All existing tests pass

flag=none

[skip-eslint]

Change-Id: I36c1a2f47004185f8f02f4155b838c877ee495e3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/302256
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2022-09-29 22:04:26 +00:00
Aaron Ogata 853fa3c8f0 remove ancient version of JSDOM
Change-Id: Iddecff6d28e84c3cfdc82ab788a720292da646a1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/298114
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
2022-08-09 03:20:53 +00:00
Jacob Burroughs adb31a0114 create package.json for all ui/features
Change-Id: I1e604415b97648412dc714028737fb346d831ab8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292037
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2022-05-18 17:13:20 +00:00
Aaron Shafovaloff f8458c8699 fix formatting from useScope commits
test plan:
 - all tests pass

flag=none

Change-Id: I50e858039081b8bd0c5a497cdf9e697710a54dc5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287364
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2022-03-17 21:07:06 +00:00
jake.oeding 6bccd15c3b reduce screenreader sort order dictation freq
stops adding sort order message to flash_screenreader_holder
every time ColumnHeaders is rendered. now only adds when
user changes the sort selection

fixes MAT-653
flag=none

test plan:
- go to courses/:id/files
> observe in the DOM that there is no message
  added to the flash_screenreader_holder div
- enable VoiceOver
- sort by one of the columns, for instance, by
  name descending
> observe that a single message reflecting the chosen
  sort is added to the flash_screenreader_holder
- force the ColumnHeaders to re-render multiple times
  by navigating back and forth between them and the
  file tree several times rapidly with kbo navigation
> observe in the DOM that no new sort messages are
  added into the flash_screenreader_holder
> throughout the steps, listen and hear that VO
  does not bombard you with sort messages

Change-Id: I82fe7b677f7b37d42837140b0d64c023c7e4e5dd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286412
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2022-03-14 21:26:37 +00:00
Ahmad Amireh 1a46b90a25 rewrite i18n! to useScope in coffeescripts
refs FOO-2696
flag = none

see the related patch for javascripts for context, this is the same but
for coffeescripts

Change-Id: Ia672b95445ee5c1a4db28f625f18e65fdf60ce0c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286663
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>
2022-03-10 21:38:47 +00:00
Ahmad Amireh bf46b5cc33 rewrite i18n! to useScope in javascripts
refs FOO-2696
flag = none

applied by the codemod found here: https://github.com/instructure/canvas-i18n-loader-rewrite

this won't pass in isolation, see the mega patch that cherry-picks them
all for the status

~ test plan ~

do a cursory glance over the changes and verify we didn't miss anything

Change-Id: I9bc7dad55c7aba9053ab69c9bb477cb4ee3e78bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286661
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>
2022-03-10 21:38:25 +00:00
jake.oeding 863dbf9d39 migrate more ColumnHeader specs
migrate a missed file of ColumnHeader specs

refs MAT-653
flag=none

test plan:
-specs pass

Change-Id: I567f107561cdc1ab248ebf695b3de2e8deb694bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286649
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jon Scheiding <jon.scheiding@instructure.com>
QA-Review: Jon Scheiding <jon.scheiding@instructure.com>
Product-Review: Jake Oeding <jake.oeding@instructure.com>
2022-03-10 21:23:49 +00:00
jake.oeding 961a1fab27 migrate ColumnHeaders tests
move from QUnit to Jest. prep for
another patch

refs MAT-653
flag=none

test plan:
-specs pass

Change-Id: I6be413f687359c3295fabdc03f07173e46a29cb1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286598
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Juan Chavez <juan.chavez@instructure.com>
QA-Review: Juan Chavez <juan.chavez@instructure.com>
Product-Review: Jake Oeding <jake.oeding@instructure.com>
2022-03-08 22:18:50 +00:00
jake.oeding 2f2377f617 selectively display 'Move To...' warning
renames 'Move' option to 'Move To...' for
consistency and only populates the screen reader
warning when user has permission to move files

[skip-crystalball]

fixes MAT-651
flag=none

test plan:
-prerequisite: have a course with a teacher and
 student with default permissions and a
 published file
-do the following for the teacher and for the
 student:
 1. navigate to /courses/:id/files
 2. check for existence/abscence of warning
    message in the DOM
 3. now search for your published file in the
    'search for files...' input
 4. again, check for the existence/abscence of
    warning message in the DOM
-the warning should appear for teachers (who
 have the ability to move files by default)
-the warning should not appear for students
 (who by default do not have the ability to
 move files)

Change-Id: I3dac4b853400105f7def6c431aa8074761b23a75
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286501
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gonzalo Penaranda <gonzalo.penaranda@instructure.com>
QA-Review: Gonzalo Penaranda <gonzalo.penaranda@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
2022-03-07 23:29:18 +00:00
Jake Oeding f1cbee5523 Revert "selectively populate 'Move To...' warning"
This reverts commit 29e8dde825.

Reason for revert: Causing build failures

Change-Id: Ia8a6433612a9d7a991d4dadb29389afc7e14fe7a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285822
Tested-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-03-07 17:30:24 +00:00
jake.oeding 29e8dde825 selectively populate 'Move To...' warning
renames 'Move' option to 'Move To...' for
consistency and only populates the screen reader
warning when user has permission to move files

fixes MAT-651
flag=none

test plan:
-prerequisite: have a course with a teacher and
 student with default permissions and a
 published file
-do the following for the teacher and for the
 student:
 1. navigate to /courses/:id/files
 2. check for existence/abscence of warning
    message in the DOM
 3. now search for your published file in the
    'search for files...' input
 4. again, check for the existence/abscence of
    warning message in the DOM
-the warning should appear for teachers (who
 have the ability to move files by default)
-the warning should not appear for students
 (who by default do not have the ability to
 move files)

Change-Id: Ia210d3df488c9d3cca8b946c6747840cd9bc30e3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286353
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gonzalo Penaranda <gonzalo.penaranda@instructure.com>
QA-Review: Gonzalo Penaranda <gonzalo.penaranda@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
2022-03-07 16:19:08 +00:00
Ahmad Amireh 5b90b39cf5 [instui8] address deprecations
refs FOO-2645
flag = none

this applies the first two codemods: updatePropNames and updateV7Props.
We can still remain on v7 at this point.

To reproduce this:

- clone github.com/instructure/instructure-ui
- activate node 14 and run "yarn install"
- apply the first mod with this command:

npx jscodeshift \
 -t packages/ui-codemods/lib/updatePropNames.ts \
 --config=packages/instui-config/codemod-configs/v7/propNames.config.json\
 ~/src/canvas-lms/ui

- apply the second mod with this command:

    npx jscodeshift \
      -t packages/ui-codemods/lib/updateV7Props.ts \
      -fileName updateV7PropsWarnings.txt \
      ~/src/canvas-lms/ui

substitute ~/src/canvas-lms with the path to ur canvas installation

~ TEST PLAN ~
  ~~~~~~~~~

not sure if it's reasonable to be spot-checking all the affected sites,
we should be able to rely on the test suite for that, but it won't hurt
to look and click through things

Change-Id: Ie120b773550633f418fae5635d1943083a65005e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285028
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: Sean Scally <sean.scally@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2022-02-28 19:04:05 +00:00
Weston Dransfield ca7bbd6c0a Fix flakey selenium specs for files
This change causes the files UI to wait
for all DOM content to be loaded before
initializing the router and listening
for LTI messages

flag=none

Test Plan:
Navigate to /courses/:id/files and verify
the Files UI loads and functions as before

Change-Id: Iee3b5579db889f455353184fd6c39a2716d42003
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/280800
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2021-12-09 22:35:08 +00:00
Gonzalo Penaranda 165d852122 Align NVDA/JAWS VO column with rows on file
fixes MAT-504
flag=none

Test Plan:
 - Enable JAWS or NVDA before accessing Canvas
 - Go to Courses > Files. Upload a new file if
   there isn't any
 - To locate the VO(VoiceOver) Assistant on the
   table in order to describe every element of the
   file upload table, click on the link with the
   title of the course, on the left side of the
   file upload table. Then click on 'name' header
 - Once located, push Up or Down buttons on the keyboard
   to navigate through the descriptions of every element
   with the VO. The descriptions of the headers now relate
   with their corresponding elements on the table

ADDITIONAL NOTES:

 - The test was done on Chrome and Mozilla Firefox and
 using NVDA. It should work either with NVDA or JAWS.

Change-Id: Iade3344d6d2dab14899892d7954917cd03a646f9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279590
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
2021-12-03 22:17:58 +00:00
Juan Chavez ebeb65763b Add full options for files when searching
fixes MAT-486

flag=none

test plan:
- In a course add a number of files.
- Navigate to course files page.
- Select the three dots in a file row and
observe the available options (Download, Send,
Copy, Rename, etc.).
- Search the same file using search bar.
- Select three dots again.
- Verify that the same options are available.

Change-Id: I2adde2596cf97f50eb296d7501855fef01bfcf1d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276781
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: David Lyons <lyons@instructure.com>
2021-10-28 16:23:51 +00:00
Jackson Howe 0bf98345c6 Fix LS encapsulation SpecifierMismatchErrors
refs LS-2763
flag = none

Test plan:
 - Specs pass and Canvas still works; check these areas in particular:
   - Files page direct share
   - Syllabus immersive reader
   - Wiki page immersive reader
   - K5 schedule pages and Important Info pages
   - Modules page

Change-Id: I2585e2479938a44237ef0cc859baa6cc8e6e8651
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276179
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-10-19 16:38:34 +00:00
Ed Schiebel 2cae62a330 Only show Send|Copy To in course files
The code for handling Send To and Copy To are in the
courses_controller, so let's only show the menuitems
when in course Files and not user files (or group files,
if that's a thing).

Also converted the QUnit specs to jest.

Changed ItemCog string refs (which were only used in specs
except for 1 case) to data-testid

closes LS-2724
flag=none

test plan:
  - Send To... and Copy To... work as expected in course files
  - Neither menu item is available in user files
   (you find the menu in the kabob menu to the right of a file
   on the files page)

Change-Id: I89f3d3706645c183381523d07956e692069dc0cc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275792
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: Ed Schiebel <eschiebel@instructure.com>
2021-10-13 18:00:24 +00:00
Xander Moffatt 8c3963a98d messages: move ltiState up from handler
refs INTEROP-7086
flag=none

why:
* to prepare for further refactoring, including the deletion of
handleLtiPostMessage

test plan:
* webpack build works
* specs work

Change-Id: Ia75763f84dafa51cf2c4203d7d9032e37e83aa5c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273932
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
2021-09-28 18:20:08 +00:00
Gary Mei 180082b46a add Send To and Copy To functionality to files
closes MAT-187
flag=none

Test Plan
- Have two courses.
- Have two teachers, one enrolled in the first course and the other
  enrolled in the second course.
- Create a course file at the root level in the first course.
- Create a course file nested in a folder in the first course.

- Send the two files from the first course to the second teacher.
- Verify that the content shares appear for the second teacher.
- Verify that the content shares can be previewed with a Common
  Cartridge viewer.
- Verify that the content shares can be imported into the second
  course, with the folder hierarchy preserved.
- Delete the two imported files from the second course.

- Copy the two files from the first course to the second course.
- Verify that the two files are imported into the second course, with
  the file hierarchy preserved.

Change-Id: I8fa74f0fe175498f2fb73583ae06181356b684a5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270708
Reviewed-by: Jon Scheiding <jon.scheiding@instructure.com>
QA-Review: Jon Scheiding <jon.scheiding@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Gary Mei <gmei@instructure.com>
2021-09-02 19:41:23 +00:00
Jackson Howe dc5b874eb0 Tweak global nav strings for k5
Creates a helper in the application_controller called `k5_user?` which
returns true iff the user is associated with any k5 accounts. Also sets
a JS_ENV variable called :K5_USER with the value of ks_user?. Renames
other JS_ENV variables to :K5_HOMEROOM_COURSE and :K5_SUBJECT_COURSE for
clarity. Also removes references to 'k5_mode', replacing with calls to
k5_user? or calls on the Course model for clarity.

use_k5? is cached since it is frequently referenced. The cache key is
cleared for each user in the account when k5 mode is toggled by an admin
or when enrollments are adjusted. It is also set to expire after 1 hour,
which might not be necessary. Cache is not invalidated when the k5 flag
is toggled since the flag is being removed.

The user dashboard and global nav states are dependent on use_k5? Shows
`Subjects` instead of `Courses` and `Homeroom` instead of `Dashboard` in
the global nav when k5 is on. Also filters homeroom courses out of
course list when k5 is on.

closes LS-1827
flag=canvas_for_elementary

[fsc-max-nodes=20]
[fsc-timeout=40]

Test plan:
 - Login as a teacher enrolled in at least one course in a k5 account
 - Expect to see k5 dashboard
 - Expect to see `Subjects` and `Homeroom` (with home icon) in the
   global nav (and in the mobile global nav)
 - Toggle the courses/subjects tray in global nav and expect to see
   only references to Subjects
 - Open /courses/ and expect the page heading to be `Subjects`
 - Browse through the course and expect it to look normal (w/ Balsamiq)
 - Switch to a student and expect the above to be true, plus the courses
   list should not include homeroom courses
 - Disable k5 for the account and return to teacher or student
 - Expect to immediately see classic canvas nav, dashboard, and courses
   again
 - Test caching by placing a log statement (i.e.
   `p "K5 Cache: uncached"`) in ApplicationController#uncached_use_k5?
 - Run `redis-cli FLUSHDB`
 - Navigate around canvas; expect to see the log statement only once in
   the logs until toggling k5 mode or adding the first k5 course to a
   user

Change-Id: Iec970c939b976d10eee13d40b7bf68f601d8178e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265239
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-26 15:37:55 +00:00
Eric Saupe 3ff97df0e9 Modify index and show views for K5 mode
This change removes the sidebar and breadcrumbs from show and index
actions in course controllers to simplify the views.

fixes LS-2063
flag=canvas_for_elementary

test plan:
- Enable Canvas for Elementary for the account
- Navigate to the course settings page
- Navigate to all pages listed in the left nav
- Verify the left nav and breadcrumbs are missing on all course pages for
 students but not for teachers

Change-Id: Id8e448ee2b3bd981f4376de5cf827d728da15763
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262428
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-04-21 18:21:41 +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