Skip to content

Commit

Permalink
maps/react: fix react map namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
vellip committed Jan 29, 2025
1 parent b0cfac3 commit 2707e62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion adhocracy4/maps_react/templatetags/react_maps_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def react_choose_point(polygon, point, name):
}

return format_html(
'<div data-a4-widget="choose-point" ' 'data-attributes="{attributes}"></div>',
'<div data-a4-widget="react-choose-point" '
'data-attributes="{attributes}"></div>',
attributes=json.dumps(attributes),
)
8 changes: 4 additions & 4 deletions adhocracy4/maps_react/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ def __init__(self, polygon, attrs=None):
super().__init__(attrs)

class Media:
js = ("a4maps_choose_point.js",)
js = ("a4maps_react_choose_point.js",)

css = {"all": ["a4maps_choose_point.css"]}
css = {"all": ["a4maps_react_choose_point.css"]}

def render(self, name, value, attrs, renderer=None):
if not finders.find("a4maps_choose_point.js"):
if not finders.find("a4maps_react_choose_point.js"):
raise ImproperlyConfigured(
"Configure your frontend build tool to generate a4maps_choose_point.js."
"Configure your frontend build tool to generate a4maps_react_choose_point.js."
)

context = {
Expand Down

0 comments on commit 2707e62

Please sign in to comment.