Commit e7c447ab authored by Rayron Victor's avatar Rayron Victor Committed by 陈帅

Fix prettier glob (#2673)

* SelectLang: languages options don't need to be translated

* fix e2e tests when `PORT` is set in `.env`

* prettier: fix glob by adding single quotes.

* prettier: running prettier after glob fix
parent 1d39d7ef
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"test": "umi test", "test": "umi test",
"test:component": "umi test ./src/components", "test:component": "umi test ./src/components",
"test:all": "node ./tests/run-tests.js", "test:all": "node ./tests/run-tests.js",
"prettier": "prettier --write ./src/**/**/**/*", "prettier": "prettier --write './src/**/*'",
"docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up", "docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up",
"docker:build": "docker-compose -f ./docker/docker-compose.dev.yml build", "docker:build": "docker-compose -f ./docker/docker-compose.dev.yml build",
"docker-prod:dev": "docker-compose -f ./docker/docker-compose.yml up", "docker-prod:dev": "docker-compose -f ./docker/docker-compose.yml up",
......
import * as React from 'react'; import * as React from 'react';
export interface INoticeIconData { export interface INoticeIconData {
avatar?: string|React.ReactNode; avatar?: string | React.ReactNode;
title?: React.ReactNode; title?: React.ReactNode;
description?: React.ReactNode; description?: React.ReactNode;
datetime?: React.ReactNode; datetime?: React.ReactNode;
......
...@@ -17,7 +17,7 @@ export interface IPageHeaderProps { ...@@ -17,7 +17,7 @@ export interface IPageHeaderProps {
style?: React.CSSProperties; style?: React.CSSProperties;
home?: React.ReactNode; home?: React.ReactNode;
wide?: boolean; wide?: boolean;
hiddenBreadcrumb?:boolean; hiddenBreadcrumb?: boolean;
} }
export default class PageHeader extends React.Component<IPageHeaderProps, any> {} export default class PageHeader extends React.Component<IPageHeaderProps, any> {}
...@@ -43,7 +43,11 @@ class HeaderView extends PureComponent { ...@@ -43,7 +43,11 @@ class HeaderView extends PureComponent {
}; };
handleNoticeClear = type => { handleNoticeClear = type => {
message.success(`${formatMessage({ id: 'component.noticeIcon.cleared' })} ${formatMessage({ id: `component.globalHeader.${type}` })}`); message.success(
`${formatMessage({ id: 'component.noticeIcon.cleared' })} ${formatMessage({
id: `component.globalHeader.${type}`,
})}`
);
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'global/clearNotices', type: 'global/clearNotices',
......
import React from 'react'; import React from 'react';
import Link from 'umi/link'; import Link from 'umi/link';
import { formatMessage } from "umi/locale"; import { formatMessage } from 'umi/locale';
import Exception from '@/components/Exception'; import Exception from '@/components/Exception';
export default () => ( export default () => (
<Exception <Exception
type="404" type="404"
linkElement={Link} linkElement={Link}
desc={formatMessage({id: 'app.exception.description.404'})} desc={formatMessage({ id: 'app.exception.description.404' })}
backText={formatMessage({id: 'app.exception.back'})} backText={formatMessage({ id: 'app.exception.back' })}
/> />
); );
...@@ -21,12 +21,12 @@ class SearchList extends Component { ...@@ -21,12 +21,12 @@ class SearchList extends Component {
default: default:
break; break;
} }
} };
handleFormSubmit = (value) => { handleFormSubmit = value => {
// eslint-disable-next-line // eslint-disable-next-line
console.log(value); console.log(value);
} };
render() { render() {
const tabList = [ const tabList = [
......
...@@ -125,10 +125,7 @@ class CoverCardList extends PureComponent { ...@@ -125,10 +125,7 @@ class CoverCardList extends PureComponent {
<Col lg={8} md={10} sm={10} xs={24}> <Col lg={8} md={10} sm={10} xs={24}>
<FormItem {...formItemLayout} label="作者"> <FormItem {...formItemLayout} label="作者">
{getFieldDecorator('author', {})( {getFieldDecorator('author', {})(
<Select <Select placeholder="不限" style={{ maxWidth: 200, width: '100%' }}>
placeholder="不限"
style={{ maxWidth: 200, width: '100%' }}
>
<Option value="lisa">王昭君</Option> <Option value="lisa">王昭君</Option>
</Select> </Select>
)} )}
...@@ -137,10 +134,7 @@ class CoverCardList extends PureComponent { ...@@ -137,10 +134,7 @@ class CoverCardList extends PureComponent {
<Col lg={8} md={10} sm={10} xs={24}> <Col lg={8} md={10} sm={10} xs={24}>
<FormItem {...formItemLayout} label="好评度"> <FormItem {...formItemLayout} label="好评度">
{getFieldDecorator('rate', {})( {getFieldDecorator('rate', {})(
<Select <Select placeholder="不限" style={{ maxWidth: 200, width: '100%' }}>
placeholder="不限"
style={{ maxWidth: 200, width: '100%' }}
>
<Option value="good">优秀</Option> <Option value="good">优秀</Option>
<Option value="normal">普通</Option> <Option value="normal">普通</Option>
</Select> </Select>
......
...@@ -92,7 +92,9 @@ class LoginPage extends Component { ...@@ -92,7 +92,9 @@ class LoginPage extends Component {
{login.status === 'error' && {login.status === 'error' &&
login.type === 'mobile' && login.type === 'mobile' &&
!submitting && !submitting &&
this.renderMessage(formatMessage({ id: 'app.login.message-invalid-verification-code' }))} this.renderMessage(
formatMessage({ id: 'app.login.message-invalid-verification-code' })
)}
<Mobile name="mobile" /> <Mobile name="mobile" />
<Captcha name="captcha" countDown={120} onGetCaptcha={this.onGetCaptcha} /> <Captcha name="captcha" countDown={120} onGetCaptcha={this.onGetCaptcha} />
</Tab> </Tab>
......
...@@ -63,10 +63,7 @@ const cachedSave = (response, hashcode) => { ...@@ -63,10 +63,7 @@ const cachedSave = (response, hashcode) => {
* @param {object} [option] The options we want to pass to "fetch" * @param {object} [option] The options we want to pass to "fetch"
* @return {object} An object containing either "data" or "err" * @return {object} An object containing either "data" or "err"
*/ */
export default function request( export default function request(url, option) {
url,
option,
) {
const options = { const options = {
expirys: isAntdPro(), expirys: isAntdPro(),
...option, ...option,
......
...@@ -22,7 +22,6 @@ describe('fixedZero tests', () => { ...@@ -22,7 +22,6 @@ describe('fixedZero tests', () => {
expect(fixedZero(8)).toEqual('08'); expect(fixedZero(8)).toEqual('08');
expect(fixedZero(9)).toEqual('09'); expect(fixedZero(9)).toEqual('09');
}); });
}); });
describe('isUrl tests', () => { describe('isUrl tests', () => {
...@@ -60,5 +59,4 @@ describe('isUrl tests', () => { ...@@ -60,5 +59,4 @@ describe('isUrl tests', () => {
expect(isUrl('http://www.example.com/test/123?foo=bar')).toBeTruthy(); expect(isUrl('http://www.example.com/test/123?foo=bar')).toBeTruthy();
expect(isUrl('https://www.example.com/test/123?foo=bar')).toBeTruthy(); expect(isUrl('https://www.example.com/test/123?foo=bar')).toBeTruthy();
}); });
}); });
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment