Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(SF-979): Fix sort types, make withoutSorts check ByIdSorts, update test#85

Merged
Vic-Dev merged 3 commits into
developgroupby/api-javascript:developfrom
SF-979groupby/api-javascript:SF-979Copy head branch name to clipboard
Sep 20, 2018
Merged

fix(SF-979): Fix sort types, make withoutSorts check ByIdSorts, update test#85
Vic-Dev merged 3 commits into
developgroupby/api-javascript:developfrom
SF-979groupby/api-javascript:SF-979Copy head branch name to clipboard

Conversation

@Vic-Dev

@Vic-Dev Vic-Dev commented Sep 17, 2018

Copy link
Copy Markdown
Contributor

No description provided.

@jmbtutor jmbtutor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Just the one comment about casting vs bracket property access.

Comment thread src/core/query.ts

withoutSorts(...sorts: Sort[]): Query {
this.request.sort = this.request.sort.filter((oldSort) => !sorts.find((sort) => sort.field === oldSort.field));
this.request.sort = this.request.sort.filter((oldSort) => !sorts.find((sort) =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This feels inefficient because it's an O(n2) algorithm. We can bring it down to O(n) by going through sorts and adding each string representation of ids as keys to an ids object and each field as keys to a fields object, then going through this.request.sort and looking them up in the appropriate objects.

That said, sorts (and possibly this.request.sort) is probably going to be small enough (less than 5?) that we can probably get away with what we're already doing.

Comment thread src/core/query.ts Outdated
@codecov-io

codecov-io commented Sep 18, 2018

Copy link
Copy Markdown

Codecov Report

Merging #85 into develop will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #85      +/-   ##
===========================================
+ Coverage    99.17%   99.17%   +<.01%     
===========================================
  Files            3        3              
  Lines          241      243       +2     
  Branches        22       23       +1     
===========================================
+ Hits           239      241       +2     
  Partials         2        2
Impacted Files Coverage Δ
src/core/query.ts 98.44% <100%> (+0.02%) ⬆️

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 77cfa37...8bbbec9. Read the comment docs.

@jmbtutor jmbtutor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

@Vic-Dev Vic-Dev merged commit e9e5bce into develop Sep 20, 2018
@Vic-Dev Vic-Dev deleted the SF-979 branch September 20, 2018 16:35
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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.