From a674541260d0be050a9b6e020705138bccf41b91 Mon Sep 17 00:00:00 2001 From: zombiej Date: Thu, 29 Oct 2020 10:14:41 +0800 Subject: [PATCH 01/16] docs: Open site res docs in new page --- site/theme/template/Home/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/theme/template/Home/index.tsx b/site/theme/template/Home/index.tsx index 7b3a16fd19..df5576e820 100644 --- a/site/theme/template/Home/index.tsx +++ b/site/theme/template/Home/index.tsx @@ -77,7 +77,7 @@ const Home = (props: { location: any }) => { } extra={ - + } From 204d2e342a70deafffadfbb3187284f895104989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=97=E4=BD=A0=E6=98=AF=E5=B0=8F=E7=8C=AB=E5=92=AA?= Date: Thu, 29 Oct 2020 11:50:49 +0800 Subject: [PATCH 02/16] test: ui test use secret and include branch (#27433) * test: ui test use secret and include branch * fix argos token --- azure-pipelines.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 04419f29fe..c0dead5a50 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,8 +2,9 @@ name: Ant Design trigger: branches: - exclude: - - gh-pages + include: + - master + - feature # https://developercommunity.visualstudio.com/comments/949241/view.html pr: @@ -67,6 +68,7 @@ stages: - stage: ui variables: + ARGOSTOKEN: $(ARGOS_TOKEN) ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}: branchName: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ] commitId: $(Build.SourceVersion) @@ -91,5 +93,5 @@ stages: displayName: 'Install modules' - script: npm run test-image displayName: 'UI Test' - - script: npm run argos -- --token $ARGOS_TOKEN --branch $(branchName) --commit $(commitId) + - script: npm run argos -- --token $(ARGOSTOKEN) --branch $(branchName) --commit $(commitId) displayName: 'Upload to argos-ci' From 84e8d18f89b3142dbcb9bd5984e6aaf2d0897394 Mon Sep 17 00:00:00 2001 From: Kermit Xuan Date: Thu, 29 Oct 2020 12:23:02 +0800 Subject: [PATCH 03/16] fix: lock ignore-emit-webpack-plugin version (#27434) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ae33cc494..80b8279a07 100644 --- a/package.json +++ b/package.json @@ -218,7 +218,7 @@ "http-server": "^0.12.0", "husky": "^4.0.3", "identity-obj-proxy": "^3.0.0", - "ignore-emit-webpack-plugin": "^2.0.2", + "ignore-emit-webpack-plugin": "2.0.2", "immutability-helper": "^3.0.0", "inquirer": "^7.1.0", "intersection-observer": "^0.11.0", From db89bf3955b462796382580ca9b89e1944c0df83 Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Thu, 29 Oct 2020 15:29:20 +0800 Subject: [PATCH 04/16] fix: RangePicker border style when has same data (#27438) --- components/date-picker/style/panel.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/date-picker/style/panel.less b/components/date-picker/style/panel.less index 3a164e32c0..4d57191a98 100644 --- a/components/date-picker/style/panel.less +++ b/components/date-picker/style/panel.less @@ -239,6 +239,8 @@ &-in-view&-range-hover-start:not(&-in-range):not(&-range-start):not(&-range-end), &-in-view&-range-hover-end:not(&-in-range):not(&-range-start):not(&-range-end), &-in-view&-range-hover-start&-range-start-single, + &-in-view&-range-hover-start&-range-start&-range-end&-range-end-near-hover, + &-in-view&-range-hover-end&-range-start&-range-end&-range-start-near-hover, &-in-view&-range-hover-end&-range-end-single, &-in-view&-range-hover:not(&-in-range) { &::after { From 9e1b78e9c8202803b99dc311758e1e8e567a99df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=97=E4=BD=A0=E6=98=AF=E5=B0=8F=E7=8C=AB=E5=92=AA?= Date: Thu, 29 Oct 2020 21:31:00 +0800 Subject: [PATCH 05/16] test: enable pr test action (#27440) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 610e1fdd1c..2215a5df5c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ name: test -on: [push] +on: [push, pull_request] jobs: setup: From aa95f58fbf6607fbe00f84b3ddc286a7dead829d Mon Sep 17 00:00:00 2001 From: Lyndon001 Date: Fri, 30 Oct 2020 09:48:47 +0800 Subject: [PATCH 06/16] Update resources.zh-CN.md --- docs/resources.zh-CN.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/resources.zh-CN.md b/docs/resources.zh-CN.md index 23ff47b13e..27be39705c 100644 --- a/docs/resources.zh-CN.md +++ b/docs/resources.zh-CN.md @@ -132,7 +132,7 @@ toc: false ### UI/UE 设计师 -简历和作品集请投递:lindong.lld#alipay.com +简历和作品集请投递:lindong.lld#antgroup.com > 注明简历来自 ant.design 官网 @@ -146,13 +146,13 @@ toc: false - 有数据驱动的增长设计实践,加分; - 深度理解 SAP、Salesforce、Google 等设计体系,能提出自己独到见解并落实到实践中,加加加分。 - 岗位职责: - - 参与[蚂蚁金融科技](https://tech.antfin.com/)、[区块链](https://tech.antfin.com/blockchain)、人工智能等企业级产品的设计工作; + - 参与[蚂蚁链](https://blockchain.antgroup.com/)、人工智能、数据平台等企业级产品的设计工作; - 参与[语雀](https://www.yuque.com/)、[云凤蝶](https://www.yunfengdie.com/)等创新产品的设计工作; - 参与 Ant Design 的打磨,将其建设成全球卓越的设计体系。 - 参与 AntV 的打磨,将其建设成全球一流的数据可视化体系。 - One More Thing ❤️ : - - 你们总是为世界带去美好,但总是忘却你们也需要美好。我们正在努力打造 [🍳 Kitchen:一款为设计师提效的 Sketch 工具集](https://kitchen.alipay.com/)、[语雀画板](https://yuque.com/) 等专属设计师的产品,让设计真正变成财富。期待志同道合的你,一道给设计行业带来「微小而美好的改变」。 + - 你们总是为世界带去美好,但总是忘却你们也需要美好。我们正在努力打造 [🍳 Kitchen:一款为设计师提效的 Sketch 工具集](https://kitchen.alipay.com/)等专属设计师的产品,让设计真正变成财富。期待志同道合的你,一道给设计行业带来「微小而美好的改变」。 ### 前端工程师 From d4a4468789a0ade74fe6c9d029546780be037337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=97=E4=BD=A0=E6=98=AF=E5=B0=8F=E7=8C=AB=E5=92=AA?= Date: Fri, 30 Oct 2020 11:49:40 +0800 Subject: [PATCH 07/16] test: github secret token (#27453) * test: github secret token * use test ui action --- .github/workflows/test.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2215a5df5c..94c74228d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ name: test -on: [push, pull_request] +on: [push, pull_request_target] jobs: setup: @@ -208,3 +208,25 @@ jobs: env: LIB_DIR: es needs: compile + + ui: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@master + + - name: restore cache from package-lock.json + uses: actions/cache@v1 + with: + path: package-temp-dir + key: lock-${{ github.sha }} + + - name: restore cache from node_modules + uses: actions/cache@v1 + with: + path: node_modules + key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} + + - name: test + run: npm run argos -- --token ${{ secrets.ARGOS_TOKEN }} --branch ${GITHUB_REF##*/} --commit ${GITHUB_SHA} + needs: setup From 5669d9c65ac7e39928ae4baa8e7330029bece2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=97=E4=BD=A0=E6=98=AF=E5=B0=8F=E7=8C=AB=E5=92=AA?= Date: Fri, 30 Oct 2020 13:18:20 +0800 Subject: [PATCH 08/16] test: fix lose test script (#27455) * fix lose test script * fix action cache not enable pr target * add ui yml --- .github/workflows/test.yml | 24 +----------------------- .github/workflows/ui.yml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/ui.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 94c74228d9..2215a5df5c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ name: test -on: [push, pull_request_target] +on: [push, pull_request] jobs: setup: @@ -208,25 +208,3 @@ jobs: env: LIB_DIR: es needs: compile - - ui: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@master - - - name: restore cache from package-lock.json - uses: actions/cache@v1 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v1 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: test - run: npm run argos -- --token ${{ secrets.ARGOS_TOKEN }} --branch ${GITHUB_REF##*/} --commit ${GITHUB_SHA} - needs: setup diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml new file mode 100644 index 0000000000..194f18177e --- /dev/null +++ b/.github/workflows/ui.yml @@ -0,0 +1,19 @@ +name: UI + +on: [push, pull_request_target] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@master + + - name: install + run: npm install + + - name: test + run: npm run test-image + + - name: argos-ci + run: npm run argos -- --token ${{ secrets.ARGOS_TOKEN }} --branch ${GITHUB_REF##*/} --commit ${GITHUB_SHA} From 39e37bf1b41102354e23ebeb072748429aef1f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Fri, 30 Oct 2020 15:27:37 +0800 Subject: [PATCH 09/16] fix: Input[allowClear] className (#27462) * fix: Input[allowClear] className missing close #27444 * fix snapshot --- .../__tests__/__snapshots__/demo.test.js.snap | 2 +- components/input/ClearableLabeledInput.tsx | 16 +++-- components/input/__tests__/Search.test.js | 6 +- .../__snapshots__/Search.test.js.snap | 62 ++++++++++++++++++- .../__tests__/__snapshots__/demo.test.js.snap | 2 +- .../__snapshots__/index.test.js.snap | 54 ---------------- components/input/__tests__/index.test.js | 28 ++++++--- 7 files changed, 94 insertions(+), 76 deletions(-) diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index a6ec07b9f4..e2570853b0 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -7623,7 +7623,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = ` class="ant-form-item-control-input-content" > { [`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl', [`${prefixCls}-affix-wrapper-readonly`]: readOnly, [`${prefixCls}-affix-wrapper-borderless`]: !bordered, - // https://github.com/ant-design/ant-design/issues/27258 - [`${className}`]: !allowClear && className, + // className will go to addon wrapper + [`${className}`]: !hasAddon(this.props) && className, }); return ( { renderInputWithLabel(prefixCls: string, labeledElement: React.ReactElement) { const { addonBefore, addonAfter, style, size, className, direction } = this.props; // Not wrap when there is not addons - if (!addonBefore && !addonAfter) { + if (!hasAddon(this.props)) { return labeledElement; } @@ -156,8 +160,7 @@ class ClearableLabeledInput extends React.Component { ) : null; const addonAfterNode = addonAfter ? {addonAfter} : null; - const mergedWrapperClassName = classNames(`${prefixCls}-wrapper`, { - [wrapperClassName]: addonBefore || addonAfter, + const mergedWrapperClassName = classNames(`${prefixCls}-wrapper`, wrapperClassName, { [`${wrapperClassName}-rtl`]: direction === 'rtl', }); @@ -197,8 +200,9 @@ class ClearableLabeledInput extends React.Component { { [`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl', [`${prefixCls}-affix-wrapper-borderless`]: !bordered, + // className will go to addon wrapper + [`${className}`]: !hasAddon(this.props) && className, }, - className, ); return ( diff --git a/components/input/__tests__/Search.test.js b/components/input/__tests__/Search.test.js index 49f0546be6..9c1f936e0b 100644 --- a/components/input/__tests__/Search.test.js +++ b/components/input/__tests__/Search.test.js @@ -22,10 +22,8 @@ describe('Input.Search', () => { }); it('should support ReactNode suffix without error', () => { - const fn = () => { - mount(ok} />); - }; - expect(fn).not.toThrow(); + const wrapper = mount(ok} />); + expect(wrapper.render()).toMatchSnapshot(); }); it('should disable enter button when disabled prop is true', () => { diff --git a/components/input/__tests__/__snapshots__/Search.test.js.snap b/components/input/__tests__/__snapshots__/Search.test.js.snap index a2746d8e5d..b5936dcce5 100644 --- a/components/input/__tests__/__snapshots__/Search.test.js.snap +++ b/components/input/__tests__/__snapshots__/Search.test.js.snap @@ -45,6 +45,62 @@ exports[`Input.Search rtl render component should be rendered correctly in RTL d `; +exports[`Input.Search should support ReactNode suffix without error 1`] = ` + + + + + +
+ ok +
+
+
+ + + +
+
+`; + exports[`Input.Search should support addonAfter 1`] = ` `; - -exports[`Input.Search should support suffix 1`] = ` - - - - - - suffix - - - - - - - -`; diff --git a/components/input/__tests__/index.test.js b/components/input/__tests__/index.test.js index fce7dbf558..0268a9627b 100644 --- a/components/input/__tests__/index.test.js +++ b/components/input/__tests__/index.test.js @@ -76,6 +76,20 @@ describe('Input', () => { }); }); +describe('prefix and suffix', () => { + it('should support className when has suffix', () => { + const wrapper = mount(); + expect(wrapper.getDOMNode().className.includes('my-class-name')).toBe(true); + expect(wrapper.find('input').getDOMNode().className.includes('my-class-name')).toBe(false); + }); + + it('should support className when has prefix', () => { + const wrapper = mount(); + expect(wrapper.getDOMNode().className.includes('my-class-name')).toBe(true); + expect(wrapper.find('input').getDOMNode().className.includes('my-class-name')).toBe(false); + }); +}); + describe('As Form Control', () => { it('should be reset when wrapped in form.getFieldDecorator without initialValue', () => { const Demo = () => { @@ -110,13 +124,6 @@ describe('As Form Control', () => { }); }); -describe('Input.Search', () => { - it('should support suffix', () => { - const wrapper = mount(); - expect(wrapper.render()).toMatchSnapshot(); - }); -}); - describe('Input allowClear', () => { it('should change type when click', () => { const wrapper = mount(); @@ -189,4 +196,11 @@ describe('Input allowClear', () => { expect(wrapper.find('.ant-input-clear-icon-hidden').exists()).toBeTruthy(); }); }); + + // https://github.com/ant-design/ant-design/issues/27444 + it('should support className', () => { + const wrapper = mount(); + expect(wrapper.getDOMNode().className.includes('my-class-name')).toBe(true); + expect(wrapper.find('input').getDOMNode().className.includes('my-class-name')).toBe(false); + }); }); From dbca2381df279dc45fab3f6b226d9967c3658c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=97=E4=BD=A0=E6=98=AF=E5=B0=8F=E7=8C=AB=E5=92=AA?= Date: Fri, 30 Oct 2020 15:29:23 +0800 Subject: [PATCH 10/16] test: remove azure ui test and try test pr github action (#27458) * test: remove azure ui test and try test pr github action * fix pr if --- .github/workflows/ui.yml | 7 ++++++- azure-pipelines.yml | 37 +------------------------------------ 2 files changed, 7 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml index 194f18177e..4749503673 100644 --- a/.github/workflows/ui.yml +++ b/.github/workflows/ui.yml @@ -16,4 +16,9 @@ jobs: run: npm run test-image - name: argos-ci - run: npm run argos -- --token ${{ secrets.ARGOS_TOKEN }} --branch ${GITHUB_REF##*/} --commit ${GITHUB_SHA} + if: github.event_name == 'pull_request_target' + run: npm run argos -- --token ${{ secrets.ARGOS_TOKEN }} --branch pull/${{ github.event.pull_request.number }}/merge --commit ${{ github.event.pull_request.head.sha }} + + - name: argos-ci + if: github.event_name == 'push' + run: npm run argos -- --token ${{ secrets.ARGOS_TOKEN }} --branch ${GITHUB_REF##*/} --commit ${{ github.sha }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c0dead5a50..f28a1a6a00 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,12 +1,7 @@ name: Ant Design -trigger: - branches: - include: - - master - - feature +trigger: none -# https://developercommunity.visualstudio.com/comments/949241/view.html pr: autoCancel: true branches: @@ -65,33 +60,3 @@ stages: - script: | node ./scripts/azure-github-comment.js "[](https://dev.azure.com/ant-design/ant-design/_build/results?buildId=$(Build.BuildId))" displayName: 'Comment on github' - - - stage: ui - variables: - ARGOSTOKEN: $(ARGOS_TOKEN) - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}: - branchName: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ] - commitId: $(Build.SourceVersion) - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: - branchName: $[ replace(variables['Build.SourceBranch'], 'refs/', '') ] - commitId: $(System.PullRequest.SourceCommitId) - dependsOn: [] - jobs: - - job: UI_Test - steps: - - script: | - echo $(commitId) - - checkout: self - displayName: 'Checkout' - clean: true - fetchDepth: 1 - - task: NodeTool@0 - displayName: 'Install Node.js' - inputs: - versionSpec: '14.7.0' - - script: npm install - displayName: 'Install modules' - - script: npm run test-image - displayName: 'UI Test' - - script: npm run argos -- --token $(ARGOSTOKEN) --branch $(branchName) --commit $(commitId) - displayName: 'Upload to argos-ci' From d8a225fdb912eea29991306728cd6acb80213dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=97=E4=BD=A0=E6=98=AF=E5=B0=8F=E7=8C=AB=E5=92=AA?= Date: Fri, 30 Oct 2020 17:13:25 +0800 Subject: [PATCH 11/16] test: fix ui push trigger branch (#27466) --- .github/workflows/ui.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml index 4749503673..83b999feb3 100644 --- a/.github/workflows/ui.yml +++ b/.github/workflows/ui.yml @@ -1,6 +1,10 @@ name: UI -on: [push, pull_request_target] +on: + pull_request_target: + push: + branches: + - master jobs: test: From f2a16bc9044aa660139df64bab89b87a843386ab Mon Sep 17 00:00:00 2001 From: appleshell Date: Fri, 30 Oct 2020 17:50:39 +0800 Subject: [PATCH 12/16] docs: update description of optionFilterProp in Select (#27467) * docs: update description of optionFilterProp in Select * update description * update description Co-authored-by: lvpansen --- components/select/index.en-US.md | 2 +- components/select/index.zh-CN.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/select/index.en-US.md b/components/select/index.en-US.md index 989f197034..aa6a4b47e0 100644 --- a/components/select/index.en-US.md +++ b/components/select/index.en-US.md @@ -49,7 +49,7 @@ Select component to select value from options. | mode | Set mode of Select | `multiple` \| `tags` | - | | | notFoundContent | Specify content to show when no result matches | ReactNode | `Not Found` | | | open | Controlled open state of dropdown | boolean | - | | -| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | `value` | | +| optionFilterProp | Which prop value of option will be used for filter if filterOption is true. If `options` is set, it should be set to `label` | string | `value` | | | optionLabelProp | Which prop value of option will render as content of select. [Example](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | `children` | | | options | Select options. Will get better perf than jsx definition | { label, value }\[] | - | | | placeholder | Placeholder of select | ReactNode | - | | diff --git a/components/select/index.zh-CN.md b/components/select/index.zh-CN.md index 4fd09f1a11..8937b35222 100644 --- a/components/select/index.zh-CN.md +++ b/components/select/index.zh-CN.md @@ -50,8 +50,8 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_0XzgOis7/Select.svg | mode | 设置 Select 的模式为多选或标签 | `multiple` \| `tags` | - | | | notFoundContent | 当下拉列表为空时显示的内容 | ReactNode | `Not Found` | | | open | 是否展开下拉菜单 | boolean | - | | -| optionFilterProp | 搜索时过滤对应的 option 属性,如设置为 children 表示对内嵌内容进行搜索。[示例](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | `value` | | -| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value` | string | `children` | | +| optionFilterProp | 搜索时过滤对应的 `option` 属性,如设置为 `children` 表示对内嵌内容进行搜索。若通过 `options` 属性配置选项内容,建议设置 `optionFilterProp="label"` 来对内容进行搜索。 | string | `value` | | +| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。[示例](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | `children` | | | options | 数据化配置选项内容,相比 jsx 定义会获得更好的渲染性能 | { label, value }\[] | - | | | placeholder | 选择框默认文字 | string | - | | | removeIcon | 自定义的多选框清除图标 | ReactNode | - | | From 86f07dfd1a8e60999bad762c5f2a9ae5557b7d18 Mon Sep 17 00:00:00 2001 From: yuanyao1225 <73329016+yuanyao1225@users.noreply.github.com> Date: Fri, 30 Oct 2020 18:35:47 +0800 Subject: [PATCH 13/16] docs: Update home page articles (#27452) * feat: article * Update RecommendPage.tsx * Update RecommendPage.tsx * Update RecommendPage.tsx * Update RecommendPage.tsx * Update RecommendPage.tsx --- site/theme/template/Home/RecommendPage.tsx | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/site/theme/template/Home/RecommendPage.tsx b/site/theme/template/Home/RecommendPage.tsx index 8fd1f2ebd9..fe4d30a01a 100644 --- a/site/theme/template/Home/RecommendPage.tsx +++ b/site/theme/template/Home/RecommendPage.tsx @@ -16,42 +16,42 @@ interface Recommend { const LIST_CN: Recommend[] = [ { - title: '这几个 Ant Design 色彩的小知识,我猜你不知道!', - description: '今天不说大道理,就给大家科普几个 Ant Design 色彩的小知识——', - img: 'https://pic4.zhimg.com/v2-254eebfe6b092b0b9c1f8d17f3c64d3d_1440w.jpg?source=172ae18b', - href: 'https://zhuanlan.zhihu.com/p/268168773', + title: '新一代 Ant Design,未来已来,邀你共建!', + description: '欢迎加入,Ant Designers!', + img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*yGcPRroihLQAAAAAAAAAAAAAARQnAQ', + href: 'https://zhuanlan.zhihu.com/p/269789439', popularize: true, }, { - title: '第十五届 D2 前端技术论坛 - 无界', - description: '前端热爱,技术无界,第十五届 D2 前端技术论坛,我们云端相聚!', - img: 'https://img.alicdn.com/tfs/TB1R39KnSR26e4jSZFEXXbwuXXa-1960-768.png', - href: 'http://d2forum.alibaba-inc.com/', + title: '在Ant Design 4.0里,我们如何追求快乐的工作?', + description: '蚂蚁集团高级体验设计专家林外在上海外滩大会上分享 Ant Design4.0 背后的设计理念', + img: 'https://gw.alipayobjects.com/mdn/rms_b56775/afts/img/A*psuyRqopCIEAAAAAAAAAAAAAARQnAQ', + href: 'https://mp.weixin.qq.com/s/QUqy1-g0FElqOs9cQFFWHA', }, { - title: 'Ant Design 4.0 的一些杂事儿 - VirtualList 篇', + title: '第十五届 D2 前端技术论坛 - 无界', description: - '在 React 中,我们常说不太需要关注性能问题。然而作为组件库,这些事你就不得不考虑一下。', - img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*ULOBQroFRMQAAAAAAAAAAAAAARQnAQ', - href: 'https://zhuanlan.zhihu.com/p/237996796', + '前端热爱,技术无界,第十五届 D2 前端技术论坛,我们云端相聚!', + img: 'https://img.alicdn.com/tfs/TB1R39KnSR26e4jSZFEXXbwuXXa-1960-768.png', + href: 'http://d2forum.alibaba-inc.com/', }, ]; const LIST_EN: Recommend[] = [ { - title: 'These a few color knowledge of Ant Design, I guess you do not know!', + title: 'New generation of Ant Design, the future is coming, let us create it together!', description: - '🎨 This time, we do not talk about theoretical knowledge, just a few color design skills of Ant Design', - img: 'https://pic4.zhimg.com/v2-254eebfe6b092b0b9c1f8d17f3c64d3d_1440w.jpg?source=172ae18b', - href: 'https://zhuanlan.zhihu.com/p/268168773', + 'Welcome to join us,Ant Designers!', + img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*yGcPRroihLQAAAAAAAAAAAAAARQnAQ', + href: 'https://zhuanlan.zhihu.com/p/269789439', popularize: true, }, { - title: 'Next Generation of Component Library?', + title: 'How do we pursue happy work in Ant Design 4.0?', description: - '😎 With the launch of React hooks and Vue composition API, perhaps we have met a new breakthrough point of component libraries.', - img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*SU6hQ5jHVEsAAAAAAAAAAAAAARQnAQ', - href: 'https://zhuanlan.zhihu.com/p/252824872', + 'Ant group senior experience design expert Lin Wai shares the design concept behind Ant Design 4.0', + img: 'https://gw.alipayobjects.com/mdn/rms_b56775/afts/img/A*psuyRqopCIEAAAAAAAAAAAAAARQnAQ', + href: 'https://mp.weixin.qq.com/s/QUqy1-g0FElqOs9cQFFWHA', }, { title: 'Stories about Ant Design 4.0: VirtualList', From 972d280aa12c7ebb57e84e286c3c0272850171aa Mon Sep 17 00:00:00 2001 From: Amumu Date: Fri, 30 Oct 2020 19:33:09 +0800 Subject: [PATCH 14/16] chore: fix lock version (#27472) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 80b8279a07..19c9817843 100644 --- a/package.json +++ b/package.json @@ -218,7 +218,7 @@ "http-server": "^0.12.0", "husky": "^4.0.3", "identity-obj-proxy": "^3.0.0", - "ignore-emit-webpack-plugin": "2.0.2", + "ignore-emit-webpack-plugin": "2.0.3", "immutability-helper": "^3.0.0", "inquirer": "^7.1.0", "intersection-observer": "^0.11.0", From 9052af449b610776aa17641b6dda2372ab0f8539 Mon Sep 17 00:00:00 2001 From: xyb <576420147@qq.com> Date: Fri, 30 Oct 2020 19:52:12 +0800 Subject: [PATCH 15/16] fix: Modal missing modalRender prop (#27272) close #27174 --- components/modal/ConfirmDialog.tsx | 2 ++ components/modal/Modal.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/components/modal/ConfirmDialog.tsx b/components/modal/ConfirmDialog.tsx index f580336380..d9690ed4a1 100644 --- a/components/modal/ConfirmDialog.tsx +++ b/components/modal/ConfirmDialog.tsx @@ -31,6 +31,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => { direction, prefixCls, rootPrefixCls, + modalRender, } = props; devWarning( @@ -93,6 +94,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => { keyboard={keyboard} centered={centered} getContainer={getContainer} + modalRender={modalRender} >
diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx index 36be0bdd98..acce2ac47c 100644 --- a/components/modal/Modal.tsx +++ b/components/modal/Modal.tsx @@ -80,6 +80,7 @@ export interface ModalProps { wrapProps?: any; prefixCls?: string; closeIcon?: React.ReactNode; + modalRender?: (node: React.ReactNode) => React.ReactNode; } type getContainerFunc = () => HTMLElement; @@ -114,6 +115,7 @@ export interface ModalFuncProps { transitionName?: string; maskTransitionName?: string; direction?: string; + modalRender?: (node: React.ReactNode) => React.ReactNode; } export interface ModalLocale { From 5c0799d5acb902b2d543422183b7402f80413129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=8C=AB?= Date: Fri, 30 Oct 2020 20:02:43 +0800 Subject: [PATCH 16/16] docs: add techui promotion (#27465) * feat: add techui promotion * feat: change button to menu * feat: change TechUI menu position --- components/overview/index.zh-CN.md | 2 +- .../theme/template/Layout/Header/Navigation.tsx | 9 +++++++++ site/theme/template/Layout/Header/index.tsx | 17 ++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/components/overview/index.zh-CN.md b/components/overview/index.zh-CN.md index f73d7df694..3a790c387f 100644 --- a/components/overview/index.zh-CN.md +++ b/components/overview/index.zh-CN.md @@ -4,4 +4,4 @@ title: 组件总览 type: 组件总览 --- -`antd` 为 Web 应用提供了丰富的基础 UI 组件,我们还将持续探索企业级应用的最佳 UI 实践。除了官方组件,我们也提供了[社区精选组件](/docs/react/recommendation)作为必要的补充。 +`antd` 为 Web 应用提供了丰富的基础 UI 组件,我们还将持续探索企业级应用的最佳 UI 实践。除了官方组件,我们也提供了[社区精选组件](/docs/react/recommendation)作为必要的补充,另外如果您是内网用户,欢迎尝试使用 [TechUI](https://techui.alipay.com)。 diff --git a/site/theme/template/Layout/Header/Navigation.tsx b/site/theme/template/Layout/Header/Navigation.tsx index 1914bc14dd..e7e5e0a5e0 100644 --- a/site/theme/template/Layout/Header/Navigation.tsx +++ b/site/theme/template/Layout/Header/Navigation.tsx @@ -17,6 +17,7 @@ export interface NavigationProps extends SharedProps { responsive: null | 'narrow' | 'crowded'; location: { pathname: string; query: any }; directionText: string; + showTechUIButton: boolean; onLangChange: () => void; onDirectionChange: () => void; } @@ -29,6 +30,7 @@ export default ({ responsive, location, directionText, + showTechUIButton, onLangChange, onDirectionChange, }: NavigationProps) => { @@ -100,6 +102,13 @@ export default ({ + {showTechUIButton && ( + + + TechUI + + + )} {isZhCN && !isGitee && ( 国内镜像 diff --git a/site/theme/template/Layout/Header/index.tsx b/site/theme/template/Layout/Header/index.tsx index 3a33558099..e3de78cd2d 100644 --- a/site/theme/template/Layout/Header/index.tsx +++ b/site/theme/template/Layout/Header/index.tsx @@ -12,6 +12,7 @@ import More from './More'; import Navigation from './Navigation'; import Github from './Github'; import SiteContext from '../SiteContext'; +import { ping } from '../../utils'; import './index.less'; @@ -61,15 +62,19 @@ interface HeaderState { menuVisible: boolean; windowWidth: number; searching: boolean; + showTechUIButton: boolean; } class Header extends React.Component { static contextType = SiteContext; + pingTimer: NodeJS.Timeout; + state = { menuVisible: false, windowWidth: 1400, searching: false, + showTechUIButton: false, }; componentDidMount() { @@ -79,10 +84,19 @@ class Header extends React.Component { window.addEventListener('resize', this.onWindowResize); this.onWindowResize(); + + this.pingTimer = ping(status => { + if (status !== 'timeout' && status !== 'error') { + this.setState({ + showTechUIButton: true, + }); + } + }); } componentWillUnmount() { window.removeEventListener('resize', this.onWindowResize); + clearTimeout(this.pingTimer); } onWindowResize = () => { @@ -179,7 +193,7 @@ class Header extends React.Component { return ( {({ isMobile }) => { - const { menuVisible, windowWidth, searching } = this.state; + const { menuVisible, windowWidth, searching, showTechUIButton } = this.state; const { direction } = this.context; const { location, @@ -232,6 +246,7 @@ class Header extends React.Component { location={location} responsive={responsive} isMobile={isMobile} + showTechUIButton={showTechUIButton} pathname={pathname} directionText={this.getNextDirectionText()} onLangChange={this.onLangChange}