Skip to content

Commit

Permalink
fix(market): lowercase search query, fix #167
Browse files Browse the repository at this point in the history
also fix commands, config, explorer, locales
  • Loading branch information
shigma committed May 17, 2023
1 parent a8bd51b commit 3ae6e46
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/market/client/components/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ watch(() => props.modelValue, (value) => {
const lastWord = computed({
get: () => words.value[words.value.length - 1],
set: (value) => {
words.value[words.value.length - 1] = value
words.value[words.value.length - 1] = value.toLowerCase()
emit('update:modelValue', words.value)
},
})
Expand Down
2 changes: 1 addition & 1 deletion plugins/commands/client/commands.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function getClass(data: CommandData) {
}
function filterNode(value: string, data: CommandData) {
return data.name.includes(keyword.value)
return data.name.toLowerCase().includes(keyword.value.toLowerCase())
}
function allowDrag(node: Node) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/config/client/components/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const route = useRoute()
const packages = computed(() => Object.values(store.packages).filter(({ name, shortname, manifest }) => {
const category = store.market?.data[name]?.category || manifest?.category
return name
&& shortname.includes(keyword.value)
&& shortname.includes(keyword.value.toLowerCase())
&& (active.value === 'all' || resolveCategory(category) === active.value)
}))
Expand Down
2 changes: 1 addition & 1 deletion plugins/config/client/components/tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const model = computed({
})
function filterNode(value: string, data: Tree) {
return data.label.includes(keyword.value)
return data.label.toLowerCase().includes(keyword.value.toLowerCase())
}
interface Node {
Expand Down
2 changes: 1 addition & 1 deletion plugins/explorer/client/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function getClass(data: TreeEntry) {
}
function filterNode(value: string, data: TreeEntry) {
return data.name.includes(keyword.value)
return data.name.toLowerCase().includes(keyword.value.toLowerCase())
}
function createEntry(type: 'file' | 'directory') {
Expand Down
2 changes: 1 addition & 1 deletion plugins/locales/client/locales.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const active = computed<string>({
})
function filterNode(value: string, data: Tree) {
return data.label.includes(keyword.value)
return data.label.toLowerCase().includes(keyword.value.toLowerCase())
}
function getClass(tree: Tree) {
Expand Down
1 change: 1 addition & 0 deletions plugins/market/client/components/market.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ watch(router.currentRoute, (value) => {
const { keyword } = value.query
if (keyword === prompt.value) return
words.value = Array.isArray(keyword) ? keyword : (keyword || '').split(' ')
words.value = words.value.map(w => w.toLowerCase())
if (words.value[words.value.length - 1]) words.value.push('')
}, { immediate: true, deep: true })
Expand Down

0 comments on commit 3ae6e46

Please sign in to comment.