mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: Split navigation preference for count and behavior of sidebar links (#22203)
This PR splits up the preference that controls the count vs dot and destination of sidebar links, which is really hard to understand, into 2 simpler checkboxes: The new preferences/checkboxes are off by default, but there are database migrations to switch the old preference to the new ones so that existing users don't have to update their preferences to keep their preferred behavior of sidebar links when this changed is rolled out. Internal topic: t/103529.
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSidebarLinkToFilteredListToUserOption < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :user_options, :sidebar_link_to_filtered_list, :boolean, default: false, null: false
|
||||
|
||||
execute <<~SQL
|
||||
UPDATE user_options
|
||||
SET sidebar_link_to_filtered_list = true
|
||||
WHERE sidebar_list_destination = 1
|
||||
SQL
|
||||
end
|
||||
end
|
@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSidebarShowCountOfNewItemsToUserOption < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :user_options,
|
||||
:sidebar_show_count_of_new_items,
|
||||
:boolean,
|
||||
default: false,
|
||||
null: false
|
||||
|
||||
execute <<~SQL
|
||||
UPDATE user_options
|
||||
SET sidebar_show_count_of_new_items = true
|
||||
WHERE sidebar_list_destination = 1
|
||||
SQL
|
||||
end
|
||||
end
|
@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveDefaultSidebarListDestinationSetting < ActiveRecord::Migration[7.0]
|
||||
def up
|
||||
execute("DELETE FROM site_settings WHERE name = 'default_sidebar_list_destination'")
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user