Skip to content

Commit c00a405

Browse files
Merge pull request #84 from openshift-cherrypick-robot/cherry-pick-83-to-release-4.18
[release-4.18] Fix interfaces order and add yaml tab to selected interface
2 parents f8b8549 + 53eedd9 commit c00a405

4 files changed

Lines changed: 17 additions & 21 deletions

File tree

src/views/states/list/components/InterfaceDrawer/InterfaceDrawer.tsx

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

3-
import { Modal, Title } from '@patternfly/react-core';
3+
import { Modal, PageSection, PageSectionVariants, Title } from '@patternfly/react-core';
44
import { NodeNetworkConfigurationInterface } from '@types';
55
import { useNMStateTranslation } from '@utils/hooks/useNMStateTranslation';
66

@@ -70,9 +70,9 @@ const InterfaceDrawer: FC<InterfaceDrawerProps> = ({ selectedInterface, onClose
7070
))}
7171
</ul>
7272
</div>
73-
<div className="pf-u-p-xl">
73+
<PageSection variant={PageSectionVariants.light}>
7474
<SelectedTabComponent selectedInterface={selectedInterface} />
75-
</div>
75+
</PageSection>
7676
</Modal>
7777
);
7878
};

src/views/states/list/components/InterfaceDrawer/InterfaceDrawerFooter.tsx

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

3-
import { Button, ButtonVariant, debounce, Tooltip } from '@patternfly/react-core';
3+
import { Button, ButtonVariant, debounce, Split, Tooltip } from '@patternfly/react-core';
44
import { NodeNetworkConfigurationInterface } from '@types';
55
import { useNMStateTranslation } from '@utils/hooks/useNMStateTranslation';
66

@@ -29,20 +29,16 @@ const InterfaceDrawerYAMLFooter: FC<InterfaceDrawerFooterProps> = ({ selectedInt
2929
}, []);
3030

3131
return (
32-
<>
32+
<Split hasGutter>
3333
<Tooltip content={copied ? t('Copied') : t('Copy YAML to clipboard')}>
3434
<Button variant={ButtonVariant.primary} onClick={onCopy}>
3535
{t('Copy')}
3636
</Button>
3737
</Tooltip>
38-
<Button
39-
variant={ButtonVariant.secondary}
40-
onClick={() => downloadYAML(selectedInterface)}
41-
className="pf-u-ml-md"
42-
>
38+
<Button variant={ButtonVariant.secondary} onClick={() => downloadYAML(selectedInterface)}>
4339
{t('Download YAML')}
4440
</Button>
45-
</>
41+
</Split>
4642
);
4743
};
4844

src/views/states/topology/components/TopologySidebar/TopologySidebar.tsx

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

3-
import { Divider, Title } from '@patternfly/react-core';
43
import { TopologySideBar } from '@patternfly/react-topology';
54
import { V1beta1NodeNetworkState } from '@types';
65

76
import StateDetailsPage from '../../../details/StateDetailsPage';
8-
import InterfaceDrawerDetailsTab from '../../../list/components/InterfaceDrawer/InterfaceDrawerDetailsTab';
7+
import InterfaceDrawer from '../../../list/components/InterfaceDrawer/InterfaceDrawer';
98

109
import './TopologySidebar.scss';
1110

@@ -34,9 +33,10 @@ const TopologySidebar: FC<TopologySidebarProps> = ({ states, selectedIds, setSel
3433
<StateDetailsPage nns={selectedState} />
3534
) : (
3635
<>
37-
<Title headingLevel="h2">{selectedInterface?.name}</Title>
38-
<Divider style={{ padding: '1rem 0' }} />
39-
<InterfaceDrawerDetailsTab selectedInterface={selectedInterface} />
36+
<InterfaceDrawer
37+
selectedInterface={selectedInterface}
38+
onClose={() => setSelectedIds([])}
39+
/>
4040
</>
4141
)}
4242
</div>

src/views/states/topology/utils/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ const statusMap: { [key: string]: NodeStatus } = {
2626
};
2727

2828
const networkTypeLevelMap = {
29-
[InterfaceType.LINUX_BRIDGE]: 1,
30-
[InterfaceType.VLAN]: 2,
31-
[InterfaceType.BOND]: 3,
32-
[InterfaceType.ETHERNET]: 4,
29+
[InterfaceType.LINUX_BRIDGE]: 2,
30+
[InterfaceType.VLAN]: 3,
31+
[InterfaceType.BOND]: 4,
32+
[InterfaceType.ETHERNET]: 5,
3333
};
3434

3535
export const networkNodeLevel = new Proxy(networkTypeLevelMap, {
3636
get(target, prop: string) {
37-
return target[prop] ?? 5;
37+
return target[prop] ?? 1;
3838
},
3939
});
4040

0 commit comments

Comments
 (0)