Browse Source

fix: refresh cmd palette

pull/6585/head
DarkPhoenix2704 1 year ago
parent
commit
bfacd80715
  1. 6
      packages/nc-gui/components/dashboard/settings/DataSources.vue
  2. 4
      packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue
  3. 4
      packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue
  4. 3
      packages/nc-gui/components/dlg/ProjectDuplicate.vue
  5. 3
      packages/nc-gui/components/dlg/TableCreate.vue
  6. 3
      packages/nc-gui/components/dlg/TableDuplicate.vue
  7. 4
      packages/nc-gui/components/dlg/ViewCreate.vue
  8. 4
      packages/nc-gui/components/dlg/ViewDelete.vue
  9. 4
      packages/nc-gui/components/dlg/WorkspaceDelete.vue

6
packages/nc-gui/components/dashboard/settings/DataSources.vue

@ -87,6 +87,8 @@ const deleteBase = async () => {
await loadProject(base.value.id as string, true) await loadProject(base.value.id as string, true)
} catch (e: any) { } catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e)) message.error(await extractSdkResponseErrorMsg(e))
} finally {
refreshCommandPalette()
} }
} }
@ -105,6 +107,8 @@ const toggleBase = async (source: BaseType, state: boolean) => {
await loadProject(base.value.id as string, true) await loadProject(base.value.id as string, true)
} catch (e: any) { } catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e)) message.error(await extractSdkResponseErrorMsg(e))
} finally {
refreshCommandPalette()
} }
} }
@ -133,6 +137,8 @@ const moveBase = async (e: any) => {
await loadBases() await loadBases()
} catch (e: any) { } catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e)) message.error(await extractSdkResponseErrorMsg(e))
} finally {
refreshCommandPalette()
} }
} }

4
packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue

@ -39,6 +39,8 @@ const { base } = storeToRefs(baseStore)
const { loadProjectTables } = useTablesStore() const { loadProjectTables } = useTablesStore()
const { refreshCommandPalette } = useCommandPalette()
const _projectId = inject(ProjectIdInj, undefined) const _projectId = inject(ProjectIdInj, undefined)
const baseId = computed(() => _projectId?.value ?? base.value?.id) const baseId = computed(() => _projectId?.value ?? base.value?.id)
@ -293,6 +295,8 @@ const createSource = async () => {
) )
} catch (e: any) { } catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e)) message.error(await extractSdkResponseErrorMsg(e))
} finally {
refreshCommandPalette()
} }
} }

4
packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue

@ -39,6 +39,8 @@ const { base } = storeToRefs(baseStore)
const _projectId = inject(ProjectIdInj, undefined) const _projectId = inject(ProjectIdInj, undefined)
const baseId = computed(() => _projectId?.value ?? base.value?.id) const baseId = computed(() => _projectId?.value ?? base.value?.id)
const { refreshCommandPalette } = useCommandPalette()
const useForm = Form.useForm const useForm = Form.useForm
const testSuccess = ref(false) const testSuccess = ref(false)
@ -235,6 +237,8 @@ const editBase = async () => {
emit('close') emit('close')
} catch (e: any) { } catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e)) message.error(await extractSdkResponseErrorMsg(e))
} finally {
refreshCommandPalette()
} }
} }

3
packages/nc-gui/components/dlg/ProjectDuplicate.vue

@ -11,6 +11,8 @@ const props = defineProps<{
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
const { refreshCommandPalette } = useCommandPalette()
const { api } = useApi() const { api } = useApi()
const dialogShow = useVModel(props, 'modelValue', emit) const dialogShow = useVModel(props, 'modelValue', emit)
@ -60,6 +62,7 @@ const _duplicate = async () => {
message.error(await extractSdkResponseErrorMsg(e)) message.error(await extractSdkResponseErrorMsg(e))
} finally { } finally {
isLoading.value = false isLoading.value = false
refreshCommandPalette()
dialogShow.value = false dialogShow.value = false
} }
} }

3
packages/nc-gui/components/dlg/TableCreate.vue

@ -34,6 +34,8 @@ const { isMysql, isMssql, isPg } = useBase()
const { loadProjectTables, addTable } = useTablesStore() const { loadProjectTables, addTable } = useTablesStore()
const { refreshCommandPalette } = useCommandPalette()
const { table, createTable, generateUniqueTitle, tables, base } = useTableNew({ const { table, createTable, generateUniqueTitle, tables, base } = useTableNew({
async onTableCreate(table) { async onTableCreate(table) {
// await loadProject(props.baseId) // await loadProject(props.baseId)
@ -120,6 +122,7 @@ const _createTable = async () => {
setTimeout(() => { setTimeout(() => {
creating.value = false creating.value = false
}, 500) }, 500)
refreshCommandPalette()
} }
} }

3
packages/nc-gui/components/dlg/TableDuplicate.vue

@ -14,6 +14,8 @@ const { api } = useApi()
const dialogShow = useVModel(props, 'modelValue', emit) const dialogShow = useVModel(props, 'modelValue', emit)
const { refreshCommandPalette } = useCommandPalette()
const options = ref({ const options = ref({
includeData: true, includeData: true,
includeViews: true, includeViews: true,
@ -41,6 +43,7 @@ const _duplicate = async () => {
} finally { } finally {
isLoading.value = false isLoading.value = false
dialogShow.value = false dialogShow.value = false
refreshCommandPalette()
} }
} }

4
packages/nc-gui/components/dlg/ViewCreate.vue

@ -42,6 +42,8 @@ const { getMeta } = useMetas()
const { viewsByTable } = storeToRefs(useViewsStore()) const { viewsByTable } = storeToRefs(useViewsStore())
const { refreshCommandPalette } = useCommandPalette()
const { selectedViewId, groupingFieldColumnId, geoDataFieldColumnId, tableId } = toRefs(props) const { selectedViewId, groupingFieldColumnId, geoDataFieldColumnId, tableId } = toRefs(props)
const meta = ref<TableType | undefined>() const meta = ref<TableType | undefined>()
@ -171,6 +173,8 @@ async function onSubmit() {
} }
} catch (e: any) { } catch (e: any) {
message.error(e.message) message.error(e.message)
} finally {
refreshCommandPalette()
} }
vModel.value = false vModel.value = false

4
packages/nc-gui/components/dlg/ViewDelete.vue

@ -15,6 +15,8 @@ const props = defineProps<Props>()
const emits = defineEmits<Emits>() const emits = defineEmits<Emits>()
const { refreshCommandPalette } = useCommandPalette()
const { view } = props const { view } = props
const vModel = useVModel(props, 'modelValue', emits) const vModel = useVModel(props, 'modelValue', emits)
@ -35,6 +37,8 @@ async function onDelete() {
$e('a:view:delete', { view: props.view.type }) $e('a:view:delete', { view: props.view.type })
} catch (e: any) { } catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e)) message.error(await extractSdkResponseErrorMsg(e))
} finally {
refreshCommandPalette()
} }
// telemetry event // telemetry event

4
packages/nc-gui/components/dlg/WorkspaceDelete.vue

@ -13,6 +13,8 @@ const { deleteWorkspace: _deleteWorkspace, loadWorkspaces, navigateToWorkspace }
const { workspaces, workspacesList } = storeToRefs(workspaceStore) const { workspaces, workspacesList } = storeToRefs(workspaceStore)
const { refreshCommandPalette } = useCommandPalette()
const workspace = computed(() => workspaces.value.get(props.workspaceId)) const workspace = computed(() => workspaces.value.get(props.workspaceId))
const onDelete = async () => { const onDelete = async () => {
@ -29,6 +31,8 @@ const onDelete = async () => {
await navigateToWorkspace(workspacesList.value?.[0]?.id) await navigateToWorkspace(workspacesList.value?.[0]?.id)
} catch (e: any) { } catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e)) message.error(await extractSdkResponseErrorMsg(e))
} finally {
refreshCommandPalette()
} }
} }
</script> </script>

Loading…
Cancel
Save