Content
View differences
Updated by Parimal Satyal about 1 year ago
# Context
This is an the follow-up of <mention class="mention" data-id="62667" data-type="work_package" data-text="##62667">##62667</mention> and at the same time the preparation for <mention class="mention" data-id="63321" data-type="work_package" data-text="##63321">##63321</mention>
# Acceptance criteria
## Anatomy
* There is a new component called `FilterableTreeView`
* It consists of
* A search field at the top (basically a text field with leading search icon)
* A `TreeView` component below
## Behaviour
**TreeView**
* The `TreeView` behaves normally (as specified in ##62667)
* it supports two loading strategies (static ~~and dynamic)~~ and dynamic)
* it supports multi-select for the static loading strategy
* it supports leading and trailing visuals
* it supports leading actions
* etc.
**Search field**
* When using searching for a string in the search text field to filter/search for text with the **static loading strategy:**
* The component itself filters the tree view to show the for exact matches of the string (incl. partial matches of that exact search string: eg. "par" matches "partial" but not "Primer")
* If multi-select mutli-select is activated:
* activated, the selection before the search is launched is preserved (even if the search results don't include previously checked items)
kept
* if 'include all sub-nodes' is active, checking When searching for a parent will also check all sub-nodes including those that are not visible string in the search filter result
text field with **dynamic loading strategy:**
* Even in There is a filtered state, when submitting the form, _all_ selected new request send to get all items (including those that are not visible in match the current filter results) will be submitted as checked string
* **\[open\]** This FilterableTreeView does not support **dynamic loading strategy** at all
* If a leaf matches the search, but the node does not, the whole hiearchy of the leaf is shown and those items that do not match the string are disabled (so greyed out and not clickable)
* The letters that match the search string are highlighted in a different color in each found tree view item
## Use case
tbd
**Option 1**
* This new component will be used as the new transversal/global project selector
**Option 2**
* Use is in the admin settings as a way of selecting projects in which to enable a certain object, like a project attribute, type or custom field.
* Eg. In Administration → Projects → Project attributes → {one attribute} → Projects tab (the same pattern exists in other admin pages like Custom fields and Types)
~~**Option 2**~~
* ~~This new component will be used as the new transversal/global project selector~~
* This will be handled by the <mention class="mention" data-id="63321" data-type="work_package" data-text="##63321">##63321</mention>
<br>
## Open questions:
* Which use case should we use?
* ~~With With multi-select activated with the option to include all sub-nodes when selecting a parent:~~
* ~~When When I filter and select a parent node: Should all items of the parent be selected or only the visible ones?~~ ones?
* ~~When When I already selected some items and filter afterwards, will the hidde items still be part of the form data?~~
* ~~When using the search field to filter/search for text with **dynamic loading strategy:**~~
* ~~There is a new request send to get all items that match the string, including from nodes that were previously not yet loaded (because unexpanded)~~
* ~~**\[open\]** Does this mean that as soon as you launch a search, that all items are then lodaded? (For the search to be able to traverse all nodes and all items)~~
* ~~**\[open\]** Even if all items are then loaded, effectively making it a static list, when the search is reinitialised, previously collapsed nodes should remain collapsed~~ data?
This is an the follow-up of <mention class="mention" data-id="62667" data-type="work_package" data-text="##62667">##62667</mention> and at the same time the preparation for <mention class="mention" data-id="63321" data-type="work_package" data-text="##63321">##63321</mention>
# Acceptance criteria
## Anatomy
* There is a new component called `FilterableTreeView`
* It consists of
* A search field at the top (basically a text field with leading search icon)
* A `TreeView` component below
## Behaviour
**TreeView**
* The `TreeView` behaves normally (as specified in ##62667)
* it supports two loading strategies (static ~~and dynamic)~~
* it supports multi-select for the static loading strategy
* it supports leading and trailing visuals
* it supports leading actions
* etc.
**Search field**
* When using
* The component itself filters the tree view to show the
* If multi-select
*
* **\[open\]** This FilterableTreeView does not support **dynamic loading strategy** at all
* If a leaf matches the search, but the node does not, the whole hiearchy of the leaf is shown and those items that do not match the string are disabled (so greyed out and not clickable)
* The letters that match the search string are highlighted in a different color in each found tree view item
## Use case
*
**Option 2**
*
* Eg. In Administration → Projects → Project attributes → {one attribute} → Projects tab (the same pattern exists in other admin pages like Custom fields and Types)
~~**Option 2**~~
* ~~This new component will be used as the new transversal/global project selector~~
* This will be handled by the <mention class="mention" data-id="63321" data-type="work_package" data-text="##63321">##63321</mention>
<br>
## Open questions:
* Which use case should we use?
* ~~With
* ~~When
* ~~When
* ~~When using the search field to filter/search for text with **dynamic loading strategy:**~~
* ~~There is a new request send to get all items that match the string, including from nodes that were previously not yet loaded (because unexpanded)~~
* ~~**\[open\]** Does this mean that as soon as you launch a search, that all items are then lodaded? (For the search to be able to traverse all nodes and all items)~~
* ~~**\[open\]** Even if all items are then loaded, effectively making it a static list, when the search is reinitialised, previously collapsed nodes should remain collapsed~~