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

Refactoring on exploreReducer.js #4836

Merged
merged 2 commits into from
Apr 23, 2018
Merged

Refactoring on exploreReducer.js #4836

merged 2 commits into from
Apr 23, 2018

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Apr 17, 2018

Changed return statement to have es6 syntax insteas of Object.assign() function call

@betodealmeida @mistercrunch

@hughhhh hughhhh changed the title Refactoring on exploreReducer Refactoring on exploreReducer.js Apr 17, 2018
@hughhhh hughhhh changed the title Refactoring on exploreReducer.js [WIP] Refactoring on exploreReducer.js Apr 17, 2018
return Object.assign({}, state, { controls });
return {
...state,
...controls,
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this line is right, shouldn't this be controls: just controls, ?

return Object.assign({}, state, { controls });
return {
...state,
...controls,
Copy link
Member

Choose a reason for hiding this comment

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

Is this right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Reference ^^ above comments

@mistercrunch
Copy link
Member

Please fix the build failure and merge conflict.

@codecov-io
Copy link

codecov-io commented Apr 18, 2018

Codecov Report

Merging #4836 into master will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4836      +/-   ##
==========================================
+ Coverage   76.91%   76.96%   +0.04%     
==========================================
  Files          44       44              
  Lines        8522     8534      +12     
==========================================
+ Hits         6555     6568      +13     
+ Misses       1967     1966       -1
Impacted Files Coverage Δ
superset/connectors/sqla/models.py 74.23% <0%> (-1.18%) ⬇️
superset/utils.py 88.06% <0%> (-0.04%) ⬇️
superset/views/core.py 74.68% <0%> (+0.03%) ⬆️
superset/models/core.py 86.54% <0%> (+0.04%) ⬆️
superset/viz.py 79.87% <0%> (+0.54%) ⬆️

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 eac97ce...fd0c238. Read the comment docs.

@hughhhh hughhhh changed the title [WIP] Refactoring on exploreReducer.js Refactoring on exploreReducer.js Apr 18, 2018
@hughhhh
Copy link
Member Author

hughhhh commented Apr 18, 2018

I was following the same pattern for the Object.assign which is merging state and controls together. I've refactored it using the spread operator notation.

> a
{ foo: 'bar' }
> b
{ hugh: 'miles' }
> {...a, ...b}
{ foo: 'bar', hugh: 'miles' }

return Object.assign({}, state, { controls });
return {
...state,
...controls,
Copy link
Member

@mistercrunch mistercrunch Apr 23, 2018

Choose a reason for hiding this comment

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

From my understanding this will spread the content of controls into the root of state. Meaning if I translate your current statement here into the pre-ES6 notation I'll get Object.assign({}, state, controls); which is different from Object.assign({}, state, { controls });, we want the controls to go under state.controls, not in the root of state

@mistercrunch
Copy link
Member

LGTM

@mistercrunch mistercrunch merged commit 5927e7d into apache:master Apr 23, 2018
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
* refactoring on exploreReducser

* fix building json
timifasubaa pushed a commit to timifasubaa/incubator-superset that referenced this pull request May 31, 2018
* refactoring on exploreReducser

* fix building json
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* refactoring on exploreReducser

* fix building json
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants