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
mgr/dashboard: Remove _filterValue from CdFormGroup #24719
Conversation
@@ -113,6 +113,7 @@ export class RgwUserFormComponent implements OnInit { | |||
] | |||
] | |||
}); | |||
this.userForm._filterValue = (value) => value; |
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.
Please add a comment here why it is necessary to override this function.
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.
IMHO, a comment on that function doesn't make the implementation better. What we really need, and that's what you've already said @votdev, is a refactoring.
Can you please add a comment that explains the need of the I think the current implementation of getValue will fail if the processed control is a checkbox that return 'false' in unchecked state. If you call the method then you can not differentiate anymore between unchecked state and "if it has none it will return false". In my opinion this method is missdesigned and should be refactored. |
95dd6b7
to
e054cae
Compare
jenkins test dashboard |
e054cae
to
836c0fd
Compare
Addressed all comments |
lgtm, but it feels a little bit odd that a (by now) refactoring PR contains a test addition for an issue. It might make sense to have two commits here. |
spyOn(rgwUserService, 'update'); | ||
component.editing = true; | ||
|
||
const user_id = component.userForm.get('email'); |
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.
s/user_id/email/
It turned out that "_filterValue" wasn't needed for any form. Fixes: http://tracker.ceph.com/issues/26861 Signed-off-by: Stephan Müller <smueller@suse.com>
836c0fd
to
d4963c3
Compare
Addressed all comments |
The current behavior when submitting an empty mail field in the RGW user form that was previously filled was to replace it with "false". This was a regression introduced through the use of "CdFormGroup" which had a "_filterValue" method which converted empty strings into false, but it was removed now. Fixes: http://tracker.ceph.com/issues/26861 Signed-off-by: Stephan Müller <smueller@suse.com>
d4963c3
to
a159f5a
Compare
jenkins retest this please |
The current behavior when submitting an empty mail field in the RGW user form
that was previously filled was to replace it with "false".
This was a regression introduced through the use of "CdFormGroup" which had
a "_filterValue" method which converted empty strings into false, but it was
removed now.
Fixes: http://tracker.ceph.com/issues/26861
Signed-off-by: Stephan Müller smueller@suse.com