Commit Graph

455 Commits

Author SHA1 Message Date
Cody Cutrer b6e406ddcf RuboCop: RSpec/ExampleWording
[skip-stages=Flakey]

Change-Id: I291432cd1f51fdaefb3cf6160d423879fb858c11
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274253
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-09-24 02:15:35 +00:00
Cody Cutrer 6b0095610c RuboCop: Layout spec
[skip-stages=Flakey]

Change-Id: Id479617328562fd009f00db27f248c2ebafa4b7a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274151
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2021-09-22 22:40:24 +00:00
Rob Orton 5eb82939db delete drafts when discussion entries are created or edited
test plan
 - see specs
 - specs should pass

refs VICE-2079
flag=none

Change-Id: I31ceec3d24d36f2a9091f84f44e2772600c27b32
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274061
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-09-22 00:16:05 +00:00
Rob Orton 313fcf9798 return a discussion_entry_draft on create
test plan
 - specs should pass

refs VICE-2079
flag=none

Change-Id: Iee5a0281e98946c7641ed4bef7c3f72573f5adb2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274086
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-09-22 00:15:55 +00:00
Rob Orton 0d541df2dd use parent_id instead of parent_entry_id
test plan
 - specs should pass

refs VICE-2079
flag=none

Change-Id: I80fa44387fdc1036b803d4645a09340f0412f5bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274088
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-09-22 00:15:43 +00:00
Rob Orton cf667b9775 add discussion_entry_draft_connection to discussion type
this adds the connection to discussion and a custom loader to scope
drafts to user and the type for discussion_entry_draft

test plan
 - see specs for usage
 - specs should pass

refs VICE-2079
flag=none

Change-Id: I231f5a0927ab820bdc510183f33caf2edf905128
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273894
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-09-21 23:14:40 +00:00
Rob Orton 2aac8cff47 mutation: create_discussion_entry_drafts
this adds the create or update mutation for discussion_entry_drafts

test plan
 - see specs for usage
 - specs should pass

refs VICE-2079
flag=none

Change-Id: I9ab2353b35a13818d1f6a63d4a0ffb7f1408a1b9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273948
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2021-09-21 22:15:51 +00:00
Rob Orton 8b380bfb44 use ID for context_id
test plan
 - specs should pass

Change-Id: I14b627daff726ac0904e272af4dc9437e586271e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273316
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-09-10 22:12:40 +00:00
Rob Orton be08403191 show errors when using bad query for discussion entry loader
test plan
 - specs should pass
 - if you want a reliable way to hit the error, set the relative id to
the same id you are getting sub entries on, see spec

refs VICE-2041
flag=none

Change-Id: Ic920136432ec83ee47b090f53ea14273e70d8bfc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273274
Reviewed-by: Chawn Neal <chawn.neal@instructure.com>
QA-Review: Chawn Neal <chawn.neal@instructure.com>
Product-Review: Chawn Neal <chawn.neal@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-09-09 23:25:10 +00:00
Jon Scheiding c2279a1820 Add rewriteUrls parameter for GQL
fixes MAT-406
flag=none

Allows GQL API types to expose an option for the client to request
not to rewrite relative URLs into absolute ones in user content.

Also specifically adds this option for the SubmissionDraft GQL API.

test plan
- Navigate to Student View for an Online Text Entry assignment in a
  course with Assignment Enhancements enabled
- Switch the RCE to HTML view and enter the following HTML:
  <img src="/some_image.jpg" />
- Observe the "Draft Saved" notification at the bottom
- Refresh the page
- Verify that the submission HTML has not changed
  (in production, you will see that it changes to
  <img src="https://myusername.instructure.com/some_image.jpg" />)

Change-Id: I3437683f2f3a1915d03d1374d2d499bb3daf9a3f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271886
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
Tested-by: Jon Scheiding <jon.scheiding@instructure.com>
2021-09-09 18:05:29 +00:00
Rob Orton d924959d1d remove association to parent entry
This was replaced with quoted_entry and parentId and is not used

test plan
 - specs should pass

refs VICE-1793
flag=none

Change-Id: I143989d7a51edf0f8be7d91b6ed9b5a6e076218b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272008
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-09-09 17:31:00 +00:00
Mauricio Ribeiro 6a624356ea update frontend to use new discussion entry participant type
closes VICE-1975
flag=none

test plan:
  - No changes on Isolated view behavior

qa risk: low

Change-Id: I0691b523b688c679f1319bab0f662da28fe8c3d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273081
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-09-09 16:15:31 +00:00
Rob Orton 07118bbefa add isolated_entry_id to discussion_entry type
test plan
 - specs should pass, see specs

refs VICE-2041
flag=none

Change-Id: I74935f0c4ad97f4e9a4d76a0817da4d1125716f9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273185
Reviewed-by: Chawn Neal <chawn.neal@instructure.com>
QA-Review: Chawn Neal <chawn.neal@instructure.com>
Product-Review: Chawn Neal <chawn.neal@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-09-09 00:22:56 +00:00
Mauricio Ribeiro be4cd3bb55 create discussion entry participant loader
closes VICE-1974
flag=none

test plan:
  - Spec should pass

qa risk: low

Change-Id: I35b534bbf9edb9d4757878842c8d57d55b92697c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272409
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-09-03 14:01:58 +00:00
Rob Orton 4a3ca05870 handle read_state more consistently
test plan
 - mark discussion as read/unread
 - mark thread as read/unread
 - mark entry as read/unread
 - all should work
 - automatic mark as read should continue to work

fixes VICE-1951
flag=none

Change-Id: I0da73c4bd64f56a6cf18009177864ffac6095221
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272765
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chawn Neal <chawn.neal@instructure.com>
QA-Review: Chawn Neal <chawn.neal@instructure.com>
Product-Review: Chawn Neal <chawn.neal@instructure.com>
2021-09-02 15:48:28 +00:00
Davis Hyer ed0a8184ce remove the trophy case
fixes VICE-2002
flag=trophy_case

test plan:
  - search for any references to the trophy case
  - after running migrations, cursory test around users

qa risk: low

Change-Id: I1ef2c75f2af1cd74490928aa7949e4226aebd065
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272712
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
2021-09-01 19:25:02 +00:00
Drake Harper fbafebbd9c add mutation for marking thread as read/unread
closes VICE-1919
flag=react_discussions_post
flag=isolated_view

Test Plan:
-specs pass
-run a mutation similar to:
mutation MyMutation {
  __typename
  updateDiscussionThreadReadState(input: {discussionEntryId: "259", read: true}) {
    discussionEntry {
      _id
      read
    }
  }
}

Change-Id: I915e626cc1a33b112e9236f22c66a6781143f27b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272316
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-08-30 17:15:29 +00:00
Rob Orton 98621cccf0 use discussion entry participants upsert from topic
the upsert handles the race conditions that can come from this

test plan
 - existing specs should pass

refs VICE-1919
fixes VICE-1990
flag=none

Change-Id: I2ccc94480e06f479601349761eac61b6fbc50111
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272499
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-30 17:02:16 +00:00
Davis Hyer a5fcec34d2 remove deprecate_sms flag from CC display
refs VICE-1507
flag=deprecate_sms

Removing the logic for preventing an sms notification will come in a
future patch. Just focusing on channel displays as it required enough
extra work.

test plan:
  - add a sms communication channel for your user
  - navigate to /profile/communication
    - your sms channel should not appear
  - navigate to /courses/:id?view=notifications
    - your sms channel should not appear

qa risk: low

Change-Id: Ia238cdaf57ee6a8338bc65ea933ef2034a24d76d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271900
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-30 16:41:40 +00:00
Rob Orton 0e94ffb87c make discussion entry participants via upsert
All current creates go through the model method
DiscussionEntry.update_or_create_participant which now consumes the new
method on DiscussionEntryParticipant

test plan
 - existing specs should pass
 - should be able to create unto 1000 entries with one query

fixes VICE-1989
flag=none

Change-Id: I7b557c237d5ccfbe22fb276a2fa6a2383d9caf7d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272443
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-30 14:10:08 +00:00
Pat Renner 3be04f43b5 update selected outcomes after outcome/group edit
closes OUT-4693

flag=improved_outcomes_management

* note - this specifically covers the case
where one of the selected outcomes is edited or the
group it is associated with is deleted or edited

test-plan:
- enable flag
- visit the account outcomes page
- add some outcomes within a group
- select the outcomes so they appear in the selected
outcomes footer
- modify the title of one of the selected outcomes
via the Edit Outcome modal
- verify the new title correctly shows up in the popover within
the selected outcomes link
- create a new group, keeping some outcomes selected
- verify that deleting this group unselects the selected outcomes
- select some outcomes and move one of them via the
Outcome Move modal
- verify that the outcomes are still selected
- open up the bulk remove modal
- verify the new group title is present above the outcome
that you moved

Change-Id: I42f5bc7fea817ac153efd47921cdfd3f2c100118
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271598
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
2021-08-26 20:21:36 +00:00
Matthew Lemon b269965e30 remove n+1 on course roles for discussions
fixes VICE-1976
flag=react_discussions_post

Test Plan:
- Navigate to a discussion topic
- Note that the rails server doesn't perform an n+1 on the
  course roles

Change-Id: I416126c1217a5b9ee1ee809a915ec9ecaf72d82e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272246
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-08-25 21:20:07 +00:00
Drake Harper cdd878fb92 clean up old reply preview code
refs VICE-1970
flag=react_discussions_post
flag=isolated_view

Test Plan:
-specs pass
-nothing breaks

Change-Id: Iac48bde8380e93583a740c327f9f990e35c91a72
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272154
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-25 16:20:18 +00:00
Drake Harper bfa5ae8d24 setup backend for reply preview for rce
refs VICE-1970
flag=react_discussions_post

Test Plan:
-specs should pass

Change-Id: I475030bfd11ce31ccd435d32bb48b4cef80742e2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272026
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-24 21:56:11 +00:00
Manoel Quirino Neto efa2d4e3f0 Add target_group_id to import outcomes mutation
flag=improved_outcomes_management
closes OUT-4684

Test Plan:

* This test plan is based on g/259131

- Setup some global outcomes
- Execute some queries in the /graphiql
- Import a whole group from global outcomes to account
  first ROOT_ID then ANY_GROUP_ID
mutation ImportOutcomes {
  importOutcomes(input: {
    targetGroupId: ACCOUNT_ROOT_OUTCOME_ID or ACCOUNT_ANY_GROUP_ID,
    groupId: GROUP_ID
  }) {
    errors {
      attribute
      message
    }
    progress {
      id
    }
  }
}
- Import a whole group from account to course
mutation ImportOutcomes {
  importOutcomes(input: {
    targetGroupId:  COURSE_ROOT_OUTCOME_ID or COURSE_ANY_GROUP_ID,
    sourceContextId: ACCOUNT_ID,
    sourceContextType: "Account",
    groupId: GROUP_ID
  }) {
    errors {
      attribute
      message
    }
    progress {
      id
    }
  }
}
- Try to import some outcomes replacing groupId to
  outcomeId: OUTCOME_ID
- The response must be an empty object in case of success,
  check the ui to see if the groups were imported correctly.

Change-Id: I69afec1ce3e8db5fbac06b7c8942067229896d1c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271545
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
2021-08-24 18:20:22 +00:00
Rob Orton c9fe761550 add quoted_entry as discussion entry_type
when loading the quoted entry we always include the users since we use
the names of the author and the editor, and it has to be done for all
entries on a page so there is a loader as well

test plan
 - use query like below
 - query MyQuery {
  legacyNode(_id: "203", type: DiscussionEntry) {
    ... on DiscussionEntry {
      id
      discussionSubentriesConnection {
        nodes {
          message
          author {
            name
          }
          quotedEntry {
            previewMessage
            createdAt
            updatedAt
            author {
              name
            }
          }
        }
      }
    }
  }
}
 - ensure that users for reply are batched

refs VICE-1943
flag=isolated_view

Change-Id: I8bea05e28c13eff69a828807190bc95a7b76307b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272007
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-23 20:56:42 +00:00
Mauricio Ribeiro 0dc3678fee remove reply preview for root entries reply
closes VICE-1863
flag=none

test plan:
  - Turn IsolatedView FF on;
  - Navigate to a Discussion;
  - Click reply at any root entry
  - RCE should be rendered without the reply
  preview HTML

qa risk: low

Change-Id: I6fe8cd060976b98c044453f8bace1715107d0022
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271852
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-08-20 22:45:37 +00:00
Davis Hyer bae27dc558 spec: add NotificationPreferencesType tests
refs VICE-1507
flag=none

test plan:
  - tests pass

qa risk: low

Change-Id: I67be1ac9157cceeddde4579137ad8e60c33c2273
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271741
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-20 15:13:24 +00:00
Drake Harper 7320cf7ce6 add ability to get reply preview data with graphql
closes VICE-1942
flag=react_discussions_post

Test Plan:
-in graphiql (http://localhost:3000/graphiql)
-run a query on a discussion entry that has a reply preview
	query for replyPreviewData, similar to:

query MyQuery {
  legacyNode(_id: "239", type: DiscussionEntry) {
    ... on DiscussionEntry {
      id
      message
      read
      replyPreviewData {
        authorName
        createdAt
        message
      }
    }
  }
}

Change-Id: I201ed57a67515f31093050575117e3c0143172e7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271867
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-08-20 01:07:21 +00:00
Michael Ziwisky e3511a712a fix reference resolver for federation subgraph
refs INTEROP-6931
flag = none

we had promoted the Course type to federation entity status by addng an
`@key(fields: "id")` directive to it, but our reference resolver was
treating the given (Relay-style) `id` like a ("legacy") `_id`.  this
fixes that inconsistency, and creates a helper method to make future
such promotions more dummy-proof.

subsequently, the dummy author promoted Assignment to entity status.

test plan:
 - follow the "Smoke Testing the Federation Subgraph" section added to
   the graphql README

Change-Id: Ib8c0168724915807d8ed8d2604f2e40271ddbcb0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271691
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-08-18 16:21:23 +00:00
Rob Orton d706d56df8 remove duplicate connection
test plan
 - this is unused, all our front end uses discussionEntriesConnection
 - specs should pass

refs VICE-1793
flag=none

Change-Id: I9032098ead1ed1d6054d683da9036b644ce5b04a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271506
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-08-17 19:32:26 +00:00
Rob Orton cf4c858c01 show all unread discussion_entries for filter
before this change, it was doing an inner join and would exclude entries
for users that did not have discussion_entry_participant objects

test plan
 - unread filter should work
 - see load specs

refs VICE-1857
flag=isolated_view

Change-Id: Ic221097b0cb2fb2c85f7e184292eaef3b2cc4a1f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271336
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>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-08-16 15:00:52 +00:00
Pat Renner d77a666c96 allow global outcome links to be moved
closes OUT-4497

flag=improved_outcomes_management

test-plan:
- follow the test plan from g/265297 but verify
links within a global group can be moved to another global group
- verify links that are tied to course or account group cannot
be moved
- verify a user without manage_global_outcomes permission
receives an "Insufficient permissions" error

Change-Id: Ib53bf3e83a6d8b398514a8257e841143bb984100
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270980
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Manoel Quirino <manoel.quirino@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
Reviewed-by: Manoel Quirino <manoel.quirino@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
2021-08-12 18:45:09 +00:00
Rob Orton bce054cca0 fix searching escaping for discussion entries
test plan
 - specs should pass

flag=none
fixes VICE-1823

Change-Id: Ie27d68124d1bf27b1dc4fa7f16fdcb7651d6f2a1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271034
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-12 16:29:23 +00:00
Drake Harper 44b0c5e7d7 show "Deleted by <user>" when reply preview is deleted
closes VICE-1814
flag=react_discussions_post
flag=isolated_view
Test Plan:
-turn on discussions redesign and isolated view ff
-reply to the discussion topic creating a root reply
-reply to the root reply creating a child reply
-reply to the child reply creating a grandchild reply
-delete the child reply
-refresh the page
-view the grandchild reply
-verify reply preview says "Deleted by <user>"

Change-Id: Icaaee193ff872f359ffb8670969ff8951dcae865
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271118
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeffrey Johnson <jeffrey.johnson@instructure.com>
QA-Review: Jeffrey Johnson <jeffrey.johnson@instructure.com>
Product-Review: Allison Pittler <allison.pittler@instructure.com>
2021-08-11 17:07:57 +00:00
Manoel Quirino Neto c121abc1d6 Add support for import outcomes from root folders
Closes OUT-4640
flag=outcomes_friendly_description

Test Plan:
  - With FF enabled

  * Import outcomes from account root folder to course
    - With an outcome setup in the root outcome folder
      from the account
    - Go to course outcomes
    - Open find modal
    - Search for the outcome
    - Click import button
    - Make sure the import goes well
      * Outcome import button becomes "Added" and
        Disabled
    - Refresh the page
    - In the LHS, select the account folder
    - Make sure the outcome appear in the RHS

  * Import outcomes from account child folder to course
    - Same as before, but you need to make sure to
      select an outcome inside any folder rather than root
    - Assert the outcome was imported with the folder structure
      (Old behavior remains intact)

  - Dont need to test Account -> Global because it's expected
    that all account outcomes to be in a folder (not in root folder)

Change-Id: I3bf77815c398b974a63ad30572d571cbdc293e35
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270861
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
2021-08-10 12:16:03 +00:00
Rob Orton 5c2d706b14 only check subentries or subentries_count on legacy discussions
test plan
 - existing specs should pass

refs VICE-1793
flag=none

Change-Id: If3e67404e50d50acb5e8ef015394db70276e3e21
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270403
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-06 22:38:47 +00:00
Rob Orton fd729e97fd don't check depth on can reply
depth is no longer used in isolated view the column will likely be
removed later, but it should not hinder our ability to reply

test plan
 - have an entry with depth 3 or greater
 - it should allow you to reply

fixes VICE-1815
flag=none

Change-Id: Icb36057ae20c26b6e8794271a544f0bcdac9c4fb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270889
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: Rob Orton <rob@instructure.com>
2021-08-06 21:25:13 +00:00
Rob Orton 926fe6cb7d order root discussion entries by last_reply_at
test plan
 - create discussion entries and add replies to them
 - the root_entries should be sorted by the last reply

fixes VICE-1583
flag=none

Change-Id: I095e492c236219235b52020870951c043cdf30c7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267001
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-08-06 21:21:21 +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
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
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
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
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
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
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
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
Mauricio Ribeiro 484b53b7bc add reply preview feature
closes VICE-1561
closes VICE-1565
closes VICE-1566

flag=none

test plan:
  - With isolated view flag enabled:
  navigate to a discussion;
  click reply to an entry
  RCE should open with the reply preview html inside
  type your reply, save it
  the message should be saved without any reply preview html
  the message should be rendered with the reply preview on top

qa risk: low

Change-Id: Ied0d857808d4615edc5798022385af8f8b3be31f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270104
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-07-27 23:26:48 +00:00
Pat Renner 85e20499ac Revert "return zero for group.outcomesCount"
flag=improved_outcomes_management

refs OUT-4649

This reverts commit f1e5459ddb.

Reason for revert: was done for performance reasons, see OUT-4649

test-plan:
-qa-cr-

Change-Id: I15a5380a272d3f9769bfa7aab7442e620ef72e44
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269754
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Manoel Quirino <manoel.quirino@instructure.com>
2021-07-26 15:55:56 +00:00