Skip to content

Commit

Permalink
Fix #17: Open /settings/openshift when clicking on the disconnected
Browse files Browse the repository at this point in the history
OpenShift icon
  • Loading branch information
fantonangeli committed May 18, 2023
1 parent f465775 commit 7fd8818
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ export function OpenshiftDeploymentsDropdown() {
}
}, [openshift.deployments, isConnected, openOpenShiftSettings, settings.openshift.config.namespace]);

const onDeploymensDropdownToggle = useCallback(() => {
if (!isConnected) {
history.push(routes.settings.openshift.path({}));
}
openshift.setDeploymentsDropdownOpen((dropdownOpen) => isConnected && !dropdownOpen);
}, [history, isConnected, openshift]);

return (
<>
<Tooltip
Expand All @@ -110,7 +117,7 @@ export function OpenshiftDeploymentsDropdown() {
toggle={
<ResponsiveDropdownToggle
toggleIndicator={null}
onToggle={() => openshift.setDeploymentsDropdownOpen((dropdownOpen) => isConnected && !dropdownOpen)}
onToggle={onDeploymensDropdownToggle}
className={"kie-tools--masthead-hoverable-dark"}
>
<OpenshiftIcon color={!isConnected ? "gray" : undefined} />
Expand Down

0 comments on commit 7fd8818

Please sign in to comment.