-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow user to force refresh metadata (#5933)
* Allow user to force refresh metadata * fix javascript test error * nit * fix styling * allow custom cache timeout configuration on any database * minor improvement * nit * fix test * nit * preserve the old endpoint
- Loading branch information
1 parent
1ee08fc
commit 712c1aa
Showing
8 changed files
with
171 additions
and
39 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,51 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Label } from 'react-bootstrap'; | ||
import TooltipWrapper from './TooltipWrapper'; | ||
|
||
const propTypes = { | ||
onClick: PropTypes.func, | ||
className: PropTypes.string, | ||
tooltipContent: PropTypes.string.isRequired, | ||
}; | ||
|
||
class RefreshLabel extends React.PureComponent { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
hovered: false, | ||
}; | ||
} | ||
|
||
mouseOver() { | ||
this.setState({ hovered: true }); | ||
} | ||
|
||
mouseOut() { | ||
this.setState({ hovered: false }); | ||
} | ||
|
||
render() { | ||
const labelStyle = this.state.hovered ? 'primary' : 'default'; | ||
const tooltip = 'Click to ' + this.props.tooltipContent; | ||
return ( | ||
<TooltipWrapper | ||
tooltip={tooltip} | ||
label="cache-desc" | ||
> | ||
<Label | ||
className={this.props.className} | ||
bsStyle={labelStyle} | ||
style={{ fontSize: '13px', marginRight: '5px', cursor: 'pointer' }} | ||
onClick={this.props.onClick} | ||
onMouseOver={this.mouseOver.bind(this)} | ||
onMouseOut={this.mouseOut.bind(this)} | ||
> | ||
<i className="fa fa-refresh" /> | ||
</Label> | ||
</TooltipWrapper>); | ||
} | ||
} | ||
RefreshLabel.propTypes = propTypes; | ||
|
||
export default RefreshLabel; |
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