Skip to content

Commit

Permalink
Lint- removed unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-oscarsson committed Oct 10, 2023
1 parent 7d2ee5a commit 7c40a4e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
6 changes: 3 additions & 3 deletions ui/src/components/SampleView/shapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ export function makeLine(
wid,
select,
id,
hover = 'crosshair',
text,
type,
hover = 'crosshair',
) {
return new fabric.Line([x1, y1, x2, y2], {
fill: col,
Expand Down Expand Up @@ -252,7 +252,7 @@ export function makeBeam(posX, posY, sizeX, sizeY, shape) {
makeLine(posX + 3, posY, posX + 10, posY, 'rgba(0, 255, 255, 1)', 2, false),
makeLine(posX, posY + 3, posX, posY + 10, 'rgba(0, 255, 255, 1)', 2, false),
shape === 'ellipse'
? makeElipse(posX, posY, sizeX, sizeY, 'rgba(0, 255, 255)', 5)
? makeElipse(posX, posY, sizeX, sizeY, 'rgba(0, 255, 255)')
: makeRectangle(posX, posY, sizeX, sizeY, 'rgba(0, 255, 255, 1)'),
];
}
Expand Down Expand Up @@ -373,9 +373,9 @@ export function pointLine(
width,
selectable,
id,
cursor,
text,
'LINE',
cursor,
);
const arrow = makeArrow(line, color, selectable, id);
const anchor = makeAnchor(line, color, selectable, id);
Expand Down
13 changes: 1 addition & 12 deletions ui/src/containers/TaskContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,13 @@ class TaskContainer extends React.Component {
}

render() {
const [points, lines, grids] = [{}, {}, {}];
const lines = {};
if (typeof this.props.shapes !== 'undefined') {
Object.keys(this.props.shapes).forEach((key) => {
const shape = this.props.shapes[key];
switch (shape.t) {
case 'P': {
points[shape.id] = shape;

break;
}
case 'L': {
lines[shape.id] = shape;

break;
}
case 'G': {
grids[shape.id] = shape;

break;
}
// No default
Expand Down
10 changes: 0 additions & 10 deletions ui/src/reducers/queueGUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,16 @@ function queueGUIReducer(state = INITIAL_STATE, action = {}) {
case 'SET_QUEUE': {
const displayData = { ...state.displayData };
const existingNodes = Object.keys(state.displayData);
const sourceNodes = [];
const newNodes = [];

action.sampleOrder.forEach((sampleID) => {
if (sampleID in action.sampleList) {
action.sampleList[sampleID].tasks.forEach((task) => {
if (!existingNodes.includes(task.queueID.toString())) {
newNodes.push(task.queueID.toString());
displayData[task.queueID] = {
collapsed: false,
selected: false,
progress: 0,
};
}
sourceNodes.push(task.queueID.toString());
});
}
});
Expand Down Expand Up @@ -120,23 +115,18 @@ function queueGUIReducer(state = INITIAL_STATE, action = {}) {
const sampleList = { ...action.data.queue.sampleList.sampleList };
const sampleOrder = [...action.data.queue.sampleList.sampleOrder];
const displayData = { ...state.displayData };

const existingNodes = Object.keys(state.displayData);
const sourceNodes = [];
const newNodes = [];

sampleOrder.forEach((sampleID) => {
if (sampleID in sampleList) {
sampleList[sampleID].tasks.forEach((task) => {
if (!existingNodes.includes(task.queueID.toString())) {
newNodes.push(task.queueID.toString());
displayData[task.queueID] = {
collapsed: false,
selected: false,
progress: 0,
};
}
sourceNodes.push(task.queueID.toString());
});
}
});
Expand Down
5 changes: 4 additions & 1 deletion ui/src/reducers/sampleGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ function sampleGridReducer(state = INITIAL_STATE, action = {}) {
const sampleList = { ...state.sampleList };
sampleIDList.forEach((sampleID, i) => {
if (sampleList[sampleID].tasks.length > 0) {
sampleList[sampleID].tasks.concat(action.samplesData[i].tasks);
sampleList[sampleID].tasks = [
...sampleList[sampleID].tasks,
...action.samplesData[i].tasks,
];
} else {
sampleList[sampleID].tasks = action.samplesData[i].tasks;
}
Expand Down

0 comments on commit 7c40a4e

Please sign in to comment.