diff --git a/client/src/routes/project/tasks-table.tsx b/client/src/routes/project/tasks-table.tsx
index f757024..7b24f75 100644
--- a/client/src/routes/project/tasks-table.tsx
+++ b/client/src/routes/project/tasks-table.tsx
@@ -10,15 +10,16 @@ import ProjectTimeUnit from "../../components/project-time-unit";
export interface TaskTableProps {
project: Project
- onTaskAdd: (task: Task) => void
- onTaskRemove: (taskId: TaskID) => void
- onEstimationChange: (taskId: TaskID, confidence: EstimationConfidence, value: number) => void
- onTaskLabelUpdate: (taskId: TaskID, label: string) => void
+ onTaskAdd?: (task: Task) => void
+ onTaskRemove?: (taskId: TaskID) => void
+ onEstimationChange?: (taskId: TaskID, confidence: EstimationConfidence, value: number) => void
+ onTaskLabelUpdate?: (taskId: TaskID, label: string) => void
+ readonly?: boolean;
}
export type EstimationTotals = { [confidence in EstimationConfidence]: number }
-const TaskTable: FunctionalComponent
= ({ project, onTaskAdd, onEstimationChange, onTaskRemove, onTaskLabelUpdate }) => {
+const TaskTable: FunctionalComponent = ({ project, onTaskAdd, onEstimationChange, onTaskRemove, onTaskLabelUpdate, readonly }) => {
const defaultTaskCategory = Object.keys(project.params.taskCategories)[0];
const [ task, setTask ] = useState(newTask("", defaultTaskCategory));
@@ -55,22 +56,30 @@ const TaskTable: FunctionalComponent = ({ project, onTaskAdd, on
};
const onTaskLabelChange = (taskId: TaskID, value: string) => {
- onTaskLabelUpdate(taskId, value);
+ if(onTaskLabelUpdate){
+ onTaskLabelUpdate(taskId, value);
+ }
};
const onAddTaskClick = (evt: Event) => {
- onTaskAdd(task);
- setTask(newTask("", defaultTaskCategory));
+ if(onTaskAdd){
+ onTaskAdd(task);
+ setTask(newTask("", defaultTaskCategory));
+ }
};
const onTaskRemoveClick = (taskId: TaskID, evt: Event) => {
- onTaskRemove(taskId);
+ if(onTaskRemove){
+ onTaskRemove(taskId);
+ }
};
const withEstimationChange = (confidence: EstimationConfidence, taskID: TaskID, evt: Event) => {
const textValue = (evt.currentTarget as HTMLInputElement).value;
const value = parseFloat(textValue);
- onEstimationChange(taskID, confidence, value);
+ if(onEstimationChange){
+ onEstimationChange(taskID, confidence, value);
+ }
};
const onOptimisticChange = withEstimationChange.bind(null, EstimationConfidence.Optimistic);
@@ -116,7 +125,7 @@ const TaskTable: FunctionalComponent = ({ project, onTaskAdd, on
{ categoryLabel } |
{
- isPrint ?
+ readonly ?
{t.estimations.optimistic} :
= ({ project, onTaskAdd, on
|
{
- isPrint ?
+ readonly ?
{t.estimations.likely} :
= ({ project, onTaskAdd, on
|
{
- isPrint ?
+ readonly ?
{t.estimations.pessimistic} :
= ({ project, onTaskAdd, on
|
|
-
+ |
|
- |
+ |
{totals.optimistic} |
{totals.likely} |
{totals.pessimistic} |
diff --git a/client/src/routes/project/time-preview.tsx b/client/src/routes/project/time-preview.tsx
index fd00180..a1e59e0 100644
--- a/client/src/routes/project/time-preview.tsx
+++ b/client/src/routes/project/time-preview.tsx
@@ -23,15 +23,15 @@ const TimePreview: FunctionalComponent = ({ project }) => {
- >= 99.7% |
+ {'>'}= 99.7% |
|
- >= 90% |
+ {'>'}= 90% |
|
- >= 68% |
+ {'>'}= 68% |
|
diff --git a/client/webpack.config.js b/client/webpack.config.js
index 0d0950b..7469cb2 100644
--- a/client/webpack.config.js
+++ b/client/webpack.config.js
@@ -17,7 +17,7 @@ module.exports = {
publicPath: '/'
},
resolve: {
- extensions: [".ts", ".tsx", ".js", ".jsx"]
+ extensions: [".ts", ".tsx", ".js", ".jsx"],
},
devServer: {
compress: true,