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

Close metadata editor without saving raises no warning? #4821

Closed
matthias-ronge opened this issue Nov 11, 2021 · 5 comments
Closed

Close metadata editor without saving raises no warning? #4821

matthias-ronge opened this issue Nov 11, 2021 · 5 comments

Comments

@matthias-ronge
Copy link
Collaborator

We have observed that if you have been working in the metadata editor, then you close with the "Close" button, it goes away, but there is no warning of the form: "Do you want to exit without saving?" This is functionally correct, but we were surprised because we felt we were expecting a warning pop-up.

Question: Is that intended? Should we include a warning, or is it fine without?

@andre-hohmann
Copy link
Collaborator

In my opinion the warning would be helpful, when it really appears only after changes have been made. If it appears always, i think it will be annoying. I often open the metadata editor to examine the metadata without changing anything.

As in Kitodo.Production 2.x no warning appears, i think that most users are used to the behaviour without a warning message. I never heard that this has caused loss of metadata. Thus, for me it is not of high priority.

Maybe there are other experiences in other institutions.

@matthias-ronge
Copy link
Collaborator Author

Yes, I only meant when something was actually changed.

It looks like this is a bug. There is such functionality implemented (Variable workpieceOriginalState in class DataEditorForm) but it doesn’t work under all circumstances.

I added the invalid label because the error description is too imprecise (I first have to test exactly which changes are not correctly noticed; unfortunately I don't know anymore either).

@matthias-ronge matthias-ronge self-assigned this Nov 16, 2021
@matthias-ronge matthias-ronge removed their assignment Apr 26, 2022
@solth solth removed the 3.x label Jul 7, 2022
@solth solth added this to the Kitodo.Production 3.6.0 milestone Feb 11, 2023
@solth
Copy link
Member

solth commented Feb 11, 2023

In my opinion it is not a bug that the warning does not appear when the user closes the metadata editor explicitely using the "Close" button, because it suggests he discarded changes deliberately. At least that is how it is implemented right now.
Instead, atm the warning is implemented to only be shown if the user closes the editor by any other means (clicking another link like for example a breadcrumb link or the Kitodo logo in the upper left, manually entering a new URL in the browsers address field or closing the tab/browser altogether).

This behaviour is still bugged at the moment, though, because the warning currently often occurs even when the user did not actually make any changes to the workpiece at all.
After analysing the current behavior, I found out that the follwoing two actions cause this wrong "Unsaved changes" warning dialog even though no real changes were made to the workpiece:

  • the user selects a structure by clicking on the corresponding node in the structure tree or gallery stripe in the gallery. Reason: the group property of MetadataGroup instances of the selected structure in the workpiece variable of DataEditorForm is set to ArrayList<Metadata> when the user clicks a structure element, whereas the corresponding group properties in workpieceOriginalState are of type HashSet<Metadata>. The method MetadataGroup.equals (which is used for detecting changes) compares - among others - the class of the group property, resulting in workpiece and workpieceOriginalState being evaluated as different (because HashSet is unequal to ArrayList)
  • the user clicks on an unpaginated page/media in the structure tree or gallery. Reason: when a page is first saved to the workpiece without explicit pagination, it's ORDERLABEL attribute will be set to " - " (with leading and trailing whitespace). When selecting the page in the metadata editor once (without paginating/changing it), the ORDERLABEL is set to "-" (without leading or trailing whitespace), which again results in the workpiece and workpieceOriginalState being evaluated as differenct.

I opened a pull request to fix these two errors: #5536

@solth
Copy link
Member

solth commented Jul 4, 2023

@kitodo/kitodo-community-board is the current behaviour described in my comment above sufficient in your opinion or should the implementation be changed to also display the "Warning" dialog when explicitly closing the metadata editor with unsaved changes via the "Close" button?

@subhhwendt
Copy link
Collaborator

We discussed this issue in the community board and we can confirm that the current behaviour of the button is the expected one.

@solth solth closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants