@hedia/recommendation-screen 2.1.34-alpha.9 → 2.1.35-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{src → dist/src}/RecommendationScreen.d.ts +3 -3
- package/{src → dist/src}/RecommendationScreen.js +6 -6
- package/{src → dist/src}/components/Header.js +2 -2
- package/{src → dist/src}/components/InvisibleNumberInput.js +1 -1
- package/{src → dist/src}/components/LimitationMessage.js +1 -1
- package/{src → dist/src}/components/RecommendationModal.js +3 -3
- package/{src → dist/src}/components/RecommendedCarbs.js +2 -2
- package/{src → dist/src}/components/RecommendedInsulin.js +2 -2
- package/{src → dist/src}/components/Remeasure.js +4 -2
- package/{src → dist/src}/components/TransferToLogbook.js +1 -1
- package/{src → dist/src}/components/TwoOptionModal.js +3 -3
- package/{src → dist/src}/components/activity/Activity.js +3 -1
- package/{src → dist/src}/components/activity/ActivityIcon.d.ts +2 -2
- package/{src → dist/src}/components/activity/ActivityIcon.js +4 -4
- package/{src → dist/src}/components/activity/ActivityIntensity.js +3 -1
- package/{src → dist/src}/components/mood/MoodIcon.js +2 -2
- package/{src → dist/src}/locale/da/messages.po +92 -92
- package/{src → dist/src}/locale/de/messages.po +92 -92
- package/{src → dist/src}/locale/en/messages.po +92 -92
- package/{src → dist/src}/locale/es/messages.js +1 -1
- package/{src → dist/src}/locale/es/messages.po +92 -92
- package/{src → dist/src}/locale/fr/messages.po +92 -92
- package/{src → dist/src}/locale/it/messages.po +92 -92
- package/{src → dist/src}/types/enum.d.ts +15 -11
- package/{src → dist/src}/types/enum.js +13 -9
- package/package.json +22 -21
- package/.flowconfig +0 -65
- package/.github/pull_request_template.md +0 -6
- package/.github/workflows/ci.yaml +0 -17
- package/.github/workflows/publish-release-package.yaml +0 -17
- package/.github/workflows/validate-pr-title.yaml +0 -20
- package/.linguirc +0 -6
- package/.npmpackagejsonlintrc.json +0 -12
- package/.prettierignore +0 -2
- package/.prettierrc +0 -25
- package/Changelog.md +0 -9
- package/android/app/BUCK +0 -55
- package/android/app/build.gradle +0 -228
- package/android/app/build_defs.bzl +0 -19
- package/android/app/debug.keystore +0 -0
- package/android/app/proguard-rules.pro +0 -10
- package/android/app/src/debug/AndroidManifest.xml +0 -13
- package/android/app/src/debug/java/com/hediarecommendationscreen/ReactNativeFlipper.java +0 -72
- package/android/app/src/main/AndroidManifest.xml +0 -25
- 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/Fontisto.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 -15
- package/android/app/src/main/java/com/hediarecommendationscreen/MainApplication.java +0 -80
- 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 -3
- package/android/app/src/main/res/values/strings.xml +0 -3
- package/android/app/src/main/res/values/styles.xml +0 -11
- package/android/build.gradle +0 -38
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradle.properties +0 -28
- package/android/gradlew +0 -185
- package/android/gradlew.bat +0 -89
- package/android/settings.gradle +0 -3
- package/assets/fonts/Roboto/LICENSE.txt +0 -202
- 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 -18
- package/ignore-git.sh +0 -46
- package/ignore-publish.sh +0 -33
- package/index-git.sh +0 -5
- package/ios/HediaRecommendationScreen/AppDelegate.h +0 -8
- package/ios/HediaRecommendationScreen/AppDelegate.m +0 -61
- package/ios/HediaRecommendationScreen/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
- package/ios/HediaRecommendationScreen/Images.xcassets/Contents.json +0 -6
- package/ios/HediaRecommendationScreen/Info.plist +0 -90
- package/ios/HediaRecommendationScreen/LaunchScreen.storyboard +0 -47
- package/ios/HediaRecommendationScreen/main.m +0 -9
- package/ios/HediaRecommendationScreen.xcodeproj/project.pbxproj +0 -778
- package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen-tvOS.xcscheme +0 -88
- package/ios/HediaRecommendationScreen.xcodeproj/xcshareddata/xcschemes/HediaRecommendationScreen.xcscheme +0 -88
- package/ios/HediaRecommendationScreen.xcworkspace/contents.xcworkspacedata +0 -10
- package/ios/HediaRecommendationScreen.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/HediaRecommendationScreenTests/HediaRecommendationScreenTests.m +0 -65
- package/ios/HediaRecommendationScreenTests/Info.plist +0 -24
- package/ios/Podfile +0 -32
- package/ios/Podfile.lock +0 -544
- package/jest.config.js +0 -197
- package/jest.mock.js +0 -1
- package/metro.config.js +0 -17
- package/react-native.config.js +0 -7
- package/src/__tests__/RecommendationScreen.test.d.ts +0 -1
- package/src/__tests__/RecommendationScreen.test.js +0 -965
- package/src/__tests__/RecommendationUtils.test.d.ts +0 -1
- package/src/__tests__/RecommendationUtils.test.js +0 -216
- package/src/__tests__/Translate.test.d.ts +0 -1
- package/src/__tests__/Translate.test.js +0 -27
- package/src/__tests__/Utils.test.d.ts +0 -1
- package/src/__tests__/Utils.test.js +0 -66
- package/src/__tests__/Validations.test.d.ts +0 -1
- package/src/__tests__/Validations.test.js +0 -465
- package/src/__tests__/components/Activity.test.d.ts +0 -1
- package/src/__tests__/components/Activity.test.js +0 -86
- package/src/__tests__/components/Emotion.test.d.ts +0 -1
- package/src/__tests__/components/Emotion.test.js +0 -70
- package/src/__tests__/components/Header.test.d.ts +0 -1
- package/src/__tests__/components/Header.test.js +0 -36
- package/src/__tests__/components/InfoBars.test.d.ts +0 -1
- package/src/__tests__/components/InfoBars.test.js +0 -130
- package/src/__tests__/components/InvisibleNumberInput.test.d.ts +0 -1
- package/src/__tests__/components/InvisibleNumberInput.test.js +0 -160
- package/src/__tests__/components/LimitationMessage.test.d.ts +0 -1
- package/src/__tests__/components/LimitationMessage.test.js +0 -47
- package/src/__tests__/components/MoodIcon.test.d.ts +0 -1
- package/src/__tests__/components/MoodIcon.test.js +0 -30
- package/src/__tests__/components/RecommendationModal.test.d.ts +0 -1
- package/src/__tests__/components/RecommendationModal.test.js +0 -98
- package/src/__tests__/components/RecommendedCarbs.test.d.ts +0 -1
- package/src/__tests__/components/RecommendedCarbs.test.js +0 -120
- package/src/__tests__/components/RecommendedInsulin.test.d.ts +0 -1
- package/src/__tests__/components/RecommendedInsulin.test.js +0 -154
- package/src/__tests__/components/Remeasure.test.d.ts +0 -1
- package/src/__tests__/components/Remeasure.test.js +0 -78
- package/src/__tests__/components/TransferToLogbook.test.d.ts +0 -1
- package/src/__tests__/components/TransferToLogbook.test.js +0 -30
- package/src/__tests__/components/TwoOptionModal.test.d.ts +0 -1
- package/src/__tests__/components/TwoOptionModal.test.js +0 -65
- package/src/__tests__/utils.d.ts +0 -16
- package/src/__tests__/utils.js +0 -126
- package/tsconfig.json +0 -72
- package/tslint.json +0 -193
- package/typedoc.json +0 -13
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{src → dist/src}/assets/activity/Cyclist.png +0 -0
- /package/{src → dist/src}/assets/activity/Other.png +0 -0
- /package/{src → dist/src}/assets/activity/Runner.png +0 -0
- /package/{src → dist/src}/assets/activity/Swimmer.png +0 -0
- /package/{src → dist/src}/assets/activity/Walk.png +0 -0
- /package/{src → dist/src}/assets/mood/happy.png +0 -0
- /package/{src → dist/src}/assets/mood/happy_active.png +0 -0
- /package/{src → dist/src}/assets/mood/neutral.png +0 -0
- /package/{src → dist/src}/assets/mood/neutral_active.png +0 -0
- /package/{src → dist/src}/assets/mood/sad.png +0 -0
- /package/{src → dist/src}/assets/mood/sad_active.png +0 -0
- /package/{src → dist/src}/assets/mood/semi_happy.png +0 -0
- /package/{src → dist/src}/assets/mood/semi_happy_active.png +0 -0
- /package/{src → dist/src}/assets/mood/semi_sad.png +0 -0
- /package/{src → dist/src}/assets/mood/semi_sad_active.png +0 -0
- /package/{src → dist/src}/components/Header.d.ts +0 -0
- /package/{src → dist/src}/components/Icon.d.ts +0 -0
- /package/{src → dist/src}/components/Icon.js +0 -0
- /package/{src → dist/src}/components/InfoBars.d.ts +0 -0
- /package/{src → dist/src}/components/InfoBars.js +0 -0
- /package/{src → dist/src}/components/InvisibleNumberInput.d.ts +0 -0
- /package/{src → dist/src}/components/LimitationMessage.d.ts +0 -0
- /package/{src → dist/src}/components/LineSeparator.d.ts +0 -0
- /package/{src → dist/src}/components/LineSeparator.js +0 -0
- /package/{src → dist/src}/components/RecentInsulin.d.ts +0 -0
- /package/{src → dist/src}/components/RecentInsulin.js +0 -0
- /package/{src → dist/src}/components/RecommendationModal.d.ts +0 -0
- /package/{src → dist/src}/components/RecommendedCarbs.d.ts +0 -0
- /package/{src → dist/src}/components/RecommendedInsulin.d.ts +0 -0
- /package/{src → dist/src}/components/Remeasure.d.ts +0 -0
- /package/{src → dist/src}/components/TransferToLogbook.d.ts +0 -0
- /package/{src → dist/src}/components/TwoOptionModal.d.ts +0 -0
- /package/{src → dist/src}/components/activity/Activity.d.ts +0 -0
- /package/{src → dist/src}/components/activity/ActivityIntensity.d.ts +0 -0
- /package/{src → dist/src}/components/mood/Emotion.d.ts +0 -0
- /package/{src → dist/src}/components/mood/Emotion.js +0 -0
- /package/{src → dist/src}/components/mood/MoodIcon.d.ts +0 -0
- /package/{src → dist/src}/locale/da/messages.js +0 -0
- /package/{src → dist/src}/locale/de/messages.js +0 -0
- /package/{src → dist/src}/locale/en/messages.js +0 -0
- /package/{src → dist/src}/locale/fr/messages.js +0 -0
- /package/{src → dist/src}/locale/i18nUtils.d.ts +0 -0
- /package/{src → dist/src}/locale/i18nUtils.js +0 -0
- /package/{src → dist/src}/locale/it/messages.js +0 -0
- /package/{src → dist/src}/types/types.d.ts +0 -0
- /package/{src → dist/src}/types/types.js +0 -0
- /package/{src → dist/src}/utils/AttentionMessages.d.ts +0 -0
- /package/{src → dist/src}/utils/AttentionMessages.js +0 -0
- /package/{src → dist/src}/utils/Constants.d.ts +0 -0
- /package/{src → dist/src}/utils/Constants.js +0 -0
- /package/{src → dist/src}/utils/RecommendationError.d.ts +0 -0
- /package/{src → dist/src}/utils/RecommendationError.js +0 -0
- /package/{src → dist/src}/utils/RecommendationUtils.d.ts +0 -0
- /package/{src → dist/src}/utils/RecommendationUtils.js +0 -0
- /package/{src → dist/src}/utils/Translations.d.ts +0 -0
- /package/{src → dist/src}/utils/Translations.js +0 -0
- /package/{src → dist/src}/utils/Utils.d.ts +0 -0
- /package/{src → dist/src}/utils/Utils.js +0 -0
- /package/{src → dist/src}/utils/Validations.d.ts +0 -0
- /package/{src → dist/src}/utils/Validations.js +0 -0
|
@@ -141,7 +141,7 @@ export default class RecommendationScreen extends React.Component<IRecommendatio
|
|
|
141
141
|
* A reference to the screens scrollview allowing us to programmatically scroll the screen in the handleNoRecentInsulin() method.
|
|
142
142
|
* The member is initiated without a value but will be set as soon as the component is being rendered.
|
|
143
143
|
*/
|
|
144
|
-
private
|
|
144
|
+
private scrollView?;
|
|
145
145
|
/**
|
|
146
146
|
* A reference to the eventSubscription that'll be returned by AppState.addEventListener().
|
|
147
147
|
* It'll allow us to later remove the subscription.
|
|
@@ -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
|
|
288
|
-
*
|
|
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,15 +191,15 @@ 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
|
|
195
|
-
*
|
|
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
200
|
this.setState({ isRecommendationDisplayed: true }, () => {
|
|
201
201
|
setTimeout(() => {
|
|
202
|
-
this.
|
|
202
|
+
this.scrollView?.scrollToEnd({ animated: true });
|
|
203
203
|
}, 0);
|
|
204
204
|
});
|
|
205
205
|
};
|
|
@@ -311,7 +311,7 @@ export default class RecommendationScreen extends React.Component {
|
|
|
311
311
|
* - Set the recommendationDate argument to the recommendationDate member variable.
|
|
312
312
|
*/
|
|
313
313
|
this.handleTransfer = () => {
|
|
314
|
-
const { enteredCarbs, enteredInsulin, insulinRecommendation, remeasureTime, showExitModal, selectedMood
|
|
314
|
+
const { enteredCarbs, enteredInsulin, insulinRecommendation, remeasureTime, showExitModal, selectedMood } = this.state;
|
|
315
315
|
const carbs = { suggested: this.suggestedCarbs, entered: enteredCarbs };
|
|
316
316
|
const insulin = { suggested: insulinRecommendation, entered: enteredInsulin };
|
|
317
317
|
showExitModal ? this.hideExitModal() : this.hideTimeoutModal();
|
|
@@ -368,7 +368,7 @@ export default class RecommendationScreen extends React.Component {
|
|
|
368
368
|
this.recommendationDate = new Date(global.Date.now());
|
|
369
369
|
changeLanguage(props.language);
|
|
370
370
|
const { recentBoluses } = props.calculatorParams;
|
|
371
|
-
const { bolus, carbRecommendation, activityReduction, wasLimited, activeInsulin
|
|
371
|
+
const { bolus, carbRecommendation, activityReduction, wasLimited, activeInsulin } = Calculator.calculateRecommendation(props.calculatorParams);
|
|
372
372
|
this.suggestedCarbs = carbRecommendation;
|
|
373
373
|
this.state = {
|
|
374
374
|
remeasureTime: this.getBGLevelRemeasurementReminder(),
|
|
@@ -439,7 +439,7 @@ export default class RecommendationScreen extends React.Component {
|
|
|
439
439
|
return (<I18nProvider language={this.props.language} i18n={i18n}>
|
|
440
440
|
<ScrollView testID={RecommendationScreenTestIds.RecommendationScrollView} style={containerStyles.container} ref={(view) => {
|
|
441
441
|
if (view !== null) {
|
|
442
|
-
this.
|
|
442
|
+
this.scrollView = view;
|
|
443
443
|
}
|
|
444
444
|
}}>
|
|
445
445
|
<Header exitCallback={this.onExit}/>
|
|
@@ -15,14 +15,14 @@ export default class Header extends React.Component {
|
|
|
15
15
|
<View style={headerStyles.margin}>
|
|
16
16
|
<View style={headerStyles.exitButtonContainer}>
|
|
17
17
|
<View style={headerStyles.exitButton}>
|
|
18
|
-
<TouchableOpacity testID={Testing.Id.HeaderTestIds.ExitCalculation}
|
|
18
|
+
<TouchableOpacity testID={Testing.Id.HeaderTestIds.ExitCalculation} style={headerStyles.exitButton} onPress={this.props.exitCallback}>
|
|
19
19
|
<Icon iconIdentifier={`Ionicons/ios-close-circle-outline`} style={headerStyles.iconStyle}/>
|
|
20
20
|
</TouchableOpacity>
|
|
21
21
|
<View style={headerStyles.headerFiller}/>
|
|
22
22
|
</View>
|
|
23
23
|
</View>
|
|
24
24
|
<View style={headerStyles.headerTextContainer}>
|
|
25
|
-
<Text style={headerStyles.headerText} testID=
|
|
25
|
+
<Text style={headerStyles.headerText} testID={Testing.Id.HeaderTestIds.HeaderText}>
|
|
26
26
|
{i18n._(t `INSULIN${`\n`}RECOMMENDATION`)}
|
|
27
27
|
</Text>
|
|
28
28
|
</View>
|
|
@@ -100,7 +100,7 @@ export default class InvisibleNumberInput extends React.Component {
|
|
|
100
100
|
*/
|
|
101
101
|
render() {
|
|
102
102
|
const { testID } = this.props;
|
|
103
|
-
return (<TextInput testID={testID}
|
|
103
|
+
return (<TextInput testID={testID} value={`${this.state.value}`} ref={(textInput) => {
|
|
104
104
|
if (textInput !== null) {
|
|
105
105
|
this.textInput = textInput;
|
|
106
106
|
}
|
|
@@ -21,7 +21,7 @@ export default class LimitationMessage extends React.Component {
|
|
|
21
21
|
<Text style={stylesModal.textMessage}>{limitationMessage}</Text>
|
|
22
22
|
</View>
|
|
23
23
|
<View style={stylesModal.containerAcceptButton}>
|
|
24
|
-
<TouchableOpacity testID={Testing.Id.LimitationMessageTestIds.OkButton}
|
|
24
|
+
<TouchableOpacity testID={Testing.Id.LimitationMessageTestIds.OkButton} style={stylesModal.okButton} onPress={this.props.onPressNextButton}>
|
|
25
25
|
<Text style={stylesModal.buttonText}>{i18n._(t `OK`)}</Text>
|
|
26
26
|
</TouchableOpacity>
|
|
27
27
|
</View>
|
|
@@ -44,10 +44,10 @@ export default class RecommendationModal extends React.Component {
|
|
|
44
44
|
*/
|
|
45
45
|
this.recommendationButtons = () => {
|
|
46
46
|
return (<View style={stylesModal.recommendationButtonsContainer}>
|
|
47
|
-
<TouchableOpacity testID={RecommendationModalTestIds.AcceptCarbs}
|
|
47
|
+
<TouchableOpacity testID={RecommendationModalTestIds.AcceptCarbs} style={stylesModal.affirmativeCarbsButton} onPress={this.props.onAcceptCarbohydrates}>
|
|
48
48
|
<Text style={stylesModal.affirmativeCarbsText}>{i18n._(t `OK`)}</Text>
|
|
49
49
|
</TouchableOpacity>
|
|
50
|
-
<TouchableOpacity testID={RecommendationModalTestIds.DeclineCarbs}
|
|
50
|
+
<TouchableOpacity testID={RecommendationModalTestIds.DeclineCarbs} style={stylesModal.negativeCarbsButton} onPress={this.props.onDeclineCarbohydrates}>
|
|
51
51
|
<Text style={stylesModal.negativeCarbsText}>{i18n._(t `NO`)}</Text>
|
|
52
52
|
</TouchableOpacity>
|
|
53
53
|
</View>);
|
|
@@ -99,7 +99,7 @@ export default class RecommendationModal extends React.Component {
|
|
|
99
99
|
{willRecommendCarbs ? this.recommendCarbohydrates(suggestedCarbohydrates) : null}
|
|
100
100
|
</View>
|
|
101
101
|
{willRecommendCarbs ? null : (<View style={stylesModal.containerAcceptButton}>
|
|
102
|
-
<TouchableOpacity testID={RecommendationModalTestIds.OkButton}
|
|
102
|
+
<TouchableOpacity testID={RecommendationModalTestIds.OkButton} style={stylesModal.okButton} onPress={this.props.onClickOkButton}>
|
|
103
103
|
<Text style={stylesModal.buttonText}>{i18n._(t `OK`)}</Text>
|
|
104
104
|
</TouchableOpacity>
|
|
105
105
|
</View>)}
|
|
@@ -88,7 +88,7 @@ export default class RecommendedCarbs extends React.Component {
|
|
|
88
88
|
<LineSeparator color={BORDER_COLOUR_GREY}/>
|
|
89
89
|
<View style={calculationStyles.borderContainer}>
|
|
90
90
|
<View style={calculationStyles.recommendedContainer}>
|
|
91
|
-
<TouchableOpacity testID={RecommendedCarbsTestIds.RemoveRecommendation}
|
|
91
|
+
<TouchableOpacity testID={RecommendedCarbsTestIds.RemoveRecommendation} style={calculationStyles.removeRecommended} onPress={this.props.removeRecommendedCarbs}>
|
|
92
92
|
<Icon iconIdentifier={`Ionicons/ios-close-circle-outline`} style={calculationStyles.removeRecommendedIcon}/>
|
|
93
93
|
</TouchableOpacity>
|
|
94
94
|
<Text style={calculationStyles.recommendedLabel}>{i18n._(t `Recommended`)}</Text>
|
|
@@ -99,7 +99,7 @@ export default class RecommendedCarbs extends React.Component {
|
|
|
99
99
|
<Text style={calculationStyles.recommendedLabel}>{i18n._(t `Additional`)}</Text>
|
|
100
100
|
</View>
|
|
101
101
|
<View style={calculationStyles.valueUnitContainer}>
|
|
102
|
-
<TouchableOpacity testID={RecommendedCarbsTestIds.EditRecommendedCarbs}
|
|
102
|
+
<TouchableOpacity testID={RecommendedCarbsTestIds.EditRecommendedCarbs} onPress={this.showTextInput} style={[calculationStyles.valueUnitContainer]}>
|
|
103
103
|
<View style={calculationStyles.valueContainer}>
|
|
104
104
|
<Text testID={RecommendedCarbsTestIds.RecommendedCarbs} style={[calculationStyles.value, { color: BORDER_COLOUR_TEAL }]}>
|
|
105
105
|
{shownCarbs}
|
|
@@ -86,7 +86,7 @@ export default class RecommendedInsulin extends React.Component {
|
|
|
86
86
|
const paddingBottom = Platform.OS === `ios` ? `3%` : `1%`;
|
|
87
87
|
const shownInsulin = this.state.partialInput ?? this.props.insulinRecommendation ?? `0`;
|
|
88
88
|
return (<React.Fragment>
|
|
89
|
-
<TouchableOpacity
|
|
89
|
+
<TouchableOpacity testID={RecommendedInsulinTestIds.EditRecommendedInsulin} onPress={this.handleOnPress}>
|
|
90
90
|
<LinearGradient style={recommendedInsulinStyles.container} colors={[`#a200ff`, `#578aff`]} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }}>
|
|
91
91
|
<View style={recommendedInsulinStyles.recommendedTextContainer}>
|
|
92
92
|
<Text style={recommendedInsulinStyles.recommendedText}>
|
|
@@ -100,7 +100,7 @@ export default class RecommendedInsulin extends React.Component {
|
|
|
100
100
|
</Text>
|
|
101
101
|
<Text style={recommendedInsulinStyles.units}>{i18n._(t `Units`)}</Text>
|
|
102
102
|
</View>
|
|
103
|
-
<Icon style={recommendedInsulinStyles.editIcon} iconIdentifier={`Feather/edit`}/>
|
|
103
|
+
<Icon style={recommendedInsulinStyles.editIcon} iconIdentifier={`Feather/edit`} testID={RecommendedInsulinTestIds.EditRecommendedInsulinIcon}/>
|
|
104
104
|
</View>
|
|
105
105
|
</LinearGradient>
|
|
106
106
|
</TouchableOpacity>
|
|
@@ -65,7 +65,9 @@ export default class Remeasure extends React.Component {
|
|
|
65
65
|
</View>
|
|
66
66
|
<View style={remeasureStyles.valueUnitContainer}>
|
|
67
67
|
<View style={valueContainer}>
|
|
68
|
-
<Text style={remeasureStyles.value}
|
|
68
|
+
<Text style={remeasureStyles.value} testID={Testing.Id.RemeasureTestIds.RemeasureHours}>
|
|
69
|
+
{measure ? limited : i18n._(t `OFF`)}
|
|
70
|
+
</Text>
|
|
69
71
|
</View>
|
|
70
72
|
{measure ? (<View style={remeasureStyles.unitContainer}>
|
|
71
73
|
<Text style={remeasureStyles.units}>{i18n._(t `hours`)}</Text>
|
|
@@ -76,7 +78,7 @@ export default class Remeasure extends React.Component {
|
|
|
76
78
|
if (slider !== null) {
|
|
77
79
|
this.slider = slider;
|
|
78
80
|
}
|
|
79
|
-
}} testID={Testing.Id.RemeasureTestIds.RemeasureSlider}
|
|
81
|
+
}} testID={Testing.Id.RemeasureTestIds.RemeasureSlider} maximumTrackTintColor={BORDER_COLOUR_GREY} minimumTrackTintColor={BORDER_COLOUR_TEAL} thumbTintColor={BORDER_COLOUR_TEAL} maximumValue={6} minimumValue={0} step={0.5} style={[remeasureStyles.sliderStyle, { marginHorizontal }]} onValueChange={this.handleSliderChange}/>
|
|
80
82
|
</View>);
|
|
81
83
|
}
|
|
82
84
|
}
|
|
@@ -39,7 +39,7 @@ export default class TransferToLogbook extends React.Component {
|
|
|
39
39
|
if (!this.props.visible) {
|
|
40
40
|
return <View style={addToLogbookStyles.marginContainer}/>;
|
|
41
41
|
}
|
|
42
|
-
return (<TouchableOpacity testID={Testing.Id.TransferToLogbookTestIds.TransferButton} onPress={this.handlePress} disabled={this.state.pressed} style={addToLogbookStyles.container}
|
|
42
|
+
return (<TouchableOpacity testID={Testing.Id.TransferToLogbookTestIds.TransferButton} onPress={this.handlePress} disabled={this.state.pressed} style={addToLogbookStyles.container}>
|
|
43
43
|
{!this.state.pressed ? (<View style={addToLogbookStyles.textContainer}>
|
|
44
44
|
<Text style={addToLogbookStyles.transferText}>{i18n._(t `Transfer to logbook`)}</Text>
|
|
45
45
|
</View>) : (<View style={addToLogbookStyles.textContainerActive}>
|
|
@@ -14,7 +14,7 @@ export default class TwoOptionModal extends React.Component {
|
|
|
14
14
|
<StatusBar backgroundColor={`rgba(0, 0, 0, 1)`}/>
|
|
15
15
|
<View style={modalStyle.modalContainer}>
|
|
16
16
|
{isCancelable ? (<TouchableOpacity onPress={this.props.onClose} testID={TwoOptionModalTestIds.ExitButton} style={modalStyle.iconWrapper}>
|
|
17
|
-
<Icon
|
|
17
|
+
<Icon iconIdentifier={`Ionicons/ios-close-circle-outline`} style={modalStyle.icon}/>
|
|
18
18
|
</TouchableOpacity>) : null}
|
|
19
19
|
|
|
20
20
|
<View style={isCancelable ? modalStyle.textContainer : modalStyle.textContainerNotCancelable}>
|
|
@@ -24,12 +24,12 @@ export default class TwoOptionModal extends React.Component {
|
|
|
24
24
|
<Text style={modalStyle.message}>{this.props.message}</Text>
|
|
25
25
|
</View>
|
|
26
26
|
<View style={rowAsButtonLayout ? modalStyle.buttonContainerRow : modalStyle.buttonContainerColumn}>
|
|
27
|
-
<TouchableOpacity testID={TwoOptionModalTestIds.FirstOption}
|
|
27
|
+
<TouchableOpacity testID={TwoOptionModalTestIds.FirstOption} onPress={this.props.firstOption} style={rowAsButtonLayout ? modalStyle.buttonRow : modalStyle.firstButtonColumn}>
|
|
28
28
|
<Text style={rowAsButtonLayout ? modalStyle.textButtonRow : modalStyle.textFirstButtonColumn}>
|
|
29
29
|
{this.props.textFirstOption}
|
|
30
30
|
</Text>
|
|
31
31
|
</TouchableOpacity>
|
|
32
|
-
<TouchableOpacity testID={TwoOptionModalTestIds.SecondOption}
|
|
32
|
+
<TouchableOpacity testID={TwoOptionModalTestIds.SecondOption} onPress={this.props.secondOption} style={rowAsButtonLayout ? modalStyle.buttonRow : modalStyle.secondButtonColumn}>
|
|
33
33
|
<Text style={rowAsButtonLayout ? modalStyle.textButtonRow : modalStyle.textSecondButtonColumn}>
|
|
34
34
|
{this.props.textSecondOption}
|
|
35
35
|
</Text>
|
|
@@ -33,7 +33,9 @@ export default class Activity extends React.Component {
|
|
|
33
33
|
</View>
|
|
34
34
|
<View style={infoStyles.valueUnitContainer}>
|
|
35
35
|
<View style={infoStyles.valueContainer}>
|
|
36
|
-
<Text style={infoStyles.value}
|
|
36
|
+
<Text style={infoStyles.value} testID={Testing.Id.ActivityTestIds.ActivityDuration}>
|
|
37
|
+
{activity.activityDuration}
|
|
38
|
+
</Text>
|
|
37
39
|
</View>
|
|
38
40
|
<View style={infoStyles.unitContainer}>
|
|
39
41
|
<Text style={infoStyles.units}>{i18n._(t `min`)}</Text>
|
|
@@ -13,9 +13,9 @@ export default class ActivityIcon extends React.Component<IActivityDisplayProps>
|
|
|
13
13
|
/**
|
|
14
14
|
* Steps:
|
|
15
15
|
* 1. Unpack activityType and activityTitle from props.
|
|
16
|
-
* 2. Create
|
|
16
|
+
* 2. Create a testID string by appending ‘_activity’ to the enum label corresponding to the activityType prop.
|
|
17
17
|
* @returns A JSX element including the following:
|
|
18
|
-
* 1. An image component with the generated
|
|
18
|
+
* 1. An image component with the generated testID displaying the icon from getActivityIcon().
|
|
19
19
|
* 2. The activityTitle if it is truthy or the string “Untitled Activity” otherwise
|
|
20
20
|
*/
|
|
21
21
|
render(): JSX.Element | null;
|
|
@@ -26,16 +26,16 @@ export default class ActivityIcon extends React.Component {
|
|
|
26
26
|
/**
|
|
27
27
|
* Steps:
|
|
28
28
|
* 1. Unpack activityType and activityTitle from props.
|
|
29
|
-
* 2. Create
|
|
29
|
+
* 2. Create a testID string by appending ‘_activity’ to the enum label corresponding to the activityType prop.
|
|
30
30
|
* @returns A JSX element including the following:
|
|
31
|
-
* 1. An image component with the generated
|
|
31
|
+
* 1. An image component with the generated testID displaying the icon from getActivityIcon().
|
|
32
32
|
* 2. The activityTitle if it is truthy or the string “Untitled Activity” otherwise
|
|
33
33
|
*/
|
|
34
34
|
render() {
|
|
35
35
|
const { activityType, activityTitle } = this.props;
|
|
36
|
-
const
|
|
36
|
+
const testID = `${Activity.Enums.ActivityEnum[activityType ?? Other]}_activity`;
|
|
37
37
|
return (<View style={activityIconStyles.container}>
|
|
38
|
-
<Image style={activityIconStyles.activityIcon} source={this.getActivityIcon()}
|
|
38
|
+
<Image style={activityIconStyles.activityIcon} source={this.getActivityIcon()} testID={testID}/>
|
|
39
39
|
<Text style={activityIconStyles.activityTitle}>{activityTitle || i18n._(t `Untitled Activity`)}</Text>
|
|
40
40
|
</View>);
|
|
41
41
|
}
|
|
@@ -19,7 +19,9 @@ export default class ActivityIntensity extends React.Component {
|
|
|
19
19
|
return (<View style={[infoStyles.margin, activityIntensityStyles.row]}>
|
|
20
20
|
<View style={activityIntensityStyles.intensityContainer}>
|
|
21
21
|
<View style={[activityIntensityStyles.intensityTextContainer, style]}>
|
|
22
|
-
<Text style={activityIntensityStyles.bold}
|
|
22
|
+
<Text style={activityIntensityStyles.bold} testID={intensity}>
|
|
23
|
+
{ActivityIntensityTranslations[intensity]()}
|
|
24
|
+
</Text>
|
|
23
25
|
</View>
|
|
24
26
|
</View>
|
|
25
27
|
<View style={activityIntensityStyles.intensityContainerOffset}/>
|
|
@@ -49,8 +49,8 @@ export default class MoodIcon extends React.Component {
|
|
|
49
49
|
/** JSX element to display the mood icon retrieved using the getMoodIcon() method. */
|
|
50
50
|
render() {
|
|
51
51
|
const { mood, active } = this.props;
|
|
52
|
-
const
|
|
53
|
-
return (<TouchableOpacity style={moodIconStyles.container} onPress={this.handleOnPress}
|
|
52
|
+
const testID = `${MoodEnum[mood]}-${active}`;
|
|
53
|
+
return (<TouchableOpacity style={moodIconStyles.container} onPress={this.handleOnPress} testID={testID}>
|
|
54
54
|
<Image style={moodIconStyles.icon} source={this.getMoodIcon()}/>
|
|
55
55
|
</TouchableOpacity>);
|
|
56
56
|
}
|