Skip to content

feat(Spinner): Adding Spinner component - #100

Merged
priley86 merged 1 commit into
patternfly:masterfrom
danseethaler:spinner-component
Dec 12, 2017
Merged

priley86 merged 1 commit into
patternfly:masterfrom
danseethaler:spinner-component

Conversation

@danseethaler

Copy link
Copy Markdown
Contributor

What: Adding Spinner component from main Patternfly library.

Why: To include more components in the react implementation.

How: Adding one component file and a stories file to demo.

The story can be found here.

@waldenraines

Copy link
Copy Markdown

PR #💯 🎉 🎊

@danseethaler

Copy link
Copy Markdown
Contributor Author

@waldenraines haha 👍 good catch! Congrats to the patternfly-react community!

@waldenraines waldenraines left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@priley86

priley86 commented Dec 8, 2017 •

Copy link
Copy Markdown
Member

haha thanks for the enthusiasm @waldenraines 👍 .

@danseethaler @jgiardino I don't see much else on this other than potentially providing an additional example with the dark background (see patternfly.org example) and the test page example. You can achieve the styles there giving a black background and applying the spinner-inverse class.

As far as the stateless component goes... 👍

What else here @jgiardino ?

Also including a stories file to demo

fix #98
@danseethaler

Copy link
Copy Markdown
Contributor Author

Good call in the inverse option @priley86. I've updated to include that.

@danseethaler

Copy link
Copy Markdown
Contributor Author

As a side thought I'm wondering if we want to add more of the simple components into the widgets grouping on the sidebar. Maybe the badges, popover, and tooltips. Any thoughts on that?

image

@jgiardino

Copy link
Copy Markdown
Contributor

Thanks for adding this!

The only questions I have are regarding the inline implementation…

There isn’t much documentation about the use case for the inline spinner, but my expectation is that the text that displays next to an inline spinner is related to the loading process. And when loading is complete, then the text is no longer relevant and should be removed along with the spinner.

However in this implementation, it looks like the text that displays for the inline spinner remains after loading is complete.

@danseethaler - Does the current implementation of this component support the use case I just described?
@mcarrano, @LHinson, @Rohoover - Are my assumptions about this use case correct?

Additionally, the test page includes examples of the inline spinner where it is wrapped by different html elements: h1, h2, h3, p
Is it possible to use these elements with the spinner component?

@jgiardino

Copy link
Copy Markdown
Contributor

@mcarrano @LHinson What are your thoughts about @danseethaler suggestions for the storybook organization? I've lost touch with the information architecture work that's currently happening. Will we be getting recommendations from that work on how to organize the components in the Storybook?

@danseethaler

Copy link
Copy Markdown
Contributor Author

Really good points @jgiardino. The current implementation does allow you to wrap the spinner with any component (h1, p, etc.) just like the inline examples on the test page. In the case when the inline spinner is wrapped with an h1 or other tag it will be up to the application to remove that when loading completes. It's not removed on the story since it would be just a blank screen.

The primary idea with this component was to provide a wrapper around components that you don't want to show until loading is complete. This is common in React when a parent component needs to load some data before it renders it's children.

@priley86

priley86 commented Dec 8, 2017

Copy link
Copy Markdown
Member

@jgiardino @mcarrano @LHinson Storybook 3.3 will be coming soon and bring a wealth of other benefits too. My vote is to start introducing this kind of structure eventually (but at the moment, I don't think it's ready).

@mcarrano

mcarrano commented Dec 8, 2017

Copy link
Copy Markdown
Member

@jgiardino your assumption is correct, as in most cases I would expect that the text associated with the spinner would be some type of 'loading in progress' message'.

Regarding the Storybook organization, the information architecture is still a work in progress, but I will say that we are definitely moving away from the idea of using "widgets" as a category. It's too unclear what's a widget and what's not. In general our testing has found that a flatter organization is preferred, with some exceptions. We will definitely want to better sync the storybook sites and the patternfly.org site down the road. But it's premature to do that at this point.

@priley86

priley86 commented Dec 8, 2017

Copy link
Copy Markdown
Member

@mcarrano thanks! Let us know what you find. Just wanted to share that as an option coming soon...

@danseethaler

Copy link
Copy Markdown
Contributor Author

Any other thoughts or reservations before merging?

@priley86

priley86 commented Dec 8, 2017 •

Copy link
Copy Markdown
Member

@danseethaler I don't have any reservations about this from a JS standpoint (it seems this is more just Storybook examples/PatternFly demonstration specifics). I think @jgiardino's suggestion about showcasing the h1,h2,h3,p examples is useful for design demonstration as our existing test page looks like this:
https://rawgit.com/patternfly/patternfly/master-dist/dist/tests/spinner.html

@danseethaler

Copy link
Copy Markdown
Contributor Author

@priley86 oh yeah I wasn't sure if @jgiardino was recommending we show those in the storybook since they're already on the test page. I'm happy to add them though, either way.

return (
<div style={wrapperStyle}>
<Spinner {...spinnerProps}>
<strong>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I haven't seen this use case in the current test pages, but maybe I am missing something.

@jgiardino thoughts?

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.

@priley86 Can you elaborate on the use case you're referring to? I'm guessing you're referring to the use of <strong> here. But based on what I'm seeing in the storybook, the contents inside the <Spinner> component are the contents that display when loading is false, so the use of <strong> here is really just a placeholder for those contents, and not really part of the design pattern.

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.

@jgiardino yeah that's correct.

@jgiardino

Copy link
Copy Markdown
Contributor

Regarding the h1, h2, h3, p examples, I just wanted to note if these cases were supported in this component or not, so that we can track the status in the issue. I'm not opposed to showing them in the storybook, but I wouldn't say that's necessary for merging this.

The only concern from me is the difference between inline being true vs. false, in that it seems like the implementation of this component in a product would be different depending on whether I was displaying inline text or not. But I'm happy to defer to everyone else on whether this is even an issue—it was just something I noticed looking the storybook. :-)

@dabeng

dabeng commented Dec 12, 2017 •

Copy link
Copy Markdown
Contributor

Hi @jgiardino , in the "Inline" section of test page, I find that the size of spinner has nothing to do with h1 tag. Under the hood, it's still specified by className "spinner-lg".

<h1>
  <div class="spinner spinner-lg spinner-inline"></div>
        Inside an &lt;h1&gt;
</h1>

As a result, I don't think it's necessary to add new demos to spinner storybook according to the h1, h2, h3, p examples.

@danseethaler

Copy link
Copy Markdown
Contributor Author

Yeah I think we're good here 👍

The difference in the storybook implementation for inline is just due to the difference usage. The HTML structure needs to be different for inline vs wrapper so the usage is a little different. Thanks for the feedback everyone!

@jgiardino

Copy link
Copy Markdown
Contributor

Thanks for the clarification, @danseethaler!

@priley86

Copy link
Copy Markdown
Member

Let's go ahead and merge this one (it seems the behavior is as expected). @jgiardino feel free to circle back on the Storybook stories later if you'd like to make any updates there.

@priley86
priley86 merged commit 49def77 into patternfly:master Dec 12, 2017
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.

6 participants