Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Screen Case Search Title and Subtitle Display #33359

Merged
merged 8 commits into from
Aug 16, 2023

Conversation

Jtang-1
Copy link
Contributor

@Jtang-1 Jtang-1 commented Aug 15, 2023

Product Description

Two changes for Split Screen Case Search:

  1. The "title" is now configured via "Search Screen Title". It was previously configured via "Label for Searching"
  2. The "description"/"subtitle" is now displayed (and is configured as normal via "Search Screen Subtitle")

Screen Shot 2023-08-15 at 10 11 01 AM

Screen Shot 2023-08-15 at 10 11 06 AM

Screen Shot 2023-08-15 at 10 02 28 AM

Technical Summary

Jira Ticket: https://dimagi-dev.atlassian.net/browse/USH-3539
Related to #33261
Formplayer PR: dimagi/commcare-core#1320

Split Screen case search has two view states:

  1. Pre-search view (query type menuResponse)
  2. Post-search results view (entity type menuResponse)
    In 1, the description is pulled from this.options.description and in 2, the description is pulled from this.options.collection.queryResponse.description

Reasoning for why "title" configuration was switched to using "Search Screen Title":
In app configuration, there is both “Label for Searching” and “Search Screen Title” where:

  • ”Label for Searching” would be the text for the “search” button AND the header of search results
  • “Search Screen Title” is the text for the header of the Case Search screen

With SSCS, both the search screen and results screen are the same thing. In the original implementation here, the “Label for Searching” is used as the header. But when USH_INLINE_SEARCH is enabled, the “Label for Searching” configuration is hidden so it can't be configured. "Search Screen Title" is still available.

Feature Flag

SPLIT_SCREEN_CASE_SEARCH

Safety Assurance

Safety story

Local testing. The change only affects Split Screen Case Search which has limited usage. The change only affects display of title and subtitle.

Automated test coverage

No Automated test

QA Plan

No QA

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@dimagimon dimagimon added the Risk: Medium Change affects files that have been flagged as medium risk. label Aug 15, 2023
@Jtang-1 Jtang-1 requested a review from nospame August 15, 2023 16:33
@Jtang-1 Jtang-1 marked this pull request as ready for review August 15, 2023 17:45
@Jtang-1 Jtang-1 added the product/feature-flag Change will only affect users who have a specific feature flag enabled label Aug 15, 2023
@Jtang-1 Jtang-1 changed the title Jt/title and subtitle with sscs v0 Split Screen Case Search Title and Subtitle Display Aug 15, 2023
@shubham1g5
Copy link
Contributor

Is “Label for Searching” used anywhere on UI for split case search with this change ? If not, should we hide it on HQ UI when SSCS is enabled.

@Jtang-1
Copy link
Contributor Author

Jtang-1 commented Aug 15, 2023

@shubham1g5 Yes it is, it's still used as the text for the "search" button if it's not a "search first" workflow

Screen Shot 2023-08-15 at 2 33 20 PM

@@ -114,7 +114,8 @@ hqDefine("cloudcare/js/formplayer/menus/controller", function () {
var menuData = menusUtils.getMenuData(menuResponse);
menuData["triggerEmptyCaseList"] = true;
menuData["sidebarEnabled"] = true;
menuData["title"] = menuResponse.resultsTitle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main change in the original PR was to add results-title field to suite file and then use it from menuResponse. Since we are no longer using it can we remove results-title from suite file now ?

Copy link
Contributor Author

@Jtang-1 Jtang-1 Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can. I was thinking of handling the reversions in a separate PR just make this simpler and get it out for this deploy, but it makes sense to just do it now for the HQ and formplayer side too. eb7f65f

Just double checking, any built suites will still have the results-title, but what you found previously was that formplayer will just skip any unknown nodes (since it's just an elseif) so it'll be fine.

return {
startPage: paginateItems.startPage,
title: this.options.title,
title: title.trim(),
description: description === undefined ? "" : DOMPurify.sanitize(markdown.render(description.trim())),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why we are only doing markdown.render() for description and not title ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When description was added, it seems to explicitly support markdown (based on the help text). It doesn't seem to be called out for titles, and in the html template, it uses the raw output of title (via <%- %>), so the markdown wouldn't display correctly. I could change that, but just keeping as is to preserve current behavior.

@dimagimon dimagimon added the Core Compatibility Changes may impact Mobile and Formplayer label Aug 15, 2023
Copy link
Contributor

@shubham1g5 shubham1g5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! Looks good to me.

@Jtang-1 Jtang-1 merged commit e790b7c into master Aug 16, 2023
11 checks passed
@Jtang-1 Jtang-1 deleted the jt/title_and_subtitle_with_SSCS_v0 branch August 16, 2023 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Compatibility Changes may impact Mobile and Formplayer product/feature-flag Change will only affect users who have a specific feature flag enabled Risk: Medium Change affects files that have been flagged as medium risk.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants