Merge branch '365-show-incomplete-symptom-in-day-view' into 'master'
Resolve "show incomplete symptom in day view" Closes #365 See merge request bloodyhealth/drip!218
This commit is contained in:
@@ -15,11 +15,6 @@ import AppText from '../app-text'
|
|||||||
import DripIcon from '../../assets/drip-icons'
|
import DripIcon from '../../assets/drip-icons'
|
||||||
|
|
||||||
const bleedingLabels = labels.bleeding.labels
|
const bleedingLabels = labels.bleeding.labels
|
||||||
const feelingLabels = labels.mucus.feeling.categories
|
|
||||||
const textureLabels = labels.mucus.texture.categories
|
|
||||||
const openingLabels = labels.cervix.opening.categories
|
|
||||||
const firmnessLabels = labels.cervix.firmness.categories
|
|
||||||
const positionLabels = labels.cervix.position.categories
|
|
||||||
const intensityLabels = labels.intensity
|
const intensityLabels = labels.intensity
|
||||||
const sexLabels = labels.sex.categories
|
const sexLabels = labels.sex.categories
|
||||||
const contraceptiveLabels = labels.contraceptives.categories
|
const contraceptiveLabels = labels.contraceptives.categories
|
||||||
@@ -72,28 +67,25 @@ export default class CycleDayOverView extends Component {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mucus: mucus => {
|
mucus: mucus => {
|
||||||
const categories = ['feeling', 'texture', 'value']
|
const filledCategories = ['feeling', 'texture'].filter(c => isNumber(mucus[c]))
|
||||||
if (categories.every(c => isNumber(mucus[c]))) {
|
let label = filledCategories.map(category => {
|
||||||
let mucusLabel = [feelingLabels[mucus.feeling], textureLabels[mucus.texture]].join(', ')
|
return labels.mucus[category].categories[mucus[category]]
|
||||||
mucusLabel += `\n${labels.mucusNFP[mucus.value]}`
|
}).join(', ')
|
||||||
if (mucus.exclude) mucusLabel = `(${mucusLabel})`
|
|
||||||
return mucusLabel
|
if (isNumber(mucus.value)) label += `\n${labels.mucusNFP[mucus.value]}`
|
||||||
}
|
if (mucus.exclude) label = `(${label})`
|
||||||
|
|
||||||
|
return label
|
||||||
},
|
},
|
||||||
cervix: cervix => {
|
cervix: cervix => {
|
||||||
let cervixLabel = []
|
const filledCategories = ['opening', 'firmness', 'position'].filter(c => isNumber(cervix[c]))
|
||||||
if (isNumber(cervix.opening) && isNumber(cervix.firmness)) {
|
let label = filledCategories.map(category => {
|
||||||
cervixLabel.push(
|
return labels.cervix[category].categories[cervix[category]]
|
||||||
openingLabels[cervix.opening],
|
}).join(', ')
|
||||||
firmnessLabels[cervix.firmness]
|
|
||||||
)
|
if (cervix.exclude) label = `(${label})`
|
||||||
if (isNumber(cervix.position)) {
|
|
||||||
cervixLabel.push(positionLabels[cervix.position])
|
return label
|
||||||
}
|
|
||||||
cervixLabel = cervixLabel.join(', ')
|
|
||||||
if (cervix.exclude) cervixLabel = `(${cervixLabel})`
|
|
||||||
return cervixLabel
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
note: note => {
|
note: note => {
|
||||||
return note.value
|
return note.value
|
||||||
@@ -319,4 +311,4 @@ class FillerBoxes extends Component {
|
|||||||
|
|
||||||
function isNumber(val) {
|
function isNumber(val) {
|
||||||
return typeof val === 'number'
|
return typeof val === 'number'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user