Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 13 additions & 25 deletions ui/src/actions/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@ import { mountSample } from './sampleChanger';
import { clearSampleGrid, selectSamplesAction } from './sampleGrid';
import { abortCentring, updateShapes } from './sampleview';

export function queueLoading(loading) {
function queueLoading(loading) {
return { type: 'QUEUE_LOADING', loading };
}

export function clearAll() {
return { type: 'CLEAR_ALL' };
}

export function setQueueAction(queue) {
function setQueueAction(queue) {
const { sampleOrder, sampleList } = queue;
return { type: 'SET_QUEUE', sampleOrder, sampleList };
}
Expand All @@ -56,27 +52,23 @@ export function setQueue(queue) {
};
}

export function setCentringMethodAction(centringMethod) {
function setCentringMethodAction(centringMethod) {
return { type: 'SET_CENTRING_METHOD', centringMethod };
}

export function setQueueSettingAction(settingName, value) {
function setQueueSettingAction(settingName, value) {
return { type: 'SET_QUEUE_SETTING', settingName, value };
}

export function setNumSnapshotsAction(n) {
function setNumSnapshotsAction(n) {
return { type: 'SET_NUM_SNAPSHOTS', n };
}

export function setGroupFolderAction(path) {
function setGroupFolderAction(path) {
return { type: 'SET_GROUP_FOLDER', path };
}

export function addSamplesToQueueAction(samplesData) {
return { type: 'ADD_SAMPLES_TO_QUEUE', samplesData };
}

export function removeSamplesFromQueueAction(sampleIDList) {
function removeSamplesFromQueueAction(sampleIDList) {
return { type: 'REMOVE_SAMPLES_FROM_QUEUE', sampleIDList };
}

Expand Down Expand Up @@ -119,7 +111,7 @@ export function addSampleAndMount(sampleData) {
};
}

export function clearQueueAction() {
function clearQueueAction() {
return { type: 'CLEAR_QUEUE' };
}

Expand All @@ -138,10 +130,6 @@ export function setStatus(queueState) {
return { type: 'SET_QUEUE_STATUS', queueState };
}

export function setState(queueState) {
return { type: 'QUEUE_STATE', queueState };
}

export function startQueue(autoMountNext = true, sid = -1) {
return () => sendStartQueue(autoMountNext, sid);
}
Expand Down Expand Up @@ -172,11 +160,11 @@ export function runSample(sampleID, taskIndex) {
};
}

export function removeTaskAction(sampleID, taskIndex, queueID = null) {
function removeTaskAction(sampleID, taskIndex, queueID = null) {
return { type: 'REMOVE_TASK', sampleID, taskIndex, queueID };
}

export function removeTaskListAction(taskList, queueIDList = null) {
function removeTaskListAction(taskList, queueIDList = null) {
return { type: 'REMOVE_TASKS_LIST', taskList, queueIDList };
}

Expand Down Expand Up @@ -271,7 +259,7 @@ export function addTaskAction(tasks) {
return { type: 'ADD_TASKS', tasks };
}

export function updateTaskAction(sampleID, taskIndex, taskData) {
function updateTaskAction(sampleID, taskIndex, taskData) {
return { type: 'UPDATE_TASK', sampleID, taskIndex, taskData };
}

Expand Down Expand Up @@ -428,7 +416,7 @@ export function deleteSamplesFromQueue(sampleIDList) {
};
}

export function setAutoMountAction(automount) {
function setAutoMountAction(automount) {
return { type: 'SET_AUTO_MOUNT_SAMPLE', automount };
}

Expand All @@ -448,7 +436,7 @@ export function setAutoMountSample(automount) {
};
}

export function setAutoAddDiffPlanAction(autoadd) {
function setAutoAddDiffPlanAction(autoadd) {
return { type: 'SET_AUTO_ADD_DIFFPLAN', autoadd };
}

Expand Down
11 changes: 0 additions & 11 deletions ui/src/reducers/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const INITIAL_STATE = {
groupFolder: '',
};

// eslint-disable-next-line complexity
function queueReducer(state = INITIAL_STATE, action = {}) {
switch (action.type) {
case 'SET_QUEUE': {
Expand All @@ -28,10 +27,6 @@ function queueReducer(state = INITIAL_STATE, action = {}) {
currentSampleID: null,
};
}
case 'ADD_SAMPLES_TO_QUEUE': {
const sampleIDList = action.samplesData.map((s) => s.sampleID);
return { ...state, queue: [...state.queue, ...sampleIDList] };
}
case 'SET_QUEUE_STATUS': {
return {
...state,
Expand Down Expand Up @@ -101,12 +96,6 @@ function queueReducer(state = INITIAL_STATE, action = {}) {
case 'SET_QUEUE_SETTING': {
return { ...state, [action.settingName]: action.value };
}
case 'CLEAR_ALL': {
return { ...state, ...INITIAL_STATE, autoMountNext: state.autoMountNext };
}
case 'QUEUE_STATE': {
return Object.assign({}, state, ...action.queueState);
}
case 'SET_INITIAL_STATE': {
return {
...state,
Expand Down
16 changes: 0 additions & 16 deletions ui/src/reducers/queueGUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,6 @@ function queueGUIReducer(state = INITIAL_STATE, action = {}) {

return { ...state, displayData };
}

case 'ADD_SAMPLES_TO_QUEUE': {
const displayData = { ...state.displayData };
action.samplesData.forEach((sample) => {
displayData[sample.queueID] = {
collpased: false,
selected: false,
progress: 0,
};
});

return { ...state, displayData };
}
case 'REMOVE_TASK': {
return { ...state, displayData: omit(state.displayData, action.queueID) };
}
Expand Down Expand Up @@ -134,9 +121,6 @@ function queueGUIReducer(state = INITIAL_STATE, action = {}) {

return { ...state, displayData };
}
case 'CLEAR_ALL': {
return INITIAL_STATE;
}
default: {
return state;
}
Expand Down
19 changes: 0 additions & 19 deletions ui/src/reducers/sampleGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,6 @@ function sampleGridReducer(state = INITIAL_STATE, action = {}) {
});
return { ...state, sampleList };
}
case 'ADD_SAMPLES_TO_QUEUE': {
const sampleIDList = action.samplesData.map((s) => s.sampleID);
const sampleList = { ...state.sampleList };
sampleIDList.forEach((sampleID, i) => {
if (sampleList[sampleID].tasks.length > 0) {
sampleList[sampleID].tasks = [
...sampleList[sampleID].tasks,
...action.samplesData[i].tasks,
];
} else {
sampleList[sampleID].tasks = action.samplesData[i].tasks;
}
});

return { ...state, sampleList };
}
case 'ADD_TASK_RESULT': {
const sampleList = {
...state.sampleList,
Expand Down Expand Up @@ -310,9 +294,6 @@ function sampleGridReducer(state = INITIAL_STATE, action = {}) {
case 'CLEAR_SAMPLE_GRID': {
return { ...state, ...INITIAL_STATE };
}
case 'CLEAR_ALL': {
return { ...state, ...INITIAL_STATE };
}
default: {
return state;
}
Expand Down
1 change: 0 additions & 1 deletion ui/src/reducers/sampleview.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ function sampleViewReducer(state = INITIAL_STATE, action = {}) {
);
return { ...state, selectedShapes };
}
case 'CLEAR_ALL':
case 'SET_CURRENT_SAMPLE': {
return {
...state,
Expand Down
3 changes: 0 additions & 3 deletions ui/src/reducers/shapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ function shapesReducer(state = INITIAL_STATE, action = {}) {
case 'SET_CURRENT_SAMPLE': {
return INITIAL_STATE;
}
case 'CLEAR_ALL': {
return INITIAL_STATE;
}
case 'SET_INITIAL_STATE': {
return {
...state,
Expand Down