-
Notifications
You must be signed in to change notification settings - Fork 405
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
Conversation
const DockedGrid = React.createClass({ | ||
propTypes: { | ||
dockSize: React.PropTypes.number, | ||
featureDockedGrid: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.func]), |
There was a problem hiding this comment.
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={{ |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: {}, |
There was a problem hiding this comment.
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") { |
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
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={{ |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid !important
@@ -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>} />; |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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" | ||
}, { |
There was a problem hiding this comment.
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)"}}> |
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noSelection by default
This PR is for adding to the feature grid components two new elements.
The DockablePanel components wrap any the ResizableGrid
Added tests and documentation