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(Grid): Add the react-bootstrap grid system #77

Merged
merged 1 commit into from
Dec 6, 2017

Conversation

sharvit
Copy link
Contributor

@sharvit sharvit commented Nov 16, 2017

Add the react-bootstrap grid components to patternfly-react (Grid, Row, Col, Clearfix)

What:
Add gird-system components from react-bootstrap:

  • Grid
  • Row
  • Col
  • Clearfix

Why:
To reduce the need to import react-bootstrap package

How:
Export those components from react-bootstrap

Storybook:
https://sharvit.github.io/patternfly-react/?knob-Label=Danger%20Will%20Robinson%21&knob-ShowClearfix=true&selectedKind=Grid&selectedStory=Basic%20Grid&full=0&down=1&left=1&panelRight=0&downPanel=storybooks%2Fstorybook-addon-knobs

@priley86
Copy link
Member

thanks @sharvit - I don't see any issue w/ this. We'll be able to convert this repo to SASS pretty soon most likely, but LESS works for now 😄

The only thing I'm noting here now is that our defaultTemplate shows "This pattern does not yet exist in PatternFly." Since PF just uses Bootstrap rows/cols, I'm wondering if we shouldn't update the default template to accept a bootstrapDocumentationLink which renders in place of our This is an existing PatternFly component... and says something like This pattern uses Bootstrap CSS. Refer to the official Bootstrap documentation: {link}. In this case, we could probably link to here:
https://getbootstrap.com/docs/3.3/css/#grid

Thoughts @jgiardino @mturley @LHinson ?

@sharvit
Copy link
Contributor Author

sharvit commented Nov 16, 2017

Are you planning to export patternfly scss files as part of the package?
If so, I think that would be really great 👍

It is making sense to add the bootstrap docs urls to the views API.

@priley86
Copy link
Member

priley86 commented Nov 16, 2017

I believe the preliminary plan is to still consume PF Core SASS from PF Core (patternfly npm), and to consume any PF React specific SASS from patternfly-react, but we are hoping to keep as much SASS in PF Core as possible (more on this in upcoming community meetings). I guess you would prefer to just consume patternfly-react? I'm not sure if this will be intended, but we will have to regroup on this soon...

@mturley
Copy link
Collaborator

mturley commented Nov 16, 2017

This seems fine to me at first glance, is it really necessary though to make a two-line file for each of the grid components? If they are just imported and exported again in index.js, could we just import from react-bootstrap in index.js?

@priley86
Copy link
Member

@mturley @sharvit i'd be ok with removing the two-line files as long as it's consistent. We can open up a subsequent PR to change the others if that is the preference...

@mturley
Copy link
Collaborator

mturley commented Nov 17, 2017 via email

@sharvit
Copy link
Contributor Author

sharvit commented Nov 17, 2017

@mturley @priley86 I prefer to have one file for each component so when I want to look into component I only need to search for a file with the component name.

About the scss, I prefer to consume only one package that can supply for me the components, scss, font, icons and so...
Also being able to use scss with mixins and variables instead of using less is a big plus.

@jgiardino
Copy link
Collaborator

Thanks for contributing this, @sharvit! This is a great addition!

There were a couple of things I noticed regarding classes. @andresgalante could you also review this one and see if there's anything I missed?

  1. There are some page layouts in the patternfly test pages that include classes on the container or row, for example the Cards page layout does this. Is it possible to add classes to the <Grid>, <Row> and <Col> elements?
  2. All of the page layouts we have in patternfly use the class container-fluid. Is it possible to have this be the default for the <Grid> element assuming that most of the devs would want that and to avoid the potential for them to forget or overlook it? Or at the least, could we update the storybook example to use <Grid fluid=true> so that this is included in the story source code? It might also be nice to enable this attribute as a knob, just to call additional attention to it so that people can see the difference, but I'm open to thoughts on that.

@sharvit
Copy link
Contributor Author

sharvit commented Nov 17, 2017

@jgiardino

  1. Yes, those components are very flexible, you can use className with all of them and you can also use bsClass to change the base class (from container to pf-container).

  2. Yes, just add fluid as an attribute:

<Container fluid>
  ...
</Container>

More cool props:
https://react-bootstrap.github.io/components.html#grid-props

@priley86
Copy link
Member

@sharvit i think @jgiardino would like to review this some more today. We should be able to introduce Grid, Row and Col throughout after 😸

@priley86
Copy link
Member

@sharvit if you can rebase this and clean up other Grid, Row, Col references, I think we can merge this PR next...

@sharvit
Copy link
Contributor Author

sharvit commented Nov 22, 2017

@priley86 - Will be done soon 👍

@sharvit
Copy link
Contributor Author

sharvit commented Nov 22, 2017

@priley86 - ready to get merged

@priley86
Copy link
Member

@sharvit I think @jgiardino is referring to the fact that most if not all PF patterns today are using fluid layout. Maybe we can default this, or at least just update the story to use fluid in all of our examples?

@priley86
Copy link
Member

@sharvit @mturley let me know if this PR is blocking anything else... else I would say, let's wait for @jgiardino's feedback. She is back from the holiday break next week...

@sharvit are you able to start working on Forms / Form components in the mean time?
#65

My guess is these will be needed in many places too...

@sharvit
Copy link
Contributor Author

sharvit commented Nov 22, 2017

@priley86 - I don't believe it will be smart to make the fluid as a default behavior.
I will update the storybook soon.

It is not blocking me because i can still use the react-bootstrap version and change it easily later on.

@danseethaler - did you had a progress with the forms and the search since our last chat?

@jgiardino
Copy link
Collaborator

@sharvit @priley86
+1
I'm ok with not defaulting to fluid as long as this attribute is represented in the storybook. My main goal is that developers can use this component and easily implement patternfly page layouts, without having to dig around too much in other sites to find out how to recreate patternfly layouts with these components.

@danseethaler
Copy link
Contributor

@sharvit I have worked on the search component but not the patternfly-react context. It's just been in foreman for the RedHat Repos page. We has some discussion this morning about it though and I will probably be working on getting it over to patternfly-react this iteration.

@sharvit
Copy link
Contributor Author

sharvit commented Nov 22, 2017

@@ -0,0 +1,2 @@
import { Clearfix } from 'react-bootstrap'
Copy link
Member

Choose a reason for hiding this comment

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

cant you just

export { Clearfix } from 'react-bootstrap'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ohadlevy I wanted to be consistent with other files like:
https://github.com/patternfly/patternfly-react/blob/master/src/MenuItem/MenuItem.js

Exporting components from react-bootstrap is a common task, i think it should be consistent everywhere.

Copy link
Member

@priley86 priley86 Nov 25, 2017

Choose a reason for hiding this comment

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

@ohadlevy @sharvit of course i'm OK with making the two line files one line files. Let's just be consistent...

Feel free to update the others alongside this PR if you can. Otherwise we can do a subsequent PR.

@@ -0,0 +1,4 @@
export { default as Grid } from './Grid'
Copy link
Member

@priley86 priley86 Nov 25, 2017

Choose a reason for hiding this comment

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

Again, consistency thing here. I haven't been using an individual index.js in each component, but if we decide to, should it be done everywhere? Just please update the PR to make other components consistent.

@priley86
Copy link
Member

@sharvit other than the consistency issues, i think this is good to be merged now. I will merge this PR if you can reach a resolution on this.

@sharvit
Copy link
Contributor Author

sharvit commented Nov 26, 2017

@priley86 - I feel I should create a new pr to reflect my point of view about the consistency and we can continue to discuss from there.

@priley86
Copy link
Member

@sharvit 👍 works great for me. Let's rebase other PRs after.

@priley86
Copy link
Member

@sharvit any chance you can pull up this PR soon? I think it will be important to clarify it.

@sharvit
Copy link
Contributor Author

sharvit commented Nov 28, 2017

@priley86 the consistency one? I believe I can 👍

@priley86
Copy link
Member

priley86 commented Nov 28, 2017

yep - would be great to figure this out so I can do less rebases later :)

Add the react-bootstrap grid components to patternfly-react (Grid, Row, Col, Clearfix)
@priley86
Copy link
Member

priley86 commented Dec 6, 2017

@sharvit looking good 👍 - I think we are ready to merge here. We can convert all Less to Sass in a future PR.

@jgiardino any further issues here?

@jgiardino
Copy link
Collaborator

LGTM!

@priley86
Copy link
Member

priley86 commented Dec 6, 2017

@jgiardino 💯 ... and we can say it was you if anything breaks 🤣 😆 ??

@priley86 priley86 merged commit 30409e1 into patternfly:master Dec 6, 2017
@jgiardino jgiardino removed the review label Dec 6, 2017
@sharvit sharvit deleted the feature/page-layout branch December 6, 2017 19:13
HarikrishnanBalagopal pushed a commit to HarikrishnanBalagopal/patternfly-react that referenced this pull request Sep 29, 2021
…nfly#77)

* fix(package): move package to all npm scripts internally

* add server.js and change start command
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