Skip to content

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

Remove the preprocessor logic for now

天舟1bd9baa03c98
diff --git a/frontend/src/plugins/task/DatabaseRequestTemplate.ts b/frontend/src/plugins/task/DatabaseRequestTemplate.ts
index 1431b183fe..48997bc1cb 100644
--- a/frontend/src/plugins/task/DatabaseRequestTemplate.ts
+++ b/frontend/src/plugins/task/DatabaseRequestTemplate.ts
@@ -63,13 +63,6 @@ const template: TaskTemplate = {
}
return isEmpty(value.id);
},
- preprocessor: (value: DatabaseFieldPayload): DatabaseFieldPayload => {
- // In case caller passes corrupted data.
- // Handled here instead of the caller, because it's
- // preprocessor specific behavior to handle fallback.
- value.name = value.name?.toLowerCase();
- return value;
- },
placeholder: "New database name",
},
{
diff --git a/frontend/src/plugins/task/DatabaseSchemaUpdateTemplate.ts b/frontend/src/plugins/task/DatabaseSchemaUpdateTemplate.ts
index 31f4f2c9c9..7ce4631665 100644
--- a/frontend/src/plugins/task/DatabaseSchemaUpdateTemplate.ts
+++ b/frontend/src/plugins/task/DatabaseSchemaUpdateTemplate.ts
@@ -35,12 +35,6 @@ const template: TaskTemplate = {
name: "DB Name",
type: "Database",
required: true,
- preprocessor: (name: string): string => {
- // In case caller passes corrupted data.
- // Handled here instead of the caller, because it's
- // preprocessor specific behavior to handle fallback.
- return name?.toLowerCase();
- },
},
],
};
diff --git a/frontend/src/plugins/types.ts b/frontend/src/plugins/types.ts
index ddc6da9699..48e756d8f5 100644
--- a/frontend/src/plugins/types.ts
+++ b/frontend/src/plugins/types.ts
@@ -45,8 +45,6 @@ export type TaskField = {
// whether it's ready to submit the data.
// If not present, we will use the loadash/isEmpty check.
isEmpty?: (value: any) => boolean;
- // Preprocessor such as enforcing lowercase.
- preprocessor?: (value: any) => any;
// Placeholder displayed on UI.
placeholder?: string;
};
diff --git a/frontend/src/views/TaskDetail.vue b/frontend/src/views/TaskDetail.vue
index 5ac75edb8d..2d69daaa98 100644
--- a/frontend/src/views/TaskDetail.vue
+++ b/frontend/src/views/TaskDetail.vue
@@ -412,10 +412,7 @@ export default {
}
};
- const updateCustomField = (field: TaskField, value: string) => {
- if (field.preprocessor) {
- value = field.preprocessor(value);
- }
+ const updateCustomField = (field: TaskField, value: any) => {
state.task.payload[field.id] = value;
if (!state.new) {
patchTask({
diff --git a/frontend/src/views/TaskOutputPanel.vue b/frontend/src/views/TaskOutputPanel.vue
index 9ff0256f67..72cd6090ca 100644
--- a/frontend/src/views/TaskOutputPanel.vue
+++ b/frontend/src/views/TaskOutputPanel.vue
@@ -14,11 +14,7 @@
type="text"
class="flex-1 min-w-0 block w-full px-3 py-2 border border-r border-control-border focus:mr-0.5 focus:ring-control focus:border-control sm:text-sm"
:name="field.id"
- :value="
- field.preprocessor
- ? field.preprocessor(task.payload[field.id])
- : task.payload[field.id]
- "
+ :value="task.payload[field.id]"
@input="$emit('update-custom-field', field, $event.target.value)"
/>
<!-- Disallow tabbing since the focus ring is partially covered by the text field due to overlaying -->
diff --git a/frontend/src/views/TaskSidebar.vue b/frontend/src/views/TaskSidebar.vue
index a36fc97ff0..fd844cab48 100644
--- a/frontend/src/views/TaskSidebar.vue
+++ b/frontend/src/views/TaskSidebar.vue
@@ -343,8 +343,7 @@ export default {
const fieldValue = (field: TaskField): string | DatabaseFieldPayload => {
// Do a deep clone to prevent caller accidentally changes the original data.
- let value = cloneDeep(props.task.payload[field.id]);
- return field.preprocessor ? field.preprocessor(value) : value;
+ return cloneDeep(props.task.payload[field.id]);
};
const environmentId = (): string => {
@@ -358,18 +357,10 @@ export default {
const el = customFieldRefList[customFieldIndex]
.value as HTMLInputElement;
value = el.value;
- if (field.preprocessor) {
- value = field.preprocessor(value);
- el.value = value;
- }
} else if (field.type === "Environment") {
const el = customFieldRefList[customFieldIndex]
.value as HTMLSelectElement;
value = el.value;
- if (field.preprocessor) {
- value = field.preprocessor(value);
- el.value = value;
- }
}
if (!props.new && field.required && isEmpty(value)) {