Commit Graph

21193 Commits

Author SHA1 Message Date
wdransfield 338dc26fed Add permission checks to global navigation
Closes PLAT-5231

Test Plan:
- Install 3 global navigation tools:
  One that requires an account-level permission (A),
  One that requires a course-level permission (B),
  One that requires no permissions (C)
- Grant a user the course level permission in
  one course, but not another
- Navigate to the course where the user has the
  required permission. Verify Tool B and C
  are visible in the global navigation
- Navigate to the course where the user does not
  have the required permission. Verify only Tool C
  is visible.
- Navigate to an account where the user has the
  account-level permission. Verify only tools A and
  C are visible.
- Navigate to an account where the user does not have
  the account-level permission. Verify only tool C
  is visible.
Change-Id: Ie3fc04f38b1be89b02d04ff15ecaf14d58bdfeb2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220230
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Oxana Jurosevic
2019-12-12 21:30:20 +00:00
Spencer Olson ad40092ddf add spam_status to eportfolios
closes TALLY-376
flag=none

Test Plan:
1. Verify you can migrate and roll back the migration without errors.

Change-Id: Ibf2874cd77ec7b11ab874b2f464bb8a35b7fb85b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220031
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
2019-12-12 16:44:51 +00:00
Jon Willesen 99c4dfcf91 add direct share features to discussion show page
closes LA-299
flag=direct_share

test plan:
- as a teacher, and only when the direct share feature flag is on, the
  direct share options should appear in the discussions show page kabob
  menu and be functional.
- when students have permission to create and manage discussion topics
  in the course, they should not have the direct share options.

Change-Id: I9de37369b323cbad7009807cfa61c86b629e1a68
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219991
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-12-12 00:12:05 +00:00
Rob Orton a734b68c45 log who and how a user was merged
test plan
 - merge a user via api
 - the merged data in the console will have the user that did the merge

fixes CORE-3284

Change-Id: I193c1cd40fd056be9fef6c5961f5ac5bf9aed419
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219862
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2019-12-11 22:43:01 +00:00
Clay Diffrient e2d0d8bf3a Add violations from the tray to the whitelist
Test Plan:
  - Start up CSP logging service
  - Add a few violations to the CSP service by posting
    to that service
  - Enable CSP feature flag in Canvas
  - Go to /accounts/XX/settings and click on the security
    tab
  - Click "View Violations Log" in the whitelist header
  - A log should appear showing the violations
  - Click the "Add to Whitelist" button for a violation
  - It should show up in the whitelist.
  - It should disappear from the violation log
  - A flash message should also indicate success

closes USERS-63

flag = javascript_csp

Change-Id: I0e2a4a33e9cab27298d29f392920fd5c6d87cb26
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217882
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-12-11 20:53:43 +00:00
James Williams ac97c5ec13 fallback to extension from filename in submissions api
when parsing for assignment restrictions,
similar to how it is on the regular submissions controller

test plan:
* submitting a submissions file via the API
 (or via mobile) for an assignment with an unknown
 extension requirement (i.e. ".pages") shouldn't break

closes #LA-304

Change-Id: I15456ad53603450176aa7a5b187db863e03763a9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220339
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-12-11 17:10:07 +00:00
James Williams 58bf953a57 restrict course media objects index api to active attachments
test plan:
* the /api/v1/courses/X/media_objects endpoint
 should only show media objects associated with
 attachments in the course that the user can view
 (i.e. deleting an attachment should remove its
 associated media object from the index)

closes #LA-319

Change-Id: I326d0414578ab2111111b7149768e9d16e6a1be7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220335
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-12-11 16:59:46 +00:00
James Williams 68ef9c448c don't try and fail to copy post_to_sis with no due date
test plan:
* configure an account to have the "post grades to SIS"
 setting and "enable new SIS integration settings" feature
* create a course with a graded discussion only assigned
 to a specific section with a due date and "sync to sis"
 enabled
* should be able to copy into another course but
 with a warning noting that the "sync to sis" setting was
 not copied (because no due date came over)

closes #LA-198

Change-Id: I44ec8bb34d54c2bf52d4d4690fc4219d0e357cc1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217582
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-12-11 16:48:50 +00:00
James Williams fb2c089941 improve assignment not found message
test plan:
* trying to view a submission url for
 an assignment that has been deleted should not
 flash an error saying that the user is not a valid student

closes #LA-217

Change-Id: I621f624dabce4ba94efa2ae493c44b12ab51ac69
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220220
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-12-11 16:42:58 +00:00
Jeremy Stanley b240334e53 remove spurious </ul> after direct share menu items
test plan:
 - have an LTI tool with assignment_menu placement installed
 - enable the direct share feature flag
 - on the assignments index page, the LTI tool's placement
   should appear after the "Copy To" and "Send To" items
   inside the menu (and should _not_ be visible _outside_
   the menu)

flag: direct_share
fixes LA-351

Change-Id: Ie0261aa2e63bd7fc7007c698a73bd744c623bff8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220290
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2019-12-11 01:03:03 +00:00
Adrian Packel 7c5065319a Don't hide comments on assignment reupload
When a teacher downloads and re-uploads submissions/attachments for an
assignment (using the "Download Submissions" and "Re-upload Submissions"
links on the assignments page), ensure that the comments that are
auto-generated on reupload check the visiblity of their respective
submissions, rather than the muted status of the assignment as a whole,
to determine whether they are hidden.

flag=none
fixes TALLY-207

Test plan:
- Have a course with New Gradebook and Post Policies enabled
- Create two assignments (A1, A2) and have both accept file uploads
  - Set A2 to be manually-posted
- For two students (S1 and S2):
  - Upload files for the above two assignments
- As the teacher:
  - For A1:
    - Grade both students' submissions (this posts grades automatically)
    - Hide grades
    - Re-grade S1
    - (this sets S1 to graded+posted and S2 to graded+unposted)
  - For A2:
    - Grade S1's submission
    - Post grades for "Graded only"
  - For each assignment:
    - Download all submissions using the "Download Submissions" link on
      the assignment page
    - Re-upload submissions for that assignment with the zip file you
      just downloaded (using the "Re-upload Submissions" link)
- As S1:
  - Check your submission details page for both assignments
  - There should now be a comment from the teacher with the text "See
    attached file"
- As S2:
  - Check your submission details page for both assignments
  - No comments should be visible (i.e., the auto-generated comment
    should be hidden)

Change-Id: I66dc7a5ce99e32b02152ecff3fda3e925ac2ffe5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219603
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2019-12-10 22:41:23 +00:00
Mysti Lilla 5a4271ebbf Only search teachers within root account
fixes LA-349
flag=direct_share

Test plan
- Not sure how to test this as you need
  two root accounts in one shard
- I suppose you can probably create a
  root account in your existing database
- In any case, search for a user
  using a term that exists for another
  teacher in the other root account
  (email or name)
- Ensure they don't show up

Change-Id: If888b6ee94037a87f9299f3822bee62a19656702
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220149
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-12-10 21:30:39 +00:00
James Williams b9580173c6 support observed student submissions via assignment groups API
test plan:
* as a observer in a course,
 should be able to use the assignment groups index API
 endpoint (/api/v1/courses/X/assignment_groups)
 with 'assignments', 'submission', and 'observed_users'
 parameters passed to 'include' (as documented)
 to view submissions for the observer's student

closes #LA-274

Change-Id: Id145ab1a134b048c3fbcfa1f59a8d283f14e4eba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220184
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-12-10 20:58:39 +00:00
Ryan Shaw a57dbac767 Fix courseWizard & lazy-load it
closes: LA-91

Test plan:
1. As a user in a course, navigate to a course home page (courses/:id).
2. Click the Course Setup Checklist button on the right side menu.
   This should open the Course Setup Checklist.
3. Close the checklist by clicking the x in the top right corner.
   It should return you to the course home page.
4. Try clicking the Course Setup Checklist button again.
   It should open it back up.
5. verify that when the modal is opened, the focus is put on
   the close button

Change-Id: I85392ac52d55a3da28a7e43c0f056b0b240b8e98
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217688
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-12-10 17:24:26 +00:00
Charley Kline 90768ab688 Remove "Login Label" from Account settings
Closes USERS-109
flag=none

Per the ticket, this field is deprecated on this screen
and instead appears in the Authentication settings.

Test plan:
* The field is gone from /accounts/:id/settings

Change-Id: I4ccd0961cc10d9d77651d521a89e8a09bc422774
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/220042
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
2019-12-10 16:52:51 +00:00
James Williams 6272f32e05 de-dup adminable_accounts_scope
test plan:
* add a user as an admin in two different roles
 for the same account
* /api/v1/accounts shouldn't return the same account twice

closes #LA-343

Change-Id: I2c14ebe793ade7cb62054bda188a148c8d9e7b43
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219778
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-12-10 13:26:52 +00:00
Mysti Lilla 92fced77cf Use standard 1-based position to insert module items
fixes LA-338
flag=direct_share

Test plan
- Requires g/219207 and g/219874
- With a module that has two items
  with the same position
- Ensure you can import a new item
  in between the two items with
  the same module position

Change-Id: I656d37fad6302a02ac0b6a510611c5f028957d90
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219894
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-12-10 06:43:41 +00:00
Mysti Lilla 5c8faee4fc Use standardized positions for inserting item in modules
refs LA-338
flag=none

Test plan
- Have a module with duplicate item positions
- Ensure you can import an item in between
  those two items using a normal 1-based
  counting system instead of basing it
  off of the module item position
- Have a module with positions that don't
  start at 1 and ensure you can use a
  normal 1-based counting system to
  get the new item where you want it to be

Change-Id: I61f7daeabd09d141e08f28d2e2522cb5f08a7dfe
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219874
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-12-10 00:38:43 +00:00
Mysti Lilla 3849cfad1c Prevent 404 error in Direct Share tray
fixes LA-325
flag=direct_share

Test plan
- In the direct share import tray
  select a course and then a module
  for that course
- Then search for a different course
  and select one from the searched list
- Verify that you don't get the "something
  went wrong" picture

Change-Id: I70b7614da7d9003c76bf3ebe3ff1290e4de98575
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219207
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-12-10 00:15:54 +00:00
ckibler 1ef593e69e mark content shares as read when viewed or imported
closes LA-190
flag=direct_share

test plan:
 - Have a few unread content shares
 - Click kabob menu for one should NOT mark it read
 - Doing Preview on a share marks it read
 - Doing Import on a share marks it read
 - Opening Import tray but not starting one does NOT mark it read
 - Note, there can be ~60 second delay before the unread count
   updates

Change-Id: Ib6d3d0c32415e472f9f913235b20e010cf9bd054
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217709
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
2019-12-09 22:39:44 +00:00
Jeremy Stanley 47886e0320 add validations to MediaTrack
test plan: passing incorrectly formatted data in the
`kind` and `locale` parameters to POST
/media_objects/:media_object_id/media_tracks
should result in an error

refs LA-172
flag=none

Change-Id: Ibe9e13022dc858b15c0341a058a1cf9c9d528d39
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219869
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2019-12-09 21:27:25 +00:00
Marc Phillips cf50c61579 Remove Customization and Redux from Dev Keys
Removed the customization workflow for dev keys and
also removed redux from lti key creation, simplifying
the codebase and cleaning up unused code.

refs PLAT-5107

Test Plan:
 - Create a new lti key, note that it still works as before
 - Create a new api key, note that it still works as before
 - Be sure to try all different types of key creation

Change-Id: I9af89123f94896f42e5c5b736757919effd15b7b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219146
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
2019-12-09 20:30:08 +00:00
Gary Mei 9631484f1d fix submission details page comment not showing up
flag=none

Comments made from the submission details page were falsely having
their hidden attribute set to true even when the assignment posts
automatically.

fixes TALLY-192

Test Plan
- Enable New Gradebook.
- Create an assignment.
- Ensure that the assignment posts automatically.
- As a teacher, navigate to the submission details page for a
  student:
  courses/:course_id/assignments/:assignment_id/submissions/:user_id

- Leave a comment as a teacher.
- As the student, verify that the submission comment is visible.

Change-Id: I421d038d3ce892598377089645fc5badb95a4f0e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218574
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2019-12-09 19:57:52 +00:00
Charley Kline d94205986f Make Subaccount and Term searchable on course create
Fixes USERS-7
flag=none

Had to do some fairly major surgery as the CanvasSelect
component isn't really set up for searchable selects, so
I wrote a separate component to do that (should that get
hoisted up to shared/components?) and redid NewCourseModal
to use that instead of CanvasSelect.

Test plan:
* Navigate to /accounts/1 (assuming your "base" account has
  id 1)
* Click on the "+ Course" button in the upper right to
  bring up the creation dialog
* The "Course Name" and "Reference Code" boxes should
  behave as they always have
* The "Subaccount" and "Enrollment Term" boxes should now
  be searchable i.e. if you enter them and start typing, the
  list of choices for account or term should narrow as you
  type, and then be selectable by mouse or keyboard arrows
* Accessibility including screenreaders should be acceptable
  for these actions

Change-Id: I78ddb3fba15cdb9ed36b7c6a6ee0a878cdb62597
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219353
Product-Review: Charley Kline <ckline@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
2019-12-09 19:27:29 +00:00
ckibler 3e9b0e45ac add tooltip to unread content share indicator
closes LA-294, LA-295
flag=direct_share

test plan:
 - On content shares page, hovering over read/unread badge shows a
   tooltip of status and action that clicking will take
 - clicking the badge toggles between read and unread state

Change-Id: Ibcc5430bfcd482b6e6bad8196711300215e951ba
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219820
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
2019-12-09 19:13:53 +00:00
Charley Kline 4657162393 Respect manage_course_visibility on course creation
Fixes USERS-149
flag=none

Add safeguards in the courses_controller create method to
make sure that the caller can manage course visibility.
I had to be careful to check _all_ the visibility settings
in the API call, not just the one that the UI sets.

Also, fix up the UI so that the option to make a newly-
created course public doesn't appear if the user does not
have the manage_course_visibility permission.

Test plan:
* Try to create a new course and make it public from a user
  with the Change Course Visibility permission
* It should work
* Now try it from a user that does NOT have that permission
* The option to make it public shouldn't even appear
* Extra credit: hack app/views/shared/_new_course_form.html.erb
  (line 60) so that the "make public" checkbox appears even
  when the permission isn't granted
* Then even when checking that box that you shouldn't be
  seeing to try to make the new course public, the resulting
  course should still only have "Course" visibility

Change-Id: I48ed471885a6f3357e17aa09aef33fb098861b6f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218527
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2019-12-09 17:20:28 +00:00
Adrian Packel d435957320 Use certified icon for low plagiarism score
closes TALLY-244

Test plan:
- Have a course with New Gradebook and some students
- Enable the "New Gradebook Plagiarism Indicator" feature flag
- Create an assignment with text entry submissions
- Add an originality report to one of that assignment's submissions, and
  give it a similarity score between 0 and 20, e.g.:
  > submission = <get a submission>
  > submission.originality_reports.create!(
      workflow_state: "scored",
      originality_score: 10.0
    )
- Open New Gradebook
- The cell for that submission should show the "certified" icon (spiky
  green circle with checkmark) instead of the previous "complete" icon
  (non-spiky green circle with checkmark)
- Similarly, the details tray for the submission should show the new
  spiky icon

Change-Id: I9e105810f9b828ba1016b955808b03c7619cbb24
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219123
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
2019-12-09 16:40:13 +00:00
Adrian Packel 87bbc0ba5b Add more gradebook sort options
flag=new_gradebook_sort_options
closes TALLY-210

Test plan:
- Have a course using new gradebook
  - Have several students with pseudonyms (i.e., logins; see below)
  - Have at least one pseudonym-less student
  - Have a mechanism to filter students (section or student group)
- Enable the feature:
  - Open the Settings page for your root account and allow the
    "Additional Sort Options for New Gradebook" feature
  - Open the Settings page for your course and enable the above setting
    for the course
- Open new Gradebook
- In the student column header menu, the "Sort by" item should now show
  several sort fields and (separately) a sort order
- Check that the sort fields work as expected:
  - (Note that you will need to use the "Secondary info" menu item to
    show the relevant info field under users' names; selecting a sort
    option will not automatically change the secondary info to match)
  - "Name" should sort by the user's (sortable) name
  - "SIS ID" should sort by the SIS user ID on the user's account
  - "Integration ID" should sort by the account's integration ID
  - "Login ID" should sort by the user's login name
  - "A-Z" and "Z-A" should switch between ascending and descending
    sort order for the selected sort field
  - In all cases, students with no value for the selected field (e.g., a
    student with no login ID) should appear at the bottom of the list,
    regardless of the selected sort order
- Check that filtering by section or group still works as expected
  - Selecting a specific filter, as well as removing the filter, should
    respect the sort field and order

- Turn OFF the feature flag for the course
- Go back to New Gradebook
  - Check that the sort menu has returned to its previous state, with
    only "A-Z" and "Z-A" options that sort by name
  - (If you were sorting by a different criterion when you had the flag
    enabled, said criterion will initially still be in effect, but
    adjusting the sort order will bounce it back to sorting by name)

APPENDIX: adding pseudonyms

To create a pseudonym for a student in a Rails console:
> user = <a student>
> user.pseudonyms.create!(
    account: user.account,
    sis_user_id: "some_sis_id_or_other",
    integration_id: "some_integration_id_or_other",
    unique_id: "a_login_id"
  )

Or you could do it the boring way by just adding a login from their user
details page, but I'm not sure how to update the SIS ID and integration
ID from there.

Change-Id: I290bced84432a4776a9c20efbaeb26aeb7e18638
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/200805
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-12-09 16:40:02 +00:00
Erin Hallmark 7b3c8b7d0a Update permissions UI documentation
This commit adds minor clarifications to manage_grades and
view_all_grades based on bug fixes mentioned in the ticket.
Also removes /*eslint-disable*/ previously part of the file
and cleans up extra spaces within the code.

Since permissions are complex this commit also includes
other additions/removals that clarify changes that affect
other permissions (the additional considerations section).
We also clarified which permissions are not available at
the subaccount level.

Also modified this file to reflect permissions update from
Users-32, which affects courses - view usage reports and
grades - view all grades permissions.

Test plan:
- Jenkins passes

flag=none

CLOSES: USERS-158
REFS: USERS-32

Change-Id: Iee983c254a92f305d7a95de960d8640ace1884af
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218871
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Erin Hallmark <erin@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
2019-12-06 22:48:03 +00:00
Ryan Shaw 9e511887e5 fix group dropdown not staying open when clicked
Fixes: KNO-38

Test plan:
* Create a group set in a course with 25+ groups. 
* Head to the group home page. 
* In the top left corner click to open the "Switch Group" dropdown. 
* the dropdown list of options should be shown, and it shouldn’t
  immediately disappear

Change-Id: I1a479e714d1028e367a88c62c87c71d71562c47e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219669
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
2019-12-06 19:17:14 +00:00
James Williams 103f67bce4 fix permissions for file replacement for other contexts
test plan:
* files attached to quiz submissions should be able
 to be deleted via the API (using replace=1) by
 account admins

closes #LA-200

Change-Id: I446946fedb357e36d313e0993555668a1d85f1d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219089
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-12-06 17:08:12 +00:00
Jon Willesen 5ab9718818 add direct share features to wiki page view
closes LA-301
flag=direct_share

test plan:
- view an individual wiki page you can update.
- The "Send To" and "Copy To" menu items should appear in the kabob
  menu.
- The send to and copy to direct share features should work properly.
- When closing the tray/dialog, focus should be returned to the kabob
  menu.
- This should also work when viewing the wiki home page.
- The menu items visibility should be controlled by the direct share
  feature flag (note there seems to be a cache that needs to timeout
  about a minute after changing the flag).

Change-Id: I1dff1af1b64c562034e69a6fb70d509518b7dc92
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219205
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2019-12-06 16:22:17 +00:00
James Williams 743cd1a9c0 ensure correct delayed_jobs shard activation after commit
test plan:
* role override datafixups in transactional migrations
should queue the cache clearing job in the correct jobs shard

closes #LA-335

Change-Id: Ic688644430acf584b9711ec69c8d19a87025dccc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219777
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
2019-12-06 16:04:01 +00:00
Clay Diffrient 4560458cf7 Remove violation log link from subaccounts
Subaccounts can't access the violation log so they shouldn't show
the button to see them.

Test Plan:
  - Enable CSP feature flag in Canvas
  - Go to /accounts/XX/settings and click on the security
    tab
  - You should see View Violation Log option
  - Go to a subaccount (creating one if needed)
  - Go to the settings for that subaccount and go to the
    security tab
  - You should not see the View Violation Log option

closes USERS-150

flag = javascript_csp

Change-Id: Icd837bd0b516fe92b4eb309f97b0b3fcfadba30e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218335
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2019-12-06 15:25:53 +00:00
Landon Gilbert-Bland 0ce107e483 Fix incoming mail processor
Change-Id: I714f2d0b0fec0703a6ed2d21c043d91d405dce29
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219713
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Gentry Beckmann <gbeckmann@instructure.com>
Tested-by: Steven Burnett <sburnett@instructure.com>
2019-12-06 05:23:15 +00:00
Clint Furse ba7cbacab4 include enrollment data on asset_accessed events
closes PLAT-5096

Test Plan:
- trigger an asset_accessed as a non-admin
- verify that the enrollment_id and course_section_id is included
  in the payload

Change-Id: Iea99daa7df03323b22181751c4fafd784025636d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217905
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Marc Phillips <mphillips@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Marc Phillips <mphillips@instructure.com>
Product-Review: Marc Phillips <mphillips@instructure.com>
2019-12-05 23:04:36 +00:00
Spencer Olson 71bac498fa delete eportfolios when a user is soft-deleted
closes TALLY-347

Test Plan:
1. Delete a user via the UI and verify their eportfolios are deleted

Change-Id: I4ea0ca359f8e130e4084e0eba6efb0d4875efd72
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219512
Reviewed-by: James Williams <jamesw@instructure.com>
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2019-12-05 22:48:18 +00:00
Ryan Shaw 7e3533ac80 Remove some unneeded React.memos
Having these here means that react is first going to shallow diff any
props for referential equality (meaning `() => “hi”` is not the same as 
`() => “hi”` since they are different functions in memory even though
they return the same thing) and then if that shallow diff fails, it
is still going to re-render all children. In most cases that means these
are actually making react do MORE work.

So if there are any particular ones of these that we know are preventing
us from having to re-render stuff that is more costly than the extra
prop-diffing is saving us, and we know that is a bottleneck, then lets
comment that we did that on purpose but if not, we can remove these

Test plan:
* the a2 student page should work and look the same but it should
  actually render a little faster than it did before
  
flag=assignments_2_student

Change-Id: I6693799c10e009d41f33fa9d3559175029c76463
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218664
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
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-12-05 20:34:43 +00:00
sshepherd dbbead288d Require view grades perms to view Interactions Reports
fixes: USERS-32

test plan:
1. In account settings, make sure TAs don't have
   permission to view grading.
2. Create a new course.
3. Add a student and a TA.
4. As a course member with access to manage grades,
   grade at least one student submission.
5. As the TA, open the Student Interactions Report
   from any TA or teacher in the course
6. It should not allow you to view the Student
   Interactions Report since there are grades on
   the report and you don't have permission.

Change-Id: I1c2286b05946ced32bb26e9037a3dfbea073d17d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217075
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
2019-12-04 17:05:57 +00:00
Steven Burnett c72bf19e9d fix delete button description and focus
fixes KNO-112 KNO-113
flag=account_pronouns

Test Plan:
- with the account pronouns feature flag turned on
- go to the account settings page
- navigate with your screen reader to the pronouns section
- navigate to the delete button
- notice the delete button now states the thing you are removing
- click the new pronoun button
- notice the focus goes to the newly created row

Change-Id: Ifed7e94489cc0ae131e7d549925071faa7a6b826
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219245
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-12-04 02:20:18 +00:00
mmagyar 56cc1e5cf8 Unify look of LTI tray in RCE and Canvas
Both RCE and Favorites Import tray will look the same
 as on the design linked in the ticket.

Test plan: Tray should open and function as
 it did previously,
 there should be no functional change only visual

fixes LA-170

Change-Id: Id5118f3217beaf4eb0eadf175d90201f5d816980
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218394
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Reviewed-by: Carl Kibler <ckibler@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
2019-12-03 23:23:02 +00:00
Ryan Norton 89eff9a46c add colon before submitted / available dates in a2
in some places of a2 we use a colon before denoting dates, in
other places were weren't.  in order to stay consistent, we are
adding a colon before submitted / available dates

Test Plan:
* as a student in a2, navigate to an assignment
* submit an assignment
* below the pizza tracker you should see a submit date
** confirm it has a colon like "Submitted: <date>"

* as a teacher, create a locked assignment with an Available From
  and Until date
* as a student in a2, navigate to this assignment
* confirm that the availablilty  date shows with a colon like:
** Available: <date> until <date>

flag=assignments_2_student
fixes KNO-177

Change-Id: I8051d4cb5506da0824f4ad6bdc9cf1201996bf0e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219326
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-12-03 23:22:53 +00:00
Fredrik Ekre 0889c5d97a Fix some Submission API return types
closes #1543

test plan: api docs are correct

Change-Id: I3a2e74f48b5380d0dfdc026ae957659bec35f331
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219253
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2019-12-03 22:54:53 +00:00
Ryan Norton e850f2a53c hide decorate images from SR in a2
we have three images that we should hide from screen reader in a2
* Multiple Choice Submission
* Cannot create comments
* No file preview available

Test Plan:
* as a student in a2, navigate to an assignment
* with screen reader enabled, confirm that the above three
  images are effectively hidden

flag=assignments_2_student
fixes KNO-175

Change-Id: I1ab964034d36abbf87a901d6b5f4f7770597effe
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219320
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-12-03 21:30:05 +00:00
Ryan Norton 6cad06d79f make a2 pizza tracker hcm compatible
the pizza tracker in a2 did not respect the high contras mode
setting, now it does

Test Plan:
* as a student in a2, navigate to an assignment
* while not in HCM, verify the pizza tracker colors
* switch to HCM
* verify the pizza tracker colors have changed

* verify:
** default step items (not yet reached, gray dot)
** completed steps
** in-progress steps
** locked steps
** buttons (previous, next, new)
** the progression line between steps

flag=assignments_2_student
fixes KNO-173

Change-Id: I0923f90421a178e92346ad36eca8b6efca1eb9a3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219306
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-12-03 21:22:06 +00:00
Fredrik Ekre 8e96b8b4b5 Fix some assignment api return types
specifically Assignment.points_possible and Assignment.integration_data

fixes #1539

test plan: api docs are correct

Change-Id: I7522a84f33530fd854f6429e460b19f63d364cd8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219248
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2019-12-03 20:59:09 +00:00
James Williams 842f4be312 clear quiz availability cache on assignment override change
and vis versa

apparently quiz assignment overrides are set with both
quiz_id and assignment_id and overrides are pulled
by both the assignment and quiz object interchangeably
so we have to invalidate the cache for both pathways

refs #QO-542

Change-Id: I6b9fc5fef1bf64c6d597699c9088ff2874c3622c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219230
Reviewed-by: Aaron Griffin <agriffin@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Bryan Petty <bpetty@instructure.com>
Product-Review: Bryan Petty <bpetty@instructure.com>
2019-12-03 18:04:40 +00:00
Mysti Lilla c3dc354372 Show calendar events that used to be section-specific on planner
fixes LA-318
flag=none

Test plan
- Create a calendar event that has different dates per
  section
- (It should show up on planner at this point)
- Change it back to not being section specific
  and ensure it shows up on planner still

Change-Id: Ic212dc3ecd0517a7ee470c8431d1024ca5f093c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219137
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-12-03 17:14:03 +00:00
Jeremy Stanley 21dc0e7293 label paginator buttons for screen readers
test plan:
 - on the received content shares page, a screen reader
   should read "Page 1", "Page 2", etc. on the buttons
   that are visibly labeled "1", "2", etc.

fixes LA-293

Change-Id: I9c2a5ad65c1710c43c105490e296de0d3c18c773
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219172
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Daniel Sasaki <dsasaki@instructure.com>
2019-12-03 16:58:19 +00:00
James Williams 38e7a93e12 don't load all module progressions for mark done requirement
Change-Id: Icb266a84b82dcfed22fa1badae6e6e6e90d76c53
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219104
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
2019-12-03 16:49:24 +00:00
Anju Reddy e2cb1c4c68 spec: add minor typo fix
flag=Direct Share

Change-Id: Idf44b2c47b8b08aaa762eb3359464d7767b69d66
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219166
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Anju Reddy <areddy@instructure.com>
2019-12-03 16:11:35 +00:00
James Williams 510aee44b6 fix course link on group subtopic discussion page
test plan:
* create a course with a group
* create a graded discussion topic on the course
 assigned to the group set
* visit the group's copy of the topic
* should have a link at the top with the
 course's short name (aka course code)
 next to "From: "

flag=none
closes #LA-146

Change-Id: I819001469c4e1d4677e949120e18fc16b60daf2a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218918
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-12-03 16:02:06 +00:00
Matthew Lemon 6c7f97e0ba Darken previous and next month dates in Calendars
Test Plan:
- Navigate to calendar and check the contrast on the previous and next
  month dates using your favorite contrast checker (e.g. Axe chrome
  extension)
- The contrast on the dates should now pass requirements
- Navigate to settings and set high contrast mode and repeat the
  previous steps.

fixes KNO-24

Change-Id: I8b43e3c1675a72b6554adf57178a809ef6f24d81
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218956
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2019-12-03 15:39:07 +00:00
Fredrik Ekre c157752aec Fix return type documentation bug for AssignmentOverride.all_day.
closes #1541

test plan: api docs are correct

Change-Id: If66290da0eb5f85faccaad96b4263df13fcc011c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219130
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
2019-12-03 00:08:28 +00:00
James Williams ee66d9ab45 add file_index_menu LTI placement
test plan:
* configure a tool with a file_index_menu placement
 (similar to the wiki_index_menu type)
* enable the "Import Commons Favorites" feature
* should launch the tool though a cog dropdown
 in the header of the files page into a tray
* closing the tray after a message has been posted
 should cause the page to refresh

flag=commons_favorites
closes #LA-290

Change-Id: I9e825401fd66734da6269c62054578ccd443a4f6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218501
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
2019-12-02 22:18:07 +00:00
ckibler 08a3fc7067 fix Direct Share in course homepage view
the course homepage doesn't pass course_id in the way other course
pages do so the Send To modal was ending up with a null value for it.
Made the UI adapt to that variation.

fixes LA-313
flag=direct_share

test plan:
 - set course homepage to Assignment view and ensure the Send To
   modal loads and works

Change-Id: Ic092f2e9b5c9f13c533d27f432cde01eee39c677
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218912
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Anju Reddy <areddy@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
2019-12-02 21:56:02 +00:00
James Carbine eaa9fd1007 Fix adding students to a conference
The web conference model has a column named `user_ids` but also an
association named `users`, which auto-generates a method named
`user_ids`. The association auto-generated method takes precidence over
the column.

Back in the early days we must have been trying to populate this column
on save, but by calling `self.user_ids ||= ...` we were calling the
association reader method which was pulling ids from the database and
caching them in an instance variable:
(see https://apidock.com/rails/ActiveRecord/Associations/CollectionAssociation/ids_reader).
Since this reader always returns an array, it will always be true (even
if empty), so the line does nothing.

Removing it means the reader ivar never gets set, which means that when
we actually want to call `user_ids` to generate the json response, it
will be fresh, as can be seen by the passing test.

closes #1532

Test Plan:
  - Create a conference and only add one student.
  - Now edit that conference and add another student.
  - If you edit that conference again, that second student should have
    a checkmark indicating they are an invitee to the conference now.

Note: the test was provided by James Carbine, but I (Simon Williams)
adjusted the proposed implementation.

Change-Id: I6fe098c58580c2efb9c20eb26baac54eea4d4114
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218073
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2019-11-29 04:22:52 +00:00
Jeremy Stanley 6642ad33c5 paginate grouped submissions by user
before we were paginating by student enrollment and then
selecting unique students on the page, but a student with
multiple enrollments could appear on multiple pages

fixes ADMIN-2321
flag=none

Test-Plan:
* create a user in a course and enroll them as a student in
  multiple sections
* submit an assignment with that student
* page on the /api/v1/courses/#{@course.id}/students/submissions?grouped=1
  endpoint with per_page=1, and make sure the user only shows up
  on one page

Change-Id: Ie2eb1765ba64259b4c301e9f062bdb1a28ddbe1a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/214081
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2019-11-27 21:16:44 +00:00
Jeremy Stanley b4da805150 fix erb js_env with template streaming enabled
test plan:
- enable template streaming by adding this
  to config/dynamic_settings.yml:

  private:
    canvas:
      enable_template_streaming: true

- go to the course modules page
- edit a module requirement that some students have
  already fulfilled
- at the prompt, click "Relock modules"
- you should not get an AJAX error

fast test plan:
- open the javascript console and verify ENV.COURSE_ID is set

flag=none
fixes LA-309

Change-Id: Iac8a9577e9304238380a02222eeaf89729869d7c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218843
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-11-27 20:27:56 +00:00
Mysti Lilla b0044898f2 Add module item positioning to direct share trays
flag=direct_share
closes LA-11

Test plan
- Go to the received content page and the
  copy content menu and ensure you can
  see the module item pickers
- Ensure you can copy content to all
  of the various positions in the picker
- Verify the copied content gets to the right
  places

Change-Id: I68678edb89d51691a3ee4e5713dfceb46693cf89
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218105
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Zsofia Goreczky <zsgoreczky@instructure.com>
2019-11-27 19:29:37 +00:00
ckibler e1518e042b remove send/copy-to items from module item menus
closes LA-285
flag=direct_share

test plan:
 - with direct share on, ensure that kabob menu on a module item
   does not have Send To or Copy To options

Change-Id: If838dd7503a79db932632e388a54e0f9e8e7431d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218196
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2019-11-27 17:57:43 +00:00
Landon Gilbert-Bland 32c7fc9a99 Make apollo cache smarter for types not using node interface
This will result in less manual cache updates for types that do
not implement the node interface.

Test Plan:
  - Jenkins passes
  - Smoke test of existing pages using Apollo client to make sure
    they are still working correctly, specifically assignments 2.

fixes USERS-153

flag = none

Change-Id: I1b236784f7e407e04ae658c931b2027461cd685f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218405
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2019-11-27 16:05:00 +00:00
Ed Schiebel 11c04b5e39 Improve handling of the "blank" option from group selector
closes LA-141

The empty option was added when the "New Group Category" option
was converted to a button for accessibility (see OUT-57).
Now I hide the selector + its label if there are no group
sets.

test plan:
  - in a course with no group sets
  - create an assignment
  - check the "group assignment" checkbox
  > expect the "create group set" modal to appear
  - dismiss it w/o creating a group
  > expect the "group set" label and its <select> to be hidden
  - click the "New Group Category" button and create a group set
  > expect the "group set" label and its <select> to be displayed

  - editing an assignment that has at least 1 group set
  - check the group assignment checkbox
  > expect the select with "Select a group catetory" item displayed
  > expect the other options to be the existing group sets
  - try to save
  > expect an alert that you must select a group set
  - select a group set
  > expect to be able to save
  - edit again
  > expect the group to be selected

  From the ticket
  - Create a course with at least one student who is part of a group
  - Create or edit a group assignments
  - Select the group set dropdown and see that there is an extra empty selection there
  - Give your group assignment a due date and save it
  - Edit your assignment and select the empty option from the group set dropdown and try to save
  - After receiving the error message, select the actual group set
  - Change the date from being assigned to everyone to just being assigned to the student's group specifically
  - Save the assignment
  - As the student view the assignment and notice that the due date does not display.

Change-Id: I53f52f38f89bb37bd26ad0cd892570138178ad65
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217643
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
2019-11-27 15:45:14 +00:00
James Williams e86340a938 add assignment_group_menu LTI placement
test plan:
* configure a tool with a
 assignment_group_menu placement
 (similar to the assignment_index_menu type)
* enable the "Import Commons Favorites" feature
* should launch the tool though a cog dropdown
 for a specific assignment group into a tray
* the selected resources posted to the tool
 should only list the one assignment group you selected
* closing the tray after a message has been posted
 should cause the page to refresh

flag=commons_favorites
closes #LA-287

Change-Id: I65c38b87a863c25a45c55eae55c87994b5471632
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218306
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-27 13:09:07 +00:00
Ryan Shaw 9831a34ea2 don’t I18n.t error messages
There’s a bunch of places where we are i18n.t’ing error messages.
Those messages only appear in browser’s console and there is no
Expectation that they be translated. (Just as react’s or even native
Browser thrown error messages are not translated)

So by not translating these it should make our bundles a little smaller

Test plan:
* even if you set your locale to a non-english language
* if you ever ran into one of the cases these were logged to a
  Browser console
* it should log the error in English and not translated
* webpack bundles should be smaller

Change-Id: I0c9f65dd06c69f3353452f855791ce7f4c0c63da
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218770
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-11-27 04:29:05 +00:00
Matthew Lemon 1a2b32fa7b fix bug where media submission draft is always loading
This was due to Kaltura not immediately having media sources available
after uploading new media which is what we are using to render the
media. The upload complete response does contain an embedded_iframe_url
which we can use to temporarily display the media attempt while we wait
for the media sources to be generated.

Test Plan
- Create a media upload assignment
- As a student navigate to the assignment and create a submission draft
- The draft should display in an iframe
- Reload the page after a second and the draft should be displayed using
  media sources and a video player

fixes KNO-163
flag=assignments_2_student

Change-Id: I239a7441316438332af29e011acddf4ad5384ca2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218555
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2019-11-27 01:20:19 +00:00
Steven Burnett 2813f5cf66 add pronouns to assignment overrides picker
Test Plan:
- Turn on pronouns and have a user add some pronouns
- go create an assignment and create some overrides
- notice the pronouns show up appropriately

fixes KNO-156
flag=account_pronouns

Change-Id: I85fe018b8f66623a6f0927e1394fd68867c52a65
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217750
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Norton <rnorton@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-11-26 23:16:10 +00:00
Ryan Shaw 3d0d134a1e add moduleSequenceFooter to a2 student page
this also fixes some RTL bugs from our inline styling

demo: https://instructure.slack.com/files/U0296D4BU/FQJSMRXHR/screencast_showing_modulesequencefooter_in_a2_student_view.mov

Test Plan:
* as a teacher create a course with a module that has a few items
  (discussions, pages, lit tools, assignments, quizzes, etc) before
  and a few items after a given assignment
* now as a student go navigate to the first of those items
* use the “next” an “previous” buttons down in the moduleSequenceFooter
  to go back and forward through the items in the module
* when you get to this assignment the “prev” and “next” buttons should
  show up just like on all the page types
* clicking the “previous” and “next” buttons should work
* the “submit” button to submit your assignment should no longer float
  on the bottom of the page so it doesn’t interfere with the
  moduleSequenceFooter “previous” and “next” buttons

Test RTL:
* either set your language to arabic or hebrew or turn on the
  “force RTL even for non-RTL” feature flag
* verify that the buttons on the bottom of the screen flip to the
  opposite side of the screen

fixes: KNO-161
flag=assignments_2_student

Change-Id: I5f9e070f1b69aeadf4d3e1faca0d60fae7097b46
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218440
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
2019-11-26 22:14:53 +00:00
Ryan Shaw 275ef5dd5d dedupe an i18n scope
I think this was just a copy/paste fail, I don’t think we meant to use
The literal “_thing” value

Change-Id: Id2905c77c990246fd627d843454270919289ca1b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218771
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Norton <rnorton@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-11-26 21:19:35 +00:00
James Williams f75f8287d6 queue progress jobs after transaction
closes #CNVS-47710

Change-Id: I87064bec1a2c6eaff3e239317b7134cfeffb8f24
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218714
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-26 17:36:35 +00:00
Matthew Lemon e320e69e65 fix bug where url draft attempt crashes
When a user saves a draft URL on the third attempt and then attempts to
navigate to the first attempt the page would crash.

Test Plan:
- Create a course and add a student to it
- Create an assignment with an online url submission type
- As the student navigate to the assignment and create and submit 2
  drafts
- Create a third draft and then attempt to navigate to the first draft
- Note that the page no longer crashes

fixes KNO-145
flag=assignments_2_student

Change-Id: I1c75d4e08d43f0f282c4fec5329b08f97d09ce4e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217913
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Matthew Lemon <mlemon@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
2019-11-25 20:47:32 +00:00
Ryan Norton fdce70ac1d do not allow submissions to locked assignments
Test Plan:
* as a student, navigate to an assignment in a2
* create a valid submission draft
* as a teacher, lock the assignment (i.e. create an until date in
  the past)
* as the student, reload the page
* confirm that the assignment is now locked and there is no
  submit button

flag=assignments_2_student
fixes KNO-160

Change-Id: I3bda198b3ae97f66698159b112a6a27d83e0148b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218339
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-11-25 20:03:58 +00:00
Ryan Norton 95b4b0c97f do not lose focus when creating submission comment
when creating a submission comment in a2, we should ensure that
our focus does not disappear

Test Plan:
* as a student in a2, navigate to an assignment
* click the Comments tab in the tab list
* write a comment and click Send Comment
* confirm that the focus is returned to the input box

flag=assignments_2_student
fixes KNO-165

Change-Id: I9f168569f8958670268ccdac3df7e06a118d55aa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218450
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2019-11-25 19:53:04 +00:00
Ryan Shaw 3e39874355 Revert 2 commits to fix specs
"fix a2 student bug & only do one submission query"

This reverts commit 996121940b.

Revert "speed up Assignments#show & unskip slow specs"

This reverts commit 83171083e0.

Change-Id: Iec053ed3a1c989a4f441f8e69bf83d9e784fa014
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218518
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: James Butters <jbutters@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2019-11-25 17:01:32 +00:00
Simon Williams 77e1e9349e pass x-requested-with header for `fetch` requests
rails uses this header as a heuristic to know if a request is an xhr
request. Specifically here's the method:

    def xml_http_request?
      get_header("HTTP_X_REQUESTED_WITH") =~ /XMLHttpRequest/i
    end
    alias :xhr? :xml_http_request?

unfortunately this is not really a standard, just something jquery did
that rails uses. so we need to emulate it whenever we make requests via
other means. indeed, we already do this for axios.

we may want to consider making a `fetch` wrapper so future uses remember
to do this, but updating our default fetch options is a good start.

fixes CNVS-47648

test plan:
- make sure pageviews are enabled:
    `Setting.set('enable_page_views', 'true')`
- run rails, visit a page, and wait until the page checks unread_status
- make sure a page view is not logged for that request

Change-Id: I2b4b928b6d2c5a51e49045329026eeb23f1d743b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217855
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2019-11-22 21:16:47 +00:00
James Williams 16db63993d add module_group_menu LTI placement
test plan:
* configure a tool with a
 module_group_menu placement
 (similar to the module_index_menu type)
* enable the "Import Commons Favorites" feature
* should launch the tool though a cog dropdown
 for a specific module into a tray
* the selected resources posted to the tool
 should only list the one module you selected
* closing the tray after a message has been posted
 should cause the page to refresh

flag=commons_favorites
closes #LA-286

Change-Id: Idbaa746fc98d4ac4097da8488b7120a6acedc23f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218212
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-22 21:05:22 +00:00
Ryan Shaw ad67048b2b make ‘has_assignment_group’ cache key live longer
Change-Id: I8ee6f88e44f492b7471c1a6648339cac57c1886f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218102
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-11-22 20:42:14 +00:00
Ryan Shaw 996121940b fix a2 student bug & only do one submission query
this fixes the bug I just introduced to a2 student view but it also
fixes our code to use the same query result we already were querying
the db for instead of issuing a new query for the submission

and it also fixes a bug where if the student didn’t have permission
to :read_own_submission or :read_grades (read their own grades)
that they would still get shown the submission

test plan:
* as a student, go to courses/x/assignmets/y
* you should be able to see the part where you submit the assignment

Change-Id: Iba155bcf3b841ddaf94d3bcb450fbdddd8fbd99f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218336
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Matthew Lemon <mlemon@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-11-22 20:28:29 +00:00
Matthew Lemon e4cec6557c let students interact with passed until date assignments
If a student submits an assignment that has an `until` (lockAt) date on
it, the student should be able to see their submission, grades, and
comments, as well as leave new comments after that lockAt date has
passed. As a bonus I also fixed a wierd spacing issue on the locked icon
in the pizza tracker

Test Plan:
- Create an assignment and add a student to it
- As the student navigate to the assignment and create a few submissions
  on the assignment
- As the Teacher set the until date to a day in the past
- As the student refresh the page and note that you can still see past
  and current submissions, leave comments, view the rubric but you can't
  create any new submissions
- Create another assignment and set the until date to a day in the past
- As the student navigate to the new assignment
- The new assignment should already be locked and on the attempt tab you
  should see the availability dates for the assignment

fixes WOKE-45
flag=assignments_2_student

Change-Id: I830846f609d3f897954aa6286229dd51d485a584
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216737
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Ryan Norton <rnorton@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-11-22 17:38:48 +00:00
James Williams a742e450eb add discussion_topic_index_menu LTI placement
test plan:
* configure a tool with a
 discussion_topic_index_menu placement
 (similar to the wiki_index_menu type)
* enable the "Import Commons Favorites" feature
* should launch the tool though a cog dropdown
 in the header of the discussions page into a tray
* closing the tray after a message has been posted
 should cause the page to refresh

flag=commons_favorites
closes #LA-78 #LA-79

Change-Id: I06e5915fe899f9bfd0f66b1a52b4a4faf28b814b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218155
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-22 16:45:10 +00:00
James Williams b5de047912 add quiz_index_menu LTI placement
test plan:
* configure a tool with a quiz_index_menu placement
 (similar to the wiki_index_menu type)
* enable the "Import Commons Favorites" feature
* should launch the tool though a cog dropdown
 in the header of the quizzes page into a tray
* closing the tray after a message has been posted
 should cause the quizzes page to refresh

flag=commons_favorites
closes #LA-76 #LA-77

Change-Id: I2205d3a73bb0c6bd2d60992968fa28b129e0e177
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218039
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-22 16:45:02 +00:00
James Williams cae08c5333 add assignment_index_menu LTI placement
test plan:
* configure a tool with an assignment_index_menu placement
 (similar to the wiki_index_menu type)
* enable the "Import Commons Favorites" feature
* should launch the tool though a cog dropdown
 in the header of the assignments page into a tray
* closing the tray after a message has been posted
 should cause the assignments page to refresh

flag=commons_favorites
closes #LA-74 #LA-75

Change-Id: If2e7ec2055dd1be0706fe684b1bc617db039e70a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217973
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-22 16:02:19 +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
Ryan Shaw b6d8666148 Refactor a method so the Assignments#show action is faster
In AssignmentsController#show we call@assignment.ensure_assignment_group
which was causing this to be called and also causing a:
SELECT "assignment_groups".* 
FROM "assignment_groups" 
WHERE "assignment_groups"."context_id" = 1 
	AND "assignment_groups"."context_type" = 'Course' 
	AND (assignment_groups.workflow_state<>'deleted') 
ORDER BY assignment_groups.position, 
    CAST(LOWER(replace(assignment_groups.name, '\', '\\')) AS bytea)

…even if the assignment already had an assignment_group_id

We should be able to avoid doing that query if we already have an
assignment_group_id

Test plan:
* for an assignment that already has an assignment_grou_id
* go to AssignmentsController#show (with or without a2 on)
* it should not run that ^ query

Change-Id: I64d1d845c50a4cf3e56d2b750954c5a8a778c265
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218101
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
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-11-22 15:49:08 +00:00
Ryan Norton 5556288416 do not allow submissions from not current attempts
in a2, we should not allow the user to submit a valid attempt
unless they are viewing the current attempt

Test Plan:
* as a student in a2, navigate to any submission type
* create and submit an attempt
* click the button to create a new attempt
* add a draft to this attempt but do not submit it
* confirm that the submit button is visible
* click the previous attempt button
* confirm that the submit button is no longer visible

flag=assignments_2_student
fixes KNO-158

Change-Id: Icc29c3378e72382b39ee512a9f8ebf3cacc33466
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218025
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-11-22 00:54:36 +00:00
Ryan Shaw 83171083e0 speed up Assignments#show & unskip slow specs
fixes WOKE-46

Test plan:
* go to /courses/x/assignments/y
* it should work the same as before (both with a2 on and off)
* but it should be a little faster
* these specs should pass and not timeout

Change-Id: Iaebd30cda142d708e985ce2c1bfb09961166ecf3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218153
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-11-21 23:24:05 +00:00
Steven Burnett 5b9ca42802 remove "click here to report" link on 404 page
fixes KNO-162

Test Plan:
- Run canvas in production mode
- go to a 404 route.  Something like localhost:3000/blah
- notice the 404 page exists
- press space notice the easter egg exists.

Change-Id: I6b403f273f21ec1a7df0cd754c22026fe22d54b0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218109
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Ben Nelson <bnelson@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2019-11-21 22:11:47 +00:00
Ed Schiebel 8547d023f3 Fix CSS to color bg of iframe loading rce media
closes LA-269

Note: the formatting changes not directly related to
      this fix were done by prettier when I saved the file.

test plan:
  - in the rce, add a video
  > expect the space reserved for the video to have a light
    grey background until it's filled with the video

Change-Id: Ib3819930b60a7524d415e188e43d6bb40d3ff85a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217600
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-11-21 14:16:13 +00:00
Clay Diffrient 9eace39097 Add CSP violation tray to the security tab
This allows violations to be displayed allowing account
admins better visibility into what violations are occuring.

It also adjusts some of the CSP code to be a bit cleaner by
removing the CONFIG store that existed previously.

Test Plan:
  - Start up CSP logging service
  - Add a few violations to the CSP service by posting
    to that service
  - Enable CSP feature flag in Canvas
  - Go to /accounts/XX/settings and click on the security
    tab
  - Click "View Violations Log" in the whitelist header
  - A log should appear showing the violations
  - Each column should be sortable (except for Add to Whitelist)
  - NOTE: The Add to Whitelist button should not function yet

closes USERS-62

flag = javascript_csp

Change-Id: Id6286d6f9349ad637eda3d863c9656b0a479e041
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217823
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Matt Meservey
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
2019-11-20 22:37:00 +00:00
Ed Schiebel 8b81fea626 Update canvas media_objects api for the RCE
closes LA-68

test plan:
  - have a user with media objects in a couple courses
  - have another user with a media object
  - GET /api/v1/media_objects
  > expect all the objects for the logged in user to be returned,
    including the sources and tracks data
  - query /api/v1/media_objects?&exclude[]=sources&exclude[]=tracks
  > expect all the objects for the logged in user to be returned,
    excluding the sources and tracks data (it should be _much_ faster too)
  - query /api/v1/courses/:course_id/media_objects?exclude[]=sources&exclude[]=tracks
  > expect only the media objects for the logged in user,
    in the given course to be returned
  > expect /doc/api/media_objects.html to properly document the api
  - query /api/v1/courses/:a_nonexistent_course_id/
  > expect a 404

sorting
  - have some media objects with user_entered_title, some with
    only title.
  - GET /api/v1/media_objects&sort=title&order=desc
  > expect the results to be sorted by title descending
  - GET /api/v1/media_objects&sort=create_at&order=asc
  > expect the results to be sorted by created_at ascending
  - you can try other sorts

updating*
  - PUT /api/v1/media_objects/:media_obj_id?user_entered_title=new+title
  - if :media_obj_id belongs to the current user
    > expect status=200 and the object to be returned
  - if :media_obj_id doesn't exist
    > expect status=401
  - if :media_obj_id belongs to another user
    > expect status=401
  - if user_entered_title was empty
    > expect status=400
  - if user_entered_title was missing
    > expect status=400
  - if user wasn't logged in
    > expect either a 422 (cuz the CSRF header is funky) or
      a 302 (redirect to the login page)
  - after updating
    - GET /media_objects/:id/info
    > expect the object with the new title returned
    - GET /api/v1/media_objects?exclude[]=sources&exclude[]=tracks
    > expect the object to have its new title

*To PUT, the request must include a X-CSRF-Token header. The value can
be found in documet.cookie on a canvas page (after running
decodeURIComponent on it)

Change-Id: I496b8a36f1d177054736dadb6695a25bb7aee217
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/215292
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2019-11-20 22:15:43 +00:00
Ryan Shaw a73fc0b72b Fix some code to work when propTypes are stripped in prod mode
our babel configuration removes all of the PropType declarations
From our code in when build for production mode.
(See 'transform-react-remove-prop-types' in babel.config.js)
That is because react does not actually do any prop-type verifying
In prod mode so that code would be just wasted bytes sent to the browser

This means that our code should not actually depend on propTypes
at runtime

The way this was written, it was depending on 
CanvasAsyncSelect.propTypes existing even in prod mode

Test plan:
* if you run the code that uses this in prod mode you shouldn’t get
  react-dom.production.min.js:193 TypeError: Cannot read property 
  'renderLabel' of undefined

Change-Id: I598bbc25887b5fdd85a6ed77debf14020ea42376
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218037
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Anju Reddy <areddy@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2019-11-20 21:44:46 +00:00
Ryan Norton 63b9200c7a prevent submit bar from cutting off URL box
when the submit bar is active on a URL assignment the bottom of
the url box is cut off slightly

Test Plan:
* as a student in a2, navigate to a URL assignment
* create a valid draft so the submit button is rendered
* confirm that the bottom of the URL box is not cut off

flag=assignments_2_student
fixes KNO-159

Change-Id: Ic27800d94926e5a77fc82e65dfe2645a34c7986c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218035
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-11-20 21:11:55 +00:00
Mysti Lilla bb4569d495 Allow content share users to search by email
flag=direct_share
closes LA-23

Test plan
- Use /api/v1/courses/:course_id/content_share_users
  to search for a user with param of search_term
  as the user's name and as the user's email address
- Ensure the search works successfully
- If the user has the ability to read email
  addresses in the course they are searching from
  they should see the email address.  If not, they
  won't
- This will not affect their ability to search by email
  address

Change-Id: I15e383562ba4e85829ef3cf40b7f71960805a2bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217556
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-11-20 20:58:03 +00:00
Matthew Lemon 078256fbdd set focus correctly when using pizza tracker
When clicking on the previous attempt button on attempt 2 or when
clicking on the the new attempt button you would lose focus.

Test Plan
- Create an assignment and navigate to it as a student
- Create multiple submission attempts on the assignment (3 is probably
  good)
- Using the keyboard navigate through your previous submissions. When
  you get to the first submission attempt and there are no more previous
  attempts the focus should be set on the button for the next
  submission
- From there navigating back to the latest submission should put the
  focus on the new attempt button
- Selecting the new attempt button should put the focus on the previous
  attempt button

fixes KNO-50
fixes KNO-51
flag=assignments_2_student

Change-Id: I0abe45159813dcfd1bf1117f15c94a332d6a810c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217440
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Norton <rnorton@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2019-11-20 20:33:30 +00:00
Ed Schiebel a9e070dfcd Handle string-type media_sources
This happens with audio added from canvas files.

closes LA-270

test plan:
  - from /courses/:id/files, upload an audio file
  - from the rce, choose Media > Course Media from the toolbar
  - select the file you uploaded
  > expect the media player to render
  - save
  > expect the media player to render

Change-Id: I92f884a367225f2b62583eaad03522eaa8e6eedc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217618
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2019-11-20 19:12:37 +00:00
Anju Reddy dcad920fda spec: fill test gaps for direct share trays
flag=direct_share

Change-Id: Ic46a5a4a6dbec5d55c28e5f1615b95d9f8c412a1
REFS: ADMIN-3012
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217998
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Anju Reddy <areddy@instructure.com>
2019-11-20 19:11:31 +00:00
Evan Battaglia 09c8d85dc4 Allow creating LTI 1.3 tools with no placements
closes PLAT-4523

Test plan:
- create a new LTI key with manual entry with no placements.
  It should not show an error like before.
- Edit the LTI key and see that there are no placements
- After saving the LTI key you can add the app (Settings -> Apps) using
  the new LTI Key Client ID. Then when looking at the placements info for
  the app (click the information icon next to the app), you will see "No
  Placements Enabled" (I didn't add that copy, it was already there).
  You can also check the DB and see there are no
  ContextExternalToolPlacements for the app.
- Verify you can still add an LTI key with placements.
- Add an LTI key by JSON input. You can copy the live events LTI config
  or other LTI app config and remove the placements. Edit the LTI key
  and see there are no placements.
- I also added a LTI key by configuration URL by running a
  `python -m SimpleHTTPServer 8888` in a directory with the modified
  JSON config
- anything else we want to test still works???

Change-Id: I15da212dfa6ac11ce1ff7c37b6a787fcdb84bf71
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217405
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Jesse Poulos <jpoulos@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2019-11-20 17:36:16 +00:00
Evan Battaglia ded0cc8584 Don't give LTI 1.3 tools default placements
refs PLAT-4599

Test plan:
- add an LTI 1.3 tool without the default placements (assignment selection
  and link selection) and check that they do not show up there (when
  creating an assignment, and ... wherever the link selection shows up).
  The Live Events LTI tool which you may already have installed fits the
  bill for such an LTI 1.3 tool.
- add a LTI 1 tool (such as the LTI test tool) without the default
  placements and check that they still do show up in those places.
- can anyone think of anything else to check?

Change-Id: I68cd37e2b8ed4015037354ab2609f47a2e0f8bcc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217323
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Jesse Poulos <jpoulos@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2019-11-20 17:02:08 +00:00
Christopher Bennell 20e9e788f2 deal with extensions starting with digits when making unique file names
Fix an issue where Attachment#make_unique_filename would improperly
rename files with extensions starting with digits (e.g. Rhino .3dm
files). A file `myfile.3dm` would be renamed to `myfile.3dm-1` rather
than `myfile-1.3dm`.

closes #1527

 Test Plan:
   - Upload a file called `myfile.3dm`
   - Upload a different file with the same name
   - Ensure the new file is named `myfile-1.3dm`

Change-Id: I72dd6edfd36860e6c1c85e35e757ecc3b1dec825
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217686
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2019-11-20 16:23:45 +00:00
James Williams 6990a780e4 add module_index_menu LTI placement
test plan:
* configure a tool with an module_index_menu placement
 (similar to the wiki_index_menu type)
* enable the "Import Commons Favorites" feature
* should launch the tool though a cog dropdown
 in the header of the modules page into a tray
* closing the tray after a message has been posted
 should cause the modules page to refresh

flag=commons_favorites
closes #LA-71 #LA-72

Change-Id: I4ab15bf71da574482b107cbbba295cb4557f4fa8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217828
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-20 13:35:24 +00:00
Rob Orton 7d7214175b log stats when we deliver messages
test plan
 - messages should start sending stats to dd

fixes KNO-157

Change-Id: I46bddd942e0945c9771863fcd0ed48afdc46cd68
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217934
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-11-20 02:17:39 +00:00
Rob Orton 74df647478 force reply-to-address to less than 64 chars
the reply to address needs to have less than 64 chars before the @. the
first characters are presumably `reply+`, but can also be set to
`notifications+`. After this we create a secure id that is now truncated
to 16 characters, followed by the shortened global id of the message and
the timestamp to_i.

truncating the secure id allows us to guarantee that the address will
not exceed 64 chars and we can still use the same processing logic for
older messages.

test plan
 - generate a message
 - apply change
 - generate a new message
 - the reply to address should be shorter than it was before
 - both replies should work and process

fixes WOKE-87

Change-Id: If82dd61ec5b29aa079c82043e206b0094f0e4ae9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/215844
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
2019-11-20 00:45:14 +00:00
Ryan Norton 7c2ae74120 alert user when beginning file uploads in a2
currently we inform the user when we finish uploading files and
the user can navigate forward to see the loading indicator.

now we alert the user that uploading has started to make it more
visible

Test Plan:
* with the screen reader active, navigate to a file upload
  assignment as a student
* upload one or more files
* you should get a screen reader alert informing you that files
  are uploading

flag=assignments_2_student
fixes KNO-49

Change-Id: I271f2554da4b091d2f3d52d826431ee1b2eb4daf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217682
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
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-11-20 00:07:08 +00:00
Ryan Norton e58cca4bd9 do not lose focus when uploading new files in a2
because we tied the row key to the ids of the files in the row
we were re-rendering the row everytime we added a new file,
causing our focus to disappear.

because the columns are a 1-1 relation to the files already, we
can safely just tie the row key to the row index

Test Plan:
* as a student in a2, navigate to a file upload assignment
* with no files drafted, add a new file
** confirm that the focus remains on the file upload box
* with files added, add a new file
** confirm that the focus remains on the file upload box
* with files added, navigate away while the file is uploading
** confirm that the focus remains where you navigated on
   completion

flag=assignments_2_student
fixes KNO-52

Change-Id: Idcfe88f31d968cb6a82755c5762b4b92f01312ec
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217677
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
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-11-20 00:07:02 +00:00
Ryan Norton 698257bb1f do not lose focus on submitting in a2
when we submit from a2 we should move the focus to the tabs

NOTE: There is a bug in InstUI (INSTUI-2393) that does not
show the focus when using mouse navigation. The focus is
still in the correct spot, but only shows the proper highlight
when using keyboard navigation to submit

Test Plan:
* as a student in a2, navigate to an assignment
* draft and submit the assignment
* after clicking "Submit" the focus should be on the tab
  bar above the content (specifically, the attempt tab)
* test this on an assignment with no submissions
* test this on an assignment with previous submissions

flag=assignments_2_student
fixes KNO-53

Change-Id: I89228851be190dcd6aa24c3adb6be357cbf086cf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217715
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
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-11-20 00:00:13 +00:00
Ryan Norton 00ff438546 do not lose focus when selecting folder in a2
when navigating canvas files in a2 (like through the More Options
modal) selecting a folder should put the focus on the parent
folder, or on the first rendered folder if there is no parent

Test Plan:
* as a teacher, create a File Upload assignment
* as a student, navigate to the assignment in a2
* click on More Options
* select any folder
** confirm the focus is placed on the parent folder
* select the parent folder to return to the root
** confirm that the focus is placed on the first folder in the
   list

flag=assignments_2_student
fixes KNO-88

Change-Id: Ib0b32fdb5ee55b52991cbd7da510fd2d274fc31d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217899
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
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-11-19 23:59:00 +00:00
Matthew Lemon a66186bb7d return google drive lti tool in tools query
The google drive lti tool would never get returned from the graphql
query because it was filtered out due to the state its in (name_only).
We should only be filtering lti tools based on placement to avoid this
issue.

Test Plan:
- Create a course and add a student to it
- Setup an LTI tool on the course with a homework_submission placement
- In the rails console grab the lti tool and update its state to
  something other than public
  t = ContextExternalTool.last
  t.state = 'name_only'
  t.save!
- Create an assignment with an online upload submission type
- Navigate to the assingment as a student and open the More Options
  modal
- Note that the tool should be displayed in a tab

fixes KNO-152
flag=assignments_2_student

Change-Id: Ia2b73f1d89e130fb18fcf9a740d335d6337d118d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217815
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-11-19 22:07:45 +00:00
Ben Nelson b3fb08df2f fix A2 media recording
the props for the UploadMedia component changed and broke us
see g/211690

TEST PLAN:
A2 media recording can be saved and submitted

fixes KNO-146

Change-Id: I30e89270d0aa6b55a3206c677f2b2f115b1d0a4b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217732
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Ben Nelson <bnelson@instructure.com>
Product-Review: Ben Nelson <bnelson@instructure.com>
2019-11-19 20:53:59 +00:00
Jeremy Stanley ce78ab5500 show content shares tab to admins w/o enrollments
test plan:
 - as an account admin user with no course enrollments,
   you should
   (1) see the content share tab in your user profile
   (2) clicking it should work and take you to a page
       that shows a "no content shared" message if you
       have not yet received any shares

fixes LA-171

flag=direct_share

Change-Id: If421c418bf29ce520644dbc52653e2f31a91c637
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217636
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2019-11-19 20:09:19 +00:00
Landon Gilbert-Bland 03abd24284 Fix confirming communication channels cross shard
Test Plan:
  - Create a trust account
  - Add a user on each account
  - Add a communication channel for the user on one of the accounts
  - Merge the users
  - Masquerade as the user on the shard that is not the home for
    the user
  - Go to /profile/settings, and click the check box to confirm
    the users communication channel
  - Notice that the communication channel is confirmed, and that
    no error page is rendered

closes USERS-78

flag = none

Change-Id: I39c7d3066dd0cea733ccb2b38204efcef697757a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217608
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steve Shepherd <sshepherd@instructure.com>
2019-11-19 19:00:09 +00:00
Steven Burnett cba10651ad add pronouns to act as model
fixes KNO-153

Test Plan:
- With pronouns on
- act as a user with pronouns
- notice in the modal their pronouns show up

Change-Id: I9a7a9b0119e8a7288951f7eca521211651a11144
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217598
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-11-19 16:35:12 +00:00
Steven Burnett 0b7e9303c3 add pronouns to peer reviews page
fixes KNO-155

Test Plan:
- create an assignment with peer reviews checked
- create a couple students in the course
- have one with pronouns and one without
- go to courses/:id/assignments/:id/peer_reviews
- notice pronouns show up appropriately

Change-Id: I8cc50d8a2dcae08b22e2b730029cbc223e112a8c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217735
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-11-19 16:27:45 +00:00
Fredrik Ekre 3d04dc983b Fix some JSON in API docs.
Make JSON in API docs parseable, and more
conforming when referencing other Canvas
objects as types.

Change-Id: I252590853f2a1223d1bea92e9f753c1c9644fd07
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217695
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2019-11-19 16:04:58 +00:00
James Williams 878585c9ac fix re-import of wiki pages with modified unique titles
Change-Id: I5cba12329736600c9bbb4924a9ea79520de1db50
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217621
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-19 13:36:54 +00:00
James Williams 3298e305f1 delay peer review assignment job to prevent race conditions
if a peer review assignment job runs immediately after
the assignment is created but the associated object
(i.e. the discussion topic) has not been saved yet,
it's possible that the job will automatically create
a blank topic after saving

closes #LA-218

Change-Id: Id1613903e1aca34ab092ff56c3b51f831e85d3a7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217379
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-19 13:24:21 +00:00
Gary Mei d02dc4d524 remove submission body response when unposted quiz
closes TALLY-162

Test Plan
- Enable New Gradebook
- Create a quiz assignment with a couple multiple choice questions.
- Set its post policy to post manually.
- Have a student take the quiz.
- As the student, go to the grades page:

  `courses/:course_id/grades`

- Open the developer tools to the Network tab.
- Use the What-If scores feature on the muted assignment.
- Verify in the response that the submission json data does not
  include the body field.

Change-Id: Idd6866b1595971128129edc60e306135baa952dd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217080
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Spencer Olson <solson@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
2019-11-19 03:47:09 +00:00
Steven Burnett b8258a0bb9 add pronouns to profile page
fixes KNO-132
flag=account_pronouns

Test Plan:
- on the account settings page enable profiles for your account
- as a user go to the profile page
- notice in the edit settings you can edit your pronouns
- edit pronouns
- notice they now show up
- remove pronouns
- notice they go away

Change-Id: I51053a9e6e06e271d17e3ba5c9e5069f4875b979
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217564
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-11-18 23:11:54 +00:00
Jeremy Stanley dc40c8f3fd only add selected direct share content to module
test plan:
 - create assignment, quiz, discussion, page that
   include a file in rich text
 - use "send to" and "copy to" with this, pointing at
   a destination module
 - ensure only the selected item, not the file (or in the case
   of the quiz, the linked assignment) is added to the module
 - render API docs and make sure the parameter
   insert_into_module_type is documented properly
   (the above steps will exercise it)

fixes LA-173

Change-Id: I3da033e6abda60c59c208d5fcc340c1a063f8348
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216952
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2019-11-18 22:32:30 +00:00
Landon Gilbert-Bland 8fa975c0b3 Fix ldap logins not always going to /login/ldap on logout
Test Plan:
  - Setup an ldap server and configure it to be used with some
    canvas users
  - Login as a user using the ldap username and password, then log out.
    Notice that you are redirected to /login/ldap
  - Log back in using the canvas username and password, then log out.
    Notice that you are redirected to /login/canvas

fixes USERS-59

flag = none

Change-Id: I87cf36ec2a8e53cd391577e3a820d97665708d8f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217333
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
2019-11-18 22:30:41 +00:00
Cody Cutrer 94cf2e479b allow multiple domains on a google auth provider
closes USERS-113

test plan:
 * configure a google auth provider (as secondary to canvas auth) with multiple domains
 * attempt to login with a google account from the valid list; it should work
 * attempt to login with a google acocunt not from the valid list; you
   should end up back at the login page, with a flash message describing
   the problem
 * reconfigure to allow `*`
 * you should be able to login with any google apps account
 * it should not even list a regular gmail account on google's end

Change-Id: I1c4e77baa1b4054fe61a79c07b99555350953453
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217147
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-11-18 20:44:00 +00:00
Ryan Shaw ae29ae1926 Fix streaming bug in eportfolios#show
Change-Id: I52c7c1163fc87ac21bc2a8fd2914eec0ff44d881
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216770
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
2019-11-18 18:11:38 +00:00
Steven Burnett 54e519b519 add pronouns on account users page
fixes KNO-148
flag=assignments_2_student

Test Plan:
- with account pronouns turned on
  go to /users/<user_id_without_pronouns>
- go to   go to /users/<user_id_with_pronouns>
- notice pronouns show up appropriately

Change-Id: I7952be4b8be65cd77ba7be919aa750afb6a120ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217590
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-11-18 18:11:15 +00:00
Steven Burnett f6b7b7992a make a2 not crash for user who has not accepted invite
fixes WOKE-42
flag=assignments_2_student

Test Plan:
- with A2 on
- invite a student to a published course
- as the student (before accepting the invite) go to a published
  assignment
- Notice it doesn't crash

Change-Id: Ib79bf60c0ade6ed4af32463c18d113abb13b7527
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217203
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-11-18 18:10:17 +00:00
Steven Burnett 9924687ebb add pronouns to group manage page
fixes KNO-114

Test Plan:
- With pronouns turned on and with a student
  who has pronouns configured go to http://localhost:3000/courses/2/groups#tab-1
- notice pronouns are showing on the drag items

Change-Id: I06a34c48d09499a6577b679cc7b5c9e55f5c0e86
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217562
Tested-by: Jenkins
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-11-18 16:40:41 +00:00
Cameron Matheson a8a986d4c8 graphql: allow fetching a specific user's GroupMembership
Test plan:
  - fetch a group membership for a user in a group
  - it should only work for people who have permission to view the
    group's roster

closes GQL-93
feature = none

Change-Id: I707044b8aa56407007f931f012a6f9bea048cf4e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217344
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2019-11-18 16:14:36 +00:00
Matthew Sessions 6d0ace3946 Fix turnitin_data when last_processed_attempt is present
Change-Id: Id5f29018a481869b4c339a2c5ec98d9dd6e684c0
refs: MBL-12810
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217023
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Matt Sessions <msessions@instructure.com>
Product-Review: Matt Sessions <msessions@instructure.com>
2019-11-18 14:27:37 +00:00
Landon Gilbert-Bland 6989d5d68a Require review_grades permission to read quiz submissions
Test Plan:
  - Go to the account permissions page and remove all grading
    permissions from the TA role
  - Add a TA to a course
  - Create a quiz in the course and have a student take it
  - Find the id for the `Quizzes::QuizSubmission` for the quiz that
    was just taken
  - Navigate to the following url as a TA, filling in the course, quiz,
    and quiz_submission ids:

    /courses/:id/quizzes/:id/history?quiz_submission_id=:id

  - Notice that you get a permission denied error
  - Change the TA permissions to allow them to view all grades and
    flush your redis cache
  - Go back to that page as a TA. Notice that they can now view it

fixes USERS-31

flag = none

Change-Id: I8b63fc40be28caa044d0df893801d782c87c4e98
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216665
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
2019-11-15 19:54:43 +00:00
Steven Burnett b8cb6d5068 add user pronouns to roster page
fixes WOKE-130

Test Plan:
- go to courses/1/users/<user_id_who_has_pronouns>
- notice the pronouns for that user show on the top off the page

Change-Id: Ie5c76e8757e5c7c3ce4b8b9b4a3ea6fa26ab72a6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217206
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2019-11-15 19:08:13 +00:00
Steven Burnett 49290614af wrap users text in student context tray
fixes WOKE-131

Test Plan:
- Turn on both student context tray and account pronouns
- have a user in the course add pronouns
- on the course users page click on a user
- notice in the tray that comes out that the users pronouns
  wrap

flag=account_pronouns

Change-Id: I9d530318b6151d39a00e6828acf84ddace819618
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217210
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2019-11-15 18:54:27 +00:00
Cody Cutrer 6870e14537 Add a specific permission for course visibility changes
Fixes USERS-89
flag=none

Test plan:
 * As an admin, and as a teacher, you should be able
   to see and change Course Visibility between Public
   and Course on the course settings page
 * Change permissions to not grant it to teachers, or
   to another admin type
 * The dropdown should show only the current visibility
   setting and be disabled, and there should be a short
   explanatory message advising you to contact your
   administrator if you want to change it

Change-Id: I4a7b7280129f3fcf7980e10fd4b29603cc9637ad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/203296
QA-Review: Steve Shepherd <sshepherd@instructure.com>
Product-Review: Steve Shepherd <sshepherd@instructure.com>
Reviewed-by: Steve Shepherd <sshepherd@instructure.com>
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
2019-11-15 18:27:27 +00:00
James Williams 61c6a42125 don't allow setting assignment or group positions to nil
also fix the grade summary page if any existing rows
have null positions

test plan:
* use the assignments API to try to update an assignment
 to have a blank/null position
* it should not save the change

closes #LA-139

Change-Id: I9a3e26a41dad328defa763c5f9c8f9697ed5a4c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216204
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2019-11-15 18:07:50 +00:00
Jeremy Neander 17cb63df31 throttle loading outcomes on student grades page
fixes TALLY-228

test plan:
 * Smoke test student grades page with many outcomes
 * Jenkins oughtta be enough

Change-Id: Idc66f8b2cccea29da3a5641eb9ba0776ea623a2f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216867
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
2019-11-15 18:00:06 +00:00
Landon Gilbert-Bland 9b7478076d Cache course#associated_accounts from master
Test Plan:
  - Jenkins passes

refs USERS-125

flag = none

Change-Id: I523bdd6da1b1703e8da72aecfdb5095811e3202f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217387
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
2019-11-15 17:06:42 +00:00
Mysti Lilla 3ca3c61595 Factor out move item position for reuse
refs LA-11

Test plan
- Ensure the existing move to dialogue
  works for moving assignments around
  inside of the assignment group
- Ensure the existing move to dialogue
  works for moving assignments groups
  around on the assignments page
- Ensure the existing move all assignments
  in group dialogue works

Change-Id: I1f12591d6b4709af659a514bbb7c26fde38640e6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216783
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2019-11-15 16:28:36 +00:00
James Williams be56029aaf use manage_content permission for planner todo date setting
test plan:
* an account admin without the "Courses - add / edit / delete"
 permission but with "Course Content - add / edit / delete"
 should still be able to set todo dates on wiki pages,
 topics, and calendar events

closes #LA-5

Change-Id: I75ea60dd9c778a780e2fac0b74dbfa7a542472d9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217245
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-15 16:23:13 +00:00
James Williams c3ff5cc5e1 unset topic group setting if possible after blueprint sync
test plan:
* have a blueprint course with a group discussion topic
* sync to an associated course
* unset the group setting in the blueprint topic
* re-sync
* should unset the group setting in the associated topic
 unless the topic was posted to by a student in a group

closes #LA-203

Change-Id: I7b96af0a4a5cfeda7064268d2d065fee3649dd05
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216843
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-15 16:12:15 +00:00
James Williams 0e5feac8ec clear blueprint subscription cache if db value missing
refs #LA-241

Change-Id: I62219376dcf16a719b71e1f3dbfaa02bb77cb461
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217236
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-11-15 14:59:23 +00:00
Matthew Lemon 6c6250861d make banner have link to accept course invitation
Test Plan
- Create a course and add a student to it
- As the student navigate to the course
- A banner should render with a link to join the course
- Clicking the link should enroll the student in the course and refresh
  the page

fixes WOKE-86

Change-Id: Ied59e8683550d2337c10584ffccf14edf0f471a7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217176
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
2019-11-15 04:43:25 +00:00
Ryan Shaw 8483304dcf redirect_back to page you were on when accepting enrollment
redirect_back is a new method in rails 5:
https://apidock.com/rails/ActionController/Redirecting/redirect_back

and it is for doing exactly what we want here, redirect back to the
page the person was on, otherwise still fall back to the fallback
location we were using before

test plan:
* accept a course enrollment invitation from an assignment page
* it should redirect you back to the same page you were looking at
  and not the course home page

Change-Id: I9be2050b452ee67da3aac32a6e7670f5719e5c35
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217234
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
2019-11-15 04:42:59 +00:00
KC Naegle 15371e8e61 Update language for gradebook update alert and add i18n
closes TALLY-285

test plan
-run server with 'lolcalization=true'
-create a course with new gradebook feature flag turned off
-navigate to the gradebook
-ensure the alert at the top of the page, including the message
and the link text is localized


Change-Id: I63927d9a3c3d997b9010a7e0fd58867f66920cf9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217128
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-11-14 22:42:45 +00:00
Ryan Shaw a0ef69578a wrap notification for global announcement in feature flag
closes: WOKE-108

we recently added (g/217176) the ability for account admins, when they 
go to create a global announcement to also check a box that says
“Send notification directly to users when announcement starts”. 

this commit wraps that checkbox, as well as the 2 other check boxes
in a feature flag, since that is the only new UI that was created in
that commit.

the system to actually handle all that will still be there either way
but since no one will see the checkboxes when they go to create them
no user will notice any difference

test plan:
* go create a global announcement.
* there should not be a checkbox that says:
   “Send notification directly to users when announcement starts”
* go turn on the “Immediate notifications for global announcements”
  feature flag for the root account
* now go back to that page to create a global announcement,
* there SHOULD be a checkbox that says:
   “Send notification directly to users when announcement starts”

Change-Id: I19875ec49df4bb8cd3e9fc0a3f22ae0962c908eb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217244
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Norton <rnorton@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
2019-11-14 22:12:28 +00:00
Ryan Norton a8f4e4c6c4 remove InstructureCon comments from A2
we had some comments to revisit some code pieces after the
InstructureCon demo. these have been discussed and will be further
identified in our a11y audits

flag=assignments_2_student

Change-Id: I615303bf2147dc1603bb3efc09896ae96c0f6272
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217317
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
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-11-14 21:30:20 +00:00
Adrian Packel e33981d73f Fix late/missing policy display issues
Fix issues with the late/missing policy settings tab:
- Don't display placeholder values upon opening
- Display deduction percent as correct value, not (100 - value)
- Don't show error messages when tabbing out of a (valid) number field
  without having changed anything
- Preserve changes when selecting a different tab and returning to this
  tab

fixes TALLY-259

Test plan:
- Have a course with new Gradebook
- Open the settings modal
- Check for the following:
  - Initial values:
    - Previously-entered values for any numeric fields appear when the
      panel first loads, instead of placeholder values
  - Number inputs behavior:
    - Numeric values, including values with decimals, are accepted
    - Entering an invalid value (e.g., "fred") shows an error message
      when you tab out of the field
    - ...but if the value is valid and you didn't make any changes,
      tabbing out should not show an error message
  - Retaining/saving values:
    - Changing some values (but not saving), selecting a different tab,
      then returning to the "Late Policies" tab should retain your
      changes
    - The "Grade percentage for missing submissions" value should stay
      the same and not wantonly change to (100 - value)
    - Saving your changes and re-opening the settings dialog should show
      the values you just saved

Change-Id: I7ff75b631319055637eb5a945d68db183fbca531
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216871
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2019-11-14 18:15:32 +00:00
Ryan Shaw 412f6b1448 handle js_env from view even after streaming started
Change-Id: I4e821e71ea9518aef92b3d9cb87a28ee69f03eed
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216756
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Ryan Norton <rnorton@instructure.com>
2019-11-13 22:53:16 +00:00
ckibler 4aea564382 refresh page after resource import on pages index
refs LA-18
flag=commons_import

test plan:
 - add 'wiki_page_menu' and 'wiki_index_menu' placements to
   lti-test-provider
 - edit lti-test-provider to send a postMessage with the
   'lti.resourceImported' event
 - on Pages Index, open tray and close it. Page will not refresh
 - Open tray, send postMessage, and clsoe it. Page will refresh
 - launch LTI from the per-item kabob menu on a wiki page. Ensure
   it loads in a full-page reload. This fixes a recent regression

Change-Id: I5660acf144927e84366cea356e769b228072c0e5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216257
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Jon Willesen <jonw+gerrit@instructure.com>
Product-Review: Carl Kibler <ckibler@instructure.com>
2019-11-13 22:23:29 +00:00
James Williams 7a3ed9419f remove user profile linkedin integration
leave gem and authentication provider alone for now

test plan:
* the button on user settings page to integrate with
linked in should no longer be shown
* logging in through linked in should work as before

flag=none
closes #LA-4

Change-Id: I8e7ac10df27454db90a14d636ff0f4317978c289
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216617
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2019-11-13 21:29:54 +00:00
Michael Brewer-Davis e38cb1aa63 correct rubric colspan
closes OUT-3308

Test plan:
- create assignments that have rubrics in the following
  configurations
  - regular points
  - free-form
  - remove points
  - hide score total
- as student (test student or other) submit to
  these assignments
- in speedgrader, assess each assignment,
  verifying that both the summary and the complete
  rubric show correctly
- in individual gradebook, verify that rubric assessments
  show correctly for each assignment
- as student, verify that rubric assessments show correctly
  on each submissions page

Change-Id: I207b1b70ddb238512b68729667e7e3093c62fc27
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216750
QA-Review: Augusto Callejas <acallejas@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Product-Review: Jody Sailor
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
2019-11-13 21:20:49 +00:00
Charley Kline 66d9d792e2 Remove force_rtl feature flag
Closes USERS-18
flag=none

Per the ticket, there's no more need to be able to force RTL for
a locale, so the FF responsible for that was ripped out.

Test plan:
* The "Turn on RTL Even For Non-RTL Languages" feature
  flag should no longer appear in account settings
* Inspect the main Canvas page's HTML
* The <html> tag should include the attr  dir="ltr"
* Change your language to Hebrew or Arabic (caution,
  be sure you know how to switch back to English if you
  cannot read that language!)
* Canvas should look correct for that language, with
  the text flowing from right to left on the page
* The <html> tag should include the attr  dir="rtl"

Change-Id: Ib54645661c73a8c89fc76897b80b3e1f562b9553
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216938
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
2019-11-13 20:58:57 +00:00
Ryan Norton ccb6643205 make pizza tracker buttons look more robust in a2
the icons on the A2 tracker look a bit faded and disabled, so
we are going to update the color to make it look more natural

Test Plan:
* the pizza tracker buttons should not look disabled anymore

flag=assignments_2_student
fixes WOKE-124

Change-Id: I17a851e11ecb872f787c9d0528664c0c3040d9d7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217081
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2019-11-13 20:27:34 +00:00
Adrian Packel 565449aa00 Update deprecation link
closes TALLY-278

Test plan:
check new link is correct

Change-Id: I29982e12264e6e0abf7d1517dd8b88c526131778
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217061
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
2019-11-13 19:52:49 +00:00