[MGNLDAM-1192] Introduce imageUrl into chooseAsset Action under JS Created: 29/Mar/23  Updated: 08/Dec/23  Resolved: 04/Jul/23

Status: Closed
Project: Magnolia DAM Module
Component/s: None
Affects Version/s: None
Fix Version/s: 3.0.25

Type: Bug Priority: Neutral
Reporter: Alberto Soto Assignee: Jaromir Sarf
Resolution: Fixed Votes: 0
Labels: dx-core-6.3
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File bad_path.png     PNG File good_path.png    
Issue Links:
Cloners
is cloned by MGNLDAM-1218 Introduce imageUrl into chooseAsset A... Closed
Problem/Incident
is caused by MGNLDAM-1031 RichTextField images path always poin... Open
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLDAM-1197 Implementation Sub-task Completed Jaromir Sarf  
MGNLDAM-1198 Code review Sub-task Completed Adam Siska  
MGNLDAM-1199 Pre-Integration QA Sub-task Completed Adam Siska  
MGNLDAM-1200 QA Sub-task Completed Quach Hao Thien  
MGNLDAM-1209 Provide groovy script for fixing alre... Sub-task Closed  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: CKEditor 5
Sprint: Nucleus 39
Story Points: 2
Team: Nucleus
Work Started:
Approved:
Yes

 Description   

Steps to reproduce

1 - Introduce a dialog with the following

description:
$type: richTextField
label: Description
height: 600
i18n: true
images: true

2 - Upload an image

3 - Edit the component/page again select the image in the rich text field and trey to change it to other one

Expected results

The image is preselected in the DAM selector dialog

Actual results

Root element in selected

Workaround

The event relies in a java callback executed from the JS side

Development notes

  • magnolia-ui-framework-jcr/src/main/resources/VAADIN/js/filebrowser/plugin.js L50 launches chooseAsset action
  • Additional parameter can be injected with the asset url


 Comments   
Comment by Jaromir Sarf [ 29/May/23 ]

Discovery:
If we will use this PR, in RichtextFieldFactory we will get asset path in this format.

In order to make chooser be opened with preselected asset we need this path format. 

The solution could be adjusting the PR to get path in correct format.

EDIT: I missed the second PR, this will fix the issue. 

Comment by Jaromir Sarf [ 01/Jun/23 ]

Re-Discovery:
To get the good path to chooser we need to add the path to image element. In this method should add "data-cke-saved-src="PATH" to value.

Generated at Mon Feb 12 05:07:05 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.