From 827225b8959f734d3df446b7cfb23c8fb97d73bd Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 14 Oct 2021 12:09:07 +0800 Subject: [PATCH] chore: replace demo image to public avatar resources (#32479) * docs: replace avatar image to joeschmoe placeholder * docs: usage randomme avatar url --- components/avatar/__tests__/Avatar.test.js | 8 ++++---- .../__tests__/__snapshots__/Avatar.test.js.snap | 8 ++++---- .../__tests__/__snapshots__/demo.test.js.snap | 11 ++++++----- components/avatar/demo/group.md | 6 +++--- components/avatar/demo/type.md | 6 ++---- .../__tests__/__snapshots__/demo.test.js.snap | 2 +- components/card/demo/loading.md | 8 ++------ components/card/demo/meta.md | 2 +- .../__tests__/__snapshots__/demo.test.js.snap | 16 ++++++++-------- components/comment/demo/basic.md | 7 +------ components/comment/demo/editor.md | 9 ++------- components/comment/demo/list.md | 4 ++-- components/comment/demo/nested.md | 7 +------ .../__snapshots__/components.test.js.snap | 12 ++++++------ .../config-provider/__tests__/components.test.js | 4 +--- components/list/__tests__/Item.test.js | 2 +- .../__tests__/__snapshots__/demo.test.js.snap | 14 +++++++------- components/list/demo/basic.md | 2 +- components/list/demo/infinite-load.md | 6 ++---- .../list/demo/infinite-virtualized-load.md | 4 ++-- components/list/demo/loadmore.md | 6 ++---- components/list/demo/vertical.md | 2 +- components/skeleton/demo/list.md | 2 +- 23 files changed, 61 insertions(+), 87 deletions(-) diff --git a/components/avatar/__tests__/Avatar.test.js b/components/avatar/__tests__/Avatar.test.js index 6473e5c9b239..aa066fdf7a17 100644 --- a/components/avatar/__tests__/Avatar.test.js +++ b/components/avatar/__tests__/Avatar.test.js @@ -57,7 +57,7 @@ describe('Avatar Render', () => { it('should handle onError correctly', () => { const LOAD_FAILURE_SRC = 'http://error.url'; - const LOAD_SUCCESS_SRC = 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'; + const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random'; const div = global.document.createElement('div'); global.document.body.appendChild(div); @@ -95,7 +95,7 @@ describe('Avatar Render', () => { it('should show image on success after a failure state', () => { const LOAD_FAILURE_SRC = 'http://error.url'; - const LOAD_SUCCESS_SRC = 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'; + const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random'; const div = global.document.createElement('div'); global.document.body.appendChild(div); @@ -195,7 +195,7 @@ describe('Avatar Render', () => { }); it('should exist crossorigin attribute', () => { - const LOAD_SUCCESS_SRC = 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'; + const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random'; const wrapper = mount( crossorigin @@ -206,7 +206,7 @@ describe('Avatar Render', () => { }); it('should not exist crossorigin attribute', () => { - const LOAD_SUCCESS_SRC = 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'; + const LOAD_SUCCESS_SRC = 'https://joeschmoe.io/api/v1/random'; const wrapper = mount(crossorigin); expect(wrapper.html().includes('crossorigin')).toEqual(false); expect(wrapper.find('img').prop('crossOrigin')).toEqual(undefined); diff --git a/components/avatar/__tests__/__snapshots__/Avatar.test.js.snap b/components/avatar/__tests__/__snapshots__/Avatar.test.js.snap index fe8380110971..482399d71b5c 100644 --- a/components/avatar/__tests__/__snapshots__/Avatar.test.js.snap +++ b/components/avatar/__tests__/__snapshots__/Avatar.test.js.snap @@ -156,7 +156,7 @@ exports[`Avatar Render should handle onError correctly 1`] = ` onError={[Function]} shape="circle" size="default" - src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" + src="https://joeschmoe.io/api/v1/random" > @@ -205,7 +205,7 @@ exports[`Avatar Render should show image on success after a failure state 2`] = diff --git a/components/avatar/__tests__/__snapshots__/demo.test.js.snap b/components/avatar/__tests__/__snapshots__/demo.test.js.snap index 691070d78a21..573c36348bb8 100644 --- a/components/avatar/__tests__/__snapshots__/demo.test.js.snap +++ b/components/avatar/__tests__/__snapshots__/demo.test.js.snap @@ -342,7 +342,7 @@ Array [ class="ant-avatar ant-avatar-circle ant-avatar-image" > ,
( <> - + K } /> @@ -29,7 +29,7 @@ const Demo = () => ( - + K } /> @@ -42,7 +42,7 @@ const Demo = () => ( size="large" maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }} > - + K } /> diff --git a/components/avatar/demo/type.md b/components/avatar/demo/type.md index 41c4ca4a3534..f2ae2df174fe 100644 --- a/components/avatar/demo/type.md +++ b/components/avatar/demo/type.md @@ -22,10 +22,8 @@ ReactDOM.render( } /> U USER - - } - /> + + } /> U } /> , diff --git a/components/card/__tests__/__snapshots__/demo.test.js.snap b/components/card/__tests__/__snapshots__/demo.test.js.snap index ad60ea1bd7ca..2f8eefb76266 100644 --- a/components/card/__tests__/__snapshots__/demo.test.js.snap +++ b/components/card/__tests__/__snapshots__/demo.test.js.snap @@ -682,7 +682,7 @@ exports[`renders ./components/card/demo/meta.md correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" >
diff --git a/components/card/demo/loading.md b/components/card/demo/loading.md index 799cd1660eec..c9b7deb87554 100644 --- a/components/card/demo/loading.md +++ b/components/card/demo/loading.md @@ -37,9 +37,7 @@ class App extends React.Component { - } + avatar={} title="Card title" description="This is the description" /> @@ -55,9 +53,7 @@ class App extends React.Component { > - } + avatar={} title="Card title" description="This is the description" /> diff --git a/components/card/demo/meta.md b/components/card/demo/meta.md index 41e8e84a9c63..a4531960fd2a 100644 --- a/components/card/demo/meta.md +++ b/components/card/demo/meta.md @@ -35,7 +35,7 @@ ReactDOM.render( ]} > } + avatar={} title="Card title" description="This is the description" /> diff --git a/components/comment/__tests__/__snapshots__/demo.test.js.snap b/components/comment/__tests__/__snapshots__/demo.test.js.snap index 039f1ce63b1c..72e2762a9ca0 100644 --- a/components/comment/__tests__/__snapshots__/demo.test.js.snap +++ b/components/comment/__tests__/__snapshots__/demo.test.js.snap @@ -15,7 +15,7 @@ exports[`renders ./components/comment/demo/basic.md correctly 1`] = ` > Han Solo
@@ -132,7 +132,7 @@ exports[`renders ./components/comment/demo/editor.md correctly 1`] = ` > Han Solo @@ -222,7 +222,7 @@ exports[`renders ./components/comment/demo/list.md correctly 1`] = ` > comment-avatar
comment-avatar
Han Solo
@@ -392,7 +392,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = ` > Han Solo @@ -445,7 +445,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = ` > Han Solo @@ -496,7 +496,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = ` > Han Solo diff --git a/components/comment/demo/basic.md b/components/comment/demo/basic.md index eba3b95bae29..f5669f8f5960 100644 --- a/components/comment/demo/basic.md +++ b/components/comment/demo/basic.md @@ -56,12 +56,7 @@ const Demo = () => { Han Solo} - avatar={ - - } + avatar={} content={

We supply a series of design principles, practical patterns and high quality design diff --git a/components/comment/demo/editor.md b/components/comment/demo/editor.md index 4c27a28689f9..9c6ee8a27cec 100644 --- a/components/comment/demo/editor.md +++ b/components/comment/demo/editor.md @@ -65,7 +65,7 @@ class App extends React.Component { ...this.state.comments, { author: 'Han Solo', - avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', + avatar: 'https://joeschmoe.io/api/v1/random', content:

{this.state.value}

, datetime: moment().fromNow(), }, @@ -87,12 +87,7 @@ class App extends React.Component { <> {comments.length > 0 && } - } + avatar={} content={ Reply to], author: 'Han Solo', - avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', + avatar: 'https://joeschmoe.io/api/v1/random', content: (

We supply a series of design principles, practical patterns and high quality design @@ -38,7 +38,7 @@ const data = [ { actions: [Reply to], author: 'Han Solo', - avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', + avatar: 'https://joeschmoe.io/api/v1/random', content: (

We supply a series of design principles, practical patterns and high quality design diff --git a/components/comment/demo/nested.md b/components/comment/demo/nested.md index fe122c9bafa1..7f23fad73fa1 100644 --- a/components/comment/demo/nested.md +++ b/components/comment/demo/nested.md @@ -20,12 +20,7 @@ const ExampleComment = ({ children }) => ( Reply to]} author={Han Solo} - avatar={ - - } + avatar={} content={

We supply a series of design principles, practical patterns and high quality design diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index 020c70385527..c13cc069652d 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -14852,7 +14852,7 @@ exports[`ConfigProvider components List configProvider 1`] = ` class="config-avatar config-avatar-circle config-avatar-image" > @@ -14904,7 +14904,7 @@ exports[`ConfigProvider components List configProvider componentSize large 1`] = class="config-avatar config-avatar-circle config-avatar-image" > @@ -14956,7 +14956,7 @@ exports[`ConfigProvider components List configProvider componentSize middle 1`] class="config-avatar config-avatar-circle config-avatar-image" > @@ -15008,7 +15008,7 @@ exports[`ConfigProvider components List configProvider virtual and dropdownMatch class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -15060,7 +15060,7 @@ exports[`ConfigProvider components List normal 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -15112,7 +15112,7 @@ exports[`ConfigProvider components List prefixCls 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > diff --git a/components/config-provider/__tests__/components.test.js b/components/config-provider/__tests__/components.test.js index 85eb188909fa..0a8ef2fa776a 100644 --- a/components/config-provider/__tests__/components.test.js +++ b/components/config-provider/__tests__/components.test.js @@ -362,9 +362,7 @@ describe('ConfigProvider', () => { - } + avatar={} title="Ant Design" description="Ant Design, a design language for background applications, is refined by Ant UED Team" /> diff --git a/components/list/__tests__/Item.test.js b/components/list/__tests__/Item.test.js index fb9088b69715..67985ffaa3d8 100644 --- a/components/list/__tests__/Item.test.js +++ b/components/list/__tests__/Item.test.js @@ -9,7 +9,7 @@ describe('List Item Layout', () => { key: 1, href: 'https://ant.design', title: `ant design`, - avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', + avatar: 'https://joeschmoe.io/api/v1/random', description: 'Ant Design, a design language for background applications, is refined by Ant UED Team.', content: diff --git a/components/list/__tests__/__snapshots__/demo.test.js.snap b/components/list/__tests__/__snapshots__/demo.test.js.snap index e6a4521deb75..11f4a566b53f 100644 --- a/components/list/__tests__/__snapshots__/demo.test.js.snap +++ b/components/list/__tests__/__snapshots__/demo.test.js.snap @@ -26,7 +26,7 @@ exports[`renders ./components/list/demo/basic.md correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -63,7 +63,7 @@ exports[`renders ./components/list/demo/basic.md correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -100,7 +100,7 @@ exports[`renders ./components/list/demo/basic.md correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -137,7 +137,7 @@ exports[`renders ./components/list/demo/basic.md correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1658,7 +1658,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1824,7 +1824,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > @@ -1990,7 +1990,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = ` class="ant-avatar ant-avatar-circle ant-avatar-image" > diff --git a/components/list/demo/basic.md b/components/list/demo/basic.md index 00d7c094e9be..f750a50c4a8a 100644 --- a/components/list/demo/basic.md +++ b/components/list/demo/basic.md @@ -38,7 +38,7 @@ ReactDOM.render( renderItem={item => ( } + avatar={} title={{item.title}} description="Ant Design, a design language for background applications, is refined by Ant UED Team" /> diff --git a/components/list/demo/infinite-load.md b/components/list/demo/infinite-load.md index c66e31f2f979..d66bc39d7f81 100644 --- a/components/list/demo/infinite-load.md +++ b/components/list/demo/infinite-load.md @@ -27,7 +27,7 @@ const InfiniteListExample = () => { return; } setLoading(true); - fetch('https://randomuser.me/api/?results=10&inc=name,gender,email,nat&noinfo') + fetch('https://randomuser.me/api/?results=10&inc=name,gender,email,nat,picture&noinfo') .then(res => res.json()) .then(body => { setData([...data, ...body.results]); @@ -65,9 +65,7 @@ const InfiniteListExample = () => { renderItem={item => ( - } + avatar={} title={{item.name.last}} description={item.email} /> diff --git a/components/list/demo/infinite-virtualized-load.md b/components/list/demo/infinite-virtualized-load.md index 893bcf630d1f..86919658327d 100644 --- a/components/list/demo/infinite-virtualized-load.md +++ b/components/list/demo/infinite-virtualized-load.md @@ -25,7 +25,7 @@ import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer'; import VList from 'react-virtualized/dist/commonjs/List'; import InfiniteLoader from 'react-virtualized/dist/commonjs/InfiniteLoader'; -const fakeDataUrl = 'https://randomuser.me/api/?results=5&inc=name,gender,email,nat&noinfo'; +const fakeDataUrl = 'https://randomuser.me/api/?results=5&inc=name,gender,email,nat,picture&noinfo'; class VirtualizedExample extends React.Component { state = { @@ -88,7 +88,7 @@ class VirtualizedExample extends React.Component { return ( } + avatar={} title={{item.name.last}} description={item.email} /> diff --git a/components/list/demo/loadmore.md b/components/list/demo/loadmore.md index d1b234cecc6c..eeb6d4bb3787 100644 --- a/components/list/demo/loadmore.md +++ b/components/list/demo/loadmore.md @@ -18,7 +18,7 @@ import { List, Avatar, Button, Skeleton } from 'antd'; import reqwest from 'reqwest'; const count = 3; -const fakeDataUrl = `https://randomuser.me/api/?results=${count}&inc=name,gender,email,nat&noinfo`; +const fakeDataUrl = `https://randomuser.me/api/?results=${count}&inc=name,gender,email,nat,picture&noinfo`; class LoadMoreList extends React.Component { state = { @@ -102,9 +102,7 @@ class LoadMoreList extends React.Component { > - } + avatar={} title={{item.name.last}} description="Ant Design, a design language for background applications, is refined by Ant UED Team" /> diff --git a/components/list/demo/vertical.md b/components/list/demo/vertical.md index 74d640fd9f95..eb150697ecc0 100644 --- a/components/list/demo/vertical.md +++ b/components/list/demo/vertical.md @@ -22,7 +22,7 @@ for (let i = 0; i < 23; i++) { listData.push({ href: 'https://ant.design', title: `ant design part ${i}`, - avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', + avatar: 'https://joeschmoe.io/api/v1/random', description: 'Ant Design, a design language for background applications, is refined by Ant UED Team.', content: diff --git a/components/skeleton/demo/list.md b/components/skeleton/demo/list.md index 9dcc93312184..f97395aa5fe2 100644 --- a/components/skeleton/demo/list.md +++ b/components/skeleton/demo/list.md @@ -22,7 +22,7 @@ for (let i = 0; i < 3; i++) { listData.push({ href: 'https://ant.design', title: `ant design part ${i}`, - avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', + avatar: 'https://joeschmoe.io/api/v1/random', description: 'Ant Design, a design language for background applications, is refined by Ant UED Team.', content: