Skip to content

Commit

Permalink
adds disable for refresh button
Browse files Browse the repository at this point in the history
  • Loading branch information
dplumlee committed Jul 13, 2021
1 parent a5bddc5 commit b494375
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export const SuperDatePickerComponent = React.memo<SuperDatePickerProps>(
prevProps.startAutoReload === nextProps.startAutoReload &&
prevProps.stopAutoReload === nextProps.stopAutoReload &&
prevProps.timelineId === nextProps.timelineId &&
prevProps.disabled === nextProps.disabled &&
prevProps.toStr === nextProps.toStr &&
prevProps.updateReduxTime === nextProps.updateReduxTime &&
deepEqual(prevProps.kqlQuery, nextProps.kqlQuery) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ export const QueryTabContentComponent: React.FC<Props> = ({
);
}, [loadingSourcerer, timelineId, isQueryLoading, dispatch]);

const isDatePickerDisabled = useMemo(() => {
return (combinedQueries && combinedQueries.kqlError != null) || false;
}, [combinedQueries]);

const leadingControlColumns: ControlColumnProps[] = [defaultControlColumn];
const trailingControlColumns: ControlColumnProps[] = [];

Expand Down Expand Up @@ -334,7 +338,7 @@ export const QueryTabContentComponent: React.FC<Props> = ({
<SuperDatePicker
id="timeline"
timelineId={timelineId}
disabled={combinedQueries && combinedQueries.kqlError != null}
disabled={isDatePickerDisabled}
/>
</DatePicker>
<EuiFlexItem grow={false}>
Expand Down

0 comments on commit b494375

Please sign in to comment.