From db422257e4c5272e60d290eaaeaa1dbfcd09b234 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Wed, 22 Jan 2020 12:59:46 +0300 Subject: [PATCH 01/36] add BaseCard component --- webapp/assets/_new/styles/resets.scss | 10 ++++++ .../_new/generic/BaseCard/BaseCard.story.js | 27 ++++++++++++++++ .../_new/generic/BaseCard/BaseCard.vue | 32 +++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 webapp/components/_new/generic/BaseCard/BaseCard.story.js create mode 100644 webapp/components/_new/generic/BaseCard/BaseCard.vue diff --git a/webapp/assets/_new/styles/resets.scss b/webapp/assets/_new/styles/resets.scss index 2784add5f..144f22d10 100644 --- a/webapp/assets/_new/styles/resets.scss +++ b/webapp/assets/_new/styles/resets.scss @@ -9,3 +9,13 @@ button { font-family: inherit; font-size: inherit; } + +h1, +h2, +h3, +h4, +h5, +h6, +p { + margin: 0; +} diff --git a/webapp/components/_new/generic/BaseCard/BaseCard.story.js b/webapp/components/_new/generic/BaseCard/BaseCard.story.js new file mode 100644 index 000000000..3462df4d1 --- /dev/null +++ b/webapp/components/_new/generic/BaseCard/BaseCard.story.js @@ -0,0 +1,27 @@ +import { storiesOf } from '@storybook/vue' +import helpers from '~/storybook/helpers' +import BaseCard from './BaseCard.vue' + +storiesOf('Generic/BaseCard', module) + .addDecorator(helpers.layout) + + .add('default', () => ({ + components: { BaseCard }, + template: ` + +

I am a card heading

+

And I am a paragraph.

+
+ `, + })) + + .add('with image', () => ({ + components: { BaseCard }, + template: ` + + +

I am a card heading

+

And I am a paragraph.

+
+ `, + })) diff --git a/webapp/components/_new/generic/BaseCard/BaseCard.vue b/webapp/components/_new/generic/BaseCard/BaseCard.vue new file mode 100644 index 000000000..b76af1c78 --- /dev/null +++ b/webapp/components/_new/generic/BaseCard/BaseCard.vue @@ -0,0 +1,32 @@ + + + + + From e7bf499d373ec9d5d46be20fd838fbc4dbecb273 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Wed, 22 Jan 2020 17:37:32 +0300 Subject: [PATCH 02/36] use BaseCard in Comment component and refactor --- backend/yarn.lock | 8 +- webapp/components/Comment/Comment.spec.js | 10 +- webapp/components/Comment/Comment.vue | 207 ++++++++---------- .../CommentForm/CommentForm.spec.js | 8 +- webapp/components/CommentForm/CommentForm.vue | 2 +- .../CommentList/CommentList.spec.js | 16 +- webapp/components/CommentList/CommentList.vue | 10 +- .../ContentMenu/ContentMenu.spec.js | 2 +- webapp/components/ContentMenu/ContentMenu.vue | 2 +- .../_new/generic/BaseCard/BaseCard.vue | 4 +- webapp/pages/post/_id/_slug/index.vue | 17 +- webapp/yarn.lock | 120 ---------- 12 files changed, 134 insertions(+), 272 deletions(-) diff --git a/backend/yarn.lock b/backend/yarn.lock index 5749c5639..8ccca9a63 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -1137,7 +1137,7 @@ url-regex "~4.1.1" video-extensions "~1.1.0" -"@metascraper/helpers@^5.10.3", "@metascraper/helpers@^5.10.5": +"@metascraper/helpers@^5.10.5": version "5.10.5" resolved "https://registry.yarnpkg.com/@metascraper/helpers/-/helpers-5.10.5.tgz#c3558533f30144bacecf9599fd02ac88d839a0cc" integrity sha512-noTBDk3cF3UzKoPrC9/Sye1f9945PVEDju6br7S19YWyUpceEXoDrPF1YaqN37ku62f1s7bul11+Lv/xAYuEVQ== @@ -3872,7 +3872,6 @@ extsprintf@^1.2.0: faker@Marak/faker.js#master: version "4.1.0" - uid "3b2fa4aebccee52ae1bafc15d575061fb30c3cf1" resolved "https://codeload.github.com/Marak/faker.js/tar.gz/3b2fa4aebccee52ae1bafc15d575061fb30c3cf1" fast-deep-equal@^2.0.1: @@ -7730,6 +7729,11 @@ serve-static@1.14.1: version "1.14.1" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.17.1" set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" diff --git a/webapp/components/Comment/Comment.spec.js b/webapp/components/Comment/Comment.spec.js index b307700d9..14b0dd7ec 100644 --- a/webapp/components/Comment/Comment.spec.js +++ b/webapp/components/Comment/Comment.spec.js @@ -14,7 +14,13 @@ describe('Comment.vue', () => { let Wrapper beforeEach(() => { - propsData = {} + propsData = { + comment: { + id: 'comment007', + author: { id: 'some-user' }, + }, + postId: 'post42', + } mocks = { $t: jest.fn(), $toast: { @@ -28,6 +34,7 @@ describe('Comment.vue', () => { truncate: a => a, removeHtml: a => a, }, + $route: { hash: '' }, $scrollTo: jest.fn(), $apollo: { mutate: jest.fn().mockResolvedValue({ @@ -68,6 +75,7 @@ describe('Comment.vue', () => { id: '2', contentExcerpt: 'Hello I am a comment content', content: 'Hello I am comment content', + author: { id: 'some-user' }, } }) diff --git a/webapp/components/Comment/Comment.vue b/webapp/components/Comment/Comment.vue index b413e03f6..df1320837 100644 --- a/webapp/components/Comment/Comment.vue +++ b/webapp/components/Comment/Comment.vue @@ -1,61 +1,45 @@ - diff --git a/webapp/components/CommentForm/CommentForm.spec.js b/webapp/components/CommentForm/CommentForm.spec.js index 420ab26fb..b940c561d 100644 --- a/webapp/components/CommentForm/CommentForm.spec.js +++ b/webapp/components/CommentForm/CommentForm.spec.js @@ -153,10 +153,10 @@ describe('CommentForm.vue', () => { expect(closeMethodSpy).toHaveBeenCalledTimes(1) }) - it('emits `showEditCommentMenu` event', async () => { + it('emits `finishEditing` event', async () => { wrapper.vm.updateEditorContent('ok') await wrapper.find('form').trigger('submit') - expect(wrapper.emitted('showEditCommentMenu')).toEqual([[false]]) + expect(wrapper.emitted('finishEditing')).toBeTruthy() }) }) @@ -167,10 +167,10 @@ describe('CommentForm.vue', () => { expect(closeMethodSpy).toHaveBeenCalledTimes(1) }) - it('emits `showEditCommentMenu` event', async () => { + it('emits `finishEditing` event', async () => { wrapper.vm.updateEditorContent('ok') await wrapper.find('[data-test="cancel-button"]').trigger('submit') - expect(wrapper.emitted('showEditCommentMenu')).toEqual([[false]]) + expect(wrapper.emitted('finishEditing')).toBeTruthy() }) }) diff --git a/webapp/components/CommentForm/CommentForm.vue b/webapp/components/CommentForm/CommentForm.vue index 063a3d599..4952f99cf 100644 --- a/webapp/components/CommentForm/CommentForm.vue +++ b/webapp/components/CommentForm/CommentForm.vue @@ -69,7 +69,7 @@ export default { this.$refs.editor.clear() }, closeEditWindow() { - this.$emit('showEditCommentMenu', false) + this.$emit('finishEditing') }, handleCancel() { if (!this.update) { diff --git a/webapp/components/CommentList/CommentList.spec.js b/webapp/components/CommentList/CommentList.spec.js index 064b8f136..38f39adca 100644 --- a/webapp/components/CommentList/CommentList.spec.js +++ b/webapp/components/CommentList/CommentList.spec.js @@ -17,9 +17,14 @@ describe('CommentList.vue', () => { beforeEach(() => { propsData = { post: { - id: 1, + id: 'post42', comments: [ - { id: 'comment134', contentExcerpt: 'this is a comment', content: 'this is a comment' }, + { + id: 'comment134', + contentExcerpt: 'this is a comment', + content: 'this is a comment', + author: { id: 'some-user' }, + }, ], }, } @@ -38,6 +43,7 @@ describe('CommentList.vue', () => { removeHtml: a => a, }, $scrollTo: jest.fn(), + $route: { hash: '' }, $apollo: { queries: { Post: { @@ -70,12 +76,6 @@ describe('CommentList.vue', () => { beforeEach(jest.useFakeTimers) describe('$route.hash !== `#comments`', () => { - beforeEach(() => { - mocks.$route = { - hash: '', - } - }) - it('skips $scrollTo', () => { wrapper = Wrapper() jest.runAllTimers() diff --git a/webapp/components/CommentList/CommentList.vue b/webapp/components/CommentList/CommentList.vue index 96edf9bc3..1654e31da 100644 --- a/webapp/components/CommentList/CommentList.vue +++ b/webapp/components/CommentList/CommentList.vue @@ -4,14 +4,12 @@ {{ $t('common.comment', null, 0) }} -
'' }, - post: { type: Object, default: () => {} }, + post: { + type: Object, + required: true, + }, }, methods: { checkAnchor(anchor) { diff --git a/webapp/components/ContentMenu/ContentMenu.spec.js b/webapp/components/ContentMenu/ContentMenu.spec.js index f079f6240..bbb0c0941 100644 --- a/webapp/components/ContentMenu/ContentMenu.spec.js +++ b/webapp/components/ContentMenu/ContentMenu.spec.js @@ -154,7 +154,7 @@ describe('ContentMenu.vue', () => { .filter(item => item.text() === 'comment.menu.edit') .at(0) .trigger('click') - expect(wrapper.emitted('showEditCommentMenu')).toEqual([[true]]) + expect(wrapper.emitted('editComment')).toBeTruthy() }) it('delete the comment', () => { wrapper diff --git a/webapp/components/ContentMenu/ContentMenu.vue b/webapp/components/ContentMenu/ContentMenu.vue index a22bc3267..a4c931470 100644 --- a/webapp/components/ContentMenu/ContentMenu.vue +++ b/webapp/components/ContentMenu/ContentMenu.vue @@ -104,7 +104,7 @@ export default { routes.push({ label: this.$t(`comment.menu.edit`), callback: () => { - this.$emit('showEditCommentMenu', true) + this.$emit('editComment') }, icon: 'edit', }) diff --git a/webapp/components/_new/generic/BaseCard/BaseCard.vue b/webapp/components/_new/generic/BaseCard/BaseCard.vue index b76af1c78..6a97c47f1 100644 --- a/webapp/components/_new/generic/BaseCard/BaseCard.vue +++ b/webapp/components/_new/generic/BaseCard/BaseCard.vue @@ -5,9 +5,7 @@ From 1d435392ff63d3ea107fa0aae4b286b48d156781 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Wed, 5 Feb 2020 21:39:50 +0100 Subject: [PATCH 06/36] refactor ContributionForm template --- .../CategoriesSelect/CategoriesSelect.vue | 8 - .../ContributionForm/ContributionForm.vue | 167 ++++++++---------- webapp/components/TeaserImage/TeaserImage.vue | 5 - 3 files changed, 74 insertions(+), 106 deletions(-) diff --git a/webapp/components/CategoriesSelect/CategoriesSelect.vue b/webapp/components/CategoriesSelect/CategoriesSelect.vue index 3e240e435..7f0cbfcbc 100644 --- a/webapp/components/CategoriesSelect/CategoriesSelect.vue +++ b/webapp/components/CategoriesSelect/CategoriesSelect.vue @@ -16,14 +16,6 @@
-

- {{ - $t('contribution.categories.infoSelectedNoOfMaxCategories', { - chosen: selectedCount, - max: selectedMax, - }) - }} -

diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index ba5628e28..c7c1e8cfe 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -8,94 +8,64 @@ > @@ -116,16 +85,14 @@ import { mapGetters } from 'vuex' import HcEditor from '~/components/Editor/Editor' import locales from '~/locales' import PostMutations from '~/graphql/PostMutations.js' -import HcCategoriesSelect from '~/components/CategoriesSelect/CategoriesSelect' +import CategoriesSelect from '~/components/CategoriesSelect/CategoriesSelect' import TeaserImage from '~/components/TeaserImage/TeaserImage' -import UserTeaser from '~/components/UserTeaser/UserTeaser' export default { components: { HcEditor, - HcCategoriesSelect, + CategoriesSelect, TeaserImage, - UserTeaser, }, props: { contribution: { type: Object, default: () => {} }, @@ -194,12 +161,12 @@ export default { } }, computed: { - contentLength() { - return this.$filters.removeHtml(this.form.content).length - }, ...mapGetters({ currentUser: 'auth/user', }), + contentLength() { + return this.$filters.removeHtml(this.form.content).length + }, }, methods: { submit() { @@ -293,8 +260,38 @@ export default { diff --git a/webapp/components/TeaserImage/TeaserImage.vue b/webapp/components/TeaserImage/TeaserImage.vue index 536fd8ae4..16ee78678 100644 --- a/webapp/components/TeaserImage/TeaserImage.vue +++ b/webapp/components/TeaserImage/TeaserImage.vue @@ -106,7 +106,6 @@ export default { .image-uploader { position: relative; min-height: 200px; - overflow: hidden; cursor: pointer; &:only-child { @@ -117,10 +116,6 @@ export default { pointer-events: none; } - &.--blur-image img { - filter: blur(22px); - } - .preview-image + & { position: absolute; top: 0; From 41ef496d6b216922cf3538d3845526c7cecc019c Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Wed, 5 Feb 2020 21:45:28 +0100 Subject: [PATCH 07/36] refactor CategoriesSelect template --- .../CategoriesSelect/CategoriesSelect.vue | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/webapp/components/CategoriesSelect/CategoriesSelect.vue b/webapp/components/CategoriesSelect/CategoriesSelect.vue index 7f0cbfcbc..b7d71de2d 100644 --- a/webapp/components/CategoriesSelect/CategoriesSelect.vue +++ b/webapp/components/CategoriesSelect/CategoriesSelect.vue @@ -1,22 +1,18 @@ + + From 509892b6caee6c4ca8384fb0090122ced98edfd4 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 10 Feb 2020 12:40:38 +0100 Subject: [PATCH 08/36] 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": { From 0a9da862ed3e53e84e7066d3f5bce2ebbd8be9a5 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 10 Feb 2020 15:45:09 +0100 Subject: [PATCH 09/36] replace instances of ds-card with base-card --- .../components/FilterMenu/FilterMenu.spec.js | 17 +++--- webapp/components/FilterMenu/FilterMenu.vue | 54 ++++++------------- .../features/ReportList/ReportList.story.js | 4 +- .../features/ReportList/ReportList.vue | 7 +-- 4 files changed, 29 insertions(+), 53 deletions(-) diff --git a/webapp/components/FilterMenu/FilterMenu.spec.js b/webapp/components/FilterMenu/FilterMenu.spec.js index d70af323f..283db979e 100644 --- a/webapp/components/FilterMenu/FilterMenu.spec.js +++ b/webapp/components/FilterMenu/FilterMenu.spec.js @@ -12,10 +12,10 @@ describe('FilterMenu.vue', () => { mocks = { $t: () => {} } }) - describe('given a user', () => { + describe('given a hashtag', () => { beforeEach(() => { propsData = { - hashtag: null, + hashtag: 'Frieden', } }) @@ -27,19 +27,14 @@ describe('FilterMenu.vue', () => { wrapper = Wrapper() }) - it('does not render a card if there are no hashtags', () => { - expect(wrapper.is('.ds-card')).toBe(true) - }) - - it('renders a card if there are hashtags', () => { - propsData.hashtag = 'Frieden' + it('renders a card', () => { wrapper = Wrapper() - expect(wrapper.is('.ds-card')).toBe(true) + expect(wrapper.is('.base-card')).toBe(true) }) - describe('click "clear-search-button" button', () => { + describe('click clear search button', () => { it('emits clearSearch', () => { - wrapper.find('[name="clear-search-button"]').trigger('click') + wrapper.find('.base-button').trigger('click') expect(wrapper.emitted().clearSearch).toHaveLength(1) }) }) diff --git a/webapp/components/FilterMenu/FilterMenu.vue b/webapp/components/FilterMenu/FilterMenu.vue index e56925e56..c294763b5 100644 --- a/webapp/components/FilterMenu/FilterMenu.vue +++ b/webapp/components/FilterMenu/FilterMenu.vue @@ -1,32 +1,23 @@ diff --git a/webapp/components/features/ReportList/ReportList.story.js b/webapp/components/features/ReportList/ReportList.story.js index 33ec06120..aa188e8da 100644 --- a/webapp/components/features/ReportList/ReportList.story.js +++ b/webapp/components/features/ReportList/ReportList.story.js @@ -183,11 +183,11 @@ storiesOf('ReportList', module) openModal: action('openModal'), filter: action('filter'), }, - template: ` + template: `

Reports

-
`, + `, })) diff --git a/webapp/components/features/ReportList/ReportList.vue b/webapp/components/features/ReportList/ReportList.vue index 62a29e66b..c4a17bd26 100644 --- a/webapp/components/features/ReportList/ReportList.vue +++ b/webapp/components/features/ReportList/ReportList.vue @@ -1,5 +1,5 @@ + From cea538e2f146220e9881fbe20d36cf7922ffdfb8 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 10 Feb 2020 17:56:18 +0100 Subject: [PATCH 11/36] refactor Notification component --- .../components/Notification/Notification.vue | 82 +++++++++++-------- 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/webapp/components/Notification/Notification.vue b/webapp/components/Notification/Notification.vue index 2a4942716..34c57b368 100644 --- a/webapp/components/Notification/Notification.vue +++ b/webapp/components/Notification/Notification.vue @@ -1,37 +1,23 @@ From 6671d893e6094a240368e83be0a7b2a1a875ee86 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Tue, 11 Feb 2020 09:20:45 +0100 Subject: [PATCH 12/36] refactor PostCard (wip) --- webapp/components/ContentMenu/ContentMenu.vue | 2 +- .../Notification/Notification.spec.js | 30 +-- .../components/Notification/Notification.vue | 6 +- .../NotificationList/NotificationList.spec.js | 2 +- webapp/components/PostCard/PostCard.vue | 225 +++++++++--------- 5 files changed, 131 insertions(+), 134 deletions(-) diff --git a/webapp/components/ContentMenu/ContentMenu.vue b/webapp/components/ContentMenu/ContentMenu.vue index ba273e28a..67f28817e 100644 --- a/webapp/components/ContentMenu/ContentMenu.vue +++ b/webapp/components/ContentMenu/ContentMenu.vue @@ -8,7 +8,7 @@ size="small" circle ghost - @click="toggleMenu" + @click.prevent="toggleMenu()" /> diff --git a/webapp/components/Notification/Notification.spec.js b/webapp/components/Notification/Notification.spec.js index 750f59b3a..537babfae 100644 --- a/webapp/components/Notification/Notification.spec.js +++ b/webapp/components/Notification/Notification.spec.js @@ -63,7 +63,7 @@ describe('Notification', () => { it('renders reason', () => { wrapper = Wrapper() - expect(wrapper.find('.reason-text-for-test').text()).toEqual( + expect(wrapper.find('.notification > .description').text()).toEqual( 'notifications.reason.commented_on_post', ) }) @@ -79,9 +79,9 @@ describe('Notification', () => { wrapper = Wrapper() expect(wrapper.text()).toContain('@dagobert-duck is the best on this comment.') }) - it('has no class "read"', () => { + it('has no class "--read"', () => { wrapper = Wrapper() - expect(wrapper.classes()).not.toContain('read') + expect(wrapper.classes()).not.toContain('--read') }) describe('that is read', () => { @@ -90,8 +90,8 @@ describe('Notification', () => { wrapper = Wrapper() }) - it('has class "read"', () => { - expect(wrapper.classes()).toContain('read') + it('has class "--read"', () => { + expect(wrapper.classes()).toContain('--read') }) }) }) @@ -113,7 +113,7 @@ describe('Notification', () => { it('renders reason', () => { wrapper = Wrapper() - expect(wrapper.find('.reason-text-for-test').text()).toEqual( + expect(wrapper.find('.notification > .description').text()).toEqual( 'notifications.reason.mentioned_in_post', ) }) @@ -125,9 +125,9 @@ describe('Notification', () => { wrapper = Wrapper() expect(wrapper.text()).toContain('@jenny-rostock is the best on this post.') }) - it('has no class "read"', () => { + it('has no class "--read"', () => { wrapper = Wrapper() - expect(wrapper.classes()).not.toContain('read') + expect(wrapper.classes()).not.toContain('--read') }) describe('that is read', () => { @@ -136,8 +136,8 @@ describe('Notification', () => { wrapper = Wrapper() }) - it('has class "read"', () => { - expect(wrapper.classes()).toContain('read') + it('has class "--read"', () => { + expect(wrapper.classes()).toContain('--read') }) }) }) @@ -163,7 +163,7 @@ describe('Notification', () => { it('renders reason', () => { wrapper = Wrapper() - expect(wrapper.find('.reason-text-for-test').text()).toEqual( + expect(wrapper.find('.notification > .description').text()).toEqual( 'notifications.reason.mentioned_in_comment', ) }) @@ -182,9 +182,9 @@ describe('Notification', () => { expect(wrapper.text()).toContain('@dagobert-duck is the best on this comment.') }) - it('has no class "read"', () => { + it('has no class "--read"', () => { wrapper = Wrapper() - expect(wrapper.classes()).not.toContain('read') + expect(wrapper.classes()).not.toContain('--read') }) describe('that is read', () => { @@ -193,8 +193,8 @@ describe('Notification', () => { wrapper = Wrapper() }) - it('has class "read"', () => { - expect(wrapper.classes()).toContain('read') + it('has class "--read"', () => { + expect(wrapper.classes()).toContain('--read') }) }) }) diff --git a/webapp/components/Notification/Notification.vue b/webapp/components/Notification/Notification.vue index 34c57b368..deb012c10 100644 --- a/webapp/components/Notification/Notification.vue +++ b/webapp/components/Notification/Notification.vue @@ -1,5 +1,5 @@ @@ -48,6 +51,7 @@ export default { diff --git a/webapp/components/_new/generic/CardWithColumns/CardWithColumns.story.js b/webapp/components/_new/generic/CardWithColumns/CardWithColumns.story.js deleted file mode 100644 index 8b1e8940f..000000000 --- a/webapp/components/_new/generic/CardWithColumns/CardWithColumns.story.js +++ /dev/null @@ -1,21 +0,0 @@ -import { storiesOf } from '@storybook/vue' -import helpers from '~/storybook/helpers' -import CardWithColumns from './CardWithColumns.vue' - -storiesOf('Generic/CardWithColumns', module) - .addDecorator(helpers.layout) - - .add('default', () => ({ - components: { CardWithColumns }, - template: ` - - - - - `, - })) diff --git a/webapp/components/_new/generic/CardWithColumns/CardWithColumns.vue b/webapp/components/_new/generic/CardWithColumns/CardWithColumns.vue deleted file mode 100644 index 71fda7caf..000000000 --- a/webapp/components/_new/generic/CardWithColumns/CardWithColumns.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - - - diff --git a/webapp/pages/password-reset.vue b/webapp/pages/password-reset.vue index e59a8e6c7..930a298fe 100644 --- a/webapp/pages/password-reset.vue +++ b/webapp/pages/password-reset.vue @@ -1,24 +1,22 @@