Skip to content

Commit

Permalink
[DUOS-2695][risk=no] Fix ontology lookups for DAC Datasets (#2395)
Browse files Browse the repository at this point in the history
  • Loading branch information
rushtong authored Nov 13, 2023
1 parent d65486b commit f99a735
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/dac_dataset_table/DACDatasetTableCellData.js
Original file line number Diff line number Diff line change
@@ -59,8 +59,8 @@ export function dataCustodianCellData({dataset, label = 'dataCustodianCellData'}
}

export function dataUseCellData({dataset, label = 'dataUseCellData'}) {
const translationList = map((translation) => {
return <li key={translation.code}>{translation.code}: {translation.description}</li>;
const translationList = map((translation, index) => {
return <li key={`${translation.code}_${index}`}>{translation.code}: {translation.description}</li>;
})(dataset.translations);
const display =
<div className={style['cell-data']}>
8 changes: 7 additions & 1 deletion src/libs/ajax.js
Original file line number Diff line number Diff line change
@@ -205,8 +205,14 @@ export const DAR = {
},

searchOntologyIdList: async ids => {
if (isNil(ids) || ids.length === 0) {
return [];
}
const url = `${await getOntologyUrl()}/search?id=${ids}`;
const res = await fetchOk(url, Config.authOpts());
const res = await fetchAny(url, Config.authOpts());
if (res.status >= 400) {
return [];
}
return await res.json();
},

6 changes: 5 additions & 1 deletion src/libs/ontologyService.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import axios from 'axios';
import { Notifications } from '../libs/utils';
import { Notifications } from './utils';
import { getOntologyUrl } from './ajax';
import isNil from 'lodash';


export const OntologyService = {
searchOntology: async (obolibraryURL) => {
if (isNil(obolibraryURL) || obolibraryURL.length === 0) {
return [];
}
const baseURL = await getOntologyUrl();
const params = {id: obolibraryURL};
try{

0 comments on commit f99a735

Please sign in to comment.