@hedia/recommendation-screen 1.2.0 → 1.3.0
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/.idea/workspace.xml +60 -98
- package/package.json +1 -1
- package/src/RecommendationScreen.d.ts +3 -0
- package/src/RecommendationScreen.jsx +51 -42
- package/src/RecommendationScreen.tsx +82 -57
- package/src/components/InfoBars.d.ts +2 -0
- package/src/components/InfoBars.jsx +4 -4
- package/src/components/InfoBars.tsx +6 -6
- package/src/components/InvisibleNumberInput.d.ts +1 -0
- package/src/components/InvisibleNumberInput.jsx +1 -1
- package/src/components/InvisibleNumberInput.tsx +3 -0
- package/src/components/RecommendedCarbs.d.ts +0 -2
- package/src/components/RecommendedCarbs.jsx +8 -3
- package/src/components/RecommendedCarbs.tsx +10 -5
- package/src/components/RecommendedInsulin.d.ts +3 -3
- package/src/components/RecommendedInsulin.jsx +18 -6
- package/src/components/RecommendedInsulin.tsx +24 -10
- package/src/components/activity/ActivityIcon.jsx +1 -1
- package/src/components/activity/ActivityIcon.tsx +1 -1
- package/src/types/enum.d.ts +9 -10
- package/src/types/enum.js +9 -10
- package/src/types/enum.ts +0 -1
- package/src/types/types.ts +1 -0
- package/src/utils/AttentionMessages.d.ts +1 -1
- package/src/utils/AttentionMessages.jsx +1 -1
- package/src/utils/AttentionMessages.tsx +1 -1
- package/src/utils/Constants.d.ts +3 -0
- package/src/utils/Constants.js +4 -1
- package/src/utils/Constants.ts +5 -0
- package/src/utils/RecommendationError.d.ts +0 -1
- package/src/utils/RecommendationError.jsx +1 -3
- package/src/utils/RecommendationError.tsx +0 -7
- package/src/utils/RecommendationUtils.d.ts +2 -3
- package/src/utils/RecommendationUtils.js +3 -4
- package/src/utils/RecommendationUtils.ts +2 -4
- package/src/utils/Utils.d.ts +1 -0
- package/src/utils/Utils.js +4 -0
- package/src/utils/Utils.ts +4 -0
- package/src/utils/Validations.js +15 -11
- package/src/utils/Validations.ts +16 -11
package/.idea/workspace.xml
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<project version="4">
|
|
3
|
+
<component name="AutoImportSettings">
|
|
4
|
+
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
|
+
</component>
|
|
3
6
|
<component name="BranchesTreeState">
|
|
4
7
|
<expand>
|
|
5
8
|
<path>
|
|
@@ -25,11 +28,7 @@
|
|
|
25
28
|
</select>
|
|
26
29
|
</component>
|
|
27
30
|
<component name="ChangeListManager">
|
|
28
|
-
<list default="true" id="bceba75c-4c15-4bdc-9b41-023f63a30830" name="Default Changelist" comment=""
|
|
29
|
-
<change beforePath="$PROJECT_DIR$/App.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/App.tsx" afterDir="false" />
|
|
30
|
-
<change beforePath="$PROJECT_DIR$/src/RecommendationScreen.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/RecommendationScreen.tsx" afterDir="false" />
|
|
31
|
-
<change beforePath="$PROJECT_DIR$/src/utils/RecommendationUtils.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/utils/RecommendationUtils.ts" afterDir="false" />
|
|
32
|
-
</list>
|
|
31
|
+
<list default="true" id="bceba75c-4c15-4bdc-9b41-023f63a30830" name="Default Changelist" comment="" />
|
|
33
32
|
<option name="SHOW_DIALOG" value="false" />
|
|
34
33
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
35
34
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -164,7 +163,13 @@
|
|
|
164
163
|
<workItem from="1598549768243" duration="327000" />
|
|
165
164
|
<workItem from="1598599347013" duration="7546000" />
|
|
166
165
|
<workItem from="1598858637503" duration="10795000" />
|
|
167
|
-
<workItem from="1598949840662" duration="
|
|
166
|
+
<workItem from="1598949840662" duration="19791000" />
|
|
167
|
+
<workItem from="1599031274561" duration="12226000" />
|
|
168
|
+
<workItem from="1599119614705" duration="6081000" />
|
|
169
|
+
<workItem from="1599205746476" duration="8368000" />
|
|
170
|
+
<workItem from="1599465060245" duration="4905000" />
|
|
171
|
+
<workItem from="1599554723490" duration="10979000" />
|
|
172
|
+
<workItem from="1599637277136" duration="3405000" />
|
|
168
173
|
</task>
|
|
169
174
|
<servers />
|
|
170
175
|
</component>
|
|
@@ -172,60 +177,7 @@
|
|
|
172
177
|
<option name="version" value="3" />
|
|
173
178
|
<option name="exactExcludedFiles">
|
|
174
179
|
<list>
|
|
175
|
-
<option value="$PROJECT_DIR$/App.jsx" />
|
|
176
|
-
<option value="$PROJECT_DIR$/App.d.ts" />
|
|
177
|
-
<option value="$PROJECT_DIR$/src/types/enum.d.ts" />
|
|
178
|
-
<option value="$PROJECT_DIR$/src/types/enum.js" />
|
|
179
|
-
<option value="$PROJECT_DIR$/src/types/types.d.ts" />
|
|
180
|
-
<option value="$PROJECT_DIR$/src/types/types.js" />
|
|
181
180
|
<option value="$PROJECT_DIR$/index.js" />
|
|
182
|
-
<option value="$PROJECT_DIR$/index.d.ts" />
|
|
183
|
-
<option value="$PROJECT_DIR$/src/RecommendationScreen.d.ts" />
|
|
184
|
-
<option value="$PROJECT_DIR$/src/RecommendationScreen.jsx" />
|
|
185
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedInsulin.d.ts" />
|
|
186
|
-
<option value="$PROJECT_DIR$/src/components/InfoBars.jsx" />
|
|
187
|
-
<option value="$PROJECT_DIR$/src/components/Header.jsx" />
|
|
188
|
-
<option value="$PROJECT_DIR$/src/components/RecentInsulin.d.ts" />
|
|
189
|
-
<option value="$PROJECT_DIR$/src/components/Header.d.ts" />
|
|
190
|
-
<option value="$PROJECT_DIR$/src/components/TransferToLogbook.d.ts" />
|
|
191
|
-
<option value="$PROJECT_DIR$/src/components/InfoBars.d.ts" />
|
|
192
|
-
<option value="$PROJECT_DIR$/src/components/RecommendationModal.d.ts" />
|
|
193
|
-
<option value="$PROJECT_DIR$/src/components/RecommendationModal.jsx" />
|
|
194
|
-
<option value="$PROJECT_DIR$/src/components/Remeasure.d.ts" />
|
|
195
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedCarbs.d.ts" />
|
|
196
|
-
<option value="$PROJECT_DIR$/src/components/Remeasure.jsx" />
|
|
197
|
-
<option value="$PROJECT_DIR$/src/components/InvisibleNumberInput.d.ts" />
|
|
198
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedCarbs.jsx" />
|
|
199
|
-
<option value="$PROJECT_DIR$/src/components/InvisibleNumberInput.jsx" />
|
|
200
|
-
<option value="$PROJECT_DIR$/src/components/ExitModal.jsx" />
|
|
201
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIcon.d.ts" />
|
|
202
|
-
<option value="$PROJECT_DIR$/src/components/activity/Activity.d.ts" />
|
|
203
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIntensity.d.ts" />
|
|
204
|
-
<option value="$PROJECT_DIR$/src/components/activity/Activity.jsx" />
|
|
205
|
-
<option value="$PROJECT_DIR$/src/components/TransferToLogbook.jsx" />
|
|
206
|
-
<option value="$PROJECT_DIR$/src/components/ExitModal.d.ts" />
|
|
207
|
-
<option value="$PROJECT_DIR$/src/components/RecommendedInsulin.jsx" />
|
|
208
|
-
<option value="$PROJECT_DIR$/src/components/RecentInsulin.jsx" />
|
|
209
|
-
<option value="$PROJECT_DIR$/src/components/mood/MoodIcon.d.ts" />
|
|
210
|
-
<option value="$PROJECT_DIR$/src/components/mood/Emotion.d.ts" />
|
|
211
|
-
<option value="$PROJECT_DIR$/src/utils/AttentionMessages.jsx" />
|
|
212
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationUtils.js" />
|
|
213
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIcon.jsx" />
|
|
214
|
-
<option value="$PROJECT_DIR$/src/components/activity/ActivityIntensity.jsx" />
|
|
215
|
-
<option value="$PROJECT_DIR$/src/components/mood/MoodIcon.jsx" />
|
|
216
|
-
<option value="$PROJECT_DIR$/src/components/mood/Emotion.jsx" />
|
|
217
|
-
<option value="$PROJECT_DIR$/src/utils/Constants.d.ts" />
|
|
218
|
-
<option value="$PROJECT_DIR$/src/utils/Utils.d.ts" />
|
|
219
|
-
<option value="$PROJECT_DIR$/src/utils/Validations.js" />
|
|
220
|
-
<option value="$PROJECT_DIR$/src/utils/Utils.js" />
|
|
221
|
-
<option value="$PROJECT_DIR$/src/utils/AttentionMessages.d.ts" />
|
|
222
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationError.jsx" />
|
|
223
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationUtils.d.ts" />
|
|
224
|
-
<option value="$PROJECT_DIR$/src/utils/RecommendationError.d.ts" />
|
|
225
|
-
<option value="$PROJECT_DIR$/src/utils/Validations.d.ts" />
|
|
226
|
-
<option value="$PROJECT_DIR$/src/utils/Constants.js" />
|
|
227
|
-
<option value="$PROJECT_DIR$/src/locale/i18nUtils.js" />
|
|
228
|
-
<option value="$PROJECT_DIR$/src/locale/i18nUtils.d.ts" />
|
|
229
181
|
</list>
|
|
230
182
|
</option>
|
|
231
183
|
</component>
|
|
@@ -258,6 +210,10 @@
|
|
|
258
210
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
259
211
|
</state>
|
|
260
212
|
<state x="360" y="233" key="#com.intellij.execution.impl.EditConfigurationsDialog/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596109376244" />
|
|
213
|
+
<state x="2565" y="-159" key="#com.intellij.ide.util.MemberChooser" timestamp="1599035564109">
|
|
214
|
+
<screen x="1792" y="-410" width="1920" height="1057" />
|
|
215
|
+
</state>
|
|
216
|
+
<state x="2565" y="-159" key="#com.intellij.ide.util.MemberChooser/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599035564109" />
|
|
261
217
|
<state x="663" y="429" key="#com.jetbrains.plugins.reactnative.ReactNativePackagerConfigurationEditor" timestamp="1596109375456">
|
|
262
218
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
263
219
|
</state>
|
|
@@ -273,47 +229,48 @@
|
|
|
273
229
|
<state x="0" y="123" width="1792" height="897" key="DiffContextDialog/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597747801467" />
|
|
274
230
|
<state x="0" y="123" width="1792" height="897" key="DiffContextDialog/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1597836504040" />
|
|
275
231
|
<state x="1792" y="-314" width="1920" height="865" key="DiffContextDialog/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1598603549140" />
|
|
276
|
-
<state width="
|
|
277
|
-
<screen x="1792" y="-
|
|
232
|
+
<state width="918" height="257" key="GridCell.Tab.0.bottom" timestamp="1599641656861">
|
|
233
|
+
<screen x="1792" y="-410" width="1920" height="1057" />
|
|
278
234
|
</state>
|
|
279
235
|
<state width="1750" height="261" key="GridCell.Tab.0.bottom/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596194051670" />
|
|
280
|
-
<state width="
|
|
236
|
+
<state width="1678" height="366" key="GridCell.Tab.0.bottom/0.23.1792.1097@0.23.1792.1097" timestamp="1599585643328" />
|
|
281
237
|
<state width="1750" height="383" key="GridCell.Tab.0.bottom/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597945008184" />
|
|
282
|
-
<state width="
|
|
283
|
-
<state width="
|
|
284
|
-
<state width="
|
|
285
|
-
<state width="
|
|
286
|
-
<screen x="1792" y="-
|
|
238
|
+
<state width="1678" height="366" key="GridCell.Tab.0.bottom/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1599567565615" />
|
|
239
|
+
<state width="1276" height="270" key="GridCell.Tab.0.bottom/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1599230158300" />
|
|
240
|
+
<state width="918" height="257" key="GridCell.Tab.0.bottom/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599641656861" />
|
|
241
|
+
<state width="918" height="257" key="GridCell.Tab.0.center" timestamp="1599641656860">
|
|
242
|
+
<screen x="1792" y="-410" width="1920" height="1057" />
|
|
287
243
|
</state>
|
|
288
244
|
<state width="1750" height="261" key="GridCell.Tab.0.center/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596194051669" />
|
|
289
|
-
<state width="
|
|
245
|
+
<state width="1678" height="366" key="GridCell.Tab.0.center/0.23.1792.1097@0.23.1792.1097" timestamp="1599585643327" />
|
|
290
246
|
<state width="1750" height="383" key="GridCell.Tab.0.center/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597945008183" />
|
|
291
|
-
<state width="
|
|
292
|
-
<state width="
|
|
293
|
-
<state width="
|
|
294
|
-
<state width="
|
|
295
|
-
<screen x="1792" y="-
|
|
247
|
+
<state width="1678" height="366" key="GridCell.Tab.0.center/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1599567565614" />
|
|
248
|
+
<state width="1276" height="270" key="GridCell.Tab.0.center/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1599230158300" />
|
|
249
|
+
<state width="918" height="257" key="GridCell.Tab.0.center/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599641656860" />
|
|
250
|
+
<state width="918" height="257" key="GridCell.Tab.0.left" timestamp="1599641656860">
|
|
251
|
+
<screen x="1792" y="-410" width="1920" height="1057" />
|
|
296
252
|
</state>
|
|
297
253
|
<state width="1750" height="261" key="GridCell.Tab.0.left/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596194051668" />
|
|
298
|
-
<state width="
|
|
254
|
+
<state width="1678" height="366" key="GridCell.Tab.0.left/0.23.1792.1097@0.23.1792.1097" timestamp="1599585643327" />
|
|
299
255
|
<state width="1750" height="383" key="GridCell.Tab.0.left/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597945008182" />
|
|
300
|
-
<state width="
|
|
301
|
-
<state width="
|
|
302
|
-
<state width="
|
|
303
|
-
<state width="
|
|
304
|
-
<screen x="1792" y="-
|
|
256
|
+
<state width="1678" height="366" key="GridCell.Tab.0.left/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1599567565614" />
|
|
257
|
+
<state width="1276" height="270" key="GridCell.Tab.0.left/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1599230158299" />
|
|
258
|
+
<state width="918" height="257" key="GridCell.Tab.0.left/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599641656860" />
|
|
259
|
+
<state width="918" height="257" key="GridCell.Tab.0.right" timestamp="1599641656861">
|
|
260
|
+
<screen x="1792" y="-410" width="1920" height="1057" />
|
|
305
261
|
</state>
|
|
306
262
|
<state width="1750" height="261" key="GridCell.Tab.0.right/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596194051669" />
|
|
307
|
-
<state width="
|
|
263
|
+
<state width="1678" height="366" key="GridCell.Tab.0.right/0.23.1792.1097@0.23.1792.1097" timestamp="1599585643328" />
|
|
308
264
|
<state width="1750" height="383" key="GridCell.Tab.0.right/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597945008183" />
|
|
309
|
-
<state width="
|
|
310
|
-
<state width="
|
|
311
|
-
<state width="
|
|
312
|
-
<state x="
|
|
313
|
-
<screen x="
|
|
265
|
+
<state width="1678" height="366" key="GridCell.Tab.0.right/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1599567565614" />
|
|
266
|
+
<state width="1276" height="270" key="GridCell.Tab.0.right/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1599230158300" />
|
|
267
|
+
<state width="918" height="257" key="GridCell.Tab.0.right/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599641656861" />
|
|
268
|
+
<state x="2340" y="-140" key="IDE.errors.dialog" timestamp="1599637300780">
|
|
269
|
+
<screen x="1792" y="-410" width="1920" height="1057" />
|
|
314
270
|
</state>
|
|
315
271
|
<state x="511" y="303" key="IDE.errors.dialog/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597308623997" />
|
|
316
|
-
<state x="
|
|
272
|
+
<state x="2773" y="167" key="IDE.errors.dialog/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1598973647546" />
|
|
273
|
+
<state x="2340" y="-140" key="IDE.errors.dialog/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599637300780" />
|
|
317
274
|
<state x="0" y="23" width="1792" height="1097" key="MergeDialog" timestamp="1597409959598">
|
|
318
275
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
319
276
|
</state>
|
|
@@ -322,11 +279,12 @@
|
|
|
322
279
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
323
280
|
</state>
|
|
324
281
|
<state x="528" y="332" key="MultipleFileMergeDialog/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1597409961435" />
|
|
325
|
-
<state x="
|
|
326
|
-
<screen x="
|
|
282
|
+
<state x="2767" y="31" key="RollbackChangesDialog" timestamp="1598965839229">
|
|
283
|
+
<screen x="1792" y="-195" width="3440" height="1417" />
|
|
327
284
|
</state>
|
|
328
285
|
<state x="508" y="198" key="RollbackChangesDialog/0.23.1792.1097@0.23.1792.1097" timestamp="1596191567466" />
|
|
329
286
|
<state x="508" y="198" key="RollbackChangesDialog/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597748577571" />
|
|
287
|
+
<state x="2767" y="31" key="RollbackChangesDialog/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1598965839229" />
|
|
330
288
|
<state x="508" y="198" key="RollbackChangesDialog/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1597836481148" />
|
|
331
289
|
<state x="397" y="210" key="SettingsEditor" timestamp="1596110346829">
|
|
332
290
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
@@ -336,23 +294,27 @@
|
|
|
336
294
|
<screen x="0" y="23" width="1792" height="1097" />
|
|
337
295
|
</state>
|
|
338
296
|
<state x="428" y="230" key="com.intellij.openapi.vcs.changes.SpecificFilesViewDialog/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596103115204" />
|
|
339
|
-
<state x="
|
|
340
|
-
<screen x="
|
|
297
|
+
<state x="558" y="310" width="1234" height="580" key="find.popup" timestamp="1599469543819">
|
|
298
|
+
<screen x="0" y="23" width="1792" height="1097" />
|
|
341
299
|
</state>
|
|
342
300
|
<state x="559" y="310" width="1233" height="522" key="find.popup/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596116959250" />
|
|
343
301
|
<state x="559" y="310" width="1233" height="522" key="find.popup/0.23.1792.1097@0.23.1792.1097" timestamp="1596191045450" />
|
|
344
302
|
<state x="558" y="310" width="1234" height="580" key="find.popup/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597748403272" />
|
|
345
|
-
<state x="2863" y="176" width="2369" height="738" key="find.popup/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="
|
|
346
|
-
<state x="558" y="310" width="1234" height="580" key="find.popup/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="
|
|
347
|
-
<state x="2390" y="-133" width="1322" height="
|
|
348
|
-
<state x="
|
|
349
|
-
<screen x="1792" y="-
|
|
303
|
+
<state x="2863" y="176" width="2369" height="738" key="find.popup/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1599137555658" />
|
|
304
|
+
<state x="558" y="310" width="1234" height="580" key="find.popup/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1599469543819" />
|
|
305
|
+
<state x="2390" y="-133" width="1322" height="582" key="find.popup/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599038215964" />
|
|
306
|
+
<state x="2477" y="-143" key="refactoring.ChangeSignatureDialog" timestamp="1599040674381">
|
|
307
|
+
<screen x="1792" y="-410" width="1920" height="1057" />
|
|
308
|
+
</state>
|
|
309
|
+
<state x="2477" y="-143" key="refactoring.ChangeSignatureDialog/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599040674381" />
|
|
310
|
+
<state x="2178" y="-174" width="718" height="652" key="search.everywhere.popup" timestamp="1599645055979">
|
|
311
|
+
<screen x="1792" y="-410" width="1920" height="1057" />
|
|
350
312
|
</state>
|
|
351
313
|
<state x="360" y="268" width="670" height="676" key="search.everywhere.popup/-1920.-66.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1596101738778" />
|
|
352
314
|
<state x="360" y="268" width="670" height="676" key="search.everywhere.popup/0.23.1792.1097@0.23.1792.1097" timestamp="1596191050648" />
|
|
353
315
|
<state x="360" y="268" width="671" height="677" key="search.everywhere.popup/1792.-195.3440.1417/0.23.1792.1097@0.23.1792.1097" timestamp="1597748285464" />
|
|
354
|
-
<state x="2484" y="121" width="1287" height="875" key="search.everywhere.popup/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="
|
|
355
|
-
<state x="360" y="268" width="671" height="677" key="search.everywhere.popup/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="
|
|
356
|
-
<state x="2178" y="-174" width="718" height="652" key="search.everywhere.popup/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="
|
|
316
|
+
<state x="2484" y="121" width="1287" height="875" key="search.everywhere.popup/1792.-195.3440.1417/0.23.1792.1097@1792.-195.3440.1417" timestamp="1599560052196" />
|
|
317
|
+
<state x="360" y="268" width="671" height="677" key="search.everywhere.popup/1792.-410.1920.1057/0.23.1792.1097@0.23.1792.1097" timestamp="1599216348282" />
|
|
318
|
+
<state x="2178" y="-174" width="718" height="652" key="search.everywhere.popup/1792.-410.1920.1057/0.23.1792.1097@1792.-410.1920.1057" timestamp="1599645055979" />
|
|
357
319
|
</component>
|
|
358
320
|
</project>
|
package/package.json
CHANGED
|
@@ -42,8 +42,11 @@ interface IState {
|
|
|
42
42
|
export default class RecommendationScreen extends React.Component<IRecommendationProps, IState> {
|
|
43
43
|
private readonly timer;
|
|
44
44
|
private readonly suggestedCarbs;
|
|
45
|
+
private readonly hasError;
|
|
45
46
|
private scrollView;
|
|
46
47
|
constructor(props: IRecommendationProps);
|
|
48
|
+
componentWillUnmount(): void;
|
|
49
|
+
recalculateInsulin: (calculatorParams: Calculator.IRecommendationParams) => void;
|
|
47
50
|
onExit: () => void;
|
|
48
51
|
updateRemeasureTime: (remeasureTime: number) => void;
|
|
49
52
|
handleNoRecentInsulin: () => void;
|
|
@@ -51,13 +51,20 @@ react_native_1.YellowBox.ignoreWarnings([`Setting a timer`]);
|
|
|
51
51
|
class RecommendationScreen extends react_1.default.Component {
|
|
52
52
|
constructor(props) {
|
|
53
53
|
super(props);
|
|
54
|
+
this.hasError = false;
|
|
55
|
+
this.recalculateInsulin = (calculatorParams) => {
|
|
56
|
+
const { bolus } = Calculator.calculateRecommendation(RecommendationUtils_1.assignTargetBGL(calculatorParams));
|
|
57
|
+
this.setState({
|
|
58
|
+
insulinRecommendation: Utils_1.Utils.roundValue(bolus, this.props.injectionMethod),
|
|
59
|
+
enteredInsulin: undefined,
|
|
60
|
+
});
|
|
61
|
+
};
|
|
54
62
|
this.onExit = () => {
|
|
55
63
|
if (this.state.isRecommendationDisplayed) {
|
|
56
64
|
this.setState({ exitModal: true }, () => this.props.showBolusBar(!this.state.exitModal));
|
|
57
65
|
}
|
|
58
66
|
else {
|
|
59
67
|
this.props.exitCallback();
|
|
60
|
-
clearTimeout(this.timer);
|
|
61
68
|
}
|
|
62
69
|
};
|
|
63
70
|
this.updateRemeasureTime = (remeasureTime) => {
|
|
@@ -71,10 +78,11 @@ class RecommendationScreen extends react_1.default.Component {
|
|
|
71
78
|
});
|
|
72
79
|
};
|
|
73
80
|
this.updateCarbRecommendation = (enteredCarbs) => {
|
|
74
|
-
this.
|
|
81
|
+
const providedCarbs = this.props.calculatorParams.carbohydrates;
|
|
82
|
+
this.setState({ enteredCarbs }, () => this.recalculateInsulin({ ...this.props.calculatorParams, carbohydrates: providedCarbs + enteredCarbs }));
|
|
75
83
|
};
|
|
76
84
|
this.removeCarbRecommendation = () => {
|
|
77
|
-
this.setState({ enteredCarbs: null, carbRecommendation: null });
|
|
85
|
+
this.setState({ enteredCarbs: null, carbRecommendation: null }, () => this.recalculateInsulin({ ...this.props.calculatorParams }));
|
|
78
86
|
};
|
|
79
87
|
this.declineCarbRecommendation = () => {
|
|
80
88
|
this.hideAttentionModal();
|
|
@@ -93,7 +101,6 @@ class RecommendationScreen extends react_1.default.Component {
|
|
|
93
101
|
};
|
|
94
102
|
this.closeCalculation = () => {
|
|
95
103
|
this.hideExitModal();
|
|
96
|
-
clearTimeout(this.timer);
|
|
97
104
|
this.props.closeCalculationCallback();
|
|
98
105
|
};
|
|
99
106
|
this.handleMoodSelected = (selectedMood) => {
|
|
@@ -106,14 +113,9 @@ class RecommendationScreen extends react_1.default.Component {
|
|
|
106
113
|
if (this.state.exitModal) {
|
|
107
114
|
this.hideExitModal();
|
|
108
115
|
}
|
|
109
|
-
this.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}, {
|
|
113
|
-
suggested: this.state.insulinRecommendation,
|
|
114
|
-
entered: this.state.enteredInsulin,
|
|
115
|
-
}, this.state.remeasureTime);
|
|
116
|
-
clearTimeout(this.timer);
|
|
116
|
+
const carbs = { suggested: this.suggestedCarbs, entered: this.state.enteredCarbs };
|
|
117
|
+
const insulin = { suggested: this.state.insulinRecommendation, entered: this.state.enteredInsulin };
|
|
118
|
+
this.props.transferToLogbook(carbs, insulin, this.state.remeasureTime);
|
|
117
119
|
};
|
|
118
120
|
this.getBGLevelAttentionMessage = () => {
|
|
119
121
|
const { calculatorParams, latestLogbookFrom6Hours } = this.props;
|
|
@@ -132,42 +134,49 @@ class RecommendationScreen extends react_1.default.Component {
|
|
|
132
134
|
return RecommendationUtils_1.getLimitationMessage(wasLimited, activityReduction);
|
|
133
135
|
};
|
|
134
136
|
try {
|
|
135
|
-
Validations_1.validateParams(props);
|
|
137
|
+
Validations_1.validateParams(this.props);
|
|
138
|
+
i18nUtils_1.changeLanguage(props.language);
|
|
139
|
+
const { recentBoluses } = this.props?.calculatorParams;
|
|
140
|
+
const { bolus, carbRecommendation, activityReduction, wasLimited, activeInsulin, } = Calculator.calculateRecommendation(RecommendationUtils_1.assignTargetBGL(this.props.calculatorParams));
|
|
141
|
+
this.suggestedCarbs = carbRecommendation;
|
|
142
|
+
this.state = {
|
|
143
|
+
remeasureTime: this.getBGLevelRemeasurementReminder(),
|
|
144
|
+
isRecommendationDisplayed: recentBoluses?.length !== 0,
|
|
145
|
+
insulinRecommendation: Utils_1.Utils.roundValue(bolus, props.injectionMethod),
|
|
146
|
+
wasLimited,
|
|
147
|
+
activityReduction,
|
|
148
|
+
bolus,
|
|
149
|
+
carbRecommendation,
|
|
150
|
+
activeInsulin,
|
|
151
|
+
selectedMood: null,
|
|
152
|
+
recommendationModal: wasLimited || !!Math.round(carbRecommendation) || !!this.getBGLevelAttentionMessage(),
|
|
153
|
+
exitModal: false,
|
|
154
|
+
};
|
|
155
|
+
this.timer = setTimeout(() => {
|
|
156
|
+
props.onError(RecommendationError_1.TimeoutLimitError());
|
|
157
|
+
}, enum_1.Milliseconds.Minute * 15);
|
|
136
158
|
}
|
|
137
159
|
catch (error) {
|
|
138
|
-
|
|
160
|
+
this.hasError = true;
|
|
161
|
+
this.props.onError(error);
|
|
139
162
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
this.suggestedCarbs = carbRecommendation;
|
|
144
|
-
const activeInsulin = Calculator.calculateActiveInsulin(recentBoluses ?? []);
|
|
145
|
-
this.state = {
|
|
146
|
-
remeasureTime: this.getBGLevelRemeasurementReminder(),
|
|
147
|
-
isRecommendationDisplayed: recentBoluses?.length !== 0,
|
|
148
|
-
insulinRecommendation: Utils_1.Utils.roundValue(bolus, props.injectionMethod),
|
|
149
|
-
wasLimited,
|
|
150
|
-
activityReduction,
|
|
151
|
-
bolus,
|
|
152
|
-
carbRecommendation,
|
|
153
|
-
activeInsulin,
|
|
154
|
-
selectedMood: null,
|
|
155
|
-
recommendationModal: wasLimited || !!Math.round(carbRecommendation) || !!this.getBGLevelAttentionMessage(),
|
|
156
|
-
exitModal: false,
|
|
157
|
-
};
|
|
158
|
-
this.timer = setTimeout(() => {
|
|
159
|
-
props.onError(RecommendationError_1.TimeoutLimitError());
|
|
160
|
-
}, enum_1.Milliseconds.Minute * 15);
|
|
163
|
+
}
|
|
164
|
+
componentWillUnmount() {
|
|
165
|
+
clearTimeout(this.timer);
|
|
161
166
|
}
|
|
162
167
|
render() {
|
|
163
|
-
|
|
164
|
-
|
|
168
|
+
if (this.hasError) {
|
|
169
|
+
return <react_native_1.View style={containerStyles.container}/>;
|
|
170
|
+
}
|
|
171
|
+
const { activeInsulin, recommendationModal, carbRecommendation, enteredCarbs, enteredInsulin, insulinRecommendation, activityReduction, isRecommendationDisplayed, } = this.state;
|
|
172
|
+
const { calculatorParams, units } = this.props;
|
|
165
173
|
const { currentBGL, carbohydrates } = calculatorParams;
|
|
174
|
+
const displayedBGL = units === enum_1.BGUnit.MMOL_L ? currentBGL : Utils_1.Utils.convertToMGDL(currentBGL);
|
|
166
175
|
return (<react_2.I18nProvider language={this.props.language} i18n={i18nUtils_1.i18n}>
|
|
167
176
|
<react_native_1.ScrollView style={containerStyles.container} ref={(view) => (this.scrollView = view)}>
|
|
168
177
|
<Header_1.default exitCallback={this.onExit}/>
|
|
169
|
-
<InfoBars_1.default label={i18nUtils_1.i18n._(macro_1.t `Active Insulin`)} value={activeInsulin ? `${activeInsulin.toFixed(1)}` : null} units={i18nUtils_1.i18n._(macro_1.t `units`)} showZeroAsDash={false}/>
|
|
170
|
-
<InfoBars_1.default label={i18nUtils_1.i18n._(macro_1.t `Blood Glucose Level`)} value={currentBGL ? `${
|
|
178
|
+
<InfoBars_1.default style={{ flex: 5 }} label={i18nUtils_1.i18n._(macro_1.t `Active Insulin`)} value={activeInsulin ? `${activeInsulin.toFixed(1)}` : null} units={i18nUtils_1.i18n._(macro_1.t `units`)} showZeroAsDash={false}/>
|
|
179
|
+
<InfoBars_1.default label={i18nUtils_1.i18n._(macro_1.t `Blood Glucose Level`)} value={currentBGL ? `${displayedBGL}` : null} units={this.props.units} showZeroAsDash={true}/>
|
|
171
180
|
<react_native_1.View style={containerStyles.calcContainer}>
|
|
172
181
|
<react_native_1.View style={containerStyles.calcMargin}>
|
|
173
182
|
<react_native_1.View style={[
|
|
@@ -176,15 +185,15 @@ class RecommendationScreen extends react_1.default.Component {
|
|
|
176
185
|
borderColor: carbRecommendation ? Constants_1.BORDER_COLOUR_TEAL : Constants_1.BORDER_COLOUR_GREY,
|
|
177
186
|
},
|
|
178
187
|
]}>
|
|
179
|
-
<RecommendedCarbs_1.default enteredCarbs={`${carbohydrates}`} changedRecommendedCarbs={this.updateCarbRecommendation} recommendedCarbs={`${enteredCarbs ?? Math.round(carbRecommendation)}`} removeRecommendedCarbs={this.removeCarbRecommendation}
|
|
188
|
+
<RecommendedCarbs_1.default enteredCarbs={`${carbohydrates}`} changedRecommendedCarbs={this.updateCarbRecommendation} recommendedCarbs={`${enteredCarbs ?? Math.round(carbRecommendation)}`} removeRecommendedCarbs={this.removeCarbRecommendation}/>
|
|
180
189
|
<Remeasure_1.default onSliderChange={this.updateRemeasureTime} remeasureTime={this.state.remeasureTime}/>
|
|
181
190
|
</react_native_1.View>
|
|
182
191
|
</react_native_1.View>
|
|
183
192
|
</react_native_1.View>
|
|
184
193
|
{this.props.calculatorParams.activity && this.props.activityType !== null ? (<Activity_1.default activity={this.props.calculatorParams.activity} activityType={this.props.activityType} activityReduction={this.state.activityReduction}/>) : null}
|
|
185
|
-
{!this.state.isRecommendationDisplayed ? (<RecentInsulin_1.default onRecentInsulinYes={this.props.onRecentInsulinYes} onRecentInsulinNo={this.handleNoRecentInsulin}/>) : (<RecommendedInsulin_1.default injectionMethod={this.props.injectionMethod} insulinRecommendation={
|
|
194
|
+
{!this.state.isRecommendationDisplayed ? (<RecentInsulin_1.default onRecentInsulinYes={this.props.onRecentInsulinYes} onRecentInsulinNo={this.handleNoRecentInsulin}/>) : (<RecommendedInsulin_1.default injectionMethod={this.props.injectionMethod} insulinRecommendation={insulinRecommendation} enteredInsulin={enteredInsulin} activityReduction={activityReduction} updateRecommendedInsulin={this.updateInsulinRecommendation}/>)}
|
|
186
195
|
<Emotion_1.default moodSelected={this.handleMoodSelected} currentMood={this.state.selectedMood}/>
|
|
187
|
-
<TransferToLogbook_1.default visible={
|
|
196
|
+
<TransferToLogbook_1.default visible={isRecommendationDisplayed} transfer={this.handleTransfer}/>
|
|
188
197
|
<RecommendationModal_1.default isVisible={recommendationModal} suggestedCarbohydrates={carbRecommendation} attentionMessage={this.getBGLevelAttentionMessage()} limitationMessage={this.getLimitationAttentionMessage()} onClickOkButton={this.hideAttentionModal} onAcceptCarbohydrates={this.acceptCarbRecommendation} onDeclineCarbohydrates={this.declineCarbRecommendation}/>
|
|
189
198
|
</react_native_1.ScrollView>
|
|
190
199
|
{this.state.exitModal ? (<ExitModal_1.default onSave={this.handleTransfer} onCloseCalculation={this.closeCalculation} onClose={this.hideExitModal}/>) : null}
|