Commit Graph

9 Commits

Author SHA1 Message Date
Cody Cutrer d0863395ea optimize several things about brand config regeneration
refs FOO-1166

 * don't randomly sample from an array that's likely already usefully
   ordered
 * re-write sub_account recursive stuff so that a relation can be used,
   and then use that relation to preload brand_configs, and to select
   only necessary columns
 * fix a bunch of callbacks so that you can actually save a slim
   account object
 * pass in an account/sharedbrandconfig object when we have one already,
   instead of force reloading

Change-Id: Ia14b539617f338be507e7773da7ef9bc3907ec4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257443
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>
2021-02-17 23:18:35 +00:00
Cody Cutrer 6df20b6221 use a single background job to regenerate brand configs
fixes FOO-1166

so that the query for sub-accounts is not synchronous to the request

this should be api-compatible with the old method of one progress
object per sub account

note that sub-account themes are no longer generated in parallel,
so this may be a little bit slower than before. if it's an issue,
additional work may be required

test plan:
 * have an account with lots of sub accounts
 * edit and apply a theme
 * progress bar shoould show correctly
 * the theme should be applied to all sub accounts

Change-Id: I8c2fb4f38e72783052eaa0440072b6c8bd25bea8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257004
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-01-22 23:27:35 +00:00
Cody Cutrer 06763dd519 add # frozen_string_literal: true for lib
Change-Id: I59b751cac52367a89e03f572477f0cf1d607b405
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251155
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>
2020-10-27 20:49:50 +00:00
Cody Cutrer 6b6cb86ca5 limit lots more stuff to non_shadow root accounts
Change-Id: I99f8edb00d912b31ca29cba32f724ac33330e4ab
Reviewed-on: https://gerrit.instructure.com/194426
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
2019-05-20 22:49:36 +00:00
Cody Cutrer 15bd8d81d4 strand brand config regeneration jobs
fixes CNVS-33934

so that they can't run out of order

Change-Id: I6f8c0e680a20b2b78828818447e0d72899d01ee6
Reviewed-on: https://gerrit.instructure.com/116253
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-06-20 20:01:27 +00:00
Landon Wilkins 7473953da1 da licença part 26
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I74f079254fdbff56b4f9d7013b01f11fc862777a
Reviewed-on: https://gerrit.instructure.com/110049
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:52:25 +00:00
Simon Williams 544282af02 theme editor for siteadmin
fixes CNVS-28289

this enables theme editor to work as a virtual "parent" account for root
account themes, but only root accounts on the same shard as the site
admin account.  this is a limitation we hope to remove in the future,
but replicating the site admin theme to all shards is going to be
significantly more complicated.

test plan:
- create a mixture of root accounts on the same shard as site admin and
different shards
- regression test theme editor in siteadmin.  it should act as a parent
for same-shard accounts and not interact with different-shard accounts

Change-Id: Ia7e3e1a8adbb7bc2e49b2d9b5ef3b4d30cf4c581
Reviewed-on: https://gerrit.instructure.com/82000
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
2016-07-12 22:02:04 +00:00
Ryan Shaw fe91cf9fd4 Allow people to revert back to the "Default Theme"
fixes: CNVS-29805

test plan:

* apply a theme to an account
* pick the "default theme" card
* make no changes
* the save button should disabled with a
  "you have not set any custom values..." message
* you should be able to click the apply button
* you should now be looking at the "default theme"
* window.ENV.active_brand_config should be null

Change-Id: I362d8fde96faf0ebceed12e4c0560532a6e4e5b7
Reviewed-on: https://gerrit.instructure.com/81765
Product-Review: Colleen Palmer <colleen@instructure.com>
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2016-06-23 16:35:54 +00:00
Ryan Shaw bcd0569251 handle regenerating all sub account themes & shared themes
fixes: CNVS-28400

test plan:

test 1.
for root account with unbranded child but branded
grandchild. aka:
When you have Acct (with Theme A) -> 
Sub Acct (with no theme) -> 
Sub Sub Account (with theme B), 
and update Theme A, Theme B is not updated to inherit 
from the new A.

* start with root no brand config, child no brand
* create a theme for grandchild with red buttons
  and js file with "console.log('from grandchild')"
* go to root. set a theme with blue nav bg &
  js file with "console.log('from root')"
* you should see progress for generating grandchild
  when you hit "save"
* go to page in grandchild. buttons should be red,
  nav bg should be blue. js console should have
  "from root" logged first, then "from grandchild"

test 2:
* create a bunch of saved themes in child and grandchild
* save a new theme to "root"
* when any of the saved themes are applied they
  should be based on the new root's theme (use
  colors and console.log's to verify)


Change-Id: Ic9dbeea1524034ef60b758398eca30bc019aa32e
Reviewed-on: https://gerrit.instructure.com/79739
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2016-05-18 22:22:39 +00:00