From 999e2c20fd00dfc57731b9f5cb41c56c1ea25ab6 Mon Sep 17 00:00:00 2001 From: cjenkscybercom <christina.jenks@knowit.se> Date: Fri, 3 Nov 2023 11:52:47 +0100 Subject: [PATCH] CE-2213: remove job type from job list view --- src/views/jobs/JobListView.js | 70 ++--------------------------------- 1 file changed, 4 insertions(+), 66 deletions(-) diff --git a/src/views/jobs/JobListView.js b/src/views/jobs/JobListView.js index c9933ad1..93606698 100644 --- a/src/views/jobs/JobListView.js +++ b/src/views/jobs/JobListView.js @@ -1,5 +1,5 @@ import React, { useContext, useCallback, useMemo } from "react"; -import { Grid, TextField, Autocomplete } from "@mui/material"; +import { Box } from "@mui/material"; import { RootPaper, useAPIMethod } from "@ess-ics/ce-ui-common"; import { initRequestParams } from "../../components/common/Helper"; import { useEffect } from "react"; @@ -13,13 +13,6 @@ import { usePagination } from "../../hooks/pagination"; import { JobTable } from "../../components/Job/JobTable"; import { apiContext } from "../../api/DeployApi"; -const jobTypeOptions = [ - { label: "Show all" }, - { label: "Only deployments", filter: "DEPLOYMENT" }, - { label: "Only commands", filter: "COMMAND" } -]; -const defaultJobTypeOption = jobTypeOptions[0]; - export function JobListView() { const client = useContext(apiContext); @@ -38,8 +31,7 @@ export function JobListView() { { rows: "20", page: "0", - query: "", - job_type: null + query: "" }, { navigateMode: "replace" } ); @@ -92,16 +84,12 @@ export function JobListView() { deserialize(urlState.query) ); - if (urlState.job_type) { - requestParams.type = deserialize(urlState.job_type); - } - getOperations(requestParams); return () => { abort(); }; - }, [getOperations, urlPagination, urlState.query, urlState.job_type, abort]); + }, [getOperations, urlPagination, urlState.query, abort]); const setSearch = useCallback( (query) => { @@ -134,57 +122,7 @@ export function JobListView() { return ( <RootPaper> - <Grid - container - spacing={1} - > - <Grid - container - spacing={1} - justifyContent="flex-end" - alignItems="center" - style={{ display: "flex" }} - > - <Grid - item - xs={3} - > - <Autocomplete - id="combo-box-demo" - options={jobTypeOptions} - defaultValue={ - urlState.job_type - ? jobTypeOptions.find( - (o) => o.filter === urlState.job_type - ) || defaultJobTypeOption - : defaultJobTypeOption - } - getOptionLabel={(option) => option.label} - isOptionEqualToValue={(option, value) => - option.label === value.label - } - renderInput={(params) => ( - <TextField - {...params} - label="Job type" - variant="outlined" - /> - )} - onChange={(event, value, reason) => - setUrlState({ job_type: value?.filter }) - } - autoSelect - /> - </Grid> - </Grid> - <Grid - item - xs={12} - md={12} - > - {content} - </Grid> - </Grid> + <Box paddingY={2}>{content}</Box> </RootPaper> ); } -- GitLab