|
|
@@ -22,8 +22,22 @@ struct TaskView: View {
|
|
|
ForEach(Status.allCases) { unit in
|
|
|
Text(String(describing: unit))
|
|
|
}
|
|
|
- }.scaledToFit()
|
|
|
+ }
|
|
|
+ .onChange(of: task.status) {
|
|
|
+ if task.status.isStrong {
|
|
|
+ task.subtasks
|
|
|
+ .filter({ $0.status.isStrong })
|
|
|
+ .forEach({ subtask in subtask.status = task.status })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
TextField("Task Name", text: $task.name)
|
|
|
+ Button() {
|
|
|
+ task.subtasks.append(SubTask(name: "Subtask"))
|
|
|
+ } label: {
|
|
|
+ Image(systemName: "plus")
|
|
|
+ .help("Add a Subtask")
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if showTags {
|
|
|
@@ -43,6 +57,15 @@ struct TaskView: View {
|
|
|
ShowHideTapper(shown: $showNotes, hideToggle: $hideNotes)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ VStack {
|
|
|
+ ForEach($task.subtasks) { subtask in
|
|
|
+ HStack {
|
|
|
+ Label("", systemImage: "chevron.right")
|
|
|
+ SubTaskView(task: subtask)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}.onHover { yes in
|
|
|
showTags = yes || !(hideTags || task.tags.isEmpty)
|
|
|
showNotes = yes || !(hideNotes || task.notes.isEmpty)
|