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

State: Remove computed attributes from Redux site object #4060

Merged
merged 4 commits into from
Mar 17, 2016

Conversation

aduth
Copy link
Contributor

@aduth aduth commented Mar 15, 2016

Fixes #2757
Related: #4057

This pull request seeks to resolve remaining issues preventing us from persisting the Redux site state. Because some areas of the application had already depended upon site objects containing decorated attributes, changes were required to remove any such dependencies before site state could be persisted.

Testing instructions:

Ensure Mocha tests pass by running npm test

Verify that no regressions occur in affected components. Specifically:

/cc @gwwar , @ockham , @seear , @ehg

@aduth aduth added [Feature Group] Appearance & Themes Features related to the appearance of sites. Framework [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 15, 2016
}

this.props.dispatch( action );
this.props.dispatch( signup( this.props ) );
Copy link
Contributor

Choose a reason for hiding this comment

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

Was the previous if block a bad copy, or prep for future usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was the previous if block a bad copy, or prep for future usage?

It's my assumption, one which should be confirmed by the themes folks, that the other actions were never reached, due to the fact that selectedSite was never being passed (current use-cases render the non-connected component). It's also not as simple as replacing with sitesList.getSelectedSite(), since the sites-list module is not server-render compatible.

Copy link
Contributor

Choose a reason for hiding this comment

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

@seear ^

Copy link
Contributor

Choose a reason for hiding this comment

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

It is there for future usage, but given that it doesn't work it is fine to rip it out for now.

@gwwar
Copy link
Contributor

gwwar commented Mar 16, 2016

👍 Changes look good. It would be good to get another +1 on the Themes changes before merging.

I found an unrelated bug with removing connections. Let me know if you'd like an issue:

  1. Connect your site to Twitter
  2. Navigate to the Editor and confirm that the connection appears
  3. Go back to disconnect your site from Twitter
  4. Navigate to the Editor
    Expected: Connection is removed
    Actual: Connection remains until indexedDB is cleared

@aduth
Copy link
Contributor Author

aduth commented Mar 16, 2016

Actual: Connection remains until indexedDB is cleared

Would I be correct in assuming then that this only affects environments where Redux persistence is enabled? (May affect prioritization)

@gwwar
Copy link
Contributor

gwwar commented Mar 16, 2016

Would I be correct in assuming then that this only affects environments where Redux persistence is enabled? (May affect prioritization)

I believe so, though in prod it still looks like I still need to refresh the page to see the connection removed in editor. (Navigating between the sharing section and editor doesn't update the view)

aduth added 4 commits March 17, 2016 08:22
Since assumes presence of computed attributes
Assumes existence of computed site attributes. Currently no flow which
would result in `site` being provided to ThemeSheet component
@aduth aduth force-pushed the fix/2757-state-site-decoration branch from 51227dd to bcc5331 Compare March 17, 2016 12:46
@seear
Copy link
Contributor

seear commented Mar 17, 2016

Looks good, and the themes stuff tests out fine 👍

@aduth aduth 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 Mar 17, 2016
@aduth
Copy link
Contributor Author

aduth commented Mar 17, 2016

Thanks for the reviews, all.

aduth added a commit that referenced this pull request Mar 17, 2016
State: Remove computed attributes from Redux site object
@aduth aduth merged commit 4fe7fc9 into master Mar 17, 2016
@aduth aduth deleted the fix/2757-state-site-decoration branch March 17, 2016 14:20
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. Framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Framework: redux sites contains functions
5 participants