Skip to content

Commit 2e9aca1

Browse files
Merge pull request #111 from pcbailey/feature--nncp-wizard-redesign
CNV-66757: Redesign NodeNetworkConfigurationPolicy wizard
2 parents 611d99c + da6f08b commit 2e9aca1

File tree

100 files changed

+3041
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+3041
-142
lines changed

cypress/e2e/NewPolicy.spec.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const deletePolicyFromDetailsPage = (policyName: string) => {
1313
cy.contains('h1', 'NodeNetworkConfigurationPolicy');
1414
};
1515

16-
describe('Create new policy with form', () => {
16+
describe.skip('Create new policy with form', () => {
1717
beforeEach(() => {
1818
cy.login();
1919
});

locales/en/plugin__nmstate-console-plugin.json

Lines changed: 61 additions & 8 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"@patternfly/react-core": "6.1.1-prerelease.2",
3535
"@patternfly/react-icons": "^6.1.0",
3636
"@patternfly/react-table": "^6.1.0",
37+
"@patternfly/react-templates": "6.3.0-prerelease.10",
3738
"@patternfly/react-topology": "^6.2.0",
3839
"@testing-library/jest-dom": "^5.16.5",
3940
"@testing-library/react": "^12.0.0",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { K8sModel } from '@openshift-console/dynamic-plugin-sdk';
2+
3+
export const ClusterUserDefinedNetworkModel: K8sModel = {
4+
abbr: 'CUDN',
5+
apiGroup: 'k8s.ovn.org',
6+
apiVersion: 'v1',
7+
crd: true,
8+
id: 'clusteruserdefinednetwork',
9+
kind: 'ClusterUserDefinedNetwork',
10+
label: 'clusteruserdefinednetwork',
11+
// t('plugin__nmstate-console-plugin~ClusterUserDefinedNetwork')
12+
labelKey: 'ClusterUserDefinedNetwork',
13+
labelPlural: 'ClusterUserDefinedNetworks',
14+
// t('plugin__nmstate-console-plugin~ClusterUserDefinedNetworks')
15+
labelPluralKey: 'ClusterUserDefinedNetworks',
16+
namespaced: false,
17+
plural: 'clusteruserdefinednetworks',
18+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export enum NodeNetworkConfigurationInterfaceBondMode {
2+
BALANCE_RR = 'balance-rr',
3+
ACTIVE_BACKUP = 'active-backup',
4+
BALANCE_XOR = 'balance-xor',
5+
BROADCAST = 'broadcast',
6+
LACP = '802.3ad',
7+
BALANCE_TLB = 'balance-tlb',
8+
BALANCE_ALB = 'balance-alb',
9+
BALANCE_SLB = 'balance-slb',
10+
}

src/utils/components/DetailItem/DetailItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ import {
1313
import { PencilAltIcon } from '@patternfly/react-icons';
1414
import { useNMStateTranslation } from '@utils/hooks/useNMStateTranslation';
1515

16+
import EditButtonWithTooltip from '../EditButton/EditButtonWithTooltip';
17+
1618
import { DetailItemHeader } from './DetailItemHeader';
17-
import EditButtonWithTooltip from './EditButtonWithTooltip';
1819

1920
import './DetailItem.scss';
2021

src/utils/components/DetailItem/EditButton.tsx renamed to src/utils/components/EditButton/EditButton.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@ import React, { FC, PropsWithChildren, SyntheticEvent } from 'react';
33
import { Button, ButtonVariant } from '@patternfly/react-core';
44
import { PencilAltIcon } from '@patternfly/react-icons';
55

6+
import { IconPosition } from './utils/types';
7+
68
type EditButtonProps = PropsWithChildren<{
9+
iconPosition?: IconPosition;
710
isEditable: boolean;
811
onEditClick?: () => void;
912
testId: string;
1013
}>;
1114

12-
const EditButton: FC<EditButtonProps> = ({ children, onEditClick, isEditable, testId }) => (
15+
const EditButton: FC<EditButtonProps> = ({
16+
children,
17+
onEditClick,
18+
isEditable,
19+
testId,
20+
iconPosition = 'start',
21+
}) => (
1322
<Button
1423
onClick={(e: SyntheticEvent<HTMLButtonElement>) => {
1524
e.stopPropagation();
@@ -20,6 +29,7 @@ const EditButton: FC<EditButtonProps> = ({ children, onEditClick, isEditable, te
2029
isInline
2130
variant={ButtonVariant.link}
2231
icon={<PencilAltIcon />}
32+
iconPosition={iconPosition}
2333
>
2434
{children}
2535
</Button>

src/utils/components/DetailItem/EditButtonWithTooltip.tsx renamed to src/utils/components/EditButton/EditButtonWithTooltip.tsx

File renamed without changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ButtonProps } from '@patternfly/react-core';
2+
3+
export type IconPosition = ButtonProps['iconPosition'];

src/utils/components/ExternalLink/ExternalLink.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { FC } from 'react';
22

3+
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
34
import { useNMStateTranslation } from '@utils/hooks/useNMStateTranslation';
45

56
type ExternalLinkProps = {
@@ -12,6 +13,7 @@ const ExternalLink: FC<ExternalLinkProps> = ({ href, label }) => {
1213
return (
1314
<a href={href} target="_blank" rel="noopener noreferrer" className="co-external-link">
1415
{label || t('Learn more')}
16+
<ExternalLinkAltIcon className="pf-v6-u-ml-xs" />
1517
</a>
1618
);
1719
};

0 commit comments

Comments
 (0)