diff --git a/client/web/compose/src/components/ModuleFields/Editor/Record.vue b/client/web/compose/src/components/ModuleFields/Editor/Record.vue index 9f4617425..fa21c76ee 100644 --- a/client/web/compose/src/components/ModuleFields/Editor/Record.vue +++ b/client/web/compose/src/components/ModuleFields/Editor/Record.vue @@ -379,7 +379,7 @@ export default { this.fetchPrefiltered({ namespaceID, moduleID, query, sort: this.sortString(), limit, pageCursor }) } - }, 300), + }, 600), loadLatest () { const namespaceID = this.namespace.namespaceID diff --git a/lib/vue/src/components/prompts/kinds/CPromptComposeRecordPicker.vue b/lib/vue/src/components/prompts/kinds/CPromptComposeRecordPicker.vue index b0a8051c0..49959703d 100644 --- a/lib/vue/src/components/prompts/kinds/CPromptComposeRecordPicker.vue +++ b/lib/vue/src/components/prompts/kinds/CPromptComposeRecordPicker.vue @@ -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