From 1763be3c1dc747d7b011d34d8ce56acb099e75c8 Mon Sep 17 00:00:00 2001 From: Martin Riese Date: Tue, 23 Jan 2024 13:15:08 -0600 Subject: [PATCH 1/5] increase margin for multi select --- corehq/apps/cloudcare/templates/formplayer/case_list.html | 2 +- .../static/cloudcare/less/formplayer-webapp/content.less | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/corehq/apps/cloudcare/templates/formplayer/case_list.html b/corehq/apps/cloudcare/templates/formplayer/case_list.html index 5af57581b198..9970ded04ba2 100644 --- a/corehq/apps/cloudcare/templates/formplayer/case_list.html +++ b/corehq/apps/cloudcare/templates/formplayer/case_list.html @@ -289,7 +289,7 @@

<%- title %>

background-color: transparent; color: #685c53; justify-items: left; - padding: 10px 20px 0 20px; + margin: 10px 30px 0 10px; } diff --git a/corehq/apps/hqwebapp/static/cloudcare/less/formplayer-webapp/content.less b/corehq/apps/hqwebapp/static/cloudcare/less/formplayer-webapp/content.less index d01f6a20829d..c7865266c152 100644 --- a/corehq/apps/hqwebapp/static/cloudcare/less/formplayer-webapp/content.less +++ b/corehq/apps/hqwebapp/static/cloudcare/less/formplayer-webapp/content.less @@ -86,8 +86,7 @@ body { } .select-row-checkbox-div { - padding-top: 10px; - padding-left: 10px; + margin: 10px 10px 10px 10px; float: left; } From 529fb766e8ed0f81aac7c8fc647a2d865eca56eb Mon Sep 17 00:00:00 2001 From: Martin Riese Date: Wed, 24 Jan 2024 07:42:17 -0600 Subject: [PATCH 2/5] typo fix --- corehq/toggles/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/corehq/toggles/__init__.py b/corehq/toggles/__init__.py index e152a3e28dbd..ef6b98dba8c9 100644 --- a/corehq/toggles/__init__.py +++ b/corehq/toggles/__init__.py @@ -1019,11 +1019,11 @@ def _ensure_valid_randomness(randomness): GEOCODER_USER_PROXIMITY = StaticToggle( "geocoder_user_proximity", - "USH: Adjust geo coder result to be more relevant to user and project.", + "USH: Adjust geocoder result to be more relevant to user and project.", TAG_CUSTOM, namespaces=[NAMESPACE_DOMAIN], description=""" - This has two effects on getting geo coder search results: + This has two effects on getting geocoder search results: 1. Based on the bounding box of the project default location all result falling outside of it will be filtered out when used in the case search. 2. Proximity to the users location will be taken into account for the results order. From 18b02f4b1fb8b16d415d6c294e227fd0259448d2 Mon Sep 17 00:00:00 2001 From: Martin Riese Date: Wed, 24 Jan 2024 07:43:08 -0600 Subject: [PATCH 3/5] Adjust margin only for multi select --- .../static/cloudcare/js/formplayer/menus/views.js | 9 +++++---- .../apps/cloudcare/templates/formplayer/case_list.html | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/corehq/apps/cloudcare/static/cloudcare/js/formplayer/menus/views.js b/corehq/apps/cloudcare/static/cloudcare/js/formplayer/menus/views.js index 24883ddecbe2..58a888d7d0c7 100644 --- a/corehq/apps/cloudcare/static/cloudcare/js/formplayer/menus/views.js +++ b/corehq/apps/cloudcare/static/cloudcare/js/formplayer/menus/views.js @@ -180,7 +180,7 @@ hqDefine("cloudcare/js/formplayer/menus/views", function () { // Dynamically generate the CSS style for the grid polyfill to use for the case tile // useUniformUnits - true if the grid's cells should have the same height as width - const buildCellGridStyle = function (numRows, numColumns, useUniformUnits, prefix) { + const buildCellGridStyle = function (numRows, numColumns, useUniformUnits, prefix, isMultiSelect) { let heightString; if (useUniformUnits) { @@ -195,6 +195,7 @@ hqDefine("cloudcare/js/formplayer/menus/views", function () { numColumns: numColumns, heightString: heightString, prefix: prefix, + isMultiSelect: isMultiSelect, }; const templateString = $("#cell-grid-style-template").html(); const template = _.template(templateString); @@ -1063,10 +1064,10 @@ hqDefine("cloudcare/js/formplayer/menus/views", function () { // - shape and size of the tile's layout grid // - the tile's visual style and its outer boundary // - layout of the case tiles on the outer, visible grid - const buildCaseTileStyles = function (tiles, styles, numRows, numColumns, numEntitiesPerRow, useUniformUnits, prefix) { + const buildCaseTileStyles = function (tiles, styles, numRows, numColumns, numEntitiesPerRow, useUniformUnits, prefix, isMultiSelect) { const caseTileStyles = {}; caseTileStyles.cellLayoutStyle = buildCellLayout(tiles, styles, prefix); - caseTileStyles.cellGridStyle = buildCellGridStyle(numRows, numColumns, useUniformUnits, prefix); + caseTileStyles.cellGridStyle = buildCellGridStyle(numRows, numColumns, useUniformUnits, prefix, isMultiSelect); if (numEntitiesPerRow > 1) { caseTileStyles.cellContainerStyle = buildCellContainerStyle(numEntitiesPerRow); caseTileStyles.cellWrapperStyle = $("#cell-wrapper-style-template"); @@ -1091,7 +1092,7 @@ hqDefine("cloudcare/js/formplayer/menus/views", function () { const useUniformUnits = options.useUniformUnits; const caseTileStyles = buildCaseTileStyles(options.tiles, options.styles, numRows, numColumns, - numEntitiesPerRow, useUniformUnits, 'list'); + numEntitiesPerRow, useUniformUnits, 'list', options.isMultiSelect); const gridPolyfillPath = FormplayerFrontend.getChannel().request('gridPolyfillPath'); diff --git a/corehq/apps/cloudcare/templates/formplayer/case_list.html b/corehq/apps/cloudcare/templates/formplayer/case_list.html index 9970ded04ba2..9ef407e7b732 100644 --- a/corehq/apps/cloudcare/templates/formplayer/case_list.html +++ b/corehq/apps/cloudcare/templates/formplayer/case_list.html @@ -289,7 +289,9 @@

<%- title %>

background-color: transparent; color: #685c53; justify-items: left; - margin: 10px 30px 0 10px; + <% if (model.isMultiSelect) { %> + margin: 10px 30px 0 10px; + <% } %> } From fec3360ba5678f40393a9721501c57e8eafba0be Mon Sep 17 00:00:00 2001 From: Martin Riese Date: Wed, 31 Jan 2024 13:23:57 -0600 Subject: [PATCH 4/5] Add margin back in for single select case --- corehq/apps/cloudcare/templates/formplayer/case_list.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/corehq/apps/cloudcare/templates/formplayer/case_list.html b/corehq/apps/cloudcare/templates/formplayer/case_list.html index d82a8684efa6..21a5325779bf 100644 --- a/corehq/apps/cloudcare/templates/formplayer/case_list.html +++ b/corehq/apps/cloudcare/templates/formplayer/case_list.html @@ -291,6 +291,8 @@

<%- title %>

justify-items: left; <% if (model.isMultiSelect) { %> margin: 10px 30px 0 10px; + <% } else { %> + margin: 10px 20px 0 20px; <% } %> } From 709b9b69bf981ebc83e7668dadc1aaba5a0dce40 Mon Sep 17 00:00:00 2001 From: Martin Riese Date: Wed, 31 Jan 2024 16:23:54 -0600 Subject: [PATCH 5/5] Add case for persistent tiles --- corehq/apps/cloudcare/templates/formplayer/case_list.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/corehq/apps/cloudcare/templates/formplayer/case_list.html b/corehq/apps/cloudcare/templates/formplayer/case_list.html index fe8c04d65f0f..40ac1413eb1b 100644 --- a/corehq/apps/cloudcare/templates/formplayer/case_list.html +++ b/corehq/apps/cloudcare/templates/formplayer/case_list.html @@ -289,10 +289,12 @@

<%- title %>

background-color: transparent; color: #685c53; justify-items: left; - <% if (model.isMultiSelect) { %> - margin: 20px 30px 10px 10px; - <% } else { %> + <% if (model.prefix === "persistent") { %> margin: 20px 20px 10px 20px; + <% } else if (model.isMultiSelect) { %> + margin: 10px 30px 0 10px; + <% } else { %> + margin: 10px 20px 0 20px; <% } %> }