Opened 3 weeks ago

Last modified 4 hours ago

#2328 new enhancement

Implement support for subcontext in list pages

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.20
Component: core Version:
Keywords: Cc:

Description

The main idea is that it would be nice to have separate settings for the same list page depending on the type of items currently being listed. We can use derived bioassays as the use case, were we currently have several different subtypes:

  • SequencingRun
  • MergedSequences
  • AlignedSequences
  • VariantCall
  • GeneExpression
  • and several more...

In the GUI it should be possible to go to Derived bioassays -> AlignedSequences list page and have one set of settings (eg. visible columns, filters, etc.) and then go to Derived bioassays -> GeneExpression and have a different setup. The currently existing functionality with presets can do some things, but is not optimal since changes are not remembers (unless manually saved).

In the core functionality there is already support for using subcontext but it is only implemented for different raw data on raw bioassays (that we don't use anymore).

Change History (13)

comment:1 by Nicklas Nordborg, 3 weeks ago

Milestone: BASE 3.19.14BASE 3.20

comment:2 by Nicklas Nordborg, 3 weeks ago

In 8238:

References #2328: Implement support for subcontext in list pages

Added ItemSubtype to ItemContext so that we can associate a given context with a subtype.

The configureQuery has been updated to use the given subtype as a restriction.

comment:3 by Nicklas Nordborg, 2 weeks ago

In 8239:

References #2328: Implement support for subcontext in list pages

Added SessionControl.setCurrentSubcontext() and SessionControl.getCurrentSubcontext() for setting a current active subcontext. The existing method SessionControl.getCurrentContext() now accept a null parameter to use the active subcontext. This method was almost always called with an empty string ("") before, but in most cases we should now use null instead.

comment:4 by Nicklas Nordborg, 2 weeks ago

In 8240:

References #2328: Implement support for subcontext in list pages

Implemented support on the derived bioassay list and view pages. It is currently using a <select> element which is not the optimal.

comment:5 by Nicklas Nordborg, 2 weeks ago

In 8241:

References #2328: Implement support for subcontext in list pages

This file should have been included in the previous commit [8240].

comment:6 by Nicklas Nordborg, 2 weeks ago

In 8242:

References #2328: Implement support for subcontext in list pages

When a subtype is selected it should not be possible to filter on the "Type" list column.

comment:7 by Nicklas Nordborg, 2 weeks ago

In 8243:

References #2328: Implement support for subcontext in list pages

Item lists with sync filters should now work.

comment:8 by Nicklas Nordborg, 2 weeks ago

In 8244:

References #2328: Implement support for subcontext in list pages

Re-designed the subtype selection which now uses a regular <div> element with javascript to display a drop-down menu for selecting another subtypes.

comment:9 by Nicklas Nordborg, 13 days ago

In 8245:

References #2328: Implement support for subcontext in list pages

Fixed some issues with saving presets that caused them to always be saved without a subcontext.

comment:10 by Nicklas Nordborg, 12 days ago

In 8246:

References #2328: Implement support for subcontext in list pages

Implemented for all other item types.

comment:11 by Nicklas Nordborg, 5 days ago

In 8255:

References #2328: Implement support for subcontext in list pages

If a sub-context has been specified we need to handle filters on the itemSubtype a bit differently:

  • When calling ItemContext.setItemSubtype() existing filters on itemSubtype must be removed.
  • When calling ItemContext.setPropertyFilter() we do not allow a filter on the itemSubtype column.

Otherwise we may end up with a situation were no items are displayed on the list page and without any possibility to reset the filters.

  • When calling ItemContext.getPropertyValue("itemSubtype") the id of the current item subtype should be returned.

This will benefit the "Create new item" dialog so that the type selection field is automatically selected.

comment:12 by Nicklas Nordborg, 28 hours ago

In 8256:

References #2328: Implement support for subcontext in list pages

Trying to solve issue with item lists in popup dialogs. They are typcially used when editing an item and there is a "Select ..." button to select a related item, for example a parent item, a protocol, etc. Depending on the subtype of the item being edited the selection list typically have different filtering options that are automatically enabled. The current implementation didn't work well with subcontexts since then either the current subcontext is lost or the filter combination will not match any items at all.

The solution will try to use different subcontexts depending on the "mode" parameter (eg. "default" list page, "selectone", "selectmultiple" etc). A side-effect is that existing code that is opening popup dialogs for selecting items may need to be modified to work as intended.

There are also a lot of places in the BASE web client that are affected by this change.

comment:13 by Nicklas Nordborg, 4 hours ago

In 8259:

References #2328: Implement support for subcontext in list pages

Some minor styling changes to the drop-down menu.

  • Use a white "arrow down" icon in popup windows.
  • Check position and dimensions so that the menu is not outside window and add scrollbars if needed.
  • Clicking the subtype again when the menu is visible hides the menu.
Note: See TracTickets for help on using tickets.