Update settings reset to default buttons for all number fields
This commit is contained in:
@@ -33,6 +33,8 @@ const getDefaultsForTranslation = (pkParams: any, therapeuticRange: any, uiSetti
|
|||||||
// UI Settings
|
// UI Settings
|
||||||
simulationDays: defaults.uiSettings.simulationDays,
|
simulationDays: defaults.uiSettings.simulationDays,
|
||||||
displayedDays: defaults.uiSettings.displayedDays,
|
displayedDays: defaults.uiSettings.displayedDays,
|
||||||
|
yAxisMin: defaults.uiSettings.yAxisMin,
|
||||||
|
yAxisMax: defaults.uiSettings.yAxisMax,
|
||||||
therapeuticRangeMin: defaults.therapeuticRange.min,
|
therapeuticRangeMin: defaults.therapeuticRange.min,
|
||||||
therapeuticRangeMax: defaults.therapeuticRange.max,
|
therapeuticRangeMax: defaults.therapeuticRange.max,
|
||||||
|
|
||||||
@@ -44,6 +46,7 @@ const getDefaultsForTranslation = (pkParams: any, therapeuticRange: any, uiSetti
|
|||||||
// Advanced Settings
|
// Advanced Settings
|
||||||
standardVdValue: defaults.pkParams.advanced.standardVd?.preset === 'adult' ? '377' : defaults.pkParams.advanced.standardVd?.preset === 'child' ? '175' : defaults.pkParams.advanced.standardVd?.customValue || '377',
|
standardVdValue: defaults.pkParams.advanced.standardVd?.preset === 'adult' ? '377' : defaults.pkParams.advanced.standardVd?.preset === 'child' ? '175' : defaults.pkParams.advanced.standardVd?.customValue || '377',
|
||||||
standardVdPreset: defaults.pkParams.advanced.standardVd?.preset || 'adult',
|
standardVdPreset: defaults.pkParams.advanced.standardVd?.preset || 'adult',
|
||||||
|
customVdValue: defaults.pkParams.advanced.standardVd.customValue,
|
||||||
bodyWeight: defaults.pkParams.advanced.standardVd.bodyWeight,
|
bodyWeight: defaults.pkParams.advanced.standardVd.bodyWeight,
|
||||||
tmaxDelay: defaults.pkParams.advanced.foodEffect.tmaxDelay,
|
tmaxDelay: defaults.pkParams.advanced.foodEffect.tmaxDelay,
|
||||||
fOral: defaults.pkParams.advanced.fOral,
|
fOral: defaults.pkParams.advanced.fOral,
|
||||||
@@ -407,6 +410,8 @@ const Settings = ({
|
|||||||
required={true}
|
required={true}
|
||||||
error={!!therapeuticRangeError || !therapeuticRange.min}
|
error={!!therapeuticRangeError || !therapeuticRange.min}
|
||||||
errorMessage={therapeuticRangeError || t('errorTherapeuticRangeMinRequired') || 'Minimum therapeutic range is required'}
|
errorMessage={therapeuticRangeError || t('errorTherapeuticRangeMinRequired') || 'Minimum therapeutic range is required'}
|
||||||
|
showResetButton={true}
|
||||||
|
defaultValue={defaultsForT.therapeuticRangeMin}
|
||||||
/>
|
/>
|
||||||
<span className="text-muted-foreground">-</span>
|
<span className="text-muted-foreground">-</span>
|
||||||
<FormNumericInput
|
<FormNumericInput
|
||||||
@@ -420,6 +425,8 @@ const Settings = ({
|
|||||||
required={true}
|
required={true}
|
||||||
error={!!therapeuticRangeError || !therapeuticRange.max}
|
error={!!therapeuticRangeError || !therapeuticRange.max}
|
||||||
errorMessage={therapeuticRangeError || t('errorTherapeuticRangeMaxRequired') || 'Maximum therapeutic range is required'}
|
errorMessage={therapeuticRangeError || t('errorTherapeuticRangeMaxRequired') || 'Maximum therapeutic range is required'}
|
||||||
|
showResetButton={true}
|
||||||
|
defaultValue={defaultsForT.therapeuticRangeMax}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -458,7 +465,7 @@ const Settings = ({
|
|||||||
required={true}
|
required={true}
|
||||||
errorMessage={t('errorNumberRequired')}
|
errorMessage={t('errorNumberRequired')}
|
||||||
showResetButton={true}
|
showResetButton={true}
|
||||||
defaultValue="2"
|
defaultValue={defaultsForT.displayedDays}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -492,7 +499,7 @@ const Settings = ({
|
|||||||
placeholder={t('auto')}
|
placeholder={t('auto')}
|
||||||
allowEmpty={true}
|
allowEmpty={true}
|
||||||
showResetButton={true}
|
showResetButton={true}
|
||||||
defaultValue=""
|
defaultValue={defaultsForT.yAxisMin}
|
||||||
warning={!!yAxisRangeError}
|
warning={!!yAxisRangeError}
|
||||||
warningMessage={yAxisRangeError}
|
warningMessage={yAxisRangeError}
|
||||||
/>
|
/>
|
||||||
@@ -507,7 +514,7 @@ const Settings = ({
|
|||||||
unit="ng/ml"
|
unit="ng/ml"
|
||||||
allowEmpty={true}
|
allowEmpty={true}
|
||||||
showResetButton={true}
|
showResetButton={true}
|
||||||
defaultValue=""
|
defaultValue={defaultsForT.yAxisMax}
|
||||||
warning={!!yAxisRangeError}
|
warning={!!yAxisRangeError}
|
||||||
warningMessage={yAxisRangeError}
|
warningMessage={yAxisRangeError}
|
||||||
/>
|
/>
|
||||||
@@ -602,7 +609,7 @@ const Settings = ({
|
|||||||
required={true}
|
required={true}
|
||||||
errorMessage={t('errorNumberRequired')}
|
errorMessage={t('errorNumberRequired')}
|
||||||
showResetButton={true}
|
showResetButton={true}
|
||||||
defaultValue="5"
|
defaultValue={defaultsForT.simulationDays}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -655,7 +662,7 @@ const Settings = ({
|
|||||||
unit={t('unitDays')}
|
unit={t('unitDays')}
|
||||||
required={true}
|
required={true}
|
||||||
showResetButton={true}
|
showResetButton={true}
|
||||||
defaultValue="7"
|
defaultValue={defaultsForT.steadyStateDays}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -707,7 +714,7 @@ const Settings = ({
|
|||||||
warningMessage={t('warningEliminationOutOfRange')}
|
warningMessage={t('warningEliminationOutOfRange')}
|
||||||
errorMessage={t('errorEliminationHalfLifeRequired')}
|
errorMessage={t('errorEliminationHalfLifeRequired')}
|
||||||
showResetButton={true}
|
showResetButton={true}
|
||||||
defaultValue="11"
|
defaultValue={defaultsForT.damphHalfLife}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -746,7 +753,7 @@ const Settings = ({
|
|||||||
warningMessage={t('warningConversionOutOfRange')}
|
warningMessage={t('warningConversionOutOfRange')}
|
||||||
errorMessage={t('errorConversionHalfLifeRequired')}
|
errorMessage={t('errorConversionHalfLifeRequired')}
|
||||||
showResetButton={true}
|
showResetButton={true}
|
||||||
defaultValue="0.8"
|
defaultValue={defaultsForT.ldxHalfLife}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -781,6 +788,8 @@ const Settings = ({
|
|||||||
warning={absorptionWarning}
|
warning={absorptionWarning}
|
||||||
warningMessage={t('warningAbsorptionOutOfRange')}
|
warningMessage={t('warningAbsorptionOutOfRange')}
|
||||||
errorMessage={t('errorAbsorptionRateRequired')}
|
errorMessage={t('errorAbsorptionRateRequired')}
|
||||||
|
showResetButton={true}
|
||||||
|
defaultValue={defaultsForT.ldxAbsorptionHalfLife}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
@@ -855,6 +864,8 @@ const Settings = ({
|
|||||||
max={2000}
|
max={2000}
|
||||||
unit="L"
|
unit="L"
|
||||||
required={true}
|
required={true}
|
||||||
|
showResetButton={true}
|
||||||
|
defaultValue={defaultsForT.customVdValue}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -887,6 +898,8 @@ const Settings = ({
|
|||||||
max={300}
|
max={300}
|
||||||
unit={t('bodyWeightUnit')}
|
unit={t('bodyWeightUnit')}
|
||||||
required={true}
|
required={true}
|
||||||
|
showResetButton={true}
|
||||||
|
defaultValue={defaultsForT.bodyWeight}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -923,6 +936,8 @@ const Settings = ({
|
|||||||
max={5}
|
max={5}
|
||||||
unit={t('tmaxDelayUnit')}
|
unit={t('tmaxDelayUnit')}
|
||||||
required={true}
|
required={true}
|
||||||
|
showResetButton={true}
|
||||||
|
defaultValue={defaultsForT.tmaxDelay}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1102,6 +1117,8 @@ const Settings = ({
|
|||||||
min={0.5}
|
min={0.5}
|
||||||
max={1.0}
|
max={1.0}
|
||||||
required={true}
|
required={true}
|
||||||
|
showResetButton={true}
|
||||||
|
defaultValue={defaultsForT.fOral}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user