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 @@
{ 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() + }) + }) }) }) }) diff --git a/frontend/src/components/Contributions/ContributionListItem.vue b/frontend/src/components/Contributions/ContributionListItem.vue index 683d234ba..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, + }) " > @@ -54,7 +55,7 @@ v-b-toggle="collapsId" icon="chat-dots" class="h2 mr-5" - @click="getListContributionMessages" + @click="$emit('closeAllOpenCollapse'), getListContributionMessages" >
@@ -64,7 +65,7 @@ v-if="state === 'IN_PROGRESS'" v-b-toggle="collapsId" variant="warning" - @click="getListContributionMessages" + @click="$emit('closeAllOpenCollapse'), getListContributionMessages" > {{ $t('contribution.alert.answerQuestion') }} diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue index 786307405..58426207f 100644 --- a/frontend/src/pages/Community.vue +++ b/frontend/src/pages/Community.vue @@ -2,7 +2,7 @@
- +
- +

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

@@ -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({