-
Notifications
You must be signed in to change notification settings - Fork 217
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) Notify config system when app is fully loaded #1228
Conversation
Size Change: -150 kB (-2.38%) Total Size: 6.15 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a much better way to handle updating moduleLoaded
.
Should we remove the line in defineConfigSchema
?
I wonder if defining extension config works at all, and whether this fix will allow it to work. The fact that extension-config.test.tsx does not have any tests using defineExtensionConfigSchema
gives me some pause.
Honestly, that's initially what I did and I got lazy fixing tests, but I think you're right.
It actually does: This is just the obs-by-encounter widget added to a random slot with no additional config. Since it's showing something, the schema defaults are taking, so something is parsing the schema and correctly associating it. That said, it doesn't look like it should work to me... |
So, not marking the module as loaded at the end of |
This fixed https://openmrs.atlassian.net/browse/O3-4254 if I'm not mistaken |
@brandones Yes, though not as fully as I'd like. |
Requirements
feat
,fix
, orchore
, among others). See existing PR titles for inspiration.For changes to apps
If applicable
Summary
This is a companion commit for openmrs/openmrs-esm-patient-chart#2139. The underlying issue in that PR is that a module is only registered as loaded when
defineConfigSchema()
is called, causing the promises used to load the configuration to never resolve whendefineConfigSchema()
isn't called. (It is technically an error to calluseConfig()
without having calleddefineConfigSchema()
, but its unclear when to log this error since we can't always know when the config is read).This PR adds a call at the end of the app loading process to ensure that the module is marked as "loaded" in the configuration system.
Note that openmrs/openmrs-esm-patient-chart#2139 should still be committed even with this change.
Screenshots
Related Issue
Other