Skip to content

Commit 05c7dc5

Browse files
committed
notification task code refactor + copy changes for UI
1 parent 75916ce commit 05c7dc5

File tree

10 files changed

+814
-605
lines changed

10 files changed

+814
-605
lines changed

apiserver/plane/bgtasks/notification_task.py

Lines changed: 677 additions & 545 deletions
Large diffs are not rendered by default.

packages/constants/src/notification.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,37 +157,45 @@ export const TASK_UPDATES_NOTIFICATION_SETTINGS: TNotificationSettings[] = [
157157
{
158158
key: ENotificationSettingsKey.PROPERTY_CHANGE,
159159
i18n_title: "notification_settings.work_item_property_title",
160+
i18n_subtitle: "notification_settings.work_item_property_subtitle",
160161
},
161162
{
162163
key: ENotificationSettingsKey.STATE_CHANGE,
163164
i18n_title: "notification_settings.status_title",
165+
i18n_subtitle: "notification_settings.status_subtitle",
164166
},
165167
{
166168
key: ENotificationSettingsKey.PRIORITY,
167169
i18n_title: "notification_settings.priority_title",
170+
i18n_subtitle: "notification_settings.priority_subtitle",
168171
},
169172
{
170173
key: ENotificationSettingsKey.ASSIGNEE,
171174
i18n_title: "notification_settings.assignee_title",
175+
i18n_subtitle: "notification_settings.assignee_subtitle",
172176
},
173177
{
174178
key: ENotificationSettingsKey.START_DUE_DATE,
175179
i18n_title: "notification_settings.due_date_title",
180+
i18n_subtitle: "notification_settings.due_date_subtitle",
176181
}
177182
]
178183

179184
export const COMMENT_NOTIFICATION_SETTINGS: TNotificationSettings[] = [
180185
{
181186
key: ENotificationSettingsKey.MENTIONED_COMMENTS,
182187
i18n_title: "notification_settings.mentioned_comments_title",
188+
i18n_subtitle: "notification_settings.mentioned_comments_subtitle",
183189
},
184190
{
185191
key: ENotificationSettingsKey.COMMENTS,
186192
i18n_title: "notification_settings.new_comments_title",
193+
i18n_subtitle: "notification_settings.new_comments_subtitle",
187194
},
188195
{
189196
key: ENotificationSettingsKey.COMMENT_REACTIONS,
190197
i18n_title: "notification_settings.reaction_comments_title",
198+
i18n_subtitle: "notification_settings.reaction_comments_subtitle",
191199
},
192200
]
193201

packages/i18n/src/locales/en/translations.json

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,23 +2183,33 @@
21832183
"notification_settings": {
21842184
"page_label": "{workspace} - Inbox settings",
21852185
"inbox_settings": "Inbox settings",
2186-
"inbox_settings_description": "Toggle these ON or OFF for the workspace",
2186+
"inbox_settings_description": "Customize how you receive notifications for activities in your workspace. Your changes are saved automatically.",
21872187
"advanced_settings": "Advanced settings",
21882188
"in_plane": "In Plane",
21892189
"email": "Email",
21902190
"slack": "Slack",
2191-
"task_updates": "Task updates",
2191+
"task_updates": "Work item updates",
2192+
"task_updates_subtitle": "Get notified when work items in your workspace are updated.",
21922193
"comments": "Comments",
2193-
"work_item_property_title": "Update on any property of work item",
2194-
"status_title": "State update",
2195-
"priority_title": "Priority update",
2196-
"assignee_title": "Assignee update",
2197-
"due_date_title": "Start/Due date update",
2194+
"comments_subtitle": "Stay updated on discussions in your workspace.",
2195+
"work_item_property_title": "Update on any property of the work item",
2196+
"work_item_property_subtitle": "Get notified when work items in your workspace are updated.",
2197+
"status_title": "State change",
2198+
"status_subtitle": "When a work item's state is updated.",
2199+
"priority_title": "Priority change",
2200+
"priority_subtitle": "When a work item's priority level is adjusted.",
2201+
"assignee_title": "Assignee change",
2202+
"assignee_subtitle": "When a work item is assigned or reassigned to someone.",
2203+
"due_date_title": "Date change",
2204+
"due_date_subtitle": "When a work item's start or due date is updated.",
21982205
"module_title": "Module update",
21992206
"cycle_title": "Cycle update",
2200-
"mentioned_comments_title": "Comments I'm @mentioned in",
2207+
"mentioned_comments_title": "Mentions",
2208+
"mentioned_comments_subtitle": "When someone mentions you in a comment.",
22012209
"new_comments_title": "New comments",
2210+
"new_comments_subtitle": "When a new comment is added to a task you’re following.",
22022211
"reaction_comments_title": "Reactions",
2212+
"reaction_comments_subtitle": "Get notified when someone reacts to your comments or tasks with an emoji.",
22032213
"setting_updated_successfully": "Setting updated successfully",
22042214
"failed_to_update_setting": "Failed to update setting"
22052215
}

packages/i18n/src/locales/es/translations.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,26 +2350,36 @@
23502350
},
23512351

23522352
"notification_settings": {
2353-
"page_label": "{workspace} - Configuración de la bandeja de entrada",
2354-
"inbox_settings": "Configuración de la bandeja de entrada",
2355-
"inbox_settings_description": "Activa o desactiva estas opciones para el espacio de trabajo",
2353+
"page_label": "{workspace} - Configuración de bandeja de entrada",
2354+
"inbox_settings": "Configuración de bandeja de entrada",
2355+
"inbox_settings_description": "Personaliza cómo recibes notificaciones para actividades en tu espacio de trabajo. Tus cambios se guardan automáticamente.",
23562356
"advanced_settings": "Configuración avanzada",
23572357
"in_plane": "En Plane",
23582358
"email": "Correo electrónico",
23592359
"slack": "Slack",
2360-
"task_updates": "Actualizaciones de tareas",
2360+
"task_updates": "Actualizaciones de elementos de trabajo",
2361+
"task_updates_subtitle": "Recibe notificaciones cuando se actualicen elementos de trabajo en tu espacio de trabajo.",
23612362
"comments": "Comentarios",
2363+
"comments_subtitle": "Mantente actualizado sobre las discusiones en tu espacio de trabajo.",
23622364
"work_item_property_title": "Actualización de cualquier propiedad del elemento de trabajo",
2363-
"status_title": "Actualización de estado",
2364-
"priority_title": "Actualización de prioridad",
2365-
"assignee_title": "Actualización de asignado",
2366-
"due_date_title": "Actualización de fecha de inicio/vencimiento",
2365+
"work_item_property_subtitle": "Recibe notificaciones cuando se actualicen elementos de trabajo en tu espacio de trabajo.",
2366+
"status_title": "Cambio de estado",
2367+
"status_subtitle": "Cuando se actualiza el estado de un elemento de trabajo.",
2368+
"priority_title": "Cambio de prioridad",
2369+
"priority_subtitle": "Cuando se ajusta el nivel de prioridad de un elemento de trabajo.",
2370+
"assignee_title": "Cambio de asignación",
2371+
"assignee_subtitle": "Cuando un elemento de trabajo es asignado o reasignado a alguien.",
2372+
"due_date_title": "Cambio de fecha",
2373+
"due_date_subtitle": "Cuando se actualiza la fecha de inicio o vencimiento de un elemento de trabajo.",
23672374
"module_title": "Actualización de módulo",
23682375
"cycle_title": "Actualización de ciclo",
2369-
"mentioned_comments_title": "Comentarios en los que estoy @mencionado",
2376+
"mentioned_comments_title": "Menciones",
2377+
"mentioned_comments_subtitle": "Cuando alguien te menciona en un comentario.",
23702378
"new_comments_title": "Nuevos comentarios",
2379+
"new_comments_subtitle": "Cuando se agrega un nuevo comentario a una tarea que sigues.",
23712380
"reaction_comments_title": "Reacciones",
2372-
"setting_updated_successfully": "Configuración actualizada correctamente",
2373-
"failed_to_update_setting": "No se pudo actualizar la configuración"
2381+
"reaction_comments_subtitle": "Recibe notificaciones cuando alguien reacciona a tus comentarios o tareas con un emoji.",
2382+
"setting_updated_successfully": "Configuración actualizada con éxito",
2383+
"failed_to_update_setting": "Error al actualizar la configuración"
23742384
}
23752385
}

packages/i18n/src/locales/fr/translations.json

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,25 +2350,35 @@
23502350
},
23512351

23522352
"notification_settings": {
2353-
"page_label": "{workspace} - Paramètres de la boîte de réception",
2354-
"inbox_settings": "Paramètres de la boîte de réception",
2355-
"inbox_settings_description": "Activez ou désactivez ces options pour l'espace de travail",
2353+
"page_label": "{workspace} - Paramètres de boîte de réception",
2354+
"inbox_settings": "Paramètres de boîte de réception",
2355+
"inbox_settings_description": "Personnalisez la façon dont vous recevez des notifications pour les activités dans votre espace de travail. Vos modifications sont enregistrées automatiquement.",
23562356
"advanced_settings": "Paramètres avancés",
23572357
"in_plane": "Dans Plane",
23582358
"email": "E-mail",
23592359
"slack": "Slack",
2360-
"task_updates": "Mises à jour des tâches",
2360+
"task_updates": "Mises à jour des éléments de travail",
2361+
"task_updates_subtitle": "Soyez notifié lorsque des éléments de travail dans votre espace de travail sont mis à jour.",
23612362
"comments": "Commentaires",
2362-
"work_item_property_title": "Mise à jour de toute propriété de l'élément de travail",
2363-
"status_title": "Mise à jour de l'état",
2364-
"priority_title": "Mise à jour de la priorité",
2365-
"assignee_title": "Mise à jour de l'assigné",
2366-
"due_date_title": "Mise à jour de la date de début/d'échéance",
2367-
"module_title": "Mise à jour du module",
2368-
"cycle_title": "Mise à jour du cycle",
2369-
"mentioned_comments_title": "Commentaires où je suis @mentionné",
2363+
"comments_subtitle": "Restez informé des discussions dans votre espace de travail.",
2364+
"work_item_property_title": "Mise à jour de n'importe quelle propriété de l'élément de travail",
2365+
"work_item_property_subtitle": "Soyez notifié lorsque des éléments de travail dans votre espace de travail sont mis à jour.",
2366+
"status_title": "Changement d'état",
2367+
"status_subtitle": "Lorsque l'état d'un élément de travail est mis à jour.",
2368+
"priority_title": "Changement de priorité",
2369+
"priority_subtitle": "Lorsque le niveau de priorité d'un élément de travail est ajusté.",
2370+
"assignee_title": "Changement d'assignation",
2371+
"assignee_subtitle": "Lorsqu'un élément de travail est assigné ou réassigné à quelqu'un.",
2372+
"due_date_title": "Changement de date",
2373+
"due_date_subtitle": "Lorsque la date de début ou d'échéance d'un élément de travail est mise à jour.",
2374+
"module_title": "Mise à jour de module",
2375+
"cycle_title": "Mise à jour de cycle",
2376+
"mentioned_comments_title": "Mentions",
2377+
"mentioned_comments_subtitle": "Lorsque quelqu'un vous mentionne dans un commentaire.",
23702378
"new_comments_title": "Nouveaux commentaires",
2379+
"new_comments_subtitle": "Lorsqu'un nouveau commentaire est ajouté à une tâche que vous suivez.",
23712380
"reaction_comments_title": "Réactions",
2381+
"reaction_comments_subtitle": "Soyez notifié lorsque quelqu'un réagit à vos commentaires ou tâches avec un emoji.",
23722382
"setting_updated_successfully": "Paramètre mis à jour avec succès",
23732383
"failed_to_update_setting": "Échec de la mise à jour du paramètre"
23742384
}

