|
@@ -14,9 +14,10 @@ struct ProjectPanelView: View {
|
|
|
@Bindable var item: Project
|
|
@Bindable var item: Project
|
|
|
|
|
|
|
|
@State private var showDialogue = false
|
|
@State private var showDialogue = false
|
|
|
- @State private var move = false
|
|
|
|
|
|
|
+ @State private var moveEnabled = false
|
|
|
|
|
+
|
|
|
@State private var taskFilter = ""
|
|
@State private var taskFilter = ""
|
|
|
- @State private var statuses = StatusList()
|
|
|
|
|
|
|
+ @State private var statusFilter = StatusList()
|
|
|
|
|
|
|
|
var body: some View {
|
|
var body: some View {
|
|
|
HStack {
|
|
HStack {
|
|
@@ -30,7 +31,7 @@ struct ProjectPanelView: View {
|
|
|
}
|
|
}
|
|
|
.help("New Task")
|
|
.help("New Task")
|
|
|
.padding(.trailing, 10)
|
|
.padding(.trailing, 10)
|
|
|
- if move {
|
|
|
|
|
|
|
+ if moveEnabled {
|
|
|
Label("", systemImage: "arrow.up.arrow.down")
|
|
Label("", systemImage: "arrow.up.arrow.down")
|
|
|
.foregroundStyle(.red)
|
|
.foregroundStyle(.red)
|
|
|
.font(.title2)
|
|
.font(.title2)
|
|
@@ -42,11 +43,11 @@ struct ProjectPanelView: View {
|
|
|
.font(.title2)
|
|
.font(.title2)
|
|
|
.help("Only showing text matching '\(taskFilter)'")
|
|
.help("Only showing text matching '\(taskFilter)'")
|
|
|
}
|
|
}
|
|
|
- if !statuses.all {
|
|
|
|
|
|
|
+ if !statusFilter.all {
|
|
|
Label("", systemImage: "exclamationmark.magnifyingglass")
|
|
Label("", systemImage: "exclamationmark.magnifyingglass")
|
|
|
.foregroundStyle(.blue)
|
|
.foregroundStyle(.blue)
|
|
|
.font(.title2)
|
|
.font(.title2)
|
|
|
- .help(statuses.description)
|
|
|
|
|
|
|
+ .help(statusFilter.description)
|
|
|
}
|
|
}
|
|
|
Button {
|
|
Button {
|
|
|
showDialogue = !showDialogue
|
|
showDialogue = !showDialogue
|
|
@@ -65,13 +66,13 @@ struct ProjectPanelView: View {
|
|
|
.font(.title)
|
|
.font(.title)
|
|
|
HStack {
|
|
HStack {
|
|
|
Label("", systemImage: "arrow.up.arrow.down")
|
|
Label("", systemImage: "arrow.up.arrow.down")
|
|
|
- Toggle("Move Tasks", isOn: $move)
|
|
|
|
|
|
|
+ Toggle("Move Tasks", isOn: $moveEnabled)
|
|
|
}
|
|
}
|
|
|
HStack {
|
|
HStack {
|
|
|
Label("", systemImage: "text.magnifyingglass")
|
|
Label("", systemImage: "text.magnifyingglass")
|
|
|
TextField("Filter Tasks", text: $taskFilter)
|
|
TextField("Filter Tasks", text: $taskFilter)
|
|
|
}
|
|
}
|
|
|
- StatusChecklist(statuses: $statuses)
|
|
|
|
|
|
|
+ StatusChecklist(statuses: $statusFilter)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
Text("")
|
|
Text("")
|
|
@@ -96,10 +97,10 @@ struct ProjectPanelView: View {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.onMove(perform: { moveItem(task.wrappedValue, $0, $1) })
|
|
.onMove(perform: { moveItem(task.wrappedValue, $0, $1) })
|
|
|
- .moveDisabled(!move)
|
|
|
|
|
|
|
+ .moveDisabled(!moveEnabled)
|
|
|
}
|
|
}
|
|
|
.onMove(perform: { moveItem(item, $0, $1) })
|
|
.onMove(perform: { moveItem(item, $0, $1) })
|
|
|
- .moveDisabled(!move)
|
|
|
|
|
|
|
+ .moveDisabled(!moveEnabled)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -107,7 +108,7 @@ struct ProjectPanelView: View {
|
|
|
return items.sorted(by: T.less).filter({
|
|
return items.sorted(by: T.less).filter({
|
|
|
let value = $0.wrappedValue
|
|
let value = $0.wrappedValue
|
|
|
return value.name.isEmpty ||
|
|
return value.name.isEmpty ||
|
|
|
- (statuses.test(value.status) &&
|
|
|
|
|
|
|
+ (statusFilter.test(value.status) &&
|
|
|
(taskFilter.isEmpty || value.containsText(taskFilter)))
|
|
(taskFilter.isEmpty || value.containsText(taskFilter)))
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|