Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) O3-2025: Visit enabled system setting should be referenced using "visit.enabled" #1099

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

Jexsie
Copy link
Contributor

@Jexsie Jexsie commented Apr 5, 2023

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

  • Updates the Visit enabled system settings by name and if it's not set, defaults to true.

Screenshots

Related Issue

Other

@Jexsie
Copy link
Contributor Author

Jexsie commented Apr 5, 2023

cc @ibacher @mogoodrich

Copy link
Member

@mogoodrich mogoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though it would be good for @ibacher to glance at it quickly since he's closer to this than me.

@ibacher ibacher merged commit 765217b into openmrs:main Apr 11, 2023
5 checks passed
@denniskigen
Copy link
Member

denniskigen commented Apr 18, 2023

This request is currently failing on dev3:

Screenshot 2023-04-18 at 11 59 11 PM

Screenshot 2023-04-19 at 12 01 33 AM

@denniskigen
Copy link
Member

Potentially a similar situation to #900

@mogoodrich
Copy link
Member

@ibacher @denniskigen probably because that GP doesn't exist on dev3 (and that might be okay, as long as it just goes with the default, which I believe is 'true', if it isn't present?)

@ibacher
Copy link
Member

ibacher commented Apr 18, 2023

It's probably ok, but if the request holds things up, it would make sense to do the same thing as in #900... The real issue in #900 was there were two chained requests that needed to resolve before the display would be finalised.

@Ruhanga
Copy link
Member

Ruhanga commented Apr 19, 2023

@ibacher, @mogoodrich, @denniskigen, @Jexsie, could we rather use the existing visits.enabled GP? Otherwise we update it to visit.enabled for consistency.

@vasharma05
Copy link
Member

Shouldn't this change be done from the config schema itself, instead of writing it directly.

@vasharma05
Copy link
Member

vasharma05 commented Apr 19, 2023

The UUID in the configuration should be replaced in the config schema to visits.enabled.
We shouldn't hardcode anything I believe, it should be done via configuration.

@ibacher
Copy link
Member

ibacher commented Apr 19, 2023

@vasharma05 For system settings, the name is the identifier for the setting, so this isn't exactly the same as hard-coding an implementation-changeable variable. (In essence UUIDs are changeable across implementations because we don't always hard-code them; names for system settings, however, are properly a unique identifier for the setting), so this implementation is correct).

PS "We shouldn't hardcode anything I believe, it should be done via configuration." is, I think, not the right approach. We want to allow reasonable customisation, but it's a balancing act: if too many things are configurable, the configuration schemas become harder to use for non-developers. For the most part, the goal of configuration schemas should be to enable non-developer users to tweak how things work in their systems in ways we can reasonably anticipate they will need to do so. Of course, what qualifies as "reasonable" varies depending on the component in question. Registration, for example, is a beast configuration-wise, but that's because the core functionality is basically the same, but the details of what people need to capture can vary widely. On the other hand, for things like widgets in the patient chart, I'd err on the side of creating a new MF rather than adding too many configuration options. There are technical reasons why we sometimes need to encode UUIDs in configuration schemas (because UUIDs can vary across installations), but when this happens, it should be regarded as a regrettable circumstance and where we can avoid exposing them in implementer-facing interfaces, we should always prefer to do so.

@ibacher
Copy link
Member

ibacher commented Apr 19, 2023

could we rather use the existing visits.enabled GP?

@Ruhanga That was the intention. The mistake is in the ticket itself.

@mogoodrich
Copy link
Member

Yeah, I wrote the ticketed based on this line from the config description:

"_description: "UUID for the system setting's property 'visit.enabled'""... looks like there was typo there, if the global property is really called "visits.enabled", that's what we should be using.

@vasharma05 agree with @ibacher Also in this case "visits.enabled" is really a configuration property defined on the back-end (as a global property, which is the way configuration properties are defined on the back end), so having a configuration property in the front-end config to point to "visits.enabled" is kind of duplicatively: having a configuration property that points to another configuration property. Implementers have full control of what to set the 'visits.enabled" global property to.

@Jexsie Jexsie deleted the medic branch April 20, 2023 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants