Skip to content
Snippets Groups Projects

Resolve CE-1787 "Modify ioc type details"

Merged Imre Toth requested to merge CE-1787_Modify_IOC_type_details into develop
4 files
+ 160
100
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -2,22 +2,10 @@
* TemplateDetails
*/
import React from "react";
import { formatDate } from "../../common/Helper";
import {
Typography,
Link as MuiLink,
Grid,
Card,
CardContent,
Box,
Button,
CardHeader
} from "@mui/material";
import { KeyValueTable, AccessControl } from "ce-ui-common";
import { Grid, Card, CardContent, CardHeader } from "@mui/material";
import { KeyValueTable } from "ce-ui-common";
import { IocInstancesTable } from "../IocInstancesTable";
import { useNavigate } from "react-router-dom";
import { object } from "prop-types";
import { OperationsTable } from "../OperationsTable/OperationsTable";
const propTypes = {
/** Object containing data from selected template */
@@ -26,36 +14,7 @@ const propTypes = {
export function TemplateDetails({ template }) {
const templateDetails = {
"IOC type": template.name,
"template repository": (
<Typography>
<MuiLink
href={template.type_project_url}
target="_blank"
rel="noreferrer"
>
{template.type_project_url}
</MuiLink>
</Typography>
),
"configuration repository": (
<Typography>
<MuiLink
href={template.configuration_project_url}
target="_blank"
rel="noreferrer"
>
{template.configuration_project_url}
</MuiLink>
</Typography>
),
"registered by": template.owner,
"creation time": formatDate(template.created_at)
};
const navigate = useNavigate();
const goGenerate = () => {
navigate("/generate?typeId=" + template.id);
"IOC type": template.name
};
return (
@@ -64,33 +23,6 @@ export function TemplateDetails({ template }) {
spacing={1}
width="100%"
>
<Grid
item
xs={12}
md={12}
>
<AccessControl
allowedRoles={[
"CE_TemplatingToolAdmin",
"CE_TemplatingToolIntegrator"
]}
renderNoAccess={() => <></>}
>
<Box
display="flex"
flexDirection="row-reverse"
p={2}
m={1}
>
<Button
variant="contained"
onClick={goGenerate}
>
Generate new revision(s)
</Button>
</Box>
</AccessControl>
</Grid>
<Grid
item
xs={12}
@@ -116,21 +48,6 @@ export function TemplateDetails({ template }) {
</CardContent>
</Card>
</Grid>
<Grid
item
xs={12}
md={12}
>
<Card>
<CardHeader
title="Operations"
titleTypographyProps={{ variant: "h3", component: "h2" }}
/>
<CardContent>
<OperationsTable templateId={template.id} />
</CardContent>
</Card>
</Grid>
</Grid>
);
}
Loading