Skip to content
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: rewrite Checkbox as a separate module | suit to Fiori3 #1777

Merged
merged 13 commits into from
Jan 14, 2020

Conversation

salarenko
Copy link
Contributor

@salarenko salarenko commented Jan 4, 2020

Please provide a link to the associated issue.

closes #1769

Please provide a brief summary of this pull request.

This pull requests includes:

  • new implementation of checkbox control as separate component and module
  • new checkbox component supporting Fiori3 specification
  • documentation to new component

Checkbox state is driven by value passed to component by FormControl.

Please check whether the PR fulfills the following requirements

  • tests for the changes that have been done

Documentation checklist:

@netlify
Copy link

netlify bot commented Jan 4, 2020

Deploy preview for fundamental-ngx ready!

Built with commit 26be28b

https://deploy-preview-1777--fundamental-ngx.netlify.com

return this.checkboxState === 'indeterminate';
}

writeValue(value: any): void {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's mark methods, that are implemented from ControlValueAccessor as /** @hidden */, they shouldn't be in documentation IMO. Let's shortly describe all of other methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@InnaAtanasova InnaAtanasova added this to In progress in Development via automation Jan 7, 2020
@InnaAtanasova InnaAtanasova added this to the Sprint 28 - Sydney milestone Jan 7, 2020
@InnaAtanasova InnaAtanasova changed the title core(feat): Rewrite Checkbox as separate module | Suit to Fiori3 feat: Rewrite Checkbox as separate module | Suit to Fiori3 Jan 7, 2020
@InnaAtanasova InnaAtanasova changed the title feat: Rewrite Checkbox as separate module | Suit to Fiori3 feat: rewrite Checkbox as a separate module | suit to Fiori3 Jan 7, 2020
code: formGroupInputTs,
fileName: 'checkbox-form-group-example',
component: 'CheckboxFormGroupExampleComponent'
language: 'TypeScript',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typescript should have lower case 't' for stackblitz to work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

ngOnInit() { }
checkboxReactiveForms: ExampleFile[] = [
{
language: 'TypeScript',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


checkboxStates: ExampleFile[] = [
{
language: 'TypeScript',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}
];

checkboxCustomValues: ExampleFile[] = [
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add the html as well for all

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

expect(checkbox.checkboxValue).toBe(false);
});

// it('should be unchecked on double click', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are all of these comments for. IF they are necessary remove the ones with nothing inside

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test cases have been updated


/** Values returned by control. */
@Input()
values: FdCheckboxValues = {trueValue: true, falseValue: false, thirdStateValue: null};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know by doing this we are giving them flexibility but shouldn't a checkbox be strictly a boolean ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkbox control returns boolean values by default.
I think giving user possibility to define values returned by checkbox is a nice and useful feature.

* */
public nextValue(): void {

if (this.disabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link
Contributor

@JKMarkowski JKMarkowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very well for me. Great Job, the compare-object function will be useful in feature..

Development automation moved this from In progress to Reviewer approved Jan 10, 2020
@InnaAtanasova
Copy link
Contributor

Looks very well for me. Great Job, the compare-object function will be useful in feature..

I complete agree with Jedrzej . Great job!

@InnaAtanasova InnaAtanasova self-requested a review January 10, 2020 17:09
@InnaAtanasova
Copy link
Contributor

The build is failing. Could you take a look at it?

@InnaAtanasova InnaAtanasova merged commit 3ef07f8 into SAP:master Jan 14, 2020
Development automation moved this from Reviewer approved to Done Jan 14, 2020
Lokanathan-k pushed a commit that referenced this pull request Feb 3, 2020
* Working cheeckbox implementation

* Create documentation examples

* Add checkbox interface annotations

* feat(core): update unit tests

* feat(core) Update checkbox api description

* core(feat) Working unit tests for checkbox

* feat(core) Introduce compareObjects function | Compare values in checkbox using compareObjects

* core(feat) Review changes

* feat(core) Remove checkbox support in FormControlDirective | Update documentation examples using old versions of checkbox

* feat(core) fix circular dependencies

* feat(core) Add custom label example | Add files indexing

* feat(core) Change encapsulation and change detection strategy

* feat(core) Make MultiInput tests async
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checkbox 0.4.0 adaptation
4 participants