Skip to content

[WIP]: Queue API

Created by: marcus-oscarsson

Hello !

Here is the first take of the Queue API refactoring that we discussed in issue #304 (closed). I wanted to share this preliminary work with you guys to get your ideas on it. The general idea with this first work is to decouple server internals like nodeId and to simplify the logic we use on the client. I then hope to be able to develop a simplified API for exchanging the queue.

I've removed the mapping between server side nodeID's to samples and tasks (so far on the client side). The two lookup tables "lookup" and "queueID_lookup" have consequently been removed. The components have been updated to reflect this change. I'm currently using the sampleIDs and the position of a task in the queue to identify samples and tasks.

The "display data" that were stored in queue state collapsedSamples and checked have been moved to sample and task data objects. This might not be the best solution but its easier to access this data directly rather than going through an extra state variable. I was thinking of creating a new state variable called displayData, with all the display data like label, collapsed and checked. I might do that in the end if we there is good reasons for it, for the moment I cant really see any. Let me know what you think !?.

Ive also removed the server calls for ADD, REMOVE and CHANGE tasks, which later will be replaced by the SET_QUEUE (not done yet). The mount sample route have been refactored to operate on sampleIDs instead of nodeIDs.

Finally, the UI should work as before but no changes to the queue are sent to the server. So its of course not possible to run the queue yet. The next thing to do is to implement the queue exchange functionality basically SET_QUEUE.

If anyone have some time over, take a look and let me know what you think. All input is welcome :).

Cheers, Marcus

Merge request reports