diff --git a/app/controllers/drafts_controller.rb b/app/controllers/drafts_controller.rb index 8ed7e539b3d..86a5c254185 100644 --- a/app/controllers/drafts_controller.rb +++ b/app/controllers/drafts_controller.rb @@ -16,8 +16,7 @@ class DraftsController < ApplicationController ) render json: { - drafts: stream ? serialize_data(stream, DraftSerializer) : [], - no_results_help: I18n.t("user_activity.no_drafts.self") + drafts: stream ? serialize_data(stream, DraftSerializer) : [] } end diff --git a/app/controllers/user_actions_controller.rb b/app/controllers/user_actions_controller.rb index bee259e9518..fba1a6354a6 100644 --- a/app/controllers/user_actions_controller.rb +++ b/app/controllers/user_actions_controller.rb @@ -25,20 +25,7 @@ class UserActionsController < ApplicationController } stream = UserAction.stream(opts).to_a - if stream.empty? && (help_key = params['no_results_help_key']) - if user.id == guardian.user.try(:id) - help_key += ".self" - else - help_key += ".others" - end - render json: { - user_action: [], - no_results_help: I18n.t(help_key) - } - else - render_serialized(stream, UserActionSerializer, root: 'user_actions') - end - + render_serialized(stream, UserActionSerializer, root: 'user_actions') end def show diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 46112fa2749..16590386f43 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1621,10 +1621,7 @@ class UsersController < ApplicationController if bookmark_list.bookmarks.empty? render json: { - bookmarks: [], - no_results_help: I18n.t( - params[:q].present? ? "user_activity.no_bookmarks.search" : "user_activity.no_bookmarks.self" - ) + bookmarks: [] } else page = params[:page].to_i + 1 diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 7aeb6d57e16..b46fb39daca 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -965,12 +965,6 @@ en: pm_title: "Backup Drafts from ongoing topics" pm_body: "Topic containing backup drafts" user_activity: - no_bookmarks: - self: "You have no bookmarked posts; bookmarks allow you to quickly refer to specific posts." - search: "No bookmarks found with the provided search query." - others: "No bookmarks." - no_drafts: - self: "You have no drafts; begin composing a reply in any topic and it will be auto-saved as a new draft." no_log_search_queries: "Search log queries are currently disabled (an administrator can enable them in site settings)." email_settings: diff --git a/spec/requests/user_actions_controller_spec.rb b/spec/requests/user_actions_controller_spec.rb index c70ab0ca7a0..1d9c01c1015 100644 --- a/spec/requests/user_actions_controller_spec.rb +++ b/spec/requests/user_actions_controller_spec.rb @@ -49,36 +49,6 @@ describe UserActionsController do .to eq(user.username) end - it 'renders help text if provided for self' do - logged_in = sign_in(Fabricate(:user)) - - get "/user_actions.json", params: { - filter: UserAction::LIKE, - username: logged_in.username, - no_results_help_key: "user_activity.no_bookmarks" - } - - expect(response.status).to eq(200) - parsed = response.parsed_body - - expect(parsed["no_results_help"]).to eq(I18n.t("user_activity.no_bookmarks.self")) - end - - it 'renders help text for others' do - user = Fabricate(:user) - - get "/user_actions.json", params: { - filter: UserAction::LIKE, - username: user.username, - no_results_help_key: "user_activity.no_bookmarks" - } - - expect(response.status).to eq(200) - parsed = response.parsed_body - - expect(parsed["no_results_help"]).to eq(I18n.t("user_activity.no_bookmarks.others")) - end - context 'hidden profiles' do fab!(:post) { Fabricate(:post) } diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rb index dd9a8615f93..adaf07f712f 100644 --- a/spec/requests/users_controller_spec.rb +++ b/spec/requests/users_controller_spec.rb @@ -5074,9 +5074,6 @@ describe UsersController do get "/u/#{user.username}/bookmarks.json" expect(response.status).to eq(200) expect(response.parsed_body['bookmarks']).to eq([]) - expect(response.parsed_body['no_results_help']).to eq( - I18n.t('user_activity.no_bookmarks.self') - ) end it "shows a helpful message if no bookmarks are found for the search" do @@ -5086,9 +5083,6 @@ describe UsersController do } expect(response.status).to eq(200) expect(response.parsed_body['bookmarks']).to eq([]) - expect(response.parsed_body['no_results_help']).to eq( - I18n.t('user_activity.no_bookmarks.search') - ) end end