Compare commits

..

10 Commits

Author SHA1 Message Date
tina a4e0fa64e9 calculates cycle days for headaches 2024-10-15 17:52:38 +02:00
tina fd6f39fbc4 first exploration of place of feature and how to access data 2024-10-15 14:47:42 +02:00
wunderfisch d492a27797 Merge branch '723-feature-link-faq-in-app' into 'main'
adds a button leading to faq on website to about section in the app

Closes #723

See merge request bloodyhealth/drip!684
2024-10-03 16:35:28 +00:00
wunderfisch 22a451d4e6 Merge branch 'chore/add-condriputers' into 'main'
addding condriputers

See merge request bloodyhealth/drip!682
2024-10-03 16:35:10 +00:00
Lynn ae5f31015b Update README.md for M1 installations, fixed typo 2024-09-18 10:02:11 +00:00
Lynn c7104f7758 Update README.md for M1 installations 2024-09-18 10:00:33 +00:00
wunderfisch 86bdb8a1f8 adds a button leading to faq on website to about section in the app 2024-09-09 21:00:21 +02:00
bl00dymarie 5bc6be7849 Merge branch 'Chore/Finetune-release-documentation' into 'main'
Chore: Clean up TOC and add fdroid documentation

See merge request bloodyhealth/drip!679
2024-04-10 16:01:52 +00:00
bl00dymarie b44d4c57e1 Update file RELEASE.md 2024-04-02 11:57:53 +00:00
wunderfisch 4212906917 addding condriputers 2024-02-29 17:54:25 +01:00
19 changed files with 335 additions and 404 deletions
+31 -1
View File
@@ -34,13 +34,31 @@ 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:
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`.
+61 -36
View File
@@ -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!
+2 -2
View File
@@ -134,8 +134,8 @@ android {
applicationId "com.drip"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 35
versionName "1.2409.26"
versionCode 33
versionName "1.2403.19"
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
+12 -3
View File
@@ -23,14 +23,20 @@ const SymptomBox = ({
const { t } = useTranslation(null, { keyPrefix: 'symptoms' })
const isSymptomEdited = editedSymptom === symptom
const isSymptomDisabled = isDateInFuture(date) && symptom !== 'note'
const isExcluded = symptomData !== null ? symptomData.exclude : false
const iconColor = isSymptomDisabled ? Colors.greyLight : Colors.grey
const iconName = `drip-icon-${symptom}`
const symptomNameStyle = [
styles.symptomName,
isSymptomDisabled && styles.symptomNameDisabled,
isExcluded && styles.symptomNameExcluded,
]
const textStyle = [
styles.text,
isSymptomDisabled && styles.textDisabled,
isExcluded && styles.textExcluded,
]
const textStyle = [styles.text, isSymptomDisabled && styles.textDisabled]
return (
<>
@@ -57,11 +63,11 @@ const SymptomBox = ({
/>
<View style={styles.textContainer}>
<AppText style={symptomNameStyle}>{t(symptom)}</AppText>
{symptomDataToDisplay ? (
{symptomDataToDisplay && (
<AppText style={textStyle} numberOfLines={4}>
{symptomDataToDisplay}
</AppText>
) : null}
)}
</View>
</TouchableOpacity>
</>
@@ -115,6 +121,9 @@ const styles = StyleSheet.create({
textDisabled: {
color: Colors.greyLight,
},
textExcluded: {
color: Colors.grey,
},
})
export default SymptomBox
+18 -37
View File
@@ -12,7 +12,7 @@ import SelectBoxGroup from './select-box-group'
import SelectTabGroup from './select-tab-group'
import Temperature from './temperature'
import { blank, save, shouldShow, symptomPage } from '../helpers/cycle-day'
import { blank, save, shouldShow, symtomPage } from '../helpers/cycle-day'
import { showToast } from '../helpers/general'
import { fertilityTrackingObservable } from '../../local-storage'
@@ -21,10 +21,9 @@ import info from '../../i18n/en/symptom-info'
import { Colors, Containers, Sizes, Spacing } from '../../styles'
const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
const symptomConfig = symptomPage[symptom]
const symptomConfig = symtomPage[symptom]
const [data, setData] = useState(symptomData ? symptomData : blank[symptom])
const [shouldShowInfo, setShouldShowInfo] = useState(false)
const isBleeding = symptom === 'bleeding'
const getParsedData = () => JSON.parse(JSON.stringify(data))
const onPressLearnMore = () => setShouldShowInfo(!shouldShowInfo)
const isFertilityTrackingEnabled = fertilityTrackingObservable.value
@@ -118,23 +117,6 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
textAlignVertical: 'top',
}
{
/* show exclude AppSwitch for bleeding, mucus, cervix, temperature */
}
{
/* but if fertility is off only for bleeding */
}
const excludeToggle = shouldShow(symptomConfig.excludeText) &&
(isBleeding || isFertilityTrackingEnabled) && (
<Segment style={styles.segmentBorder}>
<AppSwitch
onToggle={onExcludeToggle}
text={symptomPage[symptom].excludeText}
value={data.exclude}
/>
</Segment>
)
return (
<AppModal onClose={onSave}>
<ScrollView
@@ -148,16 +130,10 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
save={(value, field) => onSaveTemperature(value, field)}
/>
)}
{/* There should not be a line between the bleeding tab group and the exclude toggle */}
{shouldShow(symptomConfig.selectTabGroups) &&
symptomPage[symptom].selectTabGroups.map((group) => {
symtomPage[symptom].selectTabGroups.map((group) => {
return (
<Segment
key={group.key}
style={styles.segmentBorder}
last={isBleeding}
>
<Segment key={group.key} style={styles.segmentBorder}>
<AppText style={styles.title}>{group.title}</AppText>
<SelectTabGroup
activeButton={data[group.key]}
@@ -167,12 +143,8 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
</Segment>
)
})}
{/*for bleeding, we want to move the "exclude" toggle up between the tab and box groups, all other symptoms should still have it at the bottom*/}
{isBleeding && excludeToggle}
{shouldShow(symptomConfig.selectBoxGroups) &&
symptomPage[symptom].selectBoxGroups.map((group) => {
symtomPage[symptom].selectBoxGroups.map((group) => {
const isOtherSelected =
data['other'] !== null &&
data['other'] !== false &&
@@ -197,12 +169,21 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
</Segment>
)
})}
{!isBleeding && excludeToggle}
{/* show exclude AppSwitch for bleeding, mucus, cervix, temperature */}
{/* but if fertility is off only for bleeding */}
{shouldShow(symptomConfig.excludeText) &&
(symptom === 'bleeding' || isFertilityTrackingEnabled) && (
<Segment style={styles.segmentBorder}>
<AppSwitch
onToggle={onExcludeToggle}
text={symtomPage[symptom].excludeText}
value={data.exclude}
/>
</Segment>
)}
{shouldShow(symptomConfig.note) && (
<Segment style={styles.segmentBorder}>
<AppText>{symptomPage[symptom].note}</AppText>
<AppText>{symtomPage[symptom].note}</AppText>
<AppTextInput
{...inputProps}
onChangeText={onEditNote}
+9 -95
View File
@@ -23,7 +23,6 @@ const noteDescription = labels.noteExplainer
const painLabels = labels.pain.categories
const sexLabels = labels.sex.categories
const temperatureLabels = labels.temperature
const productLabels = labels.products.categories
const minutes = ChronoUnit.MINUTES
@@ -61,15 +60,6 @@ export const blank = {
bleeding: {
exclude: false,
value: null,
pad: null,
tampon: null,
underwear: null,
cup: null,
softTampon: null,
disk: null,
none: null,
other: null,
note: null,
},
cervix: {
exclude: false,
@@ -135,10 +125,11 @@ export const blank = {
},
}
export const symptomPage = {
export const symtomPage = {
bleeding: {
excludeText: labels.bleeding.exclude.explainer,
note: null,
selectBoxGroups: null,
selectTabGroups: [
{
key: 'value',
@@ -146,13 +137,6 @@ export const symptomPage = {
title: labels.bleeding.heaviness.explainer,
},
],
selectBoxGroups: [
{
key: 'products',
options: productLabels,
title: labels.products.explainer,
},
],
},
cervix: {
excludeText: cervixLabels.excludeExplainer,
@@ -262,49 +246,10 @@ export const symptomPage = {
export const save = {
bleeding: (data, date, shouldDeleteData) => {
const {
value,
pad,
tampon,
underwear,
cup,
softTampon,
disk,
none,
other,
note,
} = data
let { exclude } = data
const isDataEntered = [
'value',
'pad',
'tampon',
'underwear',
'cup',
'softTampon',
'disk',
'none',
'other',
'note',
].some((value) => typeof data[value] === 'number' || data[value] == true)
// covering the case when a bleeding value was entered, "excluded" and saved. But then the bleeding value was deleted again.
exclude = isNumber(value) ? exclude : false
const { exclude, value } = data
const isDataEntered = isNumber(value)
const valuesToSave =
shouldDeleteData || !isDataEntered
? null
: {
exclude,
value,
pad,
tampon,
underwear,
cup,
softTampon,
disk,
none,
other,
note,
}
shouldDeleteData || !isDataEntered ? null : { value, exclude }
saveSymptom('bleeding', date, valuesToSave)
},
@@ -384,41 +329,10 @@ const saveBoxSymptom = (data, date, shouldDeleteData, symptom) => {
}
const label = {
bleeding: (bleeding) => {
bleeding = mapRealmObjToJsObj(bleeding)
const bleedingLabel = []
if (
bleeding &&
Object.values({ ...bleeding }).some(
(val) => typeof val === 'number' || val == true
)
) {
Object.keys(bleeding).forEach((key) => {
if (bleeding[key] != null && key === 'value') {
bleedingLabel.push(
bleeding.exclude
? `(${bleedingLabels[bleeding[key]]})`
: bleedingLabels[bleeding[key]]
)
}
if (
bleeding[key] &&
key !== 'other' &&
key !== 'note' &&
key !== 'value' &&
key !== 'exclude'
) {
bleedingLabel.push(bleedingLabels[key] || productLabels[key])
}
if (key === 'other' && bleeding.other) {
let label = productLabels[key]
if (bleeding.note) {
label = `${label} (${bleeding.note})`
}
bleedingLabel.push(label)
}
})
return bleedingLabel.join(', ')
bleeding: ({ value, exclude }) => {
if (isNumber(value)) {
const bleedingLabel = bleedingLabels[value]
return exclude ? `(${bleedingLabel})` : bleedingLabel
}
},
temperature: ({ value, time, exclude }) => {
+4
View File
@@ -18,6 +18,10 @@ const AboutSection = () => {
<AppPage title={t('title')}>
<Segment>
<AppText>{t('intro.text')}</AppText>
<Button isCTA isSmall onPress={() => Linking.openURL(links.faq.url)}>
{t('intro.faq')}
</Button>
<AppText>{t('intro.contact')}</AppText>
<ButtonRow>
{[links.email, links.gitlab, links.website].map((link) => (
<Button
+89
View File
@@ -0,0 +1,89 @@
import React from 'react'
import { FlatList, StyleSheet, View } from 'react-native'
import PropTypes from 'prop-types'
// import { useTranslation } from 'react-i18next'
import AppModal from '../common/app-modal'
import AppText from '../common/app-text'
import symOccModule from '../../lib/sympto-occurance'
import { Spacing, Typography, Colors } from '../../styles'
// const { t } = useTranslation(null, { keyPrefix: 'stats' })
const SymptomOccurance = ({ onClose }) => {
const cycleDays = symOccModule().getCycleStartsOfLastYear()
if (!cycleDays || cycleDays.length === 0) return false
console.log('cycle starts:', cycleDays)
const headacheDays = symOccModule().getPainDaysOfLastYear()
console.log('pain', headacheDays)
const cycleDaysOfPain = symOccModule().getCycleDayForPainDays(
cycleDays,
headacheDays
)
console.log('cycle days of pain', cycleDaysOfPain)
return (
<AppModal onClose={onClose}>
<View>
<FlatList
ListHeaderComponent={FlatListHeader}
contentContainerStyle={styles.container}
/>
</View>
</AppModal>
)
}
SymptomOccurance.propTypes = {
onClose: PropTypes.func,
}
const FlatListHeader = () => (
<View style={styles.row}>
<View style={styles.accentCell}>
<AppText style={styles.header}>
{'When did you experience headaches in the last year?'}
</AppText>
</View>
</View>
)
const styles = StyleSheet.create({
divider: {
height: 1,
width: '100%',
backgroundColor: Colors.grey,
},
header: {
...Typography.accentOrange,
paddingVertical: Spacing.small,
},
headerDivider: {
borderBottomColor: Colors.purple,
borderBottomWidth: 2,
},
row: {
flexDirection: 'row',
justifyContent: 'space-between',
paddingVertical: Spacing.tiny,
backgroundColor: 'white',
},
cell: {
flex: 2,
justifyContent: 'center',
},
accentCell: {
flex: 3,
justifyContent: 'center',
},
container: {
minHeight: '40%',
minWidth: '95%',
paddingHorizontal: Spacing.base,
},
})
export default SymptomOccurance
+11
View File
@@ -8,6 +8,7 @@ import Button from '../common/button'
import Footnote from '../common/Footnote'
import StatsOverview from './StatsOverview'
import PeriodDetailsModal from './PeriodDetailsModal'
import SymptomOccurance from './SymptomOccurance'
import cycleModule from '../../lib/cycle'
import { getCycleLengthStats as getCycleInfo } from '../../lib/cycle-length'
@@ -19,6 +20,8 @@ const image = require('../../assets/cycle-icon.png')
const Stats = () => {
const [isStatsVisible, setIsStatsVisible] = useState(false)
const [isSymptomOccuranceVisible, setIsSymptomOccuranceVisible] =
useState(false)
const { t } = useTranslation(null, { keyPrefix: 'stats' })
@@ -83,6 +86,14 @@ const Stats = () => {
{isStatsVisible && (
<PeriodDetailsModal onClose={() => setIsStatsVisible(false)} />
)}
<Button isCTA onPress={() => setIsSymptomOccuranceVisible(true)}>
{t('showSymptomOccurance')}
</Button>
{isSymptomOccuranceVisible && (
<SymptomOccurance
onClose={() => setIsSymptomOccuranceVisible(false)}
/>
)}
<Footnote>{t('footnote')}</Footnote>
</>
)}
+4 -1
View File
@@ -65,7 +65,6 @@ export function getBleedingDaysSortedByDate() {
return db
.objects('CycleDay')
.filtered('bleeding != null')
.filtered('bleeding.value != null')
.sorted('date', true)
}
export function getTemperatureDaysSortedByDate() {
@@ -74,6 +73,9 @@ export function getTemperatureDaysSortedByDate() {
.filtered('temperature != null')
.sorted('date', true)
}
export function getPainDaysSortedByDate() {
return db.objects('CycleDay').filtered('pain != null').sorted('date', true)
}
export function getCycleDaysSortedByDate() {
const cycleDays = db.objects('CycleDay').sorted('date', true)
@@ -89,6 +91,7 @@ export function getCycleStartsSortedByDate() {
export function saveSymptom(symptom, date, val) {
let cycleDay = getCycleDay(date)
if (!cycleDay) cycleDay = createCycleDay(date)
db.write(() => {
if (symptom === 'bleeding') {
const mensesDaysAfter = getMensesDaysRightAfter(cycleDay)
-195
View File
@@ -1,195 +0,0 @@
const TemperatureSchema = {
name: 'Temperature',
properties: {
value: 'double',
exclude: 'bool',
time: {
type: 'string',
optional: true,
},
note: {
type: 'string',
optional: true,
},
},
}
const BleedingSchema = {
name: 'Bleeding',
properties: {
value: { type: 'int', optional: true },
exclude: 'bool',
pad: { type: 'bool', optional: true },
tampon: { type: 'bool', optional: true },
underwear: { type: 'bool', optional: true },
cup: { type: 'bool', optional: true },
softTampon: { type: 'bool', optional: true },
disk: { type: 'bool', optional: true },
none: { type: 'bool', optional: true },
other: { type: 'bool', optional: true },
note: { type: 'string', optional: true },
},
}
const MucusSchema = {
name: 'Mucus',
properties: {
feeling: { type: 'int', optional: true },
texture: { type: 'int', optional: true },
value: { type: 'int', optional: true },
exclude: 'bool',
},
}
const CervixSchema = {
name: 'Cervix',
properties: {
opening: { type: 'int', optional: true },
firmness: { type: 'int', optional: true },
position: { type: 'int', optional: true },
exclude: 'bool',
},
}
const NoteSchema = {
name: 'Note',
properties: {
value: 'string',
},
}
const DesireSchema = {
name: 'Desire',
properties: {
value: 'int',
},
}
const SexSchema = {
name: 'Sex',
properties: {
solo: { type: 'bool', optional: true },
partner: { type: 'bool', optional: true },
condom: { type: 'bool', optional: true },
pill: { type: 'bool', optional: true },
iud: { type: 'bool', optional: true },
patch: { type: 'bool', optional: true },
ring: { type: 'bool', optional: true },
implant: { type: 'bool', optional: true },
diaphragm: { type: 'bool', optional: true },
none: { type: 'bool', optional: true },
other: { type: 'bool', optional: true },
note: { type: 'string', optional: true },
},
}
const PainSchema = {
name: 'Pain',
properties: {
cramps: { type: 'bool', optional: true },
ovulationPain: { type: 'bool', optional: true },
headache: { type: 'bool', optional: true },
backache: { type: 'bool', optional: true },
nausea: { type: 'bool', optional: true },
tenderBreasts: { type: 'bool', optional: true },
migraine: { type: 'bool', optional: true },
other: { type: 'bool', optional: true },
note: { type: 'string', optional: true },
},
}
const MoodSchema = {
name: 'Mood',
properties: {
happy: { type: 'bool', optional: true },
sad: { type: 'bool', optional: true },
stressed: { type: 'bool', optional: true },
balanced: { type: 'bool', optional: true },
fine: { type: 'bool', optional: true },
anxious: { type: 'bool', optional: true },
energetic: { type: 'bool', optional: true },
fatigue: { type: 'bool', optional: true },
angry: { type: 'bool', optional: true },
other: { type: 'bool', optional: true },
note: { type: 'string', optional: true },
},
}
const CycleDaySchema = {
name: 'CycleDay',
primaryKey: 'date',
properties: {
date: 'string',
temperature: {
type: 'Temperature',
optional: true,
},
isCycleStart: 'bool',
bleeding: {
type: 'Bleeding',
optional: true,
},
mucus: {
type: 'Mucus',
optional: true,
},
cervix: {
type: 'Cervix',
optional: true,
},
note: {
type: 'Note',
optional: true,
},
desire: {
type: 'Desire',
optional: true,
},
sex: {
type: 'Sex',
optional: true,
},
pain: {
type: 'Pain',
optional: true,
},
mood: {
type: 'Mood',
optional: true,
},
},
}
export default {
schema: [
CycleDaySchema,
TemperatureSchema,
BleedingSchema,
MucusSchema,
CervixSchema,
NoteSchema,
DesireSchema,
SexSchema,
PainSchema,
MoodSchema,
],
schemaVersion: 5,
migration: (oldRealm, newRealm) => {
if (oldRealm.schemaVersion < 5) {
const newObjects = newRealm.objects('Bleeding')
// loop through all objects and assign a default value for new properties
for (let i = 0; i < newObjects.length; i++) {
newObjects[i].pad = false
newObjects[i].tampon = false
newObjects[i].underwear = false
newObjects[i].cup = false
newObjects[i].softTampon = false
newObjects[i].disk = false
newObjects[i].none = false
newObjects[i].other = false
newObjects[i].note = null
}
}
},
}
+1 -2
View File
@@ -3,6 +3,5 @@ import schema1 from './1.js'
import schema2 from './2.js'
import schema3 from './3.js'
import schema4 from './4.js'
import schema5 from './5.js'
export default [schema0, schema1, schema2, schema3, schema4, schema5]
export default [schema0, schema1, schema2, schema3, schema4]
+5 -2
View File
@@ -45,7 +45,9 @@
"text": "The drips are developing this app on a volunteer basis. We are always grateful for support. This could mean condriputing to the code, giving feedback, suggesting improvements or features, testing or donating. It helps and motivates us maintaining this app and developing new features. Thank you for your support!"
},
"intro": {
"text": "Please note that your data is stored locally on your phone and not on a server. This means your data cannot be read by anyone else unless they have access to your phone. We want to ensure that you stay in control of your own data. If you are planning to switch or reset your phone, please remember to export your data before doing so. You can reinstall the app afterwards and import your data.\n\nIf you encounter any technical issues, don't hesitate to contact us via email. You can also contribute to the code base on Gitlab and visit our website."
"text": "Please note that your data is stored locally on your phone and not on a server. This means your data cannot be read by anyone else unless they have access to your phone. We want to ensure that you stay in control of your own data. If you are planning to switch or reset your phone, please remember to export your data before doing so. You can reinstall the app afterwards and import your data.\n\nIf you encounter any issues, please take a look at our Frequently Asked Questions page.",
"faq": "FAQ",
"contact": "\nIf your issue is not listed, don't hesitate to contact us via email. You can also contribute to the code base on Gitlab and visit our website."
},
"philosophy": {
"title": "Remember to think for yourself",
@@ -154,7 +156,8 @@
"cycleLength": "Cycle length",
"bleedingDays": "Bleeding"
},
"footnote": "Based on the standard deviation of all your tracked periods drip. calculates a range for the starting day of the upcoming 3 periods. The range will be 3 days if your standard deviation is smaller than 1.5 and 5 days if the value is bigger.\n\nThe standard deviation tells you how much the length of your periods vary, 0 means all your periods are exactly the same length and the bigger the value the more the period length varies."
"footnote": "Based on the standard deviation of all your tracked periods drip. calculates a range for the starting day of the upcoming 3 periods. The range will be 3 days if your standard deviation is smaller than 1.5 and 5 days if the value is bigger.\n\nThe standard deviation tells you how much the length of your periods vary, 0 means all your periods are exactly the same length and the bigger the value the more the period length varies.",
"showSymptomOccurance": "Show details on headaches"
},
"plurals": {
"day": "{{count}} day",
+2 -17
View File
@@ -13,21 +13,6 @@ export const bleeding = {
},
}
export const products = {
categories: {
pad: 'pad',
tampon: 'tampon',
underwear: 'underwear',
cup: 'cup',
softTampon: 'soft tampon',
disk: 'disk',
none: 'none',
other: 'other',
},
header: 'period products',
explainer: 'Did you use period products?',
}
export const cervix = {
subcategories: {
opening: 'opening',
@@ -47,7 +32,7 @@ export const cervix = {
explainer: 'How high up in the vagina is the cervix?',
},
excludeExplainer:
"You can exclude these values if you don't want to use them for fertility detection.",
"You can exclude this value if you don't want to use it for fertility detection.",
}
export const mucus = {
@@ -65,7 +50,7 @@ export const mucus = {
'Looking at and touching your cervical mucus, which describes it best?',
},
excludeExplainer:
"You can exclude these values if you don't want to use them for fertility detection",
"You can exclude this value if you don't want to use it for fertility detection",
}
export const desire = {
+4
View File
@@ -39,4 +39,8 @@ export default {
url: 'https://www.flaticon.com',
text: 'Flaticon',
},
faq: {
url: 'https://dripapp.org/faq',
text: 'FAQ',
},
}
+1 -1
View File
@@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2409.26</string>
<string>1.2403.19</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
+8 -10
View File
@@ -1,9 +1,7 @@
export default function ({
val,
cycleDay,
mensesDaysAfter,
checkIsMensesStart,
val, cycleDay, mensesDaysAfter, checkIsMensesStart
}) {
cycleDay.bleeding = val
// if a bleeding value is deleted or excluded, we need to check if there are
@@ -22,15 +20,15 @@ export default function ({
}
function bleedingValueDeletedOrExluded(val) {
const bleedingDeleted = !val || !(typeof val?.value === 'number')
const bleedingDeleted = !val
const bleedingExcluded = val && val.exclude
return bleedingDeleted || bleedingExcluded
}
function maybeClearOldCycleStarts() {
// if we have a new bleeding day, we need to clear the
// menses start marker from all following days of this
// menses that may have been marked as start before
mensesDaysAfter.forEach((day) => (day.isCycleStart = false))
// if we have a new bleeding day, we need to clear the
// menses start marker from all following days of this
// menses that may have been marked as start before
mensesDaysAfter.forEach(day => day.isCycleStart = false)
}
}
}
+70
View File
@@ -0,0 +1,70 @@
import * as joda from '@js-joda/core'
const LocalDate = joda.LocalDate
const DAYS = joda.ChronoUnit.DAYS
export default function config(opts) {
let cycleStartsSortedByDate
let painSortedByDate
if (!opts) {
// we only want to require (and run) the db module
// when not running the tests
cycleStartsSortedByDate = require('../db').getCycleStartsSortedByDate()
painSortedByDate = require('../db').getPainDaysSortedByDate()
// maxCycleLength = 45
} else {
cycleStartsSortedByDate = opts.cycleStartsSortedByDate || []
painSortedByDate = opts.painSortedByDate || []
// maxCycleLength = opts.maxCycleLength || 99
}
function getCycleStartsOfLastYear() {
const today = LocalDate.parse(new Date().toISOString().slice(0, 10))
const firstRelevantDay = today.minusYears(1)
const relevantCycles = cycleStartsSortedByDate.filter(({ date }) =>
LocalDate.parse(date).isAfter(firstRelevantDay)
)
return relevantCycles.map(({ date }) => date)
}
function getPainDaysOfLastYear() {
const today = LocalDate.parse(new Date().toISOString().slice(0, 10))
const firstRelevantDay = today.minusYears(1)
const relevantPainDays = painSortedByDate.filter(
({ date, pain }) =>
LocalDate.parse(date).isAfter(firstRelevantDay) && pain.headache
)
return relevantPainDays.map(({ date }) => date)
}
function getCycleDayForPainDays(cycleStarts, painDays) {
let i = 0
const cycleStartsAsc = cycleStarts.sort().reverse()
const painDaysAsc = painDays.sort().reverse()
const painCycleDays = painDaysAsc.map((pdate) => {
if (LocalDate.parse(pdate).isBefore(LocalDate.parse(cycleStartsAsc[i]))) {
// increase index i until cycleStart of this painDay is found
for (let j = i + 1; j < cycleStartsAsc.length; j++) {
i = j
if (
!LocalDate.parse(cycleStartsAsc[i]).isAfter(LocalDate.parse(pdate))
) {
// not(C > P) === C ≤ P
break
}
}
}
return LocalDate.parse(cycleStartsAsc[i]).until(
LocalDate.parse(pdate),
DAYS
)
})
return painCycleDays
}
return {
getCycleStartsOfLastYear,
getPainDaysOfLastYear,
getCycleDayForPainDays,
}
}
+3 -2
View File
@@ -1,13 +1,14 @@
{
"name": "drip.",
"version": "1.2409.26",
"version": "1.2403.19",
"contributors": [
"Julia Friesel <julia.friesel@gmail.com>",
"Marie Kochsiek",
"Tina Baumann",
"Sofiya Tepikin",
"Mariya Zadnepryanets",
"Lisa Hillebrand"
"Lisa Hillebrand",
"Martha Dörfler"
],
"scripts": {
"start": "react-native start",