Skip to content

Commit

Permalink
Update task status on unlock, add task id to upload question
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed May 30, 2024
1 parent 67cd1ef commit 1f6b86c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.openstreetmap.josm.data.osm.IPrimitive;
import org.openstreetmap.josm.gui.MainApplication;
import org.openstreetmap.josm.plugins.maproulette.api.TaskAPI;
import org.openstreetmap.josm.plugins.maproulette.api.enums.TaskStatus;
import org.openstreetmap.josm.plugins.maproulette.api.model.Task;
import org.openstreetmap.josm.plugins.maproulette.gui.ModifiedObjects;
import org.openstreetmap.josm.plugins.maproulette.gui.layer.MapRouletteClusteredPointLayer;
Expand Down Expand Up @@ -112,7 +111,7 @@ private void unlockTasks() {
final var unlockedTask = TaskAPI.release(cluster.id());
if (task != null && task.id() == unlockedTask.id()) {
final var modified = ModifiedObjects.getModifiedTask(task.id());
if (modified != null && modified.status() != TaskStatus.FIXED) {
if (modified != null) {
TaskAPI.updateStatus(task.id(), modified.status(), modified.comment(), modified.tags(),
modified.reviewRequested(), modified.completionResponses());
ModifiedObjects.removeModifiedTask(modified);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public boolean checkUpload(APIDataSet apiDataSet) {
final var descriptivePanel = createDescriptivePanel(task, apiDataSet);
final var didFix = ConditionalOptionPaneUtil.showConfirmationDialog(PREF_CHECK_IF_FINISHED,
MainApplication.getMainFrame(), descriptivePanel,
tr("Did you finish the following MapRoulette Task?"), JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_OPTION);
tr("Did you finish the following MapRoulette Task: {0}?", task.id()),
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_OPTION);
if (didFix) {
final var doc = (HTMLDocument) ((JosmEditorPane) descriptivePanel.getComponent(1)).getDocument();
ModifiedObjects.addModifiedTask(
Expand Down

0 comments on commit 1f6b86c

Please sign in to comment.