Skip to content

Commit 7e975e2

Browse files
authored
Fix empty drawer after publish conversation (#192)
1 parent fb152e4 commit 7e975e2

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

frontend/src/premium/community-help-center/components/community-help-center-table.vue

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,6 @@
182182
/>
183183
</div>
184184
</div>
185-
<app-community-help-center-conversation-drawer
186-
:expanded="drawerConversationId !== null"
187-
:conversation-id="drawerConversationId"
188-
@close="drawerConversationId = null"
189-
></app-community-help-center-conversation-drawer>
190185
</div>
191186
</div>
192187
</div>
@@ -206,13 +201,14 @@ import { useStore } from 'vuex'
206201
import { formatDateToTimeAgo } from '@/utils/date'
207202
import AppConversationDropdown from '@/modules/conversation/components/conversation-dropdown'
208203
import AppCommunityHelpCenterToolbar from './community-help-center-toolbar'
209-
import AppCommunityHelpCenterConversationDrawer from '@/premium/community-help-center/components/community-help-center-conversation-drawer'
210204
211205
const store = useStore()
212-
defineEmits(['cta-click'])
206+
const emit = defineEmits([
207+
'cta-click',
208+
'open-conversation-drawer'
209+
])
213210
214211
const table = ref(null)
215-
const drawerConversationId = ref(null)
216212
217213
const loading = computed(
218214
() => store.state.communityHelpCenter.list.loading
@@ -311,7 +307,7 @@ function rowClass({ row }) {
311307
}
312308
313309
function handleRowClick(row) {
314-
drawerConversationId.value = row.id
310+
emit('open-conversation-drawer', row.id)
315311
}
316312
317313
function timeAgo(date) {

frontend/src/premium/community-help-center/pages/community-help-center-page.vue

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@
3232
</div>
3333
<app-community-help-center-tabs />
3434
<app-community-help-center-filter />
35-
<app-community-help-center-table />
35+
<app-community-help-center-table
36+
@open-conversation-drawer="onConversationDrawerOpen"
37+
/>
38+
39+
<app-community-help-center-conversation-drawer
40+
:expanded="!!drawerConversationId"
41+
:conversation-id="drawerConversationId"
42+
@close="onConversationDrawerClose"
43+
></app-community-help-center-conversation-drawer>
3644
</app-page-wrapper>
3745
</template>
3846

@@ -43,6 +51,7 @@ import AppCommunityHelpCenterTable from '@/premium/community-help-center/compone
4351
import AppCommunityHelpCenterTabs from '@/premium/community-help-center/components/community-help-center-tabs'
4452
import AppCommunityHelpCenterFilter from '@/premium/community-help-center/components/community-help-center-filter'
4553
import AppCommunityHelpCenterSettings from '@/premium/community-help-center/components/community-help-center-settings'
54+
import AppCommunityHelpCenterConversationDrawer from '@/premium/community-help-center/components/community-help-center-conversation-drawer'
4655
import config from '@/config'
4756
4857
export default {
@@ -53,7 +62,14 @@ export default {
5362
AppCommunityHelpCenterTable,
5463
AppCommunityHelpCenterTabs,
5564
AppCommunityHelpCenterFilter,
56-
AppCommunityHelpCenterSettings
65+
AppCommunityHelpCenterSettings,
66+
AppCommunityHelpCenterConversationDrawer
67+
},
68+
69+
data() {
70+
return {
71+
drawerConversationId: null
72+
}
5773
},
5874
5975
computed: {
@@ -78,7 +94,13 @@ export default {
7894
'communityHelpCenter/doOpenSettingsDrawer',
7995
doCloseSettingsDrawer:
8096
'communityHelpCenter/doCloseSettingsDrawer'
81-
})
97+
}),
98+
onConversationDrawerOpen(id) {
99+
this.drawerConversationId = id
100+
},
101+
onConversationDrawerClose() {
102+
this.drawerConversationId = null
103+
}
82104
}
83105
}
84106
</script>

0 commit comments

Comments
 (0)