-
Notifications
You must be signed in to change notification settings - Fork 18
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
Studio: Allow blocking user from adding demo sites #354
Conversation
@katinthehatsite could we also account for a case in which we disable demo sites for the user who has Studio already open? Currently, when such a user tries to add a demo site, they will get a proper error message, but the button won't be disabled: |
Hmm let me check what is happening there 👀 |
@wojtekn I made some updates, would you be able to give it another try? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @fluiddot ! I made some changes to block the I tried the alternative solution but I think at the end, it comes to the same thing that @wojtekn mentioned initially with the app not updating the data in real-time. I left it as is for now, let's wait for some comments and see if we should change the approach of polling the endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created a PR to simplify the logic of the update demo site button. Let me know what do you think. #388
I've tested login in, loging out, enabling and disabling my user RC setting, and it works as expected. Great job!
Uwi625.mp4
From my point of view I would avoid adding the active listening. I see it as a corner case.
I like how we refresh the state when the user starts the app or logs in. We should use a similar criteria as we do with the quota of demo sites.
Instead of adding an active listening, I would disable the button after the first fail. Not a strong opinion.
Based on our discussions of this issue, I have implemented the behaviour mentioned in the comment above. Since it is more of an edge case, I would be okay not to poll the endpoint and update the information in real-time. @sejas could you please give it another test and let me know what you think? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kat!, thanks for applying the suggested cahnges.
I've tested the edge case when a user gets blocked and it has Studio running.
As shown in the video, the create demo site will fail and immediately will see the tooltip 👍 .
zo12GS.mp4
Thanks @katinthehatsite for addressing the comments I shared. I've tested the changes in |
Related to https://github.com/Automattic/dotcom-forge/issues/7370
Proposed Changes
This PR implements the UI for when the user is blocked from creating a demo site:
Testing Instructions
Disable site creation
button (at the bottom of the User Report Card) to block your user from creating demo sitesnvm use && npm install && npm start
Share
tabAdd demo site
button is disabledPre-merge Checklist