CEC-2579 Add ability to edit manifest (#226)
This commit is contained in:
@@ -31,6 +31,7 @@ import { Roles, hasRole } from "../../../utils/roles";
|
||||
import { useLocalStorage } from "../../useLocalStorage";
|
||||
import { TYPE_MANIFEST_SOFTWARE } from "../../../utils/manifest_types";
|
||||
import DeleteConfirmation from "../../DeleteConfirmation";
|
||||
import EditIcon from "@material-ui/icons/Edit";
|
||||
|
||||
const tableColumns = [
|
||||
{
|
||||
@@ -45,6 +46,10 @@ const tableColumns = [
|
||||
id: "version",
|
||||
label: "Version",
|
||||
},
|
||||
{
|
||||
id: "type",
|
||||
label: "Type",
|
||||
},
|
||||
{
|
||||
id: "created_at",
|
||||
label: "Created",
|
||||
@@ -59,6 +64,15 @@ const tableColumns = [
|
||||
},
|
||||
];
|
||||
|
||||
const formatManifestType = (type) => {
|
||||
switch (type) {
|
||||
case "forced":
|
||||
return "Forced";
|
||||
default:
|
||||
return "Standard";
|
||||
}
|
||||
}
|
||||
|
||||
const PAGE_SIZE = "MANIFEST_LIST_PAGE_SIZE";
|
||||
|
||||
const MainForm = () => {
|
||||
@@ -161,6 +175,12 @@ const MainForm = () => {
|
||||
icon: (
|
||||
<VisibilityIcon aria-label={`Status ${row.name} ${row.version}`} />
|
||||
),
|
||||
}, {
|
||||
tip: `Update "${row.name} ${row.version}"`,
|
||||
link: `/package-update/${row.id}`,
|
||||
icon: (
|
||||
<EditIcon aria-label={`Update ${row.name} ${row.version}`} />
|
||||
),
|
||||
});
|
||||
}
|
||||
if (hasRole([Roles.CREATE], groups)) {
|
||||
@@ -237,6 +257,7 @@ const MainForm = () => {
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell align="center">{row.version}</TableCell>
|
||||
<TableCell align="center">{formatManifestType(row.type)}</TableCell>
|
||||
<TableCell align="center">
|
||||
{LocalDateTimeString(row.created)}
|
||||
</TableCell>
|
||||
|
||||
Reference in New Issue
Block a user