Skip to content

Commit

Permalink
feat(#706): move consequence to tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Sep 4, 2024
1 parent ed15bb7 commit b71e503
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
20 changes: 8 additions & 12 deletions app/lib/common/models/drug/drug_inhibitors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,28 +117,24 @@ String inhibitionTooltipText(
final activeInhibitorsWithBrandNames =
activeInhibitors.map(getDrugNames).toList();
final inhibitorsString = enumerationWithAnd(
activeInhibitorsWithBrandNames,
context,
);
return context.l10n.inhibitors_tooltip(inhibitorsString);
activeInhibitorsWithBrandNames,
context,
);
final consequence = activeInhibitors.all(isModerateInhibitor)
? context.l10n.inhibitors_consequence_not_adapted
: context.l10n.inhibitors_consequence_adapted(genotypeResult.phenotype);
return '$consequence\n\n${context.l10n.inhibitors_tooltip(inhibitorsString)}';
}

Table buildDrugInteractionInfo(
BuildContext context,
GenotypeResult genotypeResult,
{ String? drug }
) {
final activeInhibitors = activeInhibitorsFor(
genotypeResult.gene,
drug: drug,
);
final consequence = activeInhibitors.all(isModerateInhibitor)
? context.l10n.inhibitors_consequence_not_adapted
: context.l10n.inhibitors_consequence_adapted(genotypeResult.phenotype);
return buildTable([
TableRowDefinition(
drugInteractionIndicator,
'${context.l10n.inhibitor_message} ($consequence)',
context.l10n.inhibitor_message,
tooltip: inhibitionTooltipText(context, genotypeResult, drug: drug),
)],
boldHeader: false,
Expand Down
4 changes: 2 additions & 2 deletions app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
},

"inhibitor_message": "One or more of the medications you are currently taking may interact with your genetic result",
"inhibitors_consequence_adapted": "phenotype adapted from {originalPhenotype}",
"inhibitors_consequence_not_adapted": "phenotype not adapted",
"inhibitors_consequence_adapted": "Your phenotype was adapted from {originalPhenotype}.",
"inhibitors_consequence_not_adapted": "Your phenotype was not adapted.",
"inhibitors_tooltip": "Current interacting medications: {inhibitors}",

"drugs_page_inhibitor_direct_salutation": "you are",
Expand Down

0 comments on commit b71e503

Please sign in to comment.