Skip to content

Commit

Permalink
Merge pull request #35093 from dimagi/ml/case-tile-ui-ff
Browse files Browse the repository at this point in the history
Put UI change behind existing feature flag for case tiles
  • Loading branch information
minhaminha authored Sep 4, 2024
2 parents b39e56b + bf70e5f commit 4f50cf9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions corehq/apps/cloudcare/static/cloudcare/js/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ hqDefine('cloudcare/js/markdown', [
'markdown-it/dist/markdown-it',
'hqwebapp/js/initial_page_data',
'integration/js/hmac_callout',
'hqwebapp/js/toggles',
], function (
$,
DOMPurify,
markdowner,
initialPageData,
HMACCallout
HMACCallout,
toggles
) {

function updateTarget(tokens, idx, target) {
Expand Down Expand Up @@ -142,7 +144,7 @@ hqDefine('cloudcare/js/markdown', [
}
var rendered = md.render(DOMPurify.sanitize(text || "").replaceAll("
", "\n"));
// sub case tile header with a caption
if (rendered.includes('<p><strong>')) {
if (rendered.includes('<p><strong>') && toggles.toggleEnabled('CASE_LIST_TILE_CUSTOM')) {
rendered = appendExtraStyleClass(rendered, '<p>', 'mb-0');
rendered = appendExtraStyleClass(rendered, '<h6>', 'mb-0');
}
Expand Down

0 comments on commit 4f50cf9

Please sign in to comment.