Skip to content

Commit

Permalink
PullRequest: 259 fix: delete level2's error modal
Browse files Browse the repository at this point in the history
Merge branch 'fix/dev-4.2.3-odc-359 of [email protected]:oceanbase/oceanbase-developer-center.git into dev-4.2.3

https://code.alipay.com/oceanbase/oceanbase-developer-center/pull_requests/259


Signed-off-by: 晓康 <[email protected]>


* fix: delete level2's error modal
  • Loading branch information
UnknownAdventurer committed Dec 6, 2023
1 parent e570f3e commit 14e4f6a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
20 changes: 5 additions & 15 deletions src/common/network/sql/executeSQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: <RuleResult data={violatedRules} />,
});
}
!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,
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/AsyncTask/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ const CreateModal: React.FC<IProps> = (props) => {
id: 'odc.src.component.Task.AsyncTask.CreateModal.ThePreExaminationIs',
},
{
lintResultSetLength: lintResultSet.length,
lintResultSetLength: lintResultSet?.length || 0,
},
) //`预检查完成,${lintResultSet.length} 处语句违反 SQL 开发规范。`
}
Expand Down
5 changes: 5 additions & 0 deletions src/page/Workspace/components/SQLResultSet/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
{
Expand Down Expand Up @@ -75,6 +77,7 @@ const getColumns = (showLocate: boolean, ctx: IEditor) => {
{Object.keys(rules).map((key) => {
return (
<Popover
trigger={'click'}
content={
<div>
<RenderLevel level={key} />
Expand All @@ -83,6 +86,7 @@ const getColumns = (showLocate: boolean, ctx: IEditor) => {
style={{
display: 'flex',
justifyContent: 'space-between',
gap: '8px',
alignItems: 'baseline',
}}
key={index}
Expand All @@ -93,6 +97,7 @@ const getColumns = (showLocate: boolean, ctx: IEditor) => {
{showLocate && (
<Button
type="link"
style={{ padding: '0px' }}
onClick={() => {
utils.removeHighlight(ctx);
utils.addHighlight(
Expand Down

0 comments on commit 14e4f6a

Please sign in to comment.