Project parameters edition
This commit is contained in:
@ -8,7 +8,7 @@ export interface EditableTextProps {
|
||||
class?: string
|
||||
editIconClass?: string
|
||||
onChange?: (value: string) => void
|
||||
render: (value: string) => ComponentChild
|
||||
render?: (value: string) => ComponentChild
|
||||
}
|
||||
|
||||
const EditableText: FunctionalComponent<EditableTextProps> = ({ onChange, value, render, ...props }) => {
|
||||
@ -45,7 +45,7 @@ const EditableText: FunctionalComponent<EditableTextProps> = ({ onChange, value,
|
||||
</div>
|
||||
</div> :
|
||||
<Fragment>
|
||||
{ render(internalValue) }
|
||||
{ render ? render(internalValue) : <span>{internalValue}</span> }
|
||||
<i class={`${style.editIcon} icon ${props.editIconClass ? props.editIconClass : ''}`} onClick={onEditIconClick}>🖋️</i>
|
||||
</Fragment>
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
.editableText {
|
||||
display: inherit;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.editableText > * {
|
||||
|
@ -9,13 +9,17 @@ export interface EstimationRangeProps {
|
||||
|
||||
export const EstimationRange: FunctionalComponent<EstimationRangeProps> = ({ project, estimation, sdFactor }) => {
|
||||
const roundUp = getRoundUpEstimations(project);
|
||||
const e = roundUp ? Math.ceil(estimation.e) : estimation.e;
|
||||
const sd = roundUp ? Math.ceil(estimation.sd * sdFactor) : (estimation.sd * sdFactor);
|
||||
let e = roundUp ? Math.ceil(estimation.e) : estimation.e;
|
||||
let sd = roundUp ? Math.ceil(estimation.sd * sdFactor) : (estimation.sd * sdFactor);
|
||||
const max = e+sd;
|
||||
const min = Math.max(e-sd, 0);
|
||||
if (!roundUp) {
|
||||
sd = sd.toFixed(2);
|
||||
e = e.toFixed(2);
|
||||
}
|
||||
return (
|
||||
<Fragment>
|
||||
<abbr title={`max: ${max}, min: ${min}`}>{`${e} ± ${sd}`}</abbr> <ProjectTimeUnit project={project} />
|
||||
<abbr title={`max: ${max.toFixed(2)}, min: ${min.toFixed(2)}`}>{`${e} ± ${sd}`}</abbr> <ProjectTimeUnit project={project} />
|
||||
</Fragment>
|
||||
|
||||
);
|
||||
|
Reference in New Issue
Block a user