Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ added button to delete all pending notifications #993

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions client/src/components/Header/NotificationsStep.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => {
[onDelete],
);

const handleDeleteAll = useCallback(() => {
items.forEach((item) => {
onDelete(item.id);
});
}, [items, onDelete]);

const renderItemContent = useCallback(
({ activity, card }) => {
switch (activity.type) {
Expand Down Expand Up @@ -85,6 +91,15 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => {
<Popup.Content>
{items.length > 0 ? (
<div className={styles.wrapper}>
{items.length > 1 && (
<Button
type="button"
icon="trash alternate outline"
content={t('action.deleteNotifications')}
onClick={handleDeleteAll}
className={styles.deleteAllButton}
/>
)}
{items.map((item) => (
<div key={item.id} className={styles.item}>
{item.card && item.activity ? (
Expand Down
15 changes: 15 additions & 0 deletions client/src/components/Header/NotificationsStep.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,19 @@
border-radius: 3px;
}
}

.deleteAllButton {
background: transparent;
box-shadow: none;
transition: background 0.3s ease;

display: block;
margin: 0 auto;
padding: 0.5em 1em;
font-size: 0.875em;

&:hover {
background: #e9e9e9;
}
}
}
1 change: 1 addition & 0 deletions client/src/locales/ar-YE/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export default {
deleteLabel: 'حذف الملصق',
deleteList: 'حذف القائمة',
deleteList_title: 'حذف القائمة',
deleteNotifications: 'Dismiss all',
deleteProject: 'حذف المشروع',
deleteProject_title: 'حذف المشروع',
deleteTask: 'حذف المهمة',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/bg-BG/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export default {
deleteLabel: 'Изтриване на етикета',
deleteList: 'Изтриване на списък',
deleteList_title: 'Изтриване на списък',
deleteNotifications: 'Dismiss all',
deleteProject: 'Изтриване на проект',
deleteProject_title: 'Изтриване на проект',
deleteTask: 'Изтриване на задача',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/cs-CZ/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export default {
deleteLabel: 'Smazat štítek',
deleteList: 'Smazat seznam',
deleteList_title: 'Smazat seznam',
deleteNotifications: 'Dismiss all',
deleteProject: 'Smazat projekt',
deleteProject_title: 'Smazat projekt',
deleteTask: 'Smazat úkol',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/da-DK/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export default {
deleteLabel: 'Slet mærkat',
deleteList: 'Slet liste',
deleteList_title: 'Slet liste',
deleteNotifications: 'Slet notifikationer',
deleteProject: 'Slet projekt',
deleteProject_title: 'Slet projekt',
deleteTask: 'Slet opgave',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/de-DE/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default {
deleteLabel: 'Label löschen',
deleteList: 'Liste löschen',
deleteList_title: 'Liste löschen',
deleteNotifications: 'Benachrichtigungen löschen',
deleteProject: 'Projekt löschen',
deleteProject_title: 'Projekt löschen',
deleteTask: 'Aufgabe löschen',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/en-GB/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export default {
deleteLabel: 'Delete label',
deleteList: 'Delete list',
deleteList_title: 'Delete List',
deleteNotifications: 'Dismiss all',
deleteProject: 'Delete project',
deleteProject_title: 'Delete Project',
deleteTask: 'Delete task',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/en-US/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export default {
deleteLabel: 'Delete label',
deleteList: 'Delete list',
deleteList_title: 'Delete List',
deleteNotifications: 'Dismiss all',
deleteProject: 'Delete project',
deleteProject_title: 'Delete Project',
deleteTask: 'Delete task',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/es-ES/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export default {
deleteLabel: 'Borrar etiqueta',
deleteList: 'Borrar lista',
deleteList_title: 'Borrar Lista',
deleteNotifications: 'Borrar notificaciones',
deleteProject: 'Borrar proyecto',
deleteProject_title: 'Borrar Proyecto',
deleteTask: 'Borrar tarea',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/fa-IR/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export default {
deleteLabel: 'حذف برچسب',
deleteList: 'حذف لیست',
deleteList_title: 'حذف لیست',
deleteNotifications: 'Dismiss all',
deleteProject: 'حذف پروژه',
deleteProject_title: 'حذف پروژه',
deleteTask: 'حذف وظیفه',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/fr-FR/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export default {
deleteLabel: "Supprimer l'étiquette",
deleteList: 'Supprimer la liste',
deleteList_title: 'Supprimer la liste',
deleteNotifications: 'Supprimer les notifications',
deleteProject: 'Supprimer le projet',
deleteProject_title: 'Supprimer le projet',
deleteTask: 'Supprimer la tâche',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/hu-HU/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export default {
deleteLabel: 'Címke törlése',
deleteList: 'Lista törlése',
deleteList_title: 'Lista törlése',
deleteNotifications: 'Dismiss all',
deleteProject: 'Projekt törlése',
deleteProject_title: 'Projekt törlése',
deleteTask: 'Feladat törlése',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/id-ID/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export default {
deleteLabel: 'Hapus labek',
deleteList: 'Hapus daftar',
deleteList_title: 'Hapus Daftar',
deleteNotifications: 'Dismiss all',
deleteProject: 'Hapus proyek',
deleteProject_title: 'Hapus Proyek',
deleteTask: 'Hapus tugas',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/it-IT/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export default {
deleteLabel: 'Elimina etichetta',
deleteList: 'Elimina lista',
deleteList_title: 'Elimina Lista',
deleteNotifications: 'Dismiss all',
deleteProject: 'Elimina progetto',
deleteProject_title: 'Elimina Progetto',
deleteTask: 'Elimina task',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/ja-JP/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export default {
deleteLabel: 'ラベルを削除',
deleteList: 'リストを削除',
deleteList_title: 'リストを削除',
deleteNotifications: 'Dismiss all',
deleteProject: 'プロジェクトを削除',
deleteProject_title: 'プロジェクトを削除',
deleteTask: 'タスクを削除',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/ko-KR/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export default {
deleteLabel: '라벨 삭제',
deleteList: '목록 삭제',
deleteList_title: '목록 삭제',
deleteNotifications: 'Dismiss all',
deleteProject: '프로젝트 삭제',
deleteProject_title: '프로젝트 삭제',
deleteTask: '업무 삭제',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/nl-NL/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export default {
deleteLabel: 'Label verwijderen',
deleteList: 'Lijst verwijderen',
deleteList_title: 'Lijst verwijderen',
deleteNotifications: 'Dismiss all',
deleteProject: 'Project verwijderen',
deleteProject_title: 'Project verwijderen',
deleteTask: 'Taak verwijderen',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/pl-PL/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export default {
deleteLabel: 'Usuń oznaczenie',
deleteList: 'Usuń listę',
deleteList_title: 'Usuń Listę',
deleteNotifications: 'Dismiss all',
deleteProject: 'Usuń projekt',
deleteProject_title: 'Usuń Projekt',
deleteTask: 'Usuń zadanie',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/pt-BR/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export default {
deleteLabel: 'Excluir rótulo',
deleteList: 'Excluir lista',
deleteList_title: 'Excluir Lista',
deleteNotifications: 'Dismiss all',
deleteProject: 'Excluir projeto',
deleteProject_title: 'Excluir Projeto',
deleteTask: 'Excluir tarefa',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/ro-RO/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export default {
deleteLabel: 'Ștergeți Eticheta',
deleteList: 'Ștergeți lista',
deleteList_title: 'Ștergeți Lista',
deleteNotifications: 'Dismiss all',
deleteProject: 'Ștergeți proiectul',
deleteProject_title: 'Ștergeți Proiectul',
deleteTask: 'Ștergeți sarcina',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/ru-RU/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export default {
deleteLabel: 'Удалить метку',
deleteList: 'Удалить список',
deleteList_title: 'Удалить список',
deleteNotifications: 'Dismiss all',
deleteProject: 'Удалить проект',
deleteProject_title: 'Удалить проект',
deleteTask: 'Удалить задачу',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/sk-SK/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export default {
deleteLabel: 'Zmazať štítok',
deleteList: 'Zmazať zoznam',
deleteList_title: 'Zmazať zoznam',
deleteNotifications: 'Dismiss all',
deleteProject: 'Zmazať projekt',
deleteProject_title: 'Zmazať projekt',
deleteTask: 'Zmazať úlohu',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/sr-Cyrl-CS/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export default {
deleteLabel: 'Обриши ознаку',
deleteList: 'Обриши списак',
deleteList_title: 'Обриши списак',
deleteNotifications: 'Dismiss all',
deleteProject: 'Обриши пројекат',
deleteProject_title: 'Обриши пројекат',
deleteTask: 'Обриши задатак',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/sr-Latn-CS/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export default {
deleteLabel: 'Obriši oznaku',
deleteList: 'Obriši spisak',
deleteList_title: 'Obriši spisak',
deleteNotifications: 'Dismiss all',
deleteProject: 'Obriši projekat',
deleteProject_title: 'Obriši projekat',
deleteTask: 'Obriši zadatak',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/sv-SE/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export default {
deleteLabel: 'Ta bort etikett',
deleteList: 'Ta bort lista',
deleteList_title: 'Ta Bort Lista',
deleteNotifications: 'Dismiss all',
deleteProject: 'Ta bort projekt',
deleteProject_title: 'Ta Bort Projekt',
deleteTask: 'Ta bort uppgift',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/tr-TR/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export default {
deleteLabel: 'Etiketi sil',
deleteList: 'Listeyi sil',
deleteList_title: 'Listeyi Sil',
deleteNotifications: 'Dismiss all',
deleteProject: 'Projeyi sil',
deleteProject_title: 'Projeyi Sil',
deleteTask: 'Görevi sil',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/uk-UA/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export default {
deleteLabel: 'Видалити мітку',
deleteList: 'Видалити список',
deleteList_title: 'Видалити Список',
deleteNotifications: 'Dismiss all',
deleteProject: 'Видалити проект',
deleteProject_title: 'Видалити Проект',
deleteTask: 'Видалити завдання',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/uz-UZ/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export default {
deleteLabel: "Yorliqni o'chirish",
deleteList: "Ro'yxatni o'chirish",
deleteList_title: "Ro'yxatni O'chirish",
deleteNotifications: 'Dismiss all',
deleteProject: "Loyihani o'chirish",
deleteProject_title: "Loyihani O'chirish",
deleteTask: "Vazifani o'chirish",
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/zh-CN/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export default {
deleteLabel: '删除标签',
deleteList: '删除列表',
deleteList_title: '删除列表',
deleteNotifications: 'Dismiss all',
deleteProject: '删除项目',
deleteProject_title: '删除项目',
deleteTask: '删除任务',
Expand Down
1 change: 1 addition & 0 deletions client/src/locales/zh-TW/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export default {
deleteLabel: '刪除標籤',
deleteList: '刪除列表',
deleteList_title: '刪除列表',
deleteNotifications: 'Dismiss all',
deleteProject: '刪除專案',
deleteProject_title: '刪除專案',
deleteTask: '刪除任務',
Expand Down
Loading