-
Notifications
You must be signed in to change notification settings - Fork 208
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
(feat) O3-3857: Support extension overrides in per-slot extension config #1119
Conversation
|
||
const newState = typeof partial === 'function' ? partial(state.configs.slotName[extensionId]) : partial; | ||
if (replace) { | ||
state.configs[slotName][extensionId] = Object.assign({}, newState) as ConfigStore; |
Check warning
Code scanning / CodeQL
Prototype-polluting assignment Medium
library input
This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
library input
if (replace) { | ||
state.configs[slotName][extensionId] = Object.assign({}, newState) as ConfigStore; | ||
} else { | ||
state.configs[slotName][extensionId] = Object.assign({}, state.configs[slotName][extensionId], newState); |
Check warning
Code scanning / CodeQL
Prototype-polluting assignment Medium
library input
This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
library input
Size Change: -80.5 kB (-1.42%) Total Size: 5.57 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.
LGTM (I haven't been able to test it out locally because webpack OOMs when I run the build jobs - but the code looks great)
Requirements
feat
,fix
, orchore
, among others). See existing PR titles for inspiration.For changes to apps
If applicable
Summary
The "Translation overrides" configuration stuff only works when defined at the app level because the translation namespace does not communicate any extension-specific information.
This PR fixes that so that you can provide translation overrides at the level of specific extensions-in-slots, which is useful for some of the implementation of "Clinical views" and other scenarios using "generic extension components".
Screenshots
With this configuration:
When showing the extension in the slot, we get:
When showing it in a different slot we get:
Related Issue
https://issues.openmrs.org/browse/O3-3857
Other
This uses
___
as a field demarcator since other characters I thought of either have special handling in module names or in i18next itself.