Update setting names, readme, to reflect rename to user notes

This commit is contained in:
Kris 2019-07-24 10:35:00 -04:00
parent c79a9297e3
commit e706cc5819
34 changed files with 44 additions and 44 deletions

View File

@ -1,4 +1,4 @@
### discourse-staff-notes ### discourse-user-notes
This plugin gives staff members the ability to attach notes to users. This plugin gives staff members the ability to attach notes to users.
@ -11,9 +11,9 @@ Follow our [Install a Plugin](https://meta.discourse.org/t/install-a-plugin/1915
`git clone https://github.com/discourse/discourse-staff-notes.git` as the plugin command. `git clone https://github.com/discourse/discourse-staff-notes.git` as the plugin command.
Once you've installed it, review the settings under admin and then enable Once you've installed it, review the settings under admin and then enable
`staff_notes_enabled`. `user_notes_enabled`.
**Clearing browser cache might be required when first insalled** **Clearing browser cache might be required when first installed**
## Issues ## Issues

View File

@ -3,7 +3,7 @@ import { getOwner } from "discourse-common/lib/get-owner";
export default { export default {
shouldRender(args, component) { shouldRender(args, component) {
return component.siteSettings.staff_notes_enabled; return component.siteSettings.user_notes_enabled;
}, },
setupComponent(args, component) { setupComponent(args, component) {

View File

@ -5,7 +5,7 @@ import { emojiUrlFor } from "discourse/lib/text";
export default { export default {
shouldRender(args, component) { shouldRender(args, component) {
const { siteSettings, currentUser } = component; const { siteSettings, currentUser } = component;
return siteSettings.staff_notes_enabled && currentUser && currentUser.staff; return siteSettings.user_notes_enabled && currentUser && currentUser.staff;
}, },
setupComponent(args, component) { setupComponent(args, component) {

View File

@ -4,7 +4,7 @@ import { getOwner } from "discourse-common/lib/get-owner";
export default { export default {
shouldRender(args, component) { shouldRender(args, component) {
const { siteSettings, currentUser } = component; const { siteSettings, currentUser } = component;
return siteSettings.staff_notes_enabled && currentUser && currentUser.staff; return siteSettings.user_notes_enabled && currentUser && currentUser.staff;
}, },
setupComponent(args, component) { setupComponent(args, component) {

View File

@ -8,7 +8,7 @@ export default {
const siteSettings = container.lookup("site-settings:main"); const siteSettings = container.lookup("site-settings:main");
const currentUser = container.lookup("current-user:main"); const currentUser = container.lookup("current-user:main");
if ( if (
!siteSettings.staff_notes_enabled || !siteSettings.user_notes_enabled ||
!currentUser || !currentUser ||
!currentUser.staff !currentUser.staff
) { ) {

View File

@ -1,4 +1,4 @@
{{#if siteSettings.staff_notes_enabled}} {{#if siteSettings.user_notes_enabled}}
{{admin-report {{admin-report
dataSourceName="staff_notes" dataSourceName="staff_notes"
startDate=lastWeek startDate=lastWeek

View File

@ -7,8 +7,8 @@
ca: ca:
site_settings: site_settings:
staff_notes_enabled: "Permet als usuaris de l'equip responsable adjuntar notes als usuaris" user_notes_enabled: "Permet als usuaris de l'equip responsable adjuntar notes als usuaris"
staff_notes_moderators_delete: "Permet que els moderadors suprimeixin notes dusuari" user_notes_moderators_delete: "Permet que els moderadors suprimeixin notes dusuari"
staff_notes: staff_notes:
official_warning: "Rebut un advertiment oficial de @%{username} - %{warning_link}" official_warning: "Rebut un advertiment oficial de @%{username} - %{warning_link}"
user_suspended: "@ %{username} ha suspès aquest compte fins a %{suspended_till}. Motiu: %{reason}" user_suspended: "@ %{username} ha suspès aquest compte fins a %{suspended_till}. Motiu: %{reason}"

View File

@ -7,7 +7,7 @@
cs: cs:
site_settings: site_settings:
staff_notes_enabled: "Povolit redaktorům připojit poznámku k uživatelům" user_notes_enabled: "Povolit redaktorům připojit poznámku k uživatelům"
staff_notes: staff_notes:
official_warning: "Obdrženo oficiální varování od @%{username} -- %{warning_link}" official_warning: "Obdrženo oficiální varování od @%{username} -- %{warning_link}"
user_suspended: "@%{username} zakázal tento účet do %{suspended_till}. Důvod: %{reason}" user_suspended: "@%{username} zakázal tento účet do %{suspended_till}. Důvod: %{reason}"

View File

@ -7,7 +7,7 @@
de: de:
site_settings: site_settings:
staff_notes_enabled: "Erlaube dem Team, Benutzer mit Notizen zu versehen" user_notes_enabled: "Erlaube dem Team, Benutzer mit Notizen zu versehen"
staff_notes: staff_notes:
official_warning: "Hat eine offizielle Warnung erhalten von @%{username} -- %{warning_link}" official_warning: "Hat eine offizielle Warnung erhalten von @%{username} -- %{warning_link}"
user_suspended: "@%{username} hat dieses Konto gesperrt bis %{suspended_till}. Grund: %{reason}" user_suspended: "@%{username} hat dieses Konto gesperrt bis %{suspended_till}. Grund: %{reason}"

View File

@ -1,7 +1,7 @@
en: en:
site_settings: site_settings:
staff_notes_enabled: "Allow staff users to attach notes to users" user_notes_enabled: "Allow staff users to attach notes to users"
staff_notes_moderators_delete: "Allow moderators to delete user notes" user_notes_moderators_delete: "Allow moderators to delete user notes"
staff_notes: staff_notes:
official_warning: "Received an official warning from @%{username} -- %{warning_link}" official_warning: "Received an official warning from @%{username} -- %{warning_link}"

View File

@ -7,7 +7,7 @@
es: es:
site_settings: site_settings:
staff_notes_enabled: "Permitir a los usuarios del staff adjuntar notas a los usuarios" user_notes_enabled: "Permitir a los usuarios del staff adjuntar notas a los usuarios"
staff_notes: staff_notes:
official_warning: "Recibiste una advertencia oficial de @%{username} -- %{warning_link}" official_warning: "Recibiste una advertencia oficial de @%{username} -- %{warning_link}"
user_suspended: "@%{username} suspendió esta cuenta hasta %{suspended_till}. Razón: %{reason}" user_suspended: "@%{username} suspendió esta cuenta hasta %{suspended_till}. Razón: %{reason}"

View File

@ -7,7 +7,7 @@
fi: fi:
site_settings: site_settings:
staff_notes_enabled: "Salli henkilökunnan lisätä huomioita käyttäjiin liittyen" user_notes_enabled: "Salli henkilökunnan lisätä huomioita käyttäjiin liittyen"
staff_notes: staff_notes:
official_warning: "%{username} antoi virallisen varoituksen - %{warning_link}" official_warning: "%{username} antoi virallisen varoituksen - %{warning_link}"
user_suspended: "@%{username} hyllytti käyttäjätilin %{suspended_till} asti. Syy: %{reason}" user_suspended: "@%{username} hyllytti käyttäjätilin %{suspended_till} asti. Syy: %{reason}"

View File

@ -7,7 +7,7 @@
fr: fr:
site_settings: site_settings:
staff_notes_enabled: "Permettre aux responsables d'associer des notes aux utilisateurs" user_notes_enabled: "Permettre aux responsables d'associer des notes aux utilisateurs"
staff_notes: staff_notes:
official_warning: "A reçu un avertissement officiel de @%{username} -- %{warning_link}" official_warning: "A reçu un avertissement officiel de @%{username} -- %{warning_link}"
user_suspended: "@%{username} a suspendu ce compte jusqu'à %{suspended_till}. Raison : %{reason}" user_suspended: "@%{username} a suspendu ce compte jusqu'à %{suspended_till}. Raison : %{reason}"

View File

@ -7,8 +7,8 @@
he: he:
site_settings: site_settings:
staff_notes_enabled: "לאפשר למשתמשי הצוות לצרף הערות למשתמשים" user_notes_enabled: "לאפשר למשתמשי הצוות לצרף הערות למשתמשים"
staff_notes_moderators_delete: "לאפשר למפקחים למחוק הערות משתמש" user_notes_moderators_delete: "לאפשר למפקחים למחוק הערות משתמש"
staff_notes: staff_notes:
official_warning: "התקבלה אזהרה רשמית מאת @%{username} -- %{warning_link}" official_warning: "התקבלה אזהרה רשמית מאת @%{username} -- %{warning_link}"
user_suspended: "חשבון זה הושעה על ידי @%{username} עד %{suspended_till}. סיבה: %{reason}" user_suspended: "חשבון זה הושעה על ידי @%{username} עד %{suspended_till}. סיבה: %{reason}"

View File

@ -7,7 +7,7 @@
hu: hu:
site_settings: site_settings:
staff_notes_enabled: "Megjegyzések hozzáadása a felhasználókhoz engedélyezése a személyzeti felhasználóknak" user_notes_enabled: "Megjegyzések hozzáadása a felhasználókhoz engedélyezése a személyzeti felhasználóknak"
staff_notes: staff_notes:
official_warning: "Hivatalos figyelmeztetést kaptál a következő felhasználótól @%{username} -- %{warning_link}" official_warning: "Hivatalos figyelmeztetést kaptál a következő felhasználótól @%{username} -- %{warning_link}"
user_suspended: "@%{username} felfüggesztette ezt a fiókot a következő ideig, %{suspended_till}. Ok: %{reason}" user_suspended: "@%{username} felfüggesztette ezt a fiókot a következő ideig, %{suspended_till}. Ok: %{reason}"

View File

@ -7,7 +7,7 @@
hy: hy:
site_settings: site_settings:
staff_notes_enabled: "Թույլատրել անձնակազմի անդամներին կցել նշումներ օգտատերերին" user_notes_enabled: "Թույլատրել անձնակազմի անդամներին կցել նշումներ օգտատերերին"
staff_notes: staff_notes:
official_warning: "Ստացել է պաշտոնական զգուշացում @%{username} -ից -- %{warning_link}" official_warning: "Ստացել է պաշտոնական զգուշացում @%{username} -ից -- %{warning_link}"
user_suspended: "@%{username} -ը սառեցրել է հաշիվը մինչև %{suspended_till}: Պատճառը՝ %{reason}" user_suspended: "@%{username} -ը սառեցրել է հաշիվը մինչև %{suspended_till}: Պատճառը՝ %{reason}"

View File

@ -7,7 +7,7 @@
it: it:
site_settings: site_settings:
staff_notes_enabled: "Abilitare gli utenti dello staff ad allegare note agli utenti" user_notes_enabled: "Abilitare gli utenti dello staff ad allegare note agli utenti"
staff_notes: staff_notes:
official_warning: "Ha ricevuto un richiamo ufficiale da @%{username} -- %{warning_link}" official_warning: "Ha ricevuto un richiamo ufficiale da @%{username} -- %{warning_link}"
user_suspended: "@%{username} ha sospeso questo account fino a %{suspended_till}. Motivazione: %{reason}" user_suspended: "@%{username} ha sospeso questo account fino a %{suspended_till}. Motivazione: %{reason}"

View File

@ -7,7 +7,7 @@
ja: ja:
site_settings: site_settings:
staff_notes_enabled: "スタッフがユーザにメモを付けることを許可" user_notes_enabled: "スタッフがユーザにメモを付けることを許可"
staff_notes: staff_notes:
official_warning: "@%{username} -- %{warning_link} から、公式な警告を受けました" official_warning: "@%{username} -- %{warning_link} から、公式な警告を受けました"
user_suspended: "@%{username} \nこのアカウントは、%{suspended_till}まで無効化されました。\n理由:%{reason}" user_suspended: "@%{username} \nこのアカウントは、%{suspended_till}まで無効化されました。\n理由:%{reason}"

View File

@ -7,7 +7,7 @@
nb_NO: nb_NO:
site_settings: site_settings:
staff_notes_enabled: "Tillat staben å opprette notater på brukere" user_notes_enabled: "Tillat staben å opprette notater på brukere"
staff_notes: staff_notes:
official_warning: "Mottok en offisiell advarsel fra %{username} -- %{warning_link}" official_warning: "Mottok en offisiell advarsel fra %{username} -- %{warning_link}"
user_suspended: "@%{username} sperret denne kontoen til %{suspended_till}. Årsak: %{reason}" user_suspended: "@%{username} sperret denne kontoen til %{suspended_till}. Årsak: %{reason}"

View File

@ -7,7 +7,7 @@
nl: nl:
site_settings: site_settings:
staff_notes_enabled: "Stafgebruikers mogen notities aan gebruikers toevoegen" user_notes_enabled: "Stafgebruikers mogen notities aan gebruikers toevoegen"
staff_notes: staff_notes:
official_warning: "Heeft een officiële waarschuwing gekregen van @%{username} -- %{warning_link}" official_warning: "Heeft een officiële waarschuwing gekregen van @%{username} -- %{warning_link}"
user_suspended: "@%{username} heeft deze account geschorst tot %{suspended_till}. Reden: %{reason}" user_suspended: "@%{username} heeft deze account geschorst tot %{suspended_till}. Reden: %{reason}"

View File

@ -7,7 +7,7 @@
pl_PL: pl_PL:
site_settings: site_settings:
staff_notes_enabled: "Pozwól członkom zespołu dołączać uwagi do użytkowników" user_notes_enabled: "Pozwól członkom zespołu dołączać uwagi do użytkowników"
staff_notes: staff_notes:
official_warning: "Otrzymano oficjalne ostrzeżenie od @%{username} -- %{warning_link}" official_warning: "Otrzymano oficjalne ostrzeżenie od @%{username} -- %{warning_link}"
user_suspended: "@%{username} zawiesiłeś to konto do %{suspended_till}. Powód: %{reason}" user_suspended: "@%{username} zawiesiłeś to konto do %{suspended_till}. Powód: %{reason}"

View File

@ -7,7 +7,7 @@
pt: pt:
site_settings: site_settings:
staff_notes_enabled: "Permitir que os utilizadores da equipa anexem notas aos utilizadores" user_notes_enabled: "Permitir que os utilizadores da equipa anexem notas aos utilizadores"
staff_notes: staff_notes:
official_warning: "Recebeu um aviso oficial de @%{username} -- %{warning_link}" official_warning: "Recebeu um aviso oficial de @%{username} -- %{warning_link}"
reports: reports:

View File

@ -7,7 +7,7 @@
pt_BR: pt_BR:
site_settings: site_settings:
staff_notes_enabled: "Permitir que usuários da staff anexem notas aos usuários" user_notes_enabled: "Permitir que usuários da staff anexem notas aos usuários"
staff_notes: staff_notes:
official_warning: "Recebido um aviso oficial de @%{username} -- %{warning_link}" official_warning: "Recebido um aviso oficial de @%{username} -- %{warning_link}"
user_suspended: "@%{username} suspendeu esta conta até %{suspended_till}. Motivo: %{reason}" user_suspended: "@%{username} suspendeu esta conta até %{suspended_till}. Motivo: %{reason}"

View File

@ -7,7 +7,7 @@
ru: ru:
site_settings: site_settings:
staff_notes_enabled: "Разрешить персоналу прикреплять заметки к пользователям" user_notes_enabled: "Разрешить персоналу прикреплять заметки к пользователям"
staff_notes: staff_notes:
official_warning: "Получено официальное предупреждение от @%{username} -- %{warning_link}" official_warning: "Получено официальное предупреждение от @%{username} -- %{warning_link}"
user_suspended: "@%{username} приостановил этот аккаунт до %{suspended_till}. Причина: %{reason}" user_suspended: "@%{username} приостановил этот аккаунт до %{suspended_till}. Причина: %{reason}"

View File

@ -7,7 +7,7 @@
sk: sk:
site_settings: site_settings:
staff_notes_enabled: "Umožniť personálu napísať poznámku k používateľom" user_notes_enabled: "Umožniť personálu napísať poznámku k používateľom"
reports: reports:
staff_notes: staff_notes:
labels: labels:

View File

@ -7,7 +7,7 @@
sl: sl:
site_settings: site_settings:
staff_notes_enabled: "Omogoči opombe osebja na uporabniku" user_notes_enabled: "Omogoči opombe osebja na uporabniku"
staff_notes: staff_notes:
official_warning: "Prejel uradno opozorilo od @%{username} -- %{warning_link}" official_warning: "Prejel uradno opozorilo od @%{username} -- %{warning_link}"
user_suspended: "@%{username} supendiral ta račun do %{suspended_till}. Razlog: %{reason}" user_suspended: "@%{username} supendiral ta račun do %{suspended_till}. Razlog: %{reason}"

View File

@ -7,7 +7,7 @@
sw: sw:
site_settings: site_settings:
staff_notes_enabled: "Waruhusu wasaidizi waambatanishe madokezo kwa watumiaji" user_notes_enabled: "Waruhusu wasaidizi waambatanishe madokezo kwa watumiaji"
staff_notes: staff_notes:
official_warning: "Umepokea onyo kutoka kwa @%{username} -- %{warning_link}" official_warning: "Umepokea onyo kutoka kwa @%{username} -- %{warning_link}"
user_suspended: "@%{username}amesimamisha akaunti yake mpaka %{suspended_till}. Sababu:%{reason}" user_suspended: "@%{username}amesimamisha akaunti yake mpaka %{suspended_till}. Sababu:%{reason}"

View File

@ -7,7 +7,7 @@
tr_TR: tr_TR:
site_settings: site_settings:
staff_notes_enabled: "Personel kullanıcılarının, kullanıcılara not eklemesine izin ver" user_notes_enabled: "Personel kullanıcılarının, kullanıcılara not eklemesine izin ver"
reports: reports:
staff_notes: staff_notes:
labels: labels:

View File

@ -7,8 +7,8 @@
ur: ur:
site_settings: site_settings:
staff_notes_enabled: "اسٹاف صارفین کو صارفین کیساتھ نوٹ منسلک کرنے کی اجازت دیں" user_notes_enabled: "اسٹاف صارفین کو صارفین کیساتھ نوٹ منسلک کرنے کی اجازت دیں"
staff_notes_moderators_delete: "منتظمین کو صارف نوٹس حذف کرنے کی اجازت دیں" user_notes_moderators_delete: "منتظمین کو صارف نوٹس حذف کرنے کی اجازت دیں"
staff_notes: staff_notes:
official_warning: "@%{username} کی طرف سے ایک آفیشل انتباہ ملی -- %{warning_link}" official_warning: "@%{username} کی طرف سے ایک آفیشل انتباہ ملی -- %{warning_link}"
user_suspended: "@%{username}نے یہ اکاؤنٹ %{suspended_till}تک معطل کر دیا۔ وجہ: %{reason} " user_suspended: "@%{username}نے یہ اکاؤنٹ %{suspended_till}تک معطل کر دیا۔ وجہ: %{reason} "

View File

@ -7,8 +7,8 @@
zh_CN: zh_CN:
site_settings: site_settings:
staff_notes_enabled: "允许管理人员将注释附加到用户" user_notes_enabled: "允许管理人员将注释附加到用户"
staff_notes_moderators_delete: "允许版主删除用户注释" user_notes_moderators_delete: "允许版主删除用户注释"
staff_notes: staff_notes:
official_warning: "收到来自 @%{username}的正式警告 - %{warning_link}" official_warning: "收到来自 @%{username}的正式警告 - %{warning_link}"
user_suspended: "@%{username}暂停此帐户,直到%{suspended_till}。 原因:%{reason}" user_suspended: "@%{username}暂停此帐户,直到%{suspended_till}。 原因:%{reason}"

View File

@ -1,7 +1,7 @@
plugins: plugins:
staff_notes_enabled: user_notes_enabled:
default: false default: false
client: true client: true
staff_notes_moderators_delete: user_notes_moderators_delete:
default: true default: true
client: false client: false

View File

@ -1,12 +1,12 @@
# frozen_string_literal: true # frozen_string_literal: true
# name: discourse-staff-notes # name: discourse-user-notes
# about: Gives the ability for staff members to attach notes to users # about: Gives the ability for staff members to attach notes to users
# version: 0.0.2 # version: 0.0.2
# authors: Robin Ward # authors: Robin Ward
# url: https://github.com/discourse/discourse-staff-notes # url: https://github.com/discourse/discourse-staff-notes
enabled_site_setting :staff_notes_enabled enabled_site_setting :user_notes_enabled
register_asset 'stylesheets/staff_notes.scss' register_asset 'stylesheets/staff_notes.scss'
@ -203,7 +203,7 @@ after_initialize do
whitelist_staff_user_custom_field(STAFF_NOTE_COUNT_FIELD) whitelist_staff_user_custom_field(STAFF_NOTE_COUNT_FIELD)
add_to_class(Guardian, :can_delete_staff_notes?) do add_to_class(Guardian, :can_delete_staff_notes?) do
(SiteSetting.staff_notes_moderators_delete? && user.staff?) || user.admin? (SiteSetting.user_notes_moderators_delete? && user.staff?) || user.admin?
end end
add_to_serializer(:admin_detailed_user, :staff_notes_count, false) do add_to_serializer(:admin_detailed_user, :staff_notes_count, false) do

View File

@ -9,7 +9,7 @@ describe UserHistory do
describe 'when a user suspension log is created' do describe 'when a user suspension log is created' do
context "staff notes plugin is enabled" do context "staff notes plugin is enabled" do
before do before do
SiteSetting.staff_notes_enabled = true SiteSetting.user_notes_enabled = true
end end
it "should create staff note for suspension" do it "should create staff note for suspension" do

View File

@ -10,7 +10,7 @@ describe UserWarning do
describe 'when a user warning is created' do describe 'when a user warning is created' do
context "staff notes plugin is enabled" do context "staff notes plugin is enabled" do
before do before do
SiteSetting.staff_notes_enabled = true SiteSetting.user_notes_enabled = true
end end
it "should create staff note for warning" do it "should create staff note for warning" do