[MGNLUI-7270] Disable save action when showing versions of content in detail subapp Created: 21/Jun/22  Updated: 27/Feb/23  Resolved: 02/Nov/22

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3, 6.2.26

Type: Bug Priority: Neutral
Reporter: Roberto Gaona Assignee: Antonín Juran
Resolution: Fixed Votes: 0
Labels: RichTextField
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 3d 6.5h Time Spent: 3d 2.5h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File image-2022-10-06-14-09-29-238.png    
Issue Links:
Problem/Incident
causality
duplicate
duplicates MGNLUI-6958 ReadOnly RichTextField still accepts ... Open
relation
is related to MGNLUI-7884 RichText fields are editable tho the ... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-7586 Implementation Sub-task Completed Antonín Juran  
MGNLUI-7587 Code review Sub-task Completed Roman Kovařík  
MGNLUI-7588 Pre-integration QA Sub-task Completed Sang Ngo Huu  
MGNLUI-7589 Final QA Sub-task Completed Quach Hao Thien  
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:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Date of First Response:
Epic Link: Nucleus Quality Maintenance
Sprint: Nucleus 22
Story Points: 3
Team: Nucleus

 Description   

Steps to reproduce:

1 - Modify on demo: /dam-app-jcr/dialogs/uploadAndEdit.yaml and set the description field to type RichText

2 - Publish any asset from the assets app

3 - Access "Show versions" and choose the previously published version.

You will see how you can edit the richTextField, although can't save any changes since the buttons are disabled on the view.



 Comments   
Comment by Quach Hao Thien [ 06/Oct/22 ]

Discovery:

The reason RichTextEditor still can be input despite the whole field had being disabled is there is an attribute called contenteditable, which could be true/false, by setEnabled(false) to the field will not affect this attribute. The contenteditable are configurable via org.vaadin.alump.ckeditor.AbstractCKEditorTextField#setProtectedBody(boolean) method.

Proposed solution:

When the Detail Subapp is opened on view/version viewType, the component container will be setEnabled(false) https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/browse/magnolia-ui-framework/src/main/java/info/magnolia/ui/contentapp/detail/ContentDetailSubApp.java#159,161, 
(Unfortunately, setting a Vaadin component container, like a layout, read-only does not set all its components read-only recursively, as one might expect. Doing the same with disabled does, though.)

Therefore, to set all its components disabled, we have to looping and setting manually

 

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