Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix_deps][taier-ui]restrict dt-sql-parser's version #1124

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions taier-ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,14 @@ module.exports = {
'@typescript-eslint/no-non-null-assertion': 'off',
// Turn it to warn temporarily since there are some code have to use this comment to skip ts checker
'@typescript-eslint/ban-ts-comment': 'warn',
'react-hooks/exhaustive-deps': 'off',
},
overrides: [
{
files: ['**/*.test.{ts,tsx}'],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
},
},
],
};
4 changes: 2 additions & 2 deletions taier-ui/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module.exports = {
'^.+\\.(t|j)sx?$': ['@swc/jest'],
},
setupFilesAfterEnv: ['<rootDir>/src/tests/jest-setup.js'],
testEnvironment: "jsdom",
modulePathIgnorePatterns: ['<rootDir>/src/.umi/'],
testEnvironment: 'jsdom',
modulePathIgnorePatterns: ['<rootDir>/src/.umi/', '<rootDir>/src/.umi-production'],
moduleNameMapper: {
'@/(.*)': '<rootDir>/src/$1',
'^@dtinsight/molecule(/?)(.*)$': '<rootDir>/__mocks__/molecule.js',
Expand Down
3 changes: 3 additions & 0 deletions taier-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,8 @@
"typescript": "4.7.4",
"umi-plugin-tailwindcss": "^3.2.1",
"yorkie": "^2.0.0"
},
"resolutions": {
"dt-sql-parser": "4.0.0-beta.3.2"
}
}
16,587 changes: 9,957 additions & 6,630 deletions taier-ui/pnpm-lock.yaml

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions taier-ui/src/api/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
* limitations under the License.
*/

import 'whatwg-fetch';
import { message } from 'antd';
import ProgressBar from '@/components/progressBar';
import 'whatwg-fetch';

import notification from '@/components/notification';
import ProgressBar from '@/components/progressBar';
import type { IResponseBodyProps } from '@/interface';

class Http {
Expand Down
2 changes: 1 addition & 1 deletion taier-ui/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TASK_TYPE_ENUM } from '@/constant';
import http from './http';
import req from './request';
import { TASK_TYPE_ENUM } from '@/constant';

export default {
// 获取节点下拉
Expand Down
5 changes: 3 additions & 2 deletions taier-ui/src/components/TaskListener/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { ID_COLLECTIONS } from '@/constant';
import { useEffect } from 'react';
import molecule from '@dtinsight/molecule';
import { EventBus } from '@dtinsight/molecule/esm/common/event';
import { connect } from '@dtinsight/molecule/esm/react';
import { useEffect } from 'react';

import { ID_COLLECTIONS } from '@/constant';

/**
* For get the latest current value after current changed and notice the non-jsx component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`Test AddEngineModal Component Should match snapshot 1`] = `
<div
aria-labelledby="test-id"
aria-modal="true"
class="ant-modal c-clusterManage__modal"
class="ant-modal c-clusterManage__modal ant-zoom-appear ant-zoom-appear-prepare ant-zoom"
role="dialog"
style="width: 520px;"
>
Expand Down Expand Up @@ -46,13 +46,14 @@ exports[`Test AddEngineModal Component Should match snapshot 1`] = `
aria-hidden="true"
data-icon="close"
fill="currentColor"
fill-rule="evenodd"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
d="M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"
/>
</svg>
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { cleanup, render, waitFor } from '@testing-library/react';
import { input,modal } from 'ant-design-testing';
import '@testing-library/jest-dom';
import AddEngineModal from '..';
import { modal, input } from 'ant-design-testing';

import { $ } from '@/tests/utils';
import AddEngineModal from '..';

describe('Test AddEngineModal Component', () => {
beforeEach(() => {
Expand Down
3 changes: 2 additions & 1 deletion taier-ui/src/components/addEngineModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
*/

import type { ModalProps } from 'antd';
import { Form, Modal, Input } from 'antd';
import { Form, Input,Modal } from 'antd';

import { formItemLayout } from '@/constant';
import './index.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`Test AddTenantModal Should match snapshot 1`] = `
<div
aria-labelledby="test-id"
aria-modal="true"
class="ant-modal"
class="ant-modal ant-zoom-appear ant-zoom-appear-prepare ant-zoom"
role="dialog"
style="width: 520px;"
>
Expand Down Expand Up @@ -47,13 +47,14 @@ exports[`Test AddTenantModal Should match snapshot 1`] = `
aria-hidden="true"
data-icon="close"
fill="currentColor"
fill-rule="evenodd"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
d="M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"
/>
</svg>
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { input, modal, form } from 'ant-design-testing';
import { cleanup, render } from '@testing-library/react';
import { form,input, modal } from 'ant-design-testing';
import '@testing-library/jest-dom';
import AddTenantModal from '..';

import api from '@/api';
import AddTenantModal from '..';

jest.mock('@/api');
jest.mock('@/utils', () => ({
Expand Down
5 changes: 3 additions & 2 deletions taier-ui/src/components/addTenantModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* limitations under the License.
*/

import { Modal, Form, message, Input } from 'antd';
import { formItemLayout } from '@/constant';
import { Form, Input,message, Modal } from 'antd';

import api from '@/api';
import { formItemLayout } from '@/constant';
import { getUserId } from '@/utils';

interface IFormFieldProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`Test BindCommModal Component Should match snapshot 1`] = `
<div
aria-labelledby="test-id"
aria-modal="true"
class="ant-modal no-padding-modal"
class="ant-modal no-padding-modal ant-zoom-appear ant-zoom-appear-prepare ant-zoom"
role="dialog"
style="width: 600px;"
>
Expand Down Expand Up @@ -46,13 +46,14 @@ exports[`Test BindCommModal Component Should match snapshot 1`] = `
aria-hidden="true"
data-icon="close"
fill="currentColor"
fill-rule="evenodd"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
d="M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"
/>
</svg>
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import api from '@/api';
import { modal, select, form } from 'ant-design-testing';
import { cleanup, render, waitFor } from '@testing-library/react';
import BindCommModal from '..';
import { form,modal, select } from 'ant-design-testing';
import '@testing-library/jest-dom';

import api from '@/api';
import { $ } from '@/tests/utils';
import BindCommModal from '..';

jest.mock('@/api');

Expand Down
3 changes: 2 additions & 1 deletion taier-ui/src/components/bindCommModal/engineForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
*/

import { useEffect, useMemo, useState } from 'react';
import { Select, Radio, Form } from 'antd';
import { Form,Radio, Select } from 'antd';

import { ENGINE_SOURCE_TYPE_ENUM, PROJECT_CREATE_MODEL } from '@/constant';
import { isOracleEngine } from '@/utils/is';
import api from '../../api';
Expand Down
11 changes: 6 additions & 5 deletions taier-ui/src/components/bindCommModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
* limitations under the License.
*/

import { useState, useEffect } from 'react';
import { Modal, Select, Input, Form, Spin } from 'antd';
import api from '@/api';
import { useEffect,useState } from 'react';
import { InfoCircleOutlined } from '@ant-design/icons';
import { formItemLayout, ENGINE_SOURCE_TYPE_ENUM, ENGINE_SOURCE_TYPE } from '@/constant';
import { useEnv } from '../customHooks';
import { Form, Input, Modal, Select, Spin } from 'antd';

import api from '@/api';
import { ENGINE_SOURCE_TYPE,ENGINE_SOURCE_TYPE_ENUM, formItemLayout } from '@/constant';
import { getEngineSourceTypeName } from '@/utils/enums';
import { useEnv } from '../customHooks';
import './index.scss';

const { Option } = Select;
Expand Down
1 change: 1 addition & 0 deletions taier-ui/src/components/chart/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { render } from '@testing-library/react';

import config from './fixtures/config';

describe('Test Chart Component', () => {
Expand Down
2 changes: 1 addition & 1 deletion taier-ui/src/components/chart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/

import * as React from 'react';
import { isEqual } from 'lodash';
import * as echarts from 'echarts/lib/echarts';
import { isEqual } from 'lodash';
import 'echarts/lib/component/title';
import 'echarts/lib/component/tooltip';
import 'echarts/lib/component/grid';
Expand Down
1 change: 1 addition & 0 deletions taier-ui/src/components/circle/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { fireEvent, render } from '@testing-library/react';

import Circle from '..';

describe('Test Circle Component', () => {
Expand Down
1 change: 1 addition & 0 deletions taier-ui/src/components/circle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import classNames from 'classnames';

import './index.scss';

enum CIRCLE_TYPES_ENUM {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`Test Confirm Component Test Inner Confirm Should match snapshot 1`] = `
>
<div
aria-modal="true"
class="ant-modal"
class="ant-modal ant-zoom-appear ant-zoom-appear-prepare ant-zoom"
role="dialog"
style="top: 200px; width: 250px;"
>
Expand Down
5 changes: 3 additions & 2 deletions taier-ui/src/components/confirm/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { CatalogueDataProps } from '@/interface';
import { act, cleanup, render, waitFor } from '@testing-library/react';
import Confirm, { confirm } from '..';
import { button } from 'ant-design-testing';

import type { CatalogueDataProps } from '@/interface';
import { $ } from '@/tests/utils';
import Confirm, { confirm } from '..';

describe('Test Confirm Component', () => {
beforeEach(() => {
Expand Down
9 changes: 5 additions & 4 deletions taier-ui/src/components/confirm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { CatalogueDataProps } from '@/interface';
import { createElement } from '@/utils';
import { WarningOutlined } from '@ant-design/icons';
import { Button, Modal } from 'antd';
import { useLayoutEffect, useRef } from 'react';
import ReactDOM from 'react-dom/client';
import { WarningOutlined } from '@ant-design/icons';
import { Button, Modal } from 'antd';

import type { CatalogueDataProps } from '@/interface';
import { createElement } from '@/utils';
import './index.scss';

interface IConfirmProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ exports[`Test CustomDrawer Component Should match snapshot 1`] = `
aria-hidden="true"
data-icon="close"
fill="currentColor"
fill-rule="evenodd"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
d="M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"
/>
</svg>
</span>
Expand Down
7 changes: 4 additions & 3 deletions taier-ui/src/components/customDrawer/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { act, render } from '@testing-library/react';
import '@testing-library/jest-dom';
import CustomDrawer, { updateDrawer } from '..';
import { drawer } from 'ant-design-testing';
import { history } from 'umi';
import '@testing-library/jest-dom';

import { removePopUpMenu } from '@/utils';
import { drawer } from 'ant-design-testing';
import CustomDrawer, { updateDrawer } from '..';

jest.mock('umi', () => ({
history: {
Expand Down
3 changes: 2 additions & 1 deletion taier-ui/src/components/customDrawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
*/

import React, { useLayoutEffect, useState } from 'react';
import { history } from 'umi';
import type { DrawerProps } from 'antd';
import { Drawer } from 'antd';
import { history } from 'umi';

import { removePopUpMenu } from '@/utils';

interface CustomDrawerProps extends DrawerProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import molecule from '@dtinsight/molecule';
import { renderHook } from '@testing-library/react';

import useCurrentTheme from '../useCurrentTheme';

describe('Test useCurrentTheme hook', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { cleanup, renderHook } from '@testing-library/react';

import useSize from '../useSize';

describe('Test useSize hook', () => {
Expand Down
2 changes: 1 addition & 1 deletion taier-ui/src/components/customHooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

export { default as useEnv } from './useEnv';
export { default as useCalcTableScroll } from './useCalcTableScroll';
export { default as useCurrentTheme } from './useCurrentTheme';
export { default as useEnv } from './useEnv';
export { default as useSize } from './useSize';
2 changes: 1 addition & 1 deletion taier-ui/src/components/customHooks/useCalcTableScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

import { useEffect, useState, useCallback } from 'react';
import { useCallback,useEffect, useState } from 'react';
import type { TableProps } from 'antd';

interface IProps {
Expand Down
2 changes: 1 addition & 1 deletion taier-ui/src/components/customHooks/useCurrentTheme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect } from 'react';
import { useEffect,useState } from 'react';
import molecule from '@dtinsight/molecule';

const useCurrentTheme = () => {
Expand Down
1 change: 1 addition & 0 deletions taier-ui/src/components/customHooks/useEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import { useEffect, useState } from 'react';

import { ENGINE_SOURCE_TYPE, RESOURCE_TYPE } from '@/constant';

/**
Expand Down
Loading
Loading