Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

InlineAlert component#131

Merged
koorosh merged 2 commits intocockroachdb:masterfrom
koorosh:alert-component
Oct 23, 2020
Merged

InlineAlert component#131
koorosh merged 2 commits intocockroachdb:masterfrom
koorosh:alert-component

Conversation

@koorosh
Copy link
Copy Markdown
Contributor

@koorosh koorosh commented Oct 22, 2020

ui-components // InlineAlert

InlineAlert component is one of basic components in Design System to
provide users with feedback on a page. It doesn't disappear and has
to be placed somewhere on a page.

Screen Shot 2020-10-22 at 1 22 07 PM

Checklist

  • I have written or updated test for the changes I made
  • I have updated the README of the package I'm working in to reflect my changes
  • I have added or updated Storybook if appropriate for my changes

@koorosh koorosh changed the title Alert component InlineAlert component Oct 22, 2020
Copy link
Copy Markdown
Contributor

@nathanstilwell nathanstilwell left a comment

Choose a reason for hiding this comment

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

This looks great! I have one tiny change request, but everything else looks great. This is an exciting addition.


wrapper.setProps({ size: "tiny" });
expect(wrapper.prop("className")).toContain("size-tiny");
wrapper.setProps({ size: "x-large" });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I appreciate the catch. I'm not sure why I added a tiny in here given that isn't a size we currently have. Would you mind re-ordering these from smallest to largest?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What do you think about "dynamic" tests generation in this case? It might be easier to extend those test.

const iconSizes = ["small", ... "x-large"]
iconSizes.forEach(iconSize => {
  test(`with ${iconSize} size`, () => { ... })
})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@nathanstilwell , I've updated Icon tests (made more DRY)

Icon colors palette is extended with orange tint because it is one
of functional colors in design system and needed for alerts to represent
warning state.
InlineAlert component is one of basic components in Design System to
provide users with feedback on a page. It's inline alert that doesn't
disappear and has to be placed somewhere on a page.
Copy link
Copy Markdown
Contributor

@nathanstilwell nathanstilwell left a comment

Choose a reason for hiding this comment

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

LGTM. Merging will publish a prerelease tag. I will manually publish a latest version.


wrapper.setProps({ size: "tiny" });
expect(wrapper.prop("className")).toContain("size-tiny");
const iconSizes: Array<[IconSize, string]> = [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I love this.

@koorosh koorosh merged commit 66ccce9 into cockroachdb:master Oct 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants