[MGNLUI-5979] in 6.2.2 There is no preview for linkFields linking to assets as there was in M5UI. Created: 19/Jun/20  Updated: 20/Jan/21  Resolved: 10/Aug/20

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

Type: Bug Priority: Major
Reporter: Christopher Zimmermann Assignee: Dai Ha
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 7.25d
Original Estimate: Not Specified

Attachments: PNG File Bildschirmfoto 2020-06-30 um 09.58.07.png     PNG File image-2020-07-23-07-46-48-937.png     PNG File link field - how it should be.png     PNG File not-ideal.png    
Issue Links:
Cloners
is cloned by MGNLDAM-866 CLONE - in 6.2.2 There is no preview ... Closed
Relates
relates to MGNLDAM-870 CLONE - Image preview overflows in co... Closed
relates to MGNLDAM-927 CLONE - Provide compatibility to asse... Closed
relates to MGNLUI-5965 Image preview overflows in compatibil... Closed
relates to MGNLUI-6289 Provide compatibility to asset links Closed
relates to MGNLUI-6517 Provide PreviewComponent for a binary... Open
causality
dependency
is depended upon by MGNLUI-5955 linkField for asset is not as expected Closed
duplicate
is duplicated by MGNLUI-5955 linkField for asset is not as expected Closed
relation
is related to MGNLUI-6138 Contacts-v8 app: linkField image prev... 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:
[ ]* 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: M6 UI & UX Improvements
Sprint: CM & OC 6, CM & OC 7, CM & OC 8
Story Points: 5

 Description   

When a linkfield targets an asset it is a common requirement to show a preview of the linked asset, in the form itself.
(Note: A preview in the chooser is nice too - but thats not what this ticket is about.)

IN M5 we had this preview class: 
contentPreviewClass: info.magnolia.dam.app.ui.field.DamFilePreviewComponent
 
But in M6 there is not yet an equivalent.
Based on these docs, I guess it should implement 'info.magnolia.ui.preview.ItemPreviewComponent'

https://documentation.magnolia-cms.com/display/DOCS62/Link+field

 



 Comments   
Comment by Christopher Zimmermann [ 22/Jun/20 ]

5711 looks to be all about the Chooser. This is about a having a preview of an asset that can be used in the form itself.

Comment by Aleksandr Pchelintcev [ 02/Jul/20 ]

DEV notes:

  • the issue seems to be no w/ UX per se, but rather with definition converter: new DAM chooser works with Asset API and provides preview provider also based on Asset API. Converter however, doesn't relay the old-style link field to use the Asset API treating it is a mere case of JCR link field (and we don't have any default preview for JCR node).
  • solution proposal: make the converter detect the case of linking to dam workspace and relay the up to date asset chooser.
  • better solution proposal: migrate MTK :disappear:
Comment by Christopher Zimmermann [ 02/Jul/20 ]

How would migrating MTK solve the issue? On m6 dialogs there is currently no way to have an asset preview.

Comment by Marek Lesiak [ 22/Jul/20 ]

@Christopher Zimmermann Actually in 6.2.2 asset preview is somehow working. It is not perfect, but it displays at least something alongside many other properties... If we could only hide other properties from that preview. 

Please take a look at following definition: 

link:
   label: Select image
   $type: linkField
   chooser:
     workbenchChooser:
       appName: dam-chooser
   preview:
     implementationClass: info.magnolia.contacts.app.ContactPreview

To get it working you need `magnolia-contacts` dependency in your project. 

On the attached screen(not-ideal.png) you can see how it looks for my content app that is written in v6.2 style. So maybe asset preview could be written basing on `info.magnolia.contacts.app.ContactPreview`?

Comment by Dai Ha [ 23/Jul/20 ]

a viet.nguyen, mlesiak,

 

This is how a link field to asset should look like, not just as simple as hiding properties from model to UI.

For `info.magnolia.contacts.app.ContactPreview`, it is one of simple implementation of PreviewComponent that is specific for contacts-app and will drag inappropriate dependency from contacts-app to custom modules. The current approach will introduce new preview components in DAM and not based on `info.magnolia.contacts.app.ContactPreview`

Comment by Marek Lesiak [ 23/Jul/20 ]

@Dai Ha Great!  That is what I was looking for from the beginnig. In what version can I expect that? =)

Comment by Christopher Zimmermann [ 28/Jul/20 ]

Can you provide an example of the configuration for  the new damLinkField and also for the regular linkField to have a preview?

Comment by Dai Ha [ 10/Aug/20 ]

Hi czimmermann, a typical definition for damLinkField will be:

damImage:
  label: Image from DAM
  $type: damLinkField

and that was introduced by ui team before I had a chance to do the same thing . Now for my part, you can refer 

info.magnolia.dam.app.field.DamLinkFieldDefinition

it wraps a normal LinkFieldDefinition ** with components that more DAM related.

 

Comment by Dai Ha [ 10/Aug/20 ]

Hi mlesiak, the PRs went to UI 6.2.3, thank you

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