Skip to content
Snippets Groups Projects
Commit 3d740798 authored by Zoltan Runyo's avatar Zoltan Runyo
Browse files

ICSHWI-9610: IOC details deployment history, fix job table sort by time

parent 46f889d4
No related branches found
No related tags found
4 merge requests!270Merging develop branch to master in order to create RC,!222Fixing missing time interval parameter for logs,!202Merging develop to master,!194Unify deployment and command logs (Job Log) ICSHWI-9610
...@@ -288,13 +288,13 @@ export function unpackDeployment(deployment) { ...@@ -288,13 +288,13 @@ export function unpackDeployment(deployment) {
export function unpackDeploymentList(deployments) { export function unpackDeploymentList(deployments) {
let deploymentArr = deployments.deployments.map(d => unpackDeployment(d)); let deploymentArr = deployments.operations.map(d => unpackDeployment(d));
let unpackedDeploymentList = { let unpackedDeploymentList = {
totalCount: deployments.totalCount, totalCount: deployments.totalCount,
pageNumber: deployments.pageNumber, pageNumber: deployments.pageNumber,
limit: deployments.limit, limit: deployments.limit,
deploymentList: deploymentArr operationsList: deploymentArr
}; };
return unpackedDeploymentList; return unpackedDeploymentList;
...@@ -311,9 +311,9 @@ export function useDeploymentListForIOC() { ...@@ -311,9 +311,9 @@ export function useDeploymentListForIOC() {
const api = useContext(apiContext); const api = useContext(apiContext);
const method = useCallAndUnpack( const method = useCallAndUnpack(
(iocId, page, limit) => api.apis.Deployments.listDeployments({ ioc_id: iocId, page: page, limit: limit }), (iocId, page, limit) => api.apis.Deployments.listDeployments({ ioc_id: iocId, page: page, limit: limit }),
unpackDeploymentList unpackOperationsList
); );
return useAsync({ fcn: method, call: false, init: emptyDeploymentListResponse }); return useAsync({ fcn: method, call: false, init: emptyOperationsListResponse });
} }
export function unpackCommand(command) { export function unpackCommand(command) {
......
...@@ -6,10 +6,10 @@ import { UndeployIOC } from "../../components/IOC/UndeployIOC"; ...@@ -6,10 +6,10 @@ import { UndeployIOC } from "../../components/IOC/UndeployIOC";
import { SimpleModal } from "../../components/common/SimpleModal/SimpleModal"; import { SimpleModal } from "../../components/common/SimpleModal/SimpleModal";
import { useUpdateAndDeployIoc, useCreateUndeployment, useDeploymentListForIOC } from "../../api/SwaggerApi"; import { useUpdateAndDeployIoc, useCreateUndeployment, useDeploymentListForIOC } from "../../api/SwaggerApi";
import AlertMessages from "./AlertMessages"; import AlertMessages from "./AlertMessages";
import { DeploymentAsyncList } from "../../components/deployments/DeploymentAsyncList";
import { SimpleAccordion } from "../common/Accordion/SimpleAccordion"; import { SimpleAccordion } from "../common/Accordion/SimpleAccordion";
import { initRequestParams } from "../common/Helper"; import { initRequestParams } from "../common/Helper";
import AccessControl from "../auth/AccessControl"; import AccessControl from "../auth/AccessControl";
import { JobAsyncList } from "../Job/JobAsyncList";
export function IOCManage({ ioc, getIOC, buttonDisabled }) { export function IOCManage({ ioc, getIOC, buttonDisabled }) {
const [deployDialogOpen, setDeployDialogOpen] = useState(false); const [deployDialogOpen, setDeployDialogOpen] = useState(false);
...@@ -31,7 +31,7 @@ export function IOCManage({ ioc, getIOC, buttonDisabled }) { ...@@ -31,7 +31,7 @@ export function IOCManage({ ioc, getIOC, buttonDisabled }) {
const rowsPerPage = [5, 20]; const rowsPerPage = [5, 20];
useEffect(() => { useEffect(() => {
setDeploymentList(deployments.deploymentList); setDeploymentList(deployments.operationsList);
}, [deployments, setDeploymentList]) }, [deployments, setDeploymentList])
useEffect(() => useEffect(() =>
...@@ -42,7 +42,7 @@ export function IOCManage({ ioc, getIOC, buttonDisabled }) { ...@@ -42,7 +42,7 @@ export function IOCManage({ ioc, getIOC, buttonDisabled }) {
requestParams.ioc_id = ioc.id; requestParams.ioc_id = ioc.id;
if(columnSort.sortField === "start") { if(columnSort.sortField === "start") {
requestParams.order_by = "START_TIME"; requestParams.order_by = "TIME";
} }
if(columnSort.sortField === "user") { if(columnSort.sortField === "user") {
...@@ -139,7 +139,7 @@ export function IOCManage({ ioc, getIOC, buttonDisabled }) { ...@@ -139,7 +139,7 @@ export function IOCManage({ ioc, getIOC, buttonDisabled }) {
<AccessControl allowedRoles={["DeploymentToolAdmin", "DeploymentToolIntegrator"]} <AccessControl allowedRoles={["DeploymentToolAdmin", "DeploymentToolIntegrator"]}
renderNoAccess={() => <></>}> renderNoAccess={() => <></>}>
<SimpleAccordion summary="Deployment log"> <SimpleAccordion summary="Deployment log">
<DeploymentAsyncList deployments={deploymentList} setDeployments={setDeploymentList} totalCount={deployments.totalCount} <JobAsyncList jobs={deploymentList} setJobs={setDeploymentList} totalCount={deployments.totalCount}
lazyParams={lazyParams} setLazyParams={setLazyParams} columnSort={columnSort} setColumnSort={setColumnSort} lazyParams={lazyParams} setLazyParams={setLazyParams} columnSort={columnSort} setColumnSort={setColumnSort}
rowsPerPage={rowsPerPage} /> rowsPerPage={rowsPerPage} />
</SimpleAccordion> </SimpleAccordion>
......
...@@ -77,7 +77,7 @@ export function DeploymentsView() { ...@@ -77,7 +77,7 @@ export function DeploymentsView() {
} }
if (columnSort.sortField === "start") { if (columnSort.sortField === "start") {
requestParams.order_by = "START_TIME"; requestParams.order_by = "TIME";
} }
if (columnSort.sortField === "user") { if (columnSort.sortField === "user") {
......
...@@ -81,7 +81,7 @@ export function JobListView() { ...@@ -81,7 +81,7 @@ export function JobListView() {
} }
if (columnSort.sortField === "start") { if (columnSort.sortField === "start") {
requestParams.order_by = "START_TIME"; requestParams.order_by = "TIME";
} }
if (columnSort.sortField === "user") { if (columnSort.sortField === "user") {
...@@ -141,12 +141,13 @@ export function JobListView() { ...@@ -141,12 +141,13 @@ export function JobListView() {
<Grid item xs={3}> <Grid item xs={3}>
<Autocomplete <Autocomplete
id="combo-box-demo" id="combo-box-demo"
options={[{label: "Show all", filter: null}, {label: "Only deployments", filter: "DEPLOYMENT"}, {label: "Only commands", filter: "COMMAND"}]} options={[{label: "Show all"}, {label: "Only deployments", filter: "DEPLOYMENT"}, {label: "Only commands", filter: "COMMAND"}]}
defaultValue = { {label: "Show all"} }
getOptionLabel={(option) => option.label} getOptionLabel={(option) => option.label}
getOptionSelected={(option, value) => option.label === value.label} getOptionSelected={(option, value) => option.label === value.label}
style={{ width: "100%" }} style={{ width: "100%" }}
renderInput={(params) => <TextField {...params} label="Job type" variant="outlined" />} renderInput={(params) => <TextField {...params} label="Job type" variant="outlined" />}
onChange={(event, value, reason) => setJobType(value.filter)} onChange={(event, value, reason) => setJobType(value?.filter)}
autoSelect autoSelect
/> />
</Grid> </Grid>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment