From 509892b6caee6c4ca8384fb0090122ced98edfd4 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 10 Feb 2020 12:40:38 +0100 Subject: [PATCH] refactor DeleteData template and CSS --- .../components/DeleteData/DeleteData.spec.js | 12 +- webapp/components/DeleteData/DeleteData.vue | 231 ++++++------------ webapp/locales/de.json | 4 +- webapp/locales/en.json | 4 +- webapp/locales/es.json | 4 +- webapp/locales/fr.json | 4 +- webapp/locales/it.json | 4 +- webapp/locales/pl.json | 4 +- webapp/locales/pt.json | 4 +- webapp/locales/ru.json | 4 +- 10 files changed, 96 insertions(+), 179 deletions(-) diff --git a/webapp/components/DeleteData/DeleteData.spec.js b/webapp/components/DeleteData/DeleteData.spec.js index 3529c1b7b..e9205fa5a 100644 --- a/webapp/components/DeleteData/DeleteData.spec.js +++ b/webapp/components/DeleteData/DeleteData.spec.js @@ -88,7 +88,7 @@ describe('DeleteData.vue', () => { describe('calls the delete user mutation', () => { beforeEach(() => { - enableDeletionInput = wrapper.find('.enable-deletion-input input') + enableDeletionInput = wrapper.find('.ds-input') enableDeletionInput.setValue(deleteAccountName) deleteAccountBtn = wrapper.find('[data-test="delete-button"]') }) @@ -107,7 +107,7 @@ describe('DeleteData.vue', () => { it("deletes a user's posts if requested", () => { mocks.$t.mockImplementation(() => deleteContributionsMessage) - enableContributionDeletionCheckbox = wrapper.findAll('.checkbox-container input').at(0) + enableContributionDeletionCheckbox = wrapper.findAll('input[type="checkbox"]').at(0) enableContributionDeletionCheckbox.trigger('click') deleteAccountBtn.trigger('click') expect(mocks.$apollo.mutate).toHaveBeenCalledWith( @@ -122,7 +122,7 @@ describe('DeleteData.vue', () => { it("deletes a user's comments if requested", () => { mocks.$t.mockImplementation(() => deleteCommentsMessage) - enableCommentDeletionCheckbox = wrapper.findAll('.checkbox-container input').at(1) + enableCommentDeletionCheckbox = wrapper.findAll('input[type="checkbox"]').at(1) enableCommentDeletionCheckbox.trigger('click') deleteAccountBtn.trigger('click') expect(mocks.$apollo.mutate).toHaveBeenCalledWith( @@ -137,10 +137,10 @@ describe('DeleteData.vue', () => { it("deletes a user's posts and comments if requested", () => { mocks.$t.mockImplementation(() => deleteContributionsMessage) - enableContributionDeletionCheckbox = wrapper.findAll('.checkbox-container input').at(0) + enableContributionDeletionCheckbox = wrapper.findAll('input[type="checkbox"]').at(0) enableContributionDeletionCheckbox.trigger('click') mocks.$t.mockImplementation(() => deleteCommentsMessage) - enableCommentDeletionCheckbox = wrapper.findAll('.checkbox-container input').at(1) + enableCommentDeletionCheckbox = wrapper.findAll('input[type="checkbox"]').at(1) enableCommentDeletionCheckbox.trigger('click') deleteAccountBtn.trigger('click') expect(mocks.$apollo.mutate).toHaveBeenCalledWith( @@ -166,7 +166,7 @@ describe('DeleteData.vue', () => { describe('error handling', () => { it('shows an error toaster when the mutation rejects', async () => { - enableDeletionInput = wrapper.find('.enable-deletion-input input') + enableDeletionInput = wrapper.find('.ds-input') enableDeletionInput.setValue(deleteAccountName) await Vue.nextTick() deleteAccountBtn = wrapper.find('[data-test="delete-button"]') diff --git a/webapp/components/DeleteData/DeleteData.vue b/webapp/components/DeleteData/DeleteData.vue index 66a31205a..699fe9b8e 100644 --- a/webapp/components/DeleteData/DeleteData.vue +++ b/webapp/components/DeleteData/DeleteData.vue @@ -1,80 +1,46 @@ + + diff --git a/webapp/locales/de.json b/webapp/locales/de.json index d552d51ba..5b83e4090 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -119,9 +119,9 @@ "contributionsCount": "Meine {count} Beiträge löschen", "commentedCount": "Meine {count} Kommentare löschen", "accountDescription": "Sei dir bewusst, dass deine Beiträge und Kommentare für unsere Community wichtig sind. Wenn du sie trotzdem löschen möchtest, musst du sie unten markieren.", - "accountWarning": "Dein Konto, deine Beiträge oder Kommentare kannst du nach dem Löschen WEDER VERWALTEN NOCH WIEDERHERSTELLEN!<\/b>", + "accountWarning": "Dein Konto, deine Beiträge oder Kommentare kannst du nach dem Löschen WEDER VERWALTEN NOCH WIEDERHERSTELLEN!", "success": "Konto erfolgreich gelöscht!", - "pleaseConfirm": "Zerstörerische Aktion!<\/b> Gib {confirm}<\/b> ein, um zu bestätigen." + "pleaseConfirm": "Zerstörerische Aktion! Gib „{confirm}“ ein, um zu bestätigen." }, "embeds": { "name": "Drittanbieter", diff --git a/webapp/locales/en.json b/webapp/locales/en.json index d15614ecc..d8f359be5 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -278,9 +278,9 @@ "contributionsCount": "Delete my {count} posts", "commentedCount": "Delete my {count} comments", "accountDescription": "Be aware that your Posts and Comments are important to our community. If you still choose to delete them, you have to mark them below.", - "accountWarning": "You CAN'T MANAGE and CAN'T RECOVER your Account, Posts, or Comments after deleting your account!", + "accountWarning": "You CAN'T MANAGE and CAN'T RECOVER your Account, Posts, or Comments after deleting your account!", "success": "Account successfully deleted!", - "pleaseConfirm": "Destructive action! Type {confirm} to confirm" + "pleaseConfirm": "Destructive action! Type “{confirm}” to confirm." }, "embeds": { "name": "Third party providers", diff --git a/webapp/locales/es.json b/webapp/locales/es.json index f916f849b..18d67c7a4 100644 --- a/webapp/locales/es.json +++ b/webapp/locales/es.json @@ -117,9 +117,9 @@ "contributionsCount": "Eliminar mis {count} contribuciones", "commentedCount": "Eliminar mis {count} comentarios", "accountDescription": "Tenga en cuenta que su contribución y sus comentarios son importantes para nuestra comunidad. Si aún decide borrarlos, debe marcarlos a continuación.", - "accountWarning": "¡ NO PUEDE GESTIONAR <\/b> y NO PUEDE RECUPERAR <\/b> su cuenta, contribuciones o comentarios después de eliminar su cuenta!", + "accountWarning": "¡NO PUEDE GESTIONAR y NO PUEDE RECUPERAR su cuenta, contribuciones o comentarios después de eliminar su cuenta!", "success": "¡Cuenta eliminada con éxito!", - "pleaseConfirm": " ¡Acción destructiva! <\/b> Escriba {confirm} <\/b> para confirmar" + "pleaseConfirm": "¡Acción destructiva! Escriba “{confirm}” para confirmar." }, "embeds": { "name": "Proveedores externos", diff --git a/webapp/locales/fr.json b/webapp/locales/fr.json index 92ca5482e..73334a1a4 100644 --- a/webapp/locales/fr.json +++ b/webapp/locales/fr.json @@ -117,9 +117,9 @@ "contributionsCount": "Supprimer mes {count} postes", "commentedCount": "Supprimer mes {count} commentaires", "accountDescription": "Sachez que vos postes et commentaires sont importants pour notre communauté. Si vous voulez quand même les supprimer, vous devez les marquer ci-dessous.", - "accountWarning": "Vous NE POUVEZ PAS GÉRER<\/b> et NE POUVEZ PAS RECOUVRIR<\/b> votre compte, vos messages ou vos commentaires après avoir supprimé votre compte !", + "accountWarning": "Vous NE POUVEZ PAS GÉRER et NE POUVEZ PAS RECOUVRIR votre compte, vos messages ou vos commentaires après avoir supprimé votre compte !", "success": "Compte supprimer avec succès!", - "pleaseConfirm": " Action destructive! <\/b> Saisissez {confirm} <\/b> pour confirmer" + "pleaseConfirm": "Action destructive! Saisissez “{confirm}” pour confirmer." }, "embeds": { "name": "Fournisseurs tiers", diff --git a/webapp/locales/it.json b/webapp/locales/it.json index d07f95086..4bf95dd5e 100644 --- a/webapp/locales/it.json +++ b/webapp/locales/it.json @@ -117,9 +117,9 @@ "contributionsCount": "Cancellare i miei {count} messaggi", "commentedCount": "Cancella i miei {count} commenti", "accountDescription": "Essere consapevoli che i tuoi post e commenti sono importanti per la nostra comunità. Se cancelli il tuo account utente, tutto scomparirà per sempre - e sarebbe un vero peccato!", - "accountWarning": "Attenzione!Tu Non puoi gestire e Non puoi recuperare il tuo account, i tuoi messaggi o commenti dopo aver cancellato il tuo account!", + "accountWarning": "Attenzione! Tu NON PUOI GESTIRE e NON PUOI RECUPERARE il tuo account, i tuoi messaggi o commenti dopo aver cancellato il tuo account!", "success": "Account eliminato con successo!", - "pleaseConfirm": "Azione distruttiva! Digita {conferma} per confermare" + "pleaseConfirm": "Azione distruttiva! Digita “{confirm}” per confermare." }, "embeds": { "name": "", diff --git a/webapp/locales/pl.json b/webapp/locales/pl.json index 7207c1e71..9f9174caa 100644 --- a/webapp/locales/pl.json +++ b/webapp/locales/pl.json @@ -129,9 +129,9 @@ "contributionsCount": "Usuń {count} moich postów", "commentedCount": "Usuń {count} moich komentarzy", "accountDescription": "Be aware that your Post and Comments are important to our community. If you still choose to delete them, you have to mark them below.", - "accountWarning": "Po usunięcie Twojego konta, nie możesz ZARZĄDZAĆ ani ODZYSKAĆ danych, wpisów oraz komentarzy!", + "accountWarning": "Po usunięcie Twojego konta, nie możesz ZARZĄDZAĆ ani ODZYSKAĆ danych, wpisów oraz komentarzy!", "success": "Konto zostało usunięte", - "pleaseConfirm": "Uwaga, niebezpieczeństwo! Wpisz {confirm}, aby potwierdzić" + "pleaseConfirm": "Uwaga, niebezpieczeństwo! Wpisz „{confirm}”, aby potwierdzić." }, "organizations": { "name": "My Organizations" diff --git a/webapp/locales/pt.json b/webapp/locales/pt.json index 29fe301c8..3deda86ca 100644 --- a/webapp/locales/pt.json +++ b/webapp/locales/pt.json @@ -117,9 +117,9 @@ "contributionsCount": "Deletar minhas {count} publicações", "commentedCount": "Deletar meus {count} comentários", "accountDescription": "Esteja ciente de que o suas Publicações e Comentários são importantes para a nossa comunidade. Se você ainda optar por excluí-los, você tem que marcá-los abaixo.", - "accountWarning": "Você NÃO PODE GERENCIAR<\/b> e NÃO PODE RECUPERAR<\/b> sua conta, Publicações, ou Comentários após excluir sua conta!", + "accountWarning": "Você NÃO PODE GERENCIAR e NÃO PODE RECUPERAR sua conta, Publicações, ou Comentários após excluir sua conta!", "success": "Conta eliminada com sucesso!", - "pleaseConfirm": "Ação destrutiva!<\/b> Digitar {confirm}<\/b> para confirmar" + "pleaseConfirm": "Ação destrutiva! Digitar “{confirm}” para confirmar." }, "embeds": { "name": "Fornecedores de terceiros", diff --git a/webapp/locales/ru.json b/webapp/locales/ru.json index 64af8f693..235a1ef77 100644 --- a/webapp/locales/ru.json +++ b/webapp/locales/ru.json @@ -627,11 +627,11 @@ }, "deleteUserAccount": { "accountDescription": "Обратите внимание, что ваши посты и комментарии важны для сообщества. Если вы все равно хотите их удалить, то вы должны отметить соответствующие опции ниже.", - "accountWarning": "Вы НЕ СМОЖЕТЕ<\/b> восстановить свой аккаунт, посты или комментарии после удаления.", + "accountWarning": "Вы НЕ СМОЖЕТЕ восстановить свой аккаунт, посты или комментарии после удаления.", "commentedCount": "Удалить мои комментарии: {count}", "contributionsCount": "Удалить мои посты: {count}", "name": "Удалить данные", - "pleaseConfirm": "Разрушительное действие!<\/b> Введите {confirm}<\/b> для подтверждения.", + "pleaseConfirm": "Разрушительное действие! Введите „{confirm}“ для подтверждения.", "success": "Аккаунт успешно удален!" }, "download": {