Skip to content

Commit

Permalink
feat: add referencing string lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmacdonald committed Aug 14, 2019
1 parent e977480 commit ff4f5f5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
}

}
4 changes: 4 additions & 0 deletions test/fixtures/sourceData.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
4 changes: 3 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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())
}
}

Expand Down

0 comments on commit ff4f5f5

Please sign in to comment.