From 6499d35c10d3c6daed61cb1226a574cc958bb2ba Mon Sep 17 00:00:00 2001 From: Marcus Oskarsson Date: Tue, 29 Aug 2023 17:00:03 +0200 Subject: [PATCH] lint --- ui/src/actions/taskForm.js | 6 +-- ui/src/components/SampleView/SampleImage.jsx | 54 ++++++++++---------- ui/src/containers/TaskContainer.js | 7 +-- 3 files changed, 32 insertions(+), 35 deletions(-) diff --git a/ui/src/actions/taskForm.js b/ui/src/actions/taskForm.js index 24413a177..9bcce319e 100644 --- a/ui/src/actions/taskForm.js +++ b/ui/src/actions/taskForm.js @@ -2,7 +2,7 @@ export function showForm( formName, sampleQueueID = [], taskData = {}, - pointQueueID = -1, + pointQueueID = -1 ) { return { type: 'SHOW_FORM', @@ -17,7 +17,7 @@ export function showTaskForm( formName, sampleQueueID = -1, taskData = {}, - pointQueueID = -1, + pointQueueID = -1 ) { return function (dispatch) { dispatch(showForm(formName, sampleQueueID, taskData, pointQueueID)); @@ -28,4 +28,4 @@ export function hideTaskParametersForm() { return { type: 'HIDE_FORM', }; -} \ No newline at end of file +} diff --git a/ui/src/components/SampleView/SampleImage.jsx b/ui/src/components/SampleView/SampleImage.jsx index b476b6cd3..6a37fdc8d 100644 --- a/ui/src/components/SampleView/SampleImage.jsx +++ b/ui/src/components/SampleView/SampleImage.jsx @@ -52,7 +52,7 @@ export default class SampleImage extends React.Component { this.canvas = {}; this.drawGridPlugin = new DrawGridPlugin(); this.drawGridPlugin.setGridResultFormat( - process.env.REACT_APP_MESHRESULTFORMAT, + process.env.REACT_APP_MESHRESULTFORMAT ); this._keyPressed = null; this.gridStarted = false; @@ -179,25 +179,25 @@ export default class SampleImage extends React.Component { (options.e.layerX + 1.5) / this.props.imageRatio, (options.e.layerY + 1) / this.props.imageRatio, this.props.imageRatio, - this.canvas.height, + this.canvas.height ); this.centringHorizontalLine = makeCentringHorizontalLine( (options.e.layerX + 1.5) / this.props.imageRatio, (options.e.layerY + 1) / this.props.imageRatio, this.props.imageRatio, - this.canvas.width, + this.canvas.width ); this.canvas.add(this.centringVerticalLine); this.canvas.add(this.centringHorizontalLine); } - - if (options.e.buttons > 0 && this.drawGridPlugin.drawing) { + + if (options.e.buttons > 0 && this.drawGridPlugin.drawing) { this.drawGridPlugin.update( this.canvas, options.e.layerX, - options.e.layerY, + options.e.layerY ); } @@ -232,14 +232,14 @@ export default class SampleImage extends React.Component { gridData, true, gridData.cellHSpace, - value, + value ); this.props.sampleActions.sendUpdateShapes([gd]); } else if (this.props.drawGrid) { this.drawGridPlugin.setCurrentCellSpace( null, value, - this.props.imageRatio, + this.props.imageRatio ); this.drawGridPlugin.repaint(this.canvas); } @@ -258,14 +258,14 @@ export default class SampleImage extends React.Component { gridData, true, value, - gridData.cellVSpace, + gridData.cellVSpace ); this.props.sampleActions.sendUpdateShapes([gd]); } else if (this.props.drawGrid) { this.drawGridPlugin.setCurrentCellSpace( value, null, - this.props.imageRatio, + this.props.imageRatio ); this.drawGridPlugin.repaint(this.canvas); } @@ -351,7 +351,7 @@ export default class SampleImage extends React.Component { } this.props.selectedShapes.forEach((shapeID) => - this.props.sampleActions.sendDeleteShape(shapeID), + this.props.sampleActions.sendDeleteShape(shapeID) ); } @@ -456,7 +456,7 @@ export default class SampleImage extends React.Component { const gridData = this.props.grids[gridList[0]]; const cellCenter = this.getGridCellCenter( group.getObjects()[0], - clickPoint, + clickPoint ); ctxMenuObj = { type: 'GridGroupSaved', @@ -558,12 +558,12 @@ export default class SampleImage extends React.Component { if (clickCentring) { sampleActions.sendCentringPoint( option.e.layerX / imageRatio, - option.e.layerY / imageRatio, + option.e.layerY / imageRatio ); } else if (measureDistance) { sampleActions.addDistancePoint( option.e.layerX / imageRatio, - option.e.layerY / imageRatio, + option.e.layerY / imageRatio ); } else if (this.props.drawGrid) { this.drawGridPlugin.startDrawing(option, this.canvas, imageRatio); @@ -573,13 +573,13 @@ export default class SampleImage extends React.Component { const cellIdxX = parseInt( Math.floor((option.pointer.x - option.target.oCoords.tl.x) / cellSizeX), - 10, + 10 ); const cellIdxY = parseInt( Math.floor( - (option.pointer.y - option.target.oCoords.tl.y - 20) / cellSizeY, + (option.pointer.y - option.target.oCoords.tl.y - 20) / cellSizeY ), - 10, + 10 ); const shapeData = this.props.shapes[objectFound.id]; @@ -588,13 +588,13 @@ export default class SampleImage extends React.Component { cellIdxY, cellIdxX, shapeData.numRows, - shapeData.numCols, + shapeData.numCols ); const resultDataPath = shapeData.resultDataPath; if (resultDataPath.length !== 0) { this.props.generalActions.sendDisplayImage( - `${resultDataPath}&img_num=${imgNum}`, + `${resultDataPath}&img_num=${imgNum}` ); } } @@ -617,13 +617,13 @@ export default class SampleImage extends React.Component { // zoom in sendMotorPosition( 'Phi', - phi.value + Number.parseInt(motorSteps.phiStep, 10), + phi.value + Number.parseInt(motorSteps.phiStep, 10) ); } else if (e.deltaX < 0 || e.deltaY < 0) { // zoom out sendMotorPosition( 'Phi', - phi.value - Number.parseInt(motorSteps.phiStep, 10), + phi.value - Number.parseInt(motorSteps.phiStep, 10) ); } } else if (keyPressed === 'f' && focus.state === MOTOR_STATE.READY) { @@ -631,13 +631,13 @@ export default class SampleImage extends React.Component { // Focus in sendMotorPosition( 'Focus', - focus.value + Number.parseFloat(motorSteps.focusStep, 10), + focus.value + Number.parseFloat(motorSteps.focusStep, 10) ); } else if (e.deltaY < 0) { // Focus out sendMotorPosition( 'Focus', - focus.value - Number.parseFloat(motorSteps.focusStep, 10), + focus.value - Number.parseFloat(motorSteps.focusStep, 10) ); } } else if (keyPressed === 'z' && zoom.state === MOTOR_STATE.READY) { @@ -767,7 +767,7 @@ export default class SampleImage extends React.Component { saveGrid() { const gd = this.drawGridPlugin.saveGrid( - this.drawGridPlugin.currentGridData(), + this.drawGridPlugin.currentGridData() ); this.props.sampleActions.sendAddShape({ t: 'G', ...gd }); this.drawGridPlugin.reset(); @@ -877,8 +877,8 @@ export default class SampleImage extends React.Component { beamSize, clickCentring, distancePoints, - this.canvas, - ), + this.canvas + ) ); if ( @@ -909,7 +909,7 @@ export default class SampleImage extends React.Component { gridData = this.drawGridPlugin.setPixelsPerMM(pixelsPerMm, gridData); fabricSelectables.push( this.drawGridPlugin.shapeFromGridData(gridData, this.canvas) - .shapeGroup, + .shapeGroup ); } }); diff --git a/ui/src/containers/TaskContainer.js b/ui/src/containers/TaskContainer.js index 7d74f3695..1ba0f17d9 100644 --- a/ui/src/containers/TaskContainer.js +++ b/ui/src/containers/TaskContainer.js @@ -13,10 +13,7 @@ import XRFScan from '../components/Tasks/XRFScan'; import EnergyScan from '../components/Tasks/EnergyScan'; import GenericTaskForm from '../components/Tasks/GenericTaskForm'; -import { - hideTaskParametersForm, - showTaskForm, -} from '../actions/taskForm'; +import { hideTaskParametersForm, showTaskForm } from '../actions/taskForm'; import { addTask, @@ -288,7 +285,7 @@ function mapDispatchToProps(dispatch) { showTaskParametersForm: bindActionCreators(showTaskForm, dispatch), hideTaskParametersForm: bindActionCreators( hideTaskParametersForm, - dispatch, + dispatch ), updateTask: bindActionCreators(updateTask, dispatch), addTask: bindActionCreators(addTask, dispatch),