Skip to content

Commit

Permalink
Change SliceName to slice-name because of replacement in the backend
Browse files Browse the repository at this point in the history
Signed-off-by: gatici <[email protected]>
  • Loading branch information
gatici committed Nov 8, 2024
1 parent 9fc8dbe commit 43bf58a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions app/(network)/network-configuration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ const NetworkConfiguration = () => {
{networkSlices.length > 0 && (
<>
{networkSlices.map((slice) => (
<Card key={slice.SliceName}>
<h2 className="p-heading--5">{slice.SliceName}</h2>
<Card key={slice["slice-name"]}>
<h2 className="p-heading--5">{slice["slice-name"]}</h2>
<NetworkSliceTable slice={slice} />
<hr />
<div className="u-align--right">
{getEditButton(slice)}
{getDeleteButton(slice.SliceName, slice["site-device-group"])}
{getDeleteButton(slice["slice-name"], slice["site-device-group"])}
</div>
</Card>
))}
Expand Down
4 changes: 2 additions & 2 deletions components/NetworkSliceGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const NetworkSliceGroups: React.FC<NetworkSliceTableProps> = ({
}));
};
const { data: deviceGroupContent = [], isLoading } = useQuery({
queryKey: [queryKeys.deviceGroups, slice.SliceName, slice["site-device-group"]?.join(",")],
queryKey: [queryKeys.deviceGroups, slice["slice-name"], slice["site-device-group"]?.join(",")],
queryFn: () => getDeviceGroupsFromNetworkSlice(slice),
enabled: isExpanded,
});
Expand Down Expand Up @@ -163,7 +163,7 @@ export const NetworkSliceGroups: React.FC<NetworkSliceTableProps> = ({
content:
(<div className="u-align--right">
{getEditButton(deviceGroup_id)}
{getDeleteButton(deviceGroup?.["group-name"], deviceGroup?.["imsis"] , slice.SliceName)}
{getDeleteButton(deviceGroup?.["group-name"], deviceGroup?.["imsis"] , slice["slice-name"])}
</div>
),
className: "u-align--right",
Expand Down
4 changes: 2 additions & 2 deletions components/NetworkSliceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const NetworkSliceModal = ({ networkSlice, toggleModal }: NetworkSliceModalProps
});

const modalTitle = () => {
return networkSlice?.SliceName ? ("Edit Network Slice: " + networkSlice.SliceName) : "Create Network Slice"
return networkSlice?.["slice-name"] ? ("Edit Network Slice: " + networkSlice?.["slice-name"]) : "Create Network Slice"
}

const buttonText = () => {
Expand All @@ -81,7 +81,7 @@ const NetworkSliceModal = ({ networkSlice, toggleModal }: NetworkSliceModalProps
initialValues: {
mcc: networkSlice?.["site-info"]["plmn"].mcc || "",
mnc: networkSlice?.["site-info"]["plmn"].mnc || "",
name: networkSlice?.SliceName || "",
name: networkSlice?.["slice-name"] || "",
upf: getUpfFromNetworkSlice(),
gnbList: networkSlice?.["site-info"].gNodeBs || [],
},
Expand Down
16 changes: 8 additions & 8 deletions components/NetworkSliceTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ export const NetworkSliceTable: React.FC<NetworkSliceTableProps> = ({
queryKey: [queryKeys.networkSlices],
});
await queryClient.invalidateQueries({
queryKey: [queryKeys.deviceGroups, slice.SliceName],
queryKey: [queryKeys.deviceGroups, slice["slice-name"]],
});
};

return (
<>
{isModalVisible && slice?.SliceName && (
{isModalVisible && slice?.["slice-name"] && (
<DeviceGroupModal
toggleModal={toggleModal}
onDeviceGroupAction={handleDeviceGroupCreated}
networkSliceName={slice.SliceName}
networkSliceName={slice["slice-name"]}
/>
)}
<MainTable
Expand All @@ -60,7 +60,7 @@ export const NetworkSliceTable: React.FC<NetworkSliceTableProps> = ({
className: "u-align--right",
},
],
key: `mcc-${slice.SliceName}`,
key: `mcc-${slice["slice-name"]}`,
},
{
columns: [
Expand All @@ -70,7 +70,7 @@ export const NetworkSliceTable: React.FC<NetworkSliceTableProps> = ({
className: "u-align--right",
},
],
key: `mnc-${slice.SliceName}`,
key: `mnc-${slice["slice-name"]}`,
},
{
columns: [
Expand All @@ -83,7 +83,7 @@ export const NetworkSliceTable: React.FC<NetworkSliceTableProps> = ({
className: "u-align--right",
},
],
key: `upf-${slice.SliceName}`,
key: `upf-${slice["slice-name"]}`,
},
{
columns: [
Expand All @@ -94,7 +94,7 @@ export const NetworkSliceTable: React.FC<NetworkSliceTableProps> = ({
className: "u-align--right",
},
],
key: `gNodeBs-${slice.SliceName}`,
key: `gNodeBs-${slice["slice-name"]}`,
},
{
columns: [
Expand Down Expand Up @@ -149,7 +149,7 @@ export const NetworkSliceTable: React.FC<NetworkSliceTableProps> = ({
<NetworkSliceGroups slice={slice} isExpanded={isExpanded} />
),
expanded: isExpanded,
key: `device-groups-${slice.SliceName}`,
key: `device-groups-${slice["slice-name"]}`,
},
]}
/>
Expand Down
10 changes: 5 additions & 5 deletions components/SubscriberModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const SubscriberModal = ({ toggleModal, subscriber, slices, deviceGroups}: Props
const oldNetworkSlice = slices.find(
(slice) => slice["site-device-group"]?.includes(oldDeviceGroupName)
);
const oldNetworkSliceName : string = oldNetworkSlice ? oldNetworkSlice["SliceName"] : "";
const oldNetworkSliceName : string = oldNetworkSlice ? oldNetworkSlice["slice-name"] : "";

const SubscriberSchema = Yup.object().shape({
imsi: Yup.string()
Expand Down Expand Up @@ -130,7 +130,7 @@ const SubscriberModal = ({ toggleModal, subscriber, slices, deviceGroups}: Props
};

const selectedSlice = slices.find(
(slice) => slice.SliceName === formik.values.selectedSlice,
(slice) => slice["slice-name"] === formik.values.selectedSlice,
);

const setDeviceGroup = useCallback(
Expand All @@ -148,7 +148,7 @@ const SubscriberModal = ({ toggleModal, subscriber, slices, deviceGroups}: Props
: [];

useEffect(() => {
if (subscriber && selectedSlice && oldNetworkSliceName == selectedSlice.SliceName) {
if (subscriber && selectedSlice && oldNetworkSliceName == selectedSlice["slice-name"]) {
setDeviceGroup(oldDeviceGroupName);
}
else if (selectedSlice && selectedSlice["site-device-group"]?.length === 1){
Expand Down Expand Up @@ -245,8 +245,8 @@ const SubscriberModal = ({ toggleModal, subscriber, slices, deviceGroups}: Props
value: "",
},
...slices.map((slice) => ({
label: slice.SliceName,
value: slice.SliceName,
label: slice["slice-name"],
value: slice["slice-name"],
})),
]}
/>
Expand Down
2 changes: 1 addition & 1 deletion components/types.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type NetworkSlice = {
name: string;
SliceName: string;
"slice-name": string;
"slice-id": {
sst: string;
sd: string;
Expand Down

0 comments on commit 43bf58a

Please sign in to comment.