I have run into an issue where the /openmrs webapp path is hard coded in JS paths in coreapps - which leads to breakages in all installations that use different web app names. This seems common in webservice calls too
@raff I know its so close to 2.6 release … but it seems like need for a mass cleanup across modules
Yeah, for what it’s worth, one of our instances uses a difference webapp name than OpenMRS, but so far we haven’t noticed any problems… I wonder if we just aren’t using the features where this is an issue? Is it in the new dashboard widgets?
There is a couple of areas where it’s hard coded to ‘/openmrs’, in a GSP if you use ui.contextPath(), you should be fine, I think we need to expose a global variable for the contextPath in one of the core JS files in the uicommons module.
For purely Angular or React apps there’s no way for us to set a global variable from “core” code. So we should just document a preferred way to get the context path (e.g. some utility function that parses window.location).
Okay, I am JS handicapped but I have a case of
<a href="/openmrs/coreapps/patientdashboard/patientDashboard.page?patientId={{ctrl.config.patientUuid}}&visitId={{visit.uuid}}">{{visit.startDatetime | date:'yyyy-MM-dd'}}</a>
In an Angular template file, what would be the recommended approach for replacing the /openmrs/ with the context path? I have seen: