Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 960a411794 | |||
| eda7d9c7f3 | |||
| 8db4424df5 | |||
| d822d057a3 | |||
| 3b797b8500 | |||
| 503ce6e82d |
@@ -34,31 +34,13 @@ or clone it with HTTPS
|
||||
|
||||
git clone https://gitlab.com/bloodyhealth/drip.git
|
||||
|
||||
### 2. Node version
|
||||
### 2. Node & yarn 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
|
||||
@@ -145,18 +127,6 @@ 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`.
|
||||
|
||||
+36
-61
@@ -7,38 +7,27 @@ 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 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!
|
||||
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
|
||||
### Release steps
|
||||
|
||||
### 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)
|
||||
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)
|
||||
|
||||
### 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
|
||||
## 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.
|
||||
|
||||
@@ -123,50 +112,42 @@ 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).
|
||||
|
||||
### 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
|
||||
## 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
|
||||
**v1.yymm.d**
|
||||
|
||||
### Release notes
|
||||
**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.
|
||||
|
||||
### Releases on Gitlab
|
||||
## Release tag
|
||||
|
||||
Under [Releases](https://gitlab.com/bloodyhealth/drip/-/releases) we keep track of all drip releases.
|
||||
[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
|
||||
## 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).
|
||||
|
||||
@@ -183,17 +164,11 @@ 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:
|
||||
|
||||
@@ -203,6 +178,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!
|
||||
|
||||
@@ -63,11 +63,11 @@ const SymptomBox = ({
|
||||
/>
|
||||
<View style={styles.textContainer}>
|
||||
<AppText style={symptomNameStyle}>{t(symptom)}</AppText>
|
||||
{symptomDataToDisplay && (
|
||||
<AppText style={textStyle} numberOfLines={3}>
|
||||
{symptomDataToDisplay ? (
|
||||
<AppText style={textStyle} numberOfLines={4}>
|
||||
{symptomDataToDisplay}
|
||||
</AppText>
|
||||
)}
|
||||
) : null}
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</>
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
import React, { useState } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import {
|
||||
Dimensions,
|
||||
Platform,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
View,
|
||||
} from 'react-native'
|
||||
import { ScrollView, StyleSheet, View } from 'react-native'
|
||||
|
||||
import AppModal from '../common/app-modal'
|
||||
import AppSwitch from '../common/app-switch'
|
||||
@@ -18,7 +12,7 @@ import SelectBoxGroup from './select-box-group'
|
||||
import SelectTabGroup from './select-tab-group'
|
||||
import Temperature from './temperature'
|
||||
|
||||
import { blank, save, shouldShow, symtomPage } from '../helpers/cycle-day'
|
||||
import { blank, save, shouldShow, symptomPage } from '../helpers/cycle-day'
|
||||
import { showToast } from '../helpers/general'
|
||||
|
||||
import { fertilityTrackingObservable } from '../../local-storage'
|
||||
@@ -27,9 +21,10 @@ import info from '../../i18n/en/symptom-info'
|
||||
import { Colors, Containers, Sizes, Spacing } from '../../styles'
|
||||
|
||||
const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
|
||||
const symptomConfig = symtomPage[symptom]
|
||||
const symptomConfig = symptomPage[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
|
||||
@@ -117,14 +112,20 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
|
||||
const noteText = symptom === 'note' ? data.value : data.note
|
||||
const inputProps = {
|
||||
multiline: true,
|
||||
numberOfLines: Platform.OS === 'ios' ? null : 4, // only Android
|
||||
minHeight: Platform.OS === 'ios' ? styles.input.height : null,
|
||||
maxHeight:
|
||||
Platform.OS === 'ios' ? Dimensions.get('window').height * 0.4 : null,
|
||||
style: symptom === 'note' ? null : styles.input, // overwrites previous 2 lines to fix note space in symptoms
|
||||
scrollEnabled: true,
|
||||
numberOfLines: 3,
|
||||
scrollEnabled: false,
|
||||
style: styles.input,
|
||||
textAlignVertical: 'top',
|
||||
}
|
||||
const excludeToggle = shouldShow(symptomConfig.excludeText) && (
|
||||
<Segment style={styles.segmentBorder}>
|
||||
<AppSwitch
|
||||
onToggle={onExcludeToggle}
|
||||
text={symptomPage[symptom].excludeText}
|
||||
value={data.exclude}
|
||||
/>
|
||||
</Segment>
|
||||
)
|
||||
|
||||
return (
|
||||
<AppModal onClose={onSave}>
|
||||
@@ -139,10 +140,16 @@ 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) &&
|
||||
symtomPage[symptom].selectTabGroups.map((group) => {
|
||||
symptomPage[symptom].selectTabGroups.map((group) => {
|
||||
return (
|
||||
<Segment key={group.key} style={styles.segmentBorder}>
|
||||
<Segment
|
||||
key={group.key}
|
||||
style={styles.segmentBorder}
|
||||
last={isBleeding}
|
||||
>
|
||||
<AppText style={styles.title}>{group.title}</AppText>
|
||||
<SelectTabGroup
|
||||
activeButton={data[group.key]}
|
||||
@@ -152,8 +159,12 @@ 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) &&
|
||||
symtomPage[symptom].selectBoxGroups.map((group) => {
|
||||
symptomPage[symptom].selectBoxGroups.map((group) => {
|
||||
const isOtherSelected =
|
||||
data['other'] !== null &&
|
||||
data['other'] !== false &&
|
||||
@@ -192,7 +203,7 @@ const SymptomEditView = ({ date, onClose, symptom, symptomData }) => {
|
||||
)}
|
||||
{shouldShow(symptomConfig.note) && (
|
||||
<Segment style={styles.segmentBorder}>
|
||||
<AppText>{symtomPage[symptom].note}</AppText>
|
||||
<AppText>{symptomPage[symptom].note}</AppText>
|
||||
<AppTextInput
|
||||
{...inputProps}
|
||||
onChangeText={onEditNote}
|
||||
|
||||
@@ -23,6 +23,7 @@ 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
|
||||
|
||||
@@ -60,6 +61,15 @@ 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,
|
||||
@@ -125,11 +135,10 @@ export const blank = {
|
||||
},
|
||||
}
|
||||
|
||||
export const symtomPage = {
|
||||
export const symptomPage = {
|
||||
bleeding: {
|
||||
excludeText: labels.bleeding.exclude.explainer,
|
||||
note: null,
|
||||
selectBoxGroups: null,
|
||||
selectTabGroups: [
|
||||
{
|
||||
key: 'value',
|
||||
@@ -137,6 +146,13 @@ export const symtomPage = {
|
||||
title: labels.bleeding.heaviness.explainer,
|
||||
},
|
||||
],
|
||||
selectBoxGroups: [
|
||||
{
|
||||
key: 'products',
|
||||
options: productLabels,
|
||||
title: labels.products.explainer,
|
||||
},
|
||||
],
|
||||
},
|
||||
cervix: {
|
||||
excludeText: cervixLabels.excludeExplainer,
|
||||
@@ -246,12 +262,7 @@ export const symtomPage = {
|
||||
|
||||
export const save = {
|
||||
bleeding: (data, date, shouldDeleteData) => {
|
||||
const { exclude, value } = data
|
||||
const isDataEntered = isNumber(value)
|
||||
const valuesToSave =
|
||||
shouldDeleteData || !isDataEntered ? null : { value, exclude }
|
||||
|
||||
saveSymptom('bleeding', date, valuesToSave)
|
||||
saveBoxSymptom(data, date, shouldDeleteData, 'bleeding')
|
||||
},
|
||||
cervix: (data, date, shouldDeleteData) => {
|
||||
const { opening, firmness, position, exclude } = data
|
||||
@@ -329,10 +340,36 @@ const saveBoxSymptom = (data, date, shouldDeleteData, symptom) => {
|
||||
}
|
||||
|
||||
const label = {
|
||||
bleeding: ({ value, exclude }) => {
|
||||
if (isNumber(value)) {
|
||||
const bleedingLabel = bleedingLabels[value]
|
||||
return exclude ? `(${bleedingLabel})` : bleedingLabel
|
||||
bleeding: (bleeding) => {
|
||||
bleeding = mapRealmObjToJsObj(bleeding)
|
||||
const bleedingLabel = []
|
||||
if (bleeding && Object.values({ ...bleeding }).some((val) => val)) {
|
||||
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(', ')
|
||||
}
|
||||
},
|
||||
temperature: ({ value, time, exclude }) => {
|
||||
|
||||
+2
-2
@@ -65,6 +65,7 @@ export function getBleedingDaysSortedByDate() {
|
||||
return db
|
||||
.objects('CycleDay')
|
||||
.filtered('bleeding != null')
|
||||
.filtered('bleeding.value != null')
|
||||
.sorted('date', true)
|
||||
}
|
||||
export function getTemperatureDaysSortedByDate() {
|
||||
@@ -88,9 +89,8 @@ export function getCycleStartsSortedByDate() {
|
||||
export function saveSymptom(symptom, date, val) {
|
||||
let cycleDay = getCycleDay(date)
|
||||
if (!cycleDay) cycleDay = createCycleDay(date)
|
||||
|
||||
db.write(() => {
|
||||
if (symptom === 'bleeding') {
|
||||
if (symptom === 'bleeding' && val != null && val.value != null) {
|
||||
const mensesDaysAfter = getMensesDaysRightAfter(cycleDay)
|
||||
maybeSetNewCycleStart({
|
||||
val,
|
||||
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
+2
-1
@@ -3,5 +3,6 @@ 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]
|
||||
export default [schema0, schema1, schema2, schema3, schema4, schema5]
|
||||
|
||||
@@ -13,6 +13,21 @@ 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',
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@
|
||||
"scripts": {
|
||||
"start": "react-native start",
|
||||
"android": "react-native run-android",
|
||||
"ios": "react-native run-ios --simulator=\"iPhone 8 Plus\"",
|
||||
"ios15": "react-native run-ios --simulator=\"iPhone 15 Plus\"",
|
||||
"ios": "react-native run-ios --simulator=\"iPhone 15\"",
|
||||
"iosSE": "react-native run-ios --simulator=\"iPhone SE (2nd generation)\"",
|
||||
"log": "react-native log-android",
|
||||
"test": "jest test && yarn lint",
|
||||
"test-watch": "jest --watch test",
|
||||
|
||||
Reference in New Issue
Block a user