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

chore: prettier all code #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/

import React from 'react';
import { setLocale } from '@umijs/max';
import React from 'react';
import { initMetaStore } from './common/metaStore';
import DndHTML5Provider from './component/DndHTML5Provider';
import registerPlugins from './plugins/register';
import { isClient } from './util/env';
import logger from './util/logger';
import { getRoute } from './util/tracert/userRoutes';
import { initIntl } from './util/intl';
import logger from './util/logger';
import { initSentry } from './util/sentry';
import { getRoute } from './util/tracert/userRoutes';
if (isClient()) {
import('@sentry/electron').then((_Sentry) => {
_Sentry.init({
Expand Down
2 changes: 1 addition & 1 deletion src/common/datasource/doris/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

import { ConnectType, TaskType } from '@/d.ts';
import { haveOCP } from '@/util/env';
import { IDataSourceModeConfig } from '../interface';
import MySQLColumnExtra from '../oceanbase/MySQLColumnExtra';
import { haveOCP } from '@/util/env';

const tableConfig = {
enableTableCharsetsAndCollations: true,
Expand Down
24 changes: 12 additions & 12 deletions src/common/datasource/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
* limitations under the License.
*/

import { ConnectType, ConnectionMode } from '@/d.ts';
import { IDataSourceModeConfig } from './interface';
import { ConnectionMode, ConnectType } from '@/d.ts';
import { IDataSourceType } from '@/d.ts/datasource';
import obOracle from './oceanbase/oboracle';
import obMySQL from './oceanbase/obmysql';
import oracle from './oracle';
import MySQL from './mysql';
import Doris from './doris';
import { ReactComponent as OBSvg } from '@/svgr/source_ob.svg';
import { ReactComponent as DBOBSvg } from '@/svgr/database_oceanbase.svg';
import { ReactComponent as MySQLSvg } from '@/svgr/mysql.svg';
import { ReactComponent as DBDorisSvg } from '@/svgr/database_doris.svg';
import { ReactComponent as DBMySQLSvg } from '@/svgr/database_mysql.svg';
import { ReactComponent as DBOBSvg } from '@/svgr/database_oceanbase.svg';
import { ReactComponent as DBOracleSvg } from '@/svgr/database_oracle.svg';
import { ReactComponent as DorisSvg } from '@/svgr/doris.svg';
import { ReactComponent as DBDorisSvg } from '@/svgr/database_doris.svg';
import { ReactComponent as MySQLSvg } from '@/svgr/mysql.svg';
import { ReactComponent as OracleSvg } from '@/svgr/oracle.svg';
import { ReactComponent as DBOracleSvg } from '@/svgr/database_oracle.svg';
import { ReactComponent as OBSvg } from '@/svgr/source_ob.svg';
import Doris from './doris';
import { IDataSourceModeConfig } from './interface';
import MySQL from './mysql';
import obMySQL from './oceanbase/obmysql';
import obOracle from './oceanbase/oboracle';
import oracle from './oracle';

const _types: Map<
IDataSourceType,
Expand Down
2 changes: 1 addition & 1 deletion src/common/datasource/mysql/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

import { ConnectType, TaskType } from '@/d.ts';
import { haveOCP } from '@/util/env';
import { IDataSourceModeConfig } from '../interface';
import MySQLColumnExtra from '../oceanbase/MySQLColumnExtra';
import { haveOCP } from '@/util/env';

const tableConfig = {
enableTableCharsetsAndCollations: true,
Expand Down
4 changes: 2 additions & 2 deletions src/common/datasource/oceanbase/MySQLColumnExtra.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

import { dataTypesIns } from '@/util/dataType';
import { columnExtraComponent } from '../interface';
import Character from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/Character';
import DataSync from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/DateSync';
import DefaultValue from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/DefaultValue';
import Enum from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/Enum';
import Generation from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/Generation';
import Number from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/Number';
import { dataTypesIns } from '@/util/dataType';
import { columnExtraComponent } from '../interface';

const MySQLColumnExtra: columnExtraComponent = ({
column,
Expand Down
4 changes: 2 additions & 2 deletions src/common/datasource/oceanbase/OracleColumnExtra.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

import { dataTypesIns } from '@/util/dataType';
import { columnExtraComponent } from '../interface';
import DefaultValue from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/DefaultValue';
import Precision from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/Precision';
import { dataTypesIns } from '@/util/dataType';
import { columnExtraComponent } from '../interface';

const OracleColumnExtra: columnExtraComponent = ({
column,
Expand Down
2 changes: 1 addition & 1 deletion src/common/datasource/oceanbase/obmysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

import { ConnectType, TaskType } from '@/d.ts';
import { haveOCP } from '@/util/env';
import { IDataSourceModeConfig } from '../interface';
import MySQLColumnExtra from './MySQLColumnExtra';
import { haveOCP } from '@/util/env';

const tableConfig = {
enableTableCharsetsAndCollations: true,
Expand Down
4 changes: 2 additions & 2 deletions src/common/datasource/oceanbase/oboracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/

import { ConnectType, TaskType } from '@/d.ts';
import { IDataSourceModeConfig } from '../interface';
import OracleColumnExtra from './OracleColumnExtra';
import { TableForeignConstraintOnDeleteType } from '@/d.ts/table';
import { haveOCP } from '@/util/env';
import { IDataSourceModeConfig } from '../interface';
import OracleColumnExtra from './OracleColumnExtra';

const oracleTableConfig = {
constraintEnableConfigurable: true,
Expand Down
4 changes: 2 additions & 2 deletions src/common/datasource/oracle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/

import { ConnectType, TaskType } from '@/d.ts';
import { IDataSourceModeConfig } from '../interface';
import OracleColumnExtra from '../oceanbase/OracleColumnExtra';
import { TableForeignConstraintOnDeleteType } from '@/d.ts/table';
import { haveOCP } from '@/util/env';
import { IDataSourceModeConfig } from '../interface';
import OracleColumnExtra from '../oceanbase/OracleColumnExtra';

const oracleTableConfig = {
constraintEnableConfigurable: true,
Expand Down
12 changes: 3 additions & 9 deletions src/common/network/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ export async function testExsitConnection(
return ret;
}

export async function batchTest(
cids: number[],
): Promise<
export async function batchTest(cids: number[]): Promise<
Record<
number,
{
Expand Down Expand Up @@ -318,9 +316,7 @@ export async function newSessionByDataSource(
return data;
}

export async function getSessionStatus(
sessionId?: string,
): Promise<{
export async function getSessionStatus(sessionId?: string): Promise<{
settings: {
autocommit: boolean;
delimiter: string;
Expand Down Expand Up @@ -366,9 +362,7 @@ export async function getConnectionExists(params: { name: string }): Promise<boo
/**
* 获取集群 & 租户列表
*/
export async function getClusterAndTenantList(
visibleScope: IConnectionType,
): Promise<{
export async function getClusterAndTenantList(visibleScope: IConnectionType): Promise<{
tenantName: Record<string, string[]>;
clusterName: Record<string, string[]>;
}> {
Expand Down
6 changes: 2 additions & 4 deletions src/common/network/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import notification from '@/util/notification';
import request from '@/util/request';
import { getDropSQL } from '@/util/sql';
import { executeSQL } from './sql';
import { syncDatasource } from './connection';
import login from '@/store/login';

export async function listDatabases(
projectId?: number,
Expand All @@ -36,7 +34,7 @@ export async function listDatabases(
*/
containsUnassigned?: boolean,
existed?: boolean,
includesPermittedAction?: boolean
includesPermittedAction?: boolean,
): Promise<IResponseData<IDatabase>> {
const res = await request.get(`/api/v2/database/databases`, {
params: {
Expand All @@ -48,7 +46,7 @@ export async function listDatabases(
environmentId,
containsUnassigned,
existed,
includesPermittedAction
includesPermittedAction,
},
});

Expand Down
8 changes: 3 additions & 5 deletions src/common/network/exportAndImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ export async function getExportObjects(
databaseId: number,
type?: DbObjectType,
cid?: number,
): Promise<
{
[key in DbObjectType]: string[];
}
> {
): Promise<{
[key in DbObjectType]: string[];
}> {
const result = await request.get(`/api/v2/dataTransfer/getExportObjects`, {
params: {
connectionId: cid,
Expand Down
2 changes: 1 addition & 1 deletion src/common/network/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

import { IResponseData, IUserSummary } from '@/d.ts';
import { IProject, ProjectRole, PermissionSourceType, IDatabasePermission } from '@/d.ts/project';
import { DatabasePermissionType } from '@/d.ts/database';
import { IDatabasePermission, IProject, PermissionSourceType, ProjectRole } from '@/d.ts/project';
import request from '@/util/request';

export async function listProjects(
Expand Down
8 changes: 4 additions & 4 deletions src/common/network/projectNotification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

import { IResponseData } from '@/d.ts';
import {
EChannelType,
EMessageStatus,
IChannel,
ITestChannelResult,
IPolicy,
IMessage,
IPolicy,
ITestChannelResult,
TBatchUpdatePolicy,
EMessageStatus,
EChannelType,
} from '@/d.ts/projectNotification';
import request from '@/util/request';

Expand Down
2 changes: 1 addition & 1 deletion src/common/network/sql/executePL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import { PLType } from '@/constant/plType';
import { IFunction, IProcedure } from '@/d.ts';
import { generateSessionSid } from '../pathUtil';
import request from '@/util/request';
import { generateSessionSid } from '../pathUtil';

type params =
| {
Expand Down
2 changes: 1 addition & 1 deletion src/common/network/table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { INlsObject, ITable, ITableColumn, LobExt, RSModifyDataType } from '@/d.ts';
import { ITableModel, TableColumn } from '@/page/Workspace/components/CreateTable/interface';
import { ITableModel } from '@/page/Workspace/components/CreateTable/interface';
import sessionManager from '@/store/sessionManager';
import setting from '@/store/setting';
import { getNlsValueKey } from '@/util/column';
Expand Down
12 changes: 6 additions & 6 deletions src/common/network/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@
import { IShadowSyncAnalysisResult } from '@/component/Task/ShadowSyncTask/CreateModal/interface';
import {
CommonTaskLogType,
CreateStructureComparisonTaskRecord,
CreateTaskRecord,
IPartitionTablePreviewConfig,
CycleTaskDetail,
IAsyncTaskResultSet,
ICycleSubTaskRecord,
ICycleTaskRecord,
IDatasourceUser,
IFunction,
IPartitionPlan,
IPartitionPlanTable,
IPartitionPlanKeyType,
IPartitionPlanTable,
IPartitionTablePreviewConfig,
IResponseData,
ISubTaskRecords,
ITaskResult,
Expand All @@ -36,15 +38,13 @@ import {
TaskRecordParameters,
TaskStatus,
TaskType,
IDatasourceUser,
CreateStructureComparisonTaskRecord,
} from '@/d.ts';
import { IProject } from '@/d.ts/project';
import { EOperationType, IComparisonResultData, IStructrueComparisonDetail } from '@/d.ts/task';
import setting from '@/store/setting';
import request from '@/util/request';
import { downloadFile } from '@/util/utils';
import { IProject } from '@/d.ts/project';
import { generateFunctionSid } from './pathUtil';
import { EOperationType, IComparisonResultData, IStructrueComparisonDetail } from '@/d.ts/task';

/**
* 根据函数获取ddl sql
Expand Down
2 changes: 1 addition & 1 deletion src/component/Action/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { EllipsisOutlined, LoadingOutlined, MoreOutlined } from '@ant-design/icons';
import { Button, Dropdown, Menu, Space, Tooltip, Typography } from 'antd';
import { Button, Dropdown, Space, Tooltip, Typography } from 'antd';
import { isBoolean, max, omit } from 'lodash';
import React from 'react';
import type { BaseProps } from './Item';
Expand Down
2 changes: 1 addition & 1 deletion src/component/AddDataSourceDropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

import { formatMessage } from '@/util/intl';
import { getAllConnectTypes } from '@/common/datasource';
import { ConnectTypeText } from '@/constant/label';
import { IDataSourceType } from '@/d.ts/datasource';
import { formatMessage } from '@/util/intl';
import { Dropdown } from 'antd';
import { ItemType } from 'antd/lib/menu/hooks/useItems';
import { useMemo } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/component/BatchImportButton/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import login from '@/store/login';
import { formatMessage, getLocalTemplate } from '@/util/intl';
import { downloadFile } from '@/util/utils';
import { InfoCircleFilled } from '@ant-design/icons';
import { getLocale } from '@umijs/max';
import { Alert, Button, Drawer, Form, Space } from 'antd';
import { useForm } from 'antd/es/form/Form';
import type { UploadFile } from 'antd/lib/upload/interface';
import Cookies from 'js-cookie';
import React, { useEffect, useState } from 'react';
import { getLocale } from '@umijs/max';
import styles from './index.less';
// 20M
const MAX_FILE_SIZE = 1024 * 1024 * 20;
Expand Down
11 changes: 2 additions & 9 deletions src/component/BigSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,8 @@ interface IBigSelectProps {
bottom?: React.ReactNode;
}
const BigSelect: React.FC<IBigSelectProps> = (props) => {
const {
defaultValue,
options,
bottom,
icon,
iconColor,
onChange,
onDropdownVisibleChange,
} = props;
const { defaultValue, options, bottom, icon, iconColor, onChange, onDropdownVisibleChange } =
props;
return (
<Space size={12} className={styles['select-wrapper']}>
<div className={styles.logo}>
Expand Down
2 changes: 1 addition & 1 deletion src/component/Button/Reload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { ReloadOutlined, LoadingOutlined } from '@ant-design/icons';
import { LoadingOutlined, ReloadOutlined } from '@ant-design/icons';
import { useState } from 'react';

export default function Reload({
Expand Down
4 changes: 2 additions & 2 deletions src/component/Crontab/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
padding-bottom: 8px;
}
.content {
width: 100%;
display: grid;
grid-gap: 8px;
width: 100%;
&.default-mode {
grid-template-columns: 120px 210px 1fr;
padding: 8px;
background: var(--background-tertraiy-color);
grid-template-columns: 120px 210px 1fr;
&.daily {
grid-template-columns: 120px 1fr;
}
Expand Down
2 changes: 1 addition & 1 deletion src/component/DDLResultSetFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { FilterOutlined } from '@ant-design/icons';
import { Button, Checkbox, Input, Popover } from 'antd';
import { Component } from 'react';
// @ts-ignore
import { formatMessage } from '@/util/intl';
import { CheckboxValueType } from 'antd/lib/checkbox/Group';
import styles from './index.less';
import { formatMessage } from '@/util/intl';

export default class DDLResultSetFilter extends Component<
{
Expand Down
Loading
Loading