Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

714 list view grid highlighting #1944

Merged
merged 10 commits into from
Aug 29, 2018

Conversation

Blackbaud-TrevorBurch
Copy link
Member

Resolves #714

@Blackbaud-SteveBrush @Blackbaud-ToddRoberts - I'd like your thoughts on if this should be on by default. Right now I have it on by default as that is what Sky UX 1 is doing. However, I'm also leary about that due to the list view grid/grid components having been in 2 for so long without the highlighting. Should we make it be off by default for now and switch the default back in 3?

@Blackbaud-ToddRoberts
Copy link
Contributor

I think it should be on by default, it's the intended/expected behavior.

@codecov-io
Copy link

codecov-io commented Aug 27, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@d2a966f). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master   #1944   +/-   ##
========================================
  Coverage          ?    100%           
========================================
  Files             ?     424           
  Lines             ?    8954           
  Branches          ?    1322           
========================================
  Hits              ?    8954           
  Misses            ?       0           
  Partials          ?       0
Impacted Files Coverage Δ
src/modules/grid/grid-column.model.ts 100% <100%> (ø)
src/modules/grid/grid-column.component.ts 100% <100%> (ø)
src/modules/grid/grid.module.ts 100% <100%> (ø)
...modules/list-view-grid/list-view-grid.component.ts 100% <100%> (ø)
src/modules/grid/grid.component.ts 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2a966f...8b39f20. Read the comment docs.

@@ -1,7 +1,7 @@
import { SkyVisualTest } from '../../../config/utils/visual-test-commands';
import { element, by } from 'protractor';

describe('grid component', () => {
fdescribe('grid component', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might wanna change this :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Facepalm....... Fixed

@blackbaud-johnly
Copy link
Contributor

Created #1950 to document the new inputs. ... Please let me know if anything else needs to be documented for this.

Copy link
Contributor

@blackbaud-conorwright blackbaud-conorwright left a comment

Choose a reason for hiding this comment

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

Looks pretty good otherwise. Nice work, lists are a messy component set 😛

component.grid.currentSearchText.subscribe(currentText => {
expect(currentText).toBe('searchText');
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a done() call or something to ensure the expect is always being hit?

Copy link
Member Author

Choose a reason for hiding this comment

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

You can't mix fakeAsync and done as done makes the test async. I did some manual testing and see that it is getting hit and based the test off others in this spec. I don't mind changing it to async but know that in another PR I was asked to look into making a test fakeAsync instead of async.

Thoughts @blackbaud-conorwright?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, done will not be usable here. As long is this catches when the logic is removed it's fine :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I double checked and if the logic to updated currentSearchText is removed then the test fails

</sky-grid>
</div>
<button id="highlight-button" class="sky-btn sky-btn-primary" (click)="triggerHighlight()">Trigger Highlight</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

split attributes out to multiple lines #1647 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -8,6 +8,7 @@
[selectedColumnIds]="selectedColumnIds | async"
[columns]="columns | async"
[hasToolbar]="hasToolbar | async"
[highlightText]="highlightSearchText ? (currentSearchText | async) : undefined"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can highlightSearchText be a getter so that this logic could be handled in the ts file and included in coverage?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind. The logic will be much worse, since currentSearchText is an observable. We will leave this as it is

.takeUntil(this.ngUnsubscribe)
.subscribe(searchText => {
this.currentSearchText.next(searchText);
});
Copy link
Contributor

@blackbaud-conorwright blackbaud-conorwright Aug 29, 2018

Choose a reason for hiding this comment

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

Just a minor suggestion, but can this be reduced?
Like:

public currentSearchText: Observable<string>;

this.currentSearchText = this.state.map(s => s.searchText);

I'm also curious if currentSearchText must be an observable

Copy link
Contributor

Choose a reason for hiding this comment

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

Take a look at the reduction, but it should just be an observable considering how the list is already designed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@Blackbaud-AlexKingman Blackbaud-AlexKingman left a comment

Choose a reason for hiding this comment

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

This worked really well with the skyHighlight directive! Looks good to me, as long as Connor's comments are satisfied.

Copy link
Contributor

@blackbaud-conorwright blackbaud-conorwright left a comment

Choose a reason for hiding this comment

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

Nice. And thank you for double-checking the test for my sanity 😛

@Blackbaud-TrevorBurch Blackbaud-TrevorBurch deleted the 714-list-view-grid-highlighting branch August 29, 2018 18:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants