Details
-
Bug
-
Resolution: Done
-
Neutral
-
None
-
None
-
None
-
Empty show more show less
-
DevX 42
-
1
-
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:
- Downoad the 'PM Norsu' git project locally.
- Checkout the to the branch I created for you: env/
MGNLUI-8153-no-refresh-on-edit
- 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.
Checklists
Attachments
1.
|
Implementation |
|
Completed | Rishab Dhar | ||||||||
2.
|
Review |
|
Completed | Robert Šiška | ||||||||
3.
|
PiQA |
|
Completed | Robert Šiška | ||||||||
4.
|
QA |
|
Closed | Oanh Thai Hoang |
|