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

fix(option group): propagate disabled state to child options #1416

Merged
merged 7 commits into from
Apr 24, 2019
Merged

fix(option group): propagate disabled state to child options #1416

merged 7 commits into from
Apr 24, 2019

Conversation

yggg
Copy link
Contributor

@yggg yggg commented Apr 24, 2019

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

Disable options if group disabled

@yggg yggg requested a review from Tibing April 24, 2019 10:38
nnixaa
nnixaa previously approved these changes Apr 24, 2019
expect(setDisabledSpy).toHaveBeenCalledWith(true);
});

it('should enable options if set enabled', () => {
Copy link
Member

Choose a reason for hiding this comment

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

I think that way test name will be more readable 😄

Suggested change
it('should enable options if set enabled', () => {
it('should enable group options if group enabled', () => {

src/framework/theme/components/select/option.component.ts Outdated Show resolved Hide resolved
@@ -119,6 +122,17 @@ export class NbOptionComponent<T> implements OnDestroy {
this.setSelection(false);
}

/**
* Sets disabled by group state and marks component for check.
* @param disabled group disabled state
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need to specify that @param?

`,
})
export class NbOptionGroupTestComponent {
selectDisabled: boolean = false;
Copy link
Member

Choose a reason for hiding this comment

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

Let's not specify the property type when we assign value during the declaration. I've described that slightly deeper in some comment below.

`,
})
export class NbOptionDisabledTestComponent {
optionGroupDisabled: boolean = false;
Copy link
Member

Choose a reason for hiding this comment

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

Let's not specify the property type when we assign value during the declaration. I've described that slightly deeper in some comment above.

@codecov
Copy link

codecov bot commented Apr 24, 2019

Codecov Report

Merging #1416 into next will increase coverage by 0.11%.
The diff coverage is 96.42%.

@@            Coverage Diff            @@
##            next    #1416      +/-   ##
=========================================
+ Coverage   82.5%   82.61%   +0.11%     
=========================================
  Files        238      238              
  Lines       7270     7294      +24     
  Branches     647      651       +4     
=========================================
+ Hits        5998     6026      +28     
+ Misses      1083     1080       -3     
+ Partials     189      188       -1
Impacted Files Coverage Δ
...mework/theme/components/select/option.component.ts 100% <100%> (+4.65%) ⬆️
.../theme/components/select/option-group.component.ts 96.55% <95.23%> (+14.73%) ⬆️
...mework/theme/components/select/select.component.ts 89.83% <0%> (+0.42%) ⬆️

Tibing
Tibing previously approved these changes Apr 24, 2019
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.

None yet

3 participants