REFACTOR: Change `watch` wording to `unignore` (#7112)

* REFACTOR: Change `watch` wording to `unignore`
This commit is contained in:
Tarek Khalil 2019-03-05 14:40:31 +00:00 committed by GitHub
parent 9e09224eb4
commit f19d36cbba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 14 deletions

View File

@ -195,11 +195,6 @@ export default Ember.Component.extend(
this._close();
},
watchUser() {
this.get("user").watch();
this._close();
},
showUser() {
this.showUser(this.get("user"));
this._close();

View File

@ -152,9 +152,9 @@ export default Ember.Controller.extend(CanCheckEmails, {
user.ignore().then(() => user.set("ignored", true));
},
watchUser() {
unignoreUser() {
const user = this.get("model");
user.watch().then(() => user.set("ignored", false));
user.unignore().then(() => user.set("ignored", false));
}
}
});

View File

@ -622,7 +622,7 @@ const User = RestModel.extend({
});
},
watch() {
unignore() {
return ajax(`${userPath(this.get("username"))}/ignore.json`, {
type: "DELETE",
data: { ignored_user_id: this.get("id") }

View File

@ -53,9 +53,9 @@
<li>
{{#if model.ignored}}
{{d-button class="btn-default"
action=(action "watchUser")
action=(action "unignoreUser")
icon="far-eye"
label="user.watch"}}
label="user.unignore"}}
{{else}}
{{d-button class="btn-danger"
action=(action "ignoreUser")

View File

@ -14,7 +14,7 @@ class UsersController < ApplicationController
:pick_avatar, :destroy_user_image, :destroy, :check_emails,
:topic_tracking_state, :preferences, :create_second_factor,
:update_second_factor, :create_second_factor_backup, :select_avatar,
:ignore, :watch, :revoke_auth_token
:ignore, :unignore, :revoke_auth_token
]
skip_before_action :check_xhr, only: [
@ -1004,7 +1004,7 @@ class UsersController < ApplicationController
render json: success_json
end
def watch
def unignore
raise Discourse::NotFound unless SiteSetting.ignore_user_enabled
IgnoredUser.where(user: current_user, ignored_user_id: params[:ignored_user_id]).delete_all

View File

@ -637,7 +637,7 @@ en:
private_message: "Message"
private_messages: "Messages"
ignore: "Ignore"
watch: "Watch"
unignore: "Unignore"
activity_stream: "Activity"
preferences: "Preferences"
profile_hidden: "This user's public profile is hidden."

View File

@ -422,7 +422,7 @@ Discourse::Application.routes.draw do
get "#{root_path}/:username/staff-info" => "users#staff_info", constraints: { username: RouteFormat.username }
get "#{root_path}/:username/summary" => "users#summary", constraints: { username: RouteFormat.username }
put "#{root_path}/:username/ignore" => "users#ignore", constraints: { username: RouteFormat.username }
delete "#{root_path}/:username/ignore" => "users#watch", constraints: { username: RouteFormat.username }
delete "#{root_path}/:username/ignore" => "users#unignore", constraints: { username: RouteFormat.username }
get "#{root_path}/:username/invited" => "users#invited", constraints: { username: RouteFormat.username }
get "#{root_path}/:username/invited_count" => "users#invited_count", constraints: { username: RouteFormat.username }
get "#{root_path}/:username/invited/:filter" => "users#invited", constraints: { username: RouteFormat.username }