tideline 1.26.0 → 1.27.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -59,15 +59,15 @@ class BasicsChart extends React.Component {
|
|
|
59
59
|
trackMetric: PropTypes.func.isRequired,
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
_insulinDataAvailable = () => {
|
|
63
|
-
const { basal, bolus, wizard } = _.get(
|
|
62
|
+
_insulinDataAvailable = (props = this.props) => {
|
|
63
|
+
const { basal, bolus, wizard } = _.get(props, 'data.metaData.latestDatumByType', {});
|
|
64
64
|
|
|
65
65
|
return !!(basal || bolus || wizard);
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
_siteChangeDataAvailable = () => {
|
|
68
|
+
_siteChangeDataAvailable = (props = this.props) => {
|
|
69
69
|
const siteChangeDataCount = _.reduce(
|
|
70
|
-
_.get(
|
|
70
|
+
_.get(props, 'data.data.current.aggregationsByDate.siteChanges.byDate'),
|
|
71
71
|
(result, value) => result + _.max(_.values(value.subtotals)),
|
|
72
72
|
0
|
|
73
73
|
);
|
|
@@ -101,6 +101,19 @@ class BasicsChart extends React.Component {
|
|
|
101
101
|
this.setSectionsToState();
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
// eslint-disable-next-line camelcase
|
|
105
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
106
|
+
let reRenderSections = false;
|
|
107
|
+
|
|
108
|
+
if (nextProps.aggregations) {
|
|
109
|
+
_.each(nextProps.aggregations, ({ disabled }, key) => {
|
|
110
|
+
if (disabled !== this.props.aggregations?.[key].disabled) reRenderSections = true;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (reRenderSections) this.setSectionsToState(nextProps);
|
|
115
|
+
}
|
|
116
|
+
|
|
104
117
|
componentDidMount() {
|
|
105
118
|
var availableDeviceData = this._availableDeviceData();
|
|
106
119
|
|
|
@@ -114,7 +127,7 @@ class BasicsChart extends React.Component {
|
|
|
114
127
|
}
|
|
115
128
|
}
|
|
116
129
|
|
|
117
|
-
setSectionsToState = () => {
|
|
130
|
+
setSectionsToState = (props = this.props) => {
|
|
118
131
|
const typeSectionIndexMap = {
|
|
119
132
|
fingersticks: 0,
|
|
120
133
|
boluses: 1,
|
|
@@ -124,7 +137,7 @@ class BasicsChart extends React.Component {
|
|
|
124
137
|
|
|
125
138
|
const sections = [];
|
|
126
139
|
|
|
127
|
-
_.forOwn(
|
|
140
|
+
_.forOwn(props.aggregations, (aggregation, key) => {
|
|
128
141
|
const isSiteChanges = key === 'siteChanges';
|
|
129
142
|
const section = _.cloneDeep(aggregation);
|
|
130
143
|
let chart = WrapCount;
|
|
@@ -137,16 +150,16 @@ class BasicsChart extends React.Component {
|
|
|
137
150
|
let settingsTogglable = togglableState.off;
|
|
138
151
|
|
|
139
152
|
if (isSiteChanges) {
|
|
140
|
-
const { latestPumpUpload: latestPump } = _.get(
|
|
153
|
+
const { latestPumpUpload: latestPump } = _.get(props, 'data.metaData', {});
|
|
141
154
|
|
|
142
155
|
const {
|
|
143
156
|
profile: {
|
|
144
157
|
fullName,
|
|
145
158
|
},
|
|
146
159
|
settings,
|
|
147
|
-
} =
|
|
160
|
+
} = props.patient;
|
|
148
161
|
|
|
149
|
-
const permissions =
|
|
162
|
+
const permissions = props.permsOfLoggedInUser;
|
|
150
163
|
const canUpdateSettings = permissions && (permissions.hasOwnProperty('custodian') || permissions.hasOwnProperty('root'));
|
|
151
164
|
const hasSiteChangeSourceSettings = settings && settings.hasOwnProperty('siteChangeSource');
|
|
152
165
|
|
|
@@ -182,7 +195,7 @@ class BasicsChart extends React.Component {
|
|
|
182
195
|
if (_.isArray(selectorOptions.primary)) selectorOptions.primary = selectorOptions.primary[0] || {};
|
|
183
196
|
|
|
184
197
|
if (section.type === 'basals') {
|
|
185
|
-
const basalAggregationData =
|
|
198
|
+
const basalAggregationData = props.data?.data?.aggregationsByDate?.basals;
|
|
186
199
|
const hasAutomatedSuspends = basalAggregationData?.automatedSuspend?.summary?.subtotals?.automatedSuspend?.count > 0;
|
|
187
200
|
const hasAutomatedStops = basalAggregationData?.basal?.summary?.subtotals?.automatedStop?.count > 0;
|
|
188
201
|
if (hasAutomatedSuspends && hasAutomatedStops) section.perRow = 2;
|