From 18771d4d734f2953ba69ea929f3de4ef77c79128 Mon Sep 17 00:00:00 2001 From: mei23 Date: Thu, 2 May 2019 14:44:39 +0900 Subject: [PATCH] =?UTF-8?q?=E6=8B=A1=E5=BC=B5=E9=80=9A=E7=9F=A5=E6=A9=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en-US.yml | 6 +++ locales/ja-JP.yml | 7 +++ .../common/scripts/compose-notification.ts | 7 +++ .../settings/extended-notification.vue | 47 +++++++++++++++++++ .../views/components/settings/settings.vue | 6 +++ .../common/views/deck/deck.notification.vue | 23 ++++++++- .../views/components/notifications.vue | 20 +++++++- .../app/desktop/views/components/settings.vue | 3 ++ .../views/components/notification-preview.vue | 12 ++++- .../mobile/views/components/notification.vue | 23 ++++++++- src/misc/get-notification-summary.ts | 2 + src/models/notification.ts | 3 +- src/server/api/endpoints/i/notifications.ts | 4 +- src/server/api/openapi/schemas.ts | 2 +- src/services/note/create.ts | 36 ++++++++++++-- 15 files changed, 189 insertions(+), 12 deletions(-) create mode 100644 src/client/app/common/views/components/settings/extended-notification.vue diff --git a/locales/en-US.yml b/locales/en-US.yml index 272710f3239b..a2fe510f6dd2 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -126,6 +126,7 @@ common: apps: "Apps" tags: "Hashtag" mute-and-block: "Mute / Block" + extended-notification: "Extra notification" blocking: "Block" security: "Security" signin: "Login History" @@ -976,6 +977,11 @@ common/views/components/mute-and-block.vue: muted-words: "Muted keywords" muted-words-description: "Separating with spaces results in AND specifications, and delimiting with line breaks results in OR specifications" save: "Save" +common/views/components/settings/extended-notification.vue: + extended-notification: "Extra notification" + highlighted-words: "Hightlighted words" + highlighted-words-description: "Enter the words you want to notify, one per line" + save: "Save" common/views/components/password-settings.vue: reset: "Change password" enter-current-password: "Enter the current password" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index fa8deec7d2c9..e1d65cca0ee1 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -136,6 +136,7 @@ common: apps: "アプリ" tags: "ハッシュタグ" mute-and-block: "ミュート/ブロック" + extended-notification: "拡張通知" blocking: "ブロック" security: "セキュリティ" signin: "ログイン履歴" @@ -1079,6 +1080,12 @@ common/views/components/mute-and-block.vue: muted-words-description: "スペースで区切るとAND指定になり、改行で区切るとOR指定になります" save: "保存" +common/views/components/settings/extended-notification.vue: + extended-notification: "拡張通知" + highlighted-words: "ハイライトワード" + highlighted-words-description: "通知したいワードを1行に1つずつ入力します" + save: "保存" + common/views/components/password-settings.vue: reset: "パスワードを変更する" enter-current-password: "現在のパスワードを入力してください" diff --git a/src/client/app/common/scripts/compose-notification.ts b/src/client/app/common/scripts/compose-notification.ts index ec854f2f4d74..4843248853b1 100644 --- a/src/client/app/common/scripts/compose-notification.ts +++ b/src/client/app/common/scripts/compose-notification.ts @@ -64,6 +64,13 @@ export default function(type, data): Notification { icon: data.user.avatarUrl }; + case 'highlight': + return { + title: `${getUserName(data.user)}:`, + body: getNoteSummary(data), + icon: data.user.avatarUrl + }; + default: return null; } diff --git a/src/client/app/common/views/components/settings/extended-notification.vue b/src/client/app/common/views/components/settings/extended-notification.vue new file mode 100644 index 000000000000..71378cdf61d6 --- /dev/null +++ b/src/client/app/common/views/components/settings/extended-notification.vue @@ -0,0 +1,47 @@ + + + diff --git a/src/client/app/common/views/components/settings/settings.vue b/src/client/app/common/views/components/settings/settings.vue index 21436f98157e..e191d57c0bd2 100644 --- a/src/client/app/common/views/components/settings/settings.vue +++ b/src/client/app/common/views/components/settings/settings.vue @@ -183,6 +183,10 @@ + +