From e11acbab7847c3c08ea5bd812942283a7658620c Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Sun, 4 Feb 2024 17:12:42 +0100 Subject: [PATCH 01/74] Disable and switch secondary symptom depending on cervical mucus and cervix turned on or off. --- components/chart/chart.js | 6 + components/cycle-day/cycle-day-overview.js | 6 + components/settings/customization/index.js | 125 ++++++++++++++++++--- local-storage.js | 16 +++ 4 files changed, 137 insertions(+), 16 deletions(-) diff --git a/components/chart/chart.js b/components/chart/chart.js index b394129..5cc54b3 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -22,6 +22,8 @@ import { painTrackingCategoryObservable, sexTrackingCategoryObservable, temperatureTrackingCategoryObservable, + mucusTrackingCategoryObservable, + cervixTrackingCategoryObservable, } from '../../local-storage' import { makeColumnInfo } from '../helpers/chart' @@ -72,6 +74,10 @@ const CycleChart = ({ navigate, setDate }) => { const symptomRowEnabledSymptoms = symptomRowSymptoms.filter((symptom) => { if (symptom === 'sex') { return sexTrackingCategoryObservable.value ? symptom : null + } else if (symptom === 'mucus') { + return mucusTrackingCategoryObservable.value ? symptom : null + } else if (symptom === 'cervix') { + return cervixTrackingCategoryObservable.value ? symptom : null } else if (symptom === 'desire') { return desireTrackingCategoryObservable.value ? symptom : null } else if (symptom === 'pain') { diff --git a/components/cycle-day/cycle-day-overview.js b/components/cycle-day/cycle-day-overview.js index a033135..7f999f9 100644 --- a/components/cycle-day/cycle-day-overview.js +++ b/components/cycle-day/cycle-day-overview.js @@ -16,6 +16,8 @@ import { painTrackingCategoryObservable, sexTrackingCategoryObservable, temperatureTrackingCategoryObservable, + mucusTrackingCategoryObservable, + cervixTrackingCategoryObservable, } from '../../local-storage' import { Spacing } from '../../styles' import { SYMPTOMS } from '../../config' @@ -40,6 +42,10 @@ const CycleDayOverView = ({ date, setDate, isTemperatureEditView }) => { return temperatureTrackingCategoryObservable.value ? symptom : null } else if (symptom === 'sex') { return sexTrackingCategoryObservable.value ? symptom : null + } else if (symptom === 'mucus') { + return mucusTrackingCategoryObservable.value ? symptom : null + } else if (symptom === 'cervix') { + return cervixTrackingCategoryObservable.value ? symptom : null } else if (symptom === 'desire') { return desireTrackingCategoryObservable.value ? symptom : null } else if (symptom === 'pain') { diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index a8e0ab2..83dfb28 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react' +import React, { useEffect, useState } from 'react' import { Alert, Pressable } from 'react-native' import AppPage from '../../common/app-page' @@ -14,10 +14,14 @@ import { painTrackingCategoryObservable, sexTrackingCategoryObservable, temperatureTrackingCategoryObservable, + mucusTrackingCategoryObservable, + cervixTrackingCategoryObservable, saveDesireTrackingCategory, saveMoodTrackingCategory, saveNoteTrackingCategory, savePainTrackingCategory, + saveMucusTrackingCategory, + saveCervixTrackingCategory, savePeriodPrediction, saveSexTrackingCategory, saveTemperatureTrackingCategory, @@ -41,6 +45,14 @@ const Settings = () => { const [isTemperatureTrackingCategoryEnabled, setTemperatureTrackingCategory] = useState(temperatureTrackingCategoryObservable.value) + const [isMucusTrackingCategoryEnabled, setMucusTrackingCategory] = useState( + mucusTrackingCategoryObservable.value + ) + + const [isCervixTrackingCategoryEnabled, setCervixTrackingCategory] = useState( + cervixTrackingCategoryObservable.value + ) + const [isSexTrackingCategoryEnabled, setSexTrackingCategory] = useState( sexTrackingCategoryObservable.value ) @@ -61,6 +73,9 @@ const Settings = () => { noteTrackingCategoryObservable.value ) + const [isSecondarySymptomDisabled, setIsSecondarySymptomDisabled] = + useState(false) + const [isEnabled, setIsEnabled] = useState(false) const toggleSwitch = () => setIsEnabled((previousState) => !previousState) @@ -69,11 +84,44 @@ const Settings = () => { saveTemperatureTrackingCategory(value) } + const mucusTrackingCategoryToggle = (value) => { + if (!cervixTrackingCategoryObservable.value && value) { + setShouldUseCervix(false) + setIsSecondarySymptomDisabled(true) + } else if (cervixTrackingCategoryObservable.value && value) { + setIsSecondarySymptomDisabled(false) + } else if (cervixTrackingCategoryObservable.value && !value) { + setShouldUseCervix(true) + setIsSecondarySymptomDisabled(true) + } else if (!cervixTrackingCategoryObservable.value && !value) { + setIsSecondarySymptomDisabled(true) + } + setMucusTrackingCategory(value) + saveMucusTrackingCategory(value) + saveUseCervix(shouldUseCervix) + } + + const cervixTrackingCategoryToggle = (value) => { + if (!mucusTrackingCategoryObservable.value && value) { + setShouldUseCervix(true) + setIsSecondarySymptomDisabled(true) + } else if (mucusTrackingCategoryObservable.value && value) { + setIsSecondarySymptomDisabled(false) + } else if (mucusTrackingCategoryObservable.value && !value) { + setShouldUseCervix(false) + setIsSecondarySymptomDisabled(true) + } else if (!mucusTrackingCategoryObservable.value && !value) { + setIsSecondarySymptomDisabled(true) + } + setCervixTrackingCategory(value) + saveCervixTrackingCategory(value) + saveUseCervix(shouldUseCervix) + } + const sexTrackingCategoryToggle = (value) => { setSexTrackingCategory(value) saveSexTrackingCategory(value) } - const desireTrackingCategoryToggle = (value) => { setDesireTrackingCategory(value) saveDesireTrackingCategory(value) @@ -90,12 +138,10 @@ const Settings = () => { setNoteTrackingCategory(value) saveNoteTrackingCategory(value) } - const onPeriodPredictionToggle = (value) => { setPeriodPrediction(value) savePeriodPrediction(value) } - const periodPredictionText = isPeriodPredictionEnabled ? labels.periodPrediction.on : labels.periodPrediction.off @@ -105,6 +151,41 @@ const Settings = () => { saveUseCervix(value) } + useEffect(() => { + if ( + !mucusTrackingCategoryObservable.value && + cervixTrackingCategoryObservable.value + ) { + setShouldUseCervix(true) + setIsSecondarySymptomDisabled(false) + } else if ( + mucusTrackingCategoryObservable.value && + cervixTrackingCategoryObservable.value + ) { + setIsSecondarySymptomDisabled(false) + } else if ( + mucusTrackingCategoryObservable.value && + !cervixTrackingCategoryObservable.value + ) { + setShouldUseCervix(false) + setIsSecondarySymptomDisabled(false) + } else if ( + !mucusTrackingCategoryObservable.value && + !cervixTrackingCategoryObservable.value + ) { + setIsSecondarySymptomDisabled(true) + } + }, []) + + const secSymptomDisabledPrompt = () => { + if (isSecondarySymptomDisabled) { + Alert.alert( + labels.periodReminder.alertNoPeriodReminder.title, + labels.periodReminder.alertNoPeriodReminder.message + ) + } + } + const cervixText = shouldUseCervix ? labels.useCervix.cervixModeOn : labels.useCervix.cervixModeOff @@ -121,6 +202,22 @@ const Settings = () => { onToggle={temperatureTrackingCategoryToggle} text={SYMPTOMS[1]} value={isTemperatureTrackingCategoryEnabled} + /> + + { + mucusTrackingCategoryToggle(enabled) + }} + text={'mucus'} + value={isMucusTrackingCategoryEnabled} + trackColor={{ true: Colors.turquoiseDark }} + /> + { + cervixTrackingCategoryToggle(enabled) + }} + text={'cervix'} + value={isCervixTrackingCategoryEnabled} trackColor={{ true: Colors.turquoiseDark }} /> { - + - {isTemperatureTrackingCategoryEnabled && ( - - )} - {!isTemperatureTrackingCategoryEnabled && ( - {labels.disabled.message} - )} + diff --git a/local-storage.js b/local-storage.js index ece4355..7b9477a 100644 --- a/local-storage.js +++ b/local-storage.js @@ -107,6 +107,22 @@ export async function saveTemperatureTrackingCategory(bool) { } } +export const mucusTrackingCategoryObservable = Observable() +setObvWithInitValue('mucus', mucusTrackingCategoryObservable, true) + +export async function saveMucusTrackingCategory(bool) { + await AsyncStorage.setItem('mucus', JSON.stringify(bool)) + mucusTrackingCategoryObservable.set(bool) +} + +export const cervixTrackingCategoryObservable = Observable() +setObvWithInitValue('cervix', cervixTrackingCategoryObservable, true) + +export async function saveCervixTrackingCategory(bool) { + await AsyncStorage.setItem('cervix', JSON.stringify(bool)) + cervixTrackingCategoryObservable.set(bool) +} + export const sexTrackingCategoryObservable = Observable() setObvWithInitValue('sex', sexTrackingCategoryObservable, true) From 8a8b3217fa65c35e2830f75cced073f772f5b09b Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Mon, 12 Feb 2024 16:05:49 +0100 Subject: [PATCH 02/74] small changes on Secondary Symptom disable function --- components/settings/customization/index.js | 20 +++++++++++++++----- i18n/en/settings.js | 7 +++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 83dfb28..b3c6086 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -178,10 +178,18 @@ const Settings = () => { }, []) const secSymptomDisabledPrompt = () => { - if (isSecondarySymptomDisabled) { + if (!isMucusTrackingCategoryEnabled && !isCervixTrackingCategoryEnabled) { Alert.alert( - labels.periodReminder.alertNoPeriodReminder.title, - labels.periodReminder.alertNoPeriodReminder.message + labels.useCervix.disabled.title, + labels.useCervix.disabled.message + ) + } else if ( + !isMucusTrackingCategoryEnabled || + !isCervixTrackingCategoryEnabled + ) { + Alert.alert( + labels.useCervix.disabled.title, + labels.useCervix.disabled.noSecondaryEnabled ) } } @@ -208,18 +216,20 @@ const Settings = () => { onToggle={(enabled) => { mucusTrackingCategoryToggle(enabled) }} - text={'mucus'} + text={SYMPTOMS[2]} value={isMucusTrackingCategoryEnabled} trackColor={{ true: Colors.turquoiseDark }} /> + { cervixTrackingCategoryToggle(enabled) }} - text={'cervix'} + text={SYMPTOMS[3]} value={isCervixTrackingCategoryEnabled} trackColor={{ true: Colors.turquoiseDark }} /> + Date: Tue, 13 Feb 2024 11:52:33 +0100 Subject: [PATCH 03/74] fix: disabling the secondary symptom toggle when not both categories are enabled, didn't work before after new save --- components/settings/customization/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index b3c6086..db88296 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -147,8 +147,10 @@ const Settings = () => { : labels.periodPrediction.off const onCervixToggle = (value) => { - setShouldUseCervix(value) - saveUseCervix(value) + if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { + setShouldUseCervix(value) + saveUseCervix(value) + } } useEffect(() => { From d7f1eb81fbe8788196c0c114c1b4049e0018af58 Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Tue, 13 Feb 2024 15:46:04 +0100 Subject: [PATCH 04/74] centralizing code to set the Secondary Symptom from different actions in one function --- components/settings/customization/index.js | 70 +++++++--------------- 1 file changed, 22 insertions(+), 48 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index db88296..ff81683 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -85,37 +85,11 @@ const Settings = () => { } const mucusTrackingCategoryToggle = (value) => { - if (!cervixTrackingCategoryObservable.value && value) { - setShouldUseCervix(false) - setIsSecondarySymptomDisabled(true) - } else if (cervixTrackingCategoryObservable.value && value) { - setIsSecondarySymptomDisabled(false) - } else if (cervixTrackingCategoryObservable.value && !value) { - setShouldUseCervix(true) - setIsSecondarySymptomDisabled(true) - } else if (!cervixTrackingCategoryObservable.value && !value) { - setIsSecondarySymptomDisabled(true) - } - setMucusTrackingCategory(value) - saveMucusTrackingCategory(value) - saveUseCervix(shouldUseCervix) + manageSecondarySymptom(cervixTrackingCategoryObservable.value, value) } const cervixTrackingCategoryToggle = (value) => { - if (!mucusTrackingCategoryObservable.value && value) { - setShouldUseCervix(true) - setIsSecondarySymptomDisabled(true) - } else if (mucusTrackingCategoryObservable.value && value) { - setIsSecondarySymptomDisabled(false) - } else if (mucusTrackingCategoryObservable.value && !value) { - setShouldUseCervix(false) - setIsSecondarySymptomDisabled(true) - } else if (!mucusTrackingCategoryObservable.value && !value) { - setIsSecondarySymptomDisabled(true) - } - setCervixTrackingCategory(value) - saveCervixTrackingCategory(value) - saveUseCervix(shouldUseCervix) + manageSecondarySymptom(value, mucusTrackingCategoryObservable.value) } const sexTrackingCategoryToggle = (value) => { @@ -154,30 +128,30 @@ const Settings = () => { } useEffect(() => { - if ( - !mucusTrackingCategoryObservable.value && - cervixTrackingCategoryObservable.value - ) { - setShouldUseCervix(true) - setIsSecondarySymptomDisabled(false) - } else if ( - mucusTrackingCategoryObservable.value && - cervixTrackingCategoryObservable.value - ) { - setIsSecondarySymptomDisabled(false) - } else if ( - mucusTrackingCategoryObservable.value && - !cervixTrackingCategoryObservable.value - ) { + manageSecondarySymptom( + cervixTrackingCategoryObservable.value, + mucusTrackingCategoryObservable.value + ) + }, []) + + const manageSecondarySymptom = (cervix, mucus) => { + if (!cervix && mucus) { setShouldUseCervix(false) + setIsSecondarySymptomDisabled(true) + } else if (cervix && mucus) { setIsSecondarySymptomDisabled(false) - } else if ( - !mucusTrackingCategoryObservable.value && - !cervixTrackingCategoryObservable.value - ) { + } else if (cervix && !mucus) { + setShouldUseCervix(true) + setIsSecondarySymptomDisabled(true) + } else if (!cervix && !mucus) { setIsSecondarySymptomDisabled(true) } - }, []) + setMucusTrackingCategory(mucus) + saveMucusTrackingCategory(mucus) + setCervixTrackingCategory(cervix) + saveCervixTrackingCategory(cervix) + saveUseCervix(shouldUseCervix) + } const secSymptomDisabledPrompt = () => { if (!isMucusTrackingCategoryEnabled && !isCervixTrackingCategoryEnabled) { From a59dfa83367dca2dd5513cfca34b68eee3ae3cf4 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Tue, 13 Feb 2024 12:18:44 +0100 Subject: [PATCH 05/74] Add SelectTabGroup for secondary Symptom Switch --- components/settings/customization/index.js | 46 ++++++++++++++++++---- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index ff81683..4454667 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -6,6 +6,7 @@ import AppSwitch from '../../common/app-switch' import AppText from '../../common/app-text' import TemperatureSlider from './temperature-slider' import Segment from '../../common/segment' +import SelectTabGroup from '../../cycle-day/select-tab-group' import { desireTrackingCategoryObservable, @@ -120,7 +121,16 @@ const Settings = () => { ? labels.periodPrediction.on : labels.periodPrediction.off - const onCervixToggle = (value) => { + // old + // const onCervixToggle = (value) => { + // if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { + // setShouldUseCervix(value) + // saveUseCervix(value) + // } + // } + + // new + const onSelectTab = (value) => { if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { setShouldUseCervix(value) saveUseCervix(value) @@ -170,6 +180,18 @@ const Settings = () => { } } + //new + const secondarySymptomButtons = [ + { + label: 'cervical mucus', + value: 0, + }, + { + label: 'cervix', + value: 1, + }, + ] + const cervixText = shouldUseCervix ? labels.useCervix.cervixModeOn : labels.useCervix.cervixModeOff @@ -263,13 +285,21 @@ const Settings = () => { - + {/* hier war vorher der AppSwitch */} + {/* noch condition adden */} + {isTemperatureTrackingCategoryEnabled && ( + <> + {cervixText} + onSelectTab(value)} + /> + + )} + {!isTemperatureTrackingCategoryEnabled && ( + {labels.disabled.message} + )} From 1662bb29f07638f2c98e7e7deac9f524bd91659f Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Tue, 13 Feb 2024 12:39:08 +0100 Subject: [PATCH 06/74] Change prop Type to value instead of bool for saveUseCervix --- local-storage.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/local-storage.js b/local-storage.js index 7b9477a..431137f 100644 --- a/local-storage.js +++ b/local-storage.js @@ -60,11 +60,11 @@ export async function savePeriodPrediction(bool) { } export const useCervixObservable = Observable() -setObvWithInitValue('useCervix', useCervixObservable, false) +setObvWithInitValue('useCervix', useCervixObservable, 0) -export async function saveUseCervix(bool) { - await AsyncStorage.setItem('useCervix', JSON.stringify(bool)) - useCervixObservable.set(bool) +export async function saveUseCervix(value) { + await AsyncStorage.setItem('useCervix', JSON.stringify(value)) + useCervixObservable.set(value) } export const hasEncryptionObservable = Observable() From ebbfd8aba573fb6b820f7403aafcff20d174d120 Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Wed, 14 Feb 2024 10:26:13 +0100 Subject: [PATCH 07/74] merging work on secondary symptom logic and buttons --- components/settings/customization/index.js | 34 ++++++++-------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 4454667..60b7304 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -121,15 +121,17 @@ const Settings = () => { ? labels.periodPrediction.on : labels.periodPrediction.off - // old - // const onCervixToggle = (value) => { - // if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { - // setShouldUseCervix(value) - // saveUseCervix(value) - // } - // } + const secondarySymptomButtons = [ + { + label: 'cervical mucus', + value: 0, + }, + { + label: 'cervix', + value: 1, + }, + ] - // new const onSelectTab = (value) => { if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { setShouldUseCervix(value) @@ -180,18 +182,6 @@ const Settings = () => { } } - //new - const secondarySymptomButtons = [ - { - label: 'cervical mucus', - value: 0, - }, - { - label: 'cervix', - value: 1, - }, - ] - const cervixText = shouldUseCervix ? labels.useCervix.cervixModeOn : labels.useCervix.cervixModeOff @@ -285,11 +275,11 @@ const Settings = () => { - {/* hier war vorher der AppSwitch */} - {/* noch condition adden */} + {/* noch condition adden like isSecondarySymptomDisabled */} {isTemperatureTrackingCategoryEnabled && ( <> {cervixText} + Date: Tue, 13 Feb 2024 12:18:44 +0100 Subject: [PATCH 08/74] Add SelectTabGroup for secondary Symptom Switch --- components/settings/customization/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 60b7304..41a5cf5 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -279,7 +279,6 @@ const Settings = () => { {isTemperatureTrackingCategoryEnabled && ( <> {cervixText} - Date: Wed, 14 Feb 2024 15:10:28 +0100 Subject: [PATCH 09/74] Replace hard coded text --- components/settings/customization/index.js | 4 ++-- i18n/en/settings.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 41a5cf5..49a65ff 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -123,11 +123,11 @@ const Settings = () => { const secondarySymptomButtons = [ { - label: 'cervical mucus', + label: labels.useCervix.secondarySymptomCervicalMucus, value: 0, }, { - label: 'cervix', + label: labels.useCervix.secondarySymptomCervix, value: 1, }, ] diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 200ebd6..d4b307a 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -79,6 +79,8 @@ export default { noSecondaryEnabled: 'To switch the secondary symptom both cervical mucus an cervix need to be enabled in the customization settings.', }, + secondarySymptomCervicalMucus: 'cervical mucus', + secondarySymptomCervix: 'cervix', }, periodPrediction: { title: 'Period predictions', From 311cee0e17b842b412ddbc5fe6945819c9a630a9 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 14 Feb 2024 15:11:00 +0100 Subject: [PATCH 10/74] Adapt color for secondarySymptom Boxes --- components/cycle-day/select-tab-group.js | 25 ++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index b298cbd..ef9ae03 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -5,14 +5,26 @@ import { StyleSheet, TouchableOpacity, View } from 'react-native' import AppText from '../common/app-text' import { Colors, Containers } from '../../styles' +import labels from '../../i18n/en/settings' export default function SelectTabGroup({ activeButton, buttons, onSelect }) { + const isSecondarySymptomSwitch = + buttons[0]['label'] === labels.useCervix.secondarySymptomCervicalMucus return ( {buttons.map(({ label, value }, i) => { const isActive = value === activeButton - const boxStyle = [styles.box, isActive && styles.boxActive] - const textStyle = [styles.text, isActive && styles.textActive] + const boxStyle = [ + styles.box, + isActive && styles.boxActive, + isSecondarySymptomSwitch && styles.purpleBox, + isSecondarySymptomSwitch && isActive && styles.activePurpleBox, + ] + const textStyle = [ + styles.text, + isSecondarySymptomSwitch && styles.purpleText, + isActive && styles.textActive, + ] return ( Date: Wed, 14 Feb 2024 15:36:06 +0100 Subject: [PATCH 11/74] Add oneTimeTransformIntoNumber for secondarySymptom Switch --- components/cycle-day/select-tab-group.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index ef9ae03..0548977 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -8,12 +8,15 @@ import { Colors, Containers } from '../../styles' import labels from '../../i18n/en/settings' export default function SelectTabGroup({ activeButton, buttons, onSelect }) { + const oneTimeTransformIntoNumber = + typeof activeButton === 'boolean' && Number(activeButton) const isSecondarySymptomSwitch = buttons[0]['label'] === labels.useCervix.secondarySymptomCervicalMucus return ( {buttons.map(({ label, value }, i) => { - const isActive = value === activeButton + const isActive = + value === activeButton || value === oneTimeTransformIntoNumber const boxStyle = [ styles.box, isActive && styles.boxActive, From 5f5550083174e4061549eaffd305e22b1ceeb9ed Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Mon, 19 Feb 2024 12:13:58 +0100 Subject: [PATCH 12/74] small changes on secondary symptom to make it work nicly with the button logic instead of the former switch and to display the correct texts --- components/settings/customization/index.js | 32 ++++++++++------------ i18n/en/settings.js | 2 +- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 49a65ff..386225a 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -121,6 +121,7 @@ const Settings = () => { ? labels.periodPrediction.on : labels.periodPrediction.off + // used to be onCervixToggle const secondarySymptomButtons = [ { label: labels.useCervix.secondarySymptomCervicalMucus, @@ -139,6 +140,7 @@ const Settings = () => { } } + // is needed so secondary symptom is set correct on load useEffect(() => { manageSecondarySymptom( cervixTrackingCategoryObservable.value, @@ -146,15 +148,16 @@ const Settings = () => { ) }, []) + // shoutUseCervix changed to 0/1 instead of false/true const manageSecondarySymptom = (cervix, mucus) => { if (!cervix && mucus) { - setShouldUseCervix(false) - setIsSecondarySymptomDisabled(true) + setShouldUseCervix(0) + setIsSecondarySymptomDisabled(false) } else if (cervix && mucus) { setIsSecondarySymptomDisabled(false) } else if (cervix && !mucus) { - setShouldUseCervix(true) - setIsSecondarySymptomDisabled(true) + setShouldUseCervix(1) + setIsSecondarySymptomDisabled(false) } else if (!cervix && !mucus) { setIsSecondarySymptomDisabled(true) } @@ -166,15 +169,7 @@ const Settings = () => { } const secSymptomDisabledPrompt = () => { - if (!isMucusTrackingCategoryEnabled && !isCervixTrackingCategoryEnabled) { - Alert.alert( - labels.useCervix.disabled.title, - labels.useCervix.disabled.message - ) - } else if ( - !isMucusTrackingCategoryEnabled || - !isCervixTrackingCategoryEnabled - ) { + if (!isMucusTrackingCategoryEnabled == isCervixTrackingCategoryEnabled) { Alert.alert( labels.useCervix.disabled.title, labels.useCervix.disabled.noSecondaryEnabled @@ -191,6 +186,7 @@ const Settings = () => { Alert.alert(labels.disabled.title, labels.disabled.message) } } + return ( @@ -273,10 +269,13 @@ const Settings = () => { + {/* used to be switch for onCervixToggle */} - {/* noch condition adden like isSecondarySymptomDisabled */} - {isTemperatureTrackingCategoryEnabled && ( + {!isTemperatureTrackingCategoryEnabled || + isSecondarySymptomDisabled ? ( + {labels.useCervix.disabled.message} + ) : ( <> {cervixText} { /> )} - {!isTemperatureTrackingCategoryEnabled && ( - {labels.disabled.message} - )} diff --git a/i18n/en/settings.js b/i18n/en/settings.js index d4b307a..7afa9be 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -75,7 +75,7 @@ export default { disabled: { title: 'Disabled', message: - 'To set the secondary symptom please first enable the temperature, cervical mucus or cervix tracking category as well as the fertility feature in the customization settings.', + 'To set a secondary symptom please first enable the temperature, cervical mucus or cervix tracking category as well as the fertility feature in the customization settings.', noSecondaryEnabled: 'To switch the secondary symptom both cervical mucus an cervix need to be enabled in the customization settings.', }, From 7fa130f9e119125592f459731c5e58b6de484eb1 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 19 Feb 2024 17:13:40 +0100 Subject: [PATCH 13/74] Rename to useCervixAsSecondarySymptomObservable --- components/settings/customization/index.js | 4 ++-- lib/sympto-adapter.js | 4 ++-- local-storage.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 386225a..7ff147a 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -28,7 +28,7 @@ import { saveTemperatureTrackingCategory, saveUseCervix, periodPredictionObservable, - useCervixObservable, + useCervixAsSecondarySymptomObservable, } from '../../../local-storage' import { Colors } from '../../../styles' import labels from '../../../i18n/en/settings' @@ -36,7 +36,7 @@ import { SYMPTOMS } from '../../../config' const Settings = () => { const [shouldUseCervix, setShouldUseCervix] = useState( - useCervixObservable.value + useCervixAsSecondarySymptomObservable.value ) const [isPeriodPredictionEnabled, setPeriodPrediction] = useState( diff --git a/lib/sympto-adapter.js b/lib/sympto-adapter.js index aac2807..ef3b8fb 100644 --- a/lib/sympto-adapter.js +++ b/lib/sympto-adapter.js @@ -1,6 +1,6 @@ import getFertilityStatus from 'sympto' import cycleModule from './cycle' -import { useCervixObservable } from '../local-storage' +import { useCervixAsSecondarySymptomObservable } from '../local-storage' import { fertilityStatus as labels } from '../i18n/en/labels' export function getFertilityStatusForDay(dateString) { @@ -57,7 +57,7 @@ export function getCycleStatusForDay(dateString, opts = {}) { } } - cycleInfo.secondarySymptom = useCervixObservable.value ? 'cervix' : 'mucus' + cycleInfo.secondarySymptom = useCervixAsSecondarySymptomObservable.value ? 'cervix' : 'mucus' return getFertilityStatus(cycleInfo) } diff --git a/local-storage.js b/local-storage.js index 431137f..175a7d4 100644 --- a/local-storage.js +++ b/local-storage.js @@ -59,12 +59,12 @@ export async function savePeriodPrediction(bool) { } } -export const useCervixObservable = Observable() -setObvWithInitValue('useCervix', useCervixObservable, 0) +export const useCervixAsSecondarySymptomObservable = Observable() +setObvWithInitValue('useCervix', useCervixAsSecondarySymptomObservable, 0) export async function saveUseCervix(value) { await AsyncStorage.setItem('useCervix', JSON.stringify(value)) - useCervixObservable.set(value) + useCervixAsSecondarySymptomObservable.set(value) } export const hasEncryptionObservable = Observable() From 63bc8a1daf9c3e7e7ba37aaf4f1b597ec25bc670 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 19 Feb 2024 17:48:37 +0100 Subject: [PATCH 14/74] Rename to useCervixAsSecondarySymptom --- components/cycle-day/select-tab-group.js | 2 +- components/settings/customization/index.js | 22 +++++++++++----------- i18n/en/settings.js | 6 +++--- local-storage.js | 13 ++++++++++--- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index 0548977..91e87e9 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -11,7 +11,7 @@ export default function SelectTabGroup({ activeButton, buttons, onSelect }) { const oneTimeTransformIntoNumber = typeof activeButton === 'boolean' && Number(activeButton) const isSecondarySymptomSwitch = - buttons[0]['label'] === labels.useCervix.secondarySymptomCervicalMucus + buttons[0]['label'] === labels.useCervixAsSecondarySymptom.mucus return ( {buttons.map(({ label, value }, i) => { diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 7ff147a..59e5151 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -26,7 +26,7 @@ import { savePeriodPrediction, saveSexTrackingCategory, saveTemperatureTrackingCategory, - saveUseCervix, + saveUseCervixAsSecondarySymptom, periodPredictionObservable, useCervixAsSecondarySymptomObservable, } from '../../../local-storage' @@ -124,11 +124,11 @@ const Settings = () => { // used to be onCervixToggle const secondarySymptomButtons = [ { - label: labels.useCervix.secondarySymptomCervicalMucus, + label: labels.useCervixAsSecondarySymptom.mucus, value: 0, }, { - label: labels.useCervix.secondarySymptomCervix, + label: labels.useCervixAsSecondarySymptom.cervix, value: 1, }, ] @@ -136,7 +136,7 @@ const Settings = () => { const onSelectTab = (value) => { if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { setShouldUseCervix(value) - saveUseCervix(value) + saveUseCervixAsSecondarySymptom(value) } } @@ -165,21 +165,21 @@ const Settings = () => { saveMucusTrackingCategory(mucus) setCervixTrackingCategory(cervix) saveCervixTrackingCategory(cervix) - saveUseCervix(shouldUseCervix) + saveUseCervixAsSecondarySymptom(shouldUseCervix) } const secSymptomDisabledPrompt = () => { if (!isMucusTrackingCategoryEnabled == isCervixTrackingCategoryEnabled) { Alert.alert( - labels.useCervix.disabled.title, - labels.useCervix.disabled.noSecondaryEnabled + labels.useCervixAsSecondarySymptom.disabled.title, + labels.useCervixAsSecondarySymptom.disabled.noSecondaryEnabled ) } } const cervixText = shouldUseCervix - ? labels.useCervix.cervixModeOn - : labels.useCervix.cervixModeOff + ? labels.useCervixAsSecondarySymptom.cervixModeOn + : labels.useCervixAsSecondarySymptom.cervixModeOff const sliderDisabledPrompt = () => { if (!isTemperatureTrackingCategoryEnabled) { @@ -271,10 +271,10 @@ const Settings = () => { {/* used to be switch for onCervixToggle */} - + {!isTemperatureTrackingCategoryEnabled || isSecondarySymptomDisabled ? ( - {labels.useCervix.disabled.message} + {labels.useCervixAsSecondarySymptom.disabled.message} ) : ( <> {cervixText} diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 7afa9be..918ce5a 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -66,7 +66,7 @@ export default { 'To use the period reminder please first enable period predictions in the customization settings.', }, }, - useCervix: { + useCervixAsSecondarySymptom: { title: 'Secondary symptom', cervixModeOn: 'Cervix values are being used for symptothermal fertility detection. You can switch here to use cervical mucus values for symptothermal fertility detection', @@ -79,8 +79,8 @@ export default { noSecondaryEnabled: 'To switch the secondary symptom both cervical mucus an cervix need to be enabled in the customization settings.', }, - secondarySymptomCervicalMucus: 'cervical mucus', - secondarySymptomCervix: 'cervix', + mucus: 'cervical mucus', + cervix: 'cervix', }, periodPrediction: { title: 'Period predictions', diff --git a/local-storage.js b/local-storage.js index 175a7d4..84b680d 100644 --- a/local-storage.js +++ b/local-storage.js @@ -60,10 +60,17 @@ export async function savePeriodPrediction(bool) { } export const useCervixAsSecondarySymptomObservable = Observable() -setObvWithInitValue('useCervix', useCervixAsSecondarySymptomObservable, 0) +setObvWithInitValue( + 'useCervixAsSecondarySymptom', + useCervixAsSecondarySymptomObservable, + 0 +) -export async function saveUseCervix(value) { - await AsyncStorage.setItem('useCervix', JSON.stringify(value)) +export async function saveUseCervixAsSecondarySymptom(value) { + await AsyncStorage.setItem( + 'useCervixAsSecondarySymptom', + JSON.stringify(value) + ) useCervixAsSecondarySymptomObservable.set(value) } From dc304afe75d20faebca5a39b78565253ac967852 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 19 Feb 2024 18:01:57 +0100 Subject: [PATCH 15/74] Rename labels to more neutral 'secondarySymptom' --- components/cycle-day/select-tab-group.js | 2 +- components/settings/customization/index.js | 16 ++++++++-------- i18n/en/settings.js | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index 91e87e9..8c98f78 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -11,7 +11,7 @@ export default function SelectTabGroup({ activeButton, buttons, onSelect }) { const oneTimeTransformIntoNumber = typeof activeButton === 'boolean' && Number(activeButton) const isSecondarySymptomSwitch = - buttons[0]['label'] === labels.useCervixAsSecondarySymptom.mucus + buttons[0]['label'] === labels.secondarySymptom.mucus return ( {buttons.map(({ label, value }, i) => { diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 59e5151..1d9445c 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -124,11 +124,11 @@ const Settings = () => { // used to be onCervixToggle const secondarySymptomButtons = [ { - label: labels.useCervixAsSecondarySymptom.mucus, + label: labels.secondarySymptom.mucus, value: 0, }, { - label: labels.useCervixAsSecondarySymptom.cervix, + label: labels.secondarySymptom.cervix, value: 1, }, ] @@ -171,15 +171,15 @@ const Settings = () => { const secSymptomDisabledPrompt = () => { if (!isMucusTrackingCategoryEnabled == isCervixTrackingCategoryEnabled) { Alert.alert( - labels.useCervixAsSecondarySymptom.disabled.title, - labels.useCervixAsSecondarySymptom.disabled.noSecondaryEnabled + labels.secondarySymptom.disabled.title, + labels.secondarySymptom.disabled.noSecondaryEnabled ) } } const cervixText = shouldUseCervix - ? labels.useCervixAsSecondarySymptom.cervixModeOn - : labels.useCervixAsSecondarySymptom.cervixModeOff + ? labels.secondarySymptom.cervixModeOn + : labels.secondarySymptom.cervixModeOff const sliderDisabledPrompt = () => { if (!isTemperatureTrackingCategoryEnabled) { @@ -271,10 +271,10 @@ const Settings = () => { {/* used to be switch for onCervixToggle */} - + {!isTemperatureTrackingCategoryEnabled || isSecondarySymptomDisabled ? ( - {labels.useCervixAsSecondarySymptom.disabled.message} + {labels.secondarySymptom.disabled.message} ) : ( <> {cervixText} diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 918ce5a..bf26203 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -66,7 +66,7 @@ export default { 'To use the period reminder please first enable period predictions in the customization settings.', }, }, - useCervixAsSecondarySymptom: { + secondarySymptom: { title: 'Secondary symptom', cervixModeOn: 'Cervix values are being used for symptothermal fertility detection. You can switch here to use cervical mucus values for symptothermal fertility detection', From 69c546f684784a8212ce8f65d65d0667d14feb68 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 19 Feb 2024 18:05:20 +0100 Subject: [PATCH 16/74] Rename shouldUseCervix to useCervixAsSecondarySymptom --- components/settings/customization/index.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 1d9445c..ad9881a 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -35,9 +35,8 @@ import labels from '../../../i18n/en/settings' import { SYMPTOMS } from '../../../config' const Settings = () => { - const [shouldUseCervix, setShouldUseCervix] = useState( - useCervixAsSecondarySymptomObservable.value - ) + const [useCervixAsSecondarySymptom, setUseCervixAsSecondarySymptom] = + useState(useCervixAsSecondarySymptomObservable.value) const [isPeriodPredictionEnabled, setPeriodPrediction] = useState( periodPredictionObservable.value @@ -135,7 +134,7 @@ const Settings = () => { const onSelectTab = (value) => { if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { - setShouldUseCervix(value) + setUseCervixAsSecondarySymptom(value) saveUseCervixAsSecondarySymptom(value) } } @@ -151,12 +150,12 @@ const Settings = () => { // shoutUseCervix changed to 0/1 instead of false/true const manageSecondarySymptom = (cervix, mucus) => { if (!cervix && mucus) { - setShouldUseCervix(0) + setUseCervixAsSecondarySymptom(0) setIsSecondarySymptomDisabled(false) } else if (cervix && mucus) { setIsSecondarySymptomDisabled(false) } else if (cervix && !mucus) { - setShouldUseCervix(1) + setUseCervixAsSecondarySymptom(1) setIsSecondarySymptomDisabled(false) } else if (!cervix && !mucus) { setIsSecondarySymptomDisabled(true) @@ -165,7 +164,7 @@ const Settings = () => { saveMucusTrackingCategory(mucus) setCervixTrackingCategory(cervix) saveCervixTrackingCategory(cervix) - saveUseCervixAsSecondarySymptom(shouldUseCervix) + saveUseCervixAsSecondarySymptom(useCervixAsSecondarySymptom) } const secSymptomDisabledPrompt = () => { @@ -177,7 +176,7 @@ const Settings = () => { } } - const cervixText = shouldUseCervix + const cervixText = useCervixAsSecondarySymptom ? labels.secondarySymptom.cervixModeOn : labels.secondarySymptom.cervixModeOff @@ -279,7 +278,7 @@ const Settings = () => { <> {cervixText} onSelectTab(value)} /> From d66e5f36e53ed1e8e0193aef00f85a80e234ea53 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 19 Feb 2024 18:10:57 +0100 Subject: [PATCH 17/74] Rename to secondarySymptomDisabledPrompt --- components/settings/customization/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index ad9881a..7fa9dd7 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -167,7 +167,7 @@ const Settings = () => { saveUseCervixAsSecondarySymptom(useCervixAsSecondarySymptom) } - const secSymptomDisabledPrompt = () => { + const secondarySymptomDisabledPrompt = () => { if (!isMucusTrackingCategoryEnabled == isCervixTrackingCategoryEnabled) { Alert.alert( labels.secondarySymptom.disabled.title, @@ -269,7 +269,7 @@ const Settings = () => { {/* used to be switch for onCervixToggle */} - + {!isTemperatureTrackingCategoryEnabled || isSecondarySymptomDisabled ? ( From cbaf6977f6cd675fe5b6e6366f095306bc6bf693 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 22 Feb 2024 13:22:41 +0100 Subject: [PATCH 18/74] Add trackColor to Switch element directly --- components/common/app-switch.js | 6 +++--- components/settings/customization/index.js | 10 ---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/components/common/app-switch.js b/components/common/app-switch.js index 3c100fe..d45758f 100644 --- a/components/common/app-switch.js +++ b/components/common/app-switch.js @@ -4,9 +4,10 @@ import PropTypes from 'prop-types' import AppText from './app-text' -import { Containers } from '../../styles' +import { Colors, Containers } from '../../styles' -const AppSwitch = ({ onToggle, text, value, trackColor, disabled }) => { +const AppSwitch = ({ onToggle, text, value, disabled }) => { + const trackColor = { true: Colors.turquoiseDark } return ( @@ -27,7 +28,6 @@ AppSwitch.propTypes = { onToggle: PropTypes.func.isRequired, text: PropTypes.string, value: PropTypes.bool, - trackColor: PropTypes.string, disabled: PropTypes.bool, } diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index a8e0ab2..136e8f1 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -25,7 +25,6 @@ import { periodPredictionObservable, useCervixObservable, } from '../../../local-storage' -import { Colors } from '../../../styles' import labels from '../../../i18n/en/settings' import { SYMPTOMS } from '../../../config' @@ -121,37 +120,31 @@ const Settings = () => { onToggle={temperatureTrackingCategoryToggle} text={SYMPTOMS[1]} value={isTemperatureTrackingCategoryEnabled} - trackColor={{ true: Colors.turquoiseDark }} /> @@ -160,7 +153,6 @@ const Settings = () => { onToggle={toggleSwitch} text={'If turned on ...'} value={isEnabled} - trackColor={{ true: Colors.turquoiseDark }} /> @@ -185,7 +177,6 @@ const Settings = () => { onToggle={onCervixToggle} text={cervixText} value={shouldUseCervix} - trackColor={{ true: Colors.turquoiseDark }} /> )} {!isTemperatureTrackingCategoryEnabled && ( @@ -199,7 +190,6 @@ const Settings = () => { onToggle={onPeriodPredictionToggle} text={periodPredictionText} value={isPeriodPredictionEnabled} - trackColor={{ true: Colors.turquoiseDark }} /> From 4921aca3c3129f5be35811d4034e13b53759a827 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 22 Feb 2024 13:32:58 +0100 Subject: [PATCH 19/74] Bring back prettierrc as before --- .prettierrc.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.prettierrc.js b/.prettierrc.js index 2b54074..3f714ac 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,7 +1,4 @@ module.exports = { - arrowParens: 'avoid', - bracketSameLine: true, - bracketSpacing: false, singleQuote: true, - trailingComma: 'all', -}; + semi: false, +} From e69ca933828fbb1907d028b3b880f26d23515c30 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 22 Feb 2024 13:29:16 +0000 Subject: [PATCH 20/74] Remove idle code --- components/settings/customization/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index e2f4f9e..c2fc692 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -200,7 +200,6 @@ const Settings = () => { }} text={SYMPTOMS[2]} value={isMucusTrackingCategoryEnabled} - trackColor={{ true: Colors.turquoiseDark }} /> { }} text={SYMPTOMS[3]} value={isCervixTrackingCategoryEnabled} - trackColor={{ true: Colors.turquoiseDark }} /> Date: Fri, 23 Feb 2024 12:16:32 +0100 Subject: [PATCH 21/74] fix saving of secondary symptom --- components/settings/customization/index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index c2fc692..a0ee520 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -82,15 +82,12 @@ const Settings = () => { setTemperatureTrackingCategory(value) saveTemperatureTrackingCategory(value) } - const mucusTrackingCategoryToggle = (value) => { manageSecondarySymptom(cervixTrackingCategoryObservable.value, value) } - const cervixTrackingCategoryToggle = (value) => { manageSecondarySymptom(value, mucusTrackingCategoryObservable.value) } - const sexTrackingCategoryToggle = (value) => { setSexTrackingCategory(value) saveSexTrackingCategory(value) @@ -119,7 +116,6 @@ const Settings = () => { ? labels.periodPrediction.on : labels.periodPrediction.off - // used to be onCervixToggle const secondarySymptomButtons = [ { label: labels.secondarySymptom.mucus, @@ -146,15 +142,16 @@ const Settings = () => { ) }, []) - // shoutUseCervix changed to 0/1 instead of false/true const manageSecondarySymptom = (cervix, mucus) => { if (!cervix && mucus) { setUseCervixAsSecondarySymptom(0) + saveUseCervixAsSecondarySymptom(0) setIsSecondarySymptomDisabled(false) } else if (cervix && mucus) { setIsSecondarySymptomDisabled(false) } else if (cervix && !mucus) { setUseCervixAsSecondarySymptom(1) + saveUseCervixAsSecondarySymptom(1) setIsSecondarySymptomDisabled(false) } else if (!cervix && !mucus) { setIsSecondarySymptomDisabled(true) @@ -163,7 +160,6 @@ const Settings = () => { saveMucusTrackingCategory(mucus) setCervixTrackingCategory(cervix) saveCervixTrackingCategory(cervix) - saveUseCervixAsSecondarySymptom(useCervixAsSecondarySymptom) } const secondarySymptomDisabledPrompt = () => { From 092b5573964b177e049520dc521faf79e08122ec Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Fri, 23 Feb 2024 12:39:31 +0100 Subject: [PATCH 22/74] make second symptom buttons show alert if switched off --- components/settings/customization/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index a0ee520..4f202de 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -131,6 +131,8 @@ const Settings = () => { if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { setUseCervixAsSecondarySymptom(value) saveUseCervixAsSecondarySymptom(value) + } else { + secondarySymptomDisabledPrompt() } } From e395730d981e7ce9ebdc3c2aaddccbfd284620e9 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 14 Feb 2024 17:48:50 +0100 Subject: [PATCH 23/74] First step for fertilityTracking Toggle --- components/settings/customization/index.js | 25 ++++++++++++++++------ i18n/en/settings.js | 5 +++++ local-storage.js | 8 +++++++ 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 4f202de..bd20433 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -10,6 +10,7 @@ import SelectTabGroup from '../../cycle-day/select-tab-group' import { desireTrackingCategoryObservable, + fertilityTrackingObservable, moodTrackingCategoryObservable, noteTrackingCategoryObservable, painTrackingCategoryObservable, @@ -18,6 +19,7 @@ import { mucusTrackingCategoryObservable, cervixTrackingCategoryObservable, saveDesireTrackingCategory, + saveFertilityTrackingEnabled, saveMoodTrackingCategory, saveNoteTrackingCategory, savePainTrackingCategory, @@ -75,8 +77,13 @@ const Settings = () => { const [isSecondarySymptomDisabled, setIsSecondarySymptomDisabled] = useState(false) - const [isEnabled, setIsEnabled] = useState(false) - const toggleSwitch = () => setIsEnabled((previousState) => !previousState) + const [isFertilityTrackingEnabled, setFertilityTrackingEnabled] = useState( + fertilityTrackingObservable.value + ) + const fertilityTrackingToggle = (value) => { + setFertilityTrackingEnabled(value) + saveFertilityTrackingEnabled(value) + } const temperatureTrackingCategoryToggle = (value) => { setTemperatureTrackingCategory(value) @@ -112,6 +119,11 @@ const Settings = () => { setPeriodPrediction(value) savePeriodPrediction(value) } + + const fertilityTrackingText = isFertilityTrackingEnabled + ? labels.fertilityTracking.on + : labels.fertilityTracking.off + const periodPredictionText = isPeriodPredictionEnabled ? labels.periodPrediction.on : labels.periodPrediction.off @@ -234,12 +246,11 @@ const Settings = () => { value={isNoteTrackingCategoryEnabled} /> - - + diff --git a/i18n/en/settings.js b/i18n/en/settings.js index bf26203..eec5ea8 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -66,6 +66,11 @@ export default { 'To use the period reminder please first enable period predictions in the customization settings.', }, }, + fertilityTracking: { + title: 'Fertility phases calculation', + on: 'The quick brown fox jumps over the lazy dog', + off: 'No no', + }, secondarySymptom: { title: 'Secondary symptom', cervixModeOn: diff --git a/local-storage.js b/local-storage.js index 84b680d..7f2de93 100644 --- a/local-storage.js +++ b/local-storage.js @@ -170,6 +170,14 @@ export async function saveNoteTrackingCategory(bool) { noteTrackingCategoryObservable.set(bool) } +export const fertilityTrackingObservable = Observable() +setObvWithInitValue('fertilityTracking', fertilityTrackingObservable, true) + +export async function saveFertilityTrackingEnabled(bool) { + await AsyncStorage.setItem('fertilityTracking', JSON.stringify(bool)) + fertilityTrackingObservable.set(bool) +} + async function setObvWithInitValue(key, obv, defaultValue) { const result = await AsyncStorage.getItem(key) let value From faad51f4f191ae627cbdbc8b15f9adbaf4a8ace3 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 14 Feb 2024 17:49:16 +0100 Subject: [PATCH 24/74] Check for FertilityTrackingEnabled on home --- components/Home.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/Home.js b/components/Home.js index 783d8c4..af02576 100644 --- a/components/Home.js +++ b/components/Home.js @@ -14,7 +14,10 @@ import { determinePredictionText, formatWithOrdinalSuffix, } from './helpers/home' -import { periodPredictionObservable } from '../local-storage' +import { + fertilityTrackingObservable, + periodPredictionObservable, +} from '../local-storage' import { Colors, Fonts, Sizes, Spacing } from '../styles' import { LocalDate } from '@js-joda/core' @@ -28,11 +31,12 @@ const Home = ({ navigate, setDate }) => { navigate('CycleDay') } + const isFertilityTrackingEnabled = fertilityTrackingObservable.value const todayDateString = LocalDate.now().toString() const { getCycleDayNumber, getPredictedMenses } = cycleModule() const cycleDayNumber = getCycleDayNumber(todayDateString) const { status, phase, statusText } = - getFertilityStatusForDay(todayDateString) + isFertilityTrackingEnabled && getFertilityStatusForDay(todayDateString) const isPeriodPredictionEnabled = periodPredictionObservable.value const prediction = determinePredictionText(getPredictedMenses(), t) @@ -55,7 +59,7 @@ const Home = ({ navigate, setDate }) => { )} - {phase && ( + {isFertilityTrackingEnabled && phase && ( {formatWithOrdinalSuffix(phase)} From 31888c3331518a1ad54dd7b7f568eaa2104bd6e3 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 14 Feb 2024 17:49:34 +0100 Subject: [PATCH 25/74] Check for FertilityTrackingEnabled on chart --- components/helpers/chart.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/helpers/chart.js b/components/helpers/chart.js index ba25223..245123f 100644 --- a/components/helpers/chart.js +++ b/components/helpers/chart.js @@ -1,6 +1,10 @@ import { LocalDate } from '@js-joda/core' -import { scaleObservable, unitObservable } from '../../local-storage' +import { + fertilityTrackingObservable, + scaleObservable, + unitObservable, +} from '../../local-storage' import { getCycleStatusForDay } from '../../lib/sympto-adapter' import { getCycleDay, getAmountOfCycleDays } from '../../db' @@ -270,7 +274,8 @@ export function nfpLines() { if (dateString < cycle.startDate) updateCurrentCycle(dateString) if (cycle.noMoreCycles) return ret - const tempShift = cycle.status.temperatureShift + const tempShift = + fertilityTrackingObservable.value && cycle.status.temperatureShift if (tempShift) { if (tempShift.firstHighMeasurementDay.date === dateString) { From c037c630d392f6b8541917f3b7457ce0e284a5c6 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 22 Feb 2024 16:40:28 +0100 Subject: [PATCH 26/74] Check for FertilityTrackingEnabled in sympto-adapter --- lib/sympto-adapter.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/sympto-adapter.js b/lib/sympto-adapter.js index ef3b8fb..44e3d18 100644 --- a/lib/sympto-adapter.js +++ b/lib/sympto-adapter.js @@ -1,9 +1,15 @@ import getFertilityStatus from 'sympto' import cycleModule from './cycle' -import { useCervixAsSecondarySymptomObservable } from '../local-storage' +import { fertilityTrackingObservable, useCervixAsSecondarySymptomObservable } from '../local-storage' import { fertilityStatus as labels } from '../i18n/en/labels' +const isFertilityTrackingEnabled = fertilityTrackingObservable.value + export function getFertilityStatusForDay(dateString) { + if (!isFertilityTrackingEnabled) { + return + } + const status = getCycleStatusForDay(dateString) if (!status) return { status: labels.fertile, @@ -34,6 +40,10 @@ export function getFertilityStatusForDay(dateString) { } export function getCycleStatusForDay(dateString, opts = {}) { + if (!isFertilityTrackingEnabled) { + return + } + const { getCycleForDay, getCyclesBefore, From 29c3b9b10885cea154d4771b0ec74130e367a9b7 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 23 Feb 2024 13:12:27 +0100 Subject: [PATCH 27/74] Disable fertility tracking switch depending on temp, mucus or cervix --- components/settings/customization/index.js | 27 ++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index bd20433..6fd93df 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -246,13 +246,26 @@ const Settings = () => { value={isNoteTrackingCategoryEnabled} /> - - - + + + + {isTemperatureTrackingCategoryEnabled && + isMucusTrackingCategoryEnabled || + isCervixTrackingCategoryEnabled ? + ( + <> + + + ) : + ( + {labels.disabled.message} + )} + + From d0d691c6afa0f1f774342e61ea991fa77e508781 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 23 Feb 2024 13:13:12 +0100 Subject: [PATCH 28/74] Turn fertility tracking off when temperature tracking is off --- local-storage.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/local-storage.js b/local-storage.js index 7f2de93..3647683 100644 --- a/local-storage.js +++ b/local-storage.js @@ -107,8 +107,15 @@ export async function saveTemperatureTrackingCategory(bool) { temperatureTrackingCategoryObservable.set(bool) if (!temperatureTrackingCategoryObservable.value) { - const result = await AsyncStorage.getItem('tempReminder') - if (JSON.parse(result).enabled) { + // if temperature tracking is turned off, the fertility tracking gets disabled + const fertilityTrackingResult = await AsyncStorage.getItem('fertilityTracking') + if (fertilityTrackingResult) { + saveFertilityTrackingEnabled(false) + } + + // if temperature tracking is turned off, the temperature reminder gets disabled + const tempReminderResult = await AsyncStorage.getItem('tempReminder') + if (JSON.parse(tempReminderResult).enabled) { tempReminderObservable.set(false) } } From 3c0ea9b208a5b6b4532fae2b990fd87ee802bb8c Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 23 Feb 2024 13:13:46 +0100 Subject: [PATCH 29/74] Turn fertility tracking off when mucus and cervix tracking are off --- local-storage.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/local-storage.js b/local-storage.js index 3647683..1c1759e 100644 --- a/local-storage.js +++ b/local-storage.js @@ -127,6 +127,14 @@ setObvWithInitValue('mucus', mucusTrackingCategoryObservable, true) export async function saveMucusTrackingCategory(bool) { await AsyncStorage.setItem('mucus', JSON.stringify(bool)) mucusTrackingCategoryObservable.set(bool) + + // if mucus and cervix tracking is turned off, the fertility tracking gets disabled + if (!mucusTrackingCategoryObservable.value && !cervixTrackingCategoryObservable.value) { + const fertilityTrackingResult = await AsyncStorage.getItem('fertilityTracking') + if (fertilityTrackingResult) { + saveFertilityTrackingEnabled(false) + } + } } export const cervixTrackingCategoryObservable = Observable() @@ -135,6 +143,14 @@ setObvWithInitValue('cervix', cervixTrackingCategoryObservable, true) export async function saveCervixTrackingCategory(bool) { await AsyncStorage.setItem('cervix', JSON.stringify(bool)) cervixTrackingCategoryObservable.set(bool) + + // if cervix and mucus tracking is turned off, the fertility tracking gets disabled + if (!cervixTrackingCategoryObservable.value && !mucusTrackingCategoryObservable.value) { + const fertilityTrackingResult = await AsyncStorage.getItem('fertilityTracking') + if (fertilityTrackingResult) { + saveFertilityTrackingEnabled(false) + } + } } export const sexTrackingCategoryObservable = Observable() From 8150b791edc8fae0cca18da552d552730e0aba3b Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 23 Feb 2024 13:14:21 +0100 Subject: [PATCH 30/74] Only check if fertility tracking enabled for display of secondary Symptom --- components/settings/customization/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 6fd93df..1782104 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -284,8 +284,7 @@ const Settings = () => { {/* used to be switch for onCervixToggle */} - {!isTemperatureTrackingCategoryEnabled || - isSecondarySymptomDisabled ? ( + {!isFertilityTrackingEnabled ? ( {labels.secondarySymptom.disabled.message} ) : ( <> From 27bb25e6da4082cb49c6ecbae960488b83474149 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 23 Feb 2024 13:22:56 +0100 Subject: [PATCH 31/74] Add check for if tempReminder is null --- local-storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-storage.js b/local-storage.js index 1c1759e..2081547 100644 --- a/local-storage.js +++ b/local-storage.js @@ -115,7 +115,7 @@ export async function saveTemperatureTrackingCategory(bool) { // if temperature tracking is turned off, the temperature reminder gets disabled const tempReminderResult = await AsyncStorage.getItem('tempReminder') - if (JSON.parse(tempReminderResult).enabled) { + if (tempReminderResult && JSON.parse(tempReminderResult).enabled) { tempReminderObservable.set(false) } } From 5855ea0a348df47338066ce3c03c1a1806f63f30 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 23 Feb 2024 16:38:11 +0100 Subject: [PATCH 32/74] Move temp off turns fertility off logic out of local storage --- components/settings/customization/index.js | 4 ++++ local-storage.js | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 1782104..a941e64 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -88,6 +88,10 @@ const Settings = () => { const temperatureTrackingCategoryToggle = (value) => { setTemperatureTrackingCategory(value) saveTemperatureTrackingCategory(value) + if (!value) { + setFertilityTrackingEnabled(false) + saveFertilityTrackingEnabled(false) + } } const mucusTrackingCategoryToggle = (value) => { manageSecondarySymptom(cervixTrackingCategoryObservable.value, value) diff --git a/local-storage.js b/local-storage.js index 2081547..b7ad678 100644 --- a/local-storage.js +++ b/local-storage.js @@ -107,12 +107,6 @@ export async function saveTemperatureTrackingCategory(bool) { temperatureTrackingCategoryObservable.set(bool) if (!temperatureTrackingCategoryObservable.value) { - // if temperature tracking is turned off, the fertility tracking gets disabled - const fertilityTrackingResult = await AsyncStorage.getItem('fertilityTracking') - if (fertilityTrackingResult) { - saveFertilityTrackingEnabled(false) - } - // if temperature tracking is turned off, the temperature reminder gets disabled const tempReminderResult = await AsyncStorage.getItem('tempReminder') if (tempReminderResult && JSON.parse(tempReminderResult).enabled) { From 1c7350947361f76b00fd2e87d633fedd7d36d893 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 23 Feb 2024 16:38:44 +0100 Subject: [PATCH 33/74] Move cervix & mucus off turn fertility off logic out of local storage --- components/settings/customization/index.js | 2 ++ local-storage.js | 16 ---------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index a941e64..5a0caf8 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -173,6 +173,8 @@ const Settings = () => { setIsSecondarySymptomDisabled(false) } else if (!cervix && !mucus) { setIsSecondarySymptomDisabled(true) + setFertilityTrackingEnabled(false) + saveFertilityTrackingEnabled(false) } setMucusTrackingCategory(mucus) saveMucusTrackingCategory(mucus) diff --git a/local-storage.js b/local-storage.js index b7ad678..66ce305 100644 --- a/local-storage.js +++ b/local-storage.js @@ -121,14 +121,6 @@ setObvWithInitValue('mucus', mucusTrackingCategoryObservable, true) export async function saveMucusTrackingCategory(bool) { await AsyncStorage.setItem('mucus', JSON.stringify(bool)) mucusTrackingCategoryObservable.set(bool) - - // if mucus and cervix tracking is turned off, the fertility tracking gets disabled - if (!mucusTrackingCategoryObservable.value && !cervixTrackingCategoryObservable.value) { - const fertilityTrackingResult = await AsyncStorage.getItem('fertilityTracking') - if (fertilityTrackingResult) { - saveFertilityTrackingEnabled(false) - } - } } export const cervixTrackingCategoryObservable = Observable() @@ -137,14 +129,6 @@ setObvWithInitValue('cervix', cervixTrackingCategoryObservable, true) export async function saveCervixTrackingCategory(bool) { await AsyncStorage.setItem('cervix', JSON.stringify(bool)) cervixTrackingCategoryObservable.set(bool) - - // if cervix and mucus tracking is turned off, the fertility tracking gets disabled - if (!cervixTrackingCategoryObservable.value && !mucusTrackingCategoryObservable.value) { - const fertilityTrackingResult = await AsyncStorage.getItem('fertilityTracking') - if (fertilityTrackingResult) { - saveFertilityTrackingEnabled(false) - } - } } export const sexTrackingCategoryObservable = Observable() From 405e27bdbe136639fd19bc6ade21fa614e11e3c9 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 23 Feb 2024 16:50:30 +0100 Subject: [PATCH 34/74] Remove isSecondarySymptomDisabled; because maybe we don't need it anymore with fertilityTracking taking its job --- components/settings/customization/index.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 5a0caf8..e292e16 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -74,9 +74,6 @@ const Settings = () => { noteTrackingCategoryObservable.value ) - const [isSecondarySymptomDisabled, setIsSecondarySymptomDisabled] = - useState(false) - const [isFertilityTrackingEnabled, setFertilityTrackingEnabled] = useState( fertilityTrackingObservable.value ) @@ -164,15 +161,11 @@ const Settings = () => { if (!cervix && mucus) { setUseCervixAsSecondarySymptom(0) saveUseCervixAsSecondarySymptom(0) - setIsSecondarySymptomDisabled(false) } else if (cervix && mucus) { - setIsSecondarySymptomDisabled(false) } else if (cervix && !mucus) { setUseCervixAsSecondarySymptom(1) saveUseCervixAsSecondarySymptom(1) - setIsSecondarySymptomDisabled(false) } else if (!cervix && !mucus) { - setIsSecondarySymptomDisabled(true) setFertilityTrackingEnabled(false) saveFertilityTrackingEnabled(false) } From 37152b3fec4d20948ed91042460d9d4ed9fadcfe Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Fri, 23 Feb 2024 15:34:09 +0100 Subject: [PATCH 35/74] small changes in styling. more space beween switch lines, smaller switches in iOS (testing please), less bottom margin for segments --- components/common/app-switch.js | 7 ++++++- styles/containers.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/common/app-switch.js b/components/common/app-switch.js index d45758f..5e74bb5 100644 --- a/components/common/app-switch.js +++ b/components/common/app-switch.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types' import AppText from './app-text' -import { Colors, Containers } from '../../styles' +import { Colors, Containers, Spacing } from '../../styles' const AppSwitch = ({ onToggle, text, value, disabled }) => { const trackColor = { true: Colors.turquoiseDark } @@ -37,6 +37,11 @@ const styles = StyleSheet.create({ }, switch: { flex: 1, + marginBottom: Spacing.tiny, + transform: + Platform.OS === 'ios' + ? [{ scaleX: 0.8 }, { scaleY: 0.8 }] + : [{ scaleX: 1 }, { scaleY: 1 }], }, textContainer: { flex: 4, diff --git a/styles/containers.js b/styles/containers.js index 8560d10..c169fec 100644 --- a/styles/containers.js +++ b/styles/containers.js @@ -36,6 +36,6 @@ export default { }, segmentContainer: { marginHorizontal: Spacing.base, - marginBottom: Spacing.base, + marginBottom: Spacing.tiny, }, } From 4fc11d2f7e25ab18f6338c0ab5e83c3d7b5e3754 Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Mon, 26 Feb 2024 13:28:43 +0100 Subject: [PATCH 36/74] changes in customization texts and small changes to styling --- components/common/app-switch.js | 2 +- components/settings/customization/index.js | 26 ++++++++++------------ i18n/en/settings.js | 14 +++++++----- styles/containers.js | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/components/common/app-switch.js b/components/common/app-switch.js index 5e74bb5..78ab610 100644 --- a/components/common/app-switch.js +++ b/components/common/app-switch.js @@ -34,10 +34,10 @@ AppSwitch.propTypes = { const styles = StyleSheet.create({ container: { ...Containers.rowContainer, + marginTop: Spacing.tiny, }, switch: { flex: 1, - marginBottom: Spacing.tiny, transform: Platform.OS === 'ios' ? [{ scaleX: 0.8 }, { scaleY: 0.8 }] diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index e292e16..fffcd7d 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -246,23 +246,21 @@ const Settings = () => { /> - {isTemperatureTrackingCategoryEnabled && - isMucusTrackingCategoryEnabled || - isCervixTrackingCategoryEnabled ? - ( - <> - - - ) : - ( + (isMucusTrackingCategoryEnabled || + isCervixTrackingCategoryEnabled) ? ( + <> + {labels.fertilityTracking.message} + + + ) : ( {labels.disabled.message} - )} + )} diff --git a/i18n/en/settings.js b/i18n/en/settings.js index eec5ea8..5a7a2e0 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -41,7 +41,7 @@ export default { disabled: { title: 'This feature is turned off', message: - 'Please first enable the temperature tracking category in the customization settings.', + 'To use the temperature scale please first enable the temperature tracking category above.', }, tempReminder: { title: 'Temperature reminder', @@ -68,8 +68,10 @@ export default { }, fertilityTracking: { title: 'Fertility phases calculation', - on: 'The quick brown fox jumps over the lazy dog', - off: 'No no', + message: + 'If you enter menstrual bleeding, temperature and cervical mucus or cervix data according to the sympto-thermal rules, drip will calculate cycle phases with the provided data.', + on: 'If you switch this off, drip will not show fertility related information.', + off: 'If you switch this on, drip will show fertility related information.', }, secondarySymptom: { title: 'Secondary symptom', @@ -80,16 +82,16 @@ export default { disabled: { title: 'Disabled', message: - 'To set a secondary symptom please first enable the temperature, cervical mucus or cervix tracking category as well as the fertility feature in the customization settings.', + 'To set a secondary symptom please first enable the temperature, cervical mucus or cervix tracking category as well as the fertility feature above.', noSecondaryEnabled: - 'To switch the secondary symptom both cervical mucus an cervix need to be enabled in the customization settings.', + 'To switch the secondary symptom both cervical mucus and cervix need to be enabled above.', }, mucus: 'cervical mucus', cervix: 'cervix', }, periodPrediction: { title: 'Period predictions', - on: 'drip predicts your 3 next menstrual bleedings based on the statistics of your previously tracked cycles, min 3 complete cycles.', + on: 'drip predicts your 3 next menstrual bleedings based on statistics if you previously tracked at least 3 complete cycles.', off: 'There are no predictions for menstrual cycles displayed. If turned on the calendar and the home screen will display period predictions.', }, passwordSettings: { diff --git a/styles/containers.js b/styles/containers.js index c169fec..8560d10 100644 --- a/styles/containers.js +++ b/styles/containers.js @@ -36,6 +36,6 @@ export default { }, segmentContainer: { marginHorizontal: Spacing.base, - marginBottom: Spacing.tiny, + marginBottom: Spacing.base, }, } From ef4095d61c96672b5237f70893328f8e6cc2aeac Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Mon, 26 Feb 2024 15:28:11 +0100 Subject: [PATCH 37/74] fixing issue import and empty statement --- components/common/app-switch.js | 2 +- components/settings/customization/index.js | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/components/common/app-switch.js b/components/common/app-switch.js index 78ab610..dfa8dfe 100644 --- a/components/common/app-switch.js +++ b/components/common/app-switch.js @@ -1,5 +1,5 @@ import React from 'react' -import { StyleSheet, Switch, View } from 'react-native' +import { Platform, StyleSheet, Switch, View } from 'react-native' import PropTypes from 'prop-types' import AppText from './app-text' diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index fffcd7d..607a4e6 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -161,7 +161,6 @@ const Settings = () => { if (!cervix && mucus) { setUseCervixAsSecondarySymptom(0) saveUseCervixAsSecondarySymptom(0) - } else if (cervix && mucus) { } else if (cervix && !mucus) { setUseCervixAsSecondarySymptom(1) saveUseCervixAsSecondarySymptom(1) @@ -202,7 +201,6 @@ const Settings = () => { text={SYMPTOMS[1]} value={isTemperatureTrackingCategoryEnabled} /> - { mucusTrackingCategoryToggle(enabled) @@ -210,7 +208,6 @@ const Settings = () => { text={SYMPTOMS[2]} value={isMucusTrackingCategoryEnabled} /> - { cervixTrackingCategoryToggle(enabled) @@ -218,7 +215,6 @@ const Settings = () => { text={SYMPTOMS[3]} value={isCervixTrackingCategoryEnabled} /> - { - {/* used to be switch for onCervixToggle */} {!isFertilityTrackingEnabled ? ( From 72823ef95c736a3acaca76378933d956048d0b7f Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 26 Feb 2024 17:17:27 +0100 Subject: [PATCH 38/74] Generalize title of symptom labels --- components/cycle-day/symptom-box.js | 2 +- i18n/en.json | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/components/cycle-day/symptom-box.js b/components/cycle-day/symptom-box.js index f9fcd0c..1d78f02 100644 --- a/components/cycle-day/symptom-box.js +++ b/components/cycle-day/symptom-box.js @@ -20,7 +20,7 @@ const SymptomBox = ({ editedSymptom, setEditedSymptom, }) => { - const { t } = useTranslation(null, { keyPrefix: 'cycleDay.symptomBox' }) + const { t } = useTranslation(null, { keyPrefix: 'symptoms' }) const isSymptomEdited = editedSymptom === symptom const isSymptomDisabled = isDateInFuture(date) && symptom !== 'note' const isExcluded = symptomData !== null ? symptomData.exclude : false diff --git a/i18n/en.json b/i18n/en.json index 436ca79..6467b64 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -7,18 +7,16 @@ "chart": { "tutorial": "You can swipe the chart to view more dates." }, - "cycleDay": { - "symptomBox": { - "bleeding": "bleeding", - "temperature": "temperature", - "mucus": "cervical mucus", - "cervix": "cervix", - "note": "note", - "desire": "desire", - "sex": "sex", - "pain": "pain", - "mood": "mood" - } + "symptoms": { + "bleeding": "bleeding", + "temperature": "temperature", + "mucus": "cervical mucus", + "cervix": "cervix", + "note": "note", + "desire": "desire", + "sex": "sex", + "pain": "pain", + "mood": "mood" }, "labels": { "bleedingPrediction": { From 8a65c081a8d09f830d911cf8af8a104c5832ba7b Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 26 Feb 2024 17:17:49 +0100 Subject: [PATCH 39/74] Use translation for customization tracking categories --- components/settings/customization/index.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 607a4e6..f57dc4a 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react' import { Alert, Pressable } from 'react-native' +import { useTranslation } from 'react-i18next' import AppPage from '../../common/app-page' import AppSwitch from '../../common/app-switch' @@ -36,6 +37,8 @@ import labels from '../../../i18n/en/settings' import { SYMPTOMS } from '../../../config' const Settings = () => { + const { t } = useTranslation(null, { keyPrefix: 'symptoms' }) + const [useCervixAsSecondarySymptom, setUseCervixAsSecondarySymptom] = useState(useCervixAsSecondarySymptomObservable.value) @@ -198,46 +201,46 @@ const Settings = () => { { mucusTrackingCategoryToggle(enabled) }} - text={SYMPTOMS[2]} + text={t(SYMPTOMS[2])} value={isMucusTrackingCategoryEnabled} /> { cervixTrackingCategoryToggle(enabled) }} - text={SYMPTOMS[3]} + text={t(SYMPTOMS[3])} value={isCervixTrackingCategoryEnabled} /> From 9ec52b78cfeb77c4bc28b89d1bee9f3295a8459b Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 26 Feb 2024 16:51:29 +0000 Subject: [PATCH 40/74] Add comment for future TODO linking gitlab issue --- components/cycle-day/select-tab-group.js | 1 + 1 file changed, 1 insertion(+) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index 8c98f78..f2839d7 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -8,6 +8,7 @@ import { Colors, Containers } from '../../styles' import labels from '../../i18n/en/settings' export default function SelectTabGroup({ activeButton, buttons, onSelect }) { +// TODO https://gitlab.com/bloodyhealth/drip/-/issues/707 const oneTimeTransformIntoNumber = typeof activeButton === 'boolean' && Number(activeButton) const isSecondarySymptomSwitch = From 46a02560e82b48cf6d44e2a50cc615fe64138595 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 26 Feb 2024 18:23:04 +0100 Subject: [PATCH 41/74] Add title labels to customization --- components/settings/customization/index.js | 4 ++-- i18n/en/settings.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index f57dc4a..1d6cc3f 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -197,8 +197,8 @@ const Settings = () => { } return ( - - + + Date: Tue, 27 Feb 2024 18:10:11 +0100 Subject: [PATCH 42/74] revision of customization texts and refactoring behavior when disabled --- components/cycle-day/select-tab-group.js | 21 +++++- components/settings/customization/index.js | 83 ++++++++++++---------- i18n/en/settings.js | 10 +-- 3 files changed, 70 insertions(+), 44 deletions(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index f2839d7..22c0c88 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -7,12 +7,18 @@ import AppText from '../common/app-text' import { Colors, Containers } from '../../styles' import labels from '../../i18n/en/settings' -export default function SelectTabGroup({ activeButton, buttons, onSelect }) { -// TODO https://gitlab.com/bloodyhealth/drip/-/issues/707 +export default function SelectTabGroup({ + activeButton, + buttons, + onSelect, + disabled, +}) { + // TODO https://gitlab.com/bloodyhealth/drip/-/issues/707 const oneTimeTransformIntoNumber = typeof activeButton === 'boolean' && Number(activeButton) const isSecondarySymptomSwitch = buttons[0]['label'] === labels.secondarySymptom.mucus + return ( {buttons.map(({ label, value }, i) => { @@ -23,16 +29,18 @@ export default function SelectTabGroup({ activeButton, buttons, onSelect }) { isActive && styles.boxActive, isSecondarySymptomSwitch && styles.purpleBox, isSecondarySymptomSwitch && isActive && styles.activePurpleBox, + disabled && styles.inActiveBox, ] const textStyle = [ styles.text, isSecondarySymptomSwitch && styles.purpleText, isActive && styles.textActive, + disabled && styles.greyText, ] return ( onSelect(value)} + onPress={() => !disabled && onSelect(value)} key={i} style={boxStyle} > @@ -75,4 +83,11 @@ const styles = StyleSheet.create({ purpleText: { color: Colors.purple, }, + greyText: { + color: Colors.grey, + }, + inActiveBox: { + borderColor: Colors.grey, + backgroundColor: Colors.turquoiseLight, + }, }) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 1d6cc3f..5614bd4 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -143,6 +143,7 @@ const Settings = () => { }, ] + // NOTE: when disabled (!isFertilityTrackingEnabled) button press doesn't yet trigger alert const onSelectTab = (value) => { if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { setUseCervixAsSecondarySymptom(value) @@ -178,7 +179,14 @@ const Settings = () => { } const secondarySymptomDisabledPrompt = () => { - if (!isMucusTrackingCategoryEnabled == isCervixTrackingCategoryEnabled) { + if (!isFertilityTrackingEnabled) { + Alert.alert( + labels.secondarySymptom.disabled.title, + labels.secondarySymptom.disabled.message + ) + } else if ( + !isMucusTrackingCategoryEnabled == isCervixTrackingCategoryEnabled + ) { Alert.alert( labels.secondarySymptom.disabled.title, labels.secondarySymptom.disabled.noSecondaryEnabled @@ -186,6 +194,10 @@ const Settings = () => { } } + const manageFertilityFeature = + isTemperatureTrackingCategoryEnabled && + (isMucusTrackingCategoryEnabled || isCervixTrackingCategoryEnabled) + const cervixText = useCervixAsSecondarySymptom ? labels.secondarySymptom.cervixModeOn : labels.secondarySymptom.cervixModeOff @@ -196,6 +208,14 @@ const Settings = () => { } } + const fertilityDisabledPrompt = () => { + if (!isFertilityTrackingEnabled) { + Alert.alert(labels.disabled.title, labels.fertilityTracking.disabled) + } + } + + console.log('useCervixAsSecondarySymptom :>> ', useCervixAsSecondarySymptom) + return ( @@ -244,53 +264,42 @@ const Settings = () => { value={isNoteTrackingCategoryEnabled} /> - + - {isTemperatureTrackingCategoryEnabled && - (isMucusTrackingCategoryEnabled || - isCervixTrackingCategoryEnabled) ? ( - <> - {labels.fertilityTracking.message} - - - ) : ( - {labels.disabled.message} - )} + {labels.fertilityTracking.message} + + {/* NOTE: still needs to be greyed out and not moveable */} - {isTemperatureTrackingCategoryEnabled && ( - <> - {labels.tempScale.segmentExplainer} - - - )} - {!isTemperatureTrackingCategoryEnabled && ( - {labels.disabled.message} - )} + {/* {isTemperatureTrackingCategoryEnabled && ( + <> */} + {labels.tempScale.segmentExplainer} + + {/* + )} + {!isTemperatureTrackingCategoryEnabled && ( + {labels.disabled.message} + )} */} - {!isFertilityTrackingEnabled ? ( - {labels.secondarySymptom.disabled.message} - ) : ( - <> - {cervixText} - onSelectTab(value)} - /> - - )} + {cervixText} + onSelectTab(value)} + disabled={!isFertilityTrackingEnabled} + /> diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 6f4ae40..aec4513 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -36,7 +36,7 @@ export default { tempScale: { segmentTitle: 'Temperature scale', segmentExplainer: - 'Change the minimum and maximum value for the temperature chart', + 'Change the minimum and maximum value for the temperature chart.', min: 'Min', max: 'Max', loadError: 'Could not load saved temperature scale settings', @@ -72,6 +72,8 @@ export default { }, fertilityTracking: { title: 'Fertility phases calculation', + disabled: + 'To use this feature please enable temperature tracking and cervical mucus or cervix tracking.', message: 'If you enter menstrual bleeding, temperature and cervical mucus or cervix data according to the sympto-thermal rules, drip will calculate cycle phases with the provided data.', on: 'If you switch this off, drip will not show fertility related information.', @@ -80,13 +82,13 @@ export default { secondarySymptom: { title: 'Secondary symptom', cervixModeOn: - 'Cervix values are being used for symptothermal fertility detection. You can switch here to use cervical mucus values for symptothermal fertility detection', + 'Cervix values are being used for fertility detection according to the sympto-thermal rules.', cervixModeOff: - 'By default, cervical mucus values are being used for symptothermal fertility detection. You can switch here to use cervix values for symptothermal fertility detection', + 'Cervical mucus values are being used for fertility detection according to the sympto-thermal rules.', disabled: { title: 'Disabled', message: - 'To set a secondary symptom please first enable the temperature, cervical mucus or cervix tracking category as well as the fertility feature above.', + 'To set a secondary symptom please first enable the cervical mucus or cervix tracking category as well as temperature and fertility phases calculation above.', noSecondaryEnabled: 'To switch the secondary symptom both cervical mucus and cervix need to be enabled above.', }, From ffe8fab822333c3ee6935495a0413ec25543540e Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 28 Feb 2024 12:27:59 +0100 Subject: [PATCH 43/74] Add colored tracking icons to customization toggles --- components/common/tracking-category-switch.js | 63 +++++++++++++++++++ components/settings/customization/index.js | 25 +++++--- styles/colors.js | 6 +- 3 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 components/common/tracking-category-switch.js diff --git a/components/common/tracking-category-switch.js b/components/common/tracking-category-switch.js new file mode 100644 index 0000000..aef5824 --- /dev/null +++ b/components/common/tracking-category-switch.js @@ -0,0 +1,63 @@ +import React from 'react' +import { Platform, StyleSheet, Switch, View } from 'react-native' +import PropTypes from 'prop-types' + +import AppText from './app-text' + +import DripIcon from '../../assets/drip-icons' +import { Colors, Containers, Sizes, Spacing } from '../../styles' + +const TrackingCategorySwitch = ({ onToggle, symptom, text, value }) => { + const trackColor = { true: Colors.turquoiseDark } + const iconColor = value ? Colors.iconColors[symptom].color : Colors.grey + + return ( + + + + + + {text} + + + + ) +} + +TrackingCategorySwitch.propTypes = { + onToggle: PropTypes.func.isRequired, + symptom: PropTypes.string, + text: PropTypes.string, + value: PropTypes.bool, +} + +const styles = StyleSheet.create({ + container: { + ...Containers.rowContainer, + marginVertical: Spacing.tiny, + }, + iconContainer: { + marginRight: Spacing.tiny, + flex: 1, + }, + textContainer: { + flex: 5, + }, + appSwitch: { + flex: 2, + transform: + Platform.OS === 'ios' + ? [{ scaleX: 0.8 }, { scaleY: 0.8 }] + : [{ scaleX: 1 }, { scaleY: 1 }], + }, +}) +export default TrackingCategorySwitch diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 1d6cc3f..6b236a5 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -7,6 +7,7 @@ import AppSwitch from '../../common/app-switch' import AppText from '../../common/app-text' import TemperatureSlider from './temperature-slider' import Segment from '../../common/segment' +import TrackingCategorySwitch from '../../common/tracking-category-switch' import SelectTabGroup from '../../cycle-day/select-tab-group' import { @@ -199,49 +200,57 @@ const Settings = () => { return ( - - { mucusTrackingCategoryToggle(enabled) }} text={t(SYMPTOMS[2])} value={isMucusTrackingCategoryEnabled} + symptom={SYMPTOMS[2]} /> - { cervixTrackingCategoryToggle(enabled) }} text={t(SYMPTOMS[3])} value={isCervixTrackingCategoryEnabled} + symptom={SYMPTOMS[3]} /> - - - - - diff --git a/styles/colors.js b/styles/colors.js index f091d02..7baf8cd 100644 --- a/styles/colors.js +++ b/styles/colors.js @@ -18,6 +18,7 @@ const shadesOfPink = ['#c485a6', '#b15c89', pinkColor] // light to dark const lightGreenColor = '#bccd67' const orangeColor = '#bc6642' const mintColor = '#6ca299' +const turquoiseDark = '#69CBC1' export default { greyDark: '#555', @@ -27,7 +28,7 @@ export default { orange: '#F38337', purple: '#3A2671', purpleLight: '#938EB2', - turquoiseDark: '#69CBC1', + turquoiseDark: turquoiseDark, turquoise: '#CFECEA', turquoiseLight: '#E9F2ED', iconColors: { @@ -35,6 +36,9 @@ export default { color: redColor, shades: shadesOfRed, }, + temperature: { + color: turquoiseDark, + }, mucus: { color: violetColor, shades: shadesOfViolet, From ad47b4bee092a0e330312df5ed6bcc60c1e44203 Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Wed, 28 Feb 2024 13:06:25 +0100 Subject: [PATCH 44/74] enabling alert for disabled button in tab group --- components/cycle-day/select-tab-group.js | 16 ++++++++++++++-- components/settings/customization/index.js | 5 +++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index 22c0c88..3800fa4 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -1,6 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import { StyleSheet, TouchableOpacity, View } from 'react-native' +import { Alert, StyleSheet, TouchableOpacity, View } from 'react-native' import AppText from '../common/app-text' @@ -19,6 +19,16 @@ export default function SelectTabGroup({ const isSecondarySymptomSwitch = buttons[0]['label'] === labels.secondarySymptom.mucus + // Disable is only used for secondarySymptom in customization, if more come up maybe consider more tidy solution + const showDisableAlert = (label) => { + if (label === 'cervix' || 'mucus') { + Alert.alert( + labels.secondarySymptom.disabled.title, + labels.secondarySymptom.disabled.message + ) + } + } + return ( {buttons.map(({ label, value }, i) => { @@ -40,7 +50,9 @@ export default function SelectTabGroup({ return ( !disabled && onSelect(value)} + onPress={() => + !disabled ? onSelect(value) : showDisableAlert(label) + } key={i} style={boxStyle} > diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 5614bd4..9e06407 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -148,7 +148,12 @@ const Settings = () => { if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { setUseCervixAsSecondarySymptom(value) saveUseCervixAsSecondarySymptom(value) + console.log('show SecSymp value :>> ', value) + } else if (!isFertilityTrackingEnabled) { + console.log('2 show SecSymp value :>> ', value) + secondarySymptomDisabledPrompt() } else { + console.log('3 show SecSymp value :>> ', value) secondarySymptomDisabledPrompt() } } From 610383a1035a31886bd72f15e12e5ccd5fee7d83 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 28 Feb 2024 12:50:31 +0100 Subject: [PATCH 45/74] Unify the spelling of "sympto-thermal" --- CONTRIBUTING.md | 6 +++--- i18n/en/settings.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b03cccc..eedb19a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,9 +33,10 @@ We are an open source project and we highly appreciate contributions. At the sam - 🔮 open source - 🩸 feminist and gender inclusive - 🔒 secure: data entered stays with that person/on their device - - 🔬 science based: we implemented the symptothermal method - + - 🔬 science based: we implemented the sympto-thermal method + This means that we will never implement anything that contradicts these core values. Some examples: We will never build a cloud integration, we will never make an ovulation prediction. + - If you would like to make a sustainable contribution to the project, we would be happy to join the game. ### Reporting Bugs or Making Suggestions @@ -48,7 +49,6 @@ If you found a bug or have suggestions, please :one: first review the [list of e - If you want to open a merge request, yeah :tada: exciting! We are using a template for merge requests to make sure we explain what we have done and why. - Keep in mind that people who will review your merge request are more motivated to do so when the merge request is well explained and ideally not too big. - ### Thank you ![](https://media.giphy.com/media/kPA88elN9kYco/giphy.gif) diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 6f4ae40..0e5f5a1 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -80,9 +80,9 @@ export default { secondarySymptom: { title: 'Secondary symptom', cervixModeOn: - 'Cervix values are being used for symptothermal fertility detection. You can switch here to use cervical mucus values for symptothermal fertility detection', + 'Cervix values are being used for sympto-thermal fertility detection. You can switch here to use cervical mucus values for sympto-thermal fertility detection', cervixModeOff: - 'By default, cervical mucus values are being used for symptothermal fertility detection. You can switch here to use cervix values for symptothermal fertility detection', + 'By default, cervical mucus values are being used for sympto-thermal fertility detection. You can switch here to use cervix values for sympto-thermal fertility detection', disabled: { title: 'Disabled', message: @@ -139,6 +139,6 @@ Making any changes to your password setting will keep your data as it was before }, preOvu: { title: 'Infertile days at cycle start', - note: `drip. applies the sympto-thermal method for calculating infertile days at the start of the cycle (see ${links.wiki.url} for more info). However, drip. does not currently apply the so called 20-day-rule, which determines infertile days at the cycle start from past cycle lengths in case no past symptothermal info is available.`, + note: `drip. applies the sympto-thermal method for calculating infertile days at the start of the cycle (see ${links.wiki.url} for more info). However, drip. does not currently apply the so called 20-day-rule, which determines infertile days at the cycle start from past cycle lengths in case no past sympto-thermal info is available.`, }, } From 24df5cea31a78e1869c08437064f93b403cf51d9 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 29 Feb 2024 10:35:22 +0000 Subject: [PATCH 46/74] Spell "science-based" --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eedb19a..cc1e829 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ We are an open source project and we highly appreciate contributions. At the sam - 🔮 open source - 🩸 feminist and gender inclusive - 🔒 secure: data entered stays with that person/on their device - - 🔬 science based: we implemented the sympto-thermal method + - 🔬 science-based: we implemented the sympto-thermal method This means that we will never implement anything that contradicts these core values. Some examples: We will never build a cloud integration, we will never make an ovulation prediction. From 3e8f15e04e74eeb18ea28e4ec6b107c3cb565a3a Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Thu, 29 Feb 2024 17:46:56 +0100 Subject: [PATCH 47/74] disable temperature slider when fertility or temperature turned off --- .../disabled-temperature-slider.js | 62 +++++++++++++++++++ components/settings/customization/index.js | 37 +++++------ i18n/en/settings.js | 9 ++- 3 files changed, 81 insertions(+), 27 deletions(-) create mode 100644 components/settings/customization/disabled-temperature-slider.js diff --git a/components/settings/customization/disabled-temperature-slider.js b/components/settings/customization/disabled-temperature-slider.js new file mode 100644 index 0000000..44e8147 --- /dev/null +++ b/components/settings/customization/disabled-temperature-slider.js @@ -0,0 +1,62 @@ +import React from 'react' +import { StyleSheet, View } from 'react-native' +import Slider from '@ptomasroos/react-native-multi-slider' + +import SliderLabel from './slider-label' + +import { scaleObservable } from '../../../local-storage' +import { Colors, Sizes } from '../../../styles' + +import { TEMP_MIN, TEMP_MAX, TEMP_SLIDER_STEP } from '../../../config' + +const DisabledTemperatureSlider = () => { + const savedValue = scaleObservable.value + const minTemperature = savedValue.min + const maxTemperature = savedValue.max + + return ( + + + + ) +} + +export default DisabledTemperatureSlider + +const styles = StyleSheet.create({ + container: { + alignItems: 'center', + paddingTop: Sizes.base, + }, + marker: { + backgroundColor: Colors.grey, + borderRadius: 50, + elevation: 4, + height: Sizes.subtitle, + width: Sizes.subtitle, + }, + slider: { + borderRadius: 25, + height: Sizes.small, + }, + sliderAccentBackground: { + backgroundColor: Colors.grey, + }, + sliderBackground: { + backgroundColor: Colors.greyLight, + }, +}) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 9e06407..f147a41 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -19,6 +19,8 @@ import { temperatureTrackingCategoryObservable, mucusTrackingCategoryObservable, cervixTrackingCategoryObservable, + periodPredictionObservable, + useCervixAsSecondarySymptomObservable, saveDesireTrackingCategory, saveFertilityTrackingEnabled, saveMoodTrackingCategory, @@ -30,11 +32,10 @@ import { saveSexTrackingCategory, saveTemperatureTrackingCategory, saveUseCervixAsSecondarySymptom, - periodPredictionObservable, - useCervixAsSecondarySymptomObservable, } from '../../../local-storage' import labels from '../../../i18n/en/settings' import { SYMPTOMS } from '../../../config' +import DisabledTemperatureSlider from './disabled-temperature-slider' const Settings = () => { const { t } = useTranslation(null, { keyPrefix: 'symptoms' }) @@ -143,17 +144,11 @@ const Settings = () => { }, ] - // NOTE: when disabled (!isFertilityTrackingEnabled) button press doesn't yet trigger alert const onSelectTab = (value) => { if (isMucusTrackingCategoryEnabled && isCervixTrackingCategoryEnabled) { setUseCervixAsSecondarySymptom(value) saveUseCervixAsSecondarySymptom(value) - console.log('show SecSymp value :>> ', value) - } else if (!isFertilityTrackingEnabled) { - console.log('2 show SecSymp value :>> ', value) - secondarySymptomDisabledPrompt() } else { - console.log('3 show SecSymp value :>> ', value) secondarySymptomDisabledPrompt() } } @@ -208,8 +203,8 @@ const Settings = () => { : labels.secondarySymptom.cervixModeOff const sliderDisabledPrompt = () => { - if (!isTemperatureTrackingCategoryEnabled) { - Alert.alert(labels.disabled.title, labels.disabled.message) + if (!isFertilityTrackingEnabled) { + Alert.alert(labels.tempScale.disabled, labels.tempScale.disabledMessage) } } @@ -219,8 +214,6 @@ const Settings = () => { } } - console.log('useCervixAsSecondarySymptom :>> ', useCervixAsSecondarySymptom) - return ( @@ -280,19 +273,19 @@ const Settings = () => { /> - - {/* NOTE: still needs to be greyed out and not moveable */} + {/* Not ideal to have a extra DisabledTemperatureSlider but right now hard to have always the correct state of fertilityTrackingObservable in TemperatureSlider */} - {/* {isTemperatureTrackingCategoryEnabled && ( - <> */} {labels.tempScale.segmentExplainer} - - {/* - )} - {!isTemperatureTrackingCategoryEnabled && ( - {labels.disabled.message} - )} */} + {isTemperatureTrackingCategoryEnabled & isFertilityTrackingEnabled ? ( + <> + + + ) : ( + <> + + + )} diff --git a/i18n/en/settings.js b/i18n/en/settings.js index aec4513..119f887 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -41,12 +41,11 @@ export default { max: 'Max', loadError: 'Could not load saved temperature scale settings', saveError: 'Could not save temperature scale settings', + disabled: 'Disabled', + disabledMessage: + 'To use the temperature scale please first enable both temperature tracking and fertility phase calculation above.', }, - disabled: { - title: 'This feature is turned off', - message: - 'To use the temperature scale please first enable the temperature tracking category above.', - }, + tempReminder: { title: 'Temperature reminder', noTimeSet: 'Set a time for a daily reminder to take your temperature', From b65b5f3561c89a1edb8a1cb90a35fc713279549a Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Thu, 7 Mar 2024 18:58:37 +0100 Subject: [PATCH 48/74] refactoring disable function of temperature slider --- components/cycle-day/select-tab-group.js | 3 +- .../disabled-temperature-slider.js | 62 ------------------- components/settings/customization/index.js | 23 +++---- .../customization/temperature-slider.js | 28 ++++++++- i18n/en/settings.js | 5 +- 5 files changed, 39 insertions(+), 82 deletions(-) delete mode 100644 components/settings/customization/disabled-temperature-slider.js diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index 3800fa4..9794561 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -21,7 +21,7 @@ export default function SelectTabGroup({ // Disable is only used for secondarySymptom in customization, if more come up maybe consider more tidy solution const showDisableAlert = (label) => { - if (label === 'cervix' || 'mucus') { + if (label === 'cervix' || label === 'mucus') { Alert.alert( labels.secondarySymptom.disabled.title, labels.secondarySymptom.disabled.message @@ -68,6 +68,7 @@ SelectTabGroup.propTypes = { activeButton: PropTypes.number, buttons: PropTypes.array.isRequired, onSelect: PropTypes.func.isRequired, + disabled: PropTypes.bool, } const styles = StyleSheet.create({ diff --git a/components/settings/customization/disabled-temperature-slider.js b/components/settings/customization/disabled-temperature-slider.js deleted file mode 100644 index 44e8147..0000000 --- a/components/settings/customization/disabled-temperature-slider.js +++ /dev/null @@ -1,62 +0,0 @@ -import React from 'react' -import { StyleSheet, View } from 'react-native' -import Slider from '@ptomasroos/react-native-multi-slider' - -import SliderLabel from './slider-label' - -import { scaleObservable } from '../../../local-storage' -import { Colors, Sizes } from '../../../styles' - -import { TEMP_MIN, TEMP_MAX, TEMP_SLIDER_STEP } from '../../../config' - -const DisabledTemperatureSlider = () => { - const savedValue = scaleObservable.value - const minTemperature = savedValue.min - const maxTemperature = savedValue.max - - return ( - - - - ) -} - -export default DisabledTemperatureSlider - -const styles = StyleSheet.create({ - container: { - alignItems: 'center', - paddingTop: Sizes.base, - }, - marker: { - backgroundColor: Colors.grey, - borderRadius: 50, - elevation: 4, - height: Sizes.subtitle, - width: Sizes.subtitle, - }, - slider: { - borderRadius: 25, - height: Sizes.small, - }, - sliderAccentBackground: { - backgroundColor: Colors.grey, - }, - sliderBackground: { - backgroundColor: Colors.greyLight, - }, -}) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index f147a41..ddb2db9 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -35,7 +35,6 @@ import { } from '../../../local-storage' import labels from '../../../i18n/en/settings' import { SYMPTOMS } from '../../../config' -import DisabledTemperatureSlider from './disabled-temperature-slider' const Settings = () => { const { t } = useTranslation(null, { keyPrefix: 'symptoms' }) @@ -81,6 +80,7 @@ const Settings = () => { const [isFertilityTrackingEnabled, setFertilityTrackingEnabled] = useState( fertilityTrackingObservable.value ) + const fertilityTrackingToggle = (value) => { setFertilityTrackingEnabled(value) saveFertilityTrackingEnabled(value) @@ -203,14 +203,17 @@ const Settings = () => { : labels.secondarySymptom.cervixModeOff const sliderDisabledPrompt = () => { - if (!isFertilityTrackingEnabled) { + if (!isTemperatureTrackingCategoryEnabled) { Alert.alert(labels.tempScale.disabled, labels.tempScale.disabledMessage) } } const fertilityDisabledPrompt = () => { - if (!isFertilityTrackingEnabled) { - Alert.alert(labels.disabled.title, labels.fertilityTracking.disabled) + if (!manageFertilityFeature) { + Alert.alert( + labels.fertilityTracking.disabledTitle, + labels.fertilityTracking.disabled + ) } } @@ -273,19 +276,11 @@ const Settings = () => { /> - {/* Not ideal to have a extra DisabledTemperatureSlider but right now hard to have always the correct state of fertilityTrackingObservable in TemperatureSlider */} + {labels.tempScale.segmentExplainer} - {isTemperatureTrackingCategoryEnabled & isFertilityTrackingEnabled ? ( - <> - - - ) : ( - <> - - - )} + diff --git a/components/settings/customization/temperature-slider.js b/components/settings/customization/temperature-slider.js index 2019d55..7d91f7a 100644 --- a/components/settings/customization/temperature-slider.js +++ b/components/settings/customization/temperature-slider.js @@ -1,5 +1,6 @@ import React, { useState } from 'react' import { StyleSheet, View } from 'react-native' +import PropTypes from 'prop-types' import Slider from '@ptomasroos/react-native-multi-slider' import alertError from '../common/alert-error' @@ -10,7 +11,7 @@ import { Colors, Sizes } from '../../../styles' import labels from '../../../i18n/en/settings' import { TEMP_MIN, TEMP_MAX, TEMP_SLIDER_STEP } from '../../../config' -const TemperatureSlider = () => { +const TemperatureSlider = ({ disabled }) => { const savedValue = scaleObservable.value const [minTemperature, setMinTemperature] = useState(savedValue.min) const [maxTemperature, setMaxTemperature] = useState(savedValue.max) @@ -25,6 +26,14 @@ const TemperatureSlider = () => { } } + const sliderAccentBackground = disabled + ? styles.disabledSliderAccentBackground + : styles.sliderAccentBackground + + const sliderBackground = disabled + ? styles.disabledSliderBackground + : styles.sliderBackground + return ( { max={TEMP_MAX} min={TEMP_MIN} onValuesChange={onTemperatureSliderChange} - selectedStyle={styles.sliderAccentBackground} step={TEMP_SLIDER_STEP} trackStyle={styles.slider} - unselectedStyle={styles.sliderBackground} values={[minTemperature, maxTemperature]} + enabledOne={!disabled} + enabledTwo={!disabled} + selectedStyle={sliderAccentBackground} + unselectedStyle={sliderBackground} /> ) @@ -47,6 +58,10 @@ const TemperatureSlider = () => { export default TemperatureSlider +TemperatureSlider.propTypes = { + disabled: PropTypes.bool, +} + const styles = StyleSheet.create({ container: { alignItems: 'center', @@ -54,6 +69,7 @@ const styles = StyleSheet.create({ }, marker: { backgroundColor: Colors.turquoiseDark, + borderRadius: 50, elevation: 4, height: Sizes.subtitle, @@ -66,7 +82,13 @@ const styles = StyleSheet.create({ sliderAccentBackground: { backgroundColor: Colors.turquoiseDark, }, + disabledSliderAccentBackground: { + backgroundColor: Colors.grey, + }, sliderBackground: { backgroundColor: Colors.turquoise, }, + disabledSliderBackground: { + backgroundColor: Colors.greyLight, + }, }) diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 119f887..fdd3a88 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -43,7 +43,7 @@ export default { saveError: 'Could not save temperature scale settings', disabled: 'Disabled', disabledMessage: - 'To use the temperature scale please first enable both temperature tracking and fertility phase calculation above.', + 'To use the temperature scale please first enable temperature tracking above.', }, tempReminder: { @@ -71,8 +71,9 @@ export default { }, fertilityTracking: { title: 'Fertility phases calculation', + disabledTitle: 'Disabled', disabled: - 'To use this feature please enable temperature tracking and cervical mucus or cervix tracking.', + 'To use fertility phases calculation please enable temperature tracking and cervical mucus or cervix tracking above.', message: 'If you enter menstrual bleeding, temperature and cervical mucus or cervix data according to the sympto-thermal rules, drip will calculate cycle phases with the provided data.', on: 'If you switch this off, drip will not show fertility related information.', From f5894c028e637f2b4ae22bd376e5b24e0f2adb1e Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 14 Mar 2024 10:54:18 +0000 Subject: [PATCH 49/74] renaming --- components/cycle-day/select-tab-group.js | 4 ++-- i18n/en/settings.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index 9794561..195c6e7 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -20,7 +20,7 @@ export default function SelectTabGroup({ buttons[0]['label'] === labels.secondarySymptom.mucus // Disable is only used for secondarySymptom in customization, if more come up maybe consider more tidy solution - const showDisableAlert = (label) => { + const showDisabledAlert = (label) => { if (label === 'cervix' || label === 'mucus') { Alert.alert( labels.secondarySymptom.disabled.title, @@ -51,7 +51,7 @@ export default function SelectTabGroup({ return ( - !disabled ? onSelect(value) : showDisableAlert(label) + !disabled ? onSelect(value) : showDisabledAlert(label) } key={i} style={boxStyle} diff --git a/i18n/en/settings.js b/i18n/en/settings.js index f20e024..5748d02 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -75,16 +75,16 @@ export default { disabled: 'To use fertility phases calculation please enable temperature tracking and cervical mucus or cervix tracking above.', message: - 'If you enter menstrual bleeding, temperature and cervical mucus or cervix data according to the sympto-thermal rules, drip will calculate cycle phases with the provided data.', + 'If you enter menstrual bleeding, temperature and cervical mucus or cervix data according to the sympto-thermal method, drip will calculate cycle phases with the provided data.', on: 'If you switch this off, drip will not show fertility related information.', off: 'If you switch this on, drip will show fertility related information.', }, secondarySymptom: { title: 'Secondary symptom', cervixModeOn: - 'Cervix values are being used for fertility detection according to the sympto-thermal rules.', + 'Cervix values are being used for fertility detection according to the sympto-thermal method.', cervixModeOff: - 'Cervical mucus values are being used for fertility detection according to the sympto-thermal rules.', + 'Cervical mucus values are being used for fertility detection according to the sympto-thermal method.', disabled: { title: 'Disabled', message: From eaf01e98d5f9ffd1251d4a55a8e0b001d95137f7 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 14 Mar 2024 10:58:56 +0000 Subject: [PATCH 50/74] renaming --- components/cycle-day/select-tab-group.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index 195c6e7..25db72a 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -39,7 +39,7 @@ export default function SelectTabGroup({ isActive && styles.boxActive, isSecondarySymptomSwitch && styles.purpleBox, isSecondarySymptomSwitch && isActive && styles.activePurpleBox, - disabled && styles.inActiveBox, + disabled && styles.disabledBox, ] const textStyle = [ styles.text, @@ -99,7 +99,7 @@ const styles = StyleSheet.create({ greyText: { color: Colors.grey, }, - inActiveBox: { + disabledBox: { borderColor: Colors.grey, backgroundColor: Colors.turquoiseLight, }, From a93a338e6e0e360f52e8a607aca878b9a6b6c4ec Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 14 Mar 2024 14:27:18 +0100 Subject: [PATCH 51/74] Improve wording for disabled alerts --- i18n/en/settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 5748d02..8d2181e 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -73,7 +73,7 @@ export default { title: 'Fertility phases calculation', disabledTitle: 'Disabled', disabled: - 'To use fertility phases calculation please enable temperature tracking and cervical mucus or cervix tracking above.', + 'To use fertility phases calculation please enable both temperature tracking and either cervical mucus or cervix tracking above.', message: 'If you enter menstrual bleeding, temperature and cervical mucus or cervix data according to the sympto-thermal method, drip will calculate cycle phases with the provided data.', on: 'If you switch this off, drip will not show fertility related information.', @@ -98,7 +98,7 @@ export default { periodPrediction: { title: 'Period predictions', on: 'drip predicts your 3 next menstrual bleedings based on statistics if you previously tracked at least 3 complete cycles.', - off: 'There are no predictions for menstrual cycles displayed. If turned on the calendar and the home screen will display period predictions.', + off: 'There are no predictions for menstrual cycles displayed. If turned on, the calendar and the home screen will display period predictions.', }, passwordSettings: { title: 'App password', From 0e7d84874c1d4cc88556150a4a364e927f64e5d4 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 14 Mar 2024 14:28:09 +0100 Subject: [PATCH 52/74] Add more padding to button if home is almost empty --- components/Home.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/Home.js b/components/Home.js index af02576..7baea96 100644 --- a/components/Home.js +++ b/components/Home.js @@ -76,6 +76,8 @@ const Home = ({ navigate, setDate }) => { {prediction} )} + + {!isFertilityTrackingEnabled && } @@ -114,6 +116,9 @@ const styles = StyleSheet.create({ color: 'white', fontSize: Sizes.subtitle, }, + largePadding: { + padding: Spacing.large, + }, }) Home.propTypes = { From fc4bc625ce1d5954853062e17d2cb0f0d0cf454b Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 14 Mar 2024 14:28:38 +0100 Subject: [PATCH 53/74] Add some info to home text elements --- components/Home.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/Home.js b/components/Home.js index 7baea96..4729f47 100644 --- a/components/Home.js +++ b/components/Home.js @@ -51,6 +51,7 @@ const Home = ({ navigate, setDate }) => { > {moment().format('MMM Do YYYY')} + {/* display if at least 1 bleeding day has been entered */} {cycleDayNumber && ( {cycleDayText} @@ -59,6 +60,8 @@ const Home = ({ navigate, setDate }) => { )} + + {/* display if fertility tracking enabled and if phase 1, 2 or 3 has been identified */} {isFertilityTrackingEnabled && phase && ( @@ -71,6 +74,7 @@ const Home = ({ navigate, setDate }) => { )} + {isPeriodPredictionEnabled && ( {prediction} From 693c766da8a1483fd65438a9a57a9bd0ef2e9fa2 Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Thu, 14 Mar 2024 18:02:15 +0100 Subject: [PATCH 54/74] fixing cervical mucus button also showing disabled alert --- components/cycle-day/select-tab-group.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index 25db72a..6805b66 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -21,7 +21,7 @@ export default function SelectTabGroup({ // Disable is only used for secondarySymptom in customization, if more come up maybe consider more tidy solution const showDisabledAlert = (label) => { - if (label === 'cervix' || label === 'mucus') { + if (label === 'cervix' || label === 'cervical mucus') { Alert.alert( labels.secondarySymptom.disabled.title, labels.secondarySymptom.disabled.message From e33c13e5e04807747aad60fb5ac56091a9452d9a Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 14 Mar 2024 18:36:57 +0100 Subject: [PATCH 55/74] Remove idle labels --- i18n/en/cycle-day.js | 86 +++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/i18n/en/cycle-day.js b/i18n/en/cycle-day.js index 1395f12..3505f56 100644 --- a/i18n/en/cycle-day.js +++ b/i18n/en/cycle-day.js @@ -4,70 +4,71 @@ export const intensity = ['low', 'medium', 'high'] export const bleeding = { labels: ['spotting', 'light', 'medium', 'heavy'], heaviness: { - header: "Heaviness", - explainer: "How heavy is the bleeding?", + header: 'Heaviness', + explainer: 'How heavy is the bleeding?', }, exclude: { - header: "Exclude", - explainer: "You can exclude this value if it's not menstrual bleeding" - } + header: 'Exclude', + explainer: "You can exclude this value if it's not menstrual bleeding", + }, } export const cervix = { subcategories: { opening: 'opening', firmness: 'firmness', - position: 'position' + position: 'position', }, opening: { categories: ['closed', 'medium', 'open'], - explainer: 'Is your cervix open or closed?' + explainer: 'Is your cervix open or closed?', }, firmness: { categories: ['hard', 'soft'], - explainer: "When it's hard, it might feel like the tip of your nose" + explainer: "When it's hard, it might feel like the tip of your nose", }, position: { categories: ['low', 'medium', 'high'], - explainer: 'How high up in the vagina is the cervix?' + explainer: 'How high up in the vagina is the cervix?', }, - excludeExplainer: "You can exclude this value if you don't want to use it for fertility detection.", - actionHint: 'Choose values for at least "Opening" and "Firmness" to save.' + excludeExplainer: + "You can exclude this value if you don't want to use it for fertility detection.", } export const mucus = { subcategories: { feeling: 'feeling', - texture: 'texture' + texture: 'texture', }, feeling: { categories: ['dry', 'nothing', 'wet', 'slippery'], - explainer: 'What does your vaginal entrance feel like?' + explainer: 'What does your vaginal entrance feel like?', }, texture: { categories: ['nothing', 'creamy', 'egg white'], - explainer: "Looking at and touching your cervical mucus, which describes it best?" + explainer: + 'Looking at and touching your cervical mucus, which describes it best?', }, - excludeExplainer: "You can exclude this value if you don't want to use it for fertility detection", - actionHint: 'Choose values for both "Feeling" and "Texture" to save.' + excludeExplainer: + "You can exclude this value if you don't want to use it for fertility detection", } export const desire = { header: 'Intensity', - explainer: 'How would you rate your sexual desire?' + explainer: 'How would you rate your sexual desire?', } export const sex = { - categories:{ + categories: { solo: 'solo', partner: 'partner', }, - header: "Activity", + header: 'Activity', explainer: 'Were you sexually active today?', } export const contraceptives = { - categories:{ + categories: { condom: 'condom', pill: 'pill', iud: 'iud', @@ -78,8 +79,8 @@ export const contraceptives = { none: 'none', other: 'other', }, - header: "Contraceptives", - explainer: 'Did you use contraceptives?' + header: 'Contraceptives', + explainer: 'Did you use contraceptives?', } export const pain = { @@ -91,9 +92,9 @@ export const pain = { nausea: 'nausea', tenderBreasts: 'tender breasts', migraine: 'migraine', - other: 'other' + other: 'other', }, - explainer: 'How did your body feel today?' + explainer: 'How did your body feel today?', } export const mood = { @@ -107,34 +108,39 @@ export const mood = { energetic: 'energetic', fatigue: 'fatigue', angry: 'angry', - other: 'other' + other: 'other', }, - explainer: 'How did you feel today?' + explainer: 'How did you feel today?', } export const temperature = { - outOfRangeWarning: 'This temperature value is out of the current range for the temperature chart. You can change the range in the settings.', - outOfAbsoluteRangeWarning: 'This temperature value is too high or low to be shown on the temperature chart.', + outOfRangeWarning: + 'This temperature value is out of the current range for the temperature chart. You can change the range in the settings.', + outOfAbsoluteRangeWarning: + 'This temperature value is too high or low to be shown on the temperature chart.', temperature: { - header: "Temperature", - explainer: 'Take your temperature right after waking up, before getting out of bed' + header: 'Temperature', + explainer: + 'Take your temperature right after waking up, before getting out of bed', }, - time: "Time", + time: 'Time', note: { - header: "Note", - explainer: 'Is there anything that could have influenced this value, such as bad sleep or alcohol consumption?' + header: 'Note', + explainer: + 'Is there anything that could have influenced this value, such as bad sleep or alcohol consumption?', }, exclude: { - header: "Exclude", - explainer: "You can exclude this value if you don't want to use it for fertility detection" - } + header: 'Exclude', + explainer: + "You can exclude this value if you don't want to use it for fertility detection", + }, } -export const noteExplainer = "Anything you want to add for the day?" +export const noteExplainer = 'Anything you want to add for the day?' export const general = { - cycleDayNumber: "Cycle day ", - today: "Today" + cycleDayNumber: 'Cycle day ', + today: 'Today', } export const sharedDialogs = { @@ -144,5 +150,5 @@ export const sharedDialogs = { reallyDeleteData: 'Yes, I am sure', save: 'Save', delete: 'Delete', - disabledInfo: 'There is some data missing' + disabledInfo: 'There is some data missing', } From b481bd83528456417ae34b801c67ab97cff26d5f Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Sat, 16 Mar 2024 14:34:28 +0100 Subject: [PATCH 56/74] Don't show the exclude switch when fertility is off --- components/cycle-day/symptom-edit-view.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/components/cycle-day/symptom-edit-view.js b/components/cycle-day/symptom-edit-view.js index 616f70b..b87ae58 100644 --- a/components/cycle-day/symptom-edit-view.js +++ b/components/cycle-day/symptom-edit-view.js @@ -15,6 +15,7 @@ import Temperature from './temperature' import { blank, save, shouldShow, symtomPage } from '../helpers/cycle-day' import { showToast } from '../helpers/general' +import { fertilityTrackingObservable } from '../../local-storage' import { shared as sharedLabels } from '../../i18n/en/labels' import info from '../../i18n/en/symptom-info' import { Colors, Containers, Sizes, Spacing } from '../../styles' @@ -25,6 +26,7 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => { const [shouldShowInfo, setShouldShowInfo] = useState(false) const getParsedData = () => JSON.parse(JSON.stringify(data)) const onPressLearnMore = () => setShouldShowInfo(!shouldShowInfo) + const isFertilityTrackingEnabled = fertilityTrackingObservable.value const onEditNote = (note) => { const parsedData = getParsedData() @@ -167,15 +169,18 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => { ) })} - {shouldShow(symptomConfig.excludeText) && ( - - - - )} + {/* show exclude AppSwitch for bleeding, mucus, cervix, temperature */} + {/* but if fertility is off only for bleeding */} + {shouldShow(symptomConfig.excludeText) && + (symptom === 'bleeding' || isFertilityTrackingEnabled) && ( + + + + )} {shouldShow(symptomConfig.note) && ( {symtomPage[symptom].note} From 56e90b69e6093e9558397cd3b426cd6dca7a93c2 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Sat, 16 Mar 2024 14:39:38 +0100 Subject: [PATCH 57/74] Rearrange segments in customization + add subheader --- components/common/segment.js | 9 +++++++- components/settings/customization/index.js | 24 ++++++++++++++-------- i18n/en/settings.js | 1 + styles/spacing.js | 3 ++- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/components/common/segment.js b/components/common/segment.js index 0069666..0f85b7a 100644 --- a/components/common/segment.js +++ b/components/common/segment.js @@ -6,13 +6,14 @@ import AppText from './app-text' import { Colors, Containers, Spacing, Typography } from '../../styles' -const Segment = ({ children, last, title }) => { +const Segment = ({ children, last, title, subheader }) => { const containerStyle = last ? styles.containerLast : styles.container const commonStyle = Object.assign({}, containerStyle) return ( {title && {title}} + {subheader && {subheader}} {children} ) @@ -23,6 +24,7 @@ Segment.propTypes = { last: PropTypes.bool, style: PropTypes.object, title: PropTypes.string, + subheader: PropTypes.string, } const styles = StyleSheet.create({ @@ -39,6 +41,11 @@ const styles = StyleSheet.create({ title: { ...Typography.subtitle, }, + subheader: { + ...Typography.subtitle, + fontWeight: 'bold', + marginBottom: Spacing.zero, + }, }) export default Segment diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index d1381aa..27284b3 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -274,6 +274,7 @@ const Settings = () => { symptom={SYMPTOMS[8]} /> + {labels.fertilityTracking.message} @@ -286,6 +287,19 @@ const Settings = () => { + + + + + + {labels.tempScale.segmentExplainer} @@ -294,7 +308,7 @@ const Settings = () => { - + {cervixText} { /> - - - - ) } diff --git a/i18n/en/settings.js b/i18n/en/settings.js index 5748d02..88821e5 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -4,6 +4,7 @@ export default { customization: { title: 'Customization', trackingCategories: 'Tracking categories', + subheaderSymptoThermalMethod: 'Sympto-thermal method settings', }, export: { errors: { diff --git a/styles/spacing.js b/styles/spacing.js index 9c54ca9..7e418f6 100644 --- a/styles/spacing.js +++ b/styles/spacing.js @@ -1,10 +1,11 @@ import { scale } from 'react-native-size-matters' export default { + zero: '0%', tiny: scale(4), small: scale(10), base: scale(16), large: scale(20), symptomTileWidth: '48%', - textWidth: '70%' + textWidth: '70%', } From 4e37f1b7de5377bf0a030d8821b8782e5cbfe852 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Sun, 17 Mar 2024 17:00:53 +0100 Subject: [PATCH 58/74] Unify spelling starting with capital letter --- i18n/en.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index 6467b64..66108a4 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -112,19 +112,19 @@ "menuItem": { "dataManagement": { "name": "Data", - "text": "import, export or delete your data" + "text": "Import, export or delete your data" }, "customization": { "name": "Customization", - "text": "define how you want to use drip" + "text": "Define how you want to use drip" }, "password": { "name": "Password", - "text": "set or edit your password" + "text": "Set, edit or delete your password" }, "reminders": { "name": "Reminders", - "text": "turn on/off reminders" + "text": "Turn on/off reminders" }, "info": { "name": "Info", From 15a0b3d270164ee2deedb3096f7054550e569ff7 Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Mon, 18 Mar 2024 18:29:10 +0100 Subject: [PATCH 59/74] adapt text according to customization --- i18n/en/symptom-info.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/en/symptom-info.js b/i18n/en/symptom-info.js index fb124e3..583ceaf 100644 --- a/i18n/en/symptom-info.js +++ b/i18n/en/symptom-info.js @@ -25,7 +25,7 @@ export default { After tracking at least 3 menstrual cycles, drip. will give you an overview of · how long your cycles last on average (in "stats"), · whether the length of your cycles varied significantly (in "stats" and in bleeding predictions) -· and predict your next 3 cycles with a range of 3 or 5 days (on home screen and "calendar"). +· and predict your next 3 cycles with a range of 3 or 5 days (on home screen and "calendar") if this functionality is enabled in the customization settings. The app allows you to track different intensities of bleeding. On the chart and on the calendar, bleeding values are colored in different shades of red. The darker, the more intense your bleeding. Every bleeding value that is not excluded is taken into account for fertility calculation and period predictions. @@ -74,7 +74,7 @@ ${generalInfo.curiousNfp}`, title: 'Tracking cervical mucus', text: `Cervical mucus can help determine in which phase of the menstrual cycle you are. -By default the secondary symptom the app uses for the sympto-thermal method is cervical mucus. +By default the secondary symptom the app uses for the sympto-thermal method is cervical mucus. You can change this in the customization settings. · How to identify fertile cervical mucus? Tracking the feeling and the texture of your cervical mucus on a daily basis helps you identify changes of the quality of the cervical mucus. The values you enter for both feeling and texture of your cervical mucus are combined by drip. into one of five values following the sympto-thermal method. From f7c6f4bfd01b5ee7b2ca8caa6115093ed50e38e8 Mon Sep 17 00:00:00 2001 From: wunderfisch Date: Mon, 18 Mar 2024 18:36:30 +0100 Subject: [PATCH 60/74] replace hard coded label --- components/cycle-day/select-tab-group.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/cycle-day/select-tab-group.js b/components/cycle-day/select-tab-group.js index 6805b66..f94601a 100644 --- a/components/cycle-day/select-tab-group.js +++ b/components/cycle-day/select-tab-group.js @@ -21,7 +21,10 @@ export default function SelectTabGroup({ // Disable is only used for secondarySymptom in customization, if more come up maybe consider more tidy solution const showDisabledAlert = (label) => { - if (label === 'cervix' || label === 'cervical mucus') { + if ( + label === labels.secondarySymptom.cervix || + label === labels.secondarySymptom.mucus + ) { Alert.alert( labels.secondarySymptom.disabled.title, labels.secondarySymptom.disabled.message From 9b0abd536705df70c016bebe78241df721da2d40 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 18 Mar 2024 19:03:21 +0100 Subject: [PATCH 61/74] Add one small info text to the bottom of customization index --- components/settings/customization/index.js | 30 ++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/components/settings/customization/index.js b/components/settings/customization/index.js index 27284b3..733a62d 100644 --- a/components/settings/customization/index.js +++ b/components/settings/customization/index.js @@ -1,10 +1,12 @@ import React, { useEffect, useState } from 'react' -import { Alert, Pressable } from 'react-native' +import { Alert, Pressable, StyleSheet, View } from 'react-native' import { useTranslation } from 'react-i18next' +import AppIcon from '../../common/app-icon' import AppPage from '../../common/app-page' import AppSwitch from '../../common/app-switch' import AppText from '../../common/app-text' +import { Colors, Spacing, Typography } from '../../../styles' import TemperatureSlider from './temperature-slider' import Segment from '../../common/segment' import TrackingCategorySwitch from '../../common/tracking-category-switch' @@ -308,7 +310,7 @@ const Settings = () => { - + {cervixText} { /> + + + + {labels.preOvu.title} + + {labels.preOvu.note} + ) } export default Settings + +const styles = StyleSheet.create({ + icon: { + marginRight: Spacing.base, + }, + line: { + flexDirection: 'row', + alignItems: 'center', + }, + title: { + ...Typography.subtitle, + }, +}) From 37f718d1b01ba65c00dca2a2b16e300744cf0358 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 18 Mar 2024 19:03:40 +0100 Subject: [PATCH 62/74] Remove info from menu temporarily --- components/settings/settings-menu.js | 1 - 1 file changed, 1 deletion(-) diff --git a/components/settings/settings-menu.js b/components/settings/settings-menu.js index 773ca2e..49e0ac2 100644 --- a/components/settings/settings-menu.js +++ b/components/settings/settings-menu.js @@ -11,7 +11,6 @@ const menuItems = [ { label: 'reminders', componentName: 'Reminders' }, { label: 'dataManagement', componentName: 'DataManagement' }, { label: 'password', componentName: 'Password' }, - { label: 'info', componentName: 'Info' }, ] const SettingsMenu = ({ navigate }) => { From 839acfa22da28d3eba1da3fd147dd5141f525eaa Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Tue, 19 Mar 2024 14:20:40 +0100 Subject: [PATCH 63/74] Add release notes for iOS --- RELEASE.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index c72dc05..d2829a7 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -6,8 +6,8 @@ _Note: You need the release-key for Android to bundle a signed release that can 1. [version updating](#Version-updating) 2. [android building](#Building-in-Android) - - [APK](#APK) - - [AAB](#AAB) + - [APK](#APK) + - [AAB](#AAB) 3. [release sharing](#Share-the-release) ## Version updating @@ -25,6 +25,15 @@ yarn release The versionName and versionCode [are defined here](https://gitlab.com/bloodyhealth/drip/-/blob/5401789c46f4a02915ab900ef284581be420451c/android/app/build.gradle#L137-138) and in [package.json](https://gitlab.com/bloodyhealth/drip/-/blob/5401789c46f4a02915ab900ef284581be420451c/package.json#L3). +**Note for iOS** + +Update the version number for iOS in `ios/drip/Info.plist` under: + +``` +CFBundleShortVersionString +1.2403.19 +``` + ## Building in Android APK versus AAB @@ -75,6 +84,17 @@ yarn sign-android-aab-release _which is a shortcut for:_ `jarsigner -keystore ./android/app/drip-release-key.keystore ./android/app/build/outputs/bundle/release/app-release.aab drip-release-key` +## Building in iOS + +To build an .ipa archive file for an upload to the AppStore you need to go to xCode and select Build -> "Any iOS Device" and under "Product" -> "Archive". + +Once the archiving process has completed you can chose to do the following: + +"Distribute the app" + +- TestFlight & App Store for when you want to upload it for external testing and/or production release +- TestFlight Internal Only for when you want to upload it for internal testing + ## Share the release ### Gitlab repository From fd10a78a4023aea647e095830b9ca2bb15e4ed40 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 14 Mar 2024 15:43:29 +0100 Subject: [PATCH 64/74] Update Changelog for v1.2403.11 --- CHANGELOG.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5520c1..0fd7585 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,48 @@ All notable changes to this project will be documented in this file. +## v1.2403.xx Android & iOS + +### Changes + +- Disables temperature slider if temperature tracking off +- Disables secondary symptom if fertility and or cervix/cervical mucus are off +- Disables temperature reminder if temperature tracking off +- Disabled period reminder if period predictions off +- Return from sympto adapter if fertility off +- Restructure settings menu +- Unify wording to "sympto-thermal method" +- Format decimal to x.0 instead of x.00 used for standard deviation and average cycle in stats +- Use SelectTabGroup for secondary symptom customization + +- Android changes after updating React Native to 0.68.3 +- Update Android Gradle plugin from 7.0.3 to 7.0.4 +- Update NDK to "24.0.8215888" only for M1 users which added support for aarch64 +- Update metadata phone screenshots for Fdroid store listing +- Updated dependencies: + - @react-native-community/datetimepicker from 6.3.1 to 7.2.0 + - @react-native-async-storage/async-storage from ^1.17.9 to ^1.18.2 + - metro-react-native-babel-preset from ^0.66.2 to ^0.67.0 + +### Adds + +- Customization settings can turn on & off: + + - Tracking categories + - Fertility phases calculation + - Period predictions + +- Home displays text elements depending on customization settings +- Chart displays tracking category elements depending on customization settings +- CycleDay displays tracking category elements depending on customization settings +- Reminder can be disabled depending on customization settings +- Adds menu item "Info" to Settings +- Adds disabled and more styling to AppSwitch +- Adds TrackingCategorySwitch +- Adds disabled, more styling and alert to SelectTabGroup +- Adds more marginTop to License page +- Adds info text to Password menu item in Settings + ## v1.2401.17 iOS ### Changes From b2457f47512426b13ac28a861e9eea4f81a79a5a Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Tue, 19 Mar 2024 14:28:09 +0100 Subject: [PATCH 65/74] Update changelog for v1.2403.19 after implenting user testing feedback --- CHANGELOG.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fd7585..2030d2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## v1.2403.xx Android & iOS +## v1.2403.19 Android & iOS ### Changes @@ -30,14 +30,13 @@ All notable changes to this project will be documented in this file. - Customization settings can turn on & off: - Tracking categories - - Fertility phases calculation - Period predictions + - Fertility phases calculation - Home displays text elements depending on customization settings - Chart displays tracking category elements depending on customization settings -- CycleDay displays tracking category elements depending on customization settings +- CycleDay displays tracking category elements and exclude switch depending on customization settings - Reminder can be disabled depending on customization settings -- Adds menu item "Info" to Settings - Adds disabled and more styling to AppSwitch - Adds TrackingCategorySwitch - Adds disabled, more styling and alert to SelectTabGroup From 536017914cfd9969c3dc7a3da01ac796facade8d Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 20 Mar 2024 18:55:58 +0100 Subject: [PATCH 66/74] Add extensive list of release steps --- RELEASE.md | 98 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 78 insertions(+), 20 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index d2829a7..4146f0b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,14 +1,31 @@ -# How to release a new app version for Android +# How to release -_Note: You need the release-key for Android to bundle a signed release that can be uploaded and published via the Google Play Store. A similar process for Apple requires a certificate to upload and publish the app to the App Store. More documentation on 'How to release a new app version for iOS' coming soon._ +drip is developed in React Native for iOS and Android and is released on 4 different platforms: -# Table of Contents +1. [Google Play Store](https://play.google.com/store/apps/details?id=com.drip) +2. [Apple App Store](https://apps.apple.com/us/app/drip/id1584564949) +3. [F-Droid](https://f-droid.org/packages/com.drip/) +4. [drip Website](https://dripapp.org) -1. [version updating](#Version-updating) -2. [android building](#Building-in-Android) - - [APK](#APK) - - [AAB](#AAB) -3. [release sharing](#Share-the-release) +In an ideal world the app version is the same across platforms. In reality this has never been the case. + +Releasing a new version is very exciting and brings happy changes like fixing a bug, improving a feature, updating dependencies or adding a new functionality to the app. It is more than just pressing the button "publish new version". + +_Note_: You need the release-key for Android to bundle a signed release that can be uploaded and published via the Google Play Store. A similar process for Apple requires a certificate to upload and publish the app to the App Store. + +### Release steps + +1. [Version updating](#Version-updating) +2. [Android builds](#Builds-in-Android) +3. [iOS builds](#Builds-in-iOS) +4. [User testing](#User-testing) +5. [Changelog](#Changelog) +6. [Release notes](#Release-notes) +7. [Release tag](#Release-tag) +8. [Phone screenshots](#Phone-screenshots) +9. [Publishing](#Publishing) +10. [Communication](#Communication) +11. [Self care](#Self-care) ## Version updating @@ -34,7 +51,7 @@ Update the version number for iOS in `ios/drip/Info.plist` under: 1.2403.19 ``` -## Building in Android +### Builds in Android APK versus AAB @@ -42,7 +59,7 @@ APK versus AAB (https://developer.android.com/build/building-cmdline) -### APK +#### APK To build a release apk file, run the following command: @@ -64,7 +81,7 @@ _which is a shortcut for:_ `zipalign -v -p 4 ./android/app/build/outputs/apk/rel It adds a file name `app-release_signed.apk` in the same folder in `./android/app/build/outputs/apk/release/` -### AAB +#### AAB To build a release aab file, run: @@ -84,7 +101,7 @@ yarn sign-android-aab-release _which is a shortcut for:_ `jarsigner -keystore ./android/app/drip-release-key.keystore ./android/app/build/outputs/bundle/release/app-release.aab drip-release-key` -## Building in iOS +### Builds in iOS To build an .ipa archive file for an upload to the AppStore you need to go to xCode and select Build -> "Any iOS Device" and under "Product" -> "Archive". @@ -95,29 +112,66 @@ Once the archiving process has completed you can chose to do the following: - TestFlight & App Store for when you want to upload it for external testing and/or production release - TestFlight Internal Only for when you want to upload it for internal testing -## Share the release +## User testing -### Gitlab repository +To enable external testing you need to remember that Google Play and Apple App Store might take up to 1 day for their review process. "External testing" for iOS allows testing drip on Testflight anonymously via a public link. "Open testing" for Android allows testing drip on Google Play as beta tester below the normal production listing. For a quick and easy way to share an apk to testers who are willing to sideload drip onto their Android phones, do this: Upload a signed apk to the Gitlab repository of the drip website under `/release` https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/tree/main/release and maybe adapt the name of the apk with a more specific name than "app-release.apk". Now you can simply share a direct link to download your newly bundled apk, e.g. [a download link for v1.2311.14](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/blob/main/release/v1.2311.14.apk). +## Changelog + +The [changelog](https://gitlab.com/bloodyhealth/drip/-/blob/main/CHANGELOG.md) should reflect the technical / code changes between a previous and the new version. Please update the changelog file with any relevant additions, fixes and changes in the following format: + +**v1.yymm.d** + +**Changes** + +Changing the color of funky button +Updating a library from 1.2.3 to 2.3.4 + +**Adds** + +New feature for calendar + +**Fixed** + +Small bug in chart + +## Release notes + +These notes are for the users and curious ones who may want to start using drip. They should be based on the changelog but written in a friendly and easy to understand way. The focus is on the user perspective and the impact of the changes for the user. Behind the scenes and in depth code changes are less relevant. + +Google Play limits these notes to 500 characters, whereas Apple's App Store limits these notes to 4.000 characters. In Fdroid there are no release notes. + +## Release tag + +[Tags](https://gitlab.com/bloodyhealth/drip/-/tags) can mark a specific point in the coding/commmit history and helps us identify the version status of a released app. They are named "iOS-v1.2401.17" or "Release-v1.yymm.d". + +## Phone screenshots + +If there are visual changes in the app you may want to update the screenshots for the Google Play Store listing, which allows up to 8 and for Apple's App Store, which allows up to 10 screenshots. Keep in mind that both Google Play and Apple have specific resolution requirements. You'll find Google's in Grow -> Store presence -> Main Store Listing -> Phone screenshots and Apple's on the main App Store Connect site. Here is a link for [Apple's screenshot specifications](https://developer.apple.com/help/app-store-connect/reference/screenshot-specifications). + +Please also update [phone screenshots for the website](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/tree/main/assets) and set links on [/index](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/blob/f3da9776b1943ffa32458e74ef86eeca98c1891c/index.html#L47) and [/media](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/blob/c7f999bb7ad736345321537cbffa3f4c24eeee6d/media.html#L33) that can then also be attached to a social media post. + +## Publishing + ### Google Play Console Upload a signed aab to the [Google Play Console for developers](https://play.google.com/console/) and add it to the "App bundle explorer". This requires a higher versionCode and a different version name compared to previously uploaded aab or apk files. You can decide if you want the new app version to get released for testing (internal, closed or open) or for production. Keep in mind that any track other than "internal testing" triggers an external review by Google and might take a few hours. -#### Phone screenshots +### Apple App Store Connect -If there are visual changes in the app you may want to update the screenshots for the Google Play Store listing. Keep in mind that Google Play has specific resolution requirements. You'll find them in Grow -> Store presence -> Main Store Listing -> Phone screenshots. +Upload a new version and submit it for review, before it can be published. ### drip website -After a new version has been published on Google Play (or F-Droid) the apk version that is downloadable directly from the [drip website](https://dripapp.org) needs to get updated as well. Therefore you upload a signed apk to the [repository](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/) and adapt the name and link on /index.html. +After a new version has been published on Google Play (or F-Droid) the apk version that is downloadable directly from the [drip website](https://dripapp.org) needs to get updated as well. Therefore you upload a signed apk to the [repository](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/) as [we did in this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit/f8c0f90c1ae9f23bf8e1bc311790b85443149a4d), + +and adapt the name and link on /index.html [as we did in this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit2f8850ff5fa78615a4f335b625ea4a67d4acf03a) and [this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit/f3da9776b1943ffa32458e74ef86eeca98c1891c) Last time I checked it was [here](f3da9776b1943ffa32458e74ef86eeca98c1891c/index.html#L114). -#### Phone screenshots - -Please also update [phone screenshots here](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/tree/main/assets) and set links on [/index](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/blob/f3da9776b1943ffa32458e74ef86eeca98c1891c/index.html#L47) and [/media](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/blob/c7f999bb7ad736345321537cbffa3f4c24eeee6d/media.html#L33) that can then also be attached to a social media post. +## Communication You probably want to share the app update by posting on one or more of these platforms: @@ -126,3 +180,7 @@ You probably want to share the app update by posting on one or more of these pla - [Ko-fi](https://ko-fi.com/dripapp) - [Linkedin](https://www.linkedin.com/company/34899684/) - Different tech, privacy, feminist oriented slacks + +## Self care + +Congratulations. Take a break, eat some chocolate, go see a live show of your favorite band, masturbate <3! From 09cb31035c16a64bf87f273dc4baa1cb020b9f4a Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 20 Mar 2024 19:02:24 +0100 Subject: [PATCH 67/74] Fix anchor links --- RELEASE.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 4146f0b..098da89 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -15,17 +15,17 @@ _Note_: You need the release-key for Android to bundle a signed release that can ### Release steps -1. [Version updating](#Version-updating) -2. [Android builds](#Builds-in-Android) -3. [iOS builds](#Builds-in-iOS) -4. [User testing](#User-testing) -5. [Changelog](#Changelog) -6. [Release notes](#Release-notes) -7. [Release tag](#Release-tag) -8. [Phone screenshots](#Phone-screenshots) -9. [Publishing](#Publishing) -10. [Communication](#Communication) -11. [Self care](#Self-care) +1. [Version updating](#version-updating) +2. [Android builds](#android-builds) +3. [iOS builds](#ios-builds) +4. [User testing](#user-testing) +5. [Changelog](#changelog) +6. [Release notes](#release-notes) +7. [Release tag](#release-tag) +8. [Phone screenshots](#phone-screenshots) +9. [Publishing](#publishing) +10. [Communication](#communication) +11. [Self care](#self-care) ## Version updating @@ -51,7 +51,7 @@ Update the version number for iOS in `ios/drip/Info.plist` under: 1.2403.19 ``` -### Builds in Android +### Android builds APK versus AAB @@ -101,7 +101,7 @@ yarn sign-android-aab-release _which is a shortcut for:_ `jarsigner -keystore ./android/app/drip-release-key.keystore ./android/app/build/outputs/bundle/release/app-release.aab drip-release-key` -### Builds in iOS +### iOS builds To build an .ipa archive file for an upload to the AppStore you need to go to xCode and select Build -> "Any iOS Device" and under "Product" -> "Archive". From 7bbb6eaeab9732891de828f7dc36b5f84eadb652 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Wed, 20 Mar 2024 19:06:34 +0100 Subject: [PATCH 68/74] Fix formatting --- RELEASE.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 098da89..ec6736d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -166,10 +166,7 @@ Upload a new version and submit it for review, before it can be published. ### drip website -After a new version has been published on Google Play (or F-Droid) the apk version that is downloadable directly from the [drip website](https://dripapp.org) needs to get updated as well. Therefore you upload a signed apk to the [repository](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/) as [we did in this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit/f8c0f90c1ae9f23bf8e1bc311790b85443149a4d), - -and adapt the name and link on /index.html [as we did in this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit2f8850ff5fa78615a4f335b625ea4a67d4acf03a) and [this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit/f3da9776b1943ffa32458e74ef86eeca98c1891c) -Last time I checked it was [here](f3da9776b1943ffa32458e74ef86eeca98c1891c/index.html#L114). +After a new version has been published on Google Play (or F-Droid) the apk version that is downloadable directly from the [drip website](https://dripapp.org) needs to get updated as well. Therefore you upload a signed apk to the [repository](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/) as [we did in this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit/f8c0f90c1ae9f23bf8e1bc311790b85443149a4d), and adapt the name and link on /index.html [as we did in this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit2f8850ff5fa78615a4f335b625ea4a67d4acf03a) and [this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit/f3da9776b1943ffa32458e74ef86eeca98c1891c). Last time I checked it was [here](f3da9776b1943ffa32458e74ef86eeca98c1891c/index.html#L114). ## Communication From e4d97b362fb264e46e5b20be58b6b9be1dbbe935 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Thu, 21 Mar 2024 12:52:30 +0100 Subject: [PATCH 69/74] Release 1.2403.19 update for Android and iOS --- android/app/build.gradle | 4 ++-- ios/drip/Info.plist | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 268c688..3172475 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -134,8 +134,8 @@ android { applicationId "com.drip" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 27 - versionName "1.2402.15" + versionCode 33 + versionName "1.2403.19" ndk { abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } diff --git a/ios/drip/Info.plist b/ios/drip/Info.plist index 07428b9..ff02a54 100644 --- a/ios/drip/Info.plist +++ b/ios/drip/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.2401.17 + 1.2403.19 CFBundleSignature ???? CFBundleVersion diff --git a/package.json b/package.json index 876c7a4..2e688ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "drip.", - "version": "1.2402.15", + "version": "1.2403.19", "contributors": [ "Julia Friesel ", "Marie Kochsiek", From 2ca033d6d13104feb22d73f0d8171ee90b9c879d Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 25 Mar 2024 15:03:40 +0100 Subject: [PATCH 70/74] Update internal Nfp wording --- lib/nfp-mucus.js | 2 +- test/nfp-mucus.spec.js | 79 ++++++++++++++++++++++++++++++++++++ test/sensiplan-mucus.spec.js | 79 ------------------------------------ 3 files changed, 80 insertions(+), 80 deletions(-) create mode 100644 test/nfp-mucus.spec.js delete mode 100644 test/sensiplan-mucus.spec.js diff --git a/lib/nfp-mucus.js b/lib/nfp-mucus.js index f5dbb9e..c0ea3d7 100644 --- a/lib/nfp-mucus.js +++ b/lib/nfp-mucus.js @@ -1,4 +1,4 @@ -export default function getSensiplanMucus(feeling, texture) { +export default function getNfpMucus(feeling, texture) { if (typeof feeling != 'number' || typeof texture != 'number') return null const feelingMapping = { diff --git a/test/nfp-mucus.spec.js b/test/nfp-mucus.spec.js new file mode 100644 index 0000000..401ed22 --- /dev/null +++ b/test/nfp-mucus.spec.js @@ -0,0 +1,79 @@ +import getNfpMucus from '../lib/nfp-mucus' + +describe('getNfpMucus', () => { + test('returns null if there is no value for feeling or texture', () => { + expect(getNfpMucus()).toBeNull() + expect(getNfpMucus(undefined, 3)).toBeNull() + expect(getNfpMucus(2, undefined)).toBeNull() + }) + + describe('results in t for:', () => { + test('dry feeling and no texture', function () { + const nfpValue = getNfpMucus(0, 0) + expect(nfpValue).toEqual(0) + }) + }) + + describe('results in Ø for:', () => { + test('no feeling and no texture', function () { + const nfpValue = getNfpMucus(1, 0) + expect(nfpValue).toEqual(1) + }) + }) + + describe('results in f for:', () => { + test('wet feeling and no texture', function () { + const nfpValue = getNfpMucus(2, 0) + expect(nfpValue).toEqual(2) + }) + }) + + describe('results in S for:', () => { + test('dry feeling and creamy texture', function () { + const nfpValue = getNfpMucus(0, 1) + expect(nfpValue).toEqual(3) + }) + + test('no feeling and creamy texture', function () { + const nfpValue = getNfpMucus(1, 1) + expect(nfpValue).toEqual(3) + }) + + test('wet feeling and creamy texture', function () { + const nfpValue = getNfpMucus(2, 1) + expect(nfpValue).toEqual(3) + }) + }) + + describe('results in +S for:', () => { + test('dry feeling and egg white texture', function () { + const nfpValue = getNfpMucus(0, 2) + expect(nfpValue).toEqual(4) + }) + + test('no feeling and egg white texture', function () { + const nfpValue = getNfpMucus(1, 2) + expect(nfpValue).toEqual(4) + }) + + test('wet feeling and egg white texture', function () { + const nfpValue = getNfpMucus(2, 2) + expect(nfpValue).toEqual(4) + }) + + test('slippery feeling and egg white texture', function () { + const nfpValue = getNfpMucus(3, 2) + expect(nfpValue).toEqual(4) + }) + + test('slippery feeling and creamy texture', function () { + const nfpValue = getNfpMucus(3, 1) + expect(nfpValue).toEqual(4) + }) + + test('slippery feeling and no texture', function () { + const nfpValue = getNfpMucus(3, 0) + expect(nfpValue).toEqual(4) + }) + }) +}) diff --git a/test/sensiplan-mucus.spec.js b/test/sensiplan-mucus.spec.js deleted file mode 100644 index 9073e26..0000000 --- a/test/sensiplan-mucus.spec.js +++ /dev/null @@ -1,79 +0,0 @@ -import getSensiplanMucus from '../lib/nfp-mucus' - -describe('getSensiplanMucus', () => { - test('returns null if there is no value for feeling or texture', () => { - expect(getSensiplanMucus()).toBeNull() - expect(getSensiplanMucus(undefined, 3)).toBeNull() - expect(getSensiplanMucus(2, undefined)).toBeNull() - }) - - describe('results in t for:', () => { - test('dry feeling and no texture', function () { - const sensiplanValue = getSensiplanMucus(0, 0) - expect(sensiplanValue).toEqual(0) - }) - }) - - describe('results in Ø for:', () => { - test('no feeling and no texture', function () { - const sensiplanValue = getSensiplanMucus(1, 0) - expect(sensiplanValue).toEqual(1) - }) - }) - - describe('results in f for:', () => { - test('wet feeling and no texture', function () { - const sensiplanValue = getSensiplanMucus(2, 0) - expect(sensiplanValue).toEqual(2) - }) - }) - - describe('results in S for:', () => { - test('dry feeling and creamy texture', function () { - const sensiplanValue = getSensiplanMucus(0, 1) - expect(sensiplanValue).toEqual(3) - }) - - test('no feeling and creamy texture', function () { - const sensiplanValue = getSensiplanMucus(1, 1) - expect(sensiplanValue).toEqual(3) - }) - - test('wet feeling and creamy texture', function () { - const sensiplanValue = getSensiplanMucus(2, 1) - expect(sensiplanValue).toEqual(3) - }) - }) - - describe('results in +S for:', () => { - test('dry feeling and egg white texture', function () { - const sensiplanValue = getSensiplanMucus(0, 2) - expect(sensiplanValue).toEqual(4) - }) - - test('no feeling and egg white texture', function () { - const sensiplanValue = getSensiplanMucus(1, 2) - expect(sensiplanValue).toEqual(4) - }) - - test('wet feeling and egg white texture', function () { - const sensiplanValue = getSensiplanMucus(2, 2) - expect(sensiplanValue).toEqual(4) - }) - - test('slippery feeling and egg white texture', function () { - const sensiplanValue = getSensiplanMucus(3, 2) - expect(sensiplanValue).toEqual(4) - }) - - test('slippery feeling and creamy texture', function () { - const sensiplanValue = getSensiplanMucus(3, 1) - expect(sensiplanValue).toEqual(4) - }) - - test('slippery feeling and no texture', function () { - const sensiplanValue = getSensiplanMucus(3, 0) - expect(sensiplanValue).toEqual(4) - }) - }) -}) From b44d4c57e13e0a66d25a9d951bcf54061e243ab2 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Tue, 2 Apr 2024 11:57:53 +0000 Subject: [PATCH 71/74] Update file RELEASE.md --- RELEASE.md | 97 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 36 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index ec6736d..a6db8d5 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -7,27 +7,38 @@ drip is developed in React Native for iOS and Android and is released on 4 diffe 3. [F-Droid](https://f-droid.org/packages/com.drip/) 4. [drip Website](https://dripapp.org) -In an ideal world the app version is the same across platforms. In reality this has never been the case. +In an ideal world the app version is the same across platforms. In the past this has never been the case. The release v1.2403.19 is the first to be up to date on all 4 platforms! Releasing a new version is very exciting and brings happy changes like fixing a bug, improving a feature, updating dependencies or adding a new functionality to the app. It is more than just pressing the button "publish new version". _Note_: You need the release-key for Android to bundle a signed release that can be uploaded and published via the Google Play Store. A similar process for Apple requires a certificate to upload and publish the app to the App Store. -### Release steps +## Release steps -1. [Version updating](#version-updating) -2. [Android builds](#android-builds) -3. [iOS builds](#ios-builds) -4. [User testing](#user-testing) -5. [Changelog](#changelog) -6. [Release notes](#release-notes) -7. [Release tag](#release-tag) -8. [Phone screenshots](#phone-screenshots) -9. [Publishing](#publishing) -10. [Communication](#communication) -11. [Self care](#self-care) +### 1. [Code](#code) +- 1.1 [Version updating](#version-updating) +- 1.2 [Android builds](#android-builds) +- 1.3 [iOS builds](#ios-builds) +- 1.4 [User testing](#user-testing) +- 1.5 [Release tag](#release-tag) -## Version updating +### 2. [Documentation](#documentation) +- 2.1 [Changelog](#changelog) +- 2.2 [Release notes](#release-notes) +- 2.3 [Releases on Gitlab](#releases-on-gitlab) +- 2.4 [Phone screenshots](#phone-screenshots) + +### 3. [Publishing](#publishing) +- 3.1 [Google Play Console](#google-play-console) +- 3.2 [Apple App Store Connect](#apple-app-store-connect) +- 3.3 [F-droid](#f-droid) +- 3.4 [drip website](#drip-website) +- 3.5 [Communication](#communication) +- 3.6 [Self care](#self-care) + +## Code + +### Version updating When you are done with a chore, a feature or a bugfix, you may want to share it with testers and eventually publish a release. In order to identify a specific app version we can update the version name, which is created based on the following format: `1.yymm.d` e.g. `1.2311.7`. If you want to upload a new app version to Google Play you also need to update the version code. @@ -112,42 +123,50 @@ Once the archiving process has completed you can chose to do the following: - TestFlight & App Store for when you want to upload it for external testing and/or production release - TestFlight Internal Only for when you want to upload it for internal testing -## User testing +### User testing To enable external testing you need to remember that Google Play and Apple App Store might take up to 1 day for their review process. "External testing" for iOS allows testing drip on Testflight anonymously via a public link. "Open testing" for Android allows testing drip on Google Play as beta tester below the normal production listing. For a quick and easy way to share an apk to testers who are willing to sideload drip onto their Android phones, do this: Upload a signed apk to the Gitlab repository of the drip website under `/release` https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/tree/main/release and maybe adapt the name of the apk with a more specific name than "app-release.apk". Now you can simply share a direct link to download your newly bundled apk, e.g. [a download link for v1.2311.14](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/blob/main/release/v1.2311.14.apk). -## Changelog +### Release tag + +[Tags](https://gitlab.com/bloodyhealth/drip/-/tags) can mark a specific point in the coding/commmit history and helps us identify the version status of a released app. They are named "iOS-v1.2401.17" or "Release-v1.yymm.d". + +Any tag starting with "Release" or "Android" will be checked by https://gitlab.com/fdroidci + +## Documentation + +### Changelog The [changelog](https://gitlab.com/bloodyhealth/drip/-/blob/main/CHANGELOG.md) should reflect the technical / code changes between a previous and the new version. Please update the changelog file with any relevant additions, fixes and changes in the following format: -**v1.yymm.d** +>**v1.yymm.d** +> +>**Changes** +> +>Changing the color of funky button +>Updating a library from 1.2.3 to 2.3.4 +> +>**Adds** +> +>New feature for calendar +> +>**Fixed** +> +>Small bug in chart -**Changes** - -Changing the color of funky button -Updating a library from 1.2.3 to 2.3.4 - -**Adds** - -New feature for calendar - -**Fixed** - -Small bug in chart - -## Release notes +### Release notes These notes are for the users and curious ones who may want to start using drip. They should be based on the changelog but written in a friendly and easy to understand way. The focus is on the user perspective and the impact of the changes for the user. Behind the scenes and in depth code changes are less relevant. Google Play limits these notes to 500 characters, whereas Apple's App Store limits these notes to 4.000 characters. In Fdroid there are no release notes. -## Release tag +### Releases on Gitlab -[Tags](https://gitlab.com/bloodyhealth/drip/-/tags) can mark a specific point in the coding/commmit history and helps us identify the version status of a released app. They are named "iOS-v1.2401.17" or "Release-v1.yymm.d". +Under [Releases](https://gitlab.com/bloodyhealth/drip/-/releases) we keep track of all drip releases. -## Phone screenshots +### Phone screenshots If there are visual changes in the app you may want to update the screenshots for the Google Play Store listing, which allows up to 8 and for Apple's App Store, which allows up to 10 screenshots. Keep in mind that both Google Play and Apple have specific resolution requirements. You'll find Google's in Grow -> Store presence -> Main Store Listing -> Phone screenshots and Apple's on the main App Store Connect site. Here is a link for [Apple's screenshot specifications](https://developer.apple.com/help/app-store-connect/reference/screenshot-specifications). @@ -164,11 +183,17 @@ You can decide if you want the new app version to get released for testing (inte Upload a new version and submit it for review, before it can be published. +### F-droid + +This account runs automated checks for drip looking at new `Release` or `Android` [tags](https://gitlab.com/bloodyhealth/drip/-/tags/) and updates the app's metadata yaml file in Fdroid without further ado. + +However this is not the full story. Please have a look at previous commits to see what necessary changes got pushed, [see here](https://gitlab.com/fdroid/fdroiddata/-/commits/master/metadata/com.drip.yml). + ### drip website After a new version has been published on Google Play (or F-Droid) the apk version that is downloadable directly from the [drip website](https://dripapp.org) needs to get updated as well. Therefore you upload a signed apk to the [repository](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/) as [we did in this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit/f8c0f90c1ae9f23bf8e1bc311790b85443149a4d), and adapt the name and link on /index.html [as we did in this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit2f8850ff5fa78615a4f335b625ea4a67d4acf03a) and [this commit](https://gitlab.com/bloodyhealth/bloodyhealth.gitlab.io/-/commit/f3da9776b1943ffa32458e74ef86eeca98c1891c). Last time I checked it was [here](f3da9776b1943ffa32458e74ef86eeca98c1891c/index.html#L114). -## Communication +### Communication You probably want to share the app update by posting on one or more of these platforms: @@ -178,6 +203,6 @@ You probably want to share the app update by posting on one or more of these pla - [Linkedin](https://www.linkedin.com/company/34899684/) - Different tech, privacy, feminist oriented slacks -## Self care +### Self care Congratulations. Take a break, eat some chocolate, go see a live show of your favorite band, masturbate <3! From 06fab6d2ca82d1cda2cddc3ca2a1480aed6d3602 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Mon, 8 Apr 2024 12:39:36 +0200 Subject: [PATCH 72/74] Chore: Update run script for which iPhone simulator --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2e688ca..dac8a5a 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "scripts": { "start": "react-native start", "android": "react-native run-android", - "ios": "react-native run-ios --simulator=\"iPhone 15\"", - "iosSE": "react-native run-ios --simulator=\"iPhone SE (2nd generation)\"", + "ios": "react-native run-ios --simulator=\"iPhone 8 Plus\"", + "ios15": "react-native run-ios --simulator=\"iPhone 15 Plus\"", "log": "react-native log-android", "test": "jest test && yarn lint", "test-watch": "jest --watch test", From c7104f775887c8bba29d303f323f7f53f4da3d74 Mon Sep 17 00:00:00 2001 From: Lynn Date: Wed, 18 Sep 2024 10:00:33 +0000 Subject: [PATCH 73/74] Update README.md for M1 installations --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 4ce4fb0..06bcd6d 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,24 @@ Once you have nvm running you can install node 14: nvm install v14.19.3 +#### On Apple Silicon M1 + +NodeJS 14 does not compile on the M1 architecture, so it has to be installed through Rosetta: https://devzilla.io/using-nodejs-14-with-mac-silicon-m1 . +To activate Rosetta and switch to intel emulation run: + + arch -x86_64 zsh + +Run + + arch + +again to verify that it returns "i386". +Now install node 14: + + nvm install v14.19.3 + +### 3. Yarn version + use npm to install yarn: npm install --global yarn @@ -127,6 +145,18 @@ iii. If you are building the app with XCode make sure you are running this as we ### Troubleshooting +#### [MacOS M1] Flipper problems + +If a bug in the currently used Flipper version prevents building the project, comment out the respective line in the podfile, like so: + + #use_flipper!() + +Run + + pod install + +from the ios directory again to reload the dependencies. + #### [MacOS] Java problems Make sure that you have Java 1.8 by running `java -version`. From ae5f31015bfb9e4bf8c5601c79edfa476c153c77 Mon Sep 17 00:00:00 2001 From: Lynn Date: Wed, 18 Sep 2024 10:02:11 +0000 Subject: [PATCH 74/74] Update README.md for M1 installations, fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06bcd6d..4974df1 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ or clone it with HTTPS git clone https://gitlab.com/bloodyhealth/drip.git -### 2. Node & yarn version +### 2. Node version Make sure you are running Node 14 and classic yarn (v.1). It's easiest to switch Node versions using `nvm`, here's how to install NVM: https://github.com/nvm-sh/nvm#installing-and-updating. After installing nvm close the terminal and open it again to be able to use nvm. Once you have nvm running you can install node 14: