[PAGES-268] Upon locale switch in dialog, the page editor state resets selection to page, causing data to be written there Created: 16/Mar/20  Updated: 18/Oct/21  Resolved: 23/Mar/20

Status: Closed
Project: Magnolia pages module
Component/s: None
Affects Version/s: 6.2
Fix Version/s: 6.2

Type: Bug Priority: Neutral
Reporter: Aleksandr Pchelintcev Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0.25d
Time Spent: 3.05h
Original Estimate: Not Specified

Attachments: Zip Archive hello-magnolia.zip     PNG File wrong-path-store.png    
Issue Links:
Problem/Incident
causes PAGES-274 Page editor locale is not synchronise... Open
causality
is causing PAGES-513 Subapp and dialog locale not in sync Closed
dependency
is depended upon by MKTAUT-104 Test. Check i18n support for marketin... 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
Date of First Response:
Sprint: UI Framework 20
Story Points: 5

 Description   

Prepare:

Prepare one dialog component as below:

form:
  properties:
    testfield:
      label: testfield
      $type: textField
      i18n: true

or you can use hello-template that attached to this ticket hello-magnolia.zip

Step to reproduce:

  • Create new page hello-template
  • Create new component from hello-template ( this is important step, you must create new component)
  • Fill data in en view
  • Switch to de locale in locale selector
  • Fill data in de view
  • Click save

 

Observe: Wrong path storage 

 

Expect: component must be store correctly.

 

 

 



 Comments   
Comment by Roman Kovařík [ 17/Mar/20 ]

Could we remove

 localeContext.current().observe(locale -> locale
                .ifPresent(l -> {
                    pageEditorStatus.setI18nKeys(Arrays.stream(AREAS_I18N_KEYS).collect(Collectors.toMap(Function.identity(), i18n::translate)));
                    pageEditorStatus.setLocale(l);
                    if (view.asVaadinComponent().isAttached()) {
                        loadPageEditor();
                    }
                }));
 

and do the language update here?

observation = datasourceObservation.register(() -> {
            updateParameters();
            view.refresh();
        });
Generated at Mon Feb 12 06:17:16 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.