Skip to content

Commit

Permalink
update material-ui. fix proptype warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffshaver committed Oct 6, 2016
1 parent 386f7e0 commit c9c81cc
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 32 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
"leaflet-fullscreen": "^1.0.1",
"lodash.isequal": "^4.4.0",
"lodash.uniqby": "^4.7.0",
"material-ui": "^0.15.4",
"material-ui": "^0.16.0",
"morgan": "^1.7.0",
"node-uuid": "^1.4.7",
"numeral": "^1.5.3",
"papaparse": "^4.1.2",
"radium": "^0.18.1",
"react": "^15.3.1",
"react-dom": "^15.3.1",
"react-grid-layout": "^0.13.1",
"react-grid-layout": "^0.13.7",
"react-leaflet": "^0.12.1",
"react-redux": "^4.4.5",
"react-router": "^2.7.0",
Expand Down
18 changes: 9 additions & 9 deletions src/js/components/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class Dashboard extends Component {
dashboard: PropTypes.object.isRequired,
dashboardFetch: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
filters: PropTypes.array.isRequired,
filters: PropTypes.object.isRequired,
gridOptions: PropTypes.object,
visualizationResults: PropTypes.object.isRequired
}

static defaultProps = {
gridOptions: {}
}
Expand Down Expand Up @@ -119,11 +119,11 @@ class Dashboard extends Component {
onClickReset () {
this.resetFilters()
}

onVisualizationClose (vizToRemove) {
const {dashboard, dispatch} = this.props
const {visualizations = []} = dashboard

dashboard.visualizations = visualizations.filter((viz) => (
vizToRemove._id !== viz._id
))
Expand All @@ -139,10 +139,10 @@ class Dashboard extends Component {

const layout = []
let i = 0

for (const id in visualizationSizes) {
const {[id]: vizSize} = visualizationSizes

layout.push({
x: i % totalCols,
y: Math.floor(i / totalCols),
Expand All @@ -151,7 +151,7 @@ class Dashboard extends Component {
i: id,
...vizSize
})

i++
}

Expand Down Expand Up @@ -182,7 +182,7 @@ class Dashboard extends Component {
renderVisualizations () {
const {dashboard, filters, visualizationResults} = this.props
const {visualizations = []} = dashboard

return visualizations.map((visualization, i) => {
const results = visualizationResults[visualization._id]
const visualizationElement = filters[dashboard._id]
Expand All @@ -208,7 +208,7 @@ class Dashboard extends Component {
/>
)
: null

return (
<div
key={visualization._id}
Expand Down
8 changes: 5 additions & 3 deletions src/js/components/Dashboards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class Dashboards extends Component {
static propTypes = {
dashboardGroups: PropTypes.object.isRequired,
dashboardId: PropTypes.string,
dashboards: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
visualizations: PropTypes.object.isRequired
}
Expand All @@ -62,7 +61,10 @@ class Dashboards extends Component {
super(props)

this.state = {
dashboardLayout: []
createVisibility: false,
dashboardLayout: [],
deleteVisibility: false,
editVisibility: false
}

this.displayName = 'Dashboards'
Expand Down Expand Up @@ -300,7 +302,7 @@ class Dashboards extends Component {
onClose={this.hideDeleteDialog}
onSubmitClick={this.deleteDashboard}
>
<p>Are you sure you want to delete this dashboard?</p>
{[<p key={'delete'}>Are you sure you want to delete this dashboard?</p>]}
</FormDialog>
<FormDialog
open={editVisibility}
Expand Down
40 changes: 25 additions & 15 deletions src/js/components/FilterCriteria.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,30 @@ class FilterCriteria extends Component {
const {criteriaDataProperty, fields, style: filterStyle} = this.props
const field = fields.data.find((field) => field.name === fieldName) || {}
const {[criteriaDataProperty]: fieldData} = field
const ValueField = fieldData ? AutoComplete : TextField
const valueField = fieldData
? (
<AutoComplete
dataSource={fieldData}
errorText={errorText}
filter={AutoComplete.caseInsensitiveFilter}
floatingLabelText='Filter Criteria'
hintText='Filter Criteria'
openOnFocus={true}
searchText={value}
style={filterStyle}
onNewRequest={(value) => this.onChangeValue(id, value)}
onUpdateInput={(value) => this.onChangeValue(id, value)}
/>
) : (
<TextField
errorText={errorText}
floatingLabelText='Filter Criteria'
hintText='Filter Criteria'
style={filterStyle}
value={value}
onChange={({target: {value}}) => this.onChangeValue(id, value)}
/>
)
const errorText = required && !value
? 'Required'
: undefined
Expand Down Expand Up @@ -193,20 +216,7 @@ class FilterCriteria extends Component {
valueProp={'value'}
onChange={(ev, index, value) => this.onChangeOperator(id, value)}
/>
<ValueField
dataSource={fieldData}
errorText={errorText}
filter={AutoComplete.caseInsensitiveFilter}
floatingLabelText='Filter Criteria'
hintText='Filter Criteria'
openOnFocus={true}
searchText={value}
style={filterStyle}
value={value}
onChange={({target: {value}}) => this.onChangeValue(id, value)}
onNewRequest={(value) => this.onChangeValue(id, value)}
onUpdateInput={(value) => this.onChangeValue(id, value)}
/>
{valueField}
{(() => {
if (required && !isLastFilter) return null

Expand Down
3 changes: 0 additions & 3 deletions src/js/components/LeftNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ export class LeftNav extends Component {
labelStyle={style.logoLabel}
rippleColor='transparent'
style={allLogoStyles}
tooltip={applicationAbbreviation}
tooltipPosition='top-center'
tooltipStyles={style.tooltip}
/>
</MenuItem>
{this.renderRoutes()}
Expand Down

0 comments on commit c9c81cc

Please sign in to comment.