implemented storing of tasks extended fields
This commit is contained in:
@@ -52,9 +52,16 @@ public record Task(long id, long projectId, Long parentTaskId, String name, Stri
|
|||||||
};
|
};
|
||||||
|
|
||||||
var status = Status.OPEN;
|
var status = Status.OPEN;
|
||||||
Double estimatedTime = null; // TODO: provide form field
|
Double estimatedTime = null;
|
||||||
LocalDate startDate = null;
|
if (json.has(ESTIMATED_TIME)) {
|
||||||
LocalDate dueDate = null;
|
if (json.get(ESTIMATED_TIME) instanceof Number est) estimatedTime = est.doubleValue();
|
||||||
|
if (json.get(ESTIMATED_TIME) instanceof String est) try {
|
||||||
|
estimatedTime = Double.parseDouble(est);
|
||||||
|
} catch (NumberFormatException ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LocalDate startDate = json.has(START_DATE) && json.get(START_DATE) instanceof String d ? LocalDate.parse(d) : null;
|
||||||
|
LocalDate dueDate = json.has(DUE_DATE) && json.get(DUE_DATE) instanceof String d ? LocalDate.parse(d) : null;
|
||||||
var showClosed = json.has(SHOW_CLOSED) && json.get(SHOW_CLOSED) instanceof Boolean sc ? sc : false;
|
var showClosed = json.has(SHOW_CLOSED) && json.get(SHOW_CLOSED) instanceof Boolean sc ? sc : false;
|
||||||
var noIndex = json.has(NO_INDEX) && json.get(NO_INDEX) instanceof Boolean ni ? ni : false;
|
var noIndex = json.has(NO_INDEX) && json.get(NO_INDEX) instanceof Boolean ni ? ni : false;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,12 @@
|
|||||||
let task = $state({
|
let task = $state({
|
||||||
name : '',
|
name : '',
|
||||||
description : { source : '', rendered : '' },
|
description : { source : '', rendered : '' },
|
||||||
members : {}
|
members : {},
|
||||||
|
estimated_time: null,
|
||||||
|
start_date: null,
|
||||||
|
due_date: null,
|
||||||
|
show_closed: false,
|
||||||
|
no_index: false
|
||||||
});
|
});
|
||||||
let router = useTinyRouter();
|
let router = useTinyRouter();
|
||||||
|
|
||||||
@@ -120,7 +125,7 @@
|
|||||||
{t('estimated_time')}
|
{t('estimated_time')}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" /> {t('hours')}
|
<input type="number" bind:value={task.estimated_time} /> {t('hours')}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -128,7 +133,7 @@
|
|||||||
{t('start_date')}
|
{t('start_date')}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<input type="date" />
|
<input type="date" bind:value={task.start_date} />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -136,7 +141,7 @@
|
|||||||
{t('due_date')}
|
{t('due_date')}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<input type="date" />
|
<input type="date" bind:value={task.due_date} />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -145,7 +150,7 @@
|
|||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" >
|
<input type="checkbox" bind:checked={task.show_closed} >
|
||||||
{t('display_closed_tasks')}
|
{t('display_closed_tasks')}
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@@ -156,7 +161,7 @@
|
|||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" >
|
<input type="checkbox" bind:checked={task.no_index} >
|
||||||
{t('hide_on_index_page')}
|
{t('hide_on_index_page')}
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user