Skip to content

Commit

Permalink
Merge branch 'dev-4.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Jan 4, 2024
2 parents b4b092b + 9c38cc8 commit de91dd9
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 24 deletions.
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ header:
license:
spdx-id: Apache-2.0
copyright-owner: OceanBase
copyright-year: '2023'
paths:
- 'src/**/*.ts'
- 'src/**/*.js'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
"devDependencies": {
"@ant-design/icons": "^4.0.0",
"@oceanbase-odc/monaco-plugin-ob": "^0.1.1",
"@oceanbase-odc/monaco-plugin-ob": "^0.1.2",
"@oceanbase-odc/ob-intl-cli": "^1.1.5",
"@oceanbase-odc/ob-parser-js": "^3.0.1",
"@oceanbase-odc/ob-react-data-grid": "^3.0.6",
Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/component/MonacoEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import styles from './index.less';
import * as groovy from './plugins/languageSupport/groovy';
import { apply as markerPluginApply } from './plugins/marker';
import { getModelService } from './plugins/ob-language/service';
import logger from '@/util/logger';
export interface IEditor extends monaco.editor.IStandaloneCodeEditor {
doFormat: () => void;
getSelectionContent: () => string;
Expand Down Expand Up @@ -138,6 +139,7 @@ const MonacoEditor: React.FC<IProps> = function (props) {
),
);
markerPluginApply(editorRef.current.getModel());
logger.debug('init plugin done')
}

async function initEditor() {
Expand All @@ -154,6 +156,10 @@ const MonacoEditor: React.FC<IProps> = function (props) {
readOnly: readOnly,
});
await initPlugin();
editorRef.current.updateOptions({
readOnly,
theme: themeValue,
});
if (!editorRef.current?.getModel?.()) {
return;
}
Expand Down
3 changes: 2 additions & 1 deletion src/component/SelectTransfer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default function SelectTransfer(props: IProps) {
/>
</Card>
</div>
<div style={{ width: '100%', height: '100%' }}>
<div style={{ width: '50%', height: '100%' }}>
<Card
title={
formatMessage(
Expand Down Expand Up @@ -155,6 +155,7 @@ export default function SelectTransfer(props: IProps) {
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
wordBreak: "break-all"
}}
title={node.title}
>
Expand Down
2 changes: 2 additions & 0 deletions src/page/Project/Project/ListItem/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@
flex-basis: 20%;
min-width: 260px;
color: var(--text-color-secondary);
overflow: hidden;
text-overflow: ellipsis;
}
}
12 changes: 5 additions & 7 deletions src/page/Project/Project/ListItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@ export default forwardRef(function ListItem(
<div className={classNames(styles.block, styles.name)}>{data.name}</div>
<div className={classNames(styles.block, styles.desc)}>{data.description || '-'}</div>
<div className={classNames(styles.block, styles.users)}>
<Space>
<Icon style={{ color: 'var(--icon-color-disable)' }} component={UserSvg} />
{data.members
?.filter((item) => item.role === ProjectRole.OWNER)
?.map((a) => a.name)
?.join(', ') || '-'}
</Space>
<Icon style={{ color: 'var(--icon-color-disable)', marginRight: 5 }} component={UserSvg} />
{data.members
?.filter((item) => item.role === ProjectRole.OWNER)
?.map((a) => a.name)
?.join(', ') || '-'}
</div>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/page/Secure/Env/components/EnvironmentTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const EnvironmentTable = ({ ruleType }) => {
}
if (supportedDialectTypes) {
filteredRules = filteredRules?.filter((item) =>
item?.metadata?.supportedDialectTypes?.some((supportedDialectType) =>
item?.appliedDialectTypes?.some((supportedDialectType) =>
supportedDialectTypes?.includes(supportedDialectType),
),
);
Expand Down Expand Up @@ -119,7 +119,7 @@ const EnvironmentTable = ({ ruleType }) => {
}
if (supportedDialectTypes) {
filteredRules = filteredRules?.filter((item) =>
item?.metadata?.supportedDialectTypes?.some((supportedDialectType) =>
item?.appliedDialectTypes?.some((supportedDialectType) =>
supportedDialectTypes?.includes(supportedDialectType),
),
);
Expand Down
2 changes: 1 addition & 1 deletion src/store/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const themeConfig: { [key: string]: IThemeConfig } = {
},
[EThemeConfigKey.ODC_DARK]: {
key: 'odc-dark',
editorTheme: 'vs-dark',
editorTheme: 'obdark',
className: 'odc-dark',
sheetTheme: 'dark',
cmdTheme: 'dark',
Expand Down
4 changes: 2 additions & 2 deletions src/util/dataSourceParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { formatMessage } from '@/util/intl';
import { isUndefined } from 'lodash';
import { isUndefined, isNil } from 'lodash';

function unifiedStr(value: string) {
return value?.replace(/\\"|\\t|\'/g, '');
Expand Down Expand Up @@ -150,7 +150,7 @@ class Parser {
const next = args[i + 1];
const isNextValid = !next?.startsWith('-');
let value: any = isNextValid ? next : null;
result[name] = isUndefined(value) ? value : type(value, name, result[name]);
result[name] = isNil(value) ? value : type(value, name, result[name]);
if (isNextValid) {
++i;
}
Expand Down

0 comments on commit de91dd9

Please sign in to comment.