Skip to content
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

Merged
merged 17 commits into from
Jun 5, 2024

Conversation

alejandro-bulgaris-qcif
Copy link
Contributor

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

@alejandro-bulgaris-qcif alejandro-bulgaris-qcif changed the base branch from master to develop June 5, 2024 04:11
@alejandro-bulgaris-qcif alejandro-bulgaris-qcif changed the title Add support to record form app for searching the new internal mint records Add support to record form app for searching internal mint records Jun 5, 2024
@@ -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;
Copy link
Contributor

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];
Copy link
Contributor

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.

Copy link
Contributor

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') {
Copy link
Contributor

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) {
Copy link
Contributor

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 {
Copy link
Contributor

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: {
Copy link
Contributor

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]

Copy link

codecov bot commented Jun 5, 2024

Codecov Report

Attention: Patch coverage is 68.49315% with 23 lines in your changes missing coverage. Please review.

Project coverage is 53.88%. Comparing base (61e66cd) to head (53abb75).

Files Patch % Lines
typescript/api/services/VocabService.ts 68.25% 10 Missing and 10 partials ⚠️
typescript/api/controllers/VocabController.ts 70.00% 3 Missing ⚠️
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     
Flag Coverage Δ
backend-bruno 46.42% <68.49%> (+0.60%) ⬆️
backend-mocha 50.21% <68.49%> (+0.57%) ⬆️
frontend-app-config 97.87% <ø> (ø)
frontend-core-lib 52.41% <ø> (ø)
frontend-dashboard 88.07% <ø> (ø)
frontend-export 100.00% <ø> (ø)
frontend-local-auth 100.00% <ø> (ø)
frontend-manage-roles 63.33% <ø> (ø)
frontend-manage-users 59.81% <ø> (ø)
frontend-report 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrewbrazzatti andrewbrazzatti merged commit f617227 into develop Jun 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants