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

fix!: ignore metadata when setting entry unsaved flag #3305

Closed
wants to merge 1 commit into from

Conversation

bharrisau
Copy link
Contributor

Summary

Relation widget updates metadata when first loading the relationship mapping.
These metadata updates cause any collections using the relation widget to always
get marked as having usaved changes whenever they are opened.

Note: This is obviously a pretty serious change to the underlying data model
semantics. It might not make sense, but there didn't seem to be a better way of handling
the relation widget without adding an extra field to the DRAFT_CHANGE_FIELD action
to flag that this is a metadata only change and to leave the hasChanged field alone.

This is the 'metadata fix' from #2377. Some of the issues reported in #725 will be resolved (#725 is only for new entries and default values, but many of the relation widget complaints for existing entries are being funneled to that issue - see #2743)

fixes #2211

Test plan

I've testing this fixed the relation widget for myself. I wasn't able to run the e2e test package on this machine when trying the tests:all script. The new test spec sets the hasChanged semantic.

A picture of a cute animal (not mandatory but encouraged)

image

Relation widget updates metadata when first loading the relationship mapping.
These metadata updates cause any collections using the relation widget to always
get marked as having usaved changes whenever they are opened.

Note: This is obviously a pretty serious change to the underlying data model
semantics. It might not make sense, but there didn't seem to be a better way of handling
the relation widget without adding an extra field to the DRAFT_CHANGE_FIELD action
to flag that this is a metadata only change and to leave the `hasChanged` field alone.
@bharrisau bharrisau requested a review from a team February 23, 2020 04:25
@erezrokah erezrokah self-requested a review February 24, 2020 12:17
@erezrokah
Copy link
Contributor

erezrokah commented Feb 25, 2020

@bharrisau, thanks for this. Will go over soon along with #3306 to figure out which one covers more use cases.

@bharrisau
Copy link
Contributor Author

bharrisau commented Feb 25, 2020 via email

@erezrokah
Copy link
Contributor

@bharrisau I'm closing this in favour of #3306 as that one seems to cover a wider range of issues (see the issue linked there).
Mainly that PR is meant to cover not just initial load/changing of a specific field, but also setting the changed flag to false upon returning to initial state (e.g. user undoing a change in the editor).
Feel free to comment on that PR and thank you again.

@erezrokah erezrokah closed this Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants