-
Notifications
You must be signed in to change notification settings - Fork 834
Settings UI - Non admin: refresh view after unlink. Don't show features if site disconnected #6470
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
Settings UI - Non admin: refresh view after unlink. Don't show features if site disconnected #6470
Conversation
This is very much intentional, and I would be hesitant (opposed) to require a connection to view the site stats within the wp-admin. This is the same for the rest of the content that we currently show (and showed before) in the prior UI and also in the wp-admin main dashboard widget. Non-admins we can be more strict with, but still should make sure we're respecting the stats module options, since admins can choose which roles can see stats. |
23ffb60
to
42f0852
Compare
cbfd98b
to
480c273
Compare
923dc06
to
b9e2564
Compare
What Derek mentioned has been restored now. |
@eliorivero @dereksmart I think the cause of your headache yesterday is the following
Even when its parent The problem here is that we used the lifecycle method What this causes is that even when Something like this could work: I've just added a commit, including this condition to the |
Gracias @oskosk for checking and fixing this! 👍 and the detailed explanation. |
If we're showing a dedicated connect/link page for non-admins, shouldn't we be removing the features from the promotional stuff that includes things they can't activate/deactivate, or may not have access to? Like Photon, Security, Protect, Monitor, Manage, and maybe stats if they're not allowed to see them? I think that would just leave "Free Support" 😂 |
69497cd
to
d3660bc
Compare
…ce prompting user to ask an admin to connect. Don't show link button.
… changed. The Main component implements a shouldComponentUpdate() lifecycle method to check whether it should re-render under certain conditions. We were not including the user linked state among these conditions.
d3660bc
to
18ed27c
Compare
Updated this PR to do only 2 things: don't show features when site is disconnected (and display a warning prompting user to ask admin to connected) and refresh the view after non admin unlink. |
Tested, and works as expected, considering the latest changes:
Code looks good. 🐑 |
Fixes #6464
Fixes #6466 props @oskosk
Changes proposed in this Pull Request:
window.Initial_State
.Testing instructions: