[MGNLUI-8153] Page Editor does not reload after editing a component Created: 29/Jun/23  Updated: 17/Aug/23  Resolved: 24/Jul/23

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

Type: Bug Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Rishab Dhar
Resolution: Done Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 6h 50m Time Spent: 2h 50m
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-8229 Implementation Sub-task Completed Rishab Dhar  
MGNLUI-8230 Review Sub-task Completed Robert Šiška  
MGNLUI-8231 PiQA Sub-task Completed Robert Šiška  
MGNLUI-8234 QA Sub-task Closed Oanh Thai Hoang  
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
Epic Link: SPA Editor Backlog
Sprint: DevX 42
Story Points: 1
Team: DeveloperX
Work Started:
Approved:
Yes

 Description   

On SaaS (It works on DXCORE with react-minimal project),

For example on the “Hello-SaaS-Tutorial” project. (but also on other projects)

When you go to a page from the browser, the first time that you EDIT a component, the Page editor does not auto-reload and so you do not see the change that has been made.

The second time you edit the component (in the dialog you see that the change WAS MADE), and save the component, then the page reloads and the page shows the edit.

Note - The Delete and Add component actions work propertly - the page always reloads.

NOTES

Please sync with Nucleus team as this relates to a module in their domain.

Please do some research into why the code is as-it-is, possibly the bug was introduced trying to solve some specific case, and we don't want to break that.

 

Developer notes

The PageEditorPresenter refreshes the editor if the DatasourceObservation is triggered AND if the locale hasn't changed. But for some reason, the locale is set to "en" when the page is opened, but opening the component dialogs re-sets it to "en_US".

Since i18n is only partially implemented in norsu, a quick fix would be to return MagnoliaContext.getLocale in i18nAuthoringSupport (just as the Javadoc says) instead of Locale.getDefault which reads it directly from JVM. But because this code is shared by both JCR and norsu, we should verify that it doesn't break anything else.

 

Reproducing the Error

The error is occuring on several projects that are using Next.JS SSG with "Preview mode".

One project is the "Recommender" project on the "PM Norsu" instance.

To Reproduce:

  • In terminal, go into "/frontends/recommender". then
    • npm install
    • npm run dev
    • (It will be running on localhost:3000)
  • Log into 'PM Norsu' instance.
  • use environment switcher to switch to : `env/MGNLUI-8153-no-refresh-on-edit`.
  • Open pages app
  • Open page "recommend"
  • Edit the "hero" component in the "main" area.
    • Change the Title to something new.
    • "Save changes"
  • RESULT: 
    • The dialog closes, the the page does not refresh. So the change is not visible (but content was changed in fact)
  • Edit the "hero" component agaain, and "Save Changes"
  • RESULT:
    • The dialog closes, the page refreshes, and the change is visible.

 

 


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