mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Enable filtering by status
This commit is contained in:
parent
9361066244
commit
474c06738d
2 changed files with 35 additions and 6 deletions
|
|
@ -135,6 +135,18 @@ export default {
|
||||||
quickButtons: {
|
quickButtons: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [
|
default: () => [
|
||||||
|
{
|
||||||
|
label: '✅ Full Native Support',
|
||||||
|
query: 'status:native'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '✳️ Rosetta',
|
||||||
|
query: 'status:rosetta'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '🚫 Unsupported',
|
||||||
|
query: 'status:no'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Music Tools',
|
label: 'Music Tools',
|
||||||
query: 'Music'
|
query: 'Music'
|
||||||
|
|
@ -166,6 +178,7 @@ export default {
|
||||||
titleStartsWithResults: [],
|
titleStartsWithResults: [],
|
||||||
titleContainsResults: [],
|
titleContainsResults: [],
|
||||||
sectionContainsResults: [],
|
sectionContainsResults: [],
|
||||||
|
statusResults: [],
|
||||||
// store: overlayStore.state
|
// store: overlayStore.state
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -176,7 +189,8 @@ export default {
|
||||||
return [
|
return [
|
||||||
...this.titleStartsWithResults,
|
...this.titleStartsWithResults,
|
||||||
...this.titleContainsResults,
|
...this.titleContainsResults,
|
||||||
...this.sectionContainsResults
|
...this.sectionContainsResults,
|
||||||
|
...this.statusResults
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
hasSearchInputText () {
|
hasSearchInputText () {
|
||||||
|
|
@ -221,6 +235,19 @@ export default {
|
||||||
}
|
}
|
||||||
return matches
|
return matches
|
||||||
},
|
},
|
||||||
|
statusIs (query, app) {
|
||||||
|
if (!query.includes('status:')) return
|
||||||
|
|
||||||
|
const [_, status] = query.split(':')
|
||||||
|
|
||||||
|
const matches = app.status.includes(status)
|
||||||
|
|
||||||
|
if (matches) {
|
||||||
|
this.statusResults.push(app)
|
||||||
|
}
|
||||||
|
|
||||||
|
return matches
|
||||||
|
},
|
||||||
// Search tools
|
// Search tools
|
||||||
pluck (array, index) {
|
pluck (array, index) {
|
||||||
const pluckedItem = array[index]
|
const pluckedItem = array[index]
|
||||||
|
|
@ -238,6 +265,7 @@ export default {
|
||||||
this.titleStartsWithResults = []
|
this.titleStartsWithResults = []
|
||||||
this.titleContainsResults = []
|
this.titleContainsResults = []
|
||||||
this.sectionContainsResults = []
|
this.sectionContainsResults = []
|
||||||
|
this.statusResults = []
|
||||||
|
|
||||||
|
|
||||||
// Snap results scroll position back to top
|
// Snap results scroll position back to top
|
||||||
|
|
@ -257,7 +285,8 @@ export default {
|
||||||
const matchers = [
|
const matchers = [
|
||||||
this.titleStartsWith,
|
this.titleStartsWith,
|
||||||
this.titleContains,
|
this.titleContains,
|
||||||
this.sectionContains
|
this.sectionContains,
|
||||||
|
this.statusIs
|
||||||
]
|
]
|
||||||
|
|
||||||
// Run through our search priorities
|
// Run through our search priorities
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ import slugify from 'slugify'
|
||||||
const md = new MarkdownIt()
|
const md = new MarkdownIt()
|
||||||
|
|
||||||
|
|
||||||
const statuses = {
|
export const statuses = {
|
||||||
'✅': 'yes',
|
'✅': 'native',
|
||||||
'✳️': 'yes-but',
|
'✳️': 'rosetta',
|
||||||
'⏹': 'in-progress',
|
'⏹': 'no-in-progress',
|
||||||
'🚫': 'no'
|
'🚫': 'no'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue