This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Phase two result-data-sample migration
Utilize scroll helper for scrolling through query until total objects are found and aggregated Assign clusters to state before querying timeseries data to trigger componentDidUpdate in TimeseriesGraph component Update mock api test with result sample case with differing measurement_title fields
- Loading branch information
1 parent
e3599bc
commit a642a16
Showing
12 changed files
with
492 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import React, { PureComponent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { | ||
Select as PFSelect, | ||
SelectOption, | ||
SelectVariant, | ||
SelectDirection, | ||
} from '@patternfly/react-core'; | ||
|
||
export default class Select extends PureComponent { | ||
static propTypes = { | ||
options: PropTypes.array.isRequired, | ||
}; | ||
|
||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
isToggleIcon: false, | ||
isExpanded: false, | ||
isDisabled: false, | ||
direction: SelectDirection.down, | ||
}; | ||
} | ||
|
||
onToggle = isExpanded => { | ||
this.setState({ | ||
isExpanded, | ||
}); | ||
}; | ||
|
||
clearSelection = () => { | ||
this.setState({ | ||
isExpanded: false, | ||
}); | ||
}; | ||
|
||
toggleDisabled = checked => { | ||
this.setState({ | ||
isDisabled: checked, | ||
}); | ||
}; | ||
|
||
setIcon = checked => { | ||
this.setState({ | ||
isToggleIcon: checked, | ||
}); | ||
}; | ||
|
||
toggleDirection = () => { | ||
const { direction } = this.state; | ||
|
||
if (direction === SelectDirection.up) { | ||
this.setState({ | ||
direction: SelectDirection.down, | ||
}); | ||
} else { | ||
this.setState({ | ||
direction: SelectDirection.up, | ||
}); | ||
} | ||
}; | ||
|
||
render() { | ||
const { options, onSelect, selected } = this.props; | ||
const { isExpanded, isDisabled, direction, isToggleIcon } = this.state; | ||
|
||
return ( | ||
<PFSelect | ||
toggleIcon={isToggleIcon} | ||
variant={SelectVariant.single} | ||
onToggle={this.onToggle} | ||
onSelect={onSelect} | ||
selections={selected} | ||
isExpanded={isExpanded} | ||
isDisabled={isDisabled} | ||
direction={direction} | ||
> | ||
{options.map(option => ( | ||
<SelectOption key={option} value={parseInt(option, 10) + 1} /> | ||
))} | ||
</PFSelect> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import './polyfill'; | ||
import './global.less'; | ||
import 'ant-design-pro/dist/ant-design-pro.css'; | ||
import '@patternfly/react-core/dist/styles/base.css'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.