diff --git a/src/components/Filters.tsx b/src/components/Filters.tsx index be9912c1..81bc61e2 100644 --- a/src/components/Filters.tsx +++ b/src/components/Filters.tsx @@ -7,7 +7,6 @@ import { FormControl, InputLabel, Button, - Box, } from "@material-ui/core"; import { TestRun, TestVariation } from "../types"; import { DebounceInput } from "react-debounce-input"; @@ -43,10 +42,10 @@ const Filters: React.FunctionComponent = ({ const [customTags, setCustomTags] = customTagsState; const [testStatus, setTestStatus] = testStatusState ? testStatusState - : [null, () => { }]; + : [null, () => {}]; const [branchName, setBranchName] = branchNameState ? branchNameState - : [null, () => { }]; + : [null, () => {}]; const osList = items .map((t) => t.os) @@ -82,210 +81,204 @@ const Filters: React.FunctionComponent = ({ .filter((v, i, array) => v && array.indexOf(v) === i); return ( - - + + + setQuery(event?.target.value)} + /> + + {osList.length > 0 && ( - setQuery(event?.target.value)} - /> - - {osList.length > 0 && ( - - - - OS - - setOs(event.target.value as string)} + > + + All + + {osList.map((os) => ( + + {os} - {osList.map((os) => ( - - {os} - - ))} - - - - )} - {deviceList.length > 0 && ( - - - - Device - - + + + )} + {deviceList.length > 0 && ( + + + + Device + + - - - )} - {browserList.length > 0 && ( - - - - Browser - - + + + )} + {browserList.length > 0 && ( + + + + Browser + + - - - )} - {viewportList.length > 0 && ( - - - - Viewport - - + + + )} + {viewportList.length > 0 && ( + + + + Viewport + + - - - )} - {customTagsList.length > 0 && ( - - - - Custom Tags - - + + + )} + {customTagsList.length > 0 && ( + + + + Custom Tags + + - - - )} - {testStatusList && testStatusList.length > 0 && ( - - - - Status - - + + + )} + {testStatusList && testStatusList.length > 0 && ( + + + + Status + + - - - )} - {branchNameList && branchNameList.length > 0 && ( - - - - Branch - - + + + )} + {branchNameList && branchNameList.length > 0 && ( + + + + Branch + + - - - )} - - + ))} + + + )} + + - + ); }; diff --git a/src/components/TestRunList/BulkOperation.tsx b/src/components/TestRunList/BulkOperation.tsx index 5f9c2ae1..a1b43294 100644 --- a/src/components/TestRunList/BulkOperation.tsx +++ b/src/components/TestRunList/BulkOperation.tsx @@ -7,6 +7,7 @@ import { } from "@material-ui/core"; import { GridRowData, + GridRowId, GridSelectionState, useGridSlotComponentProps, } from "@material-ui/data-grid"; @@ -27,8 +28,8 @@ export const BulkOperation: React.FunctionComponent = () => { false ); const [isProcessing, setIsProcessing] = React.useState(false); - const ids: string[] = React.useMemo( - () => Object.keys(props.state.selection), + const ids: GridRowId[] = React.useMemo( + () => Object.values(props.state.selection), [props.state.selection] ); const isMerge: boolean = React.useMemo( diff --git a/src/components/TestVariationMergeForm.tsx b/src/components/TestVariationMergeForm.tsx index bad7bcb7..331e9de8 100644 --- a/src/components/TestVariationMergeForm.tsx +++ b/src/components/TestVariationMergeForm.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Grid, Select, MenuItem, Button } from "@material-ui/core"; +import { Grid, Select, MenuItem, Button, TextField } from "@material-ui/core"; import { testVariationService } from "../services"; import { useHistory } from "react-router-dom"; import { @@ -8,6 +8,7 @@ import { } from "../_helpers/route.helpers"; import { useSnackbar } from "notistack"; import { selectBuild, useBuildDispatch } from "../contexts"; +import { Autocomplete } from "@material-ui/lab"; interface IProps { projectId: string; @@ -21,12 +22,13 @@ export const TestVariationMergeForm: React.FunctionComponent = ({ const history = useHistory(); const buildDispatch = useBuildDispatch(); const { enqueueSnackbar } = useSnackbar(); - const [branch, setBranch] = React.useState(""); + const [fromBranch, setFromBranch] = React.useState(""); + const [toBranch, setToBranch] = React.useState(""); const handleSubmit = (event: React.FormEvent) => { event.preventDefault(); testVariationService - .merge(projectId, branch) + .merge(projectId, fromBranch, toBranch) .then((build) => { enqueueSnackbar(`Merge started in build: ${build.id}`, { variant: "success", @@ -46,15 +48,17 @@ export const TestVariationMergeForm: React.FunctionComponent = ({ return (
- - + + + + ({ title: i }))} + getOptionLabel={(option) => option.title} + freeSolo + fullWidth + renderInput={(params) => ( + + )} + onInputChange={(_, value) => { + setToBranch(value); + }} + /> +