Skip to content

Commit

Permalink
controlbar/react: fix district filter not working for city wide; fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vellip committed Jan 29, 2025
1 parent 737fa48 commit 91699ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion meinberlin/apps/plans/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.urls import reverse
from django.utils import timezone
from django.utils.functional import cached_property
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _
from django.views import generic
from django.views.generic.detail import SingleObjectMixin
Expand Down Expand Up @@ -100,7 +101,7 @@ def get_organisations(self):
def get_districts(self):
districts = AdministrativeDistrict.objects.values("id", "name")
districts_list = [district for district in districts]
districts_list.append({"id": -1, "name": "City Wide"})
districts_list.append({"id": -1, "name": gettext("City wide")})
return json.dumps(districts_list)

def get_topics(self):
Expand Down
2 changes: 2 additions & 0 deletions meinberlin/react/projects/ProjectTile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function truncateText (item) {
}
}

// FIXME: change to `ref` when using this component once we are on react v19
// see https://react.dev/reference/react/forwardRef
const ProjectTile = forwardRef(function ProjectTile ({ project, isHorizontal, topicChoices, isMapTile }, ref) {
const labelId = useId()
const describedById = useId()
Expand Down
2 changes: 1 addition & 1 deletion meinberlin/react/projects/ProjectsMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Markers = ({ items, topicChoices }) => {
<ProjectTile
project={activeProject.properties}
topicChoices={topicChoices}
ref={(node) => node?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })}
ref={(node) => node?.scrollIntoView?.({ behavior: 'smooth', block: 'nearest' })}
isHorizontal
isMapTile
/>
Expand Down

0 comments on commit 91699ba

Please sign in to comment.