Skip to content

Commit

Permalink
Merge pull request #33994 from dimagi/riese/dynamic_map_pop_up_2
Browse files Browse the repository at this point in the history
Add validation for address popup back in
  • Loading branch information
MartinRiese committed Jan 22, 2024
2 parents d2c8310 + 95b8737 commit a37ba26
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
3 changes: 1 addition & 2 deletions corehq/apps/app_manager/helpers/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,7 @@ def validate_details_for_build(self):
self.module.case_details.long.columns,
errors)

# Temporarily comment out until migrate_address_popup has been run
# self._validate_address_popup_in_long(errors)
self._validate_address_popup_in_long(errors)

return errors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,18 @@ <h4 class="alert-heading">
<a href="{{ module_url }}">{{ module_name }}</a>
has an invalid case tile configuration. Reason: {{ error_reason }}
{% endblocktrans %}
{% case "deprecated popup configuration" %}
{% blocktrans with module_name=error.module.name|trans:langs %}
The case list in
<a href="{{ module_url }}">{{ module_name }}</a>
has an address popup configuration that should be moved to case detail.
{% endblocktrans %}
{% case "invalid clickable icon configuration" %}
{% blocktrans with module_name=error.module.name|trans:langs error_reason=error.reason %}
The case list in
<a href="{{ module_url }}">{{ module_name }}</a>
has an invalid clickable icon configuration. Reason: {{ error_reason }}
{% endblocktrans %}
{% case "no source module id" %}
{% blocktrans with module_name=error.module.name|trans:langs %}
Shadow module
Expand Down
36 changes: 17 additions & 19 deletions corehq/apps/app_manager/tests/test_build_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,25 +173,23 @@ def test_clickable_icon_configuration_errors(self, *args):
self._clean_unique_id(errors)
self.assertIn(case_tile_error, errors)

# Temporarily comment out until migrate_address_popup has been run and
# _validate_address_popup_in_long has been added back in
# def test_address_popup_defined_in_case_list(self, *args):
# case_tile_error = {
# 'type': "invalid tile configuration",
# 'module': {'id': 0, 'name': {'en': 'first module'}},
# 'reason': 'Format "Address Popup" should be used in the Case Detail not Case List.'
# }
# app, module = self.create_app_with_module()
# module.case_details.short.columns.append(DetailColumn(
# format='address-popup',
# field='field',
# header={'en': 'Column'},
# model='case',
# ))
#
# errors = app.validate_app()
# self._clean_unique_id(errors)
# self.assertIn(case_tile_error, errors)
def test_address_popup_defined_in_case_list(self, *args):
case_tile_error = {
'type': "deprecated popup configuration",
'module': {'id': 0, 'name': {'en': 'first module'}},
'reason': 'Format "Address Popup" should be used in the Case Detail not Case List.'
}
app, module = self.create_app_with_module()
module.case_details.short.columns.append(DetailColumn(
format='address-popup',
field='field',
header={'en': 'Column'},
model='case',
))

errors = app.validate_app()
self._clean_unique_id(errors)
self.assertIn(case_tile_error, errors)

def test_address__defined_twice(self, *args):
case_tile_error = {
Expand Down

0 comments on commit a37ba26

Please sign in to comment.