mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
fix(webui): search for collection/readlist in the "add to" dialog should ignore accents
Closes: #944
This commit is contained in:
parent
834ed0e964
commit
ac67924fba
3 changed files with 7 additions and 2 deletions
|
|
@ -76,6 +76,7 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import {SeriesDto} from '@/types/komga-series'
|
import {SeriesDto} from '@/types/komga-series'
|
||||||
import {ERROR} from '@/types/events'
|
import {ERROR} from '@/types/events'
|
||||||
|
import {stripAccents} from '@/functions/string'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
name: 'CollectionAddToDialog',
|
name: 'CollectionAddToDialog',
|
||||||
|
|
@ -120,7 +121,7 @@ export default Vue.extend({
|
||||||
} else return ''
|
} else return ''
|
||||||
},
|
},
|
||||||
collectionsFiltered(): CollectionDto[] {
|
collectionsFiltered(): CollectionDto[] {
|
||||||
return this.collections.filter((x: CollectionDto) => x.name.toLowerCase().includes(this.newCollection.toLowerCase()))
|
return this.collections.filter((x: CollectionDto) => stripAccents(x.name.toLowerCase()).includes(stripAccents(this.newCollection.toLowerCase())))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import {BookDto} from '@/types/komga-books'
|
import {BookDto} from '@/types/komga-books'
|
||||||
import {ERROR} from '@/types/events'
|
import {ERROR} from '@/types/events'
|
||||||
|
import {stripAccents} from '@/functions/string'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
name: 'ReadListAddToDialog',
|
name: 'ReadListAddToDialog',
|
||||||
|
|
@ -121,7 +122,7 @@ export default Vue.extend({
|
||||||
} else return ''
|
} else return ''
|
||||||
},
|
},
|
||||||
readListsFiltered(): ReadListDto[] {
|
readListsFiltered(): ReadListDto[] {
|
||||||
return this.readLists.filter((x: ReadListDto) => x.name.toLowerCase().includes(this.newReadList.toLowerCase()))
|
return this.readLists.filter((x: ReadListDto) => stripAccents(x.name.toLowerCase()).includes(stripAccents(this.newReadList.toLowerCase())))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
3
komga-webui/src/functions/string.ts
Normal file
3
komga-webui/src/functions/string.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
export function stripAccents(s: string): string {
|
||||||
|
return s.normalize('NFD').replace(/\p{Diacritic}/gu, '')
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue