Skip to content

Commit df67a6e

Browse files
committed
allow account admins to enable theme editor for sub-accounts
fixes CNVS-29585 test plan: - as a non site admin in the new ui - make sure you can enable theme editor for sub accounts Change-Id: Ic518d2a46f01043783b2ad0250ad93b06454d2ea Reviewed-on: https://gerrit.instructure.com/80913 Tested-by: Jenkins Reviewed-by: Ryan Shaw <ryan@instructure.com> QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
1 parent 5b8173a commit df67a6e

2 files changed

Lines changed: 26 additions & 9 deletions

File tree

app/views/accounts/settings.html.erb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ TEXT
331331
<%= settings.check_box :enable_alerts, :checked => @account.settings[:enable_alerts] %>
332332
<%= settings.label :enable_alerts, :en => "Alerts (beta)" %>
333333
</div>
334-
<% end %>
334+
<% end %><%# end of site_admin? %>
335335
<div id="global_includes_warning_message_wrapper">
336336
<%= settings.check_box :global_includes, :checked => @account.settings[:global_includes] %>
337337
<%= settings.label :global_includes, :en => "Custom CSS/JavaScript overrides" %>
@@ -347,13 +347,7 @@ TEXT
347347
</p>
348348
</div>
349349
</div>
350-
<div>
351-
<%= settings.check_box :sub_account_includes,
352-
id: :account_settings_new_sub_account_includes,
353-
checked: @account.settings[:sub_account_includes]
354-
%>
355-
<%= settings.label :new_sub_account_includes, :en => "Let sub-accounts use the Theme Editor to customize their own branding" %>
356-
<% end %>
350+
<% end %><%# end of use_new_styles? %>
357351
</div>
358352
<div id="show_scheduler_checkbox">
359353
<%= settings.check_box :show_scheduler, :checked => @account.settings[:show_scheduler] %>
@@ -363,7 +357,11 @@ TEXT
363357
<%= settings.check_box :enable_profiles, :checked => @account.settings[:enable_profiles] %>
364358
<%= settings.label :enable_profiles, :en => "Enable Profiles" %>
365359
</div>
366-
<% end %>
360+
<% end %><%# end of :manage_site_settings %>
361+
<div>
362+
<%= settings.check_box :sub_account_includes, checked: @account.settings[:sub_account_includes] %>
363+
<%= settings.label :new_sub_account_includes, :en => "Let sub-accounts use the Theme Editor to customize their own branding" %>
364+
</div>
367365
<% if @account.canvas_authentication? %>
368366
<div>
369367
<%= settings.check_box :open_registration, :checked => @account.open_registration? %>

spec/views/accounts/settings.html.erb_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,23 @@
168168
expect(response).not_to have_tag '#enroll_users_form'
169169
end
170170
end
171+
172+
context "theme editor" do
173+
before do
174+
@account = Account.default
175+
assigns[:account] = @account
176+
assigns[:account_users] = []
177+
assigns[:root_account] = @account
178+
assigns[:associated_courses_count] = 0
179+
assigns[:announcements] = AccountNotification.none.paginate
180+
end
181+
182+
it "should show sub account theme editor option for non siteadmin admins" do
183+
admin = account_admin_user
184+
view_context(@account, admin)
185+
assigns[:current_user] = admin
186+
render
187+
expect(response).to include("Let sub-accounts use the Theme Editor")
188+
end
189+
end
171190
end

0 commit comments

Comments
 (0)