mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Use tooltip for hover in delete-cluster-confirmation dialog
Signed-off-by: Alex Culliere <alozhkin@mirantis.com>
This commit is contained in:
parent
de1fa12ba6
commit
f0eff41a41
@ -1,4 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
import uniqueId from "lodash/uniqueId";
|
||||||
import { clusterSettingsURL } from "../+cluster-settings";
|
import { clusterSettingsURL } from "../+cluster-settings";
|
||||||
import { landingURL } from "../+landing-page";
|
import { landingURL } from "../+landing-page";
|
||||||
|
|
||||||
@ -7,6 +8,7 @@ import { broadcastMessage, requestMain } from "../../../common/ipc";
|
|||||||
import { clusterDisconnectHandler } from "../../../common/cluster-ipc";
|
import { clusterDisconnectHandler } from "../../../common/cluster-ipc";
|
||||||
import { ConfirmDialog } from "../confirm-dialog";
|
import { ConfirmDialog } from "../confirm-dialog";
|
||||||
import { Cluster } from "../../../main/cluster";
|
import { Cluster } from "../../../main/cluster";
|
||||||
|
import { Tooltip } from "../../components//tooltip";
|
||||||
|
|
||||||
const navigate = (route: string) =>
|
const navigate = (route: string) =>
|
||||||
broadcastMessage("renderer:navigate", route);
|
broadcastMessage("renderer:navigate", route);
|
||||||
@ -25,7 +27,10 @@ export const ClusterActions = (cluster: Cluster) => ({
|
|||||||
navigate(landingURL());
|
navigate(landingURL());
|
||||||
await requestMain(clusterDisconnectHandler, cluster.id);
|
await requestMain(clusterDisconnectHandler, cluster.id);
|
||||||
},
|
},
|
||||||
remove: () => ConfirmDialog.open({
|
remove: () => {
|
||||||
|
const tooltipId = uniqueId("tooltip_target_");
|
||||||
|
|
||||||
|
return ConfirmDialog.open({
|
||||||
okButtonProps: {
|
okButtonProps: {
|
||||||
primary: false,
|
primary: false,
|
||||||
accent: true,
|
accent: true,
|
||||||
@ -36,6 +41,10 @@ export const ClusterActions = (cluster: Cluster) => ({
|
|||||||
clusterStore.removeById(cluster.id);
|
clusterStore.removeById(cluster.id);
|
||||||
navigate(landingURL());
|
navigate(landingURL());
|
||||||
},
|
},
|
||||||
message: <p>Are you sure want to remove cluster <b title={cluster.id}>{cluster.contextName}</b>?</p>,
|
message: <p>
|
||||||
})
|
Are you sure want to remove cluster <b id={tooltipId}>{cluster.name}</b>?
|
||||||
|
<Tooltip targetId={tooltipId}>{cluster.id}</Tooltip>
|
||||||
|
</p>
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user