From 25d30ccef6b64f5d96b976f4f0368931853e4721 Mon Sep 17 00:00:00 2001 From: Akash Jain Date: Mon, 4 Dec 2023 18:04:25 +0530 Subject: [PATCH 001/118] Add col-sm class the group --- .../static/cloudcare/js/form_entry/form_ui.js | 10 ++++++++++ .../apps/cloudcare/templates/form_entry/templates.html | 1 + 2 files changed, 11 insertions(+) diff --git a/corehq/apps/cloudcare/static/cloudcare/js/form_entry/form_ui.js b/corehq/apps/cloudcare/static/cloudcare/js/form_entry/form_ui.js index a211b8cebc62..709429bf45ea 100644 --- a/corehq/apps/cloudcare/static/cloudcare/js/form_entry/form_ui.js +++ b/corehq/apps/cloudcare/static/cloudcare/js/form_entry/form_ui.js @@ -652,6 +652,16 @@ hqDefine("cloudcare/js/form_entry/form_ui", function () { } return Container.prototype.headerBackgroundColor.call(self); }; + + const columnWidth = Question.calculateColumnWidthForPerRowStyle(this.style); + const perRowPattern = new RegExp(`\\d+${constants.PER_ROW}(\\s|$)`); + var styleStr = (self.style) ? ko.utils.unwrapObservable(self.style.raw) : null; + + if (getMatchingStyles(perRowPattern, styleStr)) { + this.questionTileWidth = `col-sm-${columnWidth}`; + } + + } Group.prototype = Object.create(Container.prototype); Group.prototype.constructor = Container; diff --git a/corehq/apps/cloudcare/templates/form_entry/templates.html b/corehq/apps/cloudcare/templates/form_entry/templates.html index 96fd625ef919..325a4f1da606 100644 --- a/corehq/apps/cloudcare/templates/form_entry/templates.html +++ b/corehq/apps/cloudcare/templates/form_entry/templates.html @@ -4,6 +4,7 @@ + - -