implemented task.total_prio:
- is dependent on the manually set priority of the task - increases within 100 days before the due date of a task
This commit is contained in:
@@ -167,6 +167,7 @@ public class Constants {
|
|||||||
public static final String TITLE = "title";
|
public static final String TITLE = "title";
|
||||||
public static final String TIMESTAMP = "timestamp";
|
public static final String TIMESTAMP = "timestamp";
|
||||||
public static final String TOKEN = "token";
|
public static final String TOKEN = "token";
|
||||||
|
public static final String TOTAL_PRIO = "total_prio";
|
||||||
public static final String TYPE = "type";
|
public static final String TYPE = "type";
|
||||||
|
|
||||||
public static final String UMBRELLA = "Umbrella";
|
public static final String UMBRELLA = "Umbrella";
|
||||||
|
|||||||
@@ -230,14 +230,23 @@ public class Task implements Mappable {
|
|||||||
map.put(ESTIMATED_TIME, estimatedTime);
|
map.put(ESTIMATED_TIME, estimatedTime);
|
||||||
map.put(START_DATE,start);
|
map.put(START_DATE,start);
|
||||||
map.put(DUE_DATE,dueDate);
|
map.put(DUE_DATE,dueDate);
|
||||||
map.put(SHOW_CLOSED,showClosed);
|
|
||||||
map.put(NO_INDEX,noIndex);
|
map.put(NO_INDEX,noIndex);
|
||||||
map.put(MEMBERS,memberMap);
|
map.put(MEMBERS,memberMap);
|
||||||
map.put(REQUIRED_TASKS_IDS,requiredTasksIds);
|
map.put(REQUIRED_TASKS_IDS,requiredTasksIds);
|
||||||
|
map.put(SHOW_CLOSED,showClosed);
|
||||||
|
map.put(TOTAL_PRIO,totalPrio());
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int totalPrio() {
|
||||||
|
if (dueDate == null) return priority;
|
||||||
|
var diff = (int) (dueDate.toEpochDay()-LocalDate.now().toEpochDay());
|
||||||
|
if (diff <= 0) return priority + 100; // due date has passed
|
||||||
|
if (diff < 100) return priority + 100 - diff; // due within the next 100 days
|
||||||
|
return priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
let { onclick, ondragstart, task } = $props();
|
let { onclick, ondragstart, task } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div draggable="true" class={`box prio_${task.priority} p${Math.floor(task.priority/10)*10} p${task.priority % 10}`} {onclick} {ondragstart} >
|
<div draggable="true" class={`box prio_${task.total_prio} p${Math.floor(task.total_prio/10)*10} p${task.total_prio % 10}`} {onclick} {ondragstart} >
|
||||||
<span class="title">{task.name}</span>
|
<span class="title">{task.name}</span>
|
||||||
{#if task.estimated_time}
|
{#if task.estimated_time}
|
||||||
<span class="estimate">
|
<span class="estimate">
|
||||||
|
|||||||
@@ -181,7 +181,7 @@
|
|||||||
<span class="error">{error}</span>
|
<span class="error">{error}</span>
|
||||||
{/if}
|
{/if}
|
||||||
{#if task}
|
{#if task}
|
||||||
<div class={`task grid2 prio_${task.priority} p${Math.floor(task.priority/10)*10} p${task.priority % 10}`} >
|
<div class={`task grid2 prio_${task.total_prio} p${Math.floor(task.total_prio/10)*10} p${task.total_prio % 10}`} >
|
||||||
{#if project}
|
{#if project}
|
||||||
<div>{t('project')}</div>
|
<div>{t('project')}</div>
|
||||||
<div class="project">
|
<div class="project">
|
||||||
|
|||||||
Reference in New Issue
Block a user