Skip to content

Commit

Permalink
machines: Port remaining PF3 Tooltip
Browse files Browse the repository at this point in the history
This was forgotten in PR #14195

Don't use  DropdownItem's `tooltip=` property as that does not work [1].
Wrap it in a Tooltip instead.

[1] patternfly/patternfly-react#4581

Closes #14381
  • Loading branch information
martinpitt committed Jul 21, 2020
1 parent a1cd4ce commit b0ff3e5
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions pkg/machines/components/vm/vmActions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import cockpit from 'cockpit';
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Tooltip } from 'patternfly-react';
import {
Button,
Dropdown, DropdownItem, DropdownSeparator, KebabToggle,
Tooltip,
} from '@patternfly/react-core';

import {
Expand Down Expand Up @@ -132,15 +132,14 @@ const VmActions = ({ vm, dispatch, storagePools, onStart, onInstall, onReboot, o
if (state !== undefined && LibvirtDBus.canDelete && LibvirtDBus.canDelete(state, vm.id)) {
if (!vm.persistent) {
dropdownItems.push(
<DropdownItem key={`${id}-delete`}
id={`${id}-delete`}
className='pf-m-danger'
tooltip={<Tooltip id={`${id}-delete-tooltip`}>
{_("This VM is transient. Shut it down if you wish to delete it.")}
</Tooltip>}
isDisabled>
{_("Delete")}
</DropdownItem>
<Tooltip id={`${id}-delete-tooltip`} content={_("This VM is transient. Shut it down if you wish to delete it.")}>
<DropdownItem key={`${id}-delete`}
id={`${id}-delete`}
className='pf-m-danger'
isDisabled>
{_("Delete")}
</DropdownItem>
</Tooltip>
);
} else {
dropdownItems.push(
Expand Down

0 comments on commit b0ff3e5

Please sign in to comment.