Browse Source

fix(gui-v2): add missing Go To Dashboard button

pull/2885/head
Wing-Kam Wong 2 years ago
parent
commit
a62a5834b1
  1. 15
      packages/nc-gui-v2/components/dlg/AirtableImport.vue

15
packages/nc-gui-v2/components/dlg/AirtableImport.vue

@ -14,18 +14,28 @@ interface Props {
} }
const { modelValue } = defineProps<Props>() const { modelValue } = defineProps<Props>()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
// TODO: handle baseURL // TODO: handle baseURL
const baseURL = 'http://localhost:8080' // this.$axios.defaults.baseURL const baseURL = 'http://localhost:8080' // this.$axios.defaults.baseURL
const { $state } = useNuxtApp() const { $state } = useNuxtApp()
const toast = useToast() const toast = useToast()
const { sqlUi, project, loadTables } = useProject() const { sqlUi, project, loadTables } = useProject()
const loading = ref(false) const loading = ref(false)
const showGoToDashboardButton = ref(false)
const step = ref(1) const step = ref(1)
const progress = ref<Record<string, any>[]>([]) const progress = ref<Record<string, any>[]>([])
let socket: Socket | null let socket: Socket | null
const syncSource = ref({ const syncSource = ref({
id: '', id: '',
type: 'Airtable', type: 'Airtable',
@ -64,6 +74,7 @@ const dialogShow = computed({
}) })
const useForm = Form.useForm const useForm = Form.useForm
const { resetFields, validate, validateInfos } = useForm(syncSource, validators) const { resetFields, validate, validateInfos } = useForm(syncSource, validators)
const disableImportButton = computed(() => { const disableImportButton = computed(() => {
@ -195,6 +206,7 @@ onMounted(async () => {
socket.on('progress', async (d: Record<string, any>) => { socket.on('progress', async (d: Record<string, any>) => {
progress.value.push(d) progress.value.push(d)
if (d.status === 'COMPLETED') { if (d.status === 'COMPLETED') {
showGoToDashboardButton.value = true
await loadTables() await loadTables()
// TODO: add tab of the first table // TODO: add tab of the first table
} }
@ -314,6 +326,9 @@ onBeforeUnmount(() => {
<span class="text-green-500 ml-2"> Importing</span> <span class="text-green-500 ml-2"> Importing</span>
</div> </div>
</a-card> </a-card>
<div class="flex justify-center items-center">
<a-button v-if="showGoToDashboardButton" class="mt-4" size="large" @click="dialogShow = false">Go to Dashboard</a-button>
</div>
</div> </div>
</div> </div>
</a-modal> </a-modal>

Loading…
Cancel
Save