Skip to content

Commit

Permalink
fix: icon typo (#17458)
Browse files Browse the repository at this point in the history
* 🐛 Fix icon typo

close #17448

* ✅ update snapshots

* ✅ add test case
  • Loading branch information
afc163 authored and zombieJ committed Jul 4, 2019
1 parent 859bba5 commit b1e63be
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
6 changes: 5 additions & 1 deletion components/icon/__tests__/index.test.js
Expand Up @@ -241,7 +241,11 @@ describe('utils', () => {
expect(errorSpy).toHaveBeenLastCalledWith(
"Warning: [antd: Icon] Icon 'canlendar' is typo and depracated, please use 'calendar' instead.",
);
expect(errorSpy).toHaveBeenCalledTimes(3);
render(<Icon type="colum-height" />);
expect(errorSpy).toHaveBeenLastCalledWith(
"Warning: [antd: Icon] Icon 'colum-height' is typo and depracated, please use 'column-height' instead.",
);
expect(errorSpy).toHaveBeenCalledTimes(4);
errorSpy.mockRestore();
});
});
4 changes: 4 additions & 0 deletions components/icon/utils.ts
Expand Up @@ -63,6 +63,10 @@ export function alias(type: string) {
case 'canlendar':
newType = 'calendar';
break;
// https://github.com/ant-design/ant-design/issues/17448
case 'colum-height':
newType = 'column-height';
break;
default:
}
warning(
Expand Down
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><i aria-label=\\"icon: exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" class=\\"\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z\\"></path></svg></i><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div></div>"`;
exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><i aria-label=\\"icon: exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" class=\\"\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z\\"></path></svg></i><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div></div>"`;

exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><i aria-label=\\"icon: exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" class=\\"\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z\\"></path></svg></i><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div></div>"`;
exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"<div class=\\"ant-popover-content\\"><div class=\\"ant-popover-arrow\\"></div><div class=\\"ant-popover-inner\\" role=\\"tooltip\\"><div><div class=\\"ant-popover-inner-content\\"><div class=\\"ant-popover-message\\"><i aria-label=\\"icon: exclamation-circle\\" class=\\"anticon anticon-exclamation-circle\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" class=\\"\\" data-icon=\\"exclamation-circle\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z\\"></path></svg></i><div class=\\"ant-popover-message-title\\">code</div></div><div class=\\"ant-popover-buttons\\"><button type=\\"button\\" class=\\"ant-btn ant-btn-sm\\"><span>Cancel</span></button><button type=\\"button\\" class=\\"ant-btn ant-btn-primary ant-btn-sm\\"><span>OK</span></button></div></div></div></div></div>"`;
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -43,7 +43,7 @@
},
"dependencies": {
"@ant-design/create-react-context": "^0.2.4",
"@ant-design/icons": "~2.1.0",
"@ant-design/icons": "~2.1.1",
"@ant-design/icons-react": "~2.0.1",
"@types/react-slick": "^0.23.4",
"array-tree-filter": "^2.1.0",
Expand Down
7 changes: 4 additions & 3 deletions site/theme/template/IconDisplay/fields.ts
Expand Up @@ -6,7 +6,9 @@ Object.keys(manifest).forEach(theme => {
});

// Hide typo-name icons
allIcons = allIcons.filter((name: string) => !['interation', 'canlendar'].includes(name));
allIcons = allIcons.filter(
(name: string) => !['interation', 'canlendar', 'colum-height'].includes(name),
);

export const categories = {
all: [...new Set(allIcons)],
Expand Down Expand Up @@ -125,8 +127,6 @@ export const categories = {
'font-colors',
'font-size',
'line-height',
'colum-height',
'colum-width',
'dash',
'small-dash',
'sort-ascending',
Expand All @@ -136,6 +136,7 @@ export const categories = {
'unordered-list',
'radius-setting',
'column-width',
'column-height',
],
data: [
'area-chart',
Expand Down

0 comments on commit b1e63be

Please sign in to comment.