diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 68bb82d6b8a..20c826ce50b 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -2388,7 +2388,7 @@ en: sitemap_page_size: "Number of URLs to include in each sitemap page. Max 50.000" enable_user_status: "(experimental) Allow users to set custom status message (emoji + description)." - enable_user_tips: "(experimental) Enable new user tips that describe key features to users" + enable_user_tips: "Enable new user tips that describe key features to users" short_title: "The short title will be used on the user's home screen, launcher, or other places where space may be limited. It should be limited to 12 characters." diff --git a/config/site_settings.yml b/config/site_settings.yml index 4db12493453..bb298ea862b 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -385,7 +385,7 @@ basic: default: false enable_user_tips: client: true - default: false + default: true login: invite_only: diff --git a/db/migrate/20230505113906_hide_user_tips_for_existing_users.rb b/db/migrate/20230505113906_hide_user_tips_for_existing_users.rb new file mode 100644 index 00000000000..a904c8f4da0 --- /dev/null +++ b/db/migrate/20230505113906_hide_user_tips_for_existing_users.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class HideUserTipsForExistingUsers < ActiveRecord::Migration[7.0] + def up + execute "UPDATE user_options SET seen_popups = '{1, 2, 3, 4, 5}'" + end + + def down + execute "UPDATE user_options SET seen_popups = '{}'" + end +end diff --git a/spec/requests/api/schemas/json/site_response.json b/spec/requests/api/schemas/json/site_response.json index cc269f040e3..2830f20bfe3 100644 --- a/spec/requests/api/schemas/json/site_response.json +++ b/spec/requests/api/schemas/json/site_response.json @@ -223,6 +223,34 @@ "leader" ] }, + "user_tips": { + "type": "object", + "additionalProperties": false, + "properties": { + "first_notification": { + "type": "integer" + }, + "topic_timeline": { + "type": "integer" + }, + "post_menu": { + "type": "integer" + }, + "topic_notification_levels": { + "type": "integer" + }, + "suggested_topics": { + "type": "integer" + } + }, + "required": [ + "first_notification", + "topic_timeline", + "post_menu", + "topic_notification_levels", + "suggested_topics" + ] + }, "groups": { "type": "array", "items": diff --git a/spec/serializers/site_serializer_spec.rb b/spec/serializers/site_serializer_spec.rb index c336f69f145..c3b0f7c988b 100644 --- a/spec/serializers/site_serializer_spec.rb +++ b/spec/serializers/site_serializer_spec.rb @@ -15,6 +15,8 @@ RSpec.describe SiteSerializer do end it "is not included if enable_user_tips is disabled" do + SiteSetting.enable_user_tips = false + serialized = described_class.new(Site.new(guardian), scope: guardian, root: false).as_json expect(serialized[:user_tips]).to eq(nil) end diff --git a/spec/support/system_helpers.rb b/spec/support/system_helpers.rb index 668c4d8d002..9bc48356008 100644 --- a/spec/support/system_helpers.rb +++ b/spec/support/system_helpers.rb @@ -26,6 +26,7 @@ module SystemHelpers SiteSetting.port = Capybara.server_port SiteSetting.external_system_avatars_enabled = false SiteSetting.disable_avatar_education_message = true + SiteSetting.enable_user_tips = false end def try_until_success(timeout: 2, frequency: 0.01)