Commit Graph

1938 Commits

Author SHA1 Message Date
Aaron Shafovaloff 0e872dee09 colocate Backbone collection specs
Change-Id: I8602495b46a72b05de1ce23cf858046270c4ee30
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349460
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>
2024-06-06 19:29:58 +00:00
Aaron Shafovaloff 34926139c8 colocate some assignment specs
Change-Id: I297c9ea6db24f14769a08834c4e6dfa57a71ffaf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349370
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-06 19:05:20 +00:00
Aaron Shafovaloff b7beaab0f4 move jqueryui specs
Change-Id: I0824bea05940f3997dab615711a67f557bb4499a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349366
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-06 18:48:09 +00:00
Aaron Shafovaloff 8bb9bbd94a move some qunit specs
Change-Id: Ibe03b02a80268b7cdf07175c408e6e9d6133412e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349368
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>
2024-06-06 16:13:01 +00:00
Aaron Shafovaloff c5ffc2ff9a move some jquery specs
Change-Id: Id537c8d5be2399a77bb6fcfc26dc5c232f323ef1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349367
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-06 15:26:35 +00:00
Jackson Howe abdc414ee5 Split differentiated_modules flag
Splitting the differentiated_modules flag allows us to enable the
backend changes transparently and in a backwards-compatible manner
to ensure performance before enabling the user-facing changes that
fully expose this feature. Renaming the original flag makes it easy
to ensure we've transitioned each existing instance to the proper
new flag.

What should go behind each flag?

selective_release_backend
 - any change with potential performance implications should go here
 - any change that is not required to go in
   selective_release_ui_api should go here

selective_release_ui_api
 - any change that changes UI or reveals this feature in the
   frontend must go here
 - any change allowing the creation of module-, page-, or discussion-
   type AssignmentOverride must go here
 - any change which allows data changes that are not backwards
   compatible (if the flags are disabled) must go here

One other way of putting this - with the selective_release_backend
flag enabled, selective release should be fully functional if
AssignmentOverrides exist, there's just no way to actually create
them or tell that anything has changed.

closes LX-1671
flag = selective_release_backend, selective_release_ui_api
[skip-crystalball]
[fsc-max-nodes=20]
[fsc-timeout=40]

Test plan:
 - Enable the selective_release_backend but not
   selective_release_ui_api
 - Expect to not see any selective release UI around Canvas
   (including module edit rewrite, module assign to, learning
   object show/index/edit assign to, pages "Mastery paths"
   checkbox)
 - Expect to not be able to use the learning object dates
   api
 - Enable the selective_release_ui_api flag
 - Expect selective release to work as normal

