Skip to content

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

feat: enable all labels (#3745)

Liu Ji2f2637a28097
diff --git a/frontend/src/components/DatabaseLabels/DatabaseLabelPropItem.vue b/frontend/src/components/DatabaseLabels/DatabaseLabelPropItem.vue
index 01e157caf1..48d9625f78 100644
--- a/frontend/src/components/DatabaseLabels/DatabaseLabelPropItem.vue
+++ b/frontend/src/components/DatabaseLabels/DatabaseLabelPropItem.vue
@@ -4,7 +4,6 @@
{{ value || $t("label.empty-label-value") }}
<heroicons-outline:pencil
- v-if="editable"
class="w-5 h-5 p-0.5 rounded cursor-pointer hover:bg-control-bg-hover"
@click="startEditing"
/>
@@ -45,7 +44,7 @@
</template>
<script lang="ts" setup>
-import { computed, nextTick, reactive, ref, watch } from "vue";
+import { nextTick, reactive, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
import { Database, LabelKeyType, LabelValueType } from "../../types";
import { LABEL_VALUE_EMPTY, MAX_LABEL_VALUE_LENGTH } from "../../utils";
@@ -59,7 +58,6 @@ type LocalState = {
const props = defineProps<{
labelKey: LabelKeyType;
- required: boolean;
value: LabelValueType | undefined;
database: Database;
allowEdit: boolean;
@@ -85,12 +83,6 @@ watch(
(value) => (state.value = value)
);
-const editable = computed((): boolean => {
- if (!props.allowEdit) return false;
-
- return !props.required;
-});
-
const startEditing = () => {
state.value = props.value;
state.error = undefined;
diff --git a/frontend/src/components/DatabaseLabels/DatabaseLabelProps.vue b/frontend/src/components/DatabaseLabels/DatabaseLabelProps.vue
index 6f95ce8201..b1e66288b5 100644
--- a/frontend/src/components/DatabaseLabels/DatabaseLabelProps.vue
+++ b/frontend/src/components/DatabaseLabels/DatabaseLabelProps.vue
@@ -5,7 +5,6 @@
<DatabaseLabelPropItem
:label-key="label"
:value="getLabelValue(label)"
- :required="isRequired(label)"
:database="database"
:allow-edit="allowEdit"
@update:value="(value) => onUpdateValue(label, value)"
@@ -16,14 +15,14 @@
<script lang="ts" setup>
import { cloneDeep } from "lodash-es";
-import { computed, withDefaults, watch, reactive } from "vue";
+import { withDefaults, watch, reactive } from "vue";
import type {
Database,
DatabaseLabel,
LabelKeyType,
LabelValueType,
} from "@/types";
-import { parseLabelListInTemplate, PRESET_LABEL_KEYS } from "@/utils";
+import { PRESET_LABEL_KEYS } from "@/utils";
import DatabaseLabelPropItem from "./DatabaseLabelPropItem.vue";
const props = withDefaults(
@@ -50,18 +49,6 @@ watch(
(list) => (state.labelList = cloneDeep(list))
);
-const requiredLabelList = computed((): string[] => {
- const { project } = props.database;
- if (project.tenantMode !== "TENANT") return [];
- if (!project.dbNameTemplate) return [];
-
- return parseLabelListInTemplate(project.dbNameTemplate);
-});
-
-const isRequired = (key: LabelKeyType) => {
- return requiredLabelList.value.includes(key);
-};
-
const getLabelValue = (key: LabelKeyType): LabelValueType | undefined => {
return state.labelList.find((label) => label.key === key)?.value || "";
};
diff --git a/frontend/src/components/TransferDatabaseForm/SelectDatabaseLabel.vue b/frontend/src/components/TransferDatabaseForm/SelectDatabaseLabel.vue
index efed7e63b6..91c79bb738 100644
--- a/frontend/src/components/TransferDatabaseForm/SelectDatabaseLabel.vue
+++ b/frontend/src/components/TransferDatabaseForm/SelectDatabaseLabel.vue
@@ -24,7 +24,6 @@
<div class="flex flex-col space-y-1 w-64 mt-1">
<BBTextField
- :disabled="isParsedLabel(label)"
:value="getLabelValue(label)"
:placeholder="getLabelPlaceholder(label)"
class="textfield"