Skip to content

Commit

Permalink
Merge pull request #9962 from vikram-raj/odc-6312
Browse files Browse the repository at this point in the history
Bug 2000108: fix devconsole metrics page
  • Loading branch information
openshift-merge-robot committed Sep 1, 2021
2 parents 880f22d + d5653b8 commit 7824ba4
Showing 1 changed file with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ const MetricsQueryInput: React.FC = () => {
if (text && text.localeCompare(q) !== 0) {
setTitle(CUSTOM_QUERY);
setIsPromQlDisabled(true);
if (query) {
removeQueryArgument('query0');
}
}
}, [query, queries, CUSTOM_QUERY]);

Expand Down Expand Up @@ -105,21 +102,24 @@ const MetricsQueryInput: React.FC = () => {
.catch(() => {});
}, [namespace, safeFetch, dispatch]);

const onChange = (selectedValue: string) => {
setMetric(metricsQuery(t)[selectedValue]);
setChangeKey(!changeKey);
if (selectedValue && selectedValue === ADD_NEW_QUERY) {
setTitle(CUSTOM_QUERY);
setIsPromQlDisabled(true);
setShowPromQl(true);
} else {
setTitle(metricsQuery(t)[selectedValue]);
setIsPromQlDisabled(false);
}
if (query) {
removeQueryArgument('query0');
}
};
const onChange = React.useCallback(
(selectedValue: string) => {
setMetric(metricsQuery(t)[selectedValue]);
setChangeKey(!changeKey);
if (selectedValue && selectedValue === ADD_NEW_QUERY) {
setTitle(CUSTOM_QUERY);
setIsPromQlDisabled(true);
setShowPromQl(true);
} else {
setTitle(metricsQuery(t)[selectedValue]);
setIsPromQlDisabled(false);
}
if (query) {
removeQueryArgument('query0');
}
},
[CUSTOM_QUERY, changeKey, query, t],
);

return (
<>
Expand Down

0 comments on commit 7824ba4

Please sign in to comment.