|
@@ -17,6 +17,7 @@ struct ProjectPanelView: View {
|
|
|
|
|
|
|
|
@State private var showDialogue = false
|
|
@State private var showDialogue = false
|
|
|
@State private var move = false
|
|
@State private var move = false
|
|
|
|
|
+ @State private var taskFilter = ""
|
|
|
@State private var statuses = StatusList()
|
|
@State private var statuses = StatusList()
|
|
|
|
|
|
|
|
var body: some View {
|
|
var body: some View {
|
|
@@ -44,6 +45,10 @@ struct ProjectPanelView: View {
|
|
|
Label("", systemImage: "arrow.up.arrow.down")
|
|
Label("", systemImage: "arrow.up.arrow.down")
|
|
|
Toggle("Move Tasks", isOn: $move)
|
|
Toggle("Move Tasks", isOn: $move)
|
|
|
}
|
|
}
|
|
|
|
|
+ HStack {
|
|
|
|
|
+ Label("", systemImage: "magnifyingglass")
|
|
|
|
|
+ TextField("Filter Tasks", text: $taskFilter)
|
|
|
|
|
+ }
|
|
|
StatusChecklist(statuses: $statuses)
|
|
StatusChecklist(statuses: $statuses)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -89,7 +94,8 @@ struct ProjectPanelView: View {
|
|
|
|
|
|
|
|
private func selected<T : Ordered & Filterable>(_ items: Binding<[T]>) -> [Binding<T>] {
|
|
private func selected<T : Ordered & Filterable>(_ items: Binding<[T]>) -> [Binding<T>] {
|
|
|
return items.sorted(by: T.less).filter({
|
|
return items.sorted(by: T.less).filter({
|
|
|
- statuses.test($0.wrappedValue.status)
|
|
|
|
|
|
|
+ statuses.test($0.wrappedValue.status) &&
|
|
|
|
|
+ (taskFilter.isEmpty || $0.wrappedValue.containsText(taskFilter))
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|