fix(datasource): configurability of additional data source extensions (#2931)

* feat(dataSource):Support more than one data source type.

* Add consumer type
This commit is contained in:
Bill Wallace authored and GitHub committed 2022-09-20 11:05:26 -04:00
1 parent 55a1704e4a
commit 3900e62641
18 files changed
+83 -29

No files matched your search

@@ -32,11 +32,16 @@ function DataSourceWrapper(props) {
return acc.concat(mods);
}, []);
// Grabbing first for now - should get active?
const name = webApiDataSources[0].name;
// Grabbing first defined for now - should get active
// TODO: Why does this return an array?
const dataSource = extensionManager.getDataSources(name)[0];
const dataSource = webApiDataSources
.map(ds => extensionManager.getDataSources(ds.name)?.[0])
.find(it => it !== undefined);
if (!dataSource) {
throw new Error(
`No data source found for any of ${webApiDataSources.map(it => it.name)}`
);
}
// Route props --> studies.mapParams
// mapParams --> studies.search
// studies.search --> studies.processResults
@@ -168,7 +173,7 @@ function _getQueryFilterValues(query, queryLimit) {
return queryFilterValues;
function _tryParseInt(str, defaultValue) {
var retValue = defaultValue;
let retValue = defaultValue;
if (str !== null) {
if (str.length > 0) {
if (!isNaN(str)) {