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: (platform) Introduce Checkbox as a Component #2293
Conversation
Deploy preview for fundamental-ngx ready! Built with commit 6bf9738 |
Build failed |
Build is passed, but deploy is failing. there may be some issue with netify. will check with Deno and team. |
Deployment failing is happening for other PR as well. once reviewed will check on that issue. |
libs/platform/src/lib/components/form/checkbox/checkbox.component.ts
Outdated
Show resolved
Hide resolved
libs/platform/src/lib/components/form/checkbox/checkbox.component.ts
Outdated
Show resolved
Hide resolved
...cs/platform-forms/checkbox/platform-checkbox-examples/platform-checkbox-styling.component.ts
Outdated
Show resolved
Hide resolved
9e1683b
to
fc693e8
Compare
Have pushed new changes based on reviews. |
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.
I see a lot of any
for types and methods are missing return type.
fc693e8
to
047ed4f
Compare
...cs/platform-forms/checkbox/platform-checkbox-examples/platform-checkbox-example.component.ts
Outdated
Show resolved
Hide resolved
.../platform-forms/checkbox/platform-checkbox-examples/platform-checkbox-styling.component.html
Outdated
Show resolved
Hide resolved
...cs/platform-forms/checkbox/platform-checkbox-examples/platform-checkbox-styling.component.ts
Outdated
Show resolved
Hide resolved
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.
it does not feel right, the component is not really using things from baseInput + it will not really work with formfield formgroup structure..
Try to look at the previous implementation I prepared for D-com. even its hacky, you see some structure that I put in place https://github.com/ngx-meta/rules/tree/master/libs/fiori-rules
return super.getValue(); | ||
} | ||
set value(value: any) { | ||
if (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.
check parent implementation what it is doing, when setting a value, I need to emit event to parent formField so form field can call markForCheck.
there is stateChanges
- please check it out.
Also what is the added value set your value here instead of setValue from parent?
} | ||
|
||
/** ControlvalueAccessor */ | ||
writeValue(value: any) { |
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.
check what parent writeValue is doing and why
libs/platform/src/lib/components/form/checkbox/checkbox.component.ts
Outdated
Show resolved
Hide resolved
libs/platform/src/lib/components/form/checkbox/checkbox.component.ts
Outdated
Show resolved
Hide resolved
} | ||
|
||
/** @hidden captures controller value */ | ||
private modelValue: any; |
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.
why do you need this extra property, why cant you set it directly? to 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.
now using set value method to call setValue() of baseInput.
libs/platform/src/lib/components/form/checkbox/checkbox.component.ts
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,14 @@ | |||
<fd-checkbox |
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.
Also I see only checkbox here but how this is going to work with FormField and FormGroup? It needs to be part of it, so in formField you set label for the field ..
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.
have included " div fd-form-item " in template.
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.
What are the breaking changes?
@droshev |
My comment was related to the changes you did with this PR. Do you introduce a breaking changes with this PR? If not then you need to update the title of the PR. |
047ed4f
to
3648970
Compare
fix: nested tristate remaining, documentation done
4a8ea47
to
c8cb796
Compare
}) | ||
export class CheckboxComponent extends BaseInput implements AfterViewInit { | ||
/** set to true if binary checkbox */ | ||
@Input() |
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.
I am more or less ok with this version I would work on more on the Selection Model and remove all the code and replace it with Selection Model that exists in the Material/cdk. it will make things much cleaner
After clicking checkbox quickly the page generates errors out |
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.
see comment
This issue is coming from core checkbox. Will raise issue for fix in core checkbox. |
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.
Code LGTM, let's take a look at 1 comment, but I guess it's not in scope of this PR.
...rm-forms/checkbox/platform-checkbox-examples/platform-checkbox-error-handling.component.html
Show resolved
Hide resolved
This issue was reported some time ago. It's not even ngx problem, but chrome&styles issue. |
All required changes are done.
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
Approvals are done. It looks Good for me. Merging it. |
Please provide a link to the associated issue.
#2292
Please provide a brief summary of this pull request.
Created Checkbox component in platform, which works with platform FormFieldControl.
It works fine with Reactive form as well as template driven form.
Please check whether the PR fulfills the following requirements
https://github.com/SAP/fundamental-ngx/blob/master/CONTRIBUTING.md
Documentation checklist:
README.md
Technical specification:
https://github.com/SAP/fundamental-ngx/wiki/Platform:-Checkbox-Component-Technical-Design