Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: no extra edit for editing view and procedures (#13318)

Danny Xu079799857608
diff --git a/frontend/src/components/SchemaEditorLite/Panels/CommonCodeEditor.vue b/frontend/src/components/SchemaEditorLite/Panels/CommonCodeEditor.vue
index a05c09568d..bce6cf8b37 100644
--- a/frontend/src/components/SchemaEditorLite/Panels/CommonCodeEditor.vue
+++ b/frontend/src/components/SchemaEditorLite/Panels/CommonCodeEditor.vue
@@ -1,41 +1,6 @@
<template>
<div class="h-full flex flex-col gap-1 overflow-y-hidden pt-1">
<div class="flex justify-between items-center text-sm">
- <div class="flex justify-start items-center gap-2">
- <template
- v-if="!readonly && (status === 'normal' || status === 'updated')"
- >
- <NButton
- v-if="!state.unlocked"
- size="small"
- @click="state.unlocked = true"
- >
- <template #icon>
- <SquarePenIcon class="w-3.5 h-3.5" />
- </template>
- {{ $t("common.edit") }}
- </NButton>
- <template v-else>
- <NButton size="small" @click="cancelEdit">
- <template #icon>
- <XIcon class="w-4 h-4" />
- </template>
- {{ $t("common.cancel") }}
- </NButton>
- <NButton
- size="small"
- type="primary"
- :disabled="props.code === state.code"
- @click="confirmEdit"
- >
- <template #icon>
- <CheckIcon class="w-4 h-4" />
- </template>
- {{ $t("common.confirm") }}
- </NButton>
- </template>
- </template>
- </div>
<slot name="header-suffix" />
</div>
<MonacoEditor
@@ -53,8 +18,6 @@
</template>
<script setup lang="ts">
-import { XIcon, CheckIcon, SquarePenIcon } from "lucide-vue-next";
-import { NButton } from "naive-ui";
import { computed, reactive, watch } from "vue";
import { MonacoEditor } from "@/components/MonacoEditor";
import type { ComposedDatabase } from "@/types";
@@ -62,7 +25,6 @@ import type { EditStatus } from "..";
type LocalState = {
code: string;
- unlocked: boolean;
};
const props = defineProps<{
@@ -78,37 +40,18 @@ const emit = defineEmits<{
const state = reactive<LocalState>({
code: props.code,
- unlocked: false,
});
const editable = computed(() => {
if (props.readonly) {
return false;
}
- if (props.status === "dropped") {
- return false;
- }
- if (props.status === "created") {
- return true;
- }
- return state.unlocked;
+ return true;
});
-const cancelEdit = () => {
- state.unlocked = false;
- state.code = props.code;
-};
-
-const confirmEdit = () => {
- state.unlocked = false;
- emit("update:code", state.code);
-};
-
const handleUpdateCode = (code: string) => {
state.code = code;
- if (props.status === "created") {
- emit("update:code", code);
- }
+ emit("update:code", code);
};
watch(