Developer

Creating a New Request

Last updated on 18-Oct-2018 by Frej Nøhr Larsen
Frej Nøhr Larsen

Bioinformatician
larsen@scifeon.com

This page describes the codebase for the request creation user interface (UI). If you would like to see it in action, visit the user guide.

Lifecycle

The lifecycle is a term from the Aurelia framework employed by Scifeon. It refers to the phases a web page goes through and can be used to activate certain parts of a script at certain time points.

For the request UI, just one lifecycle function is used:

activate() is called just before the view model is displayed. Here, it is used for loading data from localStorage:

This allows the user to reuse data from previous requests as inboxID and request type is saved.

attached() is called when the component is attached to the DOM. For the request UI, it is used to load methods from the database:

Scifeon View

Below is an image of the UI. Red Numbers match the numbering of the next sections.

1. Sidebar

The sidebar contains metadata about the sender, receiver, and type of the request. The view model is defined in a sidebar div element, with the dropdowns being a custom HTML element:

e-class defines the entity class, while fields contains the customizable elements to be shown.

The sidebar also contains a dropzone for files. The HTML element is shown below:

When a file is dropped in the zone, the attachFiles() function is called. $event.detail.files contains the dropped file object.

The above TypeScript contains the attachFiles() function. This function processes the dropped files and pushes them to a list of uploaded files. The files can then be viewed in the sidebar.

2. Notes

The main page elements are built into panels. Each panel consist of a header and a body. The first panel allows for custom notes to be attached to a request. The note is very customizable and can contain text, tables, and images.

The note object is initialized as a class property:

The content field can then be filled by the user using the HTML element in the UI:

Whatever is written in the text field is saved to the content field of the note entity. When the request is saved, the note entity is also sent to the database. It is linked to the request through the subjectID property.

3. Samples

The second panel allows the user to create samples for his/her experiment. The samples are described by a name, an ID, and a short description. When the request is saved, the samples are saved as sample entities in the Scifeon database.

The sample UI is made with the custom HTML element entity-list-editor which creates a customizable Handson table.

The fields attribute selects which columns are available in the table while the entities attribute selects which variable the input is bound to.

4. Methods

The Methods panel uses a custom HTML element to fetch available methods from the database and display a samples-method-map.

The map allows the user to select/deselect specific methods for each sample by clicking a checkbox.

The methods in the selected-methods list are mapped to the sample entities. This allows the user to pass several samples requiring different methods at once.