@hedia/recommendation-screen 1.8.2 → 2.0.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/.github/workflows/ci.yml +0 -0
- package/.github/workflows/publish.yml +48 -0
- package/.github/workflows/version-check.yml +45 -0
- package/.linguirc +0 -0
- package/.npmpackagejsonlintrc.json +0 -0
- package/.prettierignore +0 -0
- package/.prettierrc +0 -0
- package/App.d.ts +4 -5
- package/App.jsx +29 -23
- package/App.tsx +42 -30
- package/Changelog.md +0 -0
- package/README.md +0 -0
- package/android/app/BUCK +0 -0
- package/android/app/build.gradle +0 -0
- package/android/app/build_defs.bzl +0 -0
- package/android/app/debug.keystore +0 -0
- package/android/app/proguard-rules.pro +0 -0
- package/android/app/src/debug/AndroidManifest.xml +0 -0
- package/android/app/src/debug/java/com/hediarecommendationscreen/ReactNativeFlipper.java +0 -0
- package/android/app/src/main/AndroidManifest.xml +0 -0
- package/android/app/src/main/assets/fonts/AntDesign.ttf +0 -0
- package/android/app/src/main/assets/fonts/Entypo.ttf +0 -0
- package/android/app/src/main/assets/fonts/EvilIcons.ttf +0 -0
- package/android/app/src/main/assets/fonts/Feather.ttf +0 -0
- package/android/app/src/main/assets/fonts/FontAwesome.ttf +0 -0
- package/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf +0 -0
- package/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf +0 -0
- package/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf +0 -0
- package/android/app/src/main/assets/fonts/Foundation.ttf +0 -0
- package/android/app/src/main/assets/fonts/Ionicons.ttf +0 -0
- package/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf +0 -0
- package/android/app/src/main/assets/fonts/MaterialIcons.ttf +0 -0
- package/android/app/src/main/assets/fonts/Octicons.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-Black.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-BlackItalic.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-Bold.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-BoldItalic.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-Italic.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-Light.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-LightItalic.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-Medium.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-MediumItalic.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-Regular.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-Thin.ttf +0 -0
- package/android/app/src/main/assets/fonts/Roboto-ThinItalic.ttf +0 -0
- package/android/app/src/main/assets/fonts/SimpleLineIcons.ttf +0 -0
- package/android/app/src/main/assets/fonts/Zocial.ttf +0 -0
- package/android/app/src/main/java/com/hediarecommendationscreen/MainActivity.java +0 -0
- package/android/app/src/main/java/com/hediarecommendationscreen/MainApplication.java +0 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/values/color.xml +0 -0
- package/android/app/src/main/res/values/strings.xml +0 -0
- package/android/app/src/main/res/values/styles.xml +0 -0
- package/android/build.gradle +0 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -0
- package/android/gradle.properties +0 -0
- package/android/gradlew.bat +0 -0
- package/android/settings.gradle +0 -0
- package/app.json +0 -0
- package/assets/fonts/Roboto/LICENSE.txt +0 -0
- package/assets/fonts/Roboto/Roboto-Black.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-Bold.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-Light.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-Thin.ttf +0 -0
- package/assets/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- package/babel.config.js +0 -0
- package/ignore-git.sh +1 -1
- package/ignore-publish.sh +2 -1
- package/index.d.ts +2 -2
- package/index.js +2 -3
- package/index.ts +2 -2
- package/ios/HediaRecommendationScreen/AppDelegate.h +0 -0
- package/ios/HediaRecommendationScreen/AppDelegate.m +0 -0
- package/ios/HediaRecommendationScreen/Base.lproj/LaunchScreen.xib +0 -0
- package/ios/HediaRecommendationScreen/Images.xcassets/AppIcon.appiconset/Contents.json +0 -0
- package/ios/HediaRecommendationScreen/Images.xcassets/Contents.json +0 -0
- package/ios/HediaRecommendationScreen/Info.plist +0 -0
- package/ios/HediaRecommendationScreen/main.m +0 -0
- package/ios/HediaRecommendationScreen-tvOS/Info.plist +0 -0
- package/ios/HediaRecommendationScreen-tvOSTests/Info.plist +0 -0
- package/ios/HediaRecommendationScreen.xcodeproj/project.pbxproj +0 -0
- package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen-tvOS.xcscheme +0 -0
- package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen.xcscheme +0 -0
- package/ios/HediaRecommendationScreen.xcworkspace/contents.xcworkspacedata +0 -0
- package/ios/HediaRecommendationScreen.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- package/ios/HediaRecommendationScreenTests/HediaRecommendationScreenTests.m +0 -0
- package/ios/HediaRecommendationScreenTests/Info.plist +0 -0
- package/ios/Podfile +0 -0
- package/ios/Podfile.lock +0 -0
- package/jest.config.js +0 -0
- package/jest.mock.js +0 -0
- package/metro.config.js +0 -0
- package/package.json +8 -10
- package/react-native.config.js +0 -0
- package/src/RecommendationScreen.d.ts +18 -20
- package/src/RecommendationScreen.jsx +26 -15
- package/src/RecommendationScreen.tsx +60 -37
- package/src/__tests__/RecommendationScreen.test.d.ts +0 -0
- package/src/__tests__/RecommendationScreen.test.jsx +163 -138
- package/src/__tests__/RecommendationScreen.test.tsx +256 -159
- package/src/__tests__/RecommendationUtils.test.d.ts +0 -0
- package/src/__tests__/RecommendationUtils.test.js +33 -19
- package/src/__tests__/RecommendationUtils.test.ts +41 -22
- package/src/__tests__/Translate.test.d.ts +0 -0
- package/src/__tests__/Translate.test.jsx +13 -12
- package/src/__tests__/Translate.test.tsx +15 -14
- package/src/__tests__/Utils.test.d.ts +0 -0
- package/src/__tests__/Utils.test.js +21 -19
- package/src/__tests__/Utils.test.ts +31 -20
- package/src/__tests__/Validations.test.d.ts +0 -0
- package/src/__tests__/Validations.test.js +40 -26
- package/src/__tests__/Validations.test.ts +54 -35
- package/src/__tests__/components/Activity.test.d.ts +0 -0
- package/src/__tests__/components/Activity.test.jsx +39 -18
- package/src/__tests__/components/Activity.test.tsx +99 -45
- package/src/__tests__/components/Emotion.test.d.ts +0 -0
- package/src/__tests__/components/Emotion.test.jsx +34 -25
- package/src/__tests__/components/Emotion.test.tsx +41 -24
- package/src/__tests__/components/Header.test.d.ts +0 -0
- package/src/__tests__/components/Header.test.jsx +10 -9
- package/src/__tests__/components/Header.test.tsx +12 -11
- package/src/__tests__/components/InfoBars.test.d.ts +0 -0
- package/src/__tests__/components/InfoBars.test.jsx +1 -0
- package/src/__tests__/components/InfoBars.test.tsx +7 -6
- package/src/__tests__/components/InvisibleNumberInput.test.d.ts +0 -0
- package/src/__tests__/components/InvisibleNumberInput.test.jsx +40 -24
- package/src/__tests__/components/InvisibleNumberInput.test.tsx +41 -17
- package/src/__tests__/components/LimitationMessage.test.d.ts +0 -0
- package/src/__tests__/components/LimitationMessage.test.jsx +11 -30
- package/src/__tests__/components/LimitationMessage.test.tsx +15 -13
- package/src/__tests__/components/MoodIcon.test.d.ts +0 -0
- package/src/__tests__/components/MoodIcon.test.jsx +12 -8
- package/src/__tests__/components/MoodIcon.test.tsx +13 -5
- package/src/__tests__/components/RecommendationModal.test.d.ts +0 -0
- package/src/__tests__/components/RecommendationModal.test.jsx +22 -21
- package/src/__tests__/components/RecommendationModal.test.tsx +29 -27
- package/src/__tests__/components/RecommendedCarbs.test.d.ts +0 -0
- package/src/__tests__/components/RecommendedCarbs.test.jsx +7 -10
- package/src/__tests__/components/RecommendedCarbs.test.tsx +9 -10
- package/src/__tests__/components/RecommendedInsulin.test.d.ts +0 -0
- package/src/__tests__/components/RecommendedInsulin.test.jsx +57 -41
- package/src/__tests__/components/RecommendedInsulin.test.tsx +57 -31
- package/src/__tests__/components/Remeasure.test.d.ts +0 -0
- package/src/__tests__/components/Remeasure.test.jsx +7 -3
- package/src/__tests__/components/Remeasure.test.tsx +11 -3
- package/src/__tests__/components/TransferToLogbook.test.d.ts +0 -0
- package/src/__tests__/components/TransferToLogbook.test.jsx +2 -2
- package/src/__tests__/components/TransferToLogbook.test.tsx +2 -2
- package/src/__tests__/components/TwoOptionModal.test.d.ts +0 -0
- package/src/__tests__/components/TwoOptionModal.test.jsx +5 -4
- package/src/__tests__/components/TwoOptionModal.test.tsx +6 -4
- package/src/__tests__/utils.d.ts +5 -2
- package/src/__tests__/utils.jsx +23 -8
- package/src/__tests__/utils.tsx +28 -9
- package/src/assets/activity/Cyclist.png +0 -0
- package/src/assets/activity/Other.png +0 -0
- package/src/assets/activity/Runner.png +0 -0
- package/src/assets/activity/Swimmer.png +0 -0
- package/src/assets/activity/Walk.png +0 -0
- package/src/assets/mood/happy.png +0 -0
- package/src/assets/mood/happy_active.png +0 -0
- package/src/assets/mood/neutral.png +0 -0
- package/src/assets/mood/neutral_active.png +0 -0
- package/src/assets/mood/sad.png +0 -0
- package/src/assets/mood/sad_active.png +0 -0
- package/src/assets/mood/semi_happy.png +0 -0
- package/src/assets/mood/semi_happy_active.png +0 -0
- package/src/assets/mood/semi_sad.png +0 -0
- package/src/assets/mood/semi_sad_active.png +0 -0
- package/src/components/Header.d.ts +0 -0
- package/src/components/Header.jsx +2 -1
- package/src/components/Header.tsx +2 -1
- package/src/components/Icon.js +0 -0
- package/src/components/InfoBars.d.ts +1 -1
- package/src/components/InfoBars.jsx +0 -0
- package/src/components/InfoBars.tsx +1 -1
- package/src/components/InvisibleNumberInput.d.ts +2 -1
- package/src/components/InvisibleNumberInput.jsx +7 -2
- package/src/components/InvisibleNumberInput.tsx +10 -3
- package/src/components/LimitationMessage.d.ts +1 -1
- package/src/components/LimitationMessage.jsx +3 -2
- package/src/components/LimitationMessage.tsx +3 -1
- package/src/components/LineSeparator.d.ts +0 -0
- package/src/components/LineSeparator.jsx +0 -0
- package/src/components/LineSeparator.tsx +0 -0
- package/src/components/RecentInsulin.d.ts +0 -0
- package/src/components/RecentInsulin.jsx +3 -2
- package/src/components/RecentInsulin.tsx +3 -0
- package/src/components/RecommendationModal.d.ts +4 -4
- package/src/components/RecommendationModal.jsx +10 -9
- package/src/components/RecommendationModal.tsx +19 -8
- package/src/components/RecommendedCarbs.d.ts +4 -3
- package/src/components/RecommendedCarbs.jsx +12 -9
- package/src/components/RecommendedCarbs.tsx +31 -16
- package/src/components/RecommendedInsulin.d.ts +7 -7
- package/src/components/RecommendedInsulin.jsx +11 -7
- package/src/components/RecommendedInsulin.tsx +24 -12
- package/src/components/Remeasure.d.ts +2 -2
- package/src/components/Remeasure.jsx +7 -2
- package/src/components/Remeasure.tsx +10 -4
- package/src/components/TransferToLogbook.d.ts +0 -0
- package/src/components/TransferToLogbook.jsx +2 -1
- package/src/components/TransferToLogbook.tsx +2 -0
- package/src/components/TwoOptionModal.d.ts +5 -3
- package/src/components/TwoOptionModal.jsx +44 -13
- package/src/components/TwoOptionModal.tsx +50 -14
- package/src/components/activity/Activity.d.ts +2 -3
- package/src/components/activity/Activity.jsx +5 -2
- package/src/components/activity/Activity.tsx +7 -5
- package/src/components/activity/ActivityIcon.d.ts +1 -1
- package/src/components/activity/ActivityIcon.jsx +9 -8
- package/src/components/activity/ActivityIcon.tsx +12 -10
- package/src/components/activity/ActivityIntensity.d.ts +1 -1
- package/src/components/activity/ActivityIntensity.jsx +2 -8
- package/src/components/activity/ActivityIntensity.tsx +3 -12
- package/src/components/mood/Emotion.d.ts +5 -4
- package/src/components/mood/Emotion.jsx +4 -3
- package/src/components/mood/Emotion.tsx +9 -7
- package/src/components/mood/MoodIcon.d.ts +2 -2
- package/src/components/mood/MoodIcon.jsx +3 -2
- package/src/components/mood/MoodIcon.tsx +4 -2
- package/src/locale/CleanLanguage.ts +0 -0
- package/src/locale/da/messages.js +1 -1
- package/src/locale/da/messages.po +110 -106
- package/src/locale/de/messages.js +1 -1
- package/src/locale/de/messages.po +110 -106
- package/src/locale/en/messages.js +1 -1
- package/src/locale/en/messages.po +113 -109
- package/src/locale/es/messages.js +1 -1
- package/src/locale/es/messages.po +107 -103
- package/src/locale/fr/messages.js +1 -1
- package/src/locale/fr/messages.po +106 -102
- package/src/locale/i18nUtils.d.ts +3 -4
- package/src/locale/i18nUtils.js +13 -12
- package/src/locale/i18nUtils.ts +14 -14
- package/src/locale/it/messages.js +1 -1
- package/src/locale/it/messages.po +108 -104
- package/src/types/enum.d.ts +51 -44
- package/src/types/enum.js +66 -56
- package/src/types/enum.ts +57 -34
- package/src/types/types.d.ts +9 -23
- package/src/types/types.js +0 -0
- package/src/types/types.ts +9 -25
- package/src/utils/AttentionMessages.d.ts +1 -4
- package/src/utils/AttentionMessages.jsx +8 -30
- package/src/utils/AttentionMessages.tsx +11 -16
- package/src/utils/Constants.d.ts +0 -0
- package/src/utils/Constants.js +0 -0
- package/src/utils/Constants.ts +0 -0
- package/src/utils/RecommendationError.d.ts +1 -0
- package/src/utils/RecommendationError.jsx +43 -40
- package/src/utils/RecommendationError.tsx +10 -4
- package/src/utils/RecommendationUtils.d.ts +7 -8
- package/src/utils/RecommendationUtils.js +15 -7
- package/src/utils/RecommendationUtils.ts +24 -14
- package/src/utils/Translations.d.ts +2 -0
- package/src/utils/Translations.js +10 -0
- package/src/utils/Translations.ts +9 -0
- package/src/utils/Utils.d.ts +4 -5
- package/src/utils/Utils.js +5 -4
- package/src/utils/Utils.ts +10 -8
- package/src/utils/Validations.d.ts +9 -9
- package/src/utils/Validations.js +39 -55
- package/src/utils/Validations.ts +54 -71
- package/tsconfig.json +2 -2
- package/tslint.json +0 -0
package/.github/workflows/ci.yml
CHANGED
|
File without changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: NPM Publish Bot
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
SSH_PRIVATE_KEY: ${{ secrets.HEDIA_BOT_PRIVATE_SSH_KEY }}
|
|
11
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
node-version: [14.15] #[8.x, 10.x, 12.x]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v2
|
|
23
|
+
|
|
24
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
25
|
+
uses: actions/setup-node@v1.4.4
|
|
26
|
+
with:
|
|
27
|
+
node-version: ${{ matrix.node-version }}
|
|
28
|
+
|
|
29
|
+
- name: Register ssh keys
|
|
30
|
+
uses: webfactory/ssh-agent@v0.4.1
|
|
31
|
+
with:
|
|
32
|
+
ssh-private-key: ${{ env.SSH_PRIVATE_KEY }}
|
|
33
|
+
|
|
34
|
+
- name: Register NPM access token and in
|
|
35
|
+
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
36
|
+
|
|
37
|
+
- name: Installing dependencies
|
|
38
|
+
run: npm ci
|
|
39
|
+
|
|
40
|
+
- id: publish
|
|
41
|
+
uses: JS-DevTools/npm-publish@v1
|
|
42
|
+
with:
|
|
43
|
+
token: ${{ env.NPM_TOKEN }}
|
|
44
|
+
|
|
45
|
+
- if: steps.publish.outputs.type == 'none'
|
|
46
|
+
run: |
|
|
47
|
+
echo "Failed to publish on npm, version already exists"
|
|
48
|
+
exit 1
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: NPM Version Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
|
|
6
|
+
env:
|
|
7
|
+
SSH_PRIVATE_KEY: ${{ secrets.HEDIA_BOT_PRIVATE_SSH_KEY }}
|
|
8
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
node-version: [14.15] #[8.x, 10.x, 12.x]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v2
|
|
20
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
21
|
+
uses: actions/setup-node@v1.4.4
|
|
22
|
+
with:
|
|
23
|
+
node-version: ${{ matrix.node-version }}
|
|
24
|
+
- name: Register ssh keys
|
|
25
|
+
uses: webfactory/ssh-agent@v0.4.1
|
|
26
|
+
with:
|
|
27
|
+
ssh-private-key: |
|
|
28
|
+
${{ secrets.HEDIA_BOT_PRIVATE_SSH_KEY }}
|
|
29
|
+
- name: Register NPM access token
|
|
30
|
+
run: |
|
|
31
|
+
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
32
|
+
npm ci --ignore-scripts
|
|
33
|
+
env:
|
|
34
|
+
NPM_TOKEN: ${{ env.NPM_TOKEN }}
|
|
35
|
+
- run: npm run prettier
|
|
36
|
+
- id: publish
|
|
37
|
+
uses: JS-DevTools/npm-publish@v1
|
|
38
|
+
with:
|
|
39
|
+
token: ${{ env.NPM_TOKEN }}
|
|
40
|
+
dry-run: true
|
|
41
|
+
|
|
42
|
+
- if: steps.publish.outputs.type == 'none'
|
|
43
|
+
run: |
|
|
44
|
+
echo "Package JSON version is already published, please bump the version!"
|
|
45
|
+
exit 1
|
package/.linguirc
CHANGED
|
File without changes
|
|
File without changes
|
package/.prettierignore
CHANGED
|
File without changes
|
package/.prettierrc
CHANGED
|
File without changes
|
package/App.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserSettings } from "@hedia/types";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { IActivityDisplayProps } from "./src/types/types";
|
|
3
|
+
import { IActivityDisplayProps, IRecommendationParams } from "./src/types/types";
|
|
5
4
|
import { RecommendationError } from "./src/utils/RecommendationError";
|
|
6
5
|
interface IState {
|
|
7
6
|
params: IRecommendationParams & IActivityDisplayProps;
|
|
8
|
-
carbs: number;
|
|
9
|
-
injectionMethod: InjectionMethod;
|
|
7
|
+
carbs: number | null;
|
|
8
|
+
injectionMethod: UserSettings.Enums.InjectionMethod;
|
|
10
9
|
activityDisplayProps: IActivityDisplayProps;
|
|
11
10
|
}
|
|
12
11
|
export default class App extends React.Component<{}, IState> {
|
package/App.jsx
CHANGED
|
@@ -3,11 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const RecommendationCalculator_1 = require("@hedia/recommendation-calculator/src/RecommendationCalculator");
|
|
7
6
|
const types_1 = require("@hedia/types");
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
9
8
|
const RecommendationScreen_1 = __importDefault(require("./src/RecommendationScreen"));
|
|
10
|
-
const
|
|
9
|
+
const ActivityEnum = types_1.Activity.Enums.ActivityEnum;
|
|
10
|
+
const { Cycling } = ActivityEnum;
|
|
11
|
+
const { Pump } = types_1.UserSettings.Enums.InjectionMethod;
|
|
11
12
|
class App extends react_1.default.Component {
|
|
12
13
|
constructor(props) {
|
|
13
14
|
super(props);
|
|
@@ -56,31 +57,29 @@ class App extends react_1.default.Component {
|
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
59
|
const params = {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
insulinSensitivity:
|
|
63
|
-
targetBGL:
|
|
64
|
-
recentBoluses: [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
activityIntensity: RecommendationCalculator_1.ActivityIntensity.Moderate,
|
|
69
|
-
activitySettings: {
|
|
70
|
-
hard: { fromZero: 0.25, fromThirty: 0.55, fromFortysix: 0 },
|
|
71
|
-
light: { fromZero: 0.25, fromThirty: 0.55, fromFortysix: 0.25 },
|
|
72
|
-
post: { fromZero: 1, fromThirty: 0, fromFortysix: 0.25 },
|
|
73
|
-
moderate: { fromZero: 0.25, fromThirty: 0.5, fromFortysix: 0.75 },
|
|
74
|
-
target: 8.5,
|
|
60
|
+
carbohydrateRatio: 10,
|
|
61
|
+
currentBGL: 33,
|
|
62
|
+
carbohydrates: 1,
|
|
63
|
+
insulinSensitivity: 4,
|
|
64
|
+
targetBGL: 6,
|
|
65
|
+
recentBoluses: [
|
|
66
|
+
{
|
|
67
|
+
insulinDose: 2,
|
|
68
|
+
secondsPassed: 1000,
|
|
75
69
|
},
|
|
76
|
-
|
|
70
|
+
{
|
|
71
|
+
insulinDose: 1.7,
|
|
72
|
+
secondsPassed: 10000,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
77
75
|
activityTitle: `Moderate Activity Test Title`,
|
|
78
|
-
activityType:
|
|
76
|
+
activityType: Cycling,
|
|
77
|
+
activity: null,
|
|
79
78
|
};
|
|
80
79
|
this.state = {
|
|
81
80
|
params,
|
|
82
81
|
carbs: 25,
|
|
83
|
-
injectionMethod:
|
|
82
|
+
injectionMethod: Pump,
|
|
84
83
|
activityDisplayProps: {
|
|
85
84
|
activityType: params.activityType,
|
|
86
85
|
activityTitle: params.activityTitle,
|
|
@@ -93,7 +92,7 @@ class App extends react_1.default.Component {
|
|
|
93
92
|
carbohydrates_entered_grams: 25,
|
|
94
93
|
carbohydrates_suggested_grams: 25,
|
|
95
94
|
client_timestamp: `25`,
|
|
96
|
-
client_version: 25
|
|
95
|
+
client_version: `25`,
|
|
97
96
|
entry_timestamp: `25`,
|
|
98
97
|
event_uuid: null,
|
|
99
98
|
insulin_entered_units: 25,
|
|
@@ -102,8 +101,15 @@ class App extends react_1.default.Component {
|
|
|
102
101
|
mood: 2,
|
|
103
102
|
settings_uuid: `25`,
|
|
104
103
|
uuid: `aaa`,
|
|
104
|
+
device_and_os: `iOS 12.1.2`,
|
|
105
|
+
overwritten_by_id: null,
|
|
106
|
+
server_timestamp: null,
|
|
107
|
+
server_version: null,
|
|
108
|
+
utc_timezone_offset: null,
|
|
109
|
+
blood_ketones_millimolar: null,
|
|
110
|
+
carbohydrates_modified_suggested_grams: null,
|
|
105
111
|
};
|
|
106
|
-
return (<RecommendationScreen_1.default latestLogbookFrom6Hours={logbook1} language={
|
|
112
|
+
return (<RecommendationScreen_1.default latestLogbookFrom6Hours={logbook1} language={types_1.Languages.en} injectionMethod={this.state.injectionMethod} calculatorParams={this.state.params} userReminder={5} bloodGlucoseUnit={types_1.BloodGlucoseUnit.MMOL_L} bloodKetoneUnit={types_1.BloodKetonesUnit.MG_DL} currentBKL={0} 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}/>);
|
|
107
113
|
}
|
|
108
114
|
}
|
|
109
115
|
exports.default = App;
|
package/App.tsx
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ActivityIntensity } from "@hedia/recommendation-calculator/src/RecommendationCalculator";
|
|
3
|
-
import { BloodGlucoseUnit, BloodKetonesUnit } from "@hedia/types";
|
|
1
|
+
import { Activity, BloodGlucoseUnit, BloodKetonesUnit, Languages, UserSettings } from "@hedia/types";
|
|
4
2
|
import React from "react";
|
|
5
3
|
import RecommendationScreen from "./src/RecommendationScreen";
|
|
6
|
-
import {
|
|
7
|
-
import { IActivityDisplayProps, logbookEntry } from "./src/types/types";
|
|
4
|
+
import { IActivityDisplayProps, IRecommendationParams, logbookEntry } from "./src/types/types";
|
|
8
5
|
import { RecommendationError } from "./src/utils/RecommendationError";
|
|
9
6
|
|
|
10
7
|
interface IState {
|
|
11
8
|
params: IRecommendationParams & IActivityDisplayProps;
|
|
12
|
-
carbs: number;
|
|
13
|
-
injectionMethod: InjectionMethod;
|
|
9
|
+
carbs: number | null;
|
|
10
|
+
injectionMethod: UserSettings.Enums.InjectionMethod;
|
|
14
11
|
activityDisplayProps: IActivityDisplayProps;
|
|
15
12
|
}
|
|
16
13
|
|
|
14
|
+
const ActivityEnum = Activity.Enums.ActivityEnum;
|
|
15
|
+
|
|
16
|
+
const { Cycling } = ActivityEnum;
|
|
17
|
+
const { Pump } = UserSettings.Enums.InjectionMethod;
|
|
18
|
+
|
|
17
19
|
export default class App extends React.Component<{}, IState> {
|
|
18
20
|
constructor(props) {
|
|
19
21
|
super(props);
|
|
20
22
|
|
|
21
23
|
const params: IState["params"] = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
insulinSensitivity:
|
|
26
|
-
targetBGL:
|
|
27
|
-
recentBoluses: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
activityIntensity: ActivityIntensity.Moderate,
|
|
32
|
-
activitySettings: {
|
|
33
|
-
hard: { fromZero: 0.25, fromThirty: 0.55, fromFortysix: 0 },
|
|
34
|
-
light: { fromZero: 0.25, fromThirty: 0.55, fromFortysix: 0.25 },
|
|
35
|
-
post: { fromZero: 1, fromThirty: 0, fromFortysix: 0.25 },
|
|
36
|
-
moderate: { fromZero: 0.25, fromThirty: 0.5, fromFortysix: 0.75 },
|
|
37
|
-
target: 8.5,
|
|
24
|
+
carbohydrateRatio: 10,
|
|
25
|
+
currentBGL: 33, // in order to recommend insulin
|
|
26
|
+
carbohydrates: 1, // in order not to have entered carbs = 0
|
|
27
|
+
insulinSensitivity: 4,
|
|
28
|
+
targetBGL: 6,
|
|
29
|
+
recentBoluses: [
|
|
30
|
+
{
|
|
31
|
+
insulinDose: 2,
|
|
32
|
+
secondsPassed: 1000,
|
|
38
33
|
},
|
|
39
|
-
|
|
34
|
+
{
|
|
35
|
+
insulinDose: 1.7,
|
|
36
|
+
secondsPassed: 10000,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
40
39
|
activityTitle: `Moderate Activity Test Title`,
|
|
41
|
-
activityType:
|
|
40
|
+
activityType: Cycling,
|
|
41
|
+
activity: null,
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
this.state = {
|
|
45
45
|
params,
|
|
46
46
|
carbs: 25,
|
|
47
|
-
injectionMethod:
|
|
47
|
+
injectionMethod: Pump,
|
|
48
48
|
activityDisplayProps: {
|
|
49
49
|
activityType: params.activityType,
|
|
50
50
|
activityTitle: params.activityTitle,
|
|
@@ -55,6 +55,7 @@ export default class App extends React.Component<{}, IState> {
|
|
|
55
55
|
public exitCallback = () => {
|
|
56
56
|
console.log(`exitcallback...`);
|
|
57
57
|
};
|
|
58
|
+
|
|
58
59
|
public closeCalculationCallback = () => {
|
|
59
60
|
console.log(`closeCalculationCallback...`);
|
|
60
61
|
};
|
|
@@ -82,15 +83,19 @@ export default class App extends React.Component<{}, IState> {
|
|
|
82
83
|
public transferToLogbook = (...params) => {
|
|
83
84
|
console.log(`Transfered:`, params);
|
|
84
85
|
};
|
|
86
|
+
|
|
85
87
|
public updateRemeasureTime = (remeasureTime: number) => {
|
|
86
88
|
console.log(`updateRemeasureTime:`, remeasureTime);
|
|
87
89
|
};
|
|
90
|
+
|
|
88
91
|
public recommendationAnswer = (carbRecommendationAnswer: boolean) => {
|
|
89
92
|
console.log("carbRecommendationAnswer", carbRecommendationAnswer);
|
|
90
93
|
};
|
|
94
|
+
|
|
91
95
|
public showBolusBar = (showBolusBar: boolean) => {
|
|
92
96
|
console.log("showBolusBar", showBolusBar);
|
|
93
97
|
};
|
|
98
|
+
|
|
94
99
|
public restartCalculation = () => {
|
|
95
100
|
console.log("restart calculation");
|
|
96
101
|
};
|
|
@@ -110,7 +115,7 @@ export default class App extends React.Component<{}, IState> {
|
|
|
110
115
|
carbohydrates_entered_grams: 25,
|
|
111
116
|
carbohydrates_suggested_grams: 25,
|
|
112
117
|
client_timestamp: `25`,
|
|
113
|
-
client_version: 25
|
|
118
|
+
client_version: `25`,
|
|
114
119
|
entry_timestamp: `25`,
|
|
115
120
|
event_uuid: null,
|
|
116
121
|
insulin_entered_units: 25,
|
|
@@ -119,17 +124,24 @@ export default class App extends React.Component<{}, IState> {
|
|
|
119
124
|
mood: 2,
|
|
120
125
|
settings_uuid: `25`,
|
|
121
126
|
uuid: `aaa`,
|
|
127
|
+
device_and_os: `iOS 12.1.2`,
|
|
128
|
+
overwritten_by_id: null,
|
|
129
|
+
server_timestamp: null,
|
|
130
|
+
server_version: null,
|
|
131
|
+
utc_timezone_offset: null,
|
|
132
|
+
blood_ketones_millimolar: null,
|
|
133
|
+
carbohydrates_modified_suggested_grams: null,
|
|
122
134
|
};
|
|
123
135
|
return (
|
|
124
136
|
<RecommendationScreen
|
|
125
137
|
latestLogbookFrom6Hours={logbook1}
|
|
126
|
-
language={
|
|
138
|
+
language={Languages.en}
|
|
127
139
|
injectionMethod={this.state.injectionMethod}
|
|
128
140
|
calculatorParams={this.state.params}
|
|
129
141
|
userReminder={5}
|
|
130
|
-
bloodGlucoseUnit={BloodGlucoseUnit.
|
|
142
|
+
bloodGlucoseUnit={BloodGlucoseUnit.MMOL_L}
|
|
131
143
|
bloodKetoneUnit={BloodKetonesUnit.MG_DL}
|
|
132
|
-
currentBKL={
|
|
144
|
+
currentBKL={0}
|
|
133
145
|
closeCalculationCallback={this.closeCalculationCallback}
|
|
134
146
|
exitCallback={this.exitCallback}
|
|
135
147
|
showBolusBar={this.showBolusBar}
|
package/Changelog.md
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/android/app/BUCK
CHANGED
|
File without changes
|
package/android/app/build.gradle
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/android/build.gradle
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/android/gradlew.bat
CHANGED
|
File without changes
|
package/android/settings.gradle
CHANGED
|
File without changes
|
package/app.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/babel.config.js
CHANGED
|
File without changes
|
package/ignore-git.sh
CHANGED
package/ignore-publish.sh
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import RecommendationScreen from "./src/RecommendationScreen";
|
|
2
|
-
import {
|
|
2
|
+
import { RecommendationErrorEnum } from "./src/types/enum";
|
|
3
3
|
import * as Errors from "./src/utils/RecommendationError";
|
|
4
4
|
export default RecommendationScreen;
|
|
5
|
-
export {
|
|
5
|
+
export { Errors, RecommendationErrorEnum };
|
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
15
|
if (mod && mod.__esModule) return mod;
|
|
16
16
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
@@ -22,10 +22,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.RecommendationErrorEnum = exports.Errors =
|
|
25
|
+
exports.RecommendationErrorEnum = exports.Errors = void 0;
|
|
26
26
|
const RecommendationScreen_1 = __importDefault(require("./src/RecommendationScreen"));
|
|
27
27
|
const enum_1 = require("./src/types/enum");
|
|
28
|
-
Object.defineProperty(exports, "ActivityEnum", { enumerable: true, get: function () { return enum_1.ActivityEnum; } });
|
|
29
28
|
Object.defineProperty(exports, "RecommendationErrorEnum", { enumerable: true, get: function () { return enum_1.RecommendationErrorEnum; } });
|
|
30
29
|
const Errors = __importStar(require("./src/utils/RecommendationError"));
|
|
31
30
|
exports.Errors = Errors;
|
package/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RecommendationScreen from "./src/RecommendationScreen";
|
|
2
|
-
import {
|
|
2
|
+
import { RecommendationErrorEnum } from "./src/types/enum";
|
|
3
3
|
import * as Errors from "./src/utils/RecommendationError";
|
|
4
4
|
|
|
5
5
|
export default RecommendationScreen;
|
|
6
|
-
export {
|
|
6
|
+
export { Errors, RecommendationErrorEnum };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|