Skip to content

First implementation of ResizableGrid and DockablePanel components#1835

Merged
MV88 merged 4 commits intogeosolutions-it:masterfrom
MV88:feature-grid-migration
May 19, 2017
Merged

First implementation of ResizableGrid and DockablePanel components#1835
MV88 merged 4 commits intogeosolutions-it:masterfrom
MV88:feature-grid-migration

Conversation

@MV88
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

flexDirection: "column",
height: "100%"
}}>
<div fluid={false} style={this.props.style} className="ag-fresh">
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.

Why this change? is related to the DockableGrid?

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.

because fluid is not a parameter of the div tag

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.

ok


.react-grid-Main, .react-grid-Container, #feature-grid-container {
height: 100%;
width: 100% !important;
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.

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

width: 100% !important;
}
.react-grid-Container {
width: 100% !important;
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.

avoid !important

height: 100% !important;
}*/
.react-grid-Grid{
min-height: 100% !important;
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.

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
Copy Markdown

Coverage Status

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

},
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

globeViewSwitcher-tooltip

flexDirection: "column",
height: "100%"
}}>
<div fluid={false} style={this.props.style} className="ag-fresh">
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.

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

use a class

}
/* feauture grid */
/* feature grid made by react-data-grid */
#container-wrapped-component .react-grid-Header{
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.

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

},
getDefaultProps() {
return {
id: "dock",
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.

no default

rowGetter={this.rowGetter}
rowHeight={this.props.rowHeight}
rowKey={this.props.rowKey}
rowSelection={{
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.

noSelection by default

@coveralls
Copy link
Copy Markdown

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
Copy Markdown

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