Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ⚡️ Alert.ErrorBoundary #19923

Merged
merged 2 commits into from
Dec 11, 2019
Merged

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Nov 25, 2019

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

#12256

💡 Background and solution

import { Alert } from 'antd';
const { ErrorBoundary } = Alert;

const  ThrowError = (
  <NotExisted />
);

const App = (
  <ErrorBoundary>
    <ThrowError />
  </ErrorBoundary>
);

const App = (
  <ErrorBoundary message="出错了!" description="请刷新重试">
    <ThrowError />
  </ErrorBoundary>
);

image

📝 Changelog

Language Changelog
🇺🇸 English Add Alert.ErrorBoundary for good-looking error boundary ui.
🇨🇳 Chinese 新增 Alert.ErrorBoundary 用于提供友好的出错拦截和提示。

☑️ Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

View rendered components/alert/index.en-US.md
View rendered components/alert/index.zh-CN.md

@pr-triage pr-triage bot added the PR: draft label Nov 25, 2019
@auto-add-label auto-add-label bot added the zap label Nov 25, 2019
@netlify
Copy link

netlify bot commented Nov 25, 2019

Deploy preview for ant-design ready!

Built with commit cebf1b1

https://deploy-preview-19923--ant-design.netlify.com

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 25, 2019

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit cebf1b1:

Sandbox Source
antd reproduction template Configuration

@afc163 afc163 changed the title ⚡ support ErrorBoundary message and description ⚡️ Alert.ErrorBoundary Nov 25, 2019
@afc163 afc163 changed the title ⚡️ Alert.ErrorBoundary feat: ⚡️ Alert.ErrorBoundary Nov 25, 2019
@afc163 afc163 marked this pull request as ready for review November 25, 2019 10:15
@afc163 afc163 added the 4.x In Ant Design 4.0 label Nov 25, 2019
⚡ support ErrorBoundary message and description
@codecov
Copy link

codecov bot commented Nov 25, 2019

Codecov Report

Merging #19923 into 4.0-prepare will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@               Coverage Diff               @@
##           4.0-prepare   #19923      +/-   ##
===============================================
+ Coverage        97.55%   97.56%   +<.01%     
===============================================
  Files              292      293       +1     
  Lines             7210     7223      +13     
  Branches          1994     1999       +5     
===============================================
+ Hits              7034     7047      +13     
  Misses             176      176
Impacted Files Coverage Δ
components/alert/ErrorBoundary.tsx 100% <100%> (ø)
components/alert/index.tsx 95.45% <100%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ef6b04...cebf1b1. Read the comment docs.

@afc163
Copy link
Member Author

afc163 commented Nov 25, 2019

@zombieJ 发现 4.0 的覆盖率比 master 下降了 0.3%。

@zombieJ
Copy link
Member

zombieJ commented Nov 26, 2019

4.0 有几个 pr 把代码抽了一下,就降了。得再加点。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x In Ant Design 4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants