[MGNLUI-6411] When displaying a link field, the combobox is always querying the dataset size Created: 18/Nov/20  Updated: 01/Mar/21  Resolved: 02/Dec/20

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.6

Type: Bug Priority: Neutral
Reporter: Mercedes Iruela Assignee: Šimon Demočko
Resolution: Fixed Votes: 0
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: 53m
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2020-11-17 at 18.33.19.png     PNG File Screenshot 2021-01-27 at 08.37.07.png    
Issue Links:
Relates
causality
caused by MGNLUI-5798 Make link field extend select field a... Closed
is causing MGNLUI-6483 linkField: Setting path manually in d... Closed
is causing MGNLUI-6530 Improve LinkField with a select menu ... Closed
documentation
to be documented by MGNLUI-6436 DOC: New default values for linkField... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: Improve Content Linking
Sprint: Maintenance 35, Maintenance 36
Story Points: 5

 Description   

Steps to reproduce

  • Log tools (you may hit LOGTOOLS-21, that is unrelated), change to debug: info.magnolia.dam.jcr.JcrAssetProvider
  • Pages app: create a new page using basic template
  • Include a text and image component
  • Change to Image tab
  • Check the logs
    2020-11-17 16:56:18,419 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Running SQL2 query 'SELECT * FROM [nt:base] AS asset WHERE (NOT asset.[mgnl:deleted] IS NOT NULL) AND asset.[jcr:primaryType] = 'mgnl:asset'' against workspace dam.
    2020-11-17 16:56:18,433 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/11219108004_604a12df22_o.jpeg'
    2020-11-17 16:56:18,435 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/11219108435_a41740babe_o.jpeg'
    2020-11-17 16:56:18,436 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/14518293372_77d06a17fb_o.png'
    2020-11-17 16:56:18,436 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/31261019086_f4438ae8aa_o.jpeg'
    2020-11-17 16:56:18,436 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/IMG-20170622-WA0006.jpg'
    2020-11-17 16:56:18,436 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/IMG_0822.jpeg'
    2020-11-17 16:56:18,436 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/team-bike.png'
    2020-11-17 16:56:18,436 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/secret-santa-2016_31180868041_o.jpeg'
    2020-11-17 16:56:18,436 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/dinner.jpeg'
    2020-11-17 16:56:18,437 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Running SQL2 query 'SELECT * FROM [nt:base] AS asset WHERE (NOT asset.[mgnl:deleted] IS NOT NULL) AND asset.[jcr:primaryType] = 'mgnl:asset'' against workspace dam.
    2020-11-17 16:56:18,439 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/11219108004_604a12df22_o.jpeg'
    2020-11-17 16:56:18,439 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/11219108435_a41740babe_o.jpeg'
    2020-11-17 16:56:18,440 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/14518293372_77d06a17fb_o.png'
    2020-11-17 16:56:18,440 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/31261019086_f4438ae8aa_o.jpeg'
    2020-11-17 16:56:18,440 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/IMG-20170622-WA0006.jpg'
    2020-11-17 16:56:18,440 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/IMG_0822.jpeg'
    2020-11-17 16:56:18,440 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/team-bike.png'
    2020-11-17 16:56:18,440 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/secret-santa-2016_31180868041_o.jpeg'
    2020-11-17 16:56:18,440 DEBUG info.magnolia.dam.jcr.JcrAssetProvider      : Created asset linked to the following node '/untitled/dinner.jpeg'
    

Expected result

Not querying the whole workspace when generating the dialog

Current result

A query is done to get dataset size.

Development notes

If you include a breakpoint in info.magnolia.dam.jcr.JcrAssetProvider.list(AssetQuery), you can see the following stack:

Currently, linkField uses a combobox to display the item path (used to be a textfield) and the combobox may cause troubles due to since it might not be using the lazy loading. It might be usefull to replace combobox solution with something simpler and less intrusive.
Vaadin combobox will try to get the dataset size even if paging is enabled



 Comments   
Comment by Šimon Demočko [ 27/Nov/20 ]

DOC update: Link field page 

  • filtering mode by default is now OFF for linkfields (mentions different value at the moment)
  • textInputAllowed now false for linkfields as well
  • filtering mode, when set to something else than OFF, will fetch data from datasource for filtering purposes. When used with a datasource containing large data sets (like dam app with over thousand nodes) can lead to performance issues (that's this ticket)
Comment by Roman Kovařík [ 27/Jan/21 ]
  • textInputAllowed now false for linkfields as well

For the record this is causing linkfield to have a dropdown with one (empty) item (to be able to remove the link without choosing a new one):

Workaround for this is to enable the filtering mode and have dropdown with all workspace items.
Should the empty item have a label (e.g. "Nothing selected")?

Generated at Mon Feb 12 09:36:11 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.