-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to record form app for searching internal mint records (#…
…2211) * Refactor vocab service to use new vocab config structure * Initial refactor of vocab controller and service for searching the new internal Mint records * Refactor vocab controller and service for direct database search * Add bruno test for database internal mint search * Refactor vocab controller and service to search internal solr index * Add bruno test for search mint internal solr index * Refactor bruno tests that create mint harvest record and fix mint internal solr search * Rename MintInternal routes and methods to Records * Fix bad request error in solr query * Fix bruno solr index test given solr schema not including mint mock test record fields * Add lodash for result obejct mapping template processing * Add source type query to field vocab component in dmp form app * Add cotributor component example using new internal search index * Add vocab query config model type class * Refactor vocab controller and service to use vocab query config model type class * Add result max rows property to vocab component
- Loading branch information
1 parent
61e66cd
commit f617227
Showing
12 changed files
with
500 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export class VocabQueryConfig { | ||
querySource: VocabQuerySource = VocabQuerySource.solr; | ||
databaseQuery: VocabDatabaseQueryConfig; | ||
searchQuery: VocabSolrQueryConfig; | ||
queryField: VocabQueryFieldConfig; | ||
resultObjectMapping: { | ||
[key: string]: string; | ||
}; | ||
} | ||
|
||
export enum VocabQuerySource { | ||
solr = 'solr', | ||
database = 'database' | ||
} | ||
|
||
export class VocabDatabaseQueryConfig { | ||
queryName: string; | ||
} | ||
|
||
export class VocabSolrQueryConfig { | ||
baseQuery: string; | ||
searchCore: string = 'default'; | ||
} | ||
|
||
export class VocabQueryFieldConfig { | ||
property: string; | ||
type: string; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './SolrConfig'; | ||
export * from './ReportConfig'; | ||
export * from './ReportConfig'; | ||
export * from './VocabQueryConfig'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ body:json { | |
"metadata": { | ||
"data": { | ||
"ID": "s123456", | ||
"GIVEN_NAME": "Andrew", | ||
"GIVEN_NAME": "Ant", | ||
"OTHER_NAMES": "", | ||
"FAMILY_NAME": "S", | ||
"PREF_NAME": "", | ||
|
@@ -36,14 +36,29 @@ body:json { | |
"PERSONAL_HOMEPAGE": "", | ||
"STAFF_PROFILE_HOMEPAGE": "", | ||
"DESCRIPTION": "", | ||
"RESEARCH_ELEMENTS_USER_ID": "12345678" | ||
"RESEARCH_ELEMENTS_USER_ID": "12345678", | ||
"title": "Mock mint record type rdmp integration test", | ||
"contributor_ci": { | ||
"text_full_name": "Prof Ant Season", | ||
"email": "[email protected]", | ||
"orcid": "http://orcid.org/0000-0000-0000-000" | ||
}, | ||
"contributor_data_manager": { | ||
"text_full_name": "Prof Ant Season", | ||
"email": "[email protected]", | ||
"orcid": "http://orcid.org/0000-0000-0000-000" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
|
||
assert { | ||
res.body[0].harvestId: eq s123456 | ||
} | ||
|
||
tests { | ||
|
||
test("Status code is 200", function () { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ body:json { | |
"recordRequest": { | ||
"metadata": { | ||
"ID": "s123456", | ||
"GIVEN_NAME": "Andrew", | ||
"GIVEN_NAME": "Ant", | ||
"OTHER_NAMES": "", | ||
"FAMILY_NAME": "S", | ||
"PREF_NAME": "", | ||
|
@@ -36,7 +36,18 @@ body:json { | |
"PERSONAL_HOMEPAGE": "", | ||
"STAFF_PROFILE_HOMEPAGE": "", | ||
"DESCRIPTION": "", | ||
"RESEARCH_ELEMENTS_USER_ID": "12345678" | ||
"RESEARCH_ELEMENTS_USER_ID": "12345678", | ||
"title": "Mock mint record type rdmp integration test", | ||
"contributor_ci": { | ||
"text_full_name": "Prof Ant Season", | ||
"email": "[email protected]", | ||
"orcid": "http://orcid.org/0000-0000-0000-000" | ||
}, | ||
"contributor_data_manager": { | ||
"text_full_name": "Prof Ant Season", | ||
"email": "[email protected]", | ||
"orcid": "http://orcid.org/0000-0000-0000-000" | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -58,7 +69,9 @@ tests { | |
test("Test harvestId exists and value is as expected", function () { | ||
var jsonData = res.getBody(); | ||
expect(jsonData[0]).to.have.property('harvestId'); | ||
expect(jsonData[0]).to.have.property('message'); | ||
expect(jsonData[0].harvestId).to.equal('s123456'); | ||
expect(jsonData[0].message).to.equal('Record updated successfully'); | ||
}); | ||
|
||
} |
Oops, something went wrong.