diff --git a/components/cycle-day/cycle-day-overview.js b/components/cycle-day/cycle-day-overview.js index 98a7880829d5cdfbd844c1b6177a4675aedd0473..220365302d91c9c5f2b77600b1b134434b34ef68 100644 --- a/components/cycle-day/cycle-day-overview.js +++ b/components/cycle-day/cycle-day-overview.js @@ -9,6 +9,7 @@ import { bleeding as labels, mucusFeeling as feelingLabels, mucusTexture as textureLabels, + mucusNFP as computeSensiplanMucusLabels, } from '../labels/labels' import cycleDayModule from '../lib/get-cycle-day-number' import { bleedingDaysSortedByDate } from '../db' @@ -61,9 +62,10 @@ export default class DayView extends Component { const mucusFeelingValue = this.cycleDay.mucus && this.cycleDay.mucus.feeling const mucusTextureValue = this.cycleDay.mucus && this.cycleDay.mucus.texture + const mucusComputedValue = this.cycleDay.mucus && this.cycleDay.mucus.computedNfp let mucusLabel if (typeof mucusFeelingValue === 'number' && typeof mucusTextureValue === 'number') { - mucusLabel = `${feelingLabels[mucusFeelingValue]} + ${textureLabels[mucusTextureValue]}` + mucusLabel = `${feelingLabels[mucusFeelingValue]} + ${textureLabels[mucusTextureValue]} ( ${computeSensiplanMucusLabels[mucusComputedValue]} )` if (this.cycleDay.mucus.exclude) mucusLabel = "( " + mucusLabel + " )" } else { mucusLabel = 'edit' diff --git a/components/cycle-day/labels/labels.js b/components/cycle-day/labels/labels.js index 83c1afe00afabe935f9cf89c3747e0ed81659274..459370b25504e613605520d48b7bb967a1440624 100644 --- a/components/cycle-day/labels/labels.js +++ b/components/cycle-day/labels/labels.js @@ -1,9 +1,11 @@ const bleeding = ['spotting', 'light', 'medium', 'heavy'] const mucusFeeling = ['dry', 'nothing', 'wet', 'slippery'] const mucusTexture = ['nothing', 'creamy', 'egg white'] +const mucusNFP = ['t', 'Ø', 'f', 'S', '+S'] export { bleeding, mucusFeeling, - mucusTexture + mucusTexture, + mucusNFP } diff --git a/components/mucus.js b/components/mucus.js index 4c75148f330085a82dc04918c8889f25c1c60a9f..c1d47df09cdf60a547d6efc8be50750adf41af55 100644 --- a/components/mucus.js +++ b/components/mucus.js @@ -32,6 +32,7 @@ export default class Mucus extends Component { this.state = { currentFeelingValue, currentTextureValue, + computeSensiplanValue, exclude: this.cycleDay.mucus ? this.cycleDay.mucus.exclude : false } @@ -138,7 +139,7 @@ export default class Mucus extends Component { saveMucus(this.cycleDay, { feeling: this.state.currentFeelingValue, texture: this.state.currentTextureValue, - computedValue: computeSensiplanValue(this.state.currentFeelingValue, this.state.currentTextureValue), + computedNfp: computeSensiplanValue(this.state.currentFeelingValue, this.state.currentTextureValue), exclude: this.state.exclude }) this.showView('dayView') diff --git a/db.js b/db.js index 455acd824d5ffcdc0d5227646ce7f6607cadfcba..c0533bf307529a29f65c3f3aea2067d62eb76a29 100644 --- a/db.js +++ b/db.js @@ -23,6 +23,7 @@ const MucusSchema = { properties: { feeling: 'int', texture: 'int', + computedNfp: 'int', exclude: 'bool' } }