Skip to content

Commit

Permalink
sc-14341 modified text and added spec (#5512)
Browse files Browse the repository at this point in the history
**Story card:**
[sc-14341](https://app.shortcut.com/simpledotorg/story/14341/changes-requested-in-dm-progress-tab)

## Because

Asked to change in the text

## This addresses

DM progress tab

## Test instructions

Enter detailed instructions for how to test this PR...
  • Loading branch information
Gyan-Gupta-Rtsl authored Dec 12, 2024
1 parent 9a59761 commit 8a50cd0
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
onclick="goToPage('daily-report-page', 'home-page'); return false;"
>
<%= inline_file("chevron-left.svg") %>
back
<%= t("back") %>
</a>
<div class="pr-16px pl-16px">
<h1 class="m-0px mb-8px fw-bold fs-24px">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="p-16px bgc-white">
<h2 class="mb-32px mr-8px p-0px ta-left fw-medium fs-18px c-black pe-none">
<div class="mb-32px mr-8px p-0px ta-left fw-medium fs-18px c-black pe-none">
<%= @uncontrolled_threshold_title %>
</h2>
</div>
<div class="p-relative d-flex ai-center mb-8px" data-element-type="header">
<div class="d-flex ai-center" data-element-type="header-title">
<h2 class="m-0px mr-8px p-0px ta-left fw-bold fs-14px c-black pe-none">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def set_locale_values
else
@uncontrolled_threshold_title = t("bs_over_200_copy.reports_card_title_dm")
@uncontrolled_threshold_long = t("bs_over_200_copy.bs_200_to_299.numerator_dm")
@uncontrolled_threshold_short = t("bs_over_200_copy.bs_200_to_299.title")
@uncontrolled_threshold_short = t("bs_over_200_copy.bs_200_to_299.title_dm_bs")
@uncontrolled_threshold_bar = t("bs_over_200_copy.bs_200_to_299.title_dm")
@subtitle_text = t(
"bs_over_200_copy.bs_200_to_299.reports_card_subtitle",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="p-16px bgc-white">
<div class="p-16px bgc-white mb-8px">
<div class="p-relative d-flex ai-center mb-8px" data-element-type="header">
<div class="d-flex ai-center" data-element-type="header-title">
<h2 class="m-0px mr-8px p-0px ta-left fw-bold fs-14px c-black pe-none">
Expand Down
4 changes: 2 additions & 2 deletions app/components/progress_tab/diabetes/control_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ def set_locale_values
@numerator_text = t("bs_below_200_copy.numerator_dm_fbs")
else
@controlled_threshold_long = t("bs_below_200_copy.numerator")
@controlled_threshold_short = t("bs_below_200_copy.reports_card_title_dm")
@controlled_threshold_short = t("bs_below_200_copy.reports_card_title_dm_bs")
@controlled_threshold_bar = t("bs_below_200_copy.report_card_lower_bar")
@subtitle_text = t(
"bs_below_200_copy.reports_card_subtitle_dm",
region_name: @region.name,
diagnosis: "Diabetes",
controlled_threshold: @controlled_threshold_long
)
@numerator_text = t("bs_below_200_copy.numerator_dm")
@numerator_text = t("bs_below_200_copy.numerator")
end

@denominator_text = t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
onclick="goToPage(id='diabetes-report', 'home-page'); return false;"
>
<%= inline_file("chevron-left.svg") %>
back
<%= t("back") %>
</a>
<div class="pr-16px pl-16px">
<h1 class="m-0px mb-8px fw-bold fs-24px">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
onclick="goToPage('hypertension-report', 'home-page'); return false;"
>
<%= inline_file("chevron-left.svg") %>
back
<%= t("back") %>
</a>
<div class="pr-16px pl-16px">
<h1 class="m-0px mb-8px fw-bold fs-24px">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
onclick="goToPage('monthly-report-page', 'home-page'); return false;"
>
<%= inline_file("chevron-left.svg") %>
back
<%= t("back") %>
</a>
<div class="pr-16px pl-16px">
<h1 class="m-0px mb-8px fw-bold fs-24px">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
onclick="goToPage('yearly-report-page', 'home-page'); return false;"
>
<%= inline_file("chevron-left.svg") %>
back
<%= t("back") %>
</a>
<div class="pr-16px pl-16px">
<h1 class="m-0px mb-8px fw-bold fs-24px">
Expand Down
11 changes: 7 additions & 4 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ en:
facility: facility
name: "Name"
phone_number: "Phone Number"
back: "back"
registration_approval_email:
accessible_facilities: "User will have access to data from"
organization: "Organization"
Expand Down Expand Up @@ -64,19 +65,19 @@ en:
reports_card_title: "Blood sugar < 200"
reports_card_title_fbs: "Blood sugar < 126"
reports_card_title_dm: "Blood Sugar <200"
reports_card_title_dm_bs: "Blood sugar <200"
reports_card_title_dm_fbs: "Blood sugar controlled"
summary: "patients with a blood sugar <200 from"
summary_fbs: "patients with a blood sugar <126mg/dL from"
reports_card_subtitle: "Diabetes patients in %{region_name} with blood sugar <200 at their last visit in the last 3 months"
reports_card_subtitle_fbs: "Diabetes patients in %{region_name} with FBS <126 mg/dL or HbA1c <7% at their last visit in the last 3 months"
numerator: "Patients with RBS/PPBS <200, FBS <126, or HbA1c <7.0 at their last visit in the last 3 months"
numerator_fbs: "Patients with FBS <126mg/dL, or HbA1c <7% at their last visit in the last 3 months"
numerator_dm: "Patients with RBS/PPBS <200, FBS<126, or HbA1c <7.0 at their last visit in the last 3 months"
numerator_dm_fbs: "Patients with FBS <126mg/dL or HbA1c <7% at their last visit in the last 3 months"
report_card_lower_bar: "blood sugar <200"
report_card_lower_bar_fbs: "FBS <126mg/dL or HbA1c <7%"
reports_card_subtitle_dm: "Diabetes patients at %{region_name} registered >3 months ago with blood sugar <200 at their last visit in the last 3 months"
reports_card_subtitle_dm_fbs: "Diabetes patients at %{region_name} registered >3 months ago with FBS <126 mg/dL or HbA1c <7% at their last visit in the last 3 months"
reports_card_subtitle_dm: "Diabetes patients at %{region_name} registered >3 months ago with blood sugar <200 at their last visit in the last 3 months."
reports_card_subtitle_dm_fbs: "Diabetes patients at %{region_name} registered >3 months ago with FBS <126 mg/dL or HbA1c <7% at their last visit in the last 3 months."
rbs_ppbs:
numerator: "Patients with RBS/PPBS <200 at their last visit in the last 3 months"
fasting:
Expand All @@ -87,15 +88,17 @@ en:
reports_card_title: "Blood sugar 200-299 or ≥300"
reports_card_title_fbs: "Blood sugar 126-199 or ≥200"
reports_card_title_dm: "Blood sugar ≥200"
reports_card_title_dm_bs: "Blood sugar <200"
reports_card_title_dm_fbs: "Blood sugar uncontrolled"
reports_card_subtitle: "Diabetes patients in %{region_name} with blood sugar 200-299 or blood sugar ≥300 at their last visit in the last 3 months"
reports_card_subtitle_fbs: "Diabetes patients in %{region_name} with FBS ≥126mg/dL or HbA1c ≥7% at their last visit in the last 3 months"
bs_200_to_299:
title: "Blood Sugar 200-299"
title_dm_bs: "Blood sugar 200-299"
title_fbs: "Blood Sugar 126-199"
title_dm: "blood sugar 200-299"
title_dm_fbs: "FBS 126-199mg/dL or HbA1c 7%-8.9%"
reports_card_subtitle: "Diabetes patients at %{region_name} registered >3 months ago with blood sugar 200-299 at their last visit in the last 3 months"
reports_card_subtitle: "Diabetes patients at %{region_name} registered >3 months ago with blood sugar 200-299 at their last visit in the last 3 months."
reports_card_subtitle_fbs: "Diabetes patients at %{region_name} registered >3 months ago with FBS 126-199mg/dL or HbA1c 7%-8.9% at their last visit in the last 3 months."
summary: "patients with a blood sugar 200-299 from"
summary_fbs: "patients with FBS 126-199mg/dL or HbA1c 7%-8.9% from"
Expand Down
5 changes: 3 additions & 2 deletions config/locales/en_LK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ en-LK:
national_hospital: "National Hospitals"
teaching_hospital: "Teaching Hospitals"
bs_below_200_copy:
numerator: "Patients with RBS/PPBS <200, FBS<126, or Hba1c <7.0 at their last visit in the last 3 months"
numerator: "Patients with RBS/PPBS <200, FBS <126, or HbA1c <7.0 at their last visit in the last 3 months"
numerator_fbs: "Patients with FBS <126mg/dL, or HbA1c <7% at their last visit in the last 3 months"
numerator_dm: "Patients with RBS/PPBS <200, FBS<126, or HbA1c <7.0 at their last visit in the last 3 months"
numerator_dm_fbs: "Patients with FBS <126mg/dL or HbA1c <7% at their last visit in the last 3 months"
reports_card_title: "Blood Sugar <200"
reports_card_title_dm_bs: "Blood sugar <200"
reports_card_title_fbs: "Blood sugar controlled"
reports_card_title_dm: "Blood Sugar <200"
reports_card_title_dm_fbs: "Blood sugar controlled"
Expand All @@ -75,6 +75,7 @@ en-LK:
reports_card_subtitle_fbs: "Diabetes patients in %{region_name} with FBS ≥126mg/dL or HbA1c ≥7% at their last visit in the last 3 months"
bs_200_to_299:
title: "Blood Sugar 200-299"
title_dm_bs: "Blood sugar 200-299"
title_fbs: "Blood Sugar 126-199"
title_dm: "blood sugar 200-299"
title_dm_fbs: "FBS 126-199mg/dL or HbA1c 7%-8.9%"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def render_component_with(use_who_standard: nil)
end

it "renders the correct uncontrolled threshold short text for non-Sri Lanka countries" do
expect(rendered_component).to have_text(I18n.t("bs_over_200_copy.bs_200_to_299.title"))
expect(rendered_component).to have_text(I18n.t("bs_over_200_copy.bs_200_to_299.title_dm_bs"))
end

it "renders the correct denominator text for non-Sri Lanka countries" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ def render_component_with(use_who_standard: nil)
end

it "renders the controlled threshold long text for non-WHO standard" do
expect(rendered_component).to have_text(I18n.t("bs_below_200_copy.numerator_dm"))
expect(rendered_component).to have_text(I18n.t("bs_below_200_copy.numerator"))
end

it "renders the controlled threshold short text for non-WHO standard" do
expect(rendered_component).to have_text(I18n.t("bs_below_200_copy.reports_card_title_dm"))
expect(rendered_component).to have_text(I18n.t("bs_below_200_copy.reports_card_title_dm_bs"))
end

it "renders the correct subtitle for non-WHO standard" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
it "renders the back link with correct text and onclick behavior" do
expect(subject).to have_css(
'a[onclick="goToPage(id=\'diabetes-report\', \'home-page\'); return false;"]',
text: "back"
text: I18n.t("back")
)
end

Expand Down

0 comments on commit 8a50cd0

Please sign in to comment.