Skip to content

Commit

Permalink
Small tidying up; merge fixes to import features and to add assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
dariober authored and garrettjstevens committed Aug 2, 2023
1 parent 05f5ec1 commit 2d7e2fb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export class FeaturesService {
end: searchDto.end,
})
}

async searchFeatures(searchDto: { term: string }) {
return this.featureModel
.find({ $text: { $search: searchDto.term } })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,6 @@ export class ApolloTextSearchAdapter
.catch((err) => err)
}

// async fetchFeatureByAttr(attrType: string, attr: string) {
// const url = new URL(`features/${attrType}/${attr}`, this.baseURL)
// const uri = url.toString()
// const location: UriLocation = { locationType: 'UriLocation', uri }
// if (this.internetAccountPreAuthorization) {
// location.internetAccountPreAuthorization =
// this.internetAccountPreAuthorization
// }
// const fetch = getFetcher(location, this.pluginManager)
// return fetch(uri)
// .then((res) => res.json())
// .catch((err) => err)
// }

mapBaseResult(
features: {
refSeq: any // eslint-disable-line @typescript-eslint/no-explicit-any
Expand All @@ -76,15 +62,6 @@ export class ApolloTextSearchAdapter

searchIndex(args: BaseTextSearchArgs): Promise<BaseResult[]> {
const query = args.queryString
// const isId = query.startsWith('id:')
// // portion of query after first occurance of ':'
// const id = isId ? query.slice(query.indexOf(':') + 1) : null

// if (isId && id) {
// return this.fetchFeatureByAttr('id', id)
// .then((features) => this.mapBaseResult(features, query))
// .catch((err) => err)
// }
return this.searchFeatures(query)
.then((features) => this.mapBaseResult(features, query))
.catch((err) => err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,13 @@ export function ImportFeatures({
{submitted ? 'Submitting...' : 'Submit'}
</Button>
<Button
disabled={submitted}
variant="outlined"
type="submit"
onClick={() => {
handleClose()
}}
>
Cancel
Close
</Button>
</DialogActions>
</form>
Expand Down

0 comments on commit 2d7e2fb

Please sign in to comment.