Skip to content

Commit

Permalink
chore: prettier code, lint, test case (#11323)
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 authored Aug 30, 2024
1 parent 559c01d commit 5b5afc7
Show file tree
Hide file tree
Showing 16 changed files with 3,255 additions and 3,149 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [16.x, 14.x]
node_version: [20, 16]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- run: echo ${{github.ref}}
Expand Down
2 changes: 2 additions & 0 deletions README.es-ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Proporcionamos `pro-cli` para inicializar rΓ‘pidamente la estructura del proyect
npm i @ant-design/pro-cli -g
pro create myapp
```

Selecciona la versiΓ³n de umi

```
Expand All @@ -95,6 +96,7 @@ Selecciona la versiΓ³n de umi
umi@3
```

> Si seleccionas la versiΓ³n umi@4, los bloques completos aΓΊn no son compatibles.
Si eliges umi@3, tambiΓ©n puedes elegir la plantilla "pro". "Pro" es la plantilla bΓ‘sica, que solo proporciona el contenido bΓ‘sico de la operaciΓ³n del marco. "Complete" contiene todos los bloques, lo cual no es adecuado para el desarrollo secundario como una plantilla bΓ‘sica.
Expand Down
2 changes: 1 addition & 1 deletion config/defaultSettings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProLayoutProps } from '@ant-design/pro-components';
import type { ProLayoutProps } from '@ant-design/pro-components';

/**
* @name
Expand Down
2 changes: 0 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export default async () => {
target: 'browser',
}),
});
console.log(JSON.stringify(config));

return {
...config,
testEnvironmentOptions: {
Expand Down
2 changes: 1 addition & 1 deletion mock/listTableList.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Request, Response } from 'express';
import dayjs from 'dayjs';
import { Request, Response } from 'express';
import { parse } from 'url';

// mock tableListDataSource
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "6.0.0",
"private": true,
"description": "An out-of-box UI solution for enterprise applications",
"repository": "git@github.com:ant-design/ant-design-pro.git",
"scripts": {
"analyze": "cross-env ANALYZE=1 max build",
"build": "max build",
Expand Down Expand Up @@ -48,21 +49,18 @@
"dependencies": {
"@ant-design/icons": "^4.8.3",
"@ant-design/pro-components": "^2.7.9",
"@umijs/route-utils": "^2.2.2",
"@testing-library/dom": "^10.4.0",
"antd": "^5.18.0",
"antd-style": "^3.6.2",
"classnames": "^2.5.1",
"omit.js": "^2.0.2",
"dayjs": "^1.11.13",
"querystring": "^0.2.1",
"rc-menu": "^9.14.0",
"rc-util": "^5.41.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet-async": "^1.3.0"
"react-dom": "^18.3.1"
},
"devDependencies": {
"@ant-design/pro-cli": "^3.3.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react": "^16.0.1",
"@types/classnames": "^2.3.1",
"@types/express": "^4.17.21",
"@types/history": "^4.7.11",
Expand Down
6,246 changes: 3,178 additions & 3,068 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Footer, Question, SelectLang, AvatarDropdown, AvatarName } from '@/components';
import { AvatarDropdown, AvatarName, Footer, Question, SelectLang } from '@/components';
import { currentUser as queryCurrentUser } from '@/services/ant-design-pro/api';
import { LinkOutlined } from '@ant-design/icons';
import type { Settings as LayoutSettings } from '@ant-design/pro-components';
import { SettingDrawer } from '@ant-design/pro-components';
import type { RunTimeLayoutConfig } from '@umijs/max';
import { history, Link } from '@umijs/max';
import React from 'react';
import defaultSettings from '../config/defaultSettings';
import { errorConfig } from './requestErrorConfig';
import { currentUser as queryCurrentUser } from '@/services/ant-design-pro/api';
import React from 'react';

const isDev = process.env.NODE_ENV === 'development';
const loginPath = '/user/login';

Expand Down
4 changes: 2 additions & 2 deletions src/components/HeaderDropdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Dropdown } from 'antd';
import type { DropDownProps } from 'antd/es/dropdown';
import React from 'react';
import { createStyles } from 'antd-style';
import type { DropDownProps } from 'antd/es/dropdown';
import classNames from 'classnames';
import React from 'react';

const useStyles = createStyles(({ token }) => {
return {
Expand Down
29 changes: 13 additions & 16 deletions src/components/RightContent/AvatarDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { outLogin } from '@/services/ant-design-pro/api';
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
import { history, useModel } from '@umijs/max';
import { Spin } from 'antd';
import type { MenuProps } from 'antd';
import { createStyles } from 'antd-style';
import { stringify } from 'querystring';
import type { MenuInfo } from 'rc-menu/lib/interface';
import React, { useCallback } from 'react';
import React from 'react';
import { flushSync } from 'react-dom';
import HeaderDropdown from '../HeaderDropdown';

Expand Down Expand Up @@ -62,20 +62,17 @@ export const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu, childre

const { initialState, setInitialState } = useModel('@@initialState');

const onMenuClick = useCallback(
(event: MenuInfo) => {
const { key } = event;
if (key === 'logout') {
flushSync(() => {
setInitialState((s) => ({ ...s, currentUser: undefined }));
});
loginOut();
return;
}
history.push(`/account/${key}`);
},
[setInitialState],
);
const onMenuClick: MenuProps['onClick'] = (event) => {
const { key } = event;
if (key === 'logout') {
flushSync(() => {
setInitialState((s) => ({ ...s, currentUser: undefined }));
});
loginOut();
return;
}
history.push(`/account/${key}`);
};

const loading = (
<span className={styles.action}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import Footer from './Footer';
import { Question, SelectLang } from './RightContent';
import { AvatarDropdown, AvatarName } from './RightContent/AvatarDropdown';

export { Footer, Question, SelectLang, AvatarDropdown, AvatarName };
export { AvatarDropdown, AvatarName, Footer, Question, SelectLang };
1 change: 0 additions & 1 deletion src/pages/TableList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ const TableList: React.FC = () => {
/>
),
dataIndex: 'name',
tip: 'The rule name is the unique key',
render: (dom, entity) => {
return (
<a
Expand Down
Loading

0 comments on commit 5b5afc7

Please sign in to comment.