-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
POC: Navigate while staying in meeting
- Loading branch information
1 parent
9b44f89
commit f56de04
Showing
5 changed files
with
114 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<FloatingTable /> | ||
<slot></slot> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import FloatingTable from '#components/embedded-table/FloatingTable.vue' | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template> | ||
<div v-show="isActive" class="container"> | ||
<EmbeddedTable v-if="errorMessage === null" :url="tableUrl" @table-closed="onTableClosed" /> | ||
<div v-else class="test-not-found"> | ||
{{ $t('table.notFound') }} | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import EmbeddedTable from '#components/embedded-table/EmbeddedTable.vue' | ||
import { useTable } from './useTable' | ||
const { errorMessage, tableUrl, isActive, leaveTable } = useTable() | ||
const onTableClosed = () => { | ||
leaveTable() | ||
} | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@use 'sass:map'; | ||
@import 'vuetify/lib/styles/settings/_variables'; | ||
.container { | ||
width: 400px; | ||
height: 400px; | ||
display: flex; | ||
z-index: 1000; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { useLazyQuery } from '@vue/apollo-composable' | ||
import { ref, watch, computed } from 'vue' | ||
|
||
import GlobalErrorHandler from '#plugins/globalErrorHandler' | ||
import { joinTableQuery } from '#queries/joinTableQuery' | ||
|
||
const tableUrl = ref<string | null>(null) | ||
|
||
const tableId = ref<number | null>(null) | ||
|
||
const errorMessage = ref<string | null>(null) | ||
|
||
export const useTable = () => { | ||
const getTableId = computed(() => tableId.value) | ||
|
||
const { | ||
load, | ||
result: joinTableQueryResult, | ||
error: joinTableQueryError, | ||
} = useLazyQuery( | ||
joinTableQuery, | ||
() => ({ | ||
tableId: tableId.value, | ||
}), | ||
{ | ||
prefetch: false, | ||
fetchPolicy: 'no-cache', | ||
}, | ||
) | ||
|
||
watch(joinTableQueryResult, (data: { joinTable: string }) => { | ||
if (!data.joinTable) return | ||
tableUrl.value = data.joinTable | ||
errorMessage.value = null | ||
}) | ||
|
||
// eslint-disable-next-line promise/prefer-await-to-callbacks | ||
watch(joinTableQueryError, (error) => { | ||
if (!error) return | ||
GlobalErrorHandler.error('Error opening table', error) | ||
errorMessage.value = error.message | ||
tableUrl.value = null | ||
}) | ||
|
||
const setTableId = async (id: number) => { | ||
tableId.value = id | ||
await load() | ||
} | ||
|
||
const isActive = computed(() => tableId.value !== null) | ||
|
||
const leaveTable = () => { | ||
tableId.value = null | ||
} | ||
|
||
return { | ||
loadTable: load, | ||
getTableId, | ||
setTableId, | ||
tableUrl, | ||
isActive, | ||
leaveTable, | ||
errorMessage, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters