Skip to content

Commit

Permalink
fix(machines): Increase width of bond and bridge forms in Network tab…
Browse files Browse the repository at this point in the history
… 3.5 backport (#5505)
  • Loading branch information
ndv99 authored Jul 22, 2024
1 parent 8c0b18f commit 46934a9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
14 changes: 9 additions & 5 deletions src/app/base/components/NetworkActionRow/NetworkActionRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const NetworkActionRow = ({
setSelected,
}: Props): JSX.Element | null => {
const isAllNetworkingDisabled = useIsAllNetworkingDisabled(node);
const { setSidePanelContent } = useSidePanel();
const { setSidePanelContent, setSidePanelSize } = useSidePanel();
const { pathname } = useLocation();
const isMachinesPage = pathname.startsWith("/machine");

Expand All @@ -63,16 +63,20 @@ const NetworkActionRow = ({
})
: () =>
setSidePanelContent({ view: DeviceSidePanelViews.ADD_INTERFACE }),
[ExpandedState.ADD_BOND]: () =>
[ExpandedState.ADD_BOND]: () => {
setSidePanelContent({
view: MachineSidePanelViews.ADD_BOND,
extras: { systemId: node.system_id, selected: selected, setSelected },
}),
[ExpandedState.ADD_BRIDGE]: () =>
});
setSidePanelSize("large");
},
[ExpandedState.ADD_BRIDGE]: () => {
setSidePanelContent({
view: MachineSidePanelViews.ADD_BRIDGE,
extras: { systemId: node.system_id, selected: selected, setSelected },
}),
});
setSidePanelSize("large");
},
};
return expandedStateMap[state]?.();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const NetworkTableActions = ({
selected,
setSelected,
}: Props): JSX.Element | null => {
const { setSidePanelContent } = useSidePanel();
const { setSidePanelContent, setSidePanelSize } = useSidePanel();
const machine = useSelector((state: RootState) =>
machineSelectors.getById(state, systemId)
);
Expand Down Expand Up @@ -149,16 +149,21 @@ const NetworkTableActions = ({
disabled: item.disabled,
onClick: () => {
item.state === ExpandedState.EDIT
? setSidePanelContent({
view: item.view,
extras: {
linkId: link?.id,
nicId: nic?.id,
selected,
setSelected,
systemId: machine.system_id,
},
})
? (() => {
setSidePanelContent({
view: item.view,
extras: {
linkId: link?.id,
nicId: nic?.id,
selected,
setSelected,
systemId: machine.system_id,
},
});
if (nic.type === NetworkInterfaceTypes.BOND) {
setSidePanelSize("large");
}
})()
: setSidePanelContent({
view: item.view,
extras: {
Expand Down

0 comments on commit 46934a9

Please sign in to comment.