Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor & feat /edit button #120

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions frontend/src/pages/ProfileList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ function ProfileList(props: Props) {
navigation("/profile/" + profile);
};

const handleEdit = (profile: string) => {
navigation("/profile/create/" + profile);
};

const filteredData = data.filter((profile) =>
profile.toLowerCase().includes(searchTerm.toLowerCase()),
);
Expand Down Expand Up @@ -156,6 +160,7 @@ function ProfileList(props: Props) {
<TableCell>Name</TableCell>
<TableCell>Delete</TableCell>
<TableCell>View</TableCell>
<TableCell>Edit</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand All @@ -176,6 +181,11 @@ function ProfileList(props: Props) {
VIEW
</Button>
</TableCell>
<TableCell>
<Button color="primary" variant="contained" onClick={() => handleEdit(row.toString())}>
EDIT
</Button>
</TableCell>
</TableRow>
))}
</TableBody>
Expand Down
20 changes: 13 additions & 7 deletions frontend/src/pages/ProfileRead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ export default function ProfileRead() {

return (
<Dashboard title="Profile" refreshAction={() => {}}>
<Grid
item
xs={12}
sx={{
display: 'flex',
justifyContent: 'flex-end'
}}
>
<Button color="primary" variant="contained" onClick={handleEdit} sx={{ m: 1 }}>
EDIT
</Button>
</Grid>
<br />
<Card variant="outlined">
<Table>
<TableBody>
Expand Down Expand Up @@ -236,13 +249,6 @@ export default function ProfileRead() {
</Card>
</div>
))}

<br />
<Grid item xs={12}>
<Button color="primary" variant="contained" onClick={handleEdit} sx={{ m: 1 }}>
EDIT
</Button>
</Grid>
</Dashboard>
);
}
10 changes: 10 additions & 0 deletions frontend/src/pages/SubscriberList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ function SubscriberList(props: Props) {
navigation("/subscriber/" + subscriber.ueId + "/" + subscriber.plmnID);
};

const handleEdit = (subscriber: Subscriber) => {
navigation("/subscriber/create/" + subscriber.ueId + "/" + subscriber.plmnID);
};

const filteredData = data.filter((subscriber) =>
subscriber.ueId?.toLowerCase().includes(searchTerm.toLowerCase()) ||
subscriber.plmnID?.toLowerCase().includes(searchTerm.toLowerCase())
Expand Down Expand Up @@ -162,6 +166,7 @@ function SubscriberList(props: Props) {
<TableCell>UE ID</TableCell>
<TableCell>Delete</TableCell>
<TableCell>View</TableCell>
<TableCell>Edit</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand All @@ -183,6 +188,11 @@ function SubscriberList(props: Props) {
VIEW
</Button>
</TableCell>
<TableCell>
<Button color="primary" variant="contained" onClick={() => handleEdit(row)}>
EDIT
</Button>
</TableCell>
</TableRow>
))}
</TableBody>
Expand Down
19 changes: 13 additions & 6 deletions frontend/src/pages/SubscriberRead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,19 @@ export default function SubscriberRead() {

return (
<Dashboard title="Subscription" refreshAction={() => {}}>
<Grid
item
xs={12}
sx={{
display: 'flex',
justifyContent: 'flex-end'
}}
>
<Button color="primary" variant="contained" onClick={handleEdit} sx={{ m: 1 }}>
EDIT
</Button>
</Grid>
<br />
<Card variant="outlined">
<Table>
<TableBody>
Expand Down Expand Up @@ -343,12 +356,6 @@ export default function SubscriberRead() {
</Card>
</div>
))}
<br />
<Grid item xs={12}>
<Button color="primary" variant="contained" onClick={handleEdit} sx={{ m: 1 }}>
EDIT
</Button>
</Grid>
</Dashboard>
);
}
Loading