Modify

Opened 3 years ago

Closed 4 days ago

Last modified 4 days ago

#21840 closed enhancement (fixed)

[Patch] Automatically refresh relation editor on external changes

Reported by: Woazboat Owned by: team
Priority: normal Milestone: 25.05
Component: Core Version:
Keywords: Cc:

Description

Relation data in currently open relation editor windows is automatically reloaded when the relation is modified outside of the relation editor and there are no pending changes in the editor. If the relation has already been modified in the editor by the user and there are pending changes, display a warning notification instead that a conflict resolution will be required.

https://github.com/JOSM/josm/pull/88
https://patch-diff.githubusercontent.com/raw/JOSM/josm/pull/88.patch

Attachments (0)

Change History (6)

comment:1 by Woazboat, 3 years ago

Related to #12410 #12411 #15371 #16112

Last edited 3 years ago by Woazboat (previous) (diff)

comment:2 by taylor.smock, 3 years ago

A couple of comments from my perspective (feel free to disagree):

  • I think that isDirtyRelation() should have a default implementation of isDirtyRelation(false). You could go the other way (isDirtyRelation(boolean) defaults to calling isDirtyRelation(), which is probably better from an backward-looking standpoint, but it doesn't look like any plugins in SVN/JOSM GitHub use it).
  • You need to update GenericRelationEditorTest.java with the new method, if you aren't going to add a default implementation for isDirtyRelation(boolean).
  • Tests verifying the correctness of the logic would be nice. Unless we want someone to accidentally break it in the future. For this, you'd probably want to use JOptionPaneSimpleMocker.

comment:3 by Woazboat, 3 years ago

I added the default implementation for isDirtyRelation() and updated the test. Adding a unit test for the new refresh logic would be a bit more involved and also require some refactoring of the existing code as far as I can tell.

comment:4 by stoecker, 4 days ago

Milestone: 25.05

comment:5 by stoecker, 4 days ago

Resolution: fixed
Status: newclosed

In 19398/josm:

Auto relation refresh, fix #21840 - patch by Woazboat

comment:6 by stoecker, 4 days ago

In 19402/josm:

fix boolean logic broken in r19398, see #21840

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.