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

Update skyAppLink to use optional excludeDefaults to getAll. #402

Merged
merged 6 commits into from
May 7, 2018

Conversation

Blackbaud-BobbyEarl
Copy link

@Blackbaud-BobbyEarl Blackbaud-BobbyEarl commented Apr 25, 2018

@codecov-io
Copy link

codecov-io commented Apr 25, 2018

Codecov Report

Merging #402 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #402      +/-   ##
=========================================
+ Coverage    99.3%   99.3%   +<.01%     
=========================================
  Files          73      73              
  Lines        1867    1873       +6     
  Branches      293     294       +1     
=========================================
+ Hits         1854    1860       +6     
  Misses         13      13
Flag Coverage Δ
#builder 100% <ø> (ø) ⬆️
#runtime 95.42% <100%> (+0.09%) ⬆️
#srcapp 100% <ø> (ø) ⬆️
Impacted Files Coverage Δ
runtime/directives/sky-app-link.directive.ts 100% <100%> (ø) ⬆️
runtime/params.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 6f23cdb...85a3a0f. Read the comment docs.

Bobby Earl added 3 commits May 1, 2018 15:34
@Blackbaud-BobbyEarl
Copy link
Author

Let me know if this implementation is more inline what what you were thinking @Blackbaud-PaulCrowder.

return params;
};

return this.getAllKeys()

Choose a reason for hiding this comment

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

My suggestion here would be to write a simple loop to build up the object. It'll cut down on both the amount of code written as well as the number of loops executed (1 vs. 2) and be more legible IMO.

const filteredParams: { [key: string]: string} = {};

this.getAllKeys().forEach(key => {
  if (!excludeDefaults || this.params[key] !== this.defaultParamValues[key]) {
    filteredParams[key] = this.params[key];
  }
});

return filteredParams;

@Blackbaud-BobbyEarl Blackbaud-BobbyEarl self-assigned this May 7, 2018
@Blackbaud-BobbyEarl Blackbaud-BobbyEarl merged commit 21d0e24 into master May 7, 2018
@Blackbaud-BobbyEarl Blackbaud-BobbyEarl deleted the params-exclude-defaults branch May 7, 2018 14:11
Blackbaud-MikitaYankouski pushed a commit to Blackbaud-MikitaYankouski/skyux-builder that referenced this pull request May 3, 2019
…ud#402)

* Update skyAppLink to use optional excludeDefaults to getAll.

* Incorporated feedback

* Cleanup

* Revert "Cleanup"

This reverts commit 07742f5.

* Simplifying logic
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.

3 participants