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? |
|
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. |
sejas
left a comment
There was a problem hiding this comment.
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! |
sejas
left a comment
There was a problem hiding this comment.
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 creationbutton (at the bottom of the User Report Card) to block your user from creating demo sitesnvm use && npm install && npm startSharetabAdd demo sitebutton is disabledPre-merge Checklist