packages/i18n/src/locales/ja/translations.json

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,23 +2352,33 @@
23522352
"notification_settings": {
23532353
"page_label": "{workspace} - 受信トレイ設定",
23542354
"inbox_settings": "受信トレイ設定",
2355-
"inbox_settings_description": "ワークスペースのためにこれらをオンまたはオフに切り替えます",
2355+
"inbox_settings_description": "ワークスペースでのアクティビティに関する通知の受信方法をカスタマイズします。変更は自動的に保存されます。",
23562356
"advanced_settings": "詳細設定",
23572357
"in_plane": "Plane内",
23582358
"email": "メール",
23592359
"slack": "Slack",
2360-
"task_updates": "タスクの更新",
2360+
"task_updates": "作業項目の更新",
2361+
"task_updates_subtitle": "ワークスペース内の作業項目が更新されたときに通知を受け取ります。",
23612362
"comments": "コメント",
2362-
"work_item_property_title": "作業項目のプロパティの更新",
2363-
"status_title": "状態の更新",
2364-
"priority_title": "優先度の更新",
2365-
"assignee_title": "担当者の更新",
2366-
"due_date_title": "開始日/期日の更新",
2367-
"module_title": "モジュールの更新",
2368-
"cycle_title": "サイクルの更新",
2369-
"mentioned_comments_title": "自分が@メンションされたコメント",
2363+
"comments_subtitle": "ワークスペース内のディスカッションに関する最新情報を入手します。",
2364+
"work_item_property_title": "作業項目のあらゆるプロパティの更新",
2365+
"work_item_property_subtitle": "ワークスペース内の作業項目が更新されたときに通知を受け取ります。",
2366+
"status_title": "状態変更",
2367+
"status_subtitle": "作業項目の状態が更新されたとき。",
2368+
"priority_title": "優先度変更",
2369+
"priority_subtitle": "作業項目の優先度レベルが調整されたとき。",
2370+
"assignee_title": "担当者変更",
2371+
"assignee_subtitle": "作業項目が誰かに割り当てられたり再割り当てされたとき。",
2372+
"due_date_title": "日付変更",
2373+
"due_date_subtitle": "作業項目の開始日または期日が更新されたとき。",
2374+
"module_title": "モジュール更新",
2375+
"cycle_title": "サイクル更新",
2376+
"mentioned_comments_title": "メンション",
2377+
"mentioned_comments_subtitle": "誰かがコメントであなたに言及したとき。",
23702378
"new_comments_title": "新しいコメント",
2379+
"new_comments_subtitle": "フォローしているタスクに新しいコメントが追加されたとき。",
23712380
"reaction_comments_title": "リアクション",
2381+
"reaction_comments_subtitle": "誰かがあなたのコメントやタスクに絵文字でリアクションしたときに通知を受け取ります。",
23722382
"setting_updated_successfully": "設定が正常に更新されました",
23732383
"failed_to_update_setting": "設定の更新に失敗しました"
23742384
}

packages/i18n/src/locales/zh-CN/translations.json

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,24 +2352,34 @@
23522352
"notification_settings": {
23532353
"page_label": "{workspace} - 收件箱设置",
23542354
"inbox_settings": "收件箱设置",
2355-
"inbox_settings_description": "为工作空间打开或关闭这些选项",
2355+
"inbox_settings_description": "自定义如何接收工作空间活动的通知。您的更改会自动保存。",
23562356
"advanced_settings": "高级设置",
2357-
"in_plane": "在 Plane",
2357+
"in_plane": "在Plane中",
23582358
"email": "电子邮件",
23592359
"slack": "Slack",
2360-
"task_updates": "任务更新",
2360+
"task_updates": "工作项更新",
2361+
"task_updates_subtitle": "当您工作空间中的工作项被更新时获得通知。",
23612362
"comments": "评论",
2362-
"work_item_property_title": "工作项属性更新",
2363-
"status_title": "状态更新",
2364-
"priority_title": "优先级更新",
2365-
"assignee_title": "负责人更新",
2366-
"due_date_title": "开始/截止日期更新",
2363+
"comments_subtitle": "随时了解您工作空间中的讨论。",
2364+
"work_item_property_title": "工作项任何属性的更新",
2365+
"work_item_property_subtitle": "当您工作空间中的工作项被更新时获得通知。",
2366+
"status_title": "状态变更",
2367+
"status_subtitle": "当工作项的状态被更新时。",
2368+
"priority_title": "优先级变更",
2369+
"priority_subtitle": "当工作项的优先级被调整时。",
2370+
"assignee_title": "负责人变更",
2371+
"assignee_subtitle": "当工作项被分配或重新分配给某人时。",
2372+
"due_date_title": "日期变更",
2373+
"due_date_subtitle": "当工作项的开始日期或截止日期被更新时。",
23672374
"module_title": "模块更新",
23682375
"cycle_title": "周期更新",
2369-
"mentioned_comments_title": "我被@提及的评论",
2376+
"mentioned_comments_title": "提及",
2377+
"mentioned_comments_subtitle": "当有人在评论中提及您时。",
23702378
"new_comments_title": "新评论",
2379+
"new_comments_subtitle": "当您关注的任务添加了新评论时。",
23712380
"reaction_comments_title": "反应",
2372-
"setting_updated_successfully": "设置已成功更新",
2381+
"reaction_comments_subtitle": "当有人用表情符号对您的评论或任务做出反应时获得通知。",
2382+
"setting_updated_successfully": "设置更新成功",
23732383
"failed_to_update_setting": "设置更新失败"
23742384
}
23752385
}

packages/types/src/notification.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ENotificationSettingsKey, EWorkspaceNotificationTransport } from "@plan
22

33
export type TNotificationSettings = {
44
i18n_title: string,
5+
i18n_subtitle?: string,
56
key: ENotificationSettingsKey
67
}
78

web/core/components/inbox/settings/root.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ export const InboxSettingsRoot: FC = () => {
1212
return (
1313
<>
1414
<div className="flex flex-col gap-5 pt-4 pb-10 border-b border-custom-border-100">
15-
<div className="text-lg font-normal text-custom-text-100">
16-
{t("notification_settings.task_updates")}
15+
<div className="flex flex-col gap-1">
16+
<div className="text-lg font-normal text-custom-text-100">
17+
{t("notification_settings.task_updates")}
18+
</div>
19+
<div className="text-sm text-custom-text-350">
20+
{t("notification_settings.task_updates_subtitle")}
21+
</div>
1722
</div>
1823
<div className="grid gap-4 grid-cols-[50%_repeat(auto-fit,minmax(0,1fr))] text-sm text-custom-text-350 font-semibold">
1924
<div>{t("notification_settings.advanced_settings")}</div>
@@ -22,13 +27,18 @@ export const InboxSettingsRoot: FC = () => {
2227
</div>
2328
{
2429
TASK_UPDATES_NOTIFICATION_SETTINGS?.map((item) => (
25-
<InboxSettingUpdateRow key={item.key} settings_key={item.key} title={item.i18n_title} />
30+
<InboxSettingUpdateRow key={item.key} settings_key={item.key} title={item.i18n_title} subtitle={item.i18n_subtitle} />
2631
))
2732
}
2833
</div>
2934
<div className="flex flex-col gap-5 py-4">
30-
<div className="text-lg font-normal text-custom-text-100">
31-
{t("notification_settings.comments")}
35+
<div className="flex flex-col gap-1">
36+
<div className="text-lg font-normal text-custom-text-100">
37+
{t("notification_settings.comments")}
38+
</div>
39+
<div className="text-sm text-custom-text-350">
40+
{t("notification_settings.comments_subtitle")}
41+
</div>
3242
</div>
3343
<div className="grid gap-4 grid-cols-[50%_repeat(auto-fit,minmax(0,1fr))] text-sm text-custom-text-350 font-semibold">
3444
<div>{t("notification_settings.advanced_settings")}</div>
@@ -37,7 +47,7 @@ export const InboxSettingsRoot: FC = () => {
3747
</div>
3848
{
3949
COMMENT_NOTIFICATION_SETTINGS?.map((item, index) => (
40-
<InboxSettingUpdateRow key={index} settings_key={item.key} title={item.i18n_title} />
50+
<InboxSettingUpdateRow key={index} settings_key={item.key} title={item.i18n_title} subtitle={item.i18n_subtitle} />
4151
))
4252
}
4353
</div>

web/core/components/inbox/settings/update-setting-row.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,25 @@ import { InboxSettingUpdate } from "./update-setting";
99
type InboxSettingUpdateRowProps = {
1010
settings_key: ENotificationSettingsKey;
1111
title: string;
12+
subtitle?: string
1213
}
1314

1415
export const InboxSettingUpdateRow: FC<InboxSettingUpdateRowProps> = observer((props: InboxSettingUpdateRowProps) => {
15-
const { title, settings_key } = props;
16+
const { title, subtitle, settings_key } = props;
1617

1718
const { t } = useTranslation()
1819

1920
return (
2021
<div className="w-full grid gap-4 grid-cols-[50%_repeat(auto-fit,minmax(0,1fr))]">
21-
<div className="text-base font-normal text-custom-text-200">
22-
{t(title)}
22+
<div className="flex flex-col gap-1">
23+
<div className="text-base font-normal text-custom-text-200">
24+
{t(title)}
25+
</div>
26+
{
27+
subtitle && <div className="text-sm text-custom-text-350">
28+
{t(subtitle)}
29+
</div>
30+
}
2331
</div>
2432
<div className="">
2533
<InboxSettingUpdate transport={EWorkspaceNotificationTransport.IN_APP} settings_key={settings_key} />

0 commit comments

Comments
 (0)