-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to record form app for searching internal mint records #2211
Add support to record form app for searching internal mint records #2211
Conversation
…w internal Mint records
…ernal solr search
…est record fields
@@ -25,11 +25,14 @@ import { Observable } from 'rxjs/Rx'; | |||
import { Services as vocabService } from '../services/VocabService'; | |||
|
|||
let flat; | |||
declare var VocabService: vocabService.Vocab; | |||
declare var VocabService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reinstate the typing of VocabService
@@ -146,6 +149,112 @@ export module Services { | |||
return response.data; | |||
} | |||
|
|||
public async findRecords(sourceType:string, brand:BrandingModel, searchString:string, start:number, rows:number): Promise<any> { | |||
|
|||
const report = sails.config.vocab[sourceType]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than using the report for the variable name, query seems more appropriate.
Create a config model in core for this query object and set the query object to this type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also be using sails.config.vocab.queries
|
||
const report = sails.config.vocab[sourceType]; | ||
|
||
if (report.reportSource == 'database') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of reportSource perhaps use querySource
return query; | ||
} | ||
|
||
getResultObjectMappings(results: any, report: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of report, use the query variable name and use the QueryConfig type instead of any
} | ||
} | ||
|
||
buildNamedQueryParamMap(report: any, searchString:string):any { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace report with query and use the core type that's been created
config/vocab.js
Outdated
geonames: { | ||
method: 'get', | ||
url: "http://mint:9001/geonames/search?func=search&q=${query}&format=json", | ||
options: { | ||
|
||
} | ||
} | ||
}, | ||
party: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These queries should be under a property named "queries" and should be accessed using sails.config.vocab.queries[queryName]
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2211 +/- ##
===========================================
+ Coverage 53.44% 53.88% +0.44%
===========================================
Files 173 173
Lines 8282 8349 +67
Branches 1166 1177 +11
===========================================
+ Hits 4426 4499 +73
+ Misses 3392 3376 -16
- Partials 464 474 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The vocab component has different configurable source types and a new source type named "query" has been added to this component. This new source type will allow the record form app to search internal mint records through a new endpoint that has also been added to the backend as part of this change