fix: prevent compare dialogs from closing on outside click
Add @interact-outside.prevent to schema diff and data compare dialogs to avoid accidental dismissal. Move compare action buttons to footer, matching the SQL file execution dialog layout.
This commit is contained in:
1 parent
e6e5309807
commit
2dc462808c
2 files changed
+23
-17
No files matched your search
@@ -372,7 +372,7 @@ watch(
|
||||
|
||||
<template>
|
||||
<Dialog v-model:open="open">
|
||||
<DialogContent class="sm:max-w-2xl max-h-[80vh] flex flex-col overflow-hidden">
|
||||
<DialogContent class="sm:max-w-2xl max-h-[80vh] flex flex-col overflow-hidden" @interact-outside.prevent>
|
||||
<DialogHeader>
|
||||
<DialogTitle class="flex items-center gap-2">
|
||||
<GitCompareArrows class="w-4 h-4" />
|
||||
@@ -492,12 +492,6 @@ watch(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button v-if="step === 'select'" size="sm" :disabled="!canCompare || loadingMeta" @click="startCompare">
|
||||
<Loader2 v-if="loadingMeta" class="w-3.5 h-3.5 mr-1 animate-spin" />
|
||||
<GitCompareArrows v-else class="w-3.5 h-3.5 mr-1" />
|
||||
{{ loadingMeta ? t("common.loading") : t("diff.compare") }}
|
||||
</Button>
|
||||
|
||||
<!-- Comparing -->
|
||||
<div v-if="step === 'comparing'" class="flex items-center justify-center py-8 text-sm text-muted-foreground">
|
||||
<Loader2 class="w-4 h-4 animate-spin mr-2" />
|
||||
@@ -643,6 +637,15 @@ watch(
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<DialogFooter v-if="!(step === 'result' && diffs.length > 0)" class="flex items-center gap-2">
|
||||
<Button variant="outline" @click="open = false">{{ t("common.close") }}</Button>
|
||||
<Button v-if="step === 'select'" size="sm" :disabled="!canCompare || loadingMeta" @click="startCompare">
|
||||
<Loader2 v-if="loadingMeta" class="w-3.5 h-3.5 mr-1 animate-spin" />
|
||||
<GitCompareArrows v-else class="w-3.5 h-3.5 mr-1" />
|
||||
{{ loadingMeta ? t("common.loading") : t("diff.compare") }}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
|
||||
<DialogFooter v-if="step === 'result' && diffs.length > 0" class="flex items-center gap-2">
|
||||
<span v-if="executing" class="text-xs text-muted-foreground mr-auto">
|
||||
{{ t("diff.syncProgress", { current: executedCount, total: executeTotal }) }}
|
||||
|
||||
Reference in new issue
Block a user