Skip to content

Fix/archived location editing - #4671

Open
Zaynebblk wants to merge 6 commits into
digitalfabrik:developfrom
Zaynebblk:fix/archived-location-editing
Open

Zaynebblk wants to merge 6 commits into
digitalfabrik:developfrom
Zaynebblk:fix/archived-location-editing

Conversation

@Zaynebblk

Copy link
Copy Markdown

Description

This PR fixes several UI elements that remained interactive when viewing archived places, even though archived places are intended to be read-only.

Previously, users could still open the opening-hours editor, interact with the map to modify the marker position and address information, and toggle the automatic-coordinate checkbox. Although these changes could not be saved, the interface incorrectly allowed users to initiate editing actions.

Changes Made

1. Opening hours

  • Updated PlaceFormView to pass the existing form's disabled state to the opening-hours configuration.
  • Updated PlaceContextMixin to use this editing permission when provided, while preserving the existing permission check as a fallback.
  • The opening-hours widget now correctly disables editing interactions for archived places, including individual days and editing buttons.

2. Automatic coordinates checkbox

  • Disabled the "Derive coordinates automatically from address" checkbox when the place is archived or the user lacks editing permission.
  • Prevented users from toggling this option on read-only place forms.

3. Map and position editing

  • Updated the map's editing permission to consider both the user's permissions and the place's archived status.
  • Modified place-map.ts to register map click and marker drag editing handlers only when editing is permitted.
  • Prevented archived places from displaying position-update options or initiating address lookups through map interactions.
  • Adjusted the map's help text to reflect the read-only state.

The map remains available for viewing and navigation.

4. Regression tests

Added parameterized tests in test_place_form.py covering both archived and active places.

The tests verify that:

  • The opening-hours configuration correctly reflects whether editing is allowed.
  • Map editing permissions are disabled for archived places.
  • The automatic-coordinate checkbox is disabled for archived places.
  • Active places retain the correct editing permissions for authorized users.

Testing

  • 101 place-form tests passed, including the new regression tests.
  • 18 existing unit tests passed.
  • All pre-commit checks passed, including Ruff, Djlint, ESLint, Prettier, Mypy, and frontend tests.
  • Manually reproduced the original issue and verified that the affected controls are no longer editable for archived places.

Related Issue

Closes #3524

@MizukiTemma MizukiTemma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening an PR 😸

I have a small suggestion (find below).

@jarlhengstmengel jarlhengstmengel added this to the Roadmap T44K milestone Nov 9, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in Integreat 💛 Nov 9, 2026
@jarlhengstmengel jarlhengstmengel moved this from In Progress to In Review in Integreat 💛 Nov 9, 2026
@jarlhengstmengel jarlhengstmengel removed this from the Roadmap T44K milestone Nov 9, 2026

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some options not disabled in archived location

4 participants