Skip to content

Commit 6938540

Browse files
Merge pull request #446 from tidepool-org/WEB-3474-hide-twiist-wizard-bolus-filters
[WEB-3474] Hide twiist wizard bolus filters when empty
2 parents 1fc6f04 + a202ee6 commit 6938540

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"node": "20.8.0"
55
},
66
"packageManager": "[email protected]",
7-
"version": "1.44.1-web-3428-twiist-update.5",
7+
"version": "1.44.1-rc.3",
88
"description": "Tidepool data visualization for diabetes device data.",
99
"keywords": [
1010
"data visualization"

src/utils/basics/data.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import _ from 'lodash';
1919
import moment from 'moment';
2020
import i18next from 'i18next';
2121

22-
import { getPumpVocabulary, getUppercasedManufacturer, isLoop } from '../device';
22+
import { getPumpVocabulary, getUppercasedManufacturer, isLoop, isTwiistLoop } from '../device';
2323
import {
2424
generateBgRangeLabels,
2525
reshapeBgClassesToBgBounds,
@@ -87,6 +87,9 @@ export function defineBasicsAggregations(bgPrefs, manufacturer, pumpUpload = {})
8787
let summaryTitle;
8888
let perRow = 3;
8989

90+
// TODO: Remove this once we have twiist bolus and wizards linked
91+
const hideEmptyWizardDimensions = isTwiistLoop(pumpUpload.settings);
92+
9093
switch (section) {
9194
case 'basals':
9295
title = 'Basals';
@@ -119,12 +122,12 @@ export function defineBasicsAggregations(bgPrefs, manufacturer, pumpUpload = {})
119122
summaryTitle = t('Avg boluses / day');
120123
dimensions = [
121124
{ path: 'summary', key: 'total', label: t('Avg per day'), average: true, primary: true },
122-
{ path: 'summary.subtotals', key: 'wizard', label: t('Calculator'), percentage: true, selectorIndex: 0 },
123-
{ path: 'summary.subtotals', key: 'correction', label: t('Correction'), percentage: true, selectorIndex: 1 },
125+
{ path: 'summary.subtotals', key: 'wizard', label: t('Calculator'), percentage: true, selectorIndex: 0, hideEmpty: hideEmptyWizardDimensions },
126+
{ path: 'summary.subtotals', key: 'correction', label: t('Correction'), percentage: true, selectorIndex: 1, hideEmpty: hideEmptyWizardDimensions },
124127
{ path: 'summary.subtotals', key: 'extended', label: t('Extended'), percentage: true, selectorIndex: 4 },
125128
{ path: 'summary.subtotals', key: 'interrupted', label: t('Interrupted'), percentage: true, selectorIndex: 5 },
126-
{ path: 'summary.subtotals', key: 'override', label: t('Override'), percentage: true, selectorIndex: 2 },
127-
{ path: 'summary.subtotals', key: 'underride', label: t('Underride'), percentage: true, selectorIndex: 6 },
129+
{ path: 'summary.subtotals', key: 'override', label: t('Override'), percentage: true, selectorIndex: 2, hideEmpty: hideEmptyWizardDimensions },
130+
{ path: 'summary.subtotals', key: 'underride', label: t('Underride'), percentage: true, selectorIndex: 6, hideEmpty: hideEmptyWizardDimensions },
128131
];
129132

130133
if (isLoop(pumpUpload.settings)) {

0 commit comments

Comments
 (0)