[MGNLUI-7993] Ckeditor doesn't restore opacity when closing mgnlLink Created: 12/Apr/23  Updated: 09/May/23  Resolved: 21/Apr/23

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.32
Fix Version/s: 6.3.0, 6.2.33

Type: Bug Priority: Neutral
Reporter: Carlos Cantalapiedra Assignee: Jaromir Sarf
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 0.25d Time Spent: 0.25d
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File image-2023-04-14-13-10-18-312.png    
Issue Links:
Problem/Incident
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-8003 Implementation Sub-task Completed Jaromir Sarf  
MGNLUI-8004 Code review Sub-task Completed Adam Siska  
MGNLUI-8005 Pre-integration QA + PM (for ticket a... Sub-task Completed Adam Siska  
MGNLUI-8006 QA Sub-task Closed Antonín Juran  
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: FieldsMaintenance
Sprint: Nucleus 34
Story Points: 3
Team: Nucleus
Work Started:
Approved:
Yes

 Description   

Steps to reproduce

  1.  Create a rich text field component
  2.  Click on Link to Internal Page or Link to DAM document
  3. Close without selecting anything
  4. Check that the rich text has 0.2 opacity

Expected results

0.2 opacity attribute is removed from the editor

Actual results

The opacity attribute is only removed when a page or a DAM document is selected

Workaround

N/A

Development notes

When a page or DAM document is selected, there is a call to:

demo.magnolia-cms.com/VAADIN/js/magnolialink/plugin.js
function setReadOnly(editor, isReadOnly) {
    if (isReadOnly) {
        editor.element.setStyle('opacity', '0.2');
    } else {
        editor.element.removeStyle('opacity');
    }
}

And this is done through:

demo.magnolia-cms.com/VAADIN/js/magnolialink/plugin.js
 editor.on(EVENT_SEND_MAGNOLIA_LINK, function(e) {
     deselectedCommand();
     setReadOnly(editor, false);
[...]

The problem is that hen you click on the X icon (close dialog) or at "Cancel" button, the editor.on(EVENT_CANCEL_LINK, function(e) is not being called so the opacity can't be fixed.



 Comments   
Comment by Quach Hao Thien [ 14/Apr/23 ]

Discovery

Added image

It's able to reproduce, development note is a good way to start

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