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