Commit Graph

23 Commits

Author SHA1 Message Date
Jeremy Stanley 90e7ab67de drop unused visibility and manipulate columns from feature_flags
these were introduced as part of a major refactor that never
materialized. they have never been used.

closes LS-2098

Change-Id: I9c6711a9c2175f2e094d055f5d12fc21989c6d68
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262001
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-03-31 21:19:38 +00:00
Jacob Burroughs f4a5f2da33 Quad-state feature flags
Allow feature flags to be "allowed on".  Updates user facing langauge
to be enabled/disabled + "(always)" or "(default)", which is clearer
than allowed, especially with 4 states.  Also moves from backbone UI
to react UI rather than retrofitting the changes to the old UI. The
backbone ui can be killed in a separate PS.  The new UI is easier to
ctrl-f on and presents the flags in alphabetical order according to
the user's current locale.

This includes a somewhat gross workaround for a bug in InstUI <Menu>
which is why it goes in an explicit <Popover>

fixes FOO-835

test plan:
- Ensure 'New Feature Flags' feature is off
- Make sure feature flags work in all the expected ways at the siteadmin, account, and course level
- Turn on 'New Feature Flags'
- Make sure that you can still use the feature flag ui in natural ways at each level
- Try turning a feature flag "on" but unlocking it/leaving it unlocked
- Ensure it is inherited on but overridable

Change-Id: I520824cdf6e18b5a7da5ab5f552a7fd3140fd4bf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249917
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2020-12-15 23:18:33 +00:00
Cody Cutrer f299f76b75 add # frozen_string_literal: true for models
Change-Id: I70825be7ec7e24458afe0c63dc48c5a76158f520
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251150
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-28 22:08:12 +00:00
James Williams 667f5e3be2 clear site admin feature flag cache in all regions
test plan:
* feature flag toggling should work on site admin

closes #LS-1225

Change-Id: I6f383e2b8fa6336d8ddb2665e3a3aba08bf801f7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243755
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-07-30 13:54:34 +00:00
Jeremy Stanley a0d93f12a3 make feature flag validation a bit more helpful
instead of saying a feature "is not valid in context",
say "does not exist" or "does not apply to context"

test plan: you should get distinct validation errors
when trying to set a flag for a nonexistent feature
vs. trying to set a flag in an non-applicable context
(i.e., setting an account feature flag in a course)

flag = none

Change-Id: Idf88c4050d0e8bce760f36c7262b0986e97739fc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238466
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-05-28 17:13:28 +00:00
James Williams 8d5d7e7465 add cache around account feature checks on every page load
test plan:
* toggling site admin and root account features such
 as Direct Share should still work as expected

closes #LA-983

Change-Id: I26912068c78a7d10449a2245c902ac31f105be94
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236682
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-05-13 21:54:01 +00:00
James Williams 6562044c0a clear special account cache in development after flag change
Change-Id: I662e9ef520efb24d9923e580eeef1fd977fb8227
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/231493
QA-Review: Anju Reddy <areddy@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2020-03-25 21:32:16 +00:00
James Williams bbdc741594 skip feature flag cache when showing API results to admins
test plan:
* in a production-like environment, feature flag changes should
 not appear to be undone when refreshing the page (while the
 cache is still in the process of invalidating)

closes #ADMIN-2939

Change-Id: I495820850f8facaa6965188140d979bd5227994d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/211436
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2019-10-21 12:12:38 +00:00
Simon Williams ffca880b71 correctly invalidate course/user feature flag cache
test plan:
- change a course/user feature flag
- the change should stick and apply

Change-Id: I2b4045bf6a0c5c57c58591c98ddcd513e8243fa0
Reviewed-on: https://gerrit.instructure.com/126202
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2017-09-15 20:19:49 +00:00
Landon Wilkins 621d05fecc da licença part 11
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: Ib35e5af93dbd7b2ccc2478535590a813d18f7bf1
Reviewed-on: https://gerrit.instructure.com/110031
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 21:36:17 +00:00
Neil Gupta 7298b8749f Get rid of multiple_grading_periods feature flag
Fixes CNVS-27109

Test plan:
Regression test everything related to multiple grading periods.

In particular, make sure:
* there is no mention of the multiple grading periods feature flag on
  the account or course features pages
* make sure grading periods UI always shows up on the account grading
  standards page
* make sure the grading periods UI only shows on the course grading
  standards page if legacy course grading periods exist for that course
  (see below)
* grading period dropdowns only show up everywhere else if there are
  grading periods to show. Otherwise, it should behave as if MGP is
  "disabled"
* Grade calculation should work as expected with and without grading
  periods

To create legacy course grading periods, you have to use rails console:
1. Find your course:
      course = Course.find(<id>)
2. Create a grading period group:
      group = course.grading_period_groups.create!(title: "2017")
2. Create a grading period:
      group.grading_periods.create!(
        weight: 1,
        title: 'Fall',
        start_date: 5.days.ago,
        end_date: 10.days.from_now
      )

Here's the list of known places grading periods can be seen in the UI:

Instructor Assignments page
  (https://community.canvaslms.com/docs/DOC-2615)
Student Assignments page
  (https://community.canvaslms.com/docs/DOC-3123)
Gradebook (https://community.canvaslms.com/docs/DOC-2785)
Gradebook Individual View
  (https://community.canvaslms.com/docs/DOC-2788)
Course Settings grading schemes page
  (https://community.canvaslms.com/docs/DOC-4042)
Student Grades page (https://community.canvaslms.com/docs/DOC-1291)
Dashboard global Grades page
  (https://community.canvaslms.com/docs/DOC-5464)

Change-Id: Iefac4b08120bd1699d4ed98bcb418089eec9b3b8
Reviewed-on: https://gerrit.instructure.com/99744
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-01-25 20:35:18 +00:00
James Williams 89370c5f11 remove protected_attributes
refs #CNVS-32574

Change-Id: I3ba018a7110a7530c9af4a59c97422f626a749b6
Reviewed-on: https://gerrit.instructure.com/99260
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-12 17:46:18 +00:00
James Williams 26ee38350a strong params part E-F
refs #CNVS-32574

Change-Id: Ib1fc9c81dbfa4ece200a15a23105dbfa6f84d0c6
Reviewed-on: https://gerrit.instructure.com/94677
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-01-10 18:16:54 +00:00
James Williams 26a11c0b06 improve new account course/user search performance
don't load manageable role data for each course
it's too expensive - just load up for the account level

test plan:
* enable the new course and user search feature
* the "plus" button on courses on the search page should
 bring up the dialog to add people to the course
* the roles should still appear in the drop-down

closes #CNVS-30513

Change-Id: Ib9eb08afe253ca0890d4c60c23cd52e68a19d944
Reviewed-on: https://gerrit.instructure.com/85779
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-07-26 13:21:59 +00:00
Jeremy Stanley c8cfaa1e1c fix feature flag page error with hidden+root_opt_in
test plan:
As a site admin user,
 1. Set "Post grades to SIS" to Allowed in a root account
 2. Turn it on in a course
 3. Turn it back off in the root account
 4. Return to the course and reload the feature settings page
 5. The page should load without error

NOTE: the fact that "Post grades to SIS" is still enabled in
the course is the subject of CNVS-29319 and will be addressed
separately.  tl;dr hidden features are weird

fixes CNVS-29365

Change-Id: Ia9958bb6d4a56dc45a717503e437816a82e89b0c
Reviewed-on: https://gerrit.instructure.com/79631
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2016-05-16 17:01:25 +00:00
Cody Cutrer fb64908614 expand "native" polymorphic associations to most polymorphics
Change-Id: I0b2ada85ae6d7b32d2940f5c7db6596b27c3bf84
Reviewed-on: https://gerrit.instructure.com/72282
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-02-22 19:14:31 +00:00
Cody Cutrer d8f3e7cdf8 remove locking_account_id from feature flags
it's never used

keep it in the API response for back-compat reasons

test plan:
 * regression test feature flags; nothing should be broken

Change-Id: I6b023c04148dc6bdb686199d1891e13fcdc8ffa8
Reviewed-on: https://gerrit.instructure.com/70442
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2016-02-10 21:15:06 +00:00
Cody Cutrer e1529eb1ae switch a few things to use account_chain
instead of assuming [self, Account.site_admin]

refs CNVS-26291, CNVS-26292

Change-Id: I8c20a3e29f5af91d04e380794f21705706fd96a8
Reviewed-on: https://gerrit.instructure.com/69841
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-01-18 17:51:42 +00:00
James Williams 7b10d15b9f rails 4.2: use AR#connection on class instead of model
refs #CNVS-26056

Change-Id: Idee28041d97a6e8a7566ef922f3001906c617864
Reviewed-on: https://gerrit.instructure.com/69500
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-05 13:53:41 +00:00
Cody Cutrer abc23822f1 improve multicache
explicitly have one copy per node in a ring (instead of relying
on hashing of a different to hopefully evenly spread copies around
the ring).

test plan:
 * configure a ring of redis servers for cache
 * canvas should still work

Change-Id: I17e086aac28c1c095c9717a7625ca51c86d0598f
Reviewed-on: https://gerrit.instructure.com/48069
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-05-06 19:21:21 +00:00
Cody Cutrer b1abbc453b spread feature flag cache around a ring
Change-Id: I4831cc45d8646f6f86a34ade6546644c4dacdd49
Reviewed-on: https://gerrit.instructure.com/48065
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-02-03 01:05:24 +00:00
Jeremy Stanley 5d8dd11ba8 re-hide features when site admin turns them off
previously, this worked only in site admin context. this commit
makes it work in any context.

test plan:
 1. as site admin user A, go to the Features tab of the
    account settings for the Site Admin account and find a
    feature with the 'hidden' tag, such as "Google Docs
    Domain Restriction". toggle it on and off.
 2. as a root account admin B with no site admin privileges,
    confirm the feature is not visible on the Features tab
    of the root account
 3. as site admin user A, visit the root account's Features
    tab and confirm the hidden feature is visible (with the
    "hidden" tag). turn it on.
 4. confirm that B sees the feature on the root account's
    Features tab
 5. as A, turn the feature back off in B's account settings
    (not site admin settings)
 6. confirm that, after a page reload, B can no longer see
    the feature on the root account's Features tab

fixes CNVS-16251

Change-Id: I2e1bebe1e710471f2a0efeb8e744cabddee89df8
Reviewed-on: https://gerrit.instructure.com/45751
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-12-26 17:48:05 +00:00
Jeremy Stanley 0e075a24b4 feature flags infrastructure and API
test plan:
 - install the test_features plugin (since no real features exist yet)
 - render and consult the feature flags documentation
 - have a test environment with a root account,
   sub-account, course in sub-account, and user

 - Use the "list features" endpoint as a root account admin
   (with no site admin privileges), on the root account context, and
   confirm that hidden features do not show up
 - Use the "list features" endpoint as a site admin user,
   on the root account context, and confirm that hidden features
   show up
 - Use the "list features" endpoint on the site admin account
   and confirm the hidden features show up

 - Use the "set feature flag" endpoint on a hidden feature on site
   admin and ensure the feature becomes visible in all root accounts
 - Use the "set feature flag endpoint" on a hidden feature on a
   single root account, and ensure the feature becomes visible to
   that root account and not others

 - Confirm that root_opt_in features appear "Off" by default
   in root accounts, after being "Allowed" in code or site admin

 - Confirm a feature flag that is set to "on" or "off" (vs. "allowed")
   cannot be overridden in a lower context (and the API returns
   locked=true for them)

 - Confirm that setting locking_account_id requires admin rights
   in the locking account
 - Confirm that a feature flag with locking_account_id cannot be
   changed without admin rights in the locking account (e.g.,
   set a feature flag on a course, locked with the root account's id,
   and make sure a teacher who is not an account admin can't change it)

 - Confirm feature flags can be deleted with the "remove feature flag"
   endpoint (and they are only deleted where they are defined, not
   when called on an object that inherits a flag)

Change-Id: I3e12e23b4454889b6e8b263f1315e82d8f2ada52
Reviewed-on: https://gerrit.instructure.com/25502
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-11-19 20:50:03 +00:00