Skip to content

Commit

Permalink
refactor: Use names 'Static DHCP lease' and 'IP assignment' MAASENG-3…
Browse files Browse the repository at this point in the history
…519 (#5506)

- Rename "Static" to "Static (Client configured)
- Rename "External" to "Static (Externally managed)
- Rename "IP mode" to "IP assignment"
- Rename "DHCP" to "Dynamic"
- Rename "Auto assign" to "Automatic"

---
Fixes [MAASENG-3519](https://warthogs.atlassian.net/browse/MAASENG-3519)
  • Loading branch information
ndv99 authored Jul 25, 2024
1 parent a33fd7f commit 0b25557
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/app/base/components/LinkModeSelect/LinkModeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Props = {

export enum Label {
DefaultOption = "Select IP mode",
Select = "IP mode",
Select = "IP assignment",
}

const getAvailableLinkModes = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe("IPColumn", () => {
renderWithMockStore(<IPColumn link={links[0]} nic={nic} node={machine} />, {
state,
});
expect(screen.getByText("Auto assign")).toBeInTheDocument();
expect(screen.getByText("Automatic")).toBeInTheDocument();
});

it("can display the failed network status for multiple tests", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ const DeviceNetworkTable = ({ systemId }: Props): JSX.Element => {
onClick={() => updateSort("ip_mode")}
sortKey="ip_mode"
>
IP mode
IP assignment
</TableHeader>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe("DiscoveryAddFormFields", () => {

expect(
within(ipAssignment).getByRole("option", {
name: "Static",
name: "Static (Client configured)",
})
).toBeInTheDocument();
});
Expand Down
6 changes: 4 additions & 2 deletions src/app/store/device/utils/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ describe("device utils", () => {

it("handles external IP assignement", () => {
expect(getIpAssignmentDisplay(DeviceIpAssignment.EXTERNAL)).toBe(
"External"
"Static (Externally managed)"
);
});

it("handles static IP assignment", () => {
expect(getIpAssignmentDisplay(DeviceIpAssignment.STATIC)).toBe("Static");
expect(getIpAssignmentDisplay(DeviceIpAssignment.STATIC)).toBe(
"Static (Client configured)"
);
});

it("handles unknown IP assignment", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/app/store/device/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export const getIpAssignmentDisplay = (
case DeviceIpAssignment.DYNAMIC:
return "Dynamic";
case DeviceIpAssignment.EXTERNAL:
return "External";
return "Static (Externally managed)";
case DeviceIpAssignment.STATIC:
return "Static";
return "Static (Client configured)";
default:
return "Unknown";
}
Expand Down
8 changes: 4 additions & 4 deletions src/app/store/utils/node/networking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,10 @@ describe("machine networking utils", () => {
it("maps the link modes to display text", () => {
expect(
getLinkModeDisplay(factory.networkLink({ mode: NetworkLinkMode.AUTO }))
).toBe("Auto assign");
).toBe("Automatic");
expect(
getLinkModeDisplay(factory.networkLink({ mode: NetworkLinkMode.DHCP }))
).toBe("DHCP");
).toBe("Dynamic");
expect(
getLinkModeDisplay(
factory.networkLink({ mode: NetworkLinkMode.LINK_UP })
Expand All @@ -730,7 +730,7 @@ describe("machine networking utils", () => {
getLinkModeDisplay(
factory.networkLink({ mode: NetworkLinkMode.STATIC })
)
).toBe("Static assign");
).toBe("Static (Client configured)");
});
});

Expand Down Expand Up @@ -865,7 +865,7 @@ describe("machine networking utils", () => {
const machine = factory.machineDetails({ interfaces: [nic] });
expect(
getInterfaceIPAddressOrMode(machine, [fabric], [vlan], null, link)
).toStrictEqual("Auto assign");
).toStrictEqual("Automatic");
});
});

Expand Down
6 changes: 3 additions & 3 deletions src/app/store/utils/node/networking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@ export const isInterfaceConnected = (
};

export const LINK_MODE_DISPLAY = {
[NetworkLinkMode.AUTO]: "Auto assign",
[NetworkLinkMode.DHCP]: "DHCP",
[NetworkLinkMode.AUTO]: "Automatic",
[NetworkLinkMode.DHCP]: "Dynamic",
[NetworkLinkMode.LINK_UP]: "Unconfigured",
[NetworkLinkMode.STATIC]: "Static assign",
[NetworkLinkMode.STATIC]: "Static (Client configured)",
};

/**
Expand Down

0 comments on commit 0b25557

Please sign in to comment.