implemented various task features:

- saving on CTRL+S
- editing of
    - start date
    - due date
    - members
This commit is contained in:
2025-07-26 21:23:58 +02:00
parent 58986a5c59
commit 91aa421ae9
11 changed files with 203 additions and 62 deletions

View File

@@ -32,6 +32,16 @@ public class Project implements Mappable {
this.members = members;
}
public Project clean() {
dirtyFields.clear();
return this;
}
public Project clean(String field){
dirtyFields.remove(field);
return this;
}
public Optional<Long> companyId(){
return nullable(companyId);
}
@@ -40,8 +50,9 @@ public class Project implements Mappable {
return description;
}
public Set<String> dirtyFields(){
return dirtyFields;
public Project dirty(String field){
dirtyFields.add(field);
return this;
}
public boolean hasMember(UmbrellaUser user) {
@@ -52,6 +63,15 @@ public class Project implements Mappable {
return id;
}
public boolean isDirty() {
return !dirtyFields.isEmpty();
}
public boolean isDirty(String field){
return dirtyFields.contains(field);
}
public Map<Long,Member> members(){
return members;
}
@@ -103,12 +123,4 @@ public class Project implements Mappable {
map.put(MEMBERS,memberMap);
return map;
}
public boolean isDirty() {
return !dirtyFields.isEmpty();
}
public void clean() {
dirtyFields.clear();
}
}

View File

@@ -46,14 +46,25 @@ public class Task implements Mappable {
this.members = members;
}
public void clean() {
public Task clean() {
dirtyFields.clear();
return this;
}
public Task clean(String field){
dirtyFields.remove(field);
return this;
}
public String description(){
return description;
}
public Task dirty(String field){
dirtyFields.add(field);
return this;
}
public LocalDate dueDate(){
return dueDate;
}
@@ -70,6 +81,10 @@ public class Task implements Mappable {
return !dirtyFields.isEmpty();
}
public boolean isDirty(String field){
return dirtyFields.contains(field);
}
public Map<Long,Member> members(){
return members;
}
@@ -145,7 +160,7 @@ public class Task implements Mappable {
case STATUS: status = json.get(key) instanceof Number number ? Status.of(number.intValue()) : Status.valueOf(json.getString(key)); break;
default: {
key = null;
LOG.log(WARNING,"Tried to patch field ''{0}'' of task, which is not implemented!");
LOG.log(WARNING,"Tried to patch field ''{0}'' of task, which is not implemented!",key);
}
}
if (key != null) dirtyFields.add(key);