Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-8153

Page Editor does not reload after editing a component

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Neutral
    • 6.3.0
    • None
    • None
    • None

    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.

       

       

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              rdhar Rishab Dhar
              czimmermann Christopher Zimmermann
              DeveloperX
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Work Started:

                Checklists

                  Bug DoR
                  Task DoD

                  Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 6h 50m
                    6h 50m