Skip to content

Commit

Permalink
enhance: 設定したタグをトレンドに表示させないようにする項目を管理画面で設定できるように (misskey-dev#12512)
Browse files Browse the repository at this point in the history
* enhance: hiddenTagsを管理画面で設定できるように

* Update locales/ja-JP.yml

Co-authored-by: syuilo <[email protected]>

---------

Co-authored-by: syuilo <[email protected]>
  • Loading branch information
2 people authored and anatawa12 committed Nov 30, 2023
1 parent 986c528 commit 25304f8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,8 @@ export interface Locale {
"sensitiveWords": string;
"sensitiveWordsDescription": string;
"sensitiveWordsDescription2": string;
"hiddenTags": string;
"hiddenTagsDescription": string;
"notesSearchNotAvailable": string;
"license": string;
"unfavoriteConfirm": string;
Expand Down
2 changes: 2 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,8 @@ resetPasswordConfirm: "パスワードリセットしますか?"
sensitiveWords: "センシティブワード"
sensitiveWordsDescription: "設定したワードが含まれるノートの公開範囲をホームにします。改行で区切って複数設定できます。"
sensitiveWordsDescription2: "スペースで区切るとAND指定になり、キーワードをスラッシュで囲むと正規表現になります。"
hiddenTags: "非表示ハッシュタグ"
hiddenTagsDescription: "設定したタグをトレンドに表示させないようにします。改行で区切って複数設定できます。"
notesSearchNotAvailable: "ノート検索は利用できません。"
license: "ライセンス"
unfavoriteConfirm: "お気に入り解除しますか?"
Expand Down
8 changes: 8 additions & 0 deletions packages/frontend/src/pages/admin/moderation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts.sensitiveWords }}</template>
<template #caption>{{ i18n.ts.sensitiveWordsDescription }}<br>{{ i18n.ts.sensitiveWordsDescription2 }}</template>
</MkTextarea>

<MkTextarea v-model="hiddenTags">
<template #label>{{ i18n.ts.hiddenTags }}</template>
<template #caption>{{ i18n.ts.hiddenTagsDescription }}</template>
</MkTextarea>
</div>
</FormSuspense>
</MkSpacer>
Expand Down Expand Up @@ -72,6 +77,7 @@ import FormLink from '@/components/form/link.vue';
let enableRegistration: boolean = $ref(false);
let emailRequiredForSignup: boolean = $ref(false);
let sensitiveWords: string = $ref('');
let hiddenTags: string = $ref('');
let preservedUsernames: string = $ref('');
let tosUrl: string | null = $ref(null);
let privacyPolicyUrl: string | null = $ref(null);
Expand All @@ -81,6 +87,7 @@ async function init() {
enableRegistration = !meta.disableRegistration;
emailRequiredForSignup = meta.emailRequiredForSignup;
sensitiveWords = meta.sensitiveWords.join('\n');
hiddenTags = meta.hiddenTags.join('\n');
preservedUsernames = meta.preservedUsernames.join('\n');
tosUrl = meta.tosUrl;
privacyPolicyUrl = meta.privacyPolicyUrl;
Expand All @@ -93,6 +100,7 @@ function save() {
tosUrl,
privacyPolicyUrl,
sensitiveWords: sensitiveWords.split('\n'),
hiddenTags: hiddenTags.split('\n'),
preservedUsernames: preservedUsernames.split('\n'),
}).then(() => {
fetchInstance();
Expand Down

0 comments on commit 25304f8

Please sign in to comment.