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

[Issue 683] - when changing columns displayed, grid will only make on… #982

Conversation

Blackbaud-LuisBello
Copy link
Contributor

@Blackbaud-LuisBello Blackbaud-LuisBello commented Aug 8, 2017

…e service call to update data

unit tests passing, 100% coverage. No changes to visual component were made.

Addresses: #683

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: c8d1363
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/262377005

(Please note that this is a fully automated comment.)

@codecov-io
Copy link

codecov-io commented Aug 8, 2017

Codecov Report

Merging #982 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #982   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files         307    308    +1     
  Lines        5573   5592   +19     
  Branches      701    704    +3     
=====================================
+ Hits         5573   5592   +19
Impacted Files Coverage Δ
...modules/list-view-grid/list-view-grid.component.ts 100% <100%> (ø) ⬆️
src/modules/list/list.component.ts 100% <100%> (ø) ⬆️
...rc/modules/list/state/search/set-options.action.ts 100% <100%> (ø)
...c/modules/list/state/search/search.orchestrator.ts 100% <100%> (ø) ⬆️
src/modules/list/state/search/actions.ts 100% <100%> (ø) ⬆️
src/modules/list/state/list-state.rxstate.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 7059d25...7e58167. Read the comment docs.

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 618b093
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/263110872

(Please note that this is a fully automated comment.)

@Blackbaud-SteveBrush Blackbaud-SteveBrush self-assigned this Aug 16, 2017
@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 7e0ad29
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/265594223

(Please note that this is a fully automated comment.)

@Blackbaud-SteveBrush
Copy link
Member

@Blackbaud-LuisBello Is the intended behavior that only one call will be made to the dataProvider for the entire Grid? I'm still getting two "hits" every time the columns are updated.

(Also, the Plunkr isn't working anymore on the issue, so I may be reproducing the List View Grid incorrectly. #683)

@Blackbaud-LuisBello
Copy link
Contributor Author

the behavior should be that the main grid makes only one call on a column upgrade. the column selector modal is its own list and so, it's also making a data provider call which you might be seeing as that "second" one. The best way to test this fix is using a grid hooked up to a data service to fetch its data. when changing columns, only one service call should be made to fetch the new data. We had this same bug in our project and with this fix, our grid now correctly only makes one data call

this.next(new ListSearchSetOptionsAction(
new ListSearchSetSearchTextAction(searchText),
new ListSearchSetFieldSelectorsAction(fieldSelectors),
new ListSearchSetFunctionsAction(sortFunctions)
Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush Aug 17, 2017

Choose a reason for hiding this comment

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

You have fieldSelectors as the last parameter of searchSetOptions(), but it's the middle parameter for ListSearchOptionsAction constructor. Possible to make them consistent?

UPDATE: This shouldn't be an issue when you write the "options" setter's interface (see previous comment).

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 2ae1212
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/265668768

(Please note that this is a fully automated comment.)

undefined,
setFunctions,
displayedColumns.map(d => d.field)
);

Choose a reason for hiding this comment

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

I like the convenience of having a single method for all options, but I can imagine this getting a bit unwieldy, especially if a contributor needs to remember in which order the arguments need to be called.

I recommend that we either maintain the individual setter methods, or create a new interface that would allow a single key-value parameter (see example below). I prefer the individual setter methods, personally, because it reduces the complexity of having yet another interface on this thing.

@Blackbaud-BobbyEarl: Thoughts?

export ListSearchSetOptionsConfig {
  searchText: string;
  sortFunctions: ((data: any, searchText: string) => boolean)[];
  fieldSelectors: Array<string>;
}

// ...

public searchSetOptions(options: ListSearchSetOptionsConfig) { }

Choose a reason for hiding this comment

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

I agree with @Blackbaud-SteveBrush that if you're going to combine the methods into a single operation, it's argument should be of a new type.

I'm mostly impartial on multiple setters vs using a single method with a known argument type. If forced, I would probably lean towards the latter. The former seems like it might be possible to leak implementation details, do I need to call the methods in a specific order, for example.

Choose a reason for hiding this comment

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

You bring up a good point, @Blackbaud-BobbyEarl.

@Blackbaud-LuisBello: If you wouldn't mind generating the interface for the "options" setter, that would be ideal!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure thing, on it!

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like just some extra overhead for little benefit. Since you can just look at the function definition which is a common task for developers (and quite trivial with IDEs).

…e service call to update data

unit tests passing, 100% coverage. No changes to visual component were made.
@Blackbaud-LuisBello
Copy link
Contributor Author

Blackbaud-LuisBello commented Aug 21, 2017

@Blackbaud-SteveBrush @Blackbaud-BobbyEarl updated to use the ListSearchModel instead of separate parameters, should be good now

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 7e58167
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/266834804

(Please note that this is a fully automated comment.)

Copy link

@Blackbaud-BobbyEarl Blackbaud-BobbyEarl left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks, @Blackbaud-LuisBello!

@Blackbaud-SteveBrush Blackbaud-SteveBrush merged commit f74daee into blackbaud:master Aug 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants