diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/reports/tableau_visualization.html.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/reports/tableau_visualization.html.diff.txt index ff597cbacac9..25d35a3c9b5b 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/reports/tableau_visualization.html.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/reports/tableau_visualization.html.diff.txt @@ -11,10 +11,10 @@ {% block pagination_header %}

{% trans "Tableau Visualizations" %}

-@@ -13,9 +13,9 @@ - +@@ -14,9 +14,9 @@ + - +

{% trans "Update Tableau Visualization" %} : -@@ -40,32 +40,32 @@ +@@ -41,32 +41,32 @@ @@ -79,7 +79,7 @@ {% trans "Delete" %} -@@ -86,7 +86,7 @@ +@@ -88,7 +88,7 @@ {% block pagination_footer %}
diff --git a/corehq/apps/reports/forms.py b/corehq/apps/reports/forms.py index b938a745d1b1..b84da0c4bcbb 100644 --- a/corehq/apps/reports/forms.py +++ b/corehq/apps/reports/forms.py @@ -413,6 +413,12 @@ class TableauVisualizationForm(forms.ModelForm): view_url = forms.CharField( label=_('View URL'), ) + location_safe = forms.BooleanField( + label=_('Visible to location-restricted users'), + help_text=_('If checked, the visualization will be visible to users with roles that do not have ' + '"Full Organization Access"'), + required=False, + ) class Meta: model = TableauVisualization @@ -420,6 +426,7 @@ class Meta: 'title', 'server', 'view_url', + 'location_safe', ] def __init__(self, domain, *args, **kwargs): @@ -435,6 +442,7 @@ def helper(self): crispy.Field('title'), crispy.Field('server'), crispy.Field('view_url'), + crispy.Field('location_safe'), FormActions( StrictButton( @@ -469,6 +477,7 @@ class Meta: 'title', 'server', 'view_url', + 'location_safe', ] @property @@ -482,6 +491,7 @@ def helper(self): crispy.Field('title'), crispy.Field('server'), crispy.Field('view_url'), + crispy.Field('location_safe'), css_class='modal-body', ), FormActions( diff --git a/corehq/apps/reports/migrations/0019_tableauvisualization_location_safe.py b/corehq/apps/reports/migrations/0019_tableauvisualization_location_safe.py new file mode 100644 index 000000000000..2f8a537505bf --- /dev/null +++ b/corehq/apps/reports/migrations/0019_tableauvisualization_location_safe.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.14 on 2024-08-05 18:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('reports', '0018_alter_tableauuser_role'), + ] + + operations = [ + migrations.AddField( + model_name='tableauvisualization', + name='location_safe', + field=models.BooleanField(default=False), + ), + ] diff --git a/corehq/apps/reports/models.py b/corehq/apps/reports/models.py index 7e3ccf02269a..2716f7065e1c 100644 --- a/corehq/apps/reports/models.py +++ b/corehq/apps/reports/models.py @@ -170,6 +170,7 @@ class TableauVisualization(models.Model): server = models.ForeignKey(TableauServer, on_delete=models.CASCADE) view_url = models.CharField(max_length=256) upstream_id = models.CharField(max_length=32, null=True) + location_safe = models.BooleanField(default=False) @property def name(self): diff --git a/corehq/apps/reports/templates/reports/bootstrap3/tableau_visualization.html b/corehq/apps/reports/templates/reports/bootstrap3/tableau_visualization.html index 3d9979449961..1e3cf935050b 100644 --- a/corehq/apps/reports/templates/reports/bootstrap3/tableau_visualization.html +++ b/corehq/apps/reports/templates/reports/bootstrap3/tableau_visualization.html @@ -13,6 +13,7 @@

{% trans "Tableau Visualizations" %}

+