Skip to content

Commit

Permalink
Remove ability to switch themes
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Jun 28, 2024
1 parent 0248f9a commit 66ae15c
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 69 deletions.
19 changes: 0 additions & 19 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,6 @@ def show_tailwind_theme?
true
end

sig { params(tailwind: T::Boolean).void }
def update_tailwind_theme(tailwind)
update_tailwind_theme_cookie(tailwind)
update_tailwind_theme_user(tailwind)
end

sig { params(tailwind: T::Boolean).void }
def update_tailwind_theme_cookie(tailwind)
cookies.signed[:planningalerts_theme] = ("tailwind" if tailwind)
end

sig { params(tailwind: T::Boolean).void }
def update_tailwind_theme_user(tailwind)
u = current_user
return unless u

u.update!(tailwind_theme: tailwind)
end

sig { void }
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:name, :email, :password) }
Expand Down
14 changes: 0 additions & 14 deletions app/controllers/themes_controller.rb

This file was deleted.

3 changes: 0 additions & 3 deletions app/views/_tailwind/profiles/_menu.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<li><div class="pl-4"><%= pa_link_to_unless_current "Create new alert", new_profile_alert_path %></div></li>
<li><div class="pl-4"><%= pa_link_to_unless_current "Your comments", comments_profile_path %></div></li>
<li><div class="pl-4"><%= pa_link_to_unless_current "Edit account", edit_user_registration_path %></div></li>
<% if Flipper.enabled?(:switch_themes, current_user) %>
<li><div class="pl-4"><%= pa_link_to_unless_current "Switch design", design_profile_path %></div></li>
<% end %>
<%# Setting "Sign out" to a block breaks on ios/safari %>
<li><div class="pl-4"><%= button_to "Sign out", destroy_user_session_path, method: :delete, class: "#{pa_link_classes(quiet: false)} cursor-pointer" %></div></li>
</ul>
Expand Down
10 changes: 0 additions & 10 deletions app/views/_tailwind/profiles/design.html.erb

This file was deleted.

13 changes: 0 additions & 13 deletions app/views/profiles/design.html.haml

This file was deleted.

2 changes: 0 additions & 2 deletions app/views/profiles/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@
%li= link_to "Your alerts", profile_alerts_path
%li= link_to "Your comments", comments_profile_path
%li= link_to "Edit account", edit_user_registration_path
- if Flipper.enabled?(:switch_themes, current_user)
%li= link_to "Switch design", design_profile_path

= button_to "Sign out", destroy_user_session_path, method: :delete, class: "button button-action button-rounded"
1 change: 0 additions & 1 deletion config/initializers/flipper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
"disable_streetview_in_emails" => "Disables Google streetview in email. Do this to save money",
"disable_streetview_in_app" => "Disable Google streetview in the main application. Do this to save money",
"switch_themes" => "Can switch to new in progress design for the site",
"extra_options_on_address_search" => "Add extra options to filter by time/space when searching address",
"show_authority_map" => "Show boundary of authority on a map",
# Very important to note that switching on maintance_mode ** is not enough **.
Expand Down
7 changes: 0 additions & 7 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ def matches?(request)
resources :alerts, except: :show, controller: :alerts_new

get :comments
# The design route is temporary and only needed for early testers of the new tailwind based theme
get :design
end

resources :alerts, only: %i[new create], path_names: { new: "signup" }, param: :confirm_id do
Expand Down Expand Up @@ -222,9 +220,4 @@ def matches?(request)
get "/500", to: "documentation#error_500"

post "/cuttlefish/event", to: "cuttlefish#event"

# TODO: Only needed while we're testing the tailwind theme
resource :theme, only: [] do
post 'toggle'
end
end

0 comments on commit 66ae15c

Please sign in to comment.