3
0

Fix searching record selector prompts if no queryFields is set

This commit is contained in:
Jože Fortun
2024-11-20 11:26:06 +01:00
parent 65b2a25ae4
commit 2f3358e6ea
2 changed files with 9 additions and 5 deletions

View File

@@ -379,7 +379,7 @@ export default {
this.fetchPrefiltered({ namespaceID, moduleID, query, sort: this.sortString(), limit, pageCursor })
}
}, 300),
}, 600),
loadLatest () {
const namespaceID = this.namespace.namespaceID

View File

@@ -182,12 +182,14 @@ export default {
const { limit, pageCursor } = this.filter
const namespaceID = this.namespaceID
const moduleID = this.module.moduleID
const queryFields = this.pVal('queryFields') || []
if (moduleID && moduleID !== NoID) {
// Determine what fields to use for searching
// Default to label field
let qf = this.pVal('queryFields').map(f => f['@value']).filter(f => !!f)
if (!qf || qf.length === 0) {
let qf = queryFields.map(f => f['@value']).filter(f => !!f)
if ((!qf || qf.length === 0) && this.pVal('labelField')) {
qf = [this.pVal('labelField')]
}
@@ -198,9 +200,11 @@ export default {
}).join(' OR ')
}
this.fetchPrefiltered({ namespaceID, moduleID, query, limit })
const sort = qf.filter(f => !!f).join(', ')
this.fetchPrefiltered({ namespaceID, moduleID, query, sort, limit })
}
}, 300),
}, 600),
fetchPrefiltered (q) {
this.processing = true