Change-Id: Ia9ab02a005e4391aa63e7f2b7d5b77c990cd8154
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349192
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Sarah Gerard <sarah.gerard@instructure.com>
QA-Review: Sarah Gerard <sarah.gerard@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2024-06-05 23:55:03 +00:00
Aaron Shafovaloff acdf0185d9 colocate some epub_exports specs
Change-Id: I50cbde228adb253bebb4c5fd73cd84f072ebe172
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349353
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-05 23:39:22 +00:00
Aaron Shafovaloff 599b1e0643 colocate some dashboard-card specs
Change-Id: I36abee30b13ac5b1fc3a39ef849427cd1836dbdb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349350
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-05 23:39:01 +00:00
Aaron Shafovaloff 1420de7ea8 colocate some shared helper specs
Change-Id: Idc3df4046e28eecefefabfe5249b4ad65eabffac
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349356
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-05 23:38:52 +00:00
Aaron Shafovaloff 170635877a colocate some grading specs
Change-Id: Ic25bd9ecbedb4fd94eb47597abd3fb4c55fc027f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349348
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-05 23:31:26 +00:00
Aaron Shafovaloff 383265f406 colocate some due-date specs
Change-Id: I40d7dc6060477808b7c76d5e9a4d23691c3ca04f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349352
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-05 23:31:15 +00:00
Aaron Shafovaloff 3994e695b5 colocate FileSpec.js
Change-Id: I9490c34fdad428022234836e607777b9ff6dd916
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349336
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-05 22:17:49 +00:00
Aaron Shafovaloff 56ef5aad6a colocate EntrySpec.js
Change-Id: Ie2e896e99b829bc5c19c7bb92013e9a5ce7f462d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349335
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-05 22:17:40 +00:00
Aaron Shafovaloff dfb5cce47b colocate some QUnit tests
Change-Id: If111507b32fbb46603537e13768ce14e32bf2860
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349223
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
2024-06-05 17:32:28 +00:00
Aaron Shafovaloff 877f359896 move datetime specHelpers to package
Change-Id: Icbb2a548e8ede4db7408080a26e6aa0c39ce4008
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349195
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-04 21:23:55 +00:00
Aaron Shafovaloff 5f64c7a6d1 consolidate isMidnight function
Change-Id: I0ccd713b19a95aadf5f7c72c1bd4761c8b4eb8bf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349197
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-04 20:08:14 +00:00
Aaron Shafovaloff d68642bf53 consolidate datetime and @instructure/moment-utils
Change-Id: I5b4acd49465235e790609ed55aa02b2abe73190e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349065
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-06-04 17:42:35 +00:00
Jackson Howe 6a0869a22a Use granular permissions in selective release
Gate the learning object dates api according to new permissions, and
only render the assign to buttons & UI if the appropriate permissions
are present. This commit works by adding a policy called
:manage_assign_to to each learning object model which checks the
appropriate course permissions/ conditions. Then in various parts
throughout the UI, we can simply call `object.grants_right?(user,
:manage_assign_to)` anywhere where we're checking the ability to edit
an existing learning object's assign to settings.

To change a module's assign to settings, require the "Course content -
edit" permission.

For existing learning objects, changing assign to settings requires the
following permissions:
- assignments -> "Manage Assignments and Quizzes - edit"
- quizzes -> "Manage Assignments and Quizzes - edit"
- graded discussions -> "Discussions - moderate" and "Manage Assignments
  and Quizzes - edit"
- ungraded discussions -> "Discussions - moderate" and either a course
  admin enrollment or an enrollment that's not section restricted
- pages -> "Pages - update"

For new learning objects, we require the following permissions on the
object's create page:
- assignments -> "Manage Assignments and Quizzes - add"
- quizzes -> "Manage Assignments and Quizzes - add"
- graded discussions -> "Discussions - create" and "Manage Assignments
  and Quizzes - add"
- ungraded discussions -> "Discussions - create" and either a course
  admin enrollment or an enrollment that's not section restricted
- pages -> "Pages - update"

The "Discussions - moderate" permission can be granted to students, so
if the user does not have an admin enrollment in the course, we verify
that the student's enrollment is not section-restricted before allowing
them to edit a discussion's assign to settings. Thus, students with
"Discussions - moderate" permissions and a section-restricted
enrollment can not use the assign to tray and can no longer
differentiate a discussion by section.

closes LX-1694
flag = differentiated_modules
[fsc-max-nodes=20]
[fsc-timeout=40]

Test plan:
Visit each of the following locations as a teacher and verify that you
can access the "Assign To" UI. Then disable the associated permission
for the teacher and verify that you can no longer access the "Assign
To" UI. Note that you may need to clear your cache and restart Canvas
after toggling permissions.
 - assignments (show, index, edit, create, module items) - note that
   the index can show quiz and graded discussion items, and these
   items' assign to buttons should be gated by their respective
   permissions
 - quizzes (show, index, edit, create, module items)
 - graded discussions (show, index, edit, create, module items)
 - ungraded discussions (show, index, edit, create, module items) -
   test this as a student as well
 - pages (show, index, edit, create, module items)
 - modules (index) - both the menu option and "View Assign To"
   button should be gated

Change-Id: I19bdb24c16a4bc77b993a55be4d9536904c6441f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/348755
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: Jackson Howe <jackson.howe@instructure.com>
2024-06-04 17:08:18 +00:00
Spencer Olson ebda45d18c unify SpeedGrader text
closes EVAL-4203
flag=none
[fsc-max-nodes=30]

Ensures wherever we refer to SpeedGrader that we use "SpeedGrader"
(one word, with the "S" and "G" capitalized).

Test Plan:
- specs pass

Change-Id: I1e4c331866cb698b7eee70e62c6a203e088c6d0c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/348456
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Product-Review: Melissa Kruger <melissa.kruger@instructure.com>
2024-05-29 18:41:43 +00:00
Evan Battaglia 18f48b26da spec: convert qunit spec to jest
refs INTEROP-8581

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

Change-Id: Ibd0cf1d1ade86b5c4901e556b66583a4f8f95483
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/346980
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2024-05-28 21:44:04 +00:00
Aaron Shafovaloff a79d24cc15 more datetime migration to package
with special focus on imports

Change-Id: I9616cae0b40a8578342221970ecf43fbe07e1a97
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/348211
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-05-23 21:48:42 +00:00
Riley Crahen 1a0e3980ba Correct extraction of section names from invalid date fields
fixes LX-1408

flag = none

Motivation:
- Issue caused by jQuery upgrade
- Updated labelFn to include _index parameter
- Updated .map() usage in render

Test Plan:
- Assert it displays the name for ALL invalid sections

Change-Id: I3c94d858d10a7bf898284c3a41202ca65c6f80fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/347693
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Riley Crahen <riley.crahen@instructure.com>
2024-05-21 17:43:22 +00:00
Aaron Shafovaloff 527f1b218b remove $.fn.datetime_field
Change-Id: If1ac9b7d43f8540ec7d567f51005df0937776c14
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/347855
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
2024-05-21 16:26:27 +00:00
Aaron Shafovaloff b43d535866 use renderDatetimeField instead of $.fn.datetime_field
Change-Id: If992d674cfceba70f8f4c76ac14a3465b63b087f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/347492
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@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>
2024-05-20 20:32:07 +00:00
Balazs Komaromi a07ced4a36 Change indicator icons of assignment groups
- icon-sis-imported will only be shown if the
assignment group has sis_source_id set
- icon-link will be shown if the assignment group
has a sistemic category mapping set in its
integration data

refs DSYNC-1544
flag=none

Test Plan:
- Check if an assignment group with a
sis_source_id has a sis imported icon
- Check if an assignment group with an
integration_data containing sistemic category
mapping has a link icon

Change-Id: I1528b779f7751a49bdab2f5d192883a2d3ba82e6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/346749
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Peter Bartha <peter.bartha@instructure.com>
Reviewed-by: Kristóf Miskolczi <kristof.miskolczi@instructure.com>
QA-Review: Balazs Komaromi <balazs.komaromi@instructure.com>
Product-Review: Balazs Komaromi <balazs.komaromi@instructure.com>
2024-05-16 09:03:24 +00:00
Steve McGee 3f4df99cc8 update assignment title to new resource card
why: When editing an assignments submission type from any non-LTI option
     (online, no submission and on paper) to the submission type
     placement for a tool, it gives a false impression of being already
     connected to a resource with the tool. This is due to the pre-
     populated Canvas assignment name being listed under the button to
     launch and select content. This replaces that assignment name with
     the new resource card that will be created when the tool is
     selected.

closes: INTEROP-8535
flag=assignment_submission_type_card

test plan:
- Create a new assignment with 'External Tool'
  during creation, select the submission type "External Tool" and walk
  through the process of selecting a tool. In this flow the card should
  not appear until the assignment is saved and you try to edit it. Then
  you should see the new resource card displayed.
- Create a new assignment with a tool in the list (ie. LTI Test Tool)
  when this tool is selected you should still get the launch button
  that was created recently. Launch the tool and and walk through this
  flow. Once done with this selection flow the card should immediately
  appear.
  - If your tool has an icon_url it should be displayed in the card, and
    if it does not then the default LTI icon should be displayed. You
    can simulate the tool not having an icon by removing the icon_url
    from the Avatar `src` prop in the `LtiToolIcon` component.
  - Click the close button on the card and verify that it disappears and
    the launch button is displayed again.
- Edit an existing assignment that has a tool selected, change the type
  to something else (like 'Online') and then change it back to the tool.
  The card should appear after the second change as it should be
  remembered until you either close the card or save the assignment with
  a different submission type.

Change-Id: I7e716a09211568c2f0e51eb4bb2e7109fad2140d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/345517
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Mark Starkman <mark.starkman@instructure.com>
2024-05-15 16:57:39 +00:00
Aaron Shafovaloff 94eec36cb6 run prettier on ui/ and spec/
Change-Id: If7c95860bab3791a5be1dea1961d83dbb6a5dd50
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/347401
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>
2024-05-15 15:31:35 +00:00
Aaron Shafovaloff 445bc6a12e separate datetime functions from jQuery
Change-Id: I2603226c8800eabeb1257c13ebe7e8321d2b8ac5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/347256
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-05-14 22:08:54 +00:00
Aaron Shafovaloff 323ee9474f replace esmac with Dependency Cruiser
test plan:
  - build passes
  - run locally:
    node_modules/.bin/depcruise ./ --include-only "^(ui|packages)"

closes CFA-63

Change-Id: I6c053b57e0f7b9d1c13d88a03603dbc9d34f2667
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/346184
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Build-Review: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2024-04-25 19:35:38 +00:00
Daniel Vincze 5bfee45d6e fix: only count non deleted discussion replies
fixes VICE-4171
flag=none

test plan:
- Create a discussion with user A
- Add discussion replies with the same user in a thread
- Delete some nested replies with the same user
- With user B observe that there are no unread replies with this change
(and there are without this)

Change-Id: I0106e46295676500b50d95be34d3a048c4cce56e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/345235
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
Reviewed-by: Roland Beres <roland.beres@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2024-04-16 12:03:19 +00:00
Charley Kline edbed718bf Do not allow manual entry of insane years into datepickers
Fixes FOO-4288
flag=none

It's all too easy to inadvertently manually enter an incorrect
year when typing into either the jQuery or the InstUI date
input components. For example, while '20' is read as the year
2020, '2' becomes 1902 and '202' is left as the year 202. This
has created issues in custommer accounts.

Since Canvas dates are always related to some school term that
is likely to be in or near the present, it makes the most sense
to simply have the datepickers reject any year earlier than
1980. That figure was arbitrarily chosen but seems reasonable.

Test plan:
* Try both datepickers (suggest the course module "Lock Until"
  setting for the jQuery picker and the "Course Participation"
  start and end dates in the main course settings page).
* Free-form type a date. Any date that resolves to a year after
  1980 should work just as always; any earlier year should be
  rejected and the displayed error ("suggestion") below the
  picker field should indicate that the year is too far in
  the past.

Change-Id: Ib53d8c5cca1f9e76319323c5eda316eb63c34ef1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/344411
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: Charley Kline <ckline@instructure.com>
2024-04-15 21:23:08 +00:00
Eric Saupe 08cc4b8d6b spec: Remove enzyme.mount from coffeescript specs
fixes LF-1424
flag=none

test plan:
- tests pass

Change-Id: Ia36af050a456bcd09fb779e371da62a767df2012
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/344389
Reviewed-by: Jacob DeWar <jacob.dewar@instructure.com>
QA-Review: Jacob DeWar <jacob.dewar@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2024-04-03 19:57:33 +00:00
James Butters 537c07f0f8 update chrome version for JS tests
[change-merged]
[build-registry-path=jenkins/canvas-lms/jschrome-120]

we recently updated the version of chrome for testing on
Jenkins but missed the JS tests. Update that version to
match all other test suites, version 120

Test Plan:
- Jenkins passes

Change-Id: Iea7d74a8ce4c4b666b3b5453e37bc0fc842298e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/343771
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Michael Hargiss <mhargiss@instructure.com>
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
Build-Review: James Butters <jbutters@instructure.com>
2024-03-27 17:26:46 +00:00
Jen Smith 09f2342d35 upgrade to jquery 3.5
with jquery-migrate 3.4.1 (added to instructure_jquery_patches.js
this time,  as it wasn't being loaded soon enough for header usage
in runOnEveryPageButDontBlockAnythingElse.jsx)

this change also disables the assignment column resizing and
reordering feature in the grid gradebook.  The drag library used
for this feature does not support jquery 3.x and it is a blocker

refs FOO-4260
flag=none

Test Plan:
- Jenkins Passes

[skip-crystalball]
[fsc-max-nodes=18]
[fsc-timeout=40]

Change-Id: I56ff289813c532c98279766dbca19b9ec28c5d0c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341600
Product-Review: Ryan Norton <rnorton@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
2024-03-19 19:28:16 +00:00
Michael Hulse b778779f20 spec: skip help dialog focus spec
This commit skips the focus management test for the
help dialog. It was failing on Jenkins and we could
not reproduce it locally.

unblocking jquery upgrade path

refs FOO-4344
refs FOO-4260
flag=none

test plan: tests pass

[skip-crystalball]

Change-Id: I292a915cbe9e863303475cd3e8bb34543c8f605f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/342628
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jen Smith <jen.smith@instructure.com>
Reviewed-by: Angela Gomba <angela.gomba@instructure.com>
QA-Review: Jen Smith <jen.smith@instructure.com>
Product-Review: Jen Smith <jen.smith@instructure.com>
2024-03-14 00:58:51 +00:00
Angela Gomba 9cdfd7ce58 spec: Use closing tag </textarea>
This fixes some failing tests when upgrading to jQuery 3.5.

refs FOO-4260
flag=none

Test Plan:
- Jenkins Passes

[skip-crystalball]

Change-Id: Ic81449279070f9fb129161e03d833e04ff633227
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/342412
QA-Review: Angela Gomba <angela.gomba@instructure.com>
Product-Review: Angela Gomba <angela.gomba@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
2024-03-07 23:06:10 +00:00
Angela Gomba 36214ae403 spec: Add timer to helpDialogSpec
This fixes some failing tests when upgrading to jQuery 3.5.

refs FOO-4260
flag=none

Test Plan:
- Jenkins Passes

[skip-crystalball]

Change-Id: I75674c4fae4cd51bd9e0370bf5c303bece6ec083
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/342411
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Angela Gomba <angela.gomba@instructure.com>
Product-Review: Angela Gomba <angela.gomba@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
2024-03-07 22:19:37 +00:00
Samuel Lee 8d3eac6c3a fix showing resend invite based on permissions
fix issue where when additional granular permissions for adding
individual course roles are not enabled, a 403 error will appear
when resending invites in the roster page

fixes VICE-3902
flag=none

Test Plan:
- pick a role for testing. Example TA role.
- have the Users - manage students in courses permission turned on
- have all the individual granular add permissions turned off except
  the Users - Students option.
- note that permissions take a while to take into effect. A trick
  is to change timezones for the account with the role that you want
  to test. I tested using a TA role and changing the timezone to Tokyo
  and then changing back to central time in the TA account
  helped speed up the permissions change.
- have a student and teacher in the course
- log in to the account with the testing role and go to the roster page
- go the student and click on the three dots
- confirm that resend invitation option is shown
- go to the teacher and click on the three dots
- confirm that resend invitation option is not shown
- add a teacher role using the same student email
- view that the resend option is still in the dropdown for the student
- click resend and confirm that the invitation is sent and no 403 error
  appears
- confirm that only one api call is made in the network tab for
  the student role

Change-Id: I979274bc74078036bc2cbf69171c288bc876c331
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341881
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Jason Gillett <jason.gillett@instructure.com>
Product-Review: Samuel Lee <samuel.lee@instructure.com>
2024-03-06 17:03:17 +00:00
Angela Gomba 0c832b6d3b spec: use simulate click
This fixes some failing tests when upgrading to jQuery 3.5.

refs FOO-4260
flag=none

Test Plan:
- Jenkins Passes

[skip-crystalball]

Change-Id: Ie5e1fdd173b013e696e51e61ed7d4d2fda64bfa6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341895
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Angela Gomba <angela.gomba@instructure.com>
Product-Review: Angela Gomba <angela.gomba@instructure.com>
2024-03-05 14:51:10 +00:00
Samuel Lee 4af5d93ff8 add alert after editing profile
fixes VICE-4122
flag=none

Test Plan:
- enable profiles
- go to the user profile and edit the profile
- do not edit any of the fields and press save
- confirm that there is an alert with a save successful text and
  the screen reader reads the alert text
- edit the profile again and enter an extremely long name in the input
  field
- press save and confirm that there is an alert with a save failed
  text and the screen reader reads the alert text

Change-Id: Id23352084bea41b9fac5b829ddb029805b597e04
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341744
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Gillett <jason.gillett@instructure.com>
Product-Review: Samuel Lee <samuel.lee@instructure.com>
2024-03-04 20:22:40 +00:00
Angela Gomba ec394e19ba spec: Add timers to ValidatedFormViewSpec and RoserUserViewSpec
This fixes some failing tests when upgrading to jQuery 3.5.

refs FOO-4260
flag=none

Test Plan:
- Jenkins Passes

[skip-crystalball]

Change-Id: Icb570b4d608e11c8a4aeeaa6ecc4a133d62db276
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341891
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Angela Gomba <angela.gomba@instructure.com>
Product-Review: Angela Gomba <angela.gomba@instructure.com>
2024-03-01 18:13:30 +00:00
Angela Gomba 58d933334e spec: Add timers to specs
This fixes some failing tests when upgrading to jQuery 3.5.

refs FOO-4260
flag=none

Test Plan:
- Jenkins Passes

[skip-crystalball]

Change-Id: I74e8f5227b7f73c8283180517fdc18793f2de1de
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341387
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Angela Gomba <angela.gomba@instructure.com>
Product-Review: Angela Gomba <angela.gomba@instructure.com>
2024-02-29 23:32:49 +00:00
Angela Gomba 9815cbea4d spec: update checking for todo input
This fixes some failing tests when upgrading to jQuery 3.5.
In jQuery 2.2.4 when $todoDateInput.show() is called it adds
'display:block' which is how we checked for the input being
displayed. In jQuery 3.5 it affects the styles differently
depending on the case. In this particular case it removes
the 'display:none' css from the input style. This change
updates checking for the input displaying by checking it
no longer has 'display:none'.

refs FOO-4260
flag=none

Test Plan:
- Jenkins Passes

[skip-crystalball]

Change-Id: Icd55c60bcc46bf10ebe652635489f47e2077b40c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341381
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Angela Gomba <angela.gomba@instructure.com>
Product-Review: Angela Gomba <angela.gomba@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2024-02-29 14:25:54 +00:00
Angela Gomba 328720c016 spec: add time for server to respond
This fixes some failing tests when upgrading to jQuery 3.5.

refs FOO-4260
flag=none

Test Plan:
- Jenkins Passes

[skip-crystalball]

Change-Id: I44f320f0cc768fb7123e8e2ac405d379cf2a7c20
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341382
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Angela Gomba <angela.gomba@instructure.com>
Product-Review: Angela Gomba <angela.gomba@instructure.com>
2024-02-29 14:25:29 +00:00
Angela Gomba c3bf690fe4 spec: Use timers in LDBLoginPopupSpec
This fixes some failing tests when upgrading to jQuery 3.5.

refs FOO-4260
flag=none

Test Plan:
- Jenkins Passes

[skip-crystalball]

Change-Id: I32ac4f1647a733779b657b865dbd353c6a78f527
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341380
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Angela Gomba <angela.gomba@instructure.com>
Product-Review: Angela Gomba <angela.gomba@instructure.com>
2024-02-28 20:49:30 +00:00
Samuel Lee 6f34876083 fix date display for discussion redesign
fix issue where dates in discussion redesign were displayed
using the course setting timezone instead of the user setting
timezone

fixes VICE-4087
flag=discussion_react

Test Plan:
- have a user setting timezone that differs from the course setting
  timezone, such as having the user setting timezone as tokyo while
  the course setting timezone is local
- create a discussion with varying dates such as due date, unlock, and
  until
- confirm that the dates set in the date time inputs match the date
  in the discussion topic itself and the discussion index page
- play around with other dates such as in a graded discussion and
  confirm the dates set in the date time inputs match whatever is shown
  in the discussion topic
- confirm that discussion replies and posts are displayed using the
  user setting timezone instead of the course setting timezone
    - this includes split screen view threads and normal view threads
    - this also includes when editing a discussion reply and post

Change-Id: I0b5582328ed671b513de2ffccbc6ed1d65602d2d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341553
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Jason Gillett <jason.gillett@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2024-02-28 18:18:26 +00:00
Sarah Gerard c1031de504 Remove dead calendar header code
the h2 and button removed from the calendar
header were not being used anywhere. Getting rid
of them and related functions to keep the code clean

closes LF-1286
flag=none

test plan:
- navigate to the calendar page and mess around with
  the existing buttons in the header. Ensure there are no changes
  to their functionality.

Change-Id: Id7266728b32da823a706a68a1cc4fa6e8a946155
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341447
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: Sarah Gerard <sarah.gerard@instructure.com>
2024-02-27 16:42:55 +00:00
Michael Hulse ebf2f0f3e2 update codebase to use .prop() over .attr()
In this commit the codebase has been updated to use .prop()
over .attr().

The .attr() calls were found using this regex:

\.attr\(\s*['"](?:checked|disabled|selected)

This regex looks to update attributes from .attr(...) to
.prop(...) to ensure compatibility with jQuery 3.5 as these
are boolean properties (checked, disabled, and selected).

unblocking jquery upgrade path

refs FOO-4260
flag=none

test plan: tests pass

[skip-crystalball]

Change-Id: Ieddff1688ca9d8659b9b952ae548aad8c7b58dd8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341290
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Angela Gomba <angela.gomba@instructure.com>
QA-Review: Michael Hulse <michael.hulse@instructure.com>
Product-Review: Michael Hulse <michael.hulse@instructure.com>
2024-02-26 20:14:43 +00:00
Michael Hulse c003441d42 spec: remove test to check for $.browser
This functionality was removed in removed in jQuery 1.9.

unblocking jquery upgrade path

refs FOO-4260
flag=none

test plan: tests pass

[skip-crystalball]

Change-Id: I938a4b93e5fce12f64576105909a66ae767c0119
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341222
QA-Review: Michael Hulse <michael.hulse@instructure.com>
Product-Review: Michael Hulse <michael.hulse@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Angela Gomba <angela.gomba@instructure.com>
2024-02-26 17:45:12 +00:00
Angela Gomba 69805bb7fd spec: Fix respondWith parameters
This is part of fixing a test failure when removing
jquery-migrate 1.4. I also made some fixes for eslint errors.

refs FOO-4260
flag=none

Test Plan:
- Jenkins passes

[skip-crystalball]

Change-Id: I856af834e1fd5207a84403c059e53a8b2fab3d57
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/340809
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Angela Gomba <angela.gomba@instructure.com>
Product-Review: Angela Gomba <angela.gomba@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
2024-02-26 16:22:05 +00:00