-
Notifications
You must be signed in to change notification settings - Fork 66
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-3970 Re-enable readonly fields #397
Conversation
Size Change: +53 B (0%) Total Size: 1.15 MB ℹ️ View Unchanged
|
@pirupius Can you attach screenshots or a demo video or tests cases showing the readonly feat in action for the different renderings. |
cfa1c3f
to
05dcd6d
Compare
@samuelmale this is ready |
@@ -80,7 +80,7 @@ const MultiSelect: React.FC<FormFieldInputProps> = ({ field, value, errors, warn | |||
return field.isRequired ? <FieldLabel field={field} /> : <span>{t(field.label)}</span>; | |||
}, [field.isRequired, field.label, t]); | |||
|
|||
return sessionMode == 'view' || sessionMode == 'embedded-view' ? ( | |||
return sessionMode == 'view' || sessionMode == 'embedded-view' || isTrue(field.readonly) ? ( |
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.
Ditto
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.
For this component we're using CheckboxGroup
and it has a finicky behavior where regardless of if that property is passed, the user can still interact with the input field.
We might have to consider refactoring this component to use MultiSelect
from Carbon later on that has support for this natively but for now this defaults it to the same display as the view only mode.
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.
As per the call, am deprecating this change in favor of passing the attributes to the children for consistency.
Requirements
Summary
This PR enables readonly mode in the field types that might be having it as well as adding the utility to cater for
boolean
string valuesNOTE: For the date, we're using
OpenmrsDatePicker
and the readonly still shows the date picker so this might be either in newer versions of the framework or needs to be implemented inesm-core
Screenshots
Text
Multi Select
Number
Radio
Dropdown
Textarea
Toogle
Ui-select extended
Workspace
Related Issue
https://openmrs.atlassian.net/browse/O3-3970
Other