Skip to content

Fix Mission dialog title reset and add unsaved-changes warning#181

Open
Knobee wants to merge 1 commit intobrian7704:masterfrom
Knobee:fix/mission-dialog-ux-180
Open

Fix Mission dialog title reset and add unsaved-changes warning#181
Knobee wants to merge 1 commit intobrian7704:masterfrom
Knobee:fix/mission-dialog-ux-180

Conversation

@Knobee
Copy link
Copy Markdown

@Knobee Knobee commented Apr 27, 2026

Summary

  • Addresses Issues 1 and 2 of Mission Dialog UX Improvements #180.
  • Issue 1: After editing a mission, clicking "New Mission" again now correctly shows "Add Mission" as the dialog title and submit button label, instead of the stale "Edit Mission".
  • Issue 2: Closing the mission dialog (outside-click, ESC, or close button) with unsaved changes now opens a confirmation prompt instead of silently discarding the work. Saving or discarding clears the dirty flag.

Issue 3 — out of scope

Issue 3 (no UI to remove an existing mission password) needs a backend change before it can be done cleanly:

  • The DELETE /Marti/api/missions/<name>/password endpoint cited in the issue requires a Data Sync token / iTAK certificate and is not callable from the admin web UI.
  • The /api/missions POST handler ignores password: "" on create (mission_api.py:103).
  • The PUT/edit branch would set password="" but does not recompute password_protected, leaving stale state.

This needs a separate UI + backend PR.

Test plan

  • Open "New Mission", close, click Edit on a mission, close, click "New Mission" — dialog title and submit button both read "Add Mission".
  • Open "New Mission", type into Name, press ESC — confirmation prompt appears. "Discard" closes both dialogs; "Keep editing" only closes the prompt.
  • Open "New Mission", click outside dialog without typing anything — closes silently (no false-positive prompt).
  • Submitting a new or edited mission via the dialog button still works and clears the dirty flag.

🤖 Generated with Claude Code

Addresses issues 1 and 2 of brian7704#180.

- New Mission button now resets the dialog title back to "Add Mission"
  after the user has previously opened the Edit dialog.
- Modal close (outside-click / ESC / x button) now opens a confirmation
  prompt when the form has unsaved changes, instead of discarding them
  silently.

Issue 3 (password removal) needs a backend change in
brian7704/OpenTAKServer mission_api.py and is out of scope for this PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@brian7704
Copy link
Copy Markdown
Owner

Thanks for this PR. I tested it but the new "are you sure" modal renders behind the already opened add/edit mission modal making it unclickable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants