Hi everyone, I’m running a bahmni installation for education purpose. After the last update I have a problem with the odoo-link on the bahmni home page. Here is my a part of my whiteLable.json:
...
"landingPage": [
{
"enabled": true,
"name": "clinicalService",
"title": "Klinisches Arbeitsplatzsystem",
"logo": "/bahmni/images/app.png",
"link": "/bahmni/home"
},
{
"enabled": true,
"name": "openelis",
"title": "Labor",
"logo": "/bahmni/images/lab.png",
"link": "/openelis"
},
{
"enabled": true,
"name": "odoo",
"title": "Abrechnung",
"logo": "/bahmni/images/bills.png",
"link": ""
},
...
I realized that the link to odoo (and crater) is only be created correctly if the home-sceen is called from “localhost” or by using the IP address of the server. If I use the full URL (´gm-kis1.hnu.de´) the link remains empty. The reason for this is the following javascript part of the home screen :
function isIpAddress(host) { return /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host); } const getAppLink = (app) => { if (app.name === "crater" || app.name === "odoo") { let url = '/'; #### HERE #### -> if (window.location.host === "localhost" || isIpAddress(window.location.host)) { <-- #### HERE #### if (app.name === "odoo") url = `http://${window.location.host}:8069`; else url = `https://${window.location.host}:444`; } else if (app.linkPrefix) { url = window.location.protocol + `//${app.linkPrefix}-` + window.location.host; } return url; } return app.link ?? "/"; };
This behavior doesn’t seem correct to me. It might be related to openmrs-module-bahmniapps
, but I’m not entirely sure. If that’s the case, I would consider opening a new topic in the Issues section on GitHub.
Of course, I could create a workaround myself, but I believe this should be addressed properly.
Alternatively, it’s possible that I misunderstood the configuration or made a mistake. If so, I apologize and would be very grateful for any advice or guidance.
regards Peter