Opened 2 months ago

Closed 5 weeks ago

#2328 closed enhancement (fixed)

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 (47)

comment:1 by Nicklas Nordborg, 2 months ago

Milestone: BASE 3.19.14BASE 3.20

comment:2 by Nicklas Nordborg, 2 months 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 months 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 months 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 months 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 months 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 months 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 months 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, 2 months 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, 2 months ago

In 8246:

References #2328: Implement support for subcontext in list pages

Implemented for all other item types.

comment:11 by Nicklas Nordborg, 2 months 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, 8 weeks 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, 8 weeks 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.

comment:14 by Nicklas Nordborg, 7 weeks ago

In 8262:

References #2328: Implement support for subcontext in list pages

Allow an admin to mark a subtype as remove even if it is a "system item". Some subtypes are not used and will just clutter the selection menu and "system items" can't be deleted.

comment:15 by Nicklas Nordborg, 7 weeks ago

In 8263:

References #2328: Implement support for subcontext in list pages

Implemented support for hiding column definitions from the context menu that can be used to show/hide additional columns. This is done by setting a data-hideFromMenu=true on the column definition. There is also support for this in the ListColumnAction interface that is used by the extension system.

The derived bioassays list page is used for testing where we hide all annotation type and file types that are not related to the current subcategory or subtype.

comment:16 by Nicklas Nordborg, 7 weeks ago

In 8264:

References #2328: Implement support for subcontext in list pages

Implemented a test in ItemSubtype.isInRelatedCategory() that can be used to check if an annotation type is included in a category that is related to the subtype.

comment:17 by Nicklas Nordborg, 7 weeks ago

In 8265:

References #2328: Implement support for subcontext in list pages

Changed how a subtype with only a single sub-category is presented in the dropdown menu. Instead of filtering out the sub-category, we move it up to the the first level in the menu and replace the subtype with it.

comment:18 by Nicklas Nordborg, 7 weeks ago

In 8266:

References #2328: Implement support for subcontext in list pages

Add JspContext.getCurrentContext() to make the item context available to extensions. Implemented in the derived bioassays list page, but need to change a lot of JSP files.

comment:19 by Nicklas Nordborg, 7 weeks ago

In 8267:

References #2328: Implement support for subcontext in list pages

Lots of changes to get the current ItemContext into the JspContext: JspContext jspContext = ExtensionsControl.createContext(dc, cc, pageContext, ...

comment:20 by Nicklas Nordborg, 7 weeks ago

In 8269:

References #2328: Implement support for subcontext in list pages

The "Add parent or child item column" dialog should now handle extensions that depend on the selected subtype.

comment:21 by Nicklas Nordborg, 7 weeks ago

In 8270:

References #2328: Implement support for subcontext in list pages

The "Add members" dialog for item lists didn't display correctly to allow changing the subtype and category. This is now fixed.

comment:22 by Nicklas Nordborg, 7 weeks ago

In 8271:

References #2328: Implement support for subcontext in list pages

The table listing in the "Members" tab for an item list now uses the subtype of the item list to limit columns.

comment:23 by Nicklas Nordborg, 7 weeks ago

In 8272:

References #2328: Implement support for subcontext in list pages

Setting "subcontext" on the GuiContext object.

comment:24 by Nicklas Nordborg, 7 weeks ago

In 8273:

References #2328: Implement support for subcontext in list pages

Do not use empty string as subcontext.

comment:25 by Nicklas Nordborg, 7 weeks ago

In 8274:

References #2328: Implement support for subcontext in list pages

Do not use empty string as subcontext.

comment:26 by Nicklas Nordborg, 7 weeks ago

In 8275:

References #2328: Implement support for subcontext in list pages

Use subcontext in list-related functionality.

comment:27 by Nicklas Nordborg, 7 weeks ago

In 8276:

References #2328: Implement support for subcontext in list pages

Added filtering options to the "Configure columns" dialog. The default now is to only show columns that are related to the current subtype or subcategory, but there is an option to display all columns. There is also a filter option to only show annotation columns.

Also added color-coding to the options. Annotation columns are blue and columns that are not related to the current subtype or subcategory are gray.

comment:28 by Nicklas Nordborg, 6 weeks ago

In 8277:

References #2328: Implement support for subcontext in list pages

Updated documentation with new feature for item subtypes and annotation type categories.

comment:29 by Nicklas Nordborg, 6 weeks ago

In 8278:

References #2328: Implement support for subcontext in list pages

Updated documentation for the "Configure columns" dialog.

comment:30 by Nicklas Nordborg, 6 weeks ago

In 8279:

References #2328: Implement support for subcontext in list pages

Do not display any selection menu if there are no subtypes.

comment:31 by Nicklas Nordborg, 6 weeks ago

In 8280:

References #2328: Implement support for subcontext in list pages

Updated documentation about database changes.

comment:32 by Nicklas Nordborg, 6 weeks ago

In 8281:

References #2328: Implement support for subcontext in list pages

THe 'presets' list on list pages now include presets for all sub-contexts.

comment:33 by Nicklas Nordborg, 6 weeks ago

In 8282:

References #2328: Implement support for subcontext in list pages

Plate annotations that are available on the extracts list page should also use the current subtype/category to show/hide annotations.

comment:34 by Nicklas Nordborg, 6 weeks ago

In 8284:

References #2328: Implement support for subcontext in list pages

The options in "Item list" column is now filtered so that only lists that are relevant to the currently active subtype (and also lists without any subtype) are included in the list.

comment:35 by Nicklas Nordborg, 6 weeks ago

In 8285:

References #2328: Implement support for subcontext in list pages

The default when selecting a sub-category from the drop-down menu is to only apply a filter on the subtype column. The extra filter on the annotation used for sub-categories is only applied if there is no filter already. Since the user can change this filter it means that it may be different from the original sub-category when returning to list page.

It is now possible to reset the sub-category filter by holding one of CTRL, SHIFT or ALT when selecting from the drop-down menu.

comment:36 by Nicklas Nordborg, 6 weeks ago

In 8287:

References #2328: Implement support for subcontext in list pages

Modified the "Manage presets" dialog to display the subtype and sub-context as well as the filter expression.

comment:37 by Nicklas Nordborg, 6 weeks ago

In 8288:

References #2328: Implement support for subcontext in list pages

Found some places where the subcontext parameter needs encoding when sent in URLs.

comment:38 by Nicklas Nordborg, 6 weeks ago

In 8289:

References #2328: Implement support for subcontext in list pages

Try to match an item list sync filter with a subcategory based on the filter expression.

comment:39 by Nicklas Nordborg, 6 weeks ago

In 8290:

References #2328: Implement support for subcontext in list pages

Found another place with empty string instead of null.

comment:40 by Nicklas Nordborg, 6 weeks ago

In 8291:

References #2328: Implement support for subcontext in list pages

Use "0.0" instead of "" (empty string) for the default subcontext. This solves a lot of problems where the empty string is parsed to null which causes the currently active subcontext to be used in situations where it should not.

comment:41 by Nicklas Nordborg, 6 weeks ago

In 8292:

References #2328: Implement support for subcontext in list pages

Implemented a function for converting existing presets and synchronization filters to use subtype and subcategories instead if they have filters that matches an existing configuration. The conversion is implemented as a one-time-fix and can be done after upgrading and after configuring subtypes and annotation type categories:

  • ./onetimefix.sh convert_syncfilters for converting synchronization filters
  • ./onetimefix.bat convert_presets for converting presets


The conversion will replace a filter on the 'Item subtype' column with link to that subtype instead.

An additional check is made for presets if the subtype has specified an annotation type to use for sub-categories. If there is a filter on that annotation type and there is an annotation type category with matching values the preset will link to that category.

comment:42 by Nicklas Nordborg, 6 weeks ago

In 8293:

References #2328: Implement support for subcontext in list pages

Some important code was commented out. Should have been included in [8292].

comment:43 by Nicklas Nordborg, 6 weeks ago

In 8294:

References #2328: Implement support for subcontext in list pages

The change in [8284] that filters out item lists from the selection was too hard since it may also filter out lists that are used in the current filter. The initial fitlering still works, but any update (such as adding a column or changing the sort order) will cause the item list filter to be removed.

This update should make sure that item lists that are used for filtering are included in the selection list.

comment:44 by Nicklas Nordborg, 6 weeks ago

In 8295:

References #2328: Implement support for subcontext in list pages

"0.0" should not be used as the "subcontext name" when saving a preset.

comment:45 by Nicklas Nordborg, 6 weeks ago

In 8296:

References #2328: Implement support for subcontext in list pages

Remove debug code.

comment:46 by Nicklas Nordborg, 5 weeks ago

In 8306:

References #2328: Implement support for subcontext in list pages

If the request contains a filter for the 'itemSubtype' that we can't parse to an integer (for example, if there are multiple value '1|2') we should not set a sub-context but use the default context without any subtype or subcategory.

comment:47 by Nicklas Nordborg, 5 weeks ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.