@hedia/recommendation-screen 2.1.34-alpha.1 → 2.1.34-alpha.10

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.
Files changed (281) hide show
  1. package/dist/App.d.ts +27 -0
  2. package/dist/App.js +87 -0
  3. package/{src → dist/src}/RecommendationScreen.d.ts +2 -2
  4. package/{src → dist/src}/RecommendationScreen.js +9 -5
  5. package/package.json +24 -14
  6. package/.flowconfig +0 -65
  7. package/.github/pull_request_template.md +0 -6
  8. package/.github/workflows/on-post-merge-publish-package.yaml +0 -35
  9. package/.github/workflows/validate-pr-title.yaml +0 -20
  10. package/.github/workflows/version-bump-publish-alpha.yaml +0 -49
  11. package/.linguirc +0 -6
  12. package/.npmpackagejsonlintrc.json +0 -12
  13. package/.prettierignore +0 -2
  14. package/.prettierrc +0 -25
  15. package/Changelog.md +0 -9
  16. package/android/app/BUCK +0 -55
  17. package/android/app/build.gradle +0 -228
  18. package/android/app/build_defs.bzl +0 -19
  19. package/android/app/debug.keystore +0 -0
  20. package/android/app/proguard-rules.pro +0 -10
  21. package/android/app/src/debug/AndroidManifest.xml +0 -13
  22. package/android/app/src/debug/java/com/hediarecommendationscreen/ReactNativeFlipper.java +0 -72
  23. package/android/app/src/main/AndroidManifest.xml +0 -25
  24. package/android/app/src/main/assets/fonts/AntDesign.ttf +0 -0
  25. package/android/app/src/main/assets/fonts/Entypo.ttf +0 -0
  26. package/android/app/src/main/assets/fonts/EvilIcons.ttf +0 -0
  27. package/android/app/src/main/assets/fonts/Feather.ttf +0 -0
  28. package/android/app/src/main/assets/fonts/FontAwesome.ttf +0 -0
  29. package/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf +0 -0
  30. package/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf +0 -0
  31. package/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf +0 -0
  32. package/android/app/src/main/assets/fonts/Fontisto.ttf +0 -0
  33. package/android/app/src/main/assets/fonts/Foundation.ttf +0 -0
  34. package/android/app/src/main/assets/fonts/Ionicons.ttf +0 -0
  35. package/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf +0 -0
  36. package/android/app/src/main/assets/fonts/MaterialIcons.ttf +0 -0
  37. package/android/app/src/main/assets/fonts/Octicons.ttf +0 -0
  38. package/android/app/src/main/assets/fonts/Roboto-Black.ttf +0 -0
  39. package/android/app/src/main/assets/fonts/Roboto-BlackItalic.ttf +0 -0
  40. package/android/app/src/main/assets/fonts/Roboto-Bold.ttf +0 -0
  41. package/android/app/src/main/assets/fonts/Roboto-BoldItalic.ttf +0 -0
  42. package/android/app/src/main/assets/fonts/Roboto-Italic.ttf +0 -0
  43. package/android/app/src/main/assets/fonts/Roboto-Light.ttf +0 -0
  44. package/android/app/src/main/assets/fonts/Roboto-LightItalic.ttf +0 -0
  45. package/android/app/src/main/assets/fonts/Roboto-Medium.ttf +0 -0
  46. package/android/app/src/main/assets/fonts/Roboto-MediumItalic.ttf +0 -0
  47. package/android/app/src/main/assets/fonts/Roboto-Regular.ttf +0 -0
  48. package/android/app/src/main/assets/fonts/Roboto-Thin.ttf +0 -0
  49. package/android/app/src/main/assets/fonts/Roboto-ThinItalic.ttf +0 -0
  50. package/android/app/src/main/assets/fonts/SimpleLineIcons.ttf +0 -0
  51. package/android/app/src/main/assets/fonts/Zocial.ttf +0 -0
  52. package/android/app/src/main/java/com/hediarecommendationscreen/MainActivity.java +0 -15
  53. package/android/app/src/main/java/com/hediarecommendationscreen/MainApplication.java +0 -80
  54. package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  55. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  56. package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  57. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  58. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  59. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  60. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  61. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  62. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  63. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  64. package/android/app/src/main/res/values/color.xml +0 -3
  65. package/android/app/src/main/res/values/strings.xml +0 -3
  66. package/android/app/src/main/res/values/styles.xml +0 -11
  67. package/android/build.gradle +0 -38
  68. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  69. package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  70. package/android/gradle.properties +0 -28
  71. package/android/gradlew +0 -185
  72. package/android/gradlew.bat +0 -89
  73. package/android/settings.gradle +0 -3
  74. package/assets/fonts/Roboto/LICENSE.txt +0 -202
  75. package/assets/fonts/Roboto/Roboto-Black.ttf +0 -0
  76. package/assets/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  77. package/assets/fonts/Roboto/Roboto-Bold.ttf +0 -0
  78. package/assets/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  79. package/assets/fonts/Roboto/Roboto-Italic.ttf +0 -0
  80. package/assets/fonts/Roboto/Roboto-Light.ttf +0 -0
  81. package/assets/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  82. package/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
  83. package/assets/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  84. package/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
  85. package/assets/fonts/Roboto/Roboto-Thin.ttf +0 -0
  86. package/assets/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  87. package/babel.config.js +0 -18
  88. package/coverage/clover.xml +0 -721
  89. package/coverage/coverage-final.json +0 -28
  90. package/coverage/lcov-report/base.css +0 -224
  91. package/coverage/lcov-report/block-navigation.js +0 -79
  92. package/coverage/lcov-report/favicon.png +0 -0
  93. package/coverage/lcov-report/index.html +0 -201
  94. package/coverage/lcov-report/prettify.css +0 -1
  95. package/coverage/lcov-report/prettify.js +0 -2
  96. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  97. package/coverage/lcov-report/sorter.js +0 -170
  98. package/coverage/lcov-report/src/RecommendationScreen.tsx.html +0 -2588
  99. package/coverage/lcov-report/src/__tests__/index.html +0 -111
  100. package/coverage/lcov-report/src/__tests__/utils.tsx.html +0 -533
  101. package/coverage/lcov-report/src/components/Header.tsx.html +0 -356
  102. package/coverage/lcov-report/src/components/InfoBars.tsx.html +0 -518
  103. package/coverage/lcov-report/src/components/InvisibleNumberInput.tsx.html +0 -587
  104. package/coverage/lcov-report/src/components/LimitationMessage.tsx.html +0 -209
  105. package/coverage/lcov-report/src/components/LineSeparator.tsx.html +0 -161
  106. package/coverage/lcov-report/src/components/RecentInsulin.tsx.html +0 -410
  107. package/coverage/lcov-report/src/components/RecommendationModal.tsx.html +0 -923
  108. package/coverage/lcov-report/src/components/RecommendedCarbs.tsx.html +0 -1061
  109. package/coverage/lcov-report/src/components/RecommendedInsulin.tsx.html +0 -779
  110. package/coverage/lcov-report/src/components/Remeasure.tsx.html +0 -551
  111. package/coverage/lcov-report/src/components/TransferToLogbook.tsx.html +0 -443
  112. package/coverage/lcov-report/src/components/TwoOptionModal.tsx.html +0 -671
  113. package/coverage/lcov-report/src/components/activity/Activity.tsx.html +0 -371
  114. package/coverage/lcov-report/src/components/activity/ActivityIcon.tsx.html +0 -281
  115. package/coverage/lcov-report/src/components/activity/ActivityIntensity.tsx.html +0 -281
  116. package/coverage/lcov-report/src/components/activity/index.html +0 -141
  117. package/coverage/lcov-report/src/components/index.html +0 -276
  118. package/coverage/lcov-report/src/components/mood/Emotion.tsx.html +0 -353
  119. package/coverage/lcov-report/src/components/mood/MoodIcon.tsx.html +0 -335
  120. package/coverage/lcov-report/src/components/mood/index.html +0 -126
  121. package/coverage/lcov-report/src/index.html +0 -111
  122. package/coverage/lcov-report/src/locale/i18nUtils.ts.html +0 -206
  123. package/coverage/lcov-report/src/locale/index.html +0 -111
  124. package/coverage/lcov-report/src/utils/AttentionMessages.tsx.html +0 -554
  125. package/coverage/lcov-report/src/utils/Constants.ts.html +0 -248
  126. package/coverage/lcov-report/src/utils/RecommendationError.tsx.html +0 -620
  127. package/coverage/lcov-report/src/utils/RecommendationUtils.ts.html +0 -764
  128. package/coverage/lcov-report/src/utils/Translations.ts.html +0 -131
  129. package/coverage/lcov-report/src/utils/Utils.ts.html +0 -545
  130. package/coverage/lcov-report/src/utils/Validations.ts.html +0 -1544
  131. package/coverage/lcov-report/src/utils/index.html +0 -201
  132. package/coverage/lcov.info +0 -1618
  133. package/ignore-git.sh +0 -46
  134. package/ignore-publish.sh +0 -33
  135. package/index-git.sh +0 -5
  136. package/ios/HediaRecommendationScreen/AppDelegate.h +0 -8
  137. package/ios/HediaRecommendationScreen/AppDelegate.m +0 -61
  138. package/ios/HediaRecommendationScreen/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
  139. package/ios/HediaRecommendationScreen/Images.xcassets/Contents.json +0 -6
  140. package/ios/HediaRecommendationScreen/Info.plist +0 -90
  141. package/ios/HediaRecommendationScreen/LaunchScreen.storyboard +0 -47
  142. package/ios/HediaRecommendationScreen/main.m +0 -9
  143. package/ios/HediaRecommendationScreen.xcodeproj/project.pbxproj +0 -778
  144. package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen-tvOS.xcscheme +0 -88
  145. package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen.xcscheme +0 -88
  146. package/ios/HediaRecommendationScreen.xcworkspace/contents.xcworkspacedata +0 -10
  147. package/ios/HediaRecommendationScreen.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  148. package/ios/HediaRecommendationScreenTests/HediaRecommendationScreenTests.m +0 -65
  149. package/ios/HediaRecommendationScreenTests/Info.plist +0 -24
  150. package/ios/Podfile +0 -32
  151. package/ios/Podfile.lock +0 -544
  152. package/jest.config.js +0 -197
  153. package/jest.mock.js +0 -1
  154. package/metro.config.js +0 -17
  155. package/react-native.config.js +0 -7
  156. package/src/assets/activity/Cyclist.png +0 -0
  157. package/src/assets/activity/Other.png +0 -0
  158. package/src/assets/activity/Runner.png +0 -0
  159. package/src/assets/activity/Swimmer.png +0 -0
  160. package/src/assets/activity/Walk.png +0 -0
  161. package/src/assets/mood/happy.png +0 -0
  162. package/src/assets/mood/happy_active.png +0 -0
  163. package/src/assets/mood/neutral.png +0 -0
  164. package/src/assets/mood/neutral_active.png +0 -0
  165. package/src/assets/mood/sad.png +0 -0
  166. package/src/assets/mood/sad_active.png +0 -0
  167. package/src/assets/mood/semi_happy.png +0 -0
  168. package/src/assets/mood/semi_happy_active.png +0 -0
  169. package/src/assets/mood/semi_sad.png +0 -0
  170. package/src/assets/mood/semi_sad_active.png +0 -0
  171. package/src/locale/da/messages.js +0 -1
  172. package/src/locale/da/messages.po +0 -349
  173. package/src/locale/de/messages.js +0 -1
  174. package/src/locale/de/messages.po +0 -349
  175. package/src/locale/en/messages.js +0 -1
  176. package/src/locale/en/messages.po +0 -349
  177. package/src/locale/es/messages.js +0 -1
  178. package/src/locale/es/messages.po +0 -349
  179. package/src/locale/fr/messages.js +0 -1
  180. package/src/locale/fr/messages.po +0 -349
  181. package/src/locale/it/messages.js +0 -1
  182. package/src/locale/it/messages.po +0 -349
  183. package/tsconfig.json +0 -72
  184. package/tslint.json +0 -193
  185. package/typedoc.json +0 -13
  186. /package/{index.d.ts → dist/index.d.ts} +0 -0
  187. /package/{index.js → dist/index.js} +0 -0
  188. /package/{src → dist/src}/__tests__/RecommendationScreen.test.d.ts +0 -0
  189. /package/{src → dist/src}/__tests__/RecommendationScreen.test.js +0 -0
  190. /package/{src → dist/src}/__tests__/RecommendationUtils.test.d.ts +0 -0
  191. /package/{src → dist/src}/__tests__/RecommendationUtils.test.js +0 -0
  192. /package/{src → dist/src}/__tests__/Translate.test.d.ts +0 -0
  193. /package/{src → dist/src}/__tests__/Translate.test.js +0 -0
  194. /package/{src → dist/src}/__tests__/Utils.test.d.ts +0 -0
  195. /package/{src → dist/src}/__tests__/Utils.test.js +0 -0
  196. /package/{src → dist/src}/__tests__/Validations.test.d.ts +0 -0
  197. /package/{src → dist/src}/__tests__/Validations.test.js +0 -0
  198. /package/{src → dist/src}/__tests__/components/Activity.test.d.ts +0 -0
  199. /package/{src → dist/src}/__tests__/components/Activity.test.js +0 -0
  200. /package/{src → dist/src}/__tests__/components/Emotion.test.d.ts +0 -0
  201. /package/{src → dist/src}/__tests__/components/Emotion.test.js +0 -0
  202. /package/{src → dist/src}/__tests__/components/Header.test.d.ts +0 -0
  203. /package/{src → dist/src}/__tests__/components/Header.test.js +0 -0
  204. /package/{src → dist/src}/__tests__/components/InfoBars.test.d.ts +0 -0
  205. /package/{src → dist/src}/__tests__/components/InfoBars.test.js +0 -0
  206. /package/{src → dist/src}/__tests__/components/InvisibleNumberInput.test.d.ts +0 -0
  207. /package/{src → dist/src}/__tests__/components/InvisibleNumberInput.test.js +0 -0
  208. /package/{src → dist/src}/__tests__/components/LimitationMessage.test.d.ts +0 -0
  209. /package/{src → dist/src}/__tests__/components/LimitationMessage.test.js +0 -0
  210. /package/{src → dist/src}/__tests__/components/MoodIcon.test.d.ts +0 -0
  211. /package/{src → dist/src}/__tests__/components/MoodIcon.test.js +0 -0
  212. /package/{src → dist/src}/__tests__/components/RecommendationModal.test.d.ts +0 -0
  213. /package/{src → dist/src}/__tests__/components/RecommendationModal.test.js +0 -0
  214. /package/{src → dist/src}/__tests__/components/RecommendedCarbs.test.d.ts +0 -0
  215. /package/{src → dist/src}/__tests__/components/RecommendedCarbs.test.js +0 -0
  216. /package/{src → dist/src}/__tests__/components/RecommendedInsulin.test.d.ts +0 -0
  217. /package/{src → dist/src}/__tests__/components/RecommendedInsulin.test.js +0 -0
  218. /package/{src → dist/src}/__tests__/components/Remeasure.test.d.ts +0 -0
  219. /package/{src → dist/src}/__tests__/components/Remeasure.test.js +0 -0
  220. /package/{src → dist/src}/__tests__/components/TransferToLogbook.test.d.ts +0 -0
  221. /package/{src → dist/src}/__tests__/components/TransferToLogbook.test.js +0 -0
  222. /package/{src → dist/src}/__tests__/components/TwoOptionModal.test.d.ts +0 -0
  223. /package/{src → dist/src}/__tests__/components/TwoOptionModal.test.js +0 -0
  224. /package/{src → dist/src}/__tests__/utils.d.ts +0 -0
  225. /package/{src → dist/src}/__tests__/utils.js +0 -0
  226. /package/{src → dist/src}/components/Header.d.ts +0 -0
  227. /package/{src → dist/src}/components/Header.js +0 -0
  228. /package/{src → dist/src}/components/Icon.d.ts +0 -0
  229. /package/{src → dist/src}/components/Icon.js +0 -0
  230. /package/{src → dist/src}/components/InfoBars.d.ts +0 -0
  231. /package/{src → dist/src}/components/InfoBars.js +0 -0
  232. /package/{src → dist/src}/components/InvisibleNumberInput.d.ts +0 -0
  233. /package/{src → dist/src}/components/InvisibleNumberInput.js +0 -0
  234. /package/{src → dist/src}/components/LimitationMessage.d.ts +0 -0
  235. /package/{src → dist/src}/components/LimitationMessage.js +0 -0
  236. /package/{src → dist/src}/components/LineSeparator.d.ts +0 -0
  237. /package/{src → dist/src}/components/LineSeparator.js +0 -0
  238. /package/{src → dist/src}/components/RecentInsulin.d.ts +0 -0
  239. /package/{src → dist/src}/components/RecentInsulin.js +0 -0
  240. /package/{src → dist/src}/components/RecommendationModal.d.ts +0 -0
  241. /package/{src → dist/src}/components/RecommendationModal.js +0 -0
  242. /package/{src → dist/src}/components/RecommendedCarbs.d.ts +0 -0
  243. /package/{src → dist/src}/components/RecommendedCarbs.js +0 -0
  244. /package/{src → dist/src}/components/RecommendedInsulin.d.ts +0 -0
  245. /package/{src → dist/src}/components/RecommendedInsulin.js +0 -0
  246. /package/{src → dist/src}/components/Remeasure.d.ts +0 -0
  247. /package/{src → dist/src}/components/Remeasure.js +0 -0
  248. /package/{src → dist/src}/components/TransferToLogbook.d.ts +0 -0
  249. /package/{src → dist/src}/components/TransferToLogbook.js +0 -0
  250. /package/{src → dist/src}/components/TwoOptionModal.d.ts +0 -0
  251. /package/{src → dist/src}/components/TwoOptionModal.js +0 -0
  252. /package/{src → dist/src}/components/activity/Activity.d.ts +0 -0
  253. /package/{src → dist/src}/components/activity/Activity.js +0 -0
  254. /package/{src → dist/src}/components/activity/ActivityIcon.d.ts +0 -0
  255. /package/{src → dist/src}/components/activity/ActivityIcon.js +0 -0
  256. /package/{src → dist/src}/components/activity/ActivityIntensity.d.ts +0 -0
  257. /package/{src → dist/src}/components/activity/ActivityIntensity.js +0 -0
  258. /package/{src → dist/src}/components/mood/Emotion.d.ts +0 -0
  259. /package/{src → dist/src}/components/mood/Emotion.js +0 -0
  260. /package/{src → dist/src}/components/mood/MoodIcon.d.ts +0 -0
  261. /package/{src → dist/src}/components/mood/MoodIcon.js +0 -0
  262. /package/{src → dist/src}/locale/i18nUtils.d.ts +0 -0
  263. /package/{src → dist/src}/locale/i18nUtils.js +0 -0
  264. /package/{src → dist/src}/types/enum.d.ts +0 -0
  265. /package/{src → dist/src}/types/enum.js +0 -0
  266. /package/{src → dist/src}/types/types.d.ts +0 -0
  267. /package/{src → dist/src}/types/types.js +0 -0
  268. /package/{src → dist/src}/utils/AttentionMessages.d.ts +0 -0
  269. /package/{src → dist/src}/utils/AttentionMessages.js +0 -0
  270. /package/{src → dist/src}/utils/Constants.d.ts +0 -0
  271. /package/{src → dist/src}/utils/Constants.js +0 -0
  272. /package/{src → dist/src}/utils/RecommendationError.d.ts +0 -0
  273. /package/{src → dist/src}/utils/RecommendationError.js +0 -0
  274. /package/{src → dist/src}/utils/RecommendationUtils.d.ts +0 -0
  275. /package/{src → dist/src}/utils/RecommendationUtils.js +0 -0
  276. /package/{src → dist/src}/utils/Translations.d.ts +0 -0
  277. /package/{src → dist/src}/utils/Translations.js +0 -0
  278. /package/{src → dist/src}/utils/Utils.d.ts +0 -0
  279. /package/{src → dist/src}/utils/Utils.js +0 -0
  280. /package/{src → dist/src}/utils/Validations.d.ts +0 -0
  281. /package/{src → dist/src}/utils/Validations.js +0 -0
package/dist/App.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ import { BolusCalculator, UserSettings } from "@hedia/types";
2
+ import React from "react";
3
+ import { IActivityDisplayProps } from "./src/types/types";
4
+ import { RecommendationError } from "./src/utils/RecommendationError";
5
+ interface IState {
6
+ params: BolusCalculator.Types.IRecommendationParams & IActivityDisplayProps;
7
+ carbs: number | null;
8
+ injectionMethod: UserSettings.Enums.InjectionMethod;
9
+ activityDisplayProps: IActivityDisplayProps;
10
+ }
11
+ export default class App extends React.Component<{}, IState> {
12
+ constructor(props: {});
13
+ exitCallback: () => void;
14
+ closeCalculationCallback: () => void;
15
+ removeCarbs: () => void;
16
+ changeCarbs: (carbs: number) => void;
17
+ onYes: () => void;
18
+ updatedRecommendedInsulin: (val: number) => void;
19
+ transferToLogbook: (...params: any) => void;
20
+ updateRemeasureTime: (remeasureTime: number) => void;
21
+ recommendationAnswer: (carbRecommendationAnswer: boolean) => void;
22
+ showBolusBar: (showBolusBar: boolean) => void;
23
+ restartCalculation: () => void;
24
+ handleError: (error: RecommendationError) => never;
25
+ render(): JSX.Element;
26
+ }
27
+ export {};
package/dist/App.js ADDED
@@ -0,0 +1,87 @@
1
+ import { Activity, BloodGlucoseUnit, Languages, UserSettings } from "@hedia/types";
2
+ import React from "react";
3
+ import RecommendationScreen from "./src/RecommendationScreen";
4
+ const ActivityEnum = Activity.Enums.ActivityEnum;
5
+ const { Cycling } = ActivityEnum;
6
+ const { Pump } = UserSettings.Enums.InjectionMethod;
7
+ export default class App extends React.Component {
8
+ constructor(props) {
9
+ super(props);
10
+ this.exitCallback = () => {
11
+ console.log(`exitcallback...`);
12
+ };
13
+ this.closeCalculationCallback = () => {
14
+ console.log(`closeCalculationCallback...`);
15
+ };
16
+ this.removeCarbs = () => {
17
+ this.setState({
18
+ carbs: null,
19
+ });
20
+ };
21
+ this.changeCarbs = (carbs) => {
22
+ this.setState({
23
+ carbs,
24
+ });
25
+ };
26
+ this.onYes = () => {
27
+ console.log(`Navigate to recent bolus screen`);
28
+ };
29
+ this.updatedRecommendedInsulin = (val) => {
30
+ console.log(`Updated recommended insulin: `, val);
31
+ };
32
+ this.transferToLogbook = (...params) => {
33
+ console.log(`Transfered:`, params);
34
+ };
35
+ this.updateRemeasureTime = (remeasureTime) => {
36
+ console.log(`updateRemeasureTime:`, remeasureTime);
37
+ };
38
+ this.recommendationAnswer = (carbRecommendationAnswer) => {
39
+ console.log("carbRecommendationAnswer", carbRecommendationAnswer);
40
+ };
41
+ this.showBolusBar = (showBolusBar) => {
42
+ console.log("showBolusBar", showBolusBar);
43
+ };
44
+ this.restartCalculation = () => {
45
+ console.log("restart calculation");
46
+ };
47
+ this.handleError = (error) => {
48
+ console.log(JSON.stringify(error));
49
+ switch (error.type) {
50
+ default:
51
+ throw error;
52
+ }
53
+ };
54
+ const params = {
55
+ carbohydrateRatio: 20,
56
+ currentBGL: 4,
57
+ carbohydrates: 1,
58
+ insulinSensitivity: 4,
59
+ targetBGL: 8,
60
+ recentBoluses: [
61
+ {
62
+ insulinDose: 2,
63
+ secondsPassed: 1000,
64
+ },
65
+ {
66
+ insulinDose: 1.7,
67
+ secondsPassed: 10000,
68
+ },
69
+ ],
70
+ activityTitle: `Moderate Activity Test Title`,
71
+ activityType: Cycling,
72
+ activity: null,
73
+ };
74
+ this.state = {
75
+ params,
76
+ carbs: 25,
77
+ injectionMethod: Pump,
78
+ activityDisplayProps: {
79
+ activityType: params.activityType,
80
+ activityTitle: params.activityTitle,
81
+ },
82
+ };
83
+ }
84
+ render() {
85
+ return (<RecommendationScreen latestLogbookFrom6Hours={null} language={Languages.en} injectionMethod={this.state.injectionMethod} calculatorParams={this.state.params} userReminder={5} bloodGlucoseUnit={BloodGlucoseUnit.MMOL_L} bloodKetoneUnit={null} currentBKL={null} closeCalculationCallback={this.closeCalculationCallback} exitCallback={this.exitCallback} showBolusBar={this.showBolusBar} onRecentInsulinYes={this.onYes} transferToLogbook={this.transferToLogbook} onError={this.handleError} carbRecommendationAnswer={this.recommendationAnswer} restartCalculation={this.restartCalculation} activityDisplayProps={this.state.activityDisplayProps}/>);
86
+ }
87
+ }
@@ -284,8 +284,8 @@ export default class RecommendationScreen extends React.Component<IRecommendatio
284
284
  *
285
285
  * Steps:
286
286
  * 1. Set the isRecommendationDisplayed state variable to be true.
287
- * 2. As a callback to the setState() method, define a new anonymous function that calls the scrollToEnd() method
288
- * of the scrollView member, with the animated argument set to true.
287
+ * 2. As a callback to the setState() method, define a new anonymous function that calls setTimeout() with a duration of 0 milliseconds.
288
+ * When the time expires, call the scrollToEnd() method of the scrollView member, with the animated argument set to true.
289
289
  * This ensures that the scroll event happens after all other events that get queued to happen at the same time,
290
290
  * so all relevant elements are visible on the screen and the scroll happens reliably.
291
291
  */
@@ -191,13 +191,17 @@ export default class RecommendationScreen extends React.Component {
191
191
  *
192
192
  * Steps:
193
193
  * 1. Set the isRecommendationDisplayed state variable to be true.
194
- * 2. As a callback to the setState() method, define a new anonymous function that calls the scrollToEnd() method
195
- * of the scrollView member, with the animated argument set to true.
194
+ * 2. As a callback to the setState() method, define a new anonymous function that calls setTimeout() with a duration of 0 milliseconds.
195
+ * When the time expires, call the scrollToEnd() method of the scrollView member, with the animated argument set to true.
196
196
  * This ensures that the scroll event happens after all other events that get queued to happen at the same time,
197
197
  * so all relevant elements are visible on the screen and the scroll happens reliably.
198
198
  */
199
199
  this.handleNoRecentInsulin = () => {
200
- this.setState({ isRecommendationDisplayed: true }, () => this.scrollView?.scrollToEnd({ animated: true }));
200
+ this.setState({ isRecommendationDisplayed: true }, () => {
201
+ setTimeout(() => {
202
+ this.scrollView?.scrollToEnd({ animated: true });
203
+ }, 0);
204
+ });
201
205
  };
202
206
  /**
203
207
  * Handle what happens when the user changes the content of the additional carbohydrates input field.
@@ -307,7 +311,7 @@ export default class RecommendationScreen extends React.Component {
307
311
  * - Set the recommendationDate argument to the recommendationDate member variable.
308
312
  */
309
313
  this.handleTransfer = () => {
310
- const { enteredCarbs, enteredInsulin, insulinRecommendation, remeasureTime, showExitModal, selectedMood, } = this.state;
314
+ const { enteredCarbs, enteredInsulin, insulinRecommendation, remeasureTime, showExitModal, selectedMood } = this.state;
311
315
  const carbs = { suggested: this.suggestedCarbs, entered: enteredCarbs };
312
316
  const insulin = { suggested: insulinRecommendation, entered: enteredInsulin };
313
317
  showExitModal ? this.hideExitModal() : this.hideTimeoutModal();
@@ -364,7 +368,7 @@ export default class RecommendationScreen extends React.Component {
364
368
  this.recommendationDate = new Date(global.Date.now());
365
369
  changeLanguage(props.language);
366
370
  const { recentBoluses } = props.calculatorParams;
367
- const { bolus, carbRecommendation, activityReduction, wasLimited, activeInsulin, } = Calculator.calculateRecommendation(props.calculatorParams);
371
+ const { bolus, carbRecommendation, activityReduction, wasLimited, activeInsulin } = Calculator.calculateRecommendation(props.calculatorParams);
368
372
  this.suggestedCarbs = carbRecommendation;
369
373
  this.state = {
370
374
  remeasureTime: this.getBGLevelRemeasurementReminder(),
package/package.json CHANGED
@@ -1,20 +1,29 @@
1
1
  {
2
2
  "name": "@hedia/recommendation-screen",
3
- "version": "2.1.34-alpha.1",
3
+ "version": "2.1.34-alpha.10",
4
4
  "description": "Hedia Recommendation Screen for Bolus and Carbohydrates",
5
5
  "main": "index.js",
6
+ "files": [
7
+ "dist/"
8
+ ],
6
9
  "scripts": {
10
+ "test": "jest",
11
+ "test-coverage": "jest --coverage",
12
+ "tsc": "tsc --noEmit",
13
+ "build": "tsc --build",
14
+ "clean": "tsc --build --clean && rm -rf dist/",
15
+ "build-guards": "ts-auto-guard src/**/[!index]*.ts",
16
+ "lint": "tslint --project .",
17
+ "lint-fix": "tslint --fix --project .",
18
+ "prettier": "prettier --check \"**/*.{ts,tsx}\"",
19
+ "prettier-fix": "prettier --write \"**/*.{ts,tsx}\"",
20
+ "pkg-json-lint": "npmPkgJsonLint .",
21
+ "package-audit": "npm-audit --critical",
22
+ "prepublishOnly": "npm ci --ignore-scripts && npm run build",
23
+ "postpublish": "npm run clean",
7
24
  "a": "index-git.sh && cd android && gradlew clean && cd .. && react-native run-android",
8
25
  "start": "react-native start",
9
26
  "la": "./index-git.sh && cd ./android && ./gradlew clean && cd .. && gnome-terminal -- /bin/bash -c \"wmctrl -c 'Terminal';react-native start $SHELL\" && react-native run-android",
10
- "lint": "tslint --project .",
11
- "lint-fix": "tslint --fix --project .",
12
- "lint-pkg": "npmPkgJsonLint .",
13
- "prettier": "prettier --check \"src/**/*.{ts,tsx}\"",
14
- "test": "npm run tsc-clean && jest",
15
- "test-coverage": "npm run tsc-clean && jest --coverage",
16
- "tsc": "tsc",
17
- "tsc-clean": "tsc --build --clean",
18
27
  "add-locale": "lingui add-locale",
19
28
  "extract": "lingui extract",
20
29
  "extract-clean": "lingui extract --clean",
@@ -39,6 +48,7 @@
39
48
  "@babel/preset-react": "7.10.1",
40
49
  "@babel/preset-typescript": "7.10.1",
41
50
  "@babel/runtime": "7.12.5",
51
+ "@hedia/npm-audit-pipeline": "0.5.0",
42
52
  "@hedia/recommendation-calculator": "2.0.11",
43
53
  "@react-native-community/slider": "3.0.0",
44
54
  "@testing-library/jest-native": "3.1.0",
@@ -55,15 +65,15 @@
55
65
  "babel-plugin-macros": "2.8.0",
56
66
  "jest": "26.6.3",
57
67
  "metro-react-native-babel-preset": "0.66.2",
58
- "npm-package-json-lint": "5.1.0",
59
- "prettier": "2.2.1",
68
+ "npm-package-json-lint": "5.4.1",
69
+ "prettier": "2.5.1",
60
70
  "react": "17.0.2",
61
71
  "react-native": "0.66.3",
62
72
  "react-native-linear-gradient": "2.5.6",
63
73
  "react-native-testing-library": "2.1.0",
64
74
  "react-native-vector-icons": "6.6.0",
65
75
  "react-test-renderer": "17.0.2",
66
- "tslint": "6.1.2",
76
+ "tslint": "6.1.3",
67
77
  "tslint-config-prettier": "1.18.0",
68
78
  "typedoc": "0.21.4",
69
79
  "typedoc-plugin-no-inherit": "1.3.0",
@@ -80,9 +90,9 @@
80
90
  },
81
91
  "peerDependencies": {
82
92
  "@hedia/recommendation-calculator": "*",
93
+ "@lingui/macro": "2.9.1",
83
94
  "@react-native-community/slider": "*",
84
95
  "react-native-linear-gradient": "*",
85
- "react-native-vector-icons": "*",
86
- "@lingui/macro": "2.9.1"
96
+ "react-native-vector-icons": "*"
87
97
  }
88
98
  }
package/.flowconfig DELETED
@@ -1,65 +0,0 @@
1
- [ignore]
2
- ; We fork some components by platform
3
- .*/*[.]android.js
4
-
5
- ; Ignore "BUCK" generated dirs
6
- <PROJECT_ROOT>/\.buckd/
7
-
8
- ; Ignore polyfills
9
- node_modules/react-native/Libraries/polyfills/.*
10
-
11
- ; Flow doesn't support platforms
12
- .*/Libraries/Utilities/LoadingView.js
13
-
14
- [untyped]
15
- .*/node_modules/@react-native-community/cli/.*/.*
16
-
17
- [include]
18
-
19
- [libs]
20
- node_modules/react-native/interface.js
21
- node_modules/react-native/flow/
22
-
23
- [options]
24
- emoji=true
25
-
26
- exact_by_default=true
27
-
28
- format.bracket_spacing=false
29
-
30
- module.file_ext=.js
31
- module.file_ext=.json
32
- module.file_ext=.ios.js
33
-
34
- munge_underscores=true
35
-
36
- module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
37
- module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
38
-
39
- suppress_type=$FlowIssue
40
- suppress_type=$FlowFixMe
41
- suppress_type=$FlowFixMeProps
42
- suppress_type=$FlowFixMeState
43
-
44
- [lints]
45
- sketchy-null-number=warn
46
- sketchy-null-mixed=warn
47
- sketchy-number=warn
48
- untyped-type-import=warn
49
- nonstrict-import=warn
50
- deprecated-type=warn
51
- unsafe-getters-setters=warn
52
- unnecessary-invariant=warn
53
- signature-verification-failure=warn
54
-
55
- [strict]
56
- deprecated-type
57
- nonstrict-import
58
- sketchy-null
59
- unclear-type
60
- unsafe-getters-setters
61
- untyped-import
62
- untyped-type-import
63
-
64
- [version]
65
- ^0.158.0
@@ -1,6 +0,0 @@
1
- <!--
2
- ⚠️⚠️ If pointing to master ⚠️⚠️
3
- -----------------------------
4
- - Remember to include HDA on the PR title
5
- - Remember to set the Label
6
- --!>
@@ -1,35 +0,0 @@
1
- name: On post-merge - Publish package
2
-
3
- on:
4
- pull_request:
5
- branches:
6
- - master
7
- types: [closed]
8
-
9
- env:
10
- NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
11
-
12
- jobs:
13
- on-post-merge-publish-package:
14
- if: github.event.pull_request.merged == true
15
-
16
- runs-on: ubuntu-latest
17
-
18
- strategy:
19
- matrix:
20
- node-version: [14.15]
21
-
22
- steps:
23
- - uses: actions/checkout@v2
24
- - uses: actions/setup-node@v2
25
- with:
26
- node-version: ${{ matrix.node-version }}
27
-
28
- - name: Publish
29
- uses: hedia-team/autobump-and-publish@master
30
- with:
31
- npm-token: ${{ env.NPM_TOKEN }}
32
- issue-number: ${{ github.event.number }}
33
- github-token: ${{ secrets.GITHUB_TOKEN }}
34
- is-post-merge: true
35
- run-script: npm ci && npm run tsc
@@ -1,20 +0,0 @@
1
- name: Validate PR title
2
-
3
- on:
4
- pull_request:
5
- branches:
6
- - master
7
- types: [opened, reopened, edited]
8
-
9
- permissions:
10
- pull-requests: read
11
-
12
- jobs:
13
- validate-pr-title:
14
- runs-on: ubuntu-latest
15
-
16
- steps:
17
- - name: Validate PR title
18
- uses: deepakputhraya/action-pr-title@master
19
- with:
20
- regex: "^(((\\[\\d+\\.\\d+\\.\\d+\\])|(\\[Anytime\\]))\\s-\\s)?HDA-\\d+.*"
@@ -1,49 +0,0 @@
1
- name: Version Bump & Publish Alpha
2
-
3
- on:
4
- pull_request:
5
- branches:
6
- - master
7
- types: [opened, reopened, synchronize]
8
-
9
- env:
10
- NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
11
-
12
- jobs:
13
- validate-pr-labels:
14
- runs-on: ubuntu-latest
15
-
16
- steps:
17
- - name: Validate PR labels
18
- uses: docker://agilepathway/pull-request-label-checker:v1.0.102
19
- with:
20
- one_of: major,minor,patch
21
- repo_token: ${{ secrets.GITHUB_TOKEN }}
22
-
23
- version-bump-publish-alpha:
24
- needs: [validate-pr-labels]
25
- runs-on: ubuntu-latest
26
-
27
- strategy:
28
- matrix:
29
- node-version: [14.15]
30
-
31
- steps:
32
- - uses: actions/checkout@v2
33
- with:
34
- ref: ${{ github.event.pull_request.head.ref }}
35
- token: ${{ secrets.HEDIA_BOT_GITHUB_PAT }}
36
-
37
- - uses: mstachniuk/ci-skip@v1
38
- with:
39
- commit-filter: "autobump"
40
-
41
- - name: Autobump & Publish
42
- if: ${{ env.CI_SKIP == 'false' }}
43
- uses: hedia-team/autobump-and-publish@master
44
- with:
45
- github-token: ${{ secrets.GITHUB_TOKEN }}
46
- label: ${{ toJson(github.event.pull_request.labels.*.name) }}
47
- npm-token: ${{ env.NPM_TOKEN }}
48
- issue-number: ${{ github.event.number }}
49
- run-script: npm ci && npm run lint-pkg && npm run lint && npm run prettier && npm run test-coverage && npm run tsc
package/.linguirc DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "localeDir": "src/locale/",
3
- "srcPathDirs": ["src/"],
4
- "format": "po",
5
- "sourceLocale": "en"
6
- }
@@ -1,12 +0,0 @@
1
- {
2
- "rules": {
3
- "no-caret-version-dependencies": "error",
4
- "no-caret-version-devDependencies": "error",
5
- "no-duplicate-properties": "error",
6
- "no-repeated-dependencies": "error",
7
- "no-tilde-version-dependencies": "error",
8
- "no-tilde-version-devDependencies": "error",
9
- "prefer-alphabetical-dependencies": "error",
10
- "prefer-alphabetical-devDependencies": "error"
11
- }
12
- }
package/.prettierignore DELETED
@@ -1,2 +0,0 @@
1
- **/*.js
2
- **/*.d.ts
package/.prettierrc DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "arrowParens": "always",
3
- "bracketSpacing": true,
4
- "cursorOffset": 2,
5
- "endOfLine": "lf",
6
- "filepath": "none",
7
- "htmlWhitespaceSensitivity": "ignore",
8
- "insertPragma": false,
9
- "jsxBracketSameLine": false,
10
- "jsxSingleQuote": false,
11
- "overrides": [],
12
- "parser": "typescript",
13
- "plugins": [],
14
- "pluginSearchDirs": [],
15
- "printWidth": 120,
16
- "proseWrap": "preserve",
17
- "quoteProps": "preserve",
18
- "requirePragma": false,
19
- "semi": true,
20
- "singleQuote": false,
21
- "tabWidth": 4,
22
- "trailingComma": "all",
23
- "useTabs": true,
24
- "vueIndentScriptAndStyle": false
25
- }
package/Changelog.md DELETED
@@ -1,9 +0,0 @@
1
- # Changelog
2
-
3
- ### V1.0.1
4
-
5
- - Fixed Lingui by removing @lingui/macro
6
-
7
- ### V1.0.0
8
-
9
- - Initial release
package/android/app/BUCK DELETED
@@ -1,55 +0,0 @@
1
- # To learn about Buck see [Docs](https://buckbuild.com/).
2
- # To run your application with Buck:
3
- # - install Buck
4
- # - `npm start` - to start the packager
5
- # - `cd android`
6
- # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7
- # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8
- # - `buck install -r android/app` - compile, install and run application
9
- #
10
-
11
- load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12
-
13
- lib_deps = []
14
-
15
- create_aar_targets(glob(["libs/*.aar"]))
16
-
17
- create_jar_targets(glob(["libs/*.jar"]))
18
-
19
- android_library(
20
- name = "all-libs",
21
- exported_deps = lib_deps,
22
- )
23
-
24
- android_library(
25
- name = "app-code",
26
- srcs = glob([
27
- "src/main/java/**/*.java",
28
- ]),
29
- deps = [
30
- ":all-libs",
31
- ":build_config",
32
- ":res",
33
- ],
34
- )
35
-
36
- android_build_config(
37
- name = "build_config",
38
- package = "com.hediarecommendationscreen",
39
- )
40
-
41
- android_resource(
42
- name = "res",
43
- package = "com.hediarecommendationscreen",
44
- res = "src/main/res",
45
- )
46
-
47
- android_binary(
48
- name = "app",
49
- keystore = "//android/keystores:debug",
50
- manifest = "src/main/AndroidManifest.xml",
51
- package_type = "debug",
52
- deps = [
53
- ":app-code",
54
- ],
55
- )