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

Added restrictWidth to EuiPage #896

Merged
merged 5 commits into from
Jun 4, 2018
Merged

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Jun 1, 2018

Sets the max-width of the page, set to true to use the default size, set to false to not restrict the width (default), set to a number for a custom width.

You can see the change in the Doc app_view.js.

- Breaking: the default is to max-width the page at 1000px
* set to `false` to not restrict the width,
* set to a number for a custom width.
*/
restrictWidth: PropTypes.any,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chandlerprall I'm not sure if this is particularly correct, but we want to accept either a bool or string, maybe a custom prop type, but that seemed excessive...

Copy link
Contributor

Choose a reason for hiding this comment

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

You could also do this to be a little more specific

restrictWidth: PropTypes.oneOfType([
  PropTypes.bool,
  PropTypes.number
]),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh perfect, I'll do that.

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

I'm good with the spirit of this and agree we need something. I think we might want to default to false simply to avoid the breaking change since it's a heavily used component and saves people downstream some headache (thinking about @gjones).

Right now it's really pretty split in Kibana over which pages go full width and which don't, so I think it would require an equal amount of work to maintain no matter which was the default.

@gjones
Copy link
Contributor

gjones commented Jun 1, 2018

Thanks for bringing attention to this @snide, yeah I’d definitely agree with setting this prop to false default. Other than adding more work on our end, I’m not sure I personally agree with the library being so opinionated on such a divisive size. Although I trust and leave those decisions to your team.

@cchaos
Copy link
Contributor Author

cchaos commented Jun 4, 2018

That's fine, I'll set the default to "false". I was mainly thinking of Kibana where most of the implementation so far have needed it.

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

Tested for functionality. Works as advertised. Code looks good. 👍

and fixing strings to be numbers
@cchaos cchaos merged commit a7fd7a6 into elastic:master Jun 4, 2018
@cchaos cchaos deleted the page-layout-max branch June 4, 2018 19:44
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.

3 participants