Merge pull request #64 from schrom01/fix_tasklist-not-updated_M3

fix: Properly saving tasks
This commit is contained in:
giavaphi 2022-11-21 09:21:26 +01:00 committed by GitHub Enterprise
commit 2312149256
3 changed files with 40 additions and 41 deletions

View File

@ -106,6 +106,7 @@ public class JsonTaskList implements TaskList {
if(task.getId() == 0) { if(task.getId() == 0) {
task.withId(idProvider.incrementAndGet()); task.withId(idProvider.incrementAndGet());
} }
taskMap.put(task.getId(), task);
writeTaskListToFile(); writeTaskListToFile();
} }

View File

@ -184,15 +184,14 @@
"litersPerSqM": 15, "litersPerSqM": 15,
"interval": 4, "interval": 4,
"notes": [ "notes": [
] ]
}, },
"taskTemplates": [ "taskTemplates": [
{ {
"name": "hilling", "name": "Plant Sets",
"relativeStartDate": 0, "relativeStartDate": 0,
"relativeEndDate": 0, "relativeEndDate": 0,
"description": "Mound up the soil around the plant until just the top few leaves show above the soil. ", "description": "Plant the sets about 5cm deep into the soil.",
"interval": null, "interval": null,
"isOptional": false "isOptional": false
} }
@ -232,7 +231,6 @@
"litersPerSqM": 0, "litersPerSqM": 0,
"interval": null, "interval": null,
"notes": [ "notes": [
] ]
}, },
"taskTemplates": [ "taskTemplates": [

View File

@ -1,56 +1,56 @@
[ [
{ {
"id" : 1, "id": 1,
"name" : "sow plant", "name": "sow plant",
"description": "Plant the seeds, crops in de bed.", "description": "Plant the seeds, crops in de bed.",
"startDate" : "2022-05-01", "startDate": "2022-05-01",
"endDate" : "2022-05-01", "endDate": "2022-05-01",
"interval" : 0, "interval": 0,
"cropId" : 0 "cropId": 0
}, },
{ {
"id" : 2, "id": 2,
"name" : "water plant", "name": "water plant",
"description": "water the plant, so that the soil is wet around the plant.", "description": "water the plant, so that the soil is wet around the plant.",
"startDate" : "2022-05-01", "startDate": "2022-05-01",
"endDate" : "2022-09-01", "endDate": "2022-09-01",
"interval" : 2, "interval": 2,
"cropId" : 0 "cropId": 0
}, },
{ {
"id" : 3, "id": 3,
"name" : "fertilize plant", "name": "fertilize plant",
"description": "The fertilizer has to be mixed with water. Then fertilize the plants soil with the mixture", "description": "The fertilizer has to be mixed with water. Then fertilize the plants soil with the mixture",
"startDate" : "2022-06-01", "startDate": "2022-06-01",
"endDate" : "2022-08-01", "endDate": "2022-08-01",
"interval" : 28, "interval": 28,
"cropId" : 0 "cropId": 0
}, },
{ {
"id" : 4, "id": 4,
"name" : "covering plant", "name": "covering plant",
"description": "Take a big enough coverage for the plants. Cover the whole plant with a bit space between the plant and the coverage", "description": "Take a big enough coverage for the plants. Cover the whole plant with a bit space between the plant and the coverage",
"startDate" : "2022-07-01", "startDate": "2022-07-01",
"endDate" : "2022-07-01", "endDate": "2022-07-01",
"interval" : 0, "interval": 0,
"cropId" : 0 "cropId": 0
}, },
{ {
"id" : 5, "id": 5,
"name" : "look after plant", "name": "look after plant",
"description": "Look for pest or illness at the leaves of the plant. Check the soil around the plant, if the roots are enough covered with soil", "description": "Look for pest or illness at the leaves of the plant. Check the soil around the plant, if the roots are enough covered with soil",
"startDate" : "2022-05-01", "startDate": "2022-05-01",
"endDate" : "2022-09-01", "endDate": "2022-09-01",
"interval" : 5, "interval": 5,
"cropId" : 0 "cropId": 0
}, },
{ {
"id" : 6, "id": 6,
"name" : "harvest plant", "name": "harvest plant",
"description": "Pull the ripe vegetables out from the soil. Clean them with clear, fresh water. ", "description": "Pull the ripe vegetables out from the soil. Clean them with clear, fresh water. ",
"startDate" : "2022-09-01", "startDate": "2022-09-01",
"endDate" : "2022-09-01", "endDate": "2022-09-01",
"interval" : 0, "interval": 0,
"cropId" : 0 "cropId": 0
} }
] ]