mirror of
https://github.com/apache/superset.git
synced 2026-04-21 17:14:57 +00:00
[Explore] highlighting run query when chart is stale on explore view (#4459)
* highlighting run query when chart is stale on explore view * refactoring control changed code
This commit is contained in:
committed by
Maxime Beauchemin
parent
2932585c65
commit
56f65158a2
@@ -11,6 +11,7 @@ const propTypes = {
|
||||
onSave: PropTypes.func,
|
||||
onStop: PropTypes.func,
|
||||
loading: PropTypes.bool,
|
||||
chartIsStale: PropTypes.bool,
|
||||
errorMessage: PropTypes.node,
|
||||
};
|
||||
|
||||
@@ -21,11 +22,18 @@ const defaultProps = {
|
||||
};
|
||||
|
||||
export default function QueryAndSaveBtns(
|
||||
{ canAdd, onQuery, onSave, onStop, loading, errorMessage }) {
|
||||
{ canAdd, onQuery, onSave, onStop, loading, chartIsStale, errorMessage }) {
|
||||
const saveClasses = classnames({
|
||||
'disabled disabledButton': canAdd !== 'True',
|
||||
});
|
||||
const qryButtonStyle = errorMessage ? 'danger' : 'primary';
|
||||
|
||||
let qryButtonStyle = 'default';
|
||||
if (errorMessage) {
|
||||
qryButtonStyle = 'danger';
|
||||
} else if (chartIsStale) {
|
||||
qryButtonStyle = 'primary';
|
||||
}
|
||||
|
||||
const saveButtonDisabled = errorMessage ? true : loading;
|
||||
const qryOrStopButton = loading ? (
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user