diff --git a/frontend/src/components/ContributionMessages/ContributionMessagesFormular.spec.js b/frontend/src/components/ContributionMessages/ContributionMessagesFormular.spec.js index ad17152c0..17fd44fe2 100644 --- a/frontend/src/components/ContributionMessages/ContributionMessagesFormular.spec.js +++ b/frontend/src/components/ContributionMessages/ContributionMessagesFormular.spec.js @@ -73,8 +73,8 @@ describe('ContributionMessagesFormular', () => { ) }) - it('emitted "update-state" with data', async () => { - expect(wrapper.emitted('update-state')).toEqual( + it('emitted "update-status" with data', async () => { + expect(wrapper.emitted('update-status')).toEqual( expect.arrayContaining([expect.arrayContaining([42])]), ) }) diff --git a/frontend/src/components/ContributionMessages/ContributionMessagesFormular.vue b/frontend/src/components/ContributionMessages/ContributionMessagesFormular.vue index b11be3b14..e84f9273b 100644 --- a/frontend/src/components/ContributionMessages/ContributionMessagesFormular.vue +++ b/frontend/src/components/ContributionMessages/ContributionMessagesFormular.vue @@ -55,7 +55,7 @@ export default { }) .then((result) => { this.$emit('get-list-contribution-messages', false) - this.$emit('update-state', this.contributionId) + this.$emit('update-status', this.contributionId) this.form.text = '' this.toastSuccess(this.$t('message.reply')) this.isSubmitting = false diff --git a/frontend/src/components/ContributionMessages/ContributionMessagesList.spec.js b/frontend/src/components/ContributionMessages/ContributionMessagesList.spec.js index 47a8f9dfe..2caef666f 100644 --- a/frontend/src/components/ContributionMessages/ContributionMessagesList.spec.js +++ b/frontend/src/components/ContributionMessages/ContributionMessagesList.spec.js @@ -8,7 +8,7 @@ describe('ContributionMessagesList', () => { const propsData = { contributionId: 42, - state: 'IN_PROGRESS', + status: 'IN_PROGRESS', messages: [], } @@ -40,13 +40,13 @@ describe('ContributionMessagesList', () => { expect(wrapper.findComponent({ name: 'ContributionMessagesFormular' }).exists()).toBe(true) }) - describe('update State', () => { + describe('update Status', () => { beforeEach(() => { - wrapper.vm.updateState() + wrapper.vm.updateStatus() }) it('emits getListContributionMessages', async () => { - expect(wrapper.vm.$emit('update-state')).toBeTruthy() + expect(wrapper.vm.$emit('update-status')).toBeTruthy() }) }) }) diff --git a/frontend/src/components/ContributionMessages/ContributionMessagesList.vue b/frontend/src/components/ContributionMessages/ContributionMessagesList.vue index c93d424b6..28e37dbb7 100644 --- a/frontend/src/components/ContributionMessages/ContributionMessagesList.vue +++ b/frontend/src/components/ContributionMessages/ContributionMessagesList.vue @@ -7,10 +7,10 @@
@@ -37,7 +37,7 @@ export default { type: Number, required: true, }, - state: { + status: { type: String, required: true, }, @@ -47,8 +47,8 @@ export default { }, }, methods: { - updateState(id) { - this.$emit('update-state', id) + updateStatus(id) { + this.$emit('update-status', id) }, }, } diff --git a/frontend/src/components/ContributionMessages/ContributionMessagesListItem.spec.js b/frontend/src/components/ContributionMessages/ContributionMessagesListItem.spec.js index b00fdd7cf..d93683de9 100644 --- a/frontend/src/components/ContributionMessages/ContributionMessagesListItem.spec.js +++ b/frontend/src/components/ContributionMessages/ContributionMessagesListItem.spec.js @@ -21,7 +21,7 @@ const mocks = { describe('ContributionMessagesList', () => { const propsData = { contributionId: 42, - state: 'PENDING', + status: 'PENDING', messages: [ { id: 111, diff --git a/frontend/src/components/Contributions/ContributionList.spec.js b/frontend/src/components/Contributions/ContributionList.spec.js index ebff93886..4137f7957 100644 --- a/frontend/src/components/Contributions/ContributionList.spec.js +++ b/frontend/src/components/Contributions/ContributionList.spec.js @@ -119,11 +119,11 @@ describe('ContributionList', () => { describe('update status', () => { beforeEach(() => { - wrapper.findComponent({ name: 'ContributionListItem' }).vm.$emit('update-state', { id: 2 }) + wrapper.findComponent({ name: 'ContributionListItem' }).vm.$emit('update-status', { id: 2 }) }) it('emits update status', () => { - expect(wrapper.emitted('update-state')).toEqual([[{ id: 2 }]]) + expect(wrapper.emitted('update-status')).toEqual([[{ id: 2 }]]) }) }) }) diff --git a/frontend/src/components/Contributions/ContributionList.vue b/frontend/src/components/Contributions/ContributionList.vue index 3e32cb90f..9f62354a3 100644 --- a/frontend/src/components/Contributions/ContributionList.vue +++ b/frontend/src/components/Contributions/ContributionList.vue @@ -2,26 +2,26 @@
{ const propsData = { contributionId: 42, - state: 'PENDING', + status: 'PENDING', messagesCount: 2, id: 1, createdAt: '26/07/2022', @@ -72,8 +72,8 @@ describe('ContributionListItem', () => { expect(wrapper.vm.variant).toBe('success') }) - it('is warning at when state is IN_PROGRESS', async () => { - await wrapper.setProps({ state: 'IN_PROGRESS' }) + it('is warning at when status is IN_PROGRESS', async () => { + await wrapper.setProps({ status: 'IN_PROGRESS' }) expect(wrapper.vm.variant).toBe('205') }) }) @@ -134,13 +134,13 @@ describe('ContributionListItem', () => { }) }) - describe('updateState', () => { + describe('updateStatus', () => { beforeEach(async () => { - await wrapper.vm.updateState() + await wrapper.vm.updateStatus() }) - it('emit update-state', () => { - expect(wrapper.vm.$emit('update-state')).toBeTruthy() + it('emit update-status', () => { + expect(wrapper.vm.$emit('update-status')).toBeTruthy() }) }) }) diff --git a/frontend/src/components/Contributions/ContributionListItem.vue b/frontend/src/components/Contributions/ContributionListItem.vue index 27e8459bd..0197a9593 100644 --- a/frontend/src/components/Contributions/ContributionListItem.vue +++ b/frontend/src/components/Contributions/ContributionListItem.vue @@ -2,7 +2,7 @@
@@ -26,7 +26,7 @@
{{ $t('contributionText') }}
{{ memo }}
@@ -37,11 +37,11 @@
{{ $t('creation') }} {{ $t('(') }}{{ amount / 20 }} {{ $t('h') }}{{ $t(')') }}
-
+
{{ $t('contribution.alert.denied') }}
-
+
{{ $t('contribution.deleted') }}
{{ amount | GDD }}
@@ -53,12 +53,12 @@
@@ -69,7 +69,7 @@
@@ -161,7 +161,7 @@ export default { type: String, required: false, }, - state: { + status: { type: String, required: false, default: '', @@ -197,14 +197,14 @@ export default { if (this.deletedAt) return 'trash' if (this.deniedAt) return 'x-circle' if (this.confirmedAt) return 'check' - if (this.state === 'IN_PROGRESS') return 'question' + if (this.status === 'IN_PROGRESS') return 'question' return 'bell-fill' }, variant() { if (this.deletedAt) return 'danger' if (this.deniedAt) return 'warning' if (this.confirmedAt) return 'success' - if (this.state === 'IN_PROGRESS') return '205' + if (this.status === 'IN_PROGRESS') return '205' return 'primary' }, date() { @@ -245,8 +245,8 @@ export default { this.toastError(error.message) }) }, - updateState(id) { - this.$emit('update-state', id) + updateStatus(id) { + this.$emit('update-status', id) }, }, watch: { diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index f254b93cc..49975b0a2 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -190,7 +190,7 @@ export const listContributions = gql` confirmedAt confirmedBy deletedAt - state + status messagesCount deniedAt deniedBy @@ -214,7 +214,7 @@ export const listAllContributions = gql` contributionDate confirmedAt confirmedBy - state + status messagesCount deniedAt deniedBy diff --git a/frontend/src/pages/Community.spec.js b/frontend/src/pages/Community.spec.js index ab1572d37..0867b0732 100644 --- a/frontend/src/pages/Community.spec.js +++ b/frontend/src/pages/Community.spec.js @@ -68,7 +68,7 @@ describe('Community', () => { firstName: 'Bibi', contributionDate: '2022-07-15T08:47:06.000Z', lastName: 'Bloxberg', - state: 'IN_PROGRESS', + status: 'IN_PROGRESS', messagesCount: 0, deniedAt: null, deniedBy: null, @@ -85,7 +85,7 @@ describe('Community', () => { firstName: 'Bibi', contributionDate: '2022-06-15T08:47:06.000Z', lastName: 'Bloxberg', - state: 'CONFIRMED', + status: 'CONFIRMED', messagesCount: 0, deniedAt: null, deniedBy: null, @@ -121,7 +121,7 @@ describe('Community', () => { deniedAt: null, deniedBy: null, messagesCount: 0, - state: 'IN_PROGRESS', + status: 'IN_PROGRESS', }, { id: 1550, @@ -137,7 +137,7 @@ describe('Community', () => { deniedAt: null, deniedBy: null, messagesCount: 0, - state: 'IN_PROGRESS', + status: 'IN_PROGRESS', }, { id: 1556, @@ -153,7 +153,7 @@ describe('Community', () => { deniedAt: null, deniedBy: null, messagesCount: 0, - state: 'IN_PROGRESS', + status: 'IN_PROGRESS', }, ], contributionCount: 3, @@ -263,7 +263,7 @@ describe('Community', () => { expect(wrapper.findAll('div[role="tabpanel"]')).toHaveLength(3) }) - it('check for correct tabIndex if state is "IN_PROGRESS" or not', () => { + it('check for correct tabIndex if status is "IN_PROGRESS" or not', () => { expect(routerPushMock).toBeCalledWith({ params: { tab: 'contributions' } }) }) diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue index 4388d6f4a..c4df3a47e 100644 --- a/frontend/src/pages/Community.vue +++ b/frontend/src/pages/Community.vue @@ -30,7 +30,7 @@ @update-list-contributions="updateListContributions" @update-contribution-form="updateContributionForm" @delete-contribution="deleteContribution" - @update-state="updateState" + @update-status="updateStatus" :contributionCount="contributionCount" :showPagination="true" :pageSize="pageSize" @@ -148,7 +148,7 @@ export default { update({ listContributions }) { this.contributionCount = listContributions.contributionCount this.items = listContributions.contributionList - if (this.items.find((item) => item.state === 'IN_PROGRESS')) { + if (this.items.find((item) => item.status === 'IN_PROGRESS')) { this.tabIndex = 1 if (this.$route.params.tab !== 'contributions') this.$router.push({ params: { tab: 'contributions' } }) @@ -290,8 +290,8 @@ export default { updateTransactions(pagination) { this.$emit('update-transactions', pagination) }, - updateState(id) { - this.items.find((item) => item.id === id).state = 'PENDING' + updateStatus(id) { + this.items.find((item) => item.id === id).status = 'PENDING' }, }, }