mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #2388 from gradido/2380-Community-tab-change-must-close-conversation-window
fix(frontend): close all open collapse by change tabs in community
This commit is contained in:
commit
d9ef1c78fa
@ -3,6 +3,7 @@
|
|||||||
<div class="list-group" v-for="item in items" :key="item.id">
|
<div class="list-group" v-for="item in items" :key="item.id">
|
||||||
<contribution-list-item
|
<contribution-list-item
|
||||||
v-bind="item"
|
v-bind="item"
|
||||||
|
@closeAllOpenCollapse="$emit('closeAllOpenCollapse')"
|
||||||
:contributionId="item.id"
|
:contributionId="item.id"
|
||||||
:allContribution="allContribution"
|
:allContribution="allContribution"
|
||||||
@update-contribution-form="updateContributionForm"
|
@update-contribution-form="updateContributionForm"
|
||||||
|
|||||||
@ -132,6 +132,16 @@ describe('ContributionListItem', () => {
|
|||||||
expect(wrapper.emitted('delete-contribution')).toBeFalsy()
|
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()
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -32,6 +32,7 @@
|
|||||||
v-if="!['CONFIRMED', 'DELETED'].includes(state) && !allContribution"
|
v-if="!['CONFIRMED', 'DELETED'].includes(state) && !allContribution"
|
||||||
class="pointer ml-5"
|
class="pointer ml-5"
|
||||||
@click="
|
@click="
|
||||||
|
$emit('closeAllOpenCollapse'),
|
||||||
$emit('update-contribution-form', {
|
$emit('update-contribution-form', {
|
||||||
id: id,
|
id: id,
|
||||||
contributionDate: contributionDate,
|
contributionDate: contributionDate,
|
||||||
@ -54,7 +55,7 @@
|
|||||||
v-b-toggle="collapsId"
|
v-b-toggle="collapsId"
|
||||||
icon="chat-dots"
|
icon="chat-dots"
|
||||||
class="h2 mr-5"
|
class="h2 mr-5"
|
||||||
@click="getListContributionMessages"
|
@click="$emit('closeAllOpenCollapse'), getListContributionMessages"
|
||||||
></b-icon>
|
></b-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -64,7 +65,7 @@
|
|||||||
v-if="state === 'IN_PROGRESS'"
|
v-if="state === 'IN_PROGRESS'"
|
||||||
v-b-toggle="collapsId"
|
v-b-toggle="collapsId"
|
||||||
variant="warning"
|
variant="warning"
|
||||||
@click="getListContributionMessages"
|
@click="$emit('closeAllOpenCollapse'), getListContributionMessages"
|
||||||
>
|
>
|
||||||
{{ $t('contribution.alert.answerQuestion') }}
|
{{ $t('contribution.alert.answerQuestion') }}
|
||||||
</b-button>
|
</b-button>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<div class="community-page">
|
<div class="community-page">
|
||||||
<div>
|
<div>
|
||||||
<b-tabs v-model="tabIndex" content-class="mt-3" align="center">
|
<b-tabs v-model="tabIndex" content-class="mt-3" align="center">
|
||||||
<b-tab :title="$t('community.submitContribution')">
|
<b-tab :title="$t('community.submitContribution')" @click="closeAllOpenCollapse">
|
||||||
<contribution-form
|
<contribution-form
|
||||||
@set-contribution="setContribution"
|
@set-contribution="setContribution"
|
||||||
@update-contribution="updateContribution"
|
@update-contribution="updateContribution"
|
||||||
@ -39,6 +39,7 @@
|
|||||||
</b-alert>
|
</b-alert>
|
||||||
</div>
|
</div>
|
||||||
<contribution-list
|
<contribution-list
|
||||||
|
@closeAllOpenCollapse="closeAllOpenCollapse"
|
||||||
:items="items"
|
:items="items"
|
||||||
@update-list-contributions="updateListContributions"
|
@update-list-contributions="updateListContributions"
|
||||||
@update-contribution-form="updateContributionForm"
|
@update-contribution-form="updateContributionForm"
|
||||||
@ -49,7 +50,7 @@
|
|||||||
:pageSize="pageSize"
|
:pageSize="pageSize"
|
||||||
/>
|
/>
|
||||||
</b-tab>
|
</b-tab>
|
||||||
<b-tab :title="$t('navigation.community')">
|
<b-tab :title="$t('navigation.community')" @click="closeAllOpenCollapse">
|
||||||
<b-alert show dismissible fade variant="secondary" class="text-dark">
|
<b-alert show dismissible fade variant="secondary" class="text-dark">
|
||||||
<h4 class="alert-heading">{{ $t('navigation.community') }}</h4>
|
<h4 class="alert-heading">{{ $t('navigation.community') }}</h4>
|
||||||
<p>
|
<p>
|
||||||
@ -112,6 +113,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
setContribution(data) {
|
||||||
this.$apollo
|
this.$apollo
|
||||||
.mutate({
|
.mutate({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user