From 14e4f6afa49d9cd3230a8fdb4afc045164c1df88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=9C=9D=E4=BF=8A?= Date: Wed, 6 Dec 2023 19:22:12 +0800 Subject: [PATCH] PullRequest: 259 fix: delete level2's error modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge branch 'fix/dev-4.2.3-odc-359 of git@code.alipay.com:oceanbase/oceanbase-developer-center.git into dev-4.2.3 https://code.alipay.com/oceanbase/oceanbase-developer-center/pull_requests/259 Signed-off-by: 晓康 * fix: delete level2's error modal --- src/common/network/sql/executeSQL.tsx | 20 +++++-------------- .../Task/AsyncTask/CreateModal/index.tsx | 2 +- .../components/SQLResultSet/columns.tsx | 5 +++++ 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/common/network/sql/executeSQL.tsx b/src/common/network/sql/executeSQL.tsx index c098ff4ce..9f19a6f05 100644 --- a/src/common/network/sql/executeSQL.tsx +++ b/src/common/network/sql/executeSQL.tsx @@ -194,21 +194,11 @@ export default async function executeSQL( */ const session = sessionManager.sessionMap.get(sessionId); const isBan = violatedRules?.find((rule) => rule.level === 2); - if (isBan) { - Modal.error({ - title: formatMessage({ - id: 'odc.network.sql.executeSQL.ThisOperationHasBeenBlocked', - }), - //该操作已被以下规则拦截 - content: , - }); - } - !isBan && - modal.changeCreateAsyncTaskModal(true, { - sql: serverParams.sql, - databaseId: session?.database?.databaseId, - rules: taskInfo?.sqls, - }); + modal.changeCreateAsyncTaskModal(true, { + sql: serverParams.sql, + databaseId: session?.database?.databaseId, + rules: taskInfo?.sqls, + }); return { invalid: true, executeSuccess: false, diff --git a/src/component/Task/AsyncTask/CreateModal/index.tsx b/src/component/Task/AsyncTask/CreateModal/index.tsx index 13f0a9944..c8dfec8ed 100644 --- a/src/component/Task/AsyncTask/CreateModal/index.tsx +++ b/src/component/Task/AsyncTask/CreateModal/index.tsx @@ -638,7 +638,7 @@ const CreateModal: React.FC = (props) => { id: 'odc.src.component.Task.AsyncTask.CreateModal.ThePreExaminationIs', }, { - lintResultSetLength: lintResultSet.length, + lintResultSetLength: lintResultSet?.length || 0, }, ) //`预检查完成,${lintResultSet.length} 处语句违反 SQL 开发规范。` } diff --git a/src/page/Workspace/components/SQLResultSet/columns.tsx b/src/page/Workspace/components/SQLResultSet/columns.tsx index 8a8d69ed9..ae08495b5 100644 --- a/src/page/Workspace/components/SQLResultSet/columns.tsx +++ b/src/page/Workspace/components/SQLResultSet/columns.tsx @@ -18,6 +18,8 @@ import { RenderLevel } from '@/page/Secure/Env/components/InnerEnvironment'; import { Space, Popover, Button } from 'antd'; import utils, { IEditor } from '@/util/editor'; import { levelMap } from '@/page/Secure/interface'; +import styles from './index.less'; + const getColumns = (showLocate: boolean, ctx: IEditor) => { return [ { @@ -75,6 +77,7 @@ const getColumns = (showLocate: boolean, ctx: IEditor) => { {Object.keys(rules).map((key) => { return ( @@ -83,6 +86,7 @@ const getColumns = (showLocate: boolean, ctx: IEditor) => { style={{ display: 'flex', justifyContent: 'space-between', + gap: '8px', alignItems: 'baseline', }} key={index} @@ -93,6 +97,7 @@ const getColumns = (showLocate: boolean, ctx: IEditor) => { {showLocate && (