diff --git a/src/components/ProjectForm/ProjectForm.tsx b/src/components/ProjectForm/ProjectForm.tsx index 09c00dfa..c167ba58 100644 --- a/src/components/ProjectForm/ProjectForm.tsx +++ b/src/components/ProjectForm/ProjectForm.tsx @@ -94,6 +94,26 @@ export const ProjectForm: React.FunctionComponent = () => { }); }} /> + { + const value = (event.target as HTMLInputElement).value; + setProjectEditState(projectDispatch, { + ...project, + maxBranchLifetime: parseInt(value), + }); + }} + /> { const scale = image ? Math.min( - stageWidth < image.width ? stageWidth / image.width : 1, - stageHeigth < image.height ? stageHeigth / image.height : 1 - ) + stageWidth < image.width ? stageWidth / image.width : 1, + stageHeigth < image.height ? stageHeigth / image.height : 1 + ) : 1; setStageScale(scale); resetPositioin(); @@ -190,23 +187,36 @@ const TestDetailsModal: React.FunctionComponent<{ let newIgnoreArea = ignoreAreas.find((area) => selectedRectId! === area.id); if (newIgnoreArea) { setProcessing(true); - testRunService.getList(testRun.buildId).then( - (testRuns: TestRun[]) => { + testRunService + .getList(testRun.buildId) + .then((testRuns: TestRun[]) => { let allIds = testRuns.map((item) => item.id); - let data: UpdateIgnoreAreaDto = { ids: allIds, ignoreAreas: [newIgnoreArea!] }; + let data: UpdateIgnoreAreaDto = { + ids: allIds, + ignoreAreas: [newIgnoreArea!], + }; testRunService.addIgnoreAreas(data).then(() => { setProcessing(false); setSelectedRectId(undefined); - enqueueSnackbar("Ignore areas are updated in all images in this build.", { - variant: "success", - }); + enqueueSnackbar( + "Ignore areas are updated in all images in this build.", + { + variant: "success", + } + ); + }); + }) + .catch((error) => { + enqueueSnackbar("There was an error : " + error, { + variant: "error", }); - }).catch((error) => { - enqueueSnackbar("There was an error : " + error, { variant: "error" }); setProcessing(false); }); } else { - enqueueSnackbar("There was an error determining which ignore area to apply.", { variant: "error" }); + enqueueSnackbar( + "There was an error determining which ignore area to apply.", + { variant: "error" } + ); } }; @@ -265,10 +275,10 @@ const TestDetailsModal: React.FunctionComponent<{ )} {(testRun.status === TestStatus.unresolved || testRun.status === TestStatus.new) && ( - - - - )} + + + + )} @@ -277,7 +287,7 @@ const TestDetailsModal: React.FunctionComponent<{ - {(processing) && } + {processing && } @@ -349,13 +359,14 @@ const TestDetailsModal: React.FunctionComponent<{ - + - applyIgnoreArea() - } + onClick={() => applyIgnoreArea()} > @@ -374,6 +385,7 @@ const TestDetailsModal: React.FunctionComponent<{