Skip to content

Commit

Permalink
Merge pull request #87 from jasonmadigan/pf-topology
Browse files Browse the repository at this point in the history
Patternfly Topology
  • Loading branch information
R-Lawton authored Oct 7, 2024
2 parents 6811877 + 0e6f7eb commit 6d3cbbc
Show file tree
Hide file tree
Showing 8 changed files with 1,070 additions and 5,298 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@
"@babel/preset-react": "^7.24.7",
"@patternfly/react-code-editor": "^5.4.0",
"@patternfly/react-table": "^5.3.3",
"@patternfly/react-topology": "^5.4.0",
"babel-loader": "^8.2.0",
"graphlib": "^2.1.8",
"graphlib-dot": "^0.6.4",
"react-policy-topology": "^0.1.10"
"graphlib-dot": "^0.6.4"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
21 changes: 18 additions & 3 deletions src/components/DropdownWithKebab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import * as React from 'react';
import { EllipsisVIcon } from '@patternfly/react-icons';
import { Dropdown, DropdownItem, DropdownList, MenuToggle, MenuToggleElement, Button, ButtonVariant } from '@patternfly/react-core';
import {
Dropdown,
DropdownItem,
DropdownList,
MenuToggle,
MenuToggleElement,
Button,
ButtonVariant,
} from '@patternfly/react-core';
import { Modal, ModalBody, ModalFooter, ModalHeader } from '@patternfly/react-core/next';
import { k8sDelete, K8sResourceCommon } from '@openshift-console/dynamic-plugin-sdk';
import getModelFromResource from '../utils/getModelFromResource'; // Assume you have a utility for getting the model from the resource
Expand Down Expand Up @@ -40,7 +48,10 @@ const DropdownWithKebab: React.FC<DropdownWithKebabProps> = ({ obj }) => {
setIsDeleteModalOpen(true);
};

const onSelect = (_event: React.MouseEvent<Element, MouseEvent> | undefined, value: string | number | undefined) => {
const onSelect = (
_event: React.MouseEvent<Element, MouseEvent> | undefined,
value: string | number | undefined,
) => {
setIsOpen(false);
if (value === 'delete') {
onDeleteClick();
Expand Down Expand Up @@ -90,7 +101,11 @@ const DropdownWithKebab: React.FC<DropdownWithKebabProps> = ({ obj }) => {
<Button key="confirm" variant={ButtonVariant.danger} onClick={onDeleteConfirm}>
Delete
</Button>
<Button key="cancel" variant={ButtonVariant.link} onClick={() => setIsDeleteModalOpen(false)}>
<Button
key="cancel"
variant={ButtonVariant.link}
onClick={() => setIsDeleteModalOpen(false)}
>
Cancel
</Button>
</ModalFooter>
Expand Down
Loading

0 comments on commit 6d3cbbc

Please sign in to comment.