diff --git a/.stylelintrc b/.stylelintrc index b4331fbe879ac95bdff3bc83c8bc85437f476e74..1027152936f6ccc55a27ab3e6c78a37d2c033af4 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -20,6 +20,7 @@ "selector-list-comma-newline-after": null, "selector-pseudo-element-colon-notation": null, "unit-no-unknown": null, + "no-descending-specificity": null, "value-list-max-empty-lines": null } } diff --git a/package.json b/package.json index 409515b29d150a9c83215079a0e8855d90ec0958..b87c26fac951f50f5ec8215297394e57f55cab93 100755 --- a/package.json +++ b/package.json @@ -26,13 +26,11 @@ "bizcharts": "^3.1.0-beta.4", "bizcharts-plugin-slider": "^2.0.1", "classnames": "^2.2.5", - "core-js": "^2.5.1", "dva": "^2.1.0", "enquire-js": "^0.1.1", "fastclick": "^1.0.6", "lodash": "^4.17.4", "lodash-decorators": "^4.4.1", - "lodash.clonedeep": "^4.5.0", "moment": "^2.19.1", "numeral": "^2.0.6", "prop-types": "^15.5.10", @@ -46,8 +44,8 @@ }, "devDependencies": { "babel-eslint": "^8.0.1", - "babel-jest": "^21.0.0", - "babel-plugin-dva-hmr": "^0.3.2", + "babel-jest": "^22.0.4", + "babel-plugin-dva-hmr": "^0.4.0", "babel-plugin-import": "^1.2.1", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", @@ -68,8 +66,9 @@ "eslint-plugin-react": "^7.0.1", "gh-pages": "^1.0.0", "husky": "^0.14.3", - "jest": "^21.0.1", - "lint-staged": "^4.3.0", + "jest": "^22.0.4", + "jsdom": "^11.5.1", + "lint-staged": "^6.0.0", "mockjs": "^1.0.1-beta3", "prettier": "^1.9.0", "pro-download": "^1.0.0", @@ -79,7 +78,7 @@ "roadhog-api-doc": "^0.3.3", "rollbar": "^2.3.1", "stylelint": "^8.1.0", - "stylelint-config-standard": "^17.0.0" + "stylelint-config-standard": "^18.0.0" }, "optionalDependencies": { "nightmare": "^2.10.0" diff --git a/src/components/DescriptionList/DescriptionList.js b/src/components/DescriptionList/DescriptionList.js index 7eca3a7265c1825833005b9f9a417db39f246ffb..bef2cec978f2b530fb3ee2ba9c9fdce8a055f29e 100644 --- a/src/components/DescriptionList/DescriptionList.js +++ b/src/components/DescriptionList/DescriptionList.js @@ -6,8 +6,8 @@ import styles from './index.less'; export default ({ className, title, col = 3, layout = 'horizontal', gutter = 32, children, size, ...restProps }) => { const clsString = classNames(styles.descriptionList, styles[layout], className, { - [styles.descriptionListSmall]: size === 'small', - [styles.descriptionListLarge]: size === 'large', + [styles.small]: size === 'small', + [styles.large]: size === 'large', }); const column = col > 4 ? 4 : col; return ( diff --git a/src/components/DescriptionList/index.less b/src/components/DescriptionList/index.less index 067144e4041110d9a85d76019c3ea5e515d175ef..e8d5280e5b30f0d8c49a23afbf581a2157cd1b00 100644 --- a/src/components/DescriptionList/index.less +++ b/src/components/DescriptionList/index.less @@ -40,8 +40,29 @@ display: table-cell; } - &.vertical { + &.small { + // offset the padding-bottom of last row + :global { + .ant-row { + margin-bottom: -8px; + } + } + .title { + margin-bottom: 12px; + color: @text-color; + } + .term, .detail { + padding-bottom: 8px; + } + } + &.large { + .title { + font-size: 16px; + } + } + + &.vertical { .term { padding-bottom: 8px; display: block; @@ -52,24 +73,3 @@ } } } - -.descriptionListSmall { - // offset the padding-bottom of last row - :global { - .ant-row { - margin-bottom: -8px; - } - } - .title { - margin-bottom: 12px; - color: @text-color; - } - .term, .detail { - padding-bottom: 8px; - } -} -.descriptionListLarge { - .title { - font-size: 16px; - } -} diff --git a/src/components/GlobalHeader/index.less b/src/components/GlobalHeader/index.less index 057612b4eeeb9c406a7f6e14af218b4d4e37aab7..5618c8fda0877ac1ba2159d32d346feb521a41ac 100644 --- a/src/components/GlobalHeader/index.less +++ b/src/components/GlobalHeader/index.less @@ -60,8 +60,8 @@ i.trigger { font-size: 16px; vertical-align: middle; } - &:global(.ant-popover-open), - &:hover { + &:hover, + &:global(.ant-popover-open) { background: @primary-1; } } diff --git a/src/routes/Dashboard/Analysis.less b/src/routes/Dashboard/Analysis.less index 9b773a173b7519d53b7c8a8c5783377d451c1a73..38682c30f085c889819bdba10abe6e6501f5e3a0 100644 --- a/src/routes/Dashboard/Analysis.less +++ b/src/routes/Dashboard/Analysis.less @@ -83,11 +83,6 @@ padding-right: 24px; line-height: 55px; } - } -} - -.salesCard { - :global { .ant-card-head { position: relative; } diff --git a/src/routes/Forms/StepForm/style.less b/src/routes/Forms/StepForm/style.less index c97e60266aab15b4272ccf44ebe5bb7f41d159cd..3ca971cef8608a68fdc8fc93c05bc5d1751172d0 100644 --- a/src/routes/Forms/StepForm/style.less +++ b/src/routes/Forms/StepForm/style.less @@ -64,7 +64,7 @@ } .money { - font-family: Helvetica Neue; + font-family: "Helvetica Neue", sans-serif; font-weight: 500; font-size: 20px; line-height: 14px; diff --git a/src/routes/List/BasicList.less b/src/routes/List/BasicList.less index 94d677cc008c1a76ee302243b5d8806efe64ccd5..236793e32ea9d8509531c16db9ca80311fe58bb2 100644 --- a/src/routes/List/BasicList.less +++ b/src/routes/List/BasicList.less @@ -15,15 +15,13 @@ } .ant-list-pagination { text-align: right; + margin-top: 24px; } .ant-avatar-lg { width: 48px; height: 48px; line-height: 48px; } - .ant-list-pagination { - margin-top: 24px; - } } .headerInfo { position: relative; diff --git a/tests/setupTests.js b/tests/setupTests.js index c1d57d6b43b3a50711e7ad61356651e3477d0626..0fb8aa7ff607587a264e158e6bd6d33ed6e1a688 100644 --- a/tests/setupTests.js +++ b/tests/setupTests.js @@ -3,7 +3,7 @@ global.requestAnimationFrame = global.requestAnimationFrame || function requestAnimationFrame(callback) { setTimeout(callback, 0); }; -import { jsdom } from 'jsdom'; +import { JSDOM } from 'jsdom'; import Enzyme from 'enzyme'; import Adapter from 'enzyme-adapter-react-16'; @@ -11,6 +11,6 @@ Enzyme.configure({ adapter: new Adapter() }); // fixed jsdom miss const documentHTML = '
'; -global.document = jsdom(documentHTML); +global.document = new JSDOM(documentHTML); global.window = document.defaultView; global.navigator = global.window.navigator;