Merge pull request #1407 from omnivore-app/feat/search-by-author
Allow filtering by author
This commit is contained in:
@ -335,10 +335,16 @@ import Views
|
||||
Label { Text("Snooze") } icon: { Image.moon }
|
||||
}
|
||||
}
|
||||
Button(
|
||||
action: { viewModel.downloadAudio(audioController: audioController, item: item) },
|
||||
label: { Label("Download Audio", systemImage: "icloud.and.arrow.down") }
|
||||
)
|
||||
if let author = item.author {
|
||||
Button(
|
||||
action: {
|
||||
viewModel.searchTerm = "author:\"\(author)\""
|
||||
},
|
||||
label: {
|
||||
Label(String("More by \(author)"), systemImage: "person")
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
.swipeActions(edge: .trailing, allowsFullSwipe: true) {
|
||||
if !item.isArchived {
|
||||
|
||||
@ -213,6 +213,10 @@ struct WebReaderContainerView: View {
|
||||
},
|
||||
label: { Label("Reset Read Location", systemImage: "arrow.counterclockwise.circle") }
|
||||
)
|
||||
Button(
|
||||
action: { /* viewModel.downloadAudio(audioController: audioController, item: item) */ },
|
||||
label: { Label("Download Audio", systemImage: "icloud.and.arrow.down") }
|
||||
)
|
||||
Button(
|
||||
action: share,
|
||||
label: { Label("Share Original", systemImage: "square.and.arrow.up") }
|
||||
|
||||
@ -71,10 +71,6 @@ public struct GridCard: View {
|
||||
action: { menuActionHandler(.delete) },
|
||||
label: { Label("Delete", systemImage: "trash") }
|
||||
)
|
||||
Button(
|
||||
action: { menuActionHandler(.downloadAudio) },
|
||||
label: { Label("Download Audio", systemImage: "icloud.and.arrow.down") }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -76,6 +76,8 @@ public struct FeedCard: View {
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
}.introspectScrollView { scrollView in
|
||||
scrollView.bounces = false
|
||||
}
|
||||
.padding(.top, 0)
|
||||
#if os(macOS)
|
||||
|
||||
@ -280,6 +280,7 @@ export const parseSearchQuery = (query: string | undefined): SearchFilter => {
|
||||
'sort',
|
||||
'has',
|
||||
'saved',
|
||||
'author',
|
||||
'published',
|
||||
'subscription',
|
||||
'language',
|
||||
@ -355,6 +356,7 @@ export const parseSearchQuery = (query: string | undefined): SearchFilter => {
|
||||
break
|
||||
}
|
||||
// match filters
|
||||
case 'author':
|
||||
case 'title':
|
||||
case 'description':
|
||||
case 'content': {
|
||||
|
||||
@ -151,3 +151,12 @@ describe('query with in param set to invalid value', () => {
|
||||
expect(result.inFilter).to.eq(InFilter.INBOX)
|
||||
})
|
||||
})
|
||||
|
||||
describe('query with author set', () => {
|
||||
it('adds author to the match filters', () => {
|
||||
const result = parseSearchQuery('author:"Omnivore Blog"')
|
||||
expect(result.matchFilters[0].field).to.equal('author')
|
||||
expect(result.matchFilters[0].value).to.equal('omnivore blog')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user