Skip to content

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

refactor(frontend): remove unused requiredClassification field from SQL review (#18370)

Danny Xu5ca3c1fc1e06
diff --git a/frontend/src/locales/sql-review/en-US.json b/frontend/src/locales/sql-review/en-US.json
index 407107ed61..643f61f3fe 100644
--- a/frontend/src/locales/sql-review/en-US.json
+++ b/frontend/src/locales/sql-review/en-US.json
@@ -70,10 +70,6 @@
"required": {
"title": "Require comment"
},
- "requiredClassification": {
- "title": "Require classification",
- "tooltip": "The comment should follow {'{'}classification id{'}'}-{'{'}comment{'}'} format."
- },
"maxLength": {
"title": "Max length"
}
@@ -620,10 +616,6 @@
"required": {
"title": "Require comment"
},
- "requiredClassification": {
- "title": "Require classification",
- "tooltip": "The comment should follow {'{'}classification id{'}'}-{'{'}comment{'}'} format."
- },
"maxLength": {
"title": "Max length"
}
diff --git a/frontend/src/locales/sql-review/es-ES.json b/frontend/src/locales/sql-review/es-ES.json
index 9d138b9e14..11b6c9db50 100644
--- a/frontend/src/locales/sql-review/es-ES.json
+++ b/frontend/src/locales/sql-review/es-ES.json
@@ -70,10 +70,6 @@
"required": {
"title": "Comentario obligatorio"
},
- "requiredClassification": {
- "title": "Requerir clasificación",
- "tooltip": "El comentario debe seguir el formato {'{'}identificación de clasificación{'}'}-{'{'}comentario{'}'}."
- },
"maxLength": {
"title": "Longitud máxima"
}
@@ -620,10 +616,6 @@
"required": {
"title": "Requerir comentario"
},
- "requiredClassification": {
- "title": "Requerir clasificación",
- "tooltip": "El comentario debe seguir el formato {'{'}identificación de clasificación{'}'}-{'{'}comentario{'}'}."
- },
"maxLength": {
"title": "Longitud máxima"
}
diff --git a/frontend/src/locales/sql-review/ja-JP.json b/frontend/src/locales/sql-review/ja-JP.json
index 1591987bbb..516dfa22f6 100644
--- a/frontend/src/locales/sql-review/ja-JP.json
+++ b/frontend/src/locales/sql-review/ja-JP.json
@@ -70,10 +70,6 @@
"required": {
"title": "コメントの必須化"
},
- "requiredClassification": {
- "title": "分類が必要",
- "tooltip": "コメントは、{'{'}分類 ID{'}'}-{'{'}コメント{'}'} の形式に従う必要があります。"
- },
"maxLength": {
"title": "最大長"
}
@@ -620,10 +616,6 @@
"required": {
"title": "コメントの必須化"
},
- "requiredClassification": {
- "title": "分類が必要",
- "tooltip": "コメントは、{'{'}分類 ID{'}'}-{'{'}コメント{'}'} の形式に従う必要があります。"
- },
"maxLength": {
"title": "最大長"
}
diff --git a/frontend/src/locales/sql-review/vi-VN.json b/frontend/src/locales/sql-review/vi-VN.json
index 65551060ce..0fa6a76a91 100644
--- a/frontend/src/locales/sql-review/vi-VN.json
+++ b/frontend/src/locales/sql-review/vi-VN.json
@@ -70,10 +70,6 @@
"required": {
"title": "Yêu cầu bình luận"
},
- "requiredClassification": {
- "title": "Yêu cầu phân loại",
- "tooltip": "Bình luận phải tuân theo định dạng {'{'}id phân loại{'}'}-{'{'}bình luận{'}'}."
- },
"maxLength": {
"title": "Độ dài tối đa"
}
@@ -620,10 +616,6 @@
"required": {
"title": "Yêu cầu bình luận"
},
- "requiredClassification": {
- "title": "Yêu cầu phân loại",
- "tooltip": "Bình luận phải tuân theo định dạng {'{'}id phân loại{'}'}-{'{'}bình luận{'}'}."
- },
"maxLength": {
"title": "Độ dài tối đa"
}
diff --git a/frontend/src/locales/sql-review/zh-CN.json b/frontend/src/locales/sql-review/zh-CN.json
index efc34404a7..d1cf3a7e0d 100644
--- a/frontend/src/locales/sql-review/zh-CN.json
+++ b/frontend/src/locales/sql-review/zh-CN.json
@@ -70,10 +70,6 @@
"required": {
"title": "必须注释"
},
- "requiredClassification": {
- "title": "需要分类",
- "tooltip": "评论应遵循{'{'}分类 ID{'}'}-{'{'}评论{'}'}格式。"
- },
"maxLength": {
"title": "长度限制"
}
@@ -620,10 +616,6 @@
"required": {
"title": "必须注释"
},
- "requiredClassification": {
- "title": "需要分类",
- "tooltip": "评论应遵循{'{'}分类 ID{'}'}-{'{'}评论{'}'}格式。"
- },
"maxLength": {
"title": "长度限制"
}
diff --git a/frontend/src/types/sql-review-schema.yaml b/frontend/src/types/sql-review-schema.yaml
index 1a5a95d466..325c50a1ca 100644
--- a/frontend/src/types/sql-review-schema.yaml
+++ b/frontend/src/types/sql-review-schema.yaml
@@ -123,10 +123,6 @@
payload:
type: BOOLEAN
default: false
- - key: requiredClassification
- payload:
- type: BOOLEAN
- default: false
- key: maxLength
payload:
type: NUMBER
@@ -139,10 +135,6 @@
payload:
type: BOOLEAN
default: false
- - key: requiredClassification
- payload:
- type: BOOLEAN
- default: false
- key: maxLength
payload:
type: NUMBER
@@ -155,10 +147,6 @@
payload:
type: BOOLEAN
default: false
- - key: requiredClassification
- payload:
- type: BOOLEAN
- default: false
- key: maxLength
payload:
type: NUMBER
@@ -171,10 +159,6 @@
payload:
type: BOOLEAN
default: false
- - key: requiredClassification
- payload:
- type: BOOLEAN
- default: false
- key: maxLength
payload:
type: NUMBER
@@ -187,10 +171,6 @@
payload:
type: BOOLEAN
default: false
- - key: requiredClassification
- payload:
- type: BOOLEAN
- default: false
- key: maxLength
payload:
type: NUMBER
@@ -1375,10 +1355,6 @@
payload:
type: BOOLEAN
default: false
- - key: requiredClassification
- payload:
- type: BOOLEAN
- default: false
- key: maxLength
payload:
type: NUMBER
@@ -1391,10 +1367,6 @@
payload:
type: BOOLEAN
default: false
- - key: requiredClassification
- payload:
- type: BOOLEAN
- default: false
- key: maxLength
payload:
type: NUMBER
@@ -1407,10 +1379,6 @@
payload:
type: BOOLEAN
default: false
- - key: requiredClassification
- payload:
- type: BOOLEAN
- default: false
- key: maxLength
payload:
type: NUMBER
@@ -1423,10 +1391,6 @@
payload:
type: BOOLEAN
default: false
- - key: requiredClassification
- payload:
- type: BOOLEAN
- default: false
- key: maxLength
payload:
type: NUMBER
@@ -1439,10 +1403,6 @@
payload:
type: BOOLEAN
default: false
- - key: requiredClassification
- payload:
- type: BOOLEAN
- default: false
- key: maxLength
payload:
type: NUMBER
diff --git a/frontend/src/types/sqlReview.ts b/frontend/src/types/sqlReview.ts
index 7f21e9dfc4..da84893df6 100644
--- a/frontend/src/types/sqlReview.ts
+++ b/frontend/src/types/sqlReview.ts
@@ -79,7 +79,6 @@ interface StringArrayLimitPayload {
// Used by the backend.
interface CommentFormatPayload {
required: boolean;
- requiredClassification: boolean;
maxLength: number;
}
@@ -520,15 +519,8 @@ export const convertPolicyRuleToRuleTemplate = (
case SQLReviewRule_Type.COLUMN_COMMENT:
case SQLReviewRule_Type.TABLE_COMMENT: {
const requireComponent = componentList.find((c) => c.key === "required");
- const requiredClassificationComponent = componentList.find(
- (c) => c.key === "requiredClassification"
- );
-
- if (
- !requireComponent ||
- !requiredClassificationComponent ||
- !numberComponent
- ) {
+
+ if (!requireComponent || !numberComponent) {
throw new Error(`Invalid rule ${ruleTypeToString(ruleTemplate.type)}`);
}
@@ -542,13 +534,6 @@ export const convertPolicyRuleToRuleTemplate = (
value: (payload as CommentFormatPayload).required,
} as BooleanPayload,
},
- {
- ...requiredClassificationComponent,
- payload: {
- ...requiredClassificationComponent.payload,
- value: (payload as CommentFormatPayload).requiredClassification,
- } as BooleanPayload,
- },
{
...numberComponent,
payload: {
@@ -714,9 +699,6 @@ const mergeIndividualConfigAsRule = (
case SQLReviewRule_Type.TABLE_COMMENT: {
const requirePayload = componentList.find((c) => c.key === "required")
?.payload as BooleanPayload | undefined;
- const requiredClassificationPayload = componentList.find(
- (c) => c.key === "requiredClassification"
- )?.payload as BooleanPayload | undefined;
if (!requirePayload || !numberPayload) {
throw new Error(`Invalid rule ${ruleTypeToString(template.type)}`);
@@ -726,10 +708,6 @@ const mergeIndividualConfigAsRule = (
payload: {
required: requirePayload.value ?? requirePayload.default,
maxLength: numberPayload.value ?? numberPayload.default,
- requiredClassification:
- requiredClassificationPayload?.value ??
- requiredClassificationPayload?.default ??
- false,
},
};
}