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: Alerts component #621

Merged
merged 5 commits into from
Aug 28, 2020
Merged

feat: Alerts component #621

merged 5 commits into from
Aug 28, 2020

Conversation

Golodhros
Copy link
Member

@Golodhros Golodhros commented Aug 28, 2020

Summary of Changes

Adds the alerts component
Includes tests and a SVG icon for the alert

Documentation

Added Storybook story for the component

Components___Alert_-_Alert_⋅_Storybook

Attributes___Icons_-_SVG_Icons_⋅_Storybook

CheckList

Make sure you have checked all steps below to ensure a timely review.

  • PR title addresses the issue accurately and concisely. Example: "Updates the version of Flask to v1.0.2"
  • PR includes a summary of changes, including screenshots of any UI changes.
  • PR adds unit tests, updates existing unit tests, OR documents why no test additions or modifications are needed.
  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public python functions and the classes in the PR contain docstrings that explain what it does
  • PR passes all tests documented in the developer guide

Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
ttannis
ttannis previously approved these changes Aug 28, 2020
Copy link
Contributor

@ttannis ttannis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking comments


const AlertIcon: React.FC = () => {
return (
<svg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to have a common/icons where we start putting new amundsen icons that use inline-svgs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! I will move it there!

<AlertIcon />
<p className="alert-message">{message}</p>
{actionText && onAction && (
<button type="button" className="btn btn-link" onClick={onAction}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For our internal use case, the text will end up being a link to another Amundsen page. Given our desire to use the correct components for specific actions, do you think we should still support a button with onClick vs and anchor with an href...or both?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see.
I could make it support both easily. I will add an optional actionHref prop, if that has a value, I will render a router Link instead

Supporting an action link

Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
… Alert

Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
Signed-off-by: Marcos Iglesias <miglesiasvalle@lyft.com>
@Golodhros Golodhros merged commit 537c143 into master Aug 28, 2020
@Golodhros Golodhros deleted the mi-alerts branch August 31, 2020 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants