Commit Graph

20448 Commits

Author SHA1 Message Date
Cody Cutrer 64f5f0f3f3 preload parent and root account associations when loading account chain
since we have the objects anyway

Change-Id: I41fd0b8e6a4ccbe5178bcf3f64a3768eaa47341f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269228
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-05 18:53:42 +00:00
Math Costa 7284862580 Remove unpublished courses feature flag
closes: LS-2463
flag=none

test plan:
- Confirm the unpublished courses feature behaves as expected

Change-Id: I035c824729380509bb17fd60cacf9bbae3ef6014
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270519
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Luis Oliveira <luis.oliveira@instructure.com>
2021-08-05 18:23:54 +00:00
Evan Battaglia 082613c668 add title to content item external tool iframe
refs INTEROP-6915
flag=none

Test plan:
- launch a tool in a place that returns data (content item / deep
  linking), except RCE (that follows a different code path). For
  instance: choosing a tool for a new assignment of submission type
  "External Tool", or adding an External Tool to a module from the
  modules page
- check that the tool launch still works
- 'inspect element' and check the title of the iframe. It should be the
  name of the tool.
- without refreshing the page, close the dialog and choose another tool
  with a different name.
- the iframe title should have changed names to match the new tool.

Change-Id: I02c5ae2586c4308bb661ef2e8e8992db66006447
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270394
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
QA-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-08-05 17:18:13 +00:00
Xander Moffatt 6153c5517a allow api_find to use lti 1.3 id
why:
* API calls can query by lti_context_id, which on the User model is used
by LTI 1.1
* they can't currently query by lti_id, which on the User model is used
by LTI 1.3
* additionally, none of these lti id queries are documented

closes INTEROP-6971
flag=none

test plan:
* get a User, note it's id, lti_context_id, and lti_id
* make an API call to get details about the user:
/api/v1/users/:id, or /api/v1/accounts/:account/users/:id
* providing the id for :id should work
* providing lti_context_id:<the lti_context_id> should work
* providing lti_1_1_id:<the lti_context_id> should work
* providing lti_1_3_id:<the lti_id> should work

Change-Id: I38a7de393b70b55bba673a9f0c7cb38c8e1bb853
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270732
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2021-08-05 16:51:39 +00:00
Rob Orton 1dadd2fca9 add mentionable users to graphql discussion type
test plan
 - specs should pass

flag=none
fixes VICE-1804

Change-Id: I9833797e7ec8e6407e4f6da0faea0f14de554820
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270761
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
2021-08-05 15:39:57 +00:00
Caleb Guanzon 53d62f3545 spec: adds isolated view show older replies test
Change-Id: I5e209ba72017b4ba8801ae13dfdbecbc11a0c64d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270757
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2021-08-05 15:13:24 +00:00
Ed Schiebel 9930acbbfb Harvard RCE tweaks
- not directly related to the RCE, but now preload the
3 lato-exended font variants likely to be used
  on the page. this keeps font loading from blocking
- the big change is to make it possible to limit the number
  of RCEs that will fully render on page load. This should
  address the loading issues for quizzes with many essay questions
  (the sample quiz from Harvard had 30 + other questions)
  For now, the necessary property is only being set on the
  take-quiz page

closes: MAT-355
flag=rce_enhancements,flag=rce_limit_init_render_on_page

test plan:
    account flag.
  - create a legacy quiz with > 5 essay questions. Feel
    free to have other questions in there too if you like
  - preview or take the quiz
  > expect all 6 RCEs to be created on the page
    - you could use React dev tools or
      document.querySelectorAll('.rce-wrapper').length === 6
  - turn the "RCE Limit number of RCEs initially rendered on th page"
    account feature flag on
  - take the quiz again
  > expect only the first 5 RCEs to be fully rendered
  - scroll down to the bring the 6th into view
  > expect it to be fully realized
  - while scrolled to the bottom, refresh the page
  > not that the 6th RCE is in view, expect it to be
    fully realized also

Change-Id: Idd76a56c4ea69e45a4f1cc28e3cd8561b40c2403
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270075
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Jon Scheiding <jon.scheiding@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2021-08-05 14:02:03 +00:00
Omar Gerardo Soto-Fortuño c651786492 Add should_show_deeply_nested_alert preference and mutation
Test plan:
  - Spec pass

flag=none

Refs VICE-1749

Change-Id: I53419a2e3a50d741369dc518a19502f6d18144f0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270698
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-08-05 12:47:19 +00:00
Jacob Burroughs 9584d88b25 Support translated community links
Community links should never be added to the codebase itself anymore.
Instead they should be referenced as a translation with a key of
'community.#{key}'.  The links should be stored in config/locales/community.csv,
which is a download of the 'canvas-import' tab of the
'Canvas Translated Guides Mapping' sheet managed by the community team.

There are a few links that the community team says should be updated, that
will be done in a followup commit.

test plan:
- Spot check the various types of files (js/handlebars/erb/plain js)
- Try English, Spanish (or another non-english language in community.csv,
  and Catalan (or another language not in community.csv)

fixes FOO-1771

Change-Id: I67534204c2236a3ff05642cb2d13b8f546da9498
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270622
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2021-08-04 21:22:12 +00:00
Gary Mei 22981e1f49 save rce buttons and icons to course folder
closes MAT-178
flag=rce_buttons_and_icons

Test Plan
- Open the Buttons and Icons tray from the RCE in a course.
- Create a distinct button.
- Click Apply.
- Verify that a folder named "Buttons and Icons" is created.
- Verify that the button was saved to that folder.

- Create another distinct button.
- Click Apply.
- Verify that the previous folder contains the new button as well.

Change-Id: I1d1ff9f49485ea684c7d1e031448a11a80328c6f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269775
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Guilherme Baron <gbaron@instructure.com>
QA-Review: Guilherme Baron <gbaron@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
2021-08-04 21:04:52 +00:00
Rob Orton 2b7fe8f888 add attributes to discussion_entry type
no need to load the association if we are only using the id

test plan
 - specs should pass

refs VICE-1793
flag=none

Change-Id: Ied40488a559d7464add4108d47577f0431b1ce20
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270400
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
2021-08-04 20:27:01 +00:00
Cody Cutrer d91e73c5b8 allow MessageableUser::Calculator to be dumped
since it gets set on user. just need to clear out a proc that we can
regenerate on the fly anyway

Change-Id: If6241a7836ab8db6897e87eb36ea05cb4cef194b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270716
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-04 19:47:33 +00:00
Caleb Guanzon ced6763cd7 spec: adds module progression test
Change-Id: Ic6a775c6266372e6272fda0ed92f8b712744501b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270706
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
2021-08-04 19:21:13 +00:00
Han Yan 3764af9ffe consider assignment overrides for tool launch
closes QUIZ-8603

flag=none

test plan:
- create a NQ with students
- assign a diff due/lock date for a student A
- launch the assignment from Canvas module
- both student with/without overrides should be
  able to launch/start a quiz session

Change-Id: Iee5dab2443fdd6a86088724c47729cbf888606f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270375
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Stephen Kacsmark <skacsmark@instructure.com>
2021-08-04 18:53:11 +00:00
Ethan Vizitei b37346b4fc write any error reports from pulsar writing to the contextual shard
closes FOO-2237

TEST PLAN:
  1) fail to write to pulsar with a non-pulsar error
  2) error report lives in same shard as message

Change-Id: I30a8bb7b3cdc7b86b2e4feb5c6794c853616457d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270671
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-08-03 23:12:34 +00:00
Ethan Vizitei 980c1502a6 use correctly named error var
closes FOO-2236

TEST PLAN:
  1) make pulsar writes happen, and then fail
  2) errors that pile up are just the pulsar
     kind, no variable name errors

Change-Id: I167f232b691f78c7a95a9d209147331855332ce7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270667
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-08-03 22:43:36 +00:00
Math Costa 8675ccb46f Remove course image feature flag
closes: LS-2417
flag=none

test plan:
- Confirm the course image feature behavers as expected

Change-Id: I3b4c2a204418562a25f0512104e3964082393bd7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270197
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Luis Oliveira <luis.oliveira@instructure.com>
2021-08-03 21:07:41 +00:00
Tucker McKnight db119c2252 spec: Add a helper that can render an LTI ERB template
This module fills in enough sample information to have
ApplicationController#content_tag_redirect run without errors,
filling in the instance variables that are needed for
app/views/lti/full_width_launch.html.erb to render.

This can be used to write tests for LTI launch views without always
relying on Selenium.

Change-Id: I8057069eb83d0282d5c9dfaa104515659ce07c7f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269674
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alexandre Trindade <alexandre.trindade@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
2021-08-03 19:18:26 +00:00
Michael Ziwisky ee1abe5897 fix federation subgraph schema
refs INTEROP-6931, INTEROP-6951
flag = none

used to be that no queries existed on the subgraph except the special
Federation ones, `_service` and `_entities`.  that's because we're
creating a federation schema by subclassing our normal schema, and the
apollo-federation gem doesn't properly support that.  it _will_, once
https://github.com/Gusto/apollo-federation-ruby/pull/135 is merged, but
until then we can work around it by explicitly re-defining the query
type for the federation subgraph.

Change-Id: I0fff25295af1044047713a120b9204b2ba0ce106
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270592
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-08-03 18:14:28 +00:00
Ethan Vizitei 0e98ac9bb6 FF Auditor errors should be raised
CLOSES FOO-2233
flag=none

TEST PLAN:
  1) destroy partitions for auditors
  2) try to write a FF update
  3) error gets raised obviously

Change-Id: Id9b40b54c84b77548f1f17724972b027c679d960
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270604
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-08-03 16:59:57 +00:00
Jeremy Stanley b5f192db1e relative-ize canvas links outside the course in imports
background information:
----------------------

if you make an API PUT to

 https://example.instructure.com/courses/123/pages/foo

and include links to e.g.

 https://example.instructure.com/courses/456

canvas will rewrite the link in process_incoming_html_content
to look like

 /courses/456

which helps in being able to serve the content from multiple
domains (including, for example, cross-listed courses or
vanity URLs).

when exporting this content, canvas plugs in the primary
account domain to make the link absolute. this is necessary
because the package may be imported into a different domain.

the problem:
-----------

on import, these absolute links are left alone. if the content
is viewed on a secondary domain, the links will appear to be
to external content and navigation will be impeded (the user
may need to log in again, etc.)

test plan:
---------

1. have a canvas + multiple_root_accounts installation, with
   multiple AccountDomains for a single root account. we will
   call these A and B.
2. create two courses under this account, C1 and C2.
3. from domain B, create a page in C1 that links to C2
   (e.g. http://domain-b.local/courses/2)
4. notice in the HTML for the page (as viewed in the Rails console)
   that the link is actually to /courses/2 (at least, it should be;
   this PS hasn't changed this part)
5. export the course
6. import into a new course
7. ensure in the Rails console that the imported content
   also looks like /courses/2, with no domain attached
8. when the content is viewed through the web in domain B,
   the link appears to be in domain B and navigation is unimpeded

flag = none
fixes LS-2390

Change-Id: I767a7722baa06a00a9da46612bc2e1457485b98d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270541
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2021-08-03 01:19:19 +00:00
Drake Harper 6291c6e929 allow getting count of search entries
closes VICE-1770
flag=react_discussions_post

Test Plan:
-go into graphiql (http://localhost:3000/graphiql)
-run a query similar to
query MyQuery {
  legacyNode(_id: "<your discussion id>", type: Discussion) {
    id
    ... on Discussion {
      id
      _id
      title
      searchEntryCount(filter: all, searchTerm: "<your search term>")
    }
  }
}

-should get the count of all entries regardless of pagination

Change-Id: Iad2a074cf7e4574d2874c43e313758895247ebe0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270532
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2021-08-02 22:23:43 +00:00
Spencer Olson 57a40b1093 gradebook: make student search happen immediately
Removes a 200ms delay on search input. There's no need
for a delay because all the sorting happens client-side.

closes EVAL-1835
flag=remove_gradebook_student_search_delay

Test Plan:
1. Enable the 'Remove Delay for Gradebook Student Search' Site Admin
   Release Flag.
2. Go to Gradebook, and search for a student name. Note that the
   Gradebook rows start filtering immediately on input (previously,
   there was a 200ms delay)
3. Disable the 'Remove Delay for Gradebook Student Search' Site Admin
   Release Flag.
4. Go to Gradebook, and search for a student name. Note that the
   Gradebook rows start filtering after a brief (200ms) delay after
   input.
Change-Id: I10ccb281eb7a750b8a6f6b78f0bf7f52d174a9a5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270184
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-08-02 21:09:27 +00:00
Jonathan Guardado 37ab0b7606 Hide 'View All Pages' from page details
Extra validations were added to the DISPLAY_SHOW_ALL_LINK
flag in the JS_ENV object. Now, in addition to the navigation
configuration, it is checked if the current user is a student in a k5
subject

closes LS-2404
flag = none

Test Plan:

1. Create a page in a k5 subject, publish it and add it to a module
2. As student go to the k5 course home and click the Modules tab
3. Click on the page you just created
4. Expect to be redirected to the page and the "View All Pages" link
not be there
5.Open any page in a non-k5 course and expect to see the "View All
Pages" link as usual

Change-Id: Id56ecff11205f9e903eaf0bb76959f6f887976b4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270314
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
2021-08-02 19:38:39 +00:00
Cody Cutrer f5d0cc64bc add failsafe option for DynamicSettings
so that we're not re-implementing it at multiple callsites

also remove unused error classes

Change-Id: I938d705729f2208532b4522eddbc8edfa4f2031f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269561
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-02 18:27:59 +00:00
Spencer Olson 8ab7945533 show annotation doc immediately on first try
closes EVAL-1555
flag=annotated_document_submissions

Test Plan 1:
1. Create a student annotation assignment.
2. As a student, go to the assignment (make sure the 'Assignment
   Enhancements — Student' feature flag is disabled). When the
   page loads, you should see the document for annotating; you should
   not see a "Start Assignment" button like you normally would.
3. Click "Cancel", and verify the "Start Assignment" button shows up
   and the document is hidden. Then click "Start Assignment" and
   verify the document shows back up.
4. Make some annotations and then submit to the assignment. Then go
   back to the assignment page. Verify the document is _not_ shown
   and that if you click "New Attempt" the document shows up.

 Test Plan 2:
 1. Create an assignment that allows 2 types of submissions: text entry
    and student annotation.
 2. As a student go to the assignment (make sure the 'Assignment
    Enhancements — Student' feature flag is disabled). When the page
    loads, you should see the document for annotating. The
    'Student Annotation' tab should be the first tab, and the 'Text
    Entry' tab should be the second tab.

Test Plan 3:
1. Create a student annotation assignment.
2. In ui/features/submit_assignment/jquery/index.js, modify the
   POST request so that it will always fail (I changed
   '/api/v1/canvadoc_session' to '/api/v1/canvadoc_sessionx').
3. As a student, go to the assignment (make sure the 'Assignment
   Enhancements — Student' feature flag is disabled). When the
   page loads, you should see the 'Student Annotation' tab, the
   content should read 'There was an error loading the document.',
   and there should be a "Cancel" and "Submit Assignment" button.
   Click the "Cancel" button. The tab content should go away and
   a "Start Assignment" button should appear in the top-right.

Change-Id: I45ad44658d954a96205e591aaf80b992ed422545
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270127
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jody Sailor
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
2021-08-02 15:39:58 +00:00
Eduardo Escobar f878ccf529 move module progression buttons to footer
the ModuleSequenceFooter now is part of the
SubmissionManager component and the button
tooltips are rendered using the inst-ui
library.

fixes EVAL-1777
flag=assignments_2_student

test plan:
- enable the feature flag
 “Assignment enhancements - student“.
- create and publish a course with one teacher
  and one student.
- create at least three assignments and add each
  of them to a different module.
- acting as student, go to the first assignment
- notice the 'Next' and 'Previous' buttons
  are placed in the footer aligned with the
  'Submit Assignment' button.

Change-Id: Ie384ff5acdc52c2f5c765742d4668dbdee4b0766
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269313
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Dustin Cowles <dustin.cowles@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
2021-08-02 14:33:21 +00:00
Jorge Arteaga 935870097a prevent useless description conversion when importing to NQ
fixes QUIZ-8550
flag=none

test plan:
- create a classic quiz
- embed an image in the quiz description
- export the quiz as a QTI file
- import the quiz from the QTI file as NQ
- the import should generate a NQ
- open the NQ and see that it has instructions
with an image

- import the same QTI file with "import as new quiz" disabled
- the import should generate a classic quiz identical to
the original

Change-Id: I399698f367e016816475d51423b5d42ed5135da1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269449
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Susan Sorensen <susan.sorensen@instructure.com>
Reviewed-by: Jared Crystal <jcrystal@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
2021-08-02 13:28:38 +00:00
Davis Hyer a29a98dec2 add title to profile notifications page
fixes VICE-1780
flag=none

test plan:
  - navigate to /profile/communication
    - the page title should be 'Account Notification Settings'

qa risk: low

Change-Id: Iea87b401973147e98b1c760602b343d7ce1f68d0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270395
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-07-30 21:37:57 +00:00
Robin Kuss a5fe8be6d6 spec: test important dates on calendar assignments
Closes LS-2461

Test Plan:  passes Jenkins

Change-Id: Ib64d0060c8772eed472940deb2830ce797453b5a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270381
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
2021-07-30 18:51:29 +00:00
Rob Orton f71122eaed show defaults for non existent state for feature flag logging
test plan
 - specs should pass

refs VICE-1717
flag=all_flags

Change-Id: Ie83f953fbb9baca3a1d31541333191aa7ccde150
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270247
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-07-30 18:35:39 +00:00
Michael Ziwisky 34e0d02535 expose federatable graphql data subgraph
fixes INTEROP-6931

most of these changes are based on the guide at
https://github.com/Gusto/apollo-federation-ruby#getting-started

there should be no functional difference to the existing graphql API
endpoint.

test plan:
 - regression smoke test on the `/api/graphql` endpoint
 - testing the new `/api/graphql/subgraph` endpoint would involve
   spinning up an Apollo Gateway server and registering that subgraph
   with it, then ensuring you can issue queries, especially ones that
   involve extension of the "Course" entity.

Change-Id: Ib4266941d28c5a8dc7c279a2909257d0a330fa7a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270041
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-07-30 17:01:46 +00:00
Michael Ziwisky 338a3ef948 upgrade graphql gem to latest
fixes INTEROP-6951

upgrade required some tweaks including the following:
 - `GraphQL::Execution::Interpreter` removed from CanvasSchema because
   it is now included in GraphQL::Schema by default
 - `BaseMutation.input_type` adds arguments properly instead of using
   `merge!`, which blows up because `own_arguments` is a frozen Hash.
   (see https://github.com/rmosolgo/graphql-ruby/commit/55a955a84)
 - `NotificationPreferencesContextType` gets defined just once to avoid
   errors from specifying dupicate enum values each time its reopened
 - `.graphql_name` needed in a couple of places where `.name` (or
   implicit `.to_s` from string interpolation) previously worked.
   (see
https://github.com/rmosolgo/graphql-ruby/blob/master/CHANGELOG.md#breaking-changes-14)
 - `GraphQL::Schema` uses the new `GrpahQL::Pagination::Connections`
   connections by default (previously `GraphQL::Relay::BaseConnection`),
   so our custom `PatchedArrayConnection` and `DynamoConnection` classes
   got redone in accordance with the new interface.
 - https://github.com/rmosolgo/graphql-ruby/pull/2792 made it so
   argument names are used as-specified, while previously they were
   automatically snake-cased.  so the `gradingPeriodId` argument of
   `AssignmentFilterInputType` is now specified in snake-case, and
   everyone is happy. (note that in the generated GQL schema definition,
   it remains camel-cased, so the client interface is unchanged).
 - some sloppy queries in specs have been cleaned up because the GQL
   parser has been tightened up and was no longer recognizing them.

also, unrelated to the gem bump, but the inst_access_tokens route was
typo'd as a singular.  here it's corrected to the plural.

test plan:
 - since it's just a version bump, spec coverage should be sufficient

Change-Id: Ib73eed4c1356833dfe245188b0841c98ae2c378a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270132
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-07-30 17:01:32 +00:00
Cody Cutrer db153f2beb return a frozen account chain
so that we can return the same one every time if called multiple times
for the same context

Change-Id: I2c5825ab115c50d1332d05d1e3cecbe45cbe7ea1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270297
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-07-30 16:13:39 +00:00
Adrian Packel 0f694fdde8 Properly set hidden on bulk-update comments
When submitting comments via bulk update, check the posted status of the
submission instead of the muted status of the assignment when
determining whether the comment should be hidden. This fixes an issue
that could cause comments not to appear when the submission had already
been posted (or had just been posted, in the case of submitting both a
grade and a comment).

fixes EVAL-1815
flag=none

Test plan:
- Have a course with at least two students (you need at least two so
  that posting a submission for one student doesn't flip the
  assignment's "muted" status)
  - Take note of the ID of one of the students
- Create an assignment
  - Take note of the ID of the assignment
- Using a REST client or similar, send a POST request to the bulk update
  endpoint for the assignment (see below)
- As the student, open the submission details page
  - You should see both the grade and the comment

Sending the bulk update request:
- Send a POST request to the endpoint
  /api/v1/courses/<courseID>/assignments/<assignmentID>/submissions/update_grades

The content of the request should be multipart form data. The following
two lines will send both a grade and a comment to the endpoint for the
student whose ID is given by <student_id>:

grade_data[<student_id>][posted_grade]=5
grade_data[<student_id>][text_comment]=HELLO

Change-Id: Id3b97bf18ca888da2a2a04c372ff596335665f17
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269833
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
2021-07-30 15:21:46 +00:00
Nate Armstrong 6ea4fb907b Fix k5 detail view for multi role teachers
Teachers that are also students should not get the
K5 detail view.

fixes LS-2387
flag=none

Test plan:
- Have a user that is enrolled in a k5 subject course as
  both a student and a teacher
- View the subject course and click Manage Subject
- The course nav should be visible

Change-Id: I7b2c381a61418cd95c5f911c3ae9f151bb7b8a03
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270149
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Nate Armstrong <narmstrong@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
2021-07-30 15:08:41 +00:00
Evan Battaglia 0812089121 Remove useless teacherless? method & related code
* teacherless? method always returned false, and has since initial
  commit in 2011
* removed any code that depends on that being true, including a
  permissions grant (given/can) which was always false. (side note:
  'manage' and 'update' course permissions appear to be
  now identical.)
* RoleOverride.teacherless_permissions was only being used by that
  permissions grant
* After that, TeacherlessStudentEnrollment also then unused in code.
  * I have also verified there are no Enrollment records with
    TeacherlessStudentEnrollment anywhere in all shards on prod
* div.teacherless_invite_message was removed in 70bcc947cb, so I removed
  some Javascript that references it
* teacherless in JS_ENV apparently also unused
* side note: commits containing a certain commit can be found using e.g.
    git log -S 'TeacherlessStudentEnrollment' --oneline

Test plan:
- hard to test, so review very carefully
- grep through code for 'teacherless'
- try a couple things in the UI like having a teacher create a student
  just to make sure nothing is completely broken

flag=none
closes INTEROP-6954

Change-Id: Ibbbcacf64a87c29adc719b1d61f7b3e2241fc83e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270287
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-07-29 20:19:44 +00:00
Weston Dransfield 3ff82a2832 spec: use test ID for RCE mode switch button
flag=non

Test Plan:
specs pass

Change-Id: I306cfe7bc2020d4007a5ad825558226f3ddbf5a8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270286
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2021-07-29 18:57:23 +00:00
Cody Cutrer bc12cd788d spec: fix I18n stubs not working with reloading
also convert to a prepended module, and handle a bit more common boilerplate

Change-Id: I01fcccb39224dfa69e26a8a3368977911bf881dd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270194
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-07-29 18:46:07 +00:00
Evan Battaglia 050a65cdc5 MSFT sync: remove "manage_students" perm req'ment
Test plan:
- From the Account menu click "Permissions"
- In the "Course Roles" tab find "Users - add / remove students in
  courses". Disable this permission for teachers.
- Go to a course with a teacher
- Masquerade as the teacher and make sure they can see the
  "Integrations" tab in Course settings and enable/disable MSFT sync
- Masquerade as a student and go to
  /api/v1/courses/123/microsoft_sync/group (where 123 is the ID of your
  course) and make sure you cannot access it

closes INTEROP-6917
flag=microsoft_group_enrollments_syncing

Change-Id: I2e65905fd4e2f53790c92c64f0f7024080032867
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270217
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-07-29 18:28:42 +00:00
Cody Cutrer 4d2e66383c use has_attribute? instead of attributes.key?
the latter has to allocate a new hash of all the attributes
everytime it's called

Change-Id: If21ffaf494b290f8cf6d52c35d5c7dddd9a7ad31
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270288
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-07-29 18:17:01 +00:00
Mysti Lilla 6ca9a98660 Remove N+1s from membership service
fixes INTEROP-6859
flag=none

Test plan
- Run /api/lti/courses/:course_id/membership_service
  for a course with at least a few users set up
  and ensure that you don't get one SQL call each
  for pseudonym, enrollment and past_lti_ids
  for each user

Change-Id: I6819b68ada52d42e4fc14268059c5d8b83a42d3d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269599
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2021-07-29 18:06:55 +00:00
Jeff Largent 0935fd13d9 Add C4E subject banner image setting
Allows users with admin rights over K5 subject courses to set a
separate image on the settings page to be used on the home page of the
course. If no banner image is set, then the home page will use the
card image. If no card image is set, then the home page will use the
course color. If no course color is set, then a defauly blue-gray
color will be used.

closes LS-2351
flag = none

Test plan:
  - Create a new subject in a C4E account
  - Expect the home page to show the course name on a gray background
  - Go to the settings page and select a course color
  - Expect the home page to show the course name of background of the
    color you just selected
  - Go to the settings page and upload an image for the Card Image
  - Expect that image to show on the home page
  - Go to the settings page and upload an image for the Wide Banner
    Image
  - Expect that new image to show on the home page
  - Go back to the settings page, click the upper-right menu on the
    Wide Banner Image, and choose "choose image"
  - Expect the replaced banner image to show on the home page
  - Go back to the settings page, click the upper-right menu on the
    Wide Banner Image, and choose "remove image"
  - Expect the banner image to no longer show on the home page
  - Go to the settings page of a course in a non-C4E account and
    expect the Wide Banner Image setting to not appear

BONUS POINTS:
  - Set up Unsplash at /plugins/unsplash
  - Set a Wide Banner Image on a C4E subject via Unsplash
  - Make sure replacing / removing images works with Unsplash urls as
    well as uploaded ones

Change-Id: I24c162fb142c8d57760a52abd67e17dd0c30dd18
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269902
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
Reviewed-by: Jonathan Guardado <jonathan.guardado@instructure.com>
QA-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
2021-07-29 16:28:16 +00:00
Rob Orton 0f4ebf4cfa treat all types as threaded for react_discussions_post
test plan
 - specs should pass

flag=react_discusssions_post
fixes VICE-1789

Change-Id: I7bbfd520007e941d2114c75fad88f73c377376d8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270234
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2021-07-29 15:43:45 +00:00
Jackson Howe 911dd73354 Show k5 'manage course' based on :read_as_admin
So that teachers in concluded courses can still see their stuff.
Also show the 'manage home' button on empty home tab based off
:manage, since you can only edit home if you have :manage

closes LS-2410
flag = none

Test plan:
 - Put a k5 course into a concluded term
 - Visit the course as a teacher
 - Expect to still see the manage course button at the top
 - Expect other manage functionality to be disabled (like editing
   announcements, modules, manage home)

Change-Id: I78aa2d328a025d4f6c2aa059136f22f9877d8fff
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270206
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2021-07-29 14:59:57 +00:00
James Butters d9c41d2293 remove code for the old TestQueue
flag = none

Test Plan:
-Jenkins Passes

Change-Id: Ic988a6dd7e38e59c72254be131e890afc3d742cd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270238
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2021-07-29 14:15:14 +00:00
Robin Kuss 4a50ebb537 add calendar pick selenium tests
Closes LS-2382

Test Plan: passes jenkins

[ignore-stage-results=Flakey Spec Catcher]

Change-Id: Ia7c5fcccd2530e1546ceb3f093b198980da37c23
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270167
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
2021-07-29 13:42:41 +00:00
Cody Cutrer 679e8d9201 fix ordering on a few conversions to ShardedBookmarkedCollection
didn't realize that helper method would return the raw relation as
an optimization, which if the relation doesn't have an order by on
it would be bad.

also fix the enrollments_api_spec to actually test bookmarks
and non-bookmarks, and simplify some of the logic in
EnrollmentsApiController#index both to clean up the code, and to
allow the specs to easily test both cases

Change-Id: Ifbaf588f787de7b54f3a26c6412cca81e2f34c4a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270186
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-07-29 04:14:24 +00:00
Rob Orton 3176418d6b set parent_entry_id and root_entry_id
test plan
 - reply to a discussion entry
 - it should properly set parent_entry_id
 - reply to the new entry
 - it should still set parent_entry_id

refs VICE-1779
flag=isolated_view

Change-Id: Ia633696165d8eb84960ebd446ff6dbeff4797983
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270224
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-07-29 03:59:51 +00:00
Ryan Hawkins 494c35f594 MSFT Sync: Add UI for Suffix and Lookup Field
The Account > Settings > Integrations Page has been updated to include
new fields that lets admins input a suffix that they want to append to
the result of the login attribute for each user when associating Canvas
users with Microsoft users. An additional field was added that let's
admins also select what Active Directory attribute they'd like to use to
associate Canvas user -> Microsoft users. By combining and modifying
these two fields, admins should have much greater flexibility when it
comes to configuring Microsoft Teams Sync for their account.

In addition, added support for the new integration_id login attribute to
the UI.

closes INTEROP-6918

flag = microsoft_group_enrollments_syncing

test-plan:
* Set up Microsoft Sync for your local Canvas and enable the appropriate
  feature flag.
* Navigate to the Account > Settings > Integrations page.
* First, try giving all valid values. A tenant must be a valid domain
  name and the suffix can be anything, so long as it doesn't have
  whitespace. Most schools will likely append a domain name to this
  though, so the placeholder represents that scenario. Make sure that
  updating your settings and toggling the feature on and off succeeds,
  and that your values are saved to the `account.settings` hash for your
  account.
* Next, try to do some garbage input, both for the tenant and the
  suffix. Make sure that the UI doesn't let you toggle sync or update
  settings and warns you about the errors in your input. Also ensure
  that the previously saved settings on your `account.settings` remain
  unchanged.
* See if you can think of anything else to try and break the UI :)

Change-Id: I006e4de7d3bf9e4e0449972dedb58875abd9f89e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269282
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
2021-07-28 23:26:17 +00:00