Commit Graph

20 Commits

Author SHA1 Message Date
Martin Yosifov e551614882 Remove deleted outcomes linked to active ContentTags in IOM
closes OUT-5175
flag=improved_outcomes_management

Test plan:
- Enable Improved Outcomes Management FF
- Import from Academic Benchmarks state standards with large
number of outcomes (> 10,000): "California State Board of
Education", guid: "68B555A8-ACA0-11E9-8BB2-0A11CDE56ADE" and
"New York State Education Department", guid: "9127D390-F1B9-
11E5-862E-0938DC287387"
- Go to Account > Outcomes and create an outcome
- Open rails console, find the created outcome, set its
workflow_state to 'deleted' and clear Rails cache:
o=LearningOutcome.last
o.workflow_state = 'deleted'
o.save!
Rails.cache.clear
- Refresh the Account > Outcomes page
- Verify that the outcome is no longer displayed in Manage View
and the outcome count for the outcome's parent group is correct
- Open devtools -> network
- Click on Find button to open Find Modal
- Select "California State Board of Education" via TreeBrowser;
in devtools select the second graphql query and click Timing tab
- Wait for the query to finish and verify that its
Waiting (TTFB) time is less than 3-4 sec
- Repeat for the New York State standards

Change-Id: I9b3c3d2de153b69ef12bcef38e8bc3a0f8f36b03
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295796
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Dave Wenzlick <david.wenzlick@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
2022-07-14 16:41:39 +00:00
Martin Yosifov 15a0be89af Slow loading times for outcomes in IOM / Find modal
closes OUT-5157
flag=improved_outcomes_management

Test plan:
- Enable Improved Outcomes Management FF
- Import from Academic Benchmarks the following state standards:
"California State Board of Education", guid: "68B555A8-ACA0-11E9
-8BB2-0A11CDE56ADE"; "New York State Education Department",
guid: "9127D390-F1B9-11E5-862E-0938DC287387", and "Iowa DOE",
guid=>"9136CE2C-F1B9-11E5-862E-0938DC287387"
- Go to Account > Outcomes, open devtools -> network and click
on Find button to open the Find Modal
- Select "California State Board of Education" via TreeBrowser;
then in devtools select the second graphql query -> Timing tab
- Wait for query to finish and verify that its
Waiting (TTFB) time is less than 3 sec
- Repeat for the other two state standards
- Import the 3 state standards to the account
- Go to Account > Outcomes
- Select "California State Board of Education" via TreeBrowser;
then in devtools select the second graphql query -> Timing tab
- Wait for query to finish and verify that its
Waiting (TTFB) time is less than 3 sec

Change-Id: I6bdd31595c2798c138fb4936599d1e81dfe3dd9c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/295322
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2022-07-07 16:54:29 +00:00
Angela Gomba 9ea40e55d6 Update graphql to filter with/without alignments
closes OUT-5070
flag=outcome_alignment_summary

Test plan:
- Enable Improved Outcomes Management FF
- Enable Outcome Alignment Summary FF
- Go to Course > Outcomes
- Create outcome and align it to a rubric, assignment, etc
- Create other outcomes, but do not align them
- Obtain the course ID from the url
- Open in browser canvas.docker/graphiql
- Execute query below replacing COURSE_ID
query MyQuery {
  course(id: COURSE_ID) {
    rootOutcomeGroup {
      outcomes(filter: "WITH_ALIGNMENTS") {
        nodes {
          ... on LearningOutcome {
            title
            description
          }
        }
      }
    }
  }
}
- Verify the query returns the aligned outcome
- Rerun the query but change filter to "NO_ALIGNMENTS"
- Verify the query returns the other outcomes
- Rerun the query with the searchQuery parameter
- Verify that the search and alignment filter work
  fine together
- Rerun the query but enter an invalid argument for filter
- Verify that no filter is applied
- Disable Outcome Alignment Summary FF and retry the first
  query
- Verify it returns all outcomes and does not filter

Change-Id: I560d08ef62784c850ea98999c15c5c3bdfbafe16
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/292407
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
2022-05-27 20:53:53 +00:00
Angela Gomba 83610dd74d Display only outcomes with active workflow_state
closes OUT-4964
flag=improved_outcomes_management

test plan:
- Navigate to Account > Outcomes
- Create an outcome
- In the rails console, find the outcome you just created and
  set the workflow_state to 'deleted'
- Refresh Canvas
- Observe that the outcome no longer shows in the UI and that
  the outcome count for that group is correct

Change-Id: If5d528c544c64103b90f559f692c013f8689f928
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287168
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
2022-03-24 14:30:35 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:03:06 +00:00
Cody Cutrer e50edd485f RuboCop: heredocs
[skip-stages=Flakey]

Naming/HeredocDelimiterNaming and Rails/SquishedSQLHeredocs

the former was manual, the latter was automatic. I also changed
some <<- to <<~ to allow for better formatting

I also had to change comments inside squished SQL heredocs to
be block comments (since newlines are removed); searching for those
I found some multi-line strings that are better as heredocs

Change-Id: I6b138f8e32544b97df1e4c56f09ee5316cbdef9d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278184
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-11-16 06:36:00 +00:00
Cody Cutrer 7fdf9d7588 RuboCop: Lint
[skip-stages=Flakey]

the balance. mostly. Lint/UriEscapeUnescape is put in the pending
block because it's so touchy, and I didn't want to deal with it
right now

all manual

Change-Id: Ibeb81e013f56f160d51f7d237a9bcfe98daa1e53
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277569
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-11-09 21:42:31 +00:00
Martin Yosifov 0da9a51ef1 Add notImportedOutcomesCount field to LearningOutcomeGroup type
closes OUT-4743
flag=improved_outcomes_management

Test plan:
- Import Academic Benchmarks
- Go to Account > Settings > Feature Options and enable
Improved Outcomes Management FF
- Go to Account > Outcomes and open developer tools -> network
- Select via TreeBrowser the root outcome group and use network
tab to find the id of that group from the graphql response
- Click on Find button select State Standards in the Find Modal;
then find the id of that group using network tab
- Open a new browser tab, go to canvas.docker/graphiql and paste
the query below in the GraphiQL window:
query GroupDetailWithSearchQuery($id: ID!, $targetGroupId: Int) {
  group: legacyNode(type: LearningOutcomeGroup, _id: $id) {
    ... on LearningOutcomeGroup {
      _id
      title
      contextType
      contextId
      outcomesCount
      notImportedOutcomesCount(targetGroupId: $targetGroupId)
      outcomes(first: 10) {
        edges {
          _id
          node {
            ... on LearningOutcome {
              _id
              description
              title
            }
          }
        }
      }
    }
  }
}
- In the query variables window paste the snippet below
{
  "id": X,
  "targetGroupId": Y
}
- Replace X with the id of the State Standards group, Y with
the id of the imported group and execute the query
- Verify that there are no errors in the response
- Verify that notImportedOutcomesCount is equal to the
number of outcomes in State Standards
- Import 10 outcomes from State Standards to the account
- In the Manage View select the group where outcomes are
imported and find its id from the network tab
- Verify that notImportedOutcomesCount is equal to the
number of State Standards minus 10
- Go to Course > Outcomes, and repeat the above tests importing
from Account Standrds and verify that results are the same

Change-Id: I20652b5ece5350c2df884c98defc11d8d092b8b0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272768
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Marcus Pompeu <marcus.pompeu@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
Reviewed-by: Manoel Quirino <manoel.quirino@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
2021-09-29 19:21:21 +00:00
Cody Cutrer c65d57737a RuboCop: Layout lib
Change-Id: I0655d9a9d750f2debd6378b03d8ddc1403ebc31b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274158
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-22 20:01:52 +00:00
Manoel Quirino Neto fb67a476f8 Remove RHS cache of child groups ids
closes OUT-4774
flag=improved_outcomes_management

Test plan:
- As this PS doesn't add feature, but remove a cache,
  Assert the RHS works properly in all scenarios.
  You may take screen shots of the results in master and
  compare with this PS.

  * In the management screen
    * Selecting a group in LHS
    * Search for a group in RHS
    * Infinite scroll works properly

  * In Find Outcomes Modal
    * Assert the same as previous one

  * Repeat test for account and course

Change-Id: I073ebbf02ea7c2f75342a72ad700f1ef10a67dcc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273513
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Marcus Pompeu <marcus.pompeu@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
2021-09-14 19:22:06 +00:00
Manoel Quirino Neto e5568b0ed0 Fix search outcomes
* Fix similarity order when searching outcomes
* Add support to remove stop words based on the Account language

closes OUT-4704, OUT-4705
flag=improved_outcomes_management

Test plan:
- Search for outcomes in the management screen and find outcomes modal
- Assert the outcomes appear "in the expected order"
- Also test adding stop words in the query an assert it doesnt influence
  in the result

Change-Id: Iecbf37551e40f7e0024a15e90b2d283e56e82cff
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271715
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
Reviewed-by: Marcus Pompeu <marcus.pompeu@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
2021-09-13 18:51:07 +00:00
Pat Renner ce3546135e return count as unique links for total_suboutcomes
closes OUT-4672

flag=improved_outcomes_management

test-plan:
- turn the the flag off if it's on
- create an account outcome
- in a course, import the account outcome in a group
(parent group)
- create a subgroup of the group
- import the account outcome again into the new subgroup
- enable the flag
- visit the course and open up the parent group
- ensure the outcome appears twice on the RHS
and is counted twice in the number of outcomes

Change-Id: I19855a13271e6479106cea062a783a4fec82f054
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270812
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Jody Sailor
Reviewed-by: Brian Watson <bwatson@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
2021-08-10 16:34:51 +00:00
Pat Renner 53f6c2dfab update group counts to reflect immediate subgroups
refs OUT-4611
closes OUT-4606

flag=improved_outcomes_management

test-plan:
> enable flag
> verify that the find outcomes modal loads as expected
> verify that the group counts reflect the immediate
child groups and not all nested subgroups

Change-Id: Ia3a12b09821aa9ed3a18bc90f6a50fef66740d85
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269311
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Ben Friedman <ben.friedman@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-07-19 19:26:25 +00:00
Pat Renner 99c017e4ed cache context asset string in learning outcome group type
refs OUT-4611

flag=improved_outcomes_management

test-plan:
> enable flag
> verify no changes in functionality in manage and find screens
within Outcomes

Change-Id: If6e6bcbebc02273f92f7091a987d1013d96c7b42
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269272
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2021-07-16 20:00:17 +00:00
Pat Renner 7a6054a6cd remove extra learning outcome join in group query
refs OUT-4611

flag=improved_outcomes_management

test-plan:
- enable flag
- visit account outcomes page
- verify find outcome modal is still functional
and searching for outcomes works as expected

Change-Id: I83fb02fc8bcf926d623f89647ef6ab03feb32d37
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269091
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Martin Yosifov <martin.yosifov@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2021-07-15 13:23:37 +00:00
Manoel Quirino Neto 615b83df81 Make outcomes graphql fields functional
This change makes graphql endpoints functional even if
the FF is off

closes OUT-4348
flag=improved_outcomes_management

Test Plan:
  - Setup an account with at least 1 outcome and
    1 group
  - Make sure the query returns same values
    with the flag on and off
    {
      legacyNode(type: Account, _id: 1) {
        ... on Account {
          rootOutcomeGroup {
            outcomesCount
            childGroupsCount
            childGroups(first: 1) {
              nodes {
                _id
                title
              }
            }
            outcomes(first: 1) {
              nodes {
                ... on LearningOutcome {
                  _id
                  title
                }
              }
            }
          }
        }
      }
    }
  - Repeat the process for an course instead of account
}

Change-Id: Ic0ef4dc6d42c4df7801ff7c3904c5d6a42049ac3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267150
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Chrystal Langston <chrystal.langston@instructure.com>
QA-Review: Martin Yosifov <martin.yosifov@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2021-06-17 17:55:59 +00:00
Manoel Quirino Neto 6186ec2c10 Add ability to search outcomes
closes OUT-4013
flag=improved_outcomes_management

Test Plan:
- Make sure you have a course or account with outcomes
- Make some queries in /graphiql and check if search is returning
  results related to your search:
t push gerrit

  Query:
    {
      course(id: COURSE_ID) {
        rootOutcomeGroup {
          outcomes(searchQuery: "MY QUERY HERE") {
            nodes {
              ... on LearningOutcome {
                title
                description
              }
            }
          }
        }
      }
    }

Change-Id: I6c50385ed0fe36c5b9e75a831edddeaf51561c18
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259826
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: Pablo Gomez <pablo.gomez@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2021-03-26 20:25:35 +00:00
Pablo Marti-Gomez 4c65f3f583 Add cache to Outcomes::LearningOutcomeGroupChildren
Updates Outcomes::LearningOutcomeGroupChildren by adding cache
at the queries for getting the total subgroups and outcomes.

closes OUT-4148
flag=improved_outcomes_management

Test plan:
- Create nested learning outcome groups
- For each nested learning outcome group create learning outcomes
> With FF improved_outcomes_management: OFF
- On Rails console: calls to Outcomes::LearningOutcomeGroupChildren
methods should return a default value
- On web: when generating actions over ContentTag, LearningOutcome
and LearningOutcomeGroup it should not lead to clear any cache
> With FF improved_outcomes_management: ON
- On Rails console: call Outcomes::LearningOutcomeGroupChildren
methods for getting total subgroups and outcomes, queries to the
DB should be made (it will need the root context)
- Call again the same methods, it should return the values from
cache
- Create a new instance of the class and call the same methods,
it should return the values from cache
- Clear the cache with `Rails.cache.clear`
- On web (or through GraphiQL) get the total subgroups and total
outcomes multiple times; it should cache the data and should not
run additional queries
- On web: clear the cache by executing the following actions:
  - Add a Learning Outcome Group
  - Adopt a Learning Outcome Group
  - Copy a Learning Outcome Group from global
  - Remove a Learning Outcome Group
  - Add an Outcome
  - Remove an Outcome
- Get the total subgroups and total outcomes, it should run new
queries
- Run the same tests for global context, it should generate and
clear the cache in the same way

Change-Id: I9b0bfc68b84b3e36869d69a926ef84d9989ea96d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257257
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2021-03-17 16:49:37 +00:00
Chrystal Langston 7f1f432987 Fetch suboutcomes within a learning outcome group via graphql
Add ability to fetch all sub-outcomes of a learning outcome group
Ordered by parent group title then outcome short description. The
Results should be paginated to accommodate for infinite scroll.

closes OUT-4130
flag=improved_outcomes_management

test plan
- PreReq: Account/Course with outcomes and groups
- Log into Canvas and navigate to graphiql
- Run the below query
- outcomes should be populated with all outcomes and suboutcomes
For the root outcome group order by group title, outcome short
description
- Run the below query
query GroupDetailQuery($id: ID!, $outcomesCursor: String) {
    group: legacyNode(type: LearningOutcomeGroup, _id: $id) {
      ... on LearningOutcomeGroup {
        _id
        description
        title
        outcomesCount
        outcomes(first: 10, after: $outcomesCursor) {
          pageInfo {
            hasNextPage
            startCursor
            endCursor
          }
          nodes {
            ... on LearningOutcome {
              _id
              description
              title
            }
          }
        }
      }
    }
  }
{
  "id": 1,
  "outcomesCursor": ""
}
- All outcomes should be returned ordered by parent group name,
then outcome name
- Change the name of an outcome and/or group to force it to change
the order.
- Run the query again, and you should see the updated outcome or
Parent group’s outcomes first before the remain outcomes

Change-Id: Icdad82c0b57ca625924d9b0af7d7b3304b88c251
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257653
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
2021-02-03 17:31:04 +00:00
Pablo Marti-Gomez 16c7034ff7 Add queries for getting total subgroups and outcomes
Updates LearningOutcomeGroupType to return the number of
nested subgroups and nested outcomes for a learning outcome
group.

closes OUT-4022
flag=improved_outcomes_management

Test plan:
- Create nested learning outcome groups
- For each nested learning outcome group create learning outcomes
- Make a query in /graphiql for an accout or a course  and
retrieve the parent learning outcome group. e.g.
  ```
     query MyQuery {
        account(id: 1) {
          rootOutcomeGroup {
            id
            _id
            title
            childGroupsCount
            outcomesCount
          }
        }
     }
  ```
- Compare the values at the fields childGroupsCount and
outcomesCount with the amount of nested subgroups and nested
outcomes respectively so they should match

Change-Id: Ie63a5b134d661832f5a22714b693dddc6887cec3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/254149
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: Brian Watson <bwatson@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2021-01-21 21:04:21 +00:00