Skip to content

Commit

Permalink
ignore case sensitive when search in instance manager image page
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <andy.lee@suse.com>
  • Loading branch information
a110605 authored and derekbit committed Jul 17, 2024
1 parent 531f82d commit 1a660be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/models/instanceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export default {
payload,
}, { call, put }) {
const data = yield call(query, payload)
// filter data based on payload.field and payload.value
if (payload && payload.field && payload.value && data.data) {
data.data = data.data.filter(item => item[payload.field] && item[payload.field].indexOf(payload.value.trim()) > -1)
const searchValue = payload.value.trim().toLowerCase()
data.data = data.data.filter(item => item[payload.field] && item[payload.field].toLowerCase().indexOf(searchValue) > -1)
}
if (data.data) {
data.data.sort((a, b) => a.name.localeCompare(b.name))
Expand Down

0 comments on commit 1a660be

Please sign in to comment.