Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Squashed commit of the following:

commit e613216
Author: Boris Kovar <boris.kovar@m2ms.sk>
Date:   Wed Jul 31 13:57:02 2024 +0200

    - implemented #1251

* #1482 added TagName and CentroidRes columns for expanded view of observation dialog

* #1489 show warning toast message if is defined on target load

* #1322 added longcode column

* updated general function for tag comparison

* #1505 adjusted getting of centroid_res

---------

Co-authored-by: matej <matej.vavrek@m2ms.sk>
  • Loading branch information
boriskovar-m2ms and matej-vavrek authored Sep 6, 2024
1 parent a902593 commit 0e308b8
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions js/components/preview/molecule/moleculeView/moleculeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,33 @@ const MoleculeView = memo(

useEffect(() => {
api({
url: `${base_url}/api/canon_sites/`,
url: `${base_url}/api/canon_site_confs/`,
method: METHOD.GET
})
.then(resp => {
const canonSite = resp.data.results.find(canonSite => canonSite.id === data.canon_site_conf);
setCentroidRes(canonSite ? canonSite.centroid_res : '');
const canonSiteConf = resp.data.results.find(canonSiteConf => canonSiteConf.id === data.canon_site_conf);
if (canonSiteConf) {
api({
url: `${base_url}/api/canon_sites/`,
method: METHOD.GET
})
.then(resp => {
const canonSite = resp.data.results.find(canonSite => canonSite.id === canonSiteConf.canon_site);
if (canonSite) {
setCentroidRes(canonSite.centroid_res);
} else {
console.log('there is not any matching canonSite object with ' + canonSiteConf.canon_site + ' id');
setCentroidRes('');
}
})
.catch(err => {
console.log('error fetching centroid_res from canon_sites', err);
setCentroidRes('');
});
} else {
console.log('there is not any matching canonSiteConf object with ' + data.canon_site_conf + ' id');
setCentroidRes('');
}
})
.catch(err => {
console.log('error fetching centroid_res from canon_sites', err);
Expand Down

0 comments on commit 0e308b8

Please sign in to comment.