From 6a47ba78297de6f98f604b184d713a333b4a569e Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Nov 2022 14:29:16 +0100 Subject: [PATCH 1/5] close all open collapse by change tabs in community --- .../components/Contributions/ContributionListItem.vue | 2 ++ frontend/src/pages/Community.vue | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Contributions/ContributionListItem.vue b/frontend/src/components/Contributions/ContributionListItem.vue index 683d234ba..82b796e33 100644 --- a/frontend/src/components/Contributions/ContributionListItem.vue +++ b/frontend/src/components/Contributions/ContributionListItem.vue @@ -54,6 +54,7 @@ v-b-toggle="collapsId" icon="chat-dots" class="h2 mr-5" + @mousedown="$root.$emit('close-all-open-collapse')" @click="getListContributionMessages" > @@ -64,6 +65,7 @@ v-if="state === 'IN_PROGRESS'" v-b-toggle="collapsId" variant="warning" + @mousedown="$root.$emit('close-all-open-collapse')" @click="getListContributionMessages" > {{ $t('contribution.alert.answerQuestion') }} diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue index 786307405..28d3bdabf 100644 --- a/frontend/src/pages/Community.vue +++ b/frontend/src/pages/Community.vue @@ -49,7 +49,7 @@ :pageSize="pageSize" /> - +

{{ $t('navigation.community') }}

@@ -70,6 +70,7 @@ :items="itemsAll" @update-list-contributions="updateListAllContributions" @update-contribution-form="updateContributionForm" + @close-all-open-collapse="closeAllOpenCollapse" :contributionCount="contributionCountAll" :showPagination="true" :pageSize="pageSizeAll" @@ -112,6 +113,13 @@ export default { } }, methods: { + closeAllOpenCollapse() { + // console.log('Community closeAllOpenCollapse ') + // console.log('closeAllOpenCollapse', this.$el.querySelectorAll('.collapse.show')) + this.$el.querySelectorAll('.collapse.show').forEach((value) => { + this.$root.$emit('bv::toggle::collapse', value.id) + }) + }, setContribution(data) { this.$apollo .mutate({ From 1afac12aa831380fa18cc56812b74f7a988b09b5 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Nov 2022 15:23:44 +0100 Subject: [PATCH 2/5] close open messagebox by open another messagebox --- frontend/src/components/Contributions/ContributionList.vue | 1 + frontend/src/components/Contributions/ContributionListItem.vue | 3 +-- frontend/src/pages/Community.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Contributions/ContributionList.vue b/frontend/src/components/Contributions/ContributionList.vue index ca4e7a9a0..e76664e03 100644 --- a/frontend/src/components/Contributions/ContributionList.vue +++ b/frontend/src/components/Contributions/ContributionList.vue @@ -3,6 +3,7 @@

{{ $t('contribution.alert.answerQuestion') }} diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue index 28d3bdabf..ae0dca62e 100644 --- a/frontend/src/pages/Community.vue +++ b/frontend/src/pages/Community.vue @@ -39,6 +39,7 @@
Date: Mon, 14 Nov 2022 15:31:42 +0100 Subject: [PATCH 3/5] same event on chat-dot icon --- frontend/src/components/Contributions/ContributionListItem.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/components/Contributions/ContributionListItem.vue b/frontend/src/components/Contributions/ContributionListItem.vue index 6cf8f4cab..d09b1c790 100644 --- a/frontend/src/components/Contributions/ContributionListItem.vue +++ b/frontend/src/components/Contributions/ContributionListItem.vue @@ -54,8 +54,7 @@ v-b-toggle="collapsId" icon="chat-dots" class="h2 mr-5" - @mousedown="$root.$emit('close-all-open-collapse')" - @click="getListContributionMessages" + @click="$emit('closeAllOpenCollapse'), getListContributionMessages" > From 6e83d9447a66d426d9ea22e37b8f48f69ea0c4e6 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Nov 2022 16:49:00 +0100 Subject: [PATCH 4/5] add test, coverage to over 95% --- .../Contributions/ContributionListItem.spec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/components/Contributions/ContributionListItem.spec.js b/frontend/src/components/Contributions/ContributionListItem.spec.js index 0b0519dda..f477d1c2c 100644 --- a/frontend/src/components/Contributions/ContributionListItem.spec.js +++ b/frontend/src/components/Contributions/ContributionListItem.spec.js @@ -132,6 +132,16 @@ describe('ContributionListItem', () => { expect(wrapper.emitted('delete-contribution')).toBeFalsy() }) }) + + describe('updateState', () => { + beforeEach(async () => { + await wrapper.vm.updateState() + }) + + it('emit update-state', () => { + expect(wrapper.vm.$emit('update-state')).toBeTruthy() + }) + }) }) }) }) From 1b3a25eb0dd2e4ad153ef95bbab0a0d55ff4c1d6 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 14 Nov 2022 17:27:43 +0100 Subject: [PATCH 5/5] close all open collapse if tab new constribution and if edit --- .../Contributions/ContributionListItem.vue | 13 +++++++------ frontend/src/pages/Community.vue | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/Contributions/ContributionListItem.vue b/frontend/src/components/Contributions/ContributionListItem.vue index d09b1c790..22f7e791c 100644 --- a/frontend/src/components/Contributions/ContributionListItem.vue +++ b/frontend/src/components/Contributions/ContributionListItem.vue @@ -32,12 +32,13 @@ v-if="!['CONFIRMED', 'DELETED'].includes(state) && !allContribution" class="pointer ml-5" @click=" - $emit('update-contribution-form', { - id: id, - contributionDate: contributionDate, - memo: memo, - amount: amount, - }) + $emit('closeAllOpenCollapse'), + $emit('update-contribution-form', { + id: id, + contributionDate: contributionDate, + memo: memo, + amount: amount, + }) " > diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue index ae0dca62e..58426207f 100644 --- a/frontend/src/pages/Community.vue +++ b/frontend/src/pages/Community.vue @@ -2,7 +2,7 @@
- +