@hedia/recommendation-screen 1.8.2 → 2.0.2
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 +23 -34
- package/App.tsx +36 -41
- 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 +30 -39
- package/src/__tests__/RecommendationUtils.test.ts +38 -43
- 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 +22 -20
- package/src/__tests__/Utils.test.ts +32 -21
- package/src/__tests__/Validations.test.d.ts +0 -0
- package/src/__tests__/Validations.test.js +59 -33
- package/src/__tests__/Validations.test.ts +83 -41
- 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 +7 -2
- package/src/__tests__/utils.jsx +59 -15
- package/src/__tests__/utils.tsx +63 -16
- 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 +115 -107
- package/src/locale/de/messages.js +1 -1
- package/src/locale/de/messages.po +115 -107
- package/src/locale/en/messages.js +1 -1
- package/src/locale/en/messages.po +118 -110
- package/src/locale/es/messages.js +1 -1
- package/src/locale/es/messages.po +112 -104
- package/src/locale/fr/messages.js +1 -1
- package/src/locale/fr/messages.po +111 -103
- 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 +113 -105
- package/src/types/enum.d.ts +52 -44
- package/src/types/enum.js +67 -56
- package/src/types/enum.ts +58 -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 +2 -0
- package/src/utils/RecommendationError.jsx +45 -40
- package/src/utils/RecommendationError.tsx +17 -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 +6 -5
- package/src/utils/Utils.ts +10 -8
- package/src/utils/Validations.d.ts +10 -9
- package/src/utils/Validations.js +61 -65
- package/src/utils/Validations.ts +76 -81
- 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,13 @@ 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 utils_1 = require("./src/__tests__/utils");
|
|
10
|
+
const ActivityEnum = types_1.Activity.Enums.ActivityEnum;
|
|
11
|
+
const { Cycling } = ActivityEnum;
|
|
12
|
+
const { Pump } = types_1.UserSettings.Enums.InjectionMethod;
|
|
11
13
|
class App extends react_1.default.Component {
|
|
12
14
|
constructor(props) {
|
|
13
15
|
super(props);
|
|
@@ -56,31 +58,29 @@ class App extends react_1.default.Component {
|
|
|
56
58
|
}
|
|
57
59
|
};
|
|
58
60
|
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,
|
|
61
|
+
carbohydrateRatio: 10,
|
|
62
|
+
currentBGL: 33,
|
|
63
|
+
carbohydrates: 1,
|
|
64
|
+
insulinSensitivity: 4,
|
|
65
|
+
targetBGL: 6,
|
|
66
|
+
recentBoluses: [
|
|
67
|
+
{
|
|
68
|
+
insulinDose: 2,
|
|
69
|
+
secondsPassed: 1000,
|
|
75
70
|
},
|
|
76
|
-
|
|
71
|
+
{
|
|
72
|
+
insulinDose: 1.7,
|
|
73
|
+
secondsPassed: 10000,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
77
76
|
activityTitle: `Moderate Activity Test Title`,
|
|
78
|
-
activityType:
|
|
77
|
+
activityType: Cycling,
|
|
78
|
+
activity: utils_1.generateActivityProps(),
|
|
79
79
|
};
|
|
80
80
|
this.state = {
|
|
81
81
|
params,
|
|
82
82
|
carbs: 25,
|
|
83
|
-
injectionMethod:
|
|
83
|
+
injectionMethod: Pump,
|
|
84
84
|
activityDisplayProps: {
|
|
85
85
|
activityType: params.activityType,
|
|
86
86
|
activityTitle: params.activityTitle,
|
|
@@ -89,21 +89,10 @@ class App extends react_1.default.Component {
|
|
|
89
89
|
}
|
|
90
90
|
render() {
|
|
91
91
|
const logbook1 = {
|
|
92
|
+
...utils_1.generateDefaultLogbook(),
|
|
92
93
|
blood_glucose_millimolar: 16,
|
|
93
|
-
carbohydrates_entered_grams: 25,
|
|
94
|
-
carbohydrates_suggested_grams: 25,
|
|
95
|
-
client_timestamp: `25`,
|
|
96
|
-
client_version: 25,
|
|
97
|
-
entry_timestamp: `25`,
|
|
98
|
-
event_uuid: null,
|
|
99
|
-
insulin_entered_units: 25,
|
|
100
|
-
insulin_suggested_units: 25,
|
|
101
|
-
is_deleted: null,
|
|
102
|
-
mood: 2,
|
|
103
|
-
settings_uuid: `25`,
|
|
104
|
-
uuid: `aaa`,
|
|
105
94
|
};
|
|
106
|
-
return (<RecommendationScreen_1.default latestLogbookFrom6Hours={logbook1} language={
|
|
95
|
+
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
96
|
}
|
|
108
97
|
}
|
|
109
98
|
exports.default = App;
|
package/App.tsx
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
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";
|
|
6
|
+
import { generateActivityProps, generateDefaultLogbook } from "./src/__tests__/utils";
|
|
9
7
|
|
|
10
8
|
interface IState {
|
|
11
9
|
params: IRecommendationParams & IActivityDisplayProps;
|
|
12
|
-
carbs: number;
|
|
13
|
-
injectionMethod: InjectionMethod;
|
|
10
|
+
carbs: number | null;
|
|
11
|
+
injectionMethod: UserSettings.Enums.InjectionMethod;
|
|
14
12
|
activityDisplayProps: IActivityDisplayProps;
|
|
15
13
|
}
|
|
16
14
|
|
|
15
|
+
const ActivityEnum = Activity.Enums.ActivityEnum;
|
|
16
|
+
|
|
17
|
+
const { Cycling } = ActivityEnum;
|
|
18
|
+
const { Pump } = UserSettings.Enums.InjectionMethod;
|
|
19
|
+
|
|
17
20
|
export default class App extends React.Component<{}, IState> {
|
|
18
21
|
constructor(props) {
|
|
19
22
|
super(props);
|
|
20
23
|
|
|
21
24
|
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,
|
|
25
|
+
carbohydrateRatio: 10,
|
|
26
|
+
currentBGL: 33, // in order to recommend insulin
|
|
27
|
+
carbohydrates: 1, // in order not to have entered carbs = 0
|
|
28
|
+
insulinSensitivity: 4,
|
|
29
|
+
targetBGL: 6,
|
|
30
|
+
recentBoluses: [
|
|
31
|
+
{
|
|
32
|
+
insulinDose: 2,
|
|
33
|
+
secondsPassed: 1000,
|
|
38
34
|
},
|
|
39
|
-
|
|
35
|
+
{
|
|
36
|
+
insulinDose: 1.7,
|
|
37
|
+
secondsPassed: 10000,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
40
|
activityTitle: `Moderate Activity Test Title`,
|
|
41
|
-
activityType:
|
|
41
|
+
activityType: Cycling,
|
|
42
|
+
activity: generateActivityProps(),
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
this.state = {
|
|
45
46
|
params,
|
|
46
47
|
carbs: 25,
|
|
47
|
-
injectionMethod:
|
|
48
|
+
injectionMethod: Pump,
|
|
48
49
|
activityDisplayProps: {
|
|
49
50
|
activityType: params.activityType,
|
|
50
51
|
activityTitle: params.activityTitle,
|
|
@@ -55,6 +56,7 @@ export default class App extends React.Component<{}, IState> {
|
|
|
55
56
|
public exitCallback = () => {
|
|
56
57
|
console.log(`exitcallback...`);
|
|
57
58
|
};
|
|
59
|
+
|
|
58
60
|
public closeCalculationCallback = () => {
|
|
59
61
|
console.log(`closeCalculationCallback...`);
|
|
60
62
|
};
|
|
@@ -82,15 +84,19 @@ export default class App extends React.Component<{}, IState> {
|
|
|
82
84
|
public transferToLogbook = (...params) => {
|
|
83
85
|
console.log(`Transfered:`, params);
|
|
84
86
|
};
|
|
87
|
+
|
|
85
88
|
public updateRemeasureTime = (remeasureTime: number) => {
|
|
86
89
|
console.log(`updateRemeasureTime:`, remeasureTime);
|
|
87
90
|
};
|
|
91
|
+
|
|
88
92
|
public recommendationAnswer = (carbRecommendationAnswer: boolean) => {
|
|
89
93
|
console.log("carbRecommendationAnswer", carbRecommendationAnswer);
|
|
90
94
|
};
|
|
95
|
+
|
|
91
96
|
public showBolusBar = (showBolusBar: boolean) => {
|
|
92
97
|
console.log("showBolusBar", showBolusBar);
|
|
93
98
|
};
|
|
99
|
+
|
|
94
100
|
public restartCalculation = () => {
|
|
95
101
|
console.log("restart calculation");
|
|
96
102
|
};
|
|
@@ -106,30 +112,19 @@ export default class App extends React.Component<{}, IState> {
|
|
|
106
112
|
|
|
107
113
|
public render(): JSX.Element {
|
|
108
114
|
const logbook1: logbookEntry = {
|
|
115
|
+
...generateDefaultLogbook(),
|
|
109
116
|
blood_glucose_millimolar: 16,
|
|
110
|
-
carbohydrates_entered_grams: 25,
|
|
111
|
-
carbohydrates_suggested_grams: 25,
|
|
112
|
-
client_timestamp: `25`,
|
|
113
|
-
client_version: 25,
|
|
114
|
-
entry_timestamp: `25`,
|
|
115
|
-
event_uuid: null,
|
|
116
|
-
insulin_entered_units: 25,
|
|
117
|
-
insulin_suggested_units: 25,
|
|
118
|
-
is_deleted: null,
|
|
119
|
-
mood: 2,
|
|
120
|
-
settings_uuid: `25`,
|
|
121
|
-
uuid: `aaa`,
|
|
122
117
|
};
|
|
123
118
|
return (
|
|
124
119
|
<RecommendationScreen
|
|
125
120
|
latestLogbookFrom6Hours={logbook1}
|
|
126
|
-
language={
|
|
121
|
+
language={Languages.en}
|
|
127
122
|
injectionMethod={this.state.injectionMethod}
|
|
128
123
|
calculatorParams={this.state.params}
|
|
129
124
|
userReminder={5}
|
|
130
|
-
bloodGlucoseUnit={BloodGlucoseUnit.
|
|
125
|
+
bloodGlucoseUnit={BloodGlucoseUnit.MMOL_L}
|
|
131
126
|
bloodKetoneUnit={BloodKetonesUnit.MG_DL}
|
|
132
|
-
currentBKL={
|
|
127
|
+
currentBKL={0}
|
|
133
128
|
closeCalculationCallback={this.closeCalculationCallback}
|
|
134
129
|
exitCallback={this.exitCallback}
|
|
135
130
|
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
|
|
File without changes
|