Skip to content

Commit

Permalink
Merge branch 'dependabot/pip/requirements/reportlab-4.3.0' of https:/…
Browse files Browse the repository at this point in the history
…/github.com/dimagi/commcare-hq into dependabot/pip/requirements/reportlab-4.3.0
  • Loading branch information
orangejenny committed Feb 12, 2025
2 parents e9e4d42 + 7dbdf02 commit 0217392
Show file tree
Hide file tree
Showing 90 changed files with 1,336 additions and 503 deletions.
6 changes: 4 additions & 2 deletions corehq/apps/analytics/templates/analytics/initial/gtm.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
{% initial_analytics_data 'gtm.userIsCommCareUser' request.couch_user.is_commcare_user %}
{% initial_analytics_data 'gtm.isNewUser' request.couch_user|is_new_user %}
{% endif %}
{% if domain or request.domain %}
{% initial_analytics_data 'gtm.domain' domain|default:request.domain %}
{% if request.domain %}
{% initial_analytics_data 'gtm.domain' request.domain %}
{% elif domain %}
{% initial_analytics_data 'gtm.domain' domain %}
{% endif %}
{% if ANALYTICS_CONFIG.HQ_INSTANCE %}
{% initial_analytics_data 'gtm.hqInstance' ANALYTICS_CONFIG.HQ_INSTANCE %}
Expand Down
198 changes: 104 additions & 94 deletions corehq/apps/app_manager/static/app_manager/js/forms/case_config_ui.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ <h4 class="panel-title panel-title-nolink">
</div>
</div>
<i class="fa fa-arrow-right"></i><i class="fa fa-save"></i>
{% trans "Save Questions to Case Properties" %}
<!-- ko text: title --><!-- /ko -->
</h4>
</div>
<div class="panel-body">
Expand Down Expand Up @@ -338,7 +338,7 @@ <h4 class="panel-title panel-title-nolink">
<!-- ko if: !case_properties().length && !$parent.hasPrivilege -->
<p>
{% blocktrans %}
You no longer have permission to save case properties.
You no longer have permission to save this section.
{% endblocktrans %}
</p>
<!-- /ko -->
Expand Down
50 changes: 50 additions & 0 deletions corehq/apps/cleanup/migrations/0018_delete_ewsghana_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('cleanup', '0017_delete_oauth_integrations_models'),
]

operations = [
migrations.RunSQL("""
DROP TABLE IF EXISTS "ewsghana_facilityincharge" CASCADE;
DROP TABLE IF EXISTS "ewsghana_ewsextension" CASCADE;
DROP TABLE IF EXISTS "ewsghana_sqlnotification" CASCADE;
"""),
]


"""
Dropped entities can be checked with the following query:
select pg_describe_object(classid, objid, objsubid)
from pg_depend
where refobjid in (
'ewsghana_facilityincharge'::regclass,
'ewsghana_ewsextension'::regclass,
'ewsghana_sqlnotification'::regclass
);
Example output (from production):
type ewsghana_ewsextension
sequence ewsghana_ewsextension_id_seq
type ewsghana_facilityincharge
sequence ewsghana_facilityincharge_id_seq
type ewsghana_sqlnotification
sequence ewsghana_sqlnotification_id_seq
default value for column id of table ewsghana_ewsextension
default value for column id of table ewsghana_facilityincharge
default value for column id of table ewsghana_sqlnotification
constraint ewsghana_ewsextension_pkey on table ewsghana_ewsextension
constraint ewsghana_facilityincharge_pkey on table ewsghana_facilityincharge
constraint ewsghana_sqlnotification_pkey on table ewsghana_sqlnotification
index ewsghana_ewsextension_e274a5da
index ewsghana_ewsextension_e8701ad4
index ewsghana_ewsextension_location_id_636bec0358987f83_like
index ewsghana_ewsextension_user_id_6cff5f4a22d0e14b_like
index ewsghana_facilityincharge_location_id
index ewsghana_facilityincharge_user_id
index ewsghana_facilityincharge_user_id_like
constraint ewsgha_location_id_4879eb14d7a4a143_fk_locations_sqllocation_id on table ewsghana_facilityincharge
(20 rows)
"""
Empty file.
28 changes: 28 additions & 0 deletions corehq/apps/data_cleaning/tables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from django.utils.translation import gettext_lazy
from django_tables2 import columns

from corehq.apps.hqwebapp.tables.elasticsearch.records import CaseSearchElasticRecord
from corehq.apps.hqwebapp.tables.elasticsearch.tables import ElasticTable
from corehq.apps.hqwebapp.tables.htmx import BaseHtmxTable


class CleanCaseTable(BaseHtmxTable, ElasticTable):
record_class = CaseSearchElasticRecord

class Meta(BaseHtmxTable.Meta):
pass

name = columns.Column(
verbose_name=gettext_lazy("Case Name"),
)
case_type = columns.Column(
accessor="@case_type",
verbose_name=gettext_lazy("Case Type"),
)
status = columns.Column(
accessor="@status",
verbose_name=gettext_lazy("Status"),
)
opened_on = columns.Column(
verbose_name=gettext_lazy("Opened On"),
)
27 changes: 27 additions & 0 deletions corehq/apps/data_cleaning/templates/data_cleaning/cases.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% extends "hqwebapp/bootstrap5/base_navigation.html" %}
{% load hq_shared_tags %}
{% load django_tables2 %}
{% load i18n %}

{% js_entry "hqwebapp/js/htmx_and_alpine" %}

{% block content %}
<div class="container p-5">
<h1 class="py-3 m-0">
{% trans "Case Data Cleaning Test View" %}
</h1>
<div
hx-trigger="load"
hx-get="{% url "data_cleaning_cases_table" domain %}{% querystring %}"
>
<div class="htmx-indicator">
<i class="fa-solid fa-spinner fa-spin"></i> {% trans "Loading..." %}
</div>
</div>
</div>
{% endblock %}

{% block modals %}
{% include "hqwebapp/htmx/error_modal.html" %}
{{ block.super }}
{% endblock modals %}
11 changes: 11 additions & 0 deletions corehq/apps/data_cleaning/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.urls import re_path as url

from corehq.apps.data_cleaning.views import (
CleanCasesMainView,
CleanCasesTableView,
)

urlpatterns = [
url(r'^cases/$', CleanCasesMainView.as_view(), name=CleanCasesMainView.urlname),
url(r'^cases/table/$', CleanCasesTableView.as_view(), name=CleanCasesTableView.urlname),
]
31 changes: 31 additions & 0 deletions corehq/apps/data_cleaning/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from django.utils.decorators import method_decorator

from corehq import toggles
from corehq.apps.data_cleaning.tables import CleanCaseTable
from corehq.apps.domain.decorators import LoginAndDomainMixin
from corehq.apps.domain.views import BaseDomainView, DomainViewMixin
from corehq.apps.es import CaseSearchES
from corehq.apps.hqwebapp.decorators import use_bootstrap5
from corehq.apps.hqwebapp.tables.pagination import SelectablePaginatedTableView


@method_decorator([
use_bootstrap5,
toggles.DATA_CLEANING_CASES.required_decorator(),
], name='dispatch')
class CleanCasesMainView(BaseDomainView):
urlname = "data_cleaning_cases"
template_name = "data_cleaning/cases.html"

@property
def section_url(self):
return ""


@method_decorator(toggles.DATA_CLEANING_CASES.required_decorator(), name='dispatch')
class CleanCasesTableView(LoginAndDomainMixin, DomainViewMixin, SelectablePaginatedTableView):
urlname = "data_cleaning_cases_table"
table_class = CleanCaseTable

def get_queryset(self):
return CaseSearchES().domain(self.domain)
1 change: 1 addition & 0 deletions corehq/apps/dump_reload/tests/test_dump_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"pillowtop.DjangoPillowCheckpoint",
"pillowtop.KafkaCheckpoint",
"project_limits.DynamicRateDefinition",
"project_limits.SystemLimit",
"project_limits.RateLimitedTwoFactorLog",
"project_limits.PillowLagGaugeDefinition",
"registration.SelfSignupWorkflow",
Expand Down
8 changes: 4 additions & 4 deletions corehq/apps/hqwebapp/templatetags/hq_shared_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,15 +603,15 @@ def html_attr(value):
return conditional_escape(value)


def _create_page_data(parser, token, node_slug):
split_contents = token.split_contents()
def _create_page_data(parser, original_token, node_slug):
split_contents = original_token.split_contents()
tag = split_contents[0]
name = parse_literal(split_contents[1], parser, tag)
value = parser.compile_filter(split_contents[2])

class FakeNode(template.Node):
# must mock token or error handling code will fail and not reveal real error
token = Token(TokenType.TEXT, '', (0, 0), 0)
token = original_token
origin = parser.origin

def render(self, context):
resolved = value.resolve(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ hqDefine("reports/js/bootstrap3/standard_hq_report", [
}

if (typeof standardHQReport !== 'undefined') {
// Custom reports, notably ewsghana
// Custom reports
standardReport = standardHQReport;
} else {
// Standard reports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ hqDefine("reports/js/bootstrap5/standard_hq_report", [
}

if (typeof standardHQReport !== 'undefined') {
// Custom reports, notably ewsghana
// Custom reports
standardReport = standardHQReport;
} else {
// Standard reports
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,50 @@
<form action="#someUrl"
method="post">
<form
action="#someUrl"
method="post"
>
<!-- the {% csrf_token %} template tag should be included here -->
<fieldset>
<legend>Basic Information</legend>
<div class="row mb-3">
<label for="id_first_name" class="field-label">
<label for="id-first-name" class="field-label">
First Name
</label>
<div class="field-control">
<input type="text"
name="first_name"
class="form-control"
id="id_first_name"
autocomplete="off" />
<input
id="id-first-name"
class="form-control"
type="text"
name="first_name"
autocomplete="off"
/>
</div>
</div>
<div class="row mb-3">
<label for="id_favorite_color" class="field-label">
<label for="id-favorite-color" class="field-label">
Favorite Color
</label>
<div class="field-control">
<select name="favorite_color"
class="form-select hqwebapp-select2"
id="id_favorite_color">
<select
id="id-favorite-color"
class="form-select hqwebapp-select2"
name="favorite_color"
>
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
</select>
</div>
</div>
<div class="row mb-3">
<label for="id_hopes" class="field-label">
<label for="id-hopes" class="field-label">
Hopes and Dreams
</label>
<div class="field-control">
<textarea name="hopes"
class="form-control vertical-resize"
id="id_hopes"></textarea>
<textarea
id="id-hopes"
class="form-control vertical-resize"
name="hopes"
></textarea>
</div>
</div>
</fieldset>
Expand All @@ -46,4 +54,4 @@
<a href="#" class="btn btn-outline-primary">Cancel</a>
</div>
</div>
</form>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
<td>closed</td>
</tr>
</tbody>
</table>
</table>
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
<div class="form-check">
<input class="form-check-input"
type="checkbox"
value=""
id="flexCheckDefault">
<label class="form-check-label"
for="flexCheckDefault">
<input
id="id-flex-check-default"
class="form-check-input"
type="checkbox"
value=""
/>
<label
for="id-flex-check-default"
class="form-check-label"
>
Default checkbox
</label>
</div>
<div class="form-check">
<input class="form-check-input"
type="checkbox"
value=""
id="flexCheckChecked"
checked>
<label class="form-check-label"
for="flexCheckChecked">
<input
id="id-flex-check-checked"
class="form-check-input"
type="checkbox"
value=""
checked
/>
<label
for="id-flex-check-checked"
class="form-check-label"
>
Checked checkbox
</label>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
<form>
<div class="mb-3">
<label for="message-input" class="form-label">Message</label>
<textarea id="message-input" name="message" class="form-control" rows="3"></textarea>
<label for="id-message-input" class="form-label">Message</label>
<textarea
id="id-message-input"
class="form-control"
name="message"
rows="3"
></textarea>
</div>
<div class="mb-3">
<div class="form-check">
<input class="form-check-input"
type="checkbox"
name="tosAgree"
id="tosAgree-input">
<label class="form-check-label"
for="tosAgree-input">
<input
id="id-tos-agree-input"
class="form-check-input"
type="checkbox"
name="tosAgree"
/>
<label
for="id-tos-agree-input"
class="form-check-label"
>
I agree to the terms of service
</label>
</div>
Expand Down
Loading

0 comments on commit 0217392

Please sign in to comment.