Skip to content

Studio: Fix incorrect offline message displayed alongside "delete site" link - #141

Merged
katinthehatsite merged 7 commits into
trunkfrom
fix/message-with-multiple-demo-sites
May 17, 2024
Merged

Studio: Fix incorrect offline message displayed alongside "delete site" link#141
katinthehatsite merged 7 commits into
trunkfrom
fix/message-with-multiple-demo-sites

Conversation

@katinthehatsite

Copy link
Copy Markdown
Contributor

Closes https://github.com/Automattic/dotcom-forge/issues/7144

Proposed Changes

This PR does the following:

  • it allows to delete a local site that does not have any demo sites when the user is offline
  • it adjusts the offline message on the Delete site link to be displayed only when the user has a local site with snapshots

Testing Instructions

  • Pull the changes from this branch
  • Start the app with nvm use && npm install && npm start
  • Create a local site
  • Create a second local site and add a demo site for this one
  • Disable your device's internet connection (in my case, I disabled WIFI)
  • Navigate to Settings tab for a local site that has a demo site associated with it
  • Observe that the Delete site link is disabled and the offline message appears:
Screenshot 2024-05-17 at 11 35 04 AM
  • Navigate to another local site that does not have a demo site associated with it
  • Observe that the Delete site link is available under Settings tab
  • Click on Delete site
  • Confirm that the local site was deleted

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@katinthehatsite
katinthehatsite requested a review from a team May 17, 2024 09:37
@katinthehatsite katinthehatsite self-assigned this May 17, 2024
Comment thread src/hooks/use-site-details.tsx Outdated
@kozer

kozer commented May 17, 2024

Copy link
Copy Markdown
Contributor

I tested it and works as expected! ( However I left a comment, as things can be simplified )
2024-05-17T14:55:21,263301927+03:00
2024-05-17T14:55:28,989981768+03:00

Comment thread src/hooks/use-site-details.tsx Outdated
@katinthehatsite
katinthehatsite requested a review from a team May 17, 2024 12:52
@wojtekn
wojtekn requested a review from a team May 17, 2024 12:57
@kozer

kozer commented May 17, 2024

Copy link
Copy Markdown
Contributor

@katinthehatsite , while I was testing it, I found a bug! It's not related to you ( Happens on the trunk as well ). I'll approve! Nice work!
( Wojtek asked from team Sparrow to review it as well, so let's wait )

@SiobhyB SiobhyB left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This works perfectly for me, thanks for fixing Kat 🙌

@katinthehatsite
katinthehatsite merged commit 25df9d6 into trunk May 17, 2024
@katinthehatsite
katinthehatsite deleted the fix/message-with-multiple-demo-sites branch May 17, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants