Skip to content

Commit

Permalink
Remove toggle from More controller to always render design system lay…
Browse files Browse the repository at this point in the history
…out.
  • Loading branch information
farahTW authored and minhngocd committed Nov 21, 2023
1 parent e945d9e commit 5e8c3e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
19 changes: 1 addition & 18 deletions app/controllers/admin/more_controller.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
class Admin::MoreController < Admin::BaseController
before_action :check_new_design_system_permissions, only: %i[index]
layout :get_layout
layout "design_system"

def index; end

private

def check_new_design_system_permissions
forbidden! unless new_design_system?
end

def get_layout
design_system_actions = %w[index] if preview_design_system?(next_release: false)

if design_system_actions&.include?(action_name)
"design_system"
else
"admin"
end
end
end
2 changes: 1 addition & 1 deletion test/functional/admin/more_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class Admin::MoreControllerTest < ActionController::TestCase
setup do
login_as_preview_design_system_user :writer
login_as :writer
end

view_test "GET #index renders the 'More' page with a correctly formatted list of links" do
Expand Down

0 comments on commit 5e8c3e6

Please sign in to comment.