-
Notifications
You must be signed in to change notification settings - Fork 263
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
AAE-24018 Readonly dropdown with the rest config don't fetch options when form rule change it to not readonly #9959
AAE-24018 Readonly dropdown with the rest config don't fetch options when form rule change it to not readonly #9959
Conversation
Note: With the current code is difficult to call api only when field is not readonly by the applied rule (it would be ideal I guess), so the call is done at the form init even the dropdown is readonly at that time. |
The actual issue refers to cloud widgets but I guess I have to update regular ones as well, I can remove the changes if I'am mistaken (dropdown.widget.* files) |
Can't we track the readonly value change and query the api only then? Why is it not possible? |
After small investigation, we relay on @input() field from inherited component class -> WidgetComponent, and readonly state is determined by field.readOnly property (when this rule will be fulfilled this value will change), I tried to use ngOnChanges hook on that but seems that we still relay on the same reference hence we can't track its changes. The benefit of current implementation is that we always call once when we will call every time readonly has changed it could lead to multiple api calls, which are not needed |
16d4a14
to
75378a7
Compare
lib/process-services/src/lib/form/widgets/dropdown/dropdown.widget.ts
Outdated
Show resolved
Hide resolved
5fde186
to
6a8306c
Compare
Quality Gate passedIssues Measures |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behaviour? (You can also link to an open issue here)
AAE-24018
Screen.Recording.2024-07-18.at.13.32.02.mov
Note: We have form rule here: Enable dropdown when Text field has '1', otherwise is disabled.
What is the new behaviour?
Screen.Recording.2024-07-18.at.13.32.42.mov
Note: We have form rule here: Enable dropdown when Text field has '1', otherwise is disabled.
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: