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

First implementation of ResizableGrid and DockablePanel components #1835

Merged
merged 4 commits into from
May 19, 2017

Conversation

MV88
Copy link
Contributor

@MV88 MV88 commented May 17, 2017

This PR is for adding to the feature grid components two new elements.

The DockablePanel components wrap any the ResizableGrid
Added tests and documentation

@MV88 MV88 requested a review from offtherailz May 17, 2017 14:44
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 79.612% when pulling f9eb291 on MV88:feature-grid-migration into 2a9f77a on geosolutions-it:master.

const DockedGrid = React.createClass({
propTypes: {
dockSize: React.PropTypes.number,
featureDockedGrid: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.func]),
Copy link
Contributor

Choose a reason for hiding this comment

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

grid

>
<div id="feature-grid-container">
<FeatureDockedGrid id="feature-docked-grid"
toolbar={{
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we configure this externally. We could have a grid without a toolbar

onSizeChange={this.limitDockHeight}
fluid={true}
dimStyle={{ background: 'rgba(0, 0, 100, 0.2)' }}
dockStyle={null}
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

fluid={true}
dimStyle={{ background: 'rgba(0, 0, 100, 0.2)' }}
dockStyle={null}
dockHiddenStyle={null}
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

* @prop {object} [tools] The tools of the grid
*
*/
const FeatureDockedGrid = React.createClass({
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any Feature here

Copy link
Contributor

Choose a reason for hiding this comment

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

And no docked too

getDefaultProps() {
return {
dockSize: 0.35,
featureDockedGrid: {},
Copy link
Member

Choose a reason for hiding this comment

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

call it grid

componentWillReceiveProps(newProps) {
if (this.props.size !== newProps.size) {
const pos = newProps.position;
if (pos === "right" || pos === "left") {
Copy link
Member

Choose a reason for hiding this comment

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

props.autoWidth = true if pos === right or left
props.autoHeight idem

* @prop {object} [tools] The tools of the grid
*
*/
const FeatureDockedGrid = React.createClass({
Copy link
Member

Choose a reason for hiding this comment

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

Rename it ResisableGrid.

tools = [...tools, this.props.tools];

return (
<div style={{
Copy link
Member

Choose a reason for hiding this comment

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

Wrap from the container.

bottom: 2}}>
<span>{rowsSelected} {rowText} selected</span>
</div>
<ButtonToolbar className="featuregrid-tools" style={{marginLeft: "0px", flex: "none", marginBottom: "2px", marginRight: "2px"}} bsSize="sm">
Copy link
Member

Choose a reason for hiding this comment

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

Add the toolbar in the container.

@@ -188,7 +188,7 @@ const FeatureGrid = React.createClass({
flexDirection: "column",
height: "100%"
}}>
<div fluid={false} style={this.props.style} className="ag-fresh">
Copy link
Member

Choose a reason for hiding this comment

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

Why this change? is related to the DockableGrid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because fluid is not a parameter of the div tag

Copy link
Member

Choose a reason for hiding this comment

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

ok


.react-grid-Main, .react-grid-Container, #feature-grid-container {
height: 100%;
width: 100% !important;
Copy link
Member

Choose a reason for hiding this comment

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

avoid !important when possible. Try to provide instead inline style

width: 100% !important;
}
.react-grid-Container {
width: 100% !important;
Copy link
Member

Choose a reason for hiding this comment

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

avoid !important

height: 100% !important;
}*/
.react-grid-Grid{
min-height: 100% !important;
Copy link
Member

Choose a reason for hiding this comment

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

avoid !important

@MV88 MV88 changed the title First implementation of FeatureDockedGrid and DockedGrid components First implementation of ResizableGrid and DockablePanel components May 18, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 79.481% when pulling 64a2bec on MV88:feature-grid-migration into 2a9f77a on geosolutions-it:master.

@@ -82,7 +82,7 @@ const GlobeViewSwitcherButton = React.createClass({
].reduce((result, key) => { result[key] = this.props[key]; return result; }, {});
},
render() {
return <ToggleButton {...this.getButtonProperties()} pressed={this.props.active} tooltip={<Tooltip><Message msgId={this.props.active ? this.props.activeTooltip : this.props.notActiveTooltip}/></Tooltip>} />;
return <ToggleButton {...this.getButtonProperties()} pressed={this.props.active} tooltip={<Tooltip id="globeViewSwitcher"><Message msgId={this.props.active ? this.props.activeTooltip : this.props.notActiveTooltip}/></Tooltip>} />;
Copy link
Member

Choose a reason for hiding this comment

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

globeViewSwitcher-tooltip

@@ -188,7 +188,7 @@ const FeatureGrid = React.createClass({
flexDirection: "column",
height: "100%"
}}>
<div fluid={false} style={this.props.style} className="ag-fresh">
Copy link
Member

Choose a reason for hiding this comment

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

ok

<div id="container-wrapped-component" style={{height: "calc(100% - " + this.props.toolbarHeight + "px)"}}>
{this.props.wrappedComponent !== null ? (<WrappedComponent
size={{
width: this.getAutoWidth(this.props.position),
Copy link
Member

Choose a reason for hiding this comment

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

use values instead of booleans and avoid the additional size parameter

}, {
id: "3",
name: "Edifici"
}, {
Copy link
Member

Choose a reason for hiding this comment

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

less entries

fluid={this.props.fluid}
dimStyle={{ background: 'rgba(0, 0, 100, 0.2)' }}
>
<div id="container-wrapped-component" style={{height: "calc(100% - " + this.props.toolbarHeight + "px)"}}>
Copy link
Member

Choose a reason for hiding this comment

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

use a class

@@ -952,15 +952,65 @@ select.form-control option {
background-color: @ms2-color-primary !important;
color: @ms2-color-text-primary !important;
}
/* feauture grid */
/* feature grid made by react-data-grid */
#container-wrapped-component .react-grid-Header{
Copy link
Member

Choose a reason for hiding this comment

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

.container-wrapped-component (same below)
use a better name like dockpanel-wrapped-component or something like this

},
getDefaultProps() {
return {
id: "dock",
Copy link
Member

Choose a reason for hiding this comment

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

no default

rowGetter={this.rowGetter}
rowHeight={this.props.rowHeight}
rowKey={this.props.rowKey}
rowSelection={{
Copy link
Member

Choose a reason for hiding this comment

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

noSelection by default

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 79.513% when pulling 3c7de83 on MV88:feature-grid-migration into 2a9f77a on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 79.578% when pulling 80ebd24 on MV88:feature-grid-migration into 2a9f77a on geosolutions-it:master.

@MV88 MV88 merged commit 36bb29f into geosolutions-it:master May 19, 2017
@allyoucanmap allyoucanmap mentioned this pull request Aug 9, 2024
5 tasks
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.

5 participants