diff --git a/src/index.js b/src/index.js index 5bc5639..db5789e 100644 --- a/src/index.js +++ b/src/index.js @@ -884,6 +884,15 @@ function popSearchOrganization(searchOptions) { function popSearchTitle(searchOptions) { return initialize('title', 'findTitle', 'Find a Title', searchOptions) } +/** + * Open a reference/generic entity lookup dialog. + * @see cwrc-public-entity-dialogs.initialize + * @memberof module:cwrc-public-entity-dialogs + * @param {Object} searchOptions + */ +function popSearchRS(searchOptions) { + return initialize('rs', 'findRS', 'Find a Referencing String', searchOptions) +} module.exports = { registerEntitySources: registerEntitySources, @@ -902,12 +911,14 @@ module.exports = { popSearchOrganization: popSearchOrganization, popSearchPlace: popSearchPlace, popSearchTitle: popSearchTitle, + popSearchRS: popSearchRS, popSearch: { person : popSearchPerson, organization : popSearchOrganization, place : popSearchPlace, - title : popSearchTitle + title : popSearchTitle, + rs : popSearchRS } } diff --git a/test/fixtures/sourceData.js b/test/fixtures/sourceData.js index 6840cc4..bd25ff5 100644 --- a/test/fixtures/sourceData.js +++ b/test/fixtures/sourceData.js @@ -31,6 +31,10 @@ module.exports = { {name: 'viaf-name-10', description: 'viaf-10', id: 'viaf-Id10', uri: testURI, uriForDisplay: displayURI }, {name: 'viaf-name-11', id: 'viaf-Id11', uri: testURI, uriForDisplay: displayURI }, {name: 'viaf-name-12', description: 'viaf-12', id: 'viaf-Id12', uri: testURI , uriForDisplay: displayURI } + ], + rs: [ + {name: 'viaf-name-16', id: 'viaf-Id16', uri: testURI, uriForDisplay: displayURI }, + {name: 'viaf-name-24', id: 'viaf-Id24', uri: testURI, uriForDisplay: displayURI } ] }, wikidata: { diff --git a/test/test.js b/test/test.js index 86479a5..8a7cbe1 100644 --- a/test/test.js +++ b/test/test.js @@ -47,7 +47,8 @@ function getViafStubs() { findPerson: sinon.stub().resolves(fixtures.viaf.person), findPlace: sinon.stub().resolves(fixtures.viaf.place), findOrganization: sinon.stub().resolves(fixtures.viaf.organization), - findTitle: sinon.stub().resolves(fixtures.viaf.title) + findTitle: sinon.stub().resolves(fixtures.viaf.title), + findRS: sinon.stub().resolves(fixtures.viaf.rs) } } @@ -84,6 +85,7 @@ function getEntitySourceStubs() { place: (new Map()).set('geonames', getGeonamesStubs()).set('viaf', getViafStubs()).set('wikidata', getWikidataStubs()).set('getty',getGettyStubs()).set('dbpedia',getDbpediaStubs()), organization: (new Map()).set('viaf', getViafStubs()).set('wikidata', getWikidataStubs()).set('dbpedia',getDbpediaStubs()), title: (new Map()).set('viaf', getViafStubs()).set('wikidata', getWikidataStubs()).set('dbpedia',getDbpediaStubs()), + rs: (new Map()).set('viaf', getViafStubs()) } }