Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor is not warned about unsave changes in inspector (on publish, on page close) #2670

Closed
franzkugelmann opened this issue Feb 10, 2020 · 2 comments · Fixed by #3491
Closed
Assignees
Labels
7.3 8.3 Accessibility Bug Label to mark the change as bugfix UI & UX

Comments

@franzkugelmann
Copy link

Description

One of the editors of our customer stumbled upon the following issue:

Steps to Reproduce

  1. Do changes in the content area - now you have unpublished changes
  2. Open the inspector on the right and change something there, but "forget" to click the apply button
  3. You are used to the system warning you about unsaved changes in the inspector
  4. You click the publish button and get the feedback, that all was successfully published
  5. The change in the inspector is still unsaved, but you do not notice it, because in former versions of Neos you got a warning, if you left the inspector without hitting the "apply" button.
  6. You log our or close the window and your change is lost without you even realizing it.

Expected behavior

If you click on the top frame when there is an not-applied change in the inspector, you should get the same warning about unsaved changes as when you click in the content area.

Affected Versions

Neos: 5.x
UI: 5.x

This is not a big issue, but might be fixed easily and would avoid frustration for the editors.

@mhsdesign
Copy link
Member

Sorry for the late response ;)

I can reproduce this issue with UI version: v8.1.0 and i noticed it myself lately.

maybe we can add a beforeunload hook, that prevents closing the page accidentally (which would also solve your issue but in a much wider range ;) )

We could add this to the <Inspector />

    public warnUserForPossibleNotSavedChanges(e) {
        if (this.pendingChanges) {
            const confirmationMessage = "Pending changes at ... property ... do you really want to close the window";
            (e || window.event).returnValue = confirmationMessage;
            return confirmationMessage;
        }
    }

    public componentDidMount() {
        window.addEventListener(
            "beforeunload",
            this.warnUserForPossibleNotSavedChanges
        );
    }

    public componentWillUnmount() {
        window.removeEventListener(
            "beforeunload",
            this.warnUserForPossibleNotSavedChanges
        );
    }

image

@mhsdesign mhsdesign changed the title Editor is not warned about unsave changes in inspector when changing focus into top area (publish, logout) Editor is not warned about unsave changes in inspector (on publish, on page close) Oct 12, 2022
@grebaldi grebaldi added Bug Label to mark the change as bugfix Accessibility 7.3 8.3 labels May 1, 2023
@grebaldi
Copy link
Contributor

grebaldi commented May 1, 2023

I suggest we keep this separate from #2059. As far as I understand the original issue, it was about the "Not Applied"-Dialog not showing up if the user clicks anywhere outside the guest frame. I do not believe that #2059 would fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.3 8.3 Accessibility Bug Label to mark the change as bugfix UI & UX
Projects
None yet
5 participants