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

Jkmarx/avoid duplicate api calls #3204

Merged
merged 2 commits into from Feb 8, 2019
Merged

Conversation

jkmarx
Copy link
Member

@jkmarx jkmarx commented Feb 8, 2019

Resolves #2006

  • Some refactoring (tried to minimize)
  • Add unit tests


var promise = $q.defer();
Copy link
Member Author

Choose a reason for hiding this comment

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

  1. Wrapped service call in a function per style guide and testability.
  2. Reordered function per style guide.

vm.gridOptions.onRegisterApi = function (api) {
api.core.on.sortChanged(null, vm.sortChanged);
};

/**
Copy link
Member Author

Choose a reason for hiding this comment

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

Code kept in tack minus function wrapper.

}, function () {
$log.error('/files/ request failed');
promise.reject();
/*
Copy link
Member Author

Choose a reason for hiding this comment

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

  • Avoid duplicate api call and watch added factory variable, which is updated when files-ctrl calls api for the grid data.

@@ -1,12 +0,0 @@
(function () {
Copy link
Member Author

Choose a reason for hiding this comment

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

unused

@jkmarx jkmarx self-assigned this Feb 8, 2019
@codecov
Copy link

codecov bot commented Feb 8, 2019

Codecov Report

Merging #3204 into develop will decrease coverage by 1.59%.
The diff coverage is 43.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop    #3204     +/-   ##
==========================================
- Coverage    63.82%   62.23%   -1.6%     
==========================================
  Files          441      439      -2     
  Lines        30060    27766   -2294     
  Branches      1295     1282     -13     
==========================================
- Hits         19186    17279   -1907     
+ Misses       10874    10487    -387
Impacted Files Coverage Δ
.../user-file-browser/directives/user-file-browser.js 50% <ø> (+10%) ⬆️
...ui/source/js/user-file-browser/services/factory.js 83.01% <100%> (-0.1%) ⬇️
...file-browser/ctrls/user-file-browser-files-ctrl.js 43.54% <34.21%> (-2.92%) ⬇️
...le-browser/ctrls/user-file-browser-filters-ctrl.js 33.33% <60%> (+6.36%) ⬆️
refinery/data_set_manager/isa_tab_parser.py 64.95% <0%> (-10.87%) ⬇️
refinery/data_set_manager/views.py 62.1% <0%> (-3.29%) ⬇️
refinery/core/models.py 79.2% <0%> (-2.61%) ⬇️
refinery/tool_manager/views.py 92.3% <0%> (-2.35%) ⬇️
refinery/data_set_manager/models.py 83.44% <0%> (-2.35%) ⬇️
refinery/file_store/models.py 79.22% <0%> (-2.32%) ⬇️
... and 13 more

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 14e3113...e838c4f. Read the comment docs.

@jkmarx jkmarx added this to the Release 1.6.8 milestone Feb 8, 2019
@jkmarx jkmarx merged commit fb49ec4 into develop Feb 8, 2019
@jkmarx jkmarx deleted the jkmarx/avoid-duplicate-api-calls branch February 8, 2019 15:50
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

2 participants