Skip to content

Commit

Permalink
Merge pull request #35758 from dimagi/mjr/analytics-domain-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mjriley authored Feb 12, 2025
2 parents 011c2ea + 6437f81 commit fea74fe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
7 changes: 3 additions & 4 deletions corehq/apps/analytics/templates/analytics/initial/gtm.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
{% initial_analytics_data 'gtm.userIsCommCareUser' request.couch_user.is_commcare_user %}
{% initial_analytics_data 'gtm.isNewUser' request.couch_user|is_new_user %}
{% endif %}
{% if request.domain %}
{% initial_analytics_data 'gtm.domain' request.domain %}
{% elif domain %}
{% initial_analytics_data 'gtm.domain' domain %}
{% if request.domain or domain %}
{% firstof request.domain domain as metrics_domain %}
{% initial_analytics_data 'gtm.domain' metrics_domain %}
{% endif %}
{% if ANALYTICS_CONFIG.HQ_INSTANCE %}
{% initial_analytics_data 'gtm.hqInstance' ANALYTICS_CONFIG.HQ_INSTANCE %}
Expand Down
26 changes: 13 additions & 13 deletions corehq/apps/app_manager/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,22 +682,22 @@ def test_view_form_legacy(self, mock1):
'INVOICING_CONTACT_EMAIL', 'False', 'show_mobile_ux_warning', 'IS_DOMAIN_BILLING_ADMIN', 'translations',
'hq', 'SALES_EMAIL', 'linked_version', 'confirm', 'show_report_modules', 'lang', 'can_view_cloudcare',
'title_block', 'CUSTOM_LOGO_URL', 'items', 'request', 'messages', 'build_profile_access', 'form', 'error',
'alerts', 'prompt_settings_form', 'submenu', 'domain', 'enable_update_prompts', 'show_shadow_modules',
'sentry', 'bulk_ui_translation_upload', 'toggles_dict', 'True', 'full_name', 'latest_build_id',
'previews_dict', 'copy_app_form', 'show_status_page', 'is_linked_app', 'show_shadow_module_v1',
'use_bootstrap5', 'limit_to_linked_domains', 'add_ons_privileges', 'LANGUAGE_BIDI', 'page_title_block',
'LANGUAGES', 'underscore', 'analytics', 'block', 'app_subset', 'restrict_domain_creation',
'login_template', 'enterprise_mode', 'mobile_ux_cookie_name', 'commcare_hq_names', 'langs',
'title_context_block', 'timezone', 'helpers', 'has_mobile_workers', 'multimedia_state',
'bulk_app_translation_upload', 'show_training_modules', 'forloop', 'secure_cookies',
'alerts', 'prompt_settings_form', 'submenu', 'domain', 'metrics_domain', 'enable_update_prompts',
'show_shadow_modules', 'sentry', 'bulk_ui_translation_upload', 'toggles_dict', 'True', 'full_name',
'latest_build_id', 'previews_dict', 'copy_app_form', 'show_status_page', 'is_linked_app',
'show_shadow_module_v1', 'use_bootstrap5', 'limit_to_linked_domains', 'add_ons_privileges',
'LANGUAGE_BIDI', 'page_title_block', 'LANGUAGES', 'underscore', 'analytics', 'block', 'app_subset',
'restrict_domain_creation', 'login_template', 'enterprise_mode', 'mobile_ux_cookie_name',
'commcare_hq_names', 'langs', 'title_context_block', 'timezone', 'helpers', 'has_mobile_workers',
'multimedia_state', 'bulk_app_translation_upload', 'show_training_modules', 'forloop', 'secure_cookies',
'IS_ANALYTICS_ENVIRONMENT',
}

expected_keys_module = {
'show_advanced', 'session_endpoints_enabled', 'show_advanced_settings', 'toggles_dict',
'show_release_mode', 'linked_name', 'linked_version', 'latest_commcare_version',
'nav_menu_media_specifics', 'user', 'TIME_ZONE', 'domain', 'module_brief', 'timezone', 'active_tab',
'data_registry_enabled', 'confirm', 'messages', 'releases_active', 'show_status_page',
'nav_menu_media_specifics', 'user', 'TIME_ZONE', 'domain', 'metrics_domain', 'module_brief', 'timezone',
'active_tab', 'data_registry_enabled', 'confirm', 'messages', 'releases_active', 'show_status_page',
'show_search_workflow', 'data_registries', 'label', 'underscore', 'forloop', 'show_shadow_modules',
'SUPPORT_EMAIL', 'valid_parents_for_child_module', 'parent_case_modules',
'current_url_name', 'LANGUAGE_BIDI', 'DEFAULT_MESSAGE_LEVELS', 'show_report_modules', 'BASE_MAIN',
Expand All @@ -723,9 +723,9 @@ def test_view_form_legacy(self, mock1):
expected_keys_form = {
'show_advanced', 'is_module_filter_enabled', 'session_endpoints_enabled', 'toggles_dict',
'show_release_mode', 'linked_name', 'linked_version', 'latest_commcare_version',
'nav_menu_media_specifics', 'user', 'TIME_ZONE', 'domain', 'case_config_options', 'timezone',
'root_requires_same_case', 'active_tab', 'confirm', 'messages', 'releases_active', 'show_status_page',
'form_filter_patterns', 'form_workflows', 'label', 'underscore', 'forloop',
'nav_menu_media_specifics', 'user', 'TIME_ZONE', 'domain', 'metrics_domain', 'case_config_options',
'timezone', 'root_requires_same_case', 'active_tab', 'confirm', 'messages', 'releases_active',
'show_status_page', 'form_filter_patterns', 'form_workflows', 'label', 'underscore', 'forloop',
'SUPPORT_EMAIL', 'current_url_name', 'LANGUAGE_BIDI', 'DEFAULT_MESSAGE_LEVELS', 'show_report_modules',
'BASE_MAIN', 'xform_languages', 'app_id', 'request', 'allow_usercase', 'MINIMUM_PASSWORD_LENGTH', 'type',
'is_saas_environment', 'show_all_projects_link', 'enterprise_mode', 'module_is_multi_select', 'csrf_token',
Expand Down

0 comments on commit fea74fe

Please sign in to comment.