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

Theme Details State: Update active field on THEME_ACTIVATED #6703

Merged
merged 5 commits into from Jul 12, 2016

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Jul 12, 2016

This PR drops the isActive method from the theme sheet and instead relies on the active property of the theme object returned from the theme details store. To keep it updated, the themes-details reducer now listens to THEME_ACTIVATED. I'm also adding a test to cover that functionality, and a slightly modified version of that test to cover the same functionality for the themes reducer.

This is still rather suboptimal. This is the third reducer covering essentially the same functionality (as evidenced by the imported function we're using here, and by the duplicated test). Ideally, it should be up to selectors to assemble data from single sources of truth. (I think that's one of the things reselect was made for.)

No visual changes. To test:

  • On a theme sheet, activate the theme and verify that the button label changes to 'Customize' after activation.

Fixes #6595.

Test live: https://calypso.live/?branch=update/themes-details-reducer-update-active-field

@ockham ockham added [Feature Group] Appearance & Themes Features related to the appearance of sites. [Status] In Progress State labels Jul 12, 2016
@ockham ockham added this to the Themes: Maintenance milestone Jul 12, 2016
@ockham ockham self-assigned this Jul 12, 2016
@ockham ockham force-pushed the update/themes-details-reducer-update-active-field branch from 715bbfb to 37e5f41 Compare July 12, 2016 13:30
@ockham ockham added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Jul 12, 2016
@seear
Copy link
Contributor

seear commented Jul 12, 2016

Nice job. Can't see anything wrong here.
🚢

@seear seear added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jul 12, 2016
@ockham ockham force-pushed the update/themes-details-reducer-update-active-field branch from 937efb5 to df0918a Compare July 12, 2016 15:28
@ockham ockham merged commit fc8f153 into master Jul 12, 2016
@ockham ockham deleted the update/themes-details-reducer-update-active-field branch July 12, 2016 15:36
bisko pushed a commit that referenced this pull request Jul 13, 2016
* Theme Sheet: Use isLoaded() helper

* Theme Details State: Update active field on THEME_ACTIVATED

* Theme Sheet: Drop obsolete isActive() method

* Theme Details Reducer: Cover THEME_ACTIVATED action with test

* Themes Reducer: Cover THEME_ACTIVATED action with test
@ockham
Copy link
Contributor Author

ockham commented Jul 29, 2016

This is still rather suboptimal. This is the third reducer covering essentially the same functionality (as evidenced by the imported function we're using here, and by the duplicated test). Ideally, it should be up to selectors to assemble data from single sources of truth. (I think that's one of the things reselect was made for.)

Filed #7167.

bisko pushed a commit that referenced this pull request Aug 8, 2016
* Theme Sheet: Use isLoaded() helper

* Theme Details State: Update active field on THEME_ACTIVATED

* Theme Sheet: Drop obsolete isActive() method

* Theme Details Reducer: Cover THEME_ACTIVATED action with test

* Themes Reducer: Cover THEME_ACTIVATED action with test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Appearance & Themes Features related to the appearance of sites. State
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants