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

Entities loading #748

Merged
merged 15 commits into from
Jun 26, 2018
Merged

Entities loading #748

merged 15 commits into from
Jun 26, 2018

Conversation

bjoernricks
Copy link
Contributor

Update and simplify the entities loading into the redux store.

With this creator functions action types, actions functions and the
loader function can be created for an entity type. This will result in
less copy and paste code in future.
The moved modules contain helper functions/classes for the to be created
entities actions and selectors. Therefore use a more obvious directory
scheme.
Export the actions as an object with action creator functions.
This function creates a generic entities reducer.
The other cases are already tested in detail for createReducer.
Therefore simplify filterReducer tests to only check the basic
functionality
Now by using generic functions to create entities actions, reducers and
selectors there is no need for having different js modules for each of
them. Therefore merge all filter modules into one single module.
Always convert name parameter to uppercase letters.
Don't export EntitiesSelector class and consider it as an implementation
detail. Provide a createSelector instead. This allows to change the
layout of the reducers more easily without having to touch all entities
selectors.
Accept name instead of a promise function. Currently all load functions
will call gmp[name].getAll. Therefore the createLoadFunc can be
simplified.
Use more generalized names selector, reducer and load.
This function creates all redux related functions and objects in one go.
Namely load, selector, actions, types and reducer.
@codecov
Copy link

codecov bot commented Jun 26, 2018

Codecov Report

Merging #748 into master will increase coverage by 0.07%.
The diff coverage is 89.85%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #748      +/-   ##
=========================================
+ Coverage    5.61%   5.69%   +0.07%     
=========================================
  Files         775     776       +1     
  Lines       25671   25680       +9     
  Branches     5794    5806      +12     
=========================================
+ Hits         1442    1462      +20     
+ Misses      21764   21755       -9     
+ Partials     2465    2463       -2
Impacted Files Coverage Δ
gsa/src/web/store/entities/reducers.js 0% <0%> (ø) ⬆️
gsa/src/web/entities/page.js 0% <0%> (ø) ⬆️
...eb/components/dashboard/display/filterselection.js 0% <0%> (ø) ⬆️
gsa/src/web/store/entities/filters.js 100% <100%> (ø)
gsa/src/web/store/entities/utils/reducers.js 100% <100%> (ø)
gsa/src/web/store/entities/utils/main.js 100% <100%> (ø)
gsa/src/web/store/entities/utils/selectors.js 100% <100%> (ø)
gsa/src/web/store/entities/utils/actions.js 100% <100%> (ø)
... and 1 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 e5cadb8...ae811fa. Read the comment docs.

@swaterkamp swaterkamp merged commit 52d9833 into greenbone:master Jun 26, 2018
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.

2 participants