From 81cbb7a85c2c4200199c834140b6ec245a2fbc6c Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Wed, 15 Jan 2020 17:37:54 +0100 Subject: [PATCH] Refactor styling, fix naming convention - Emotions buttons were not displaying images correctly - Follow vue guidelines for multiword naming convention - Favor tokens over magic px numbers --- webapp/components/EmotionButton/EmotionButton.vue | 7 ++++++- .../generic/PaginationButtons/PaginationButtons.spec.js} | 0 .../generic/PaginationButtons/PaginationButtons.story.js} | 2 +- .../generic/PaginationButtons/PaginationButtons.vue} | 4 ++-- webapp/components/features/ReportList/ReportList.vue | 6 +++--- webapp/components/generic/SearchHeading/SearchHeading.vue | 2 +- webapp/pages/admin/users.vue | 6 +++--- webapp/pages/notifications/index.spec.js | 8 ++++---- webapp/pages/notifications/index.vue | 6 +++--- 9 files changed, 23 insertions(+), 18 deletions(-) rename webapp/components/{Paginate/Paginate.spec.js => _new/generic/PaginationButtons/PaginationButtons.spec.js} (100%) rename webapp/components/{Paginate/Paginate.story.js => _new/generic/PaginationButtons/PaginationButtons.story.js} (95%) rename webapp/components/{Paginate/Paginate.vue => _new/generic/PaginationButtons/PaginationButtons.vue} (92%) diff --git a/webapp/components/EmotionButton/EmotionButton.vue b/webapp/components/EmotionButton/EmotionButton.vue index b493a2f82..f6a4b4938 100644 --- a/webapp/components/EmotionButton/EmotionButton.vue +++ b/webapp/components/EmotionButton/EmotionButton.vue @@ -1,7 +1,7 @@ - + {{ $t('admin.users.empty') }} @@ -62,11 +62,11 @@ import gql from 'graphql-tag' import { isEmail } from 'validator' import normalizeEmail from '~/components/utils/NormalizeEmail' -import HcPaginate from '~/components/Paginate/Paginate' +import PaginationButtons from '~/components/_new/generic/PaginationButtons/PaginationButtons' export default { components: { - HcPaginate, + PaginationButtons, }, data() { const pageSize = 15 diff --git a/webapp/pages/notifications/index.spec.js b/webapp/pages/notifications/index.spec.js index 66f68aac7..70592b467 100644 --- a/webapp/pages/notifications/index.spec.js +++ b/webapp/pages/notifications/index.spec.js @@ -3,7 +3,7 @@ import NotificationsPage from './index.vue' import DropdownFilter from '~/components/DropdownFilter/DropdownFilter' import NotificationsTable from '~/components/NotificationsTable/NotificationsTable' -import Paginate from '~/components/Paginate/Paginate' +import PaginationButtons from '~/components/_new/generic/PaginationButtons/PaginationButtons' const localVue = global.localVue @@ -122,14 +122,14 @@ describe('PostIndex', () => { }) }) - describe('Paginate', () => { + describe('PaginationButtons', () => { beforeEach(() => { wrapper = Wrapper() }) describe('next: given a user is on the first page', () => { it('adds offset to pageSize to skip first x notifications and display next page', () => { - wrapper.find(Paginate).vm.$emit('next') + wrapper.find(PaginationButtons).vm.$emit('next') expect(wrapper.vm.offset).toEqual(12) }) }) @@ -137,7 +137,7 @@ describe('PostIndex', () => { describe('back: given a user is on the third page', () => { it('sets offset when back is emitted', () => { wrapper.setData({ offset: 24 }) - wrapper.find(Paginate).vm.$emit('back') + wrapper.find(PaginationButtons).vm.$emit('back') expect(wrapper.vm.offset).toEqual(12) }) }) diff --git a/webapp/pages/notifications/index.vue b/webapp/pages/notifications/index.vue index aa002cec7..c49d208be 100644 --- a/webapp/pages/notifications/index.vue +++ b/webapp/pages/notifications/index.vue @@ -15,21 +15,21 @@ @markNotificationAsRead="markNotificationAsRead" :notifications="notifications" /> - +