fixes VICE-868
flag=react_inbox
TEST PLAN:
- navigate to /graphiql and run the following query
```
query MyQuery {
legacyNode(_id: <user_id>, type: User) {
... on User {
id
email
recipients {
contextsConnection {
nodes {
id
name
avatarUrl
permissions {
sendMessages
sendMessagesAll
}
userCount
}
}
usersConnection {
nodes {
name
commonCoursesConnection {
nodes {
type
course {
name
}
}
}
commonGroupsConnection {
nodes {
name
}
}
}
}
}
}
}
}
```
- The query should return some results
- You can also play around with pagination to ensure that works
as well
Change-Id: I63666a7225e3ac051990f24c11199a9a40569edc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253043
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>
Don't want users to be able to spy on eachothers conversations
fixes VICE-1008
flag=canvas_inbox
Test Plan:
- Have 3 users that each have separate conversations with eachother
- Login as one of the users and navigate to /graphiql
- Run the following query:
```
query MyQuery {
legacyNode(_id: <user_id>, type: User) {
... on User {
id
conversationsConnection {
nodes {
conversation {
conversationParticipantsConnection {
nodes {
user {
name
conversationsConnection {
nodes {
conversation {
conversationMessagesConnection {
nodes {
body
}
}
}
}
}
}
}
}
}
}
}
}
}
}
```
- You should only be able to see the conversations associated to your user
- Other user conversationsConnextions should just return `null`
Change-Id: Ic865e3afd0d6fcb710cb98a08de504a24b05a244
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254332
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
closes OUT-4021
flag=improved_outcomes_management
test plan:
- Make some queries in /graphiql
- Get all of the fields defined in LearningOutcomeGroupType
- Get root account group
Query: account(id: ACCOUNT_ID) { rootOutcomeGroup { _id } }
- Get root course group
Query: course(id: COURSE_ID) { rootOutcomeGroup { _id } }
- Get group using legacyNode
Query: legacyNode(id: ID, type: LearningOutcomeGroup) { _id }
- Get group using learningOutcomeGroup
Query: learningOutcomeGroup(id: ID) { _id }
- Jenkins passes
Change-Id: I4ea41809389e50b0d7a5b2e4649fe4fdac23d9a9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253754
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
test plan
- specs should pass
fixes VICE-998
flag=mute_notifications_by_course
Change-Id: I2dc572a8013817bd1e3ae2ace54e52932e463cdd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254038
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: Matthew Lemon <mlemon@instructure.com>
fixes VICE-867
flag=react_inbox
TEST PLAN:
- Create a bunch of messages between several users
- Include attachments and media comments on the messages
- Navigate to /graphiql and run the following graphql query:
```
query MyQuery {
legacyNode(_id: <user_id>, type: User) {
... on User {
id
email
conversationsConnection {
nodes {
label
workflowState
conversation {
contextId
contextType
subject
conversationMessagesConnection {
nodes {
body
author {
email
name
}
attachmentsConnection {
nodes {
displayName
}
}
mediaComment {
mediaType
title
mediaSources {
contentType
url
}
mediaTracks {
content
kind
}
}
}
}
}
}
}
}
}
}
```
- The results of the query should show your user's conversations
Change-Id: I059c9545a63654c71689c67bc883efe01b6dc909
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252317
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: Matthew Lemon <mlemon@instructure.com>
fixes INTEROP-6182
flag=none
Test plan
- While masquerading as a teacher with permission
to read sis and view email addresses in a course
go to http://localhost:3000/graphiql and load a
student from a course the teacher teaches and has
the permissions in and ensure you can load their
email and sis data
Change-Id: I4acd548ab518b6479dc41b7a91dea6cf748e1433
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250022
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Oxana Jurosevic
We need to be able to both query for and update the users
`send_observed_names_in_notifications` preference through graphql. We
also need to update the front end UI to display the toggle when viewing
your account notification preferences.
fixes VICE-904
fixes VICE-881
flag=notification_update_account_ui
TEST PLAN:
- Create a course and add an observer to it
- Ensure the notification_update_account_ui flag is enabled on your
local site admin
- As the observer navigate to /profile/communication
- Note that there should be a toggle for showing name of observed
students in notifications
- Enable the toggle and then refresh the page and note that the change
should still be present
- As a non observer user navigate to /profile/communication and note
that the toggle is not present
- As any user navigate to a courses notification preferences page and
note that the toggle should not be present
Change-Id: I77e1b46f3e928364b0e33e91957f356f2a3e2edb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249643
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Ben Nelson <bnelson@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
fixes EVAL-1258
flag=none
Test plan:
- Have a course with a student
- Create a quiz (in old quizzes)
- In the Gradebook, change the quiz to be manually posted
- As the student, take and submit the quiz
- In a Rails console, look up the submission ID of that student's
submission
- As the student, submit a GraphQL request for that submission ID:
query MyQuery {
submission(id: "<submission id>") {
id
body
score
submissionHistoriesConnection(first: 10) {
nodes {
body
score
}
}
}
}
- The "body" attribute, in both the submission itself and the history
nodes, should be returned as null
- As the teacher, run the same query and check that you do get a
response for the body
- As the teacher, post grades for the quiz in Gradebook
- Re-run the query as the student and check that the body attribute is
now populated
Change-Id: I09c968a509fbf0510ad4e5f07e4c63f1d74eb9bd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249727
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Having the dummy root account (ID = 0) always there in
our test environment makes the test environment more closely
match prod.
test plan:
- specs pass
fixes INTEROP-6158
Change-Id: I58d6ec7e19c4ab4ebf5c2d5b3a38ecee0f047e7c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246942
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
closes OUT-3946
flag=account_level_mastery_scales
test plan:
- confirm as an account admin:
* proficiency scales and calc. methods return false
for the locked field in GraphQL queries
* proficiency scales and calc. methods are editable
in GraphQL mutations
- confirm as a teacher:
* proficiency scales and calc. methods return true
for the locked field in GraphQL queries
* proficiency scales and calc. methods are not editable
in GraphQL mutations
Change-Id: I581094f978c4e9f71831aee8286c16682a9b5bfc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247082
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
test plan:
- enable the mastery paths feature
- in a course, create an assignment and assign it to mastery paths
- go to /graphiql and run this query (substituting the id of the
course you are using)
query {
course(id: "4") {
assignmentsConnection {
nodes {
assignmentOverrides {
nodes {
title
set {
__typename
... on Noop {
_id
}
}
}
}
}
}
}
}
- you should get a result, not a 500 error
- assignment override nodes should look like
{
"title": "Mastery Paths",
"set": {
"__typename": "Noop",
"_id": "1"
}
}
flag = conditional_release
fixes LS-1452
Change-Id: I001c565ef557194bd6bfb1aa3954703c3bdb7ec5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247456
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Michael Jasper <mjasper@instructure.com>
QA-Review: Michael Jasper <mjasper@instructure.com>
test plan:
* a multi-tenant shard should still work
creating enrollments and account admins before and after
running postdeploy migrations
* the postdeploy should successfully run a datafixup
to split up build-in role rows and reassign the role_id on
other tables (account_notification_roles, account_users,
enrollments, and role_overrides) accordingly
closes #INTEROP-6045
Change-Id: I8325acb635397ac1b008b9d09788595da597cec7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243906
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
closes OUT-3878
flag=none
test-plan:
-login to http://canvas.docker/graphiql
-ensure you have at least one outcome
proficiency and calculation method for an
account
-for a course within that account, ensure
querying for proficiency/calculation method
returns the resolved value (account value)
-create an outcome proficiency and calculation
method for that course
-ensure querying that course again resolves to
the newly created objects
Change-Id: Ic4b9aa47eb9d890aaf6466c74197ba9dd182d68f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246082
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Save override grade changes in both Cassandra and ActiveRecord, but do
not show them to the user yet. In Cassandra, we represent the null
values for assignment/submission ID using a dummy value of zero since
Cassandra discourages storing null values.
flag=final_grade_override_in_gradebook_history
closes EVAL-1066
closes EVAL-1067
Test plan:
To test this, you will need to have Cassandra running either via Docker
or locally, have configured auditors (in config/dynamic_settings.yml) to
write to both ActiveRecord and Cassandra, and be able to switch the
read_path setting between the two to test reading from each one.
Note that the value of the "Final Grade Override in Gradebook History"
release flag has no bearing on any of this: override grade changes will
always be recorded, and (as of now) should not be shown on the gradebook
history page.
- Have a course with final grade override enabled via gradebook
settings, and some assignments/students
- Set up a grading scheme for the course
- As an instructor, issue some grades on individual assignments and some
course override grades
- On the Gradebook History page for that course, check that the results
do *not* include any of the override grade changes that you made, but
just contain assignment-level results as usual
Check that the override grade changes were nevertheless saved for the
course you updated in Cassandra and Postgres:
- Checking ActiveRecord (from a Rails console):
> Auditors::ActiveRecord::GradeChangeRecord.where(
assignment_id: nil,
context_type: "Course",
context_id: <course id>,
)
- The above should return a record for each override grade change
- The grade- and score-related fields should match the values you
entered for the override grades
- Checking Cassandra:
- Open a Cassandra shell via cqlsh, and run:
> use auditors;
> select * from grade_changes where assignment_id = 0 allow filtering;
- This should return one result for each override grade change you
made
Change-Id: I1dea0532d76fcda46713b5779e7bfa790ef56882
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244458
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Spencer Olson <solson@instructure.com>
refs OUT-3836
flag=account_level_mastery_scales
Add top-level query node support for outcome proficiencies
and outcome calculation methods. See "Node interface" in
"app/graphql/types/HOWTO Add Types.md" for more details.
test plan:
- create outcome proficiency and outcome calculation method
on an account
- query proficiency to get relay-style id:
query MyQuery {
outcomeProficiency(id: "<id>") {
id
}
}
- query via node and confirm the legacy id comes back:
query MyQuery {
node(id: "<relay-style-id>") {
... on OutcomeProficiency {
_id
}
}
}
- query calculation method to get relay-style id:
query MyQuery {
outcomeCalculationMethod(id: "<id>") {
id
}
}
- query via node and confirm the legacy id comes back:
query MyQuery {
node(id: "<relay-style-id>") {
... on OutcomeCalculationMethod {
_id
}
}
}
Change-Id: Ibf8ebf4e2e7001481ff6450158e02b43747ba5c4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245156
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Evan Francis <efrancis@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
closes OUT-3836
flag=account_level_mastery_scales
test plan:
- log in as an admin: canvas.docker
- load GraphQL UI: canvas.docker/graphiql
- test the folowing actions:
mutations:
* createOutcomeProficiency
* updateOutcomeProficiency
* deleteOutcomeProficiency
Change-Id: Id495c25f6cb8c8b30a60c181086982b218e2ab65
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244575
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
refs OUT-3766
flag=account_level_mastery_scales
Test plan:
- create an outcome proficiency with ratings in the ui
- using canvas.docker/graphiql, select
account(id: "1")
outcomeProficiency
_id
locked
proficiencyRatingsConnection
nodes
_id
color
description
mastery
- verify that correct result is returned
Change-Id: Ib3da07798c36dc1f5f2d11343f1a2ded3641a1fb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243561
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
A user with no enrollments would not be able to render the new account
notification preferences page. This change makes it so that the user is
returned in the graphql query if the user is the same as the current
user.
fixes VICE-682
flag=notification_update_account_ui
/ ---- ---- \
| Test Plan |
\ ---- ---- /
- Turn on the notificaiton_update_account_ui ff
- login as a user with no enrollments
- navigate the the account notification preferences page
- Note that the page should load correctly
Change-Id: I81b9c9daaef58c4b8a50880c1c13f6ceec2c9d3f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244695
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
Add the check for read_profile + read_email_addresses to see if the
current_user for the GraphQL query has permission to resolve email
addresses.
The default for read_email_addresses is true for teachers and false for
everyone else. Perhaps stating the obivious, this fix might cause
existing queries that expect email to stop recieving them unexpectedly.
closes INTEROP-6037
flag=none
Test Plan:
* Pick a course with more than 1 user in it, has a teacher that is
_not_ your site admin user. The site admin has GraphQL super powers
and will ignore the permissions.
* Get the id of the course, used in the GraphQL query
* Go to Admin -> Site Admin -> Permissions -> Search for Permissions:
email
* Set the "Users - view primary email address" to disable for Teacher
* Keep the permissions page open
* In an incognito browser, log in as the teacher for the course
* Go to /graphiql
* Run query:
query {
course(id: "<id>") {
usersConnection {
nodes {
email
}
}
}
}
* Results should only have nulls for the email
* Back tp the permissions page, toggle to enable for Teacher
* In /graphiql, run the query again
* Result should show email addresses
Change-Id: Iec3e947bc892eafbd7dd0b94a0cf73bea997f26e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244206
Product-Review: Michael Guymon <mguymon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
Fixes: DEMO-8
flag=none
Test Plan:
- All specs pass
Change-Id: I1917cf3b890a0457f85f38ac5f6f10a297c6d8ae
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243303
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Han Yan <hyan@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
flag=none
Instead of depending on a particular ordering
of the assignment override results, search for
each specific override before testing.
test plan:
- spec doesn't show up in FSC
Change-Id: I8d0367008f69f945374f50dab188f11bdf2ec46d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243620
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
Doing this will make any changes to communication channels in the future
100000000000% easier by limiting the blast radius to just a handful of
files rather than every single spec file in canvas_lms LOL
fixes VICE-540
flag=none
/ ---- ---- \
| Test Plan |
\ ---- ---- /
- tests pass
Change-Id: I9a61b3c7155bc76e0f813b4f35466baf6a8f7589
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239871
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>
Adds the `send_scores_in_emails` option as an override to the course
level notification preferences.
fixes VICE-635
flag=notification_update_account_ui
/ ---- ---- \
| Test Plan |
\ ---- ---- /
- Create a course and an assignment
- Add a user to the course
- Navigate to the global notification preferences page and toggle the
`send_scores_in_emails` option under the grading category to off
- Navigate to the course notification preferences page
- Toggle the `send_scores_in_emails` option to on
- Complete the assignment and then as the teacher grade the assignment
- Navigate to /users/<user_id>/messages
- Note the assignment graded message contains your score
- Do the previous steps but enable the toggle on for your global
notification preferences and disable it for your course
- Note that the message now does not contain any grade information
- You can also create a new course and not specifically set the setting
on the course notification preferences
- Doing the above steps should then just use the global notification
preferences setting instead
Change-Id: Ie1a9ef98ce274718197e7103318e7b971c0ffef5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243138
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>
fixes VICE-610
flag=notification_update_account_ui
/ ---- ---- \
| Test Plan |
\ ---- ---- /
- As a user navigate to your account notification preferences page
- Note the toggle under grading for sending scores in emails
- Toggle the setting and refresh the page
- Note that the setting still reflects whatever you toggled it to
- Navigate to a courses notification preferences page
- Note the toggle under grading for sending scores in emails
- The toggle should still reflect the setting set previously on the
account notification preferences page
* NOTE - This setting does not have overrides and reflects whatever you
set it to on either the account or course notification preferences
page
- Ensure that your notifications for grading are set to `immediately`
and the send scores in emails setting is on
- Submit an assignment and then as the teacher grade the assignment and
give it a score
- Navigate to /users/<user_id>/messages
- Note the Assignment Graded message and that the message contains your
score
Change-Id: Id444fcec02151f99b14cebefef03047c6edc7831
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242355
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>
flag=notification_update_account_ui
fixes VICE-609
/ ---- ---- \
| Test Plan |
\ ---- ---- /
- as a user navigate to /graphiql
- run the following query:
```
query MyQuery {
legacyNode(_id: <user_id>, type: User) {
... on User {
notificationPreferences {
sendScoresInEmails(userId: <user_id>)
}
}
}
}
```
- if the setting for sendScoresInEmails has not previously been set it
should default to false otherwise it should reflect your previously
selected setting
- run the following mutation to update the setting:
```
mutation MyMutation {
__typename
updateNotificationPreferences(
input: {
accountId: <account_id>,
contextType: Account,
sendScoresInEmails: true
}
) {
user {
notificationPreferences {
sendScoresInEmails(userId: <user_id>)
}
}
}
}
```
- it should update the sendScoresInEmails setting to true
- You can also run the previous mutation again with false to see that it
updates the setting to false as well
Change-Id: Ifc48c99eadf56a3b78a656695151675374de453a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242317
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>
Normal users are unable to perform queries on the Account graphql type
so we are adding it to the User type instead. We are also removing the
notification preferences field from courses so we only have to maintain
this field in one place on the User type.
fixes VICE-601
flag=none
/ ---- ---- \
| Test Plan |
\ ---- ---- /
- Navigate to a course notification preferences page
- Everything should still work
Change-Id: Idedd113b8c58be764767df8dda8c59be3ceb1a16
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/242009
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
flag=trophy_case
/ ---- ---- \
| Test Plan |
\ ---- ---- /
- Create a user
- Navigate to /graphiql and run the following query
```
query MyQuery {
legacyNode(_id: <user_id>, type: User) {
... on User {
id
email
trophies {
name
displayName
description
updatedAt
createdAt
}
}
}
}
```
- You should get a list of trophies with all null fields except for the
name
- Hop into your rails console and run the following to create a new
trophy for your user
- u = User.find(<user_id>)
- u.trophies.create!(name: 'balloon')
- Run the previous graphql query again
- Note that you should now see the `balloon` trophy with filled in
fields
Change-Id: Ic60b7ef5420a7100c987276328c11f969b9b1ce4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/241007
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
This allows reporting of sis_source_id/sis_user_id as sisId on various
objects in graphql: account, assignmentGroup, assignment, course,
groupSet, group, section, term, and user. For top level searchable
objects (account, assignment, assignmentGroup, course, term) you can
search by either the _id or the sisId. If both are supplied to a query,
an error is returned.
closes PLAT-5272
test plan:
- Seed your canvas instances with at least one of each type above that
has a source_source_id (or in the case of user,
user.pseudonym.sis_user_id)
- As a user with either read_sis or manage_sis permissions:
- Perform queries in graphql using those sisIds that were set for
account, assignment, assignmentGroup, course, term.
- Note that the queries return the correct objects
- Perform searches that return the list of objects in the commit
description and return the sisId
- Note that the quieries return the correct sisIds
- As a user without read_sis nor manage_sis permissions:
- Perform searches that return the list of objects in the commit
description and return the sisId
- Note that the sisIds are returned as null
Change-Id: Id549ea93ff770cd29b227607973835266196a704
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236718
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
If a user deleted a communication channel we would still display it on
the course notification preferences page because we weren't filtering
the channels based on them being active.
fixes KNO-496
flag=notification_granular_course_preferences
/ ---- ---- \
| Test Plan |
\ ---- ---- /
- Create a course and add a user to it
- Add a communication channel to the user and confirm it
- Navigate to the course notification preferences page
- Note that the new communication channel should show up
- Delete the notification channel from the user
- Navigate back to the course notification preferences page
- Note that the channel no longer shows up
Change-Id: I5fd88bb0e7e4fcb40652f3a41391ff249971a5e6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237822
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>
Not all notification preferences/categories are applicable to courses so
we need to filter what we display on the course notification preferences
page
fixes KNO-463
flag=notification_granular_course_preferences
/ ---- ---- \
| Test Plan |
\ ---- ---- /
- Create a course and add a student to it
- Set up a communication channel for the student
- As the student navigate to /courses/<course_id>?view=notifications
- Verify that only the following categories are displayed
- Course Activities
- Discussions
- Scheduling
- Conferences
Change-Id: I3481d21f6004962d6c3ed86538d9f3c3e520f6d5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236447
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Change-Id: I225c008c814a898ed1f56331f0e2bfdb0e07f26b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235943
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Allows users to update their granular notification preferences for
courses through graphql
fixes KNO-287
flag=notification_granular_course_preferences
/ ---- ---- \
| Test Plan |
\ ---- ---- /
- Create a course and add a user to it
- Make sure the user has at least one communication channel configured
- Login as the user and navigate to /courses/<course_id>?view=notifications
- Note the current state of your notification preferences
- Navigate to /graphiql and run the following mutation
- Use your rails console to grab the communication_channel_id
- u = User.find(<user_id>)
u.communication_channels.first.id // communication_channel_id
- You can update the notificationCategory or frequency to whatever you
want as well
```
mutation MyMutation {
__typename
updateNotificationPreferences(
input: {
contextType: Course,
notificationCategory: Account_Notification,
frequency: immediately,
courseId: <course_id>,
communicationChannelId: <communication_channel_id>
}
) {
course {
notificationPreferences {
channels {
_id
path
pathType
notificationPolicyOverrides(contextType: Course, courseId: <course_id>) {
_id
communicationChannelId
frequency
notification {
_id
category
categoryDisplayName
name
}
}
}
}
}
errors {
message
}
}
}
```
- The graphql response should contain the updated notification policy
override you just created
- Navigate back to /courses/<course_id>?view=notifications
- Note that the category should reflect the mutation you ran earlier
Change-Id: I004995cbb60907011aaa3fcd335059866d74d92f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/233530
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Nelson <bnelson@instructure.com>
QA-Review: Ben Nelson <bnelson@instructure.com>
Product-Review: Ben Nelson <bnelson@instructure.com>