From d81a02317f79b60299f69c04828f69eeb7647d53 Mon Sep 17 00:00:00 2001 From: Taka Date: Wed, 17 Nov 2021 21:07:03 +1100 Subject: [PATCH] Got filtering working for standard Select droplists. --- web/src/ArticleSearchResult2.js | 12 +++++++----- web/src/PublicationSearchResult2.js | 7 ++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/web/src/ArticleSearchResult2.js b/web/src/ArticleSearchResult2.js index 0c4c8d8..d8f132b 100644 --- a/web/src/ArticleSearchResult2.js +++ b/web/src/ArticleSearchResult2.js @@ -74,13 +74,14 @@ export class ArticleSearchResult2 } ; // initialize the publications - let publications = [ { value: null, label: (none) } ] ; + let publications = [ { value: null, label: (none), textLabel: "" } ] ; let mostRecentPub = null ; for ( let p of Object.entries( gAppRef.dataCache.data.publications ) ) { const pub_display_name = PublicationSearchResult.makeDisplayName( p[1] ) ; const pub = { value: p[1].pub_id, label: , + textLabel: pub_display_name, } ; publications.push( pub ) ; if ( mostRecentPub === null || p[1].time_created > mostRecentPub[1] ) @@ -107,12 +108,13 @@ export class ArticleSearchResult2 } // initialize the publishers - let publishers = [ { value: null, label: (none) } ] ; + let publishers = [ { value: null, label: (none), textLabel: "" } ] ; let currPubl = publishers[0] ; for ( let p of Object.entries( gAppRef.dataCache.data.publishers ) ) { publishers.push( { value: p[1].publ_id, - label: + label: , + textLabel: p[1].publ_name, } ) ; if ( p[1].publ_id === vals.publ_id ) currPubl = publishers[ publishers.length-1 ] ; @@ -190,7 +192,7 @@ export class ArticleSearchResult2 title = "Click to associate this article with a publisher." onClick = {onPublisherParent} > Publication: - o.textLabel} defaultValue = {currPubl} ref = { r => refs.publ_id=r } /> diff --git a/web/src/PublicationSearchResult2.js b/web/src/PublicationSearchResult2.js index 9146b88..79fe195 100644 --- a/web/src/PublicationSearchResult2.js +++ b/web/src/PublicationSearchResult2.js @@ -60,12 +60,13 @@ export class PublicationSearchResult2 } ; // initialize the publishers - let publishers = [ { value: null, label: (none) } ] ; + let publishers = [ { value: null, label: (none), textLabel: "" } ] ; let currPubl = publishers[0] ; for ( let p of Object.entries( gAppRef.dataCache.data.publishers ) ) { publishers.push( { value: p[1].publ_id, - label: + label: , + textLabel: p[1].publ_name } ) ; if ( p[1].publ_id === vals.publ_id ) currPubl = publishers[ publishers.length-1 ] ; @@ -153,7 +154,7 @@ export class PublicationSearchResult2 refs.pub_date=r} />
-