Skip to content

Conversation

@sunilsabatp
Copy link
Contributor

@sunilsabatp sunilsabatp commented Nov 6, 2025

Description

Implements the site synchronization feature that allows users to sync their project sites with RestorEco platform. This PR extracts sync-related logic into a dedicated component and improves the overall user experience with proper state management and error handling.

Refactoring

  • Extracted sync UI from ProjectSites: improving component readability and maintainability

  • Improved handleSyncSites logic:

    • Added guard to prevent multiple parallel sync requests
    • Added webhook URL validation before API calls
    • Better error logging for debugging
    • Properly closes modal after sync completion

    How It Works

  1. User clicks "Sync Sites to RestoreEco" button
  2. Confirmation modal appears
  3. On confirmation, webhook request is sent with project GUID
  4. Success feedback is shown via snackbar
  5. Modal closes automatically

- Extract sync UI logic into reusable SitesSyncActions component
- Prevent multiple parallel sync requests with flag-based guard
- Add webhook URL validation before making requests
- Improve sync error handling and user feedback
- Display success feedback via snackbar notification
- Add confirmation modal before initiating sync operation
@vercel
Copy link

vercel bot commented Nov 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
planet-webapp-multi-tenancy-setup Ready Ready Preview Nov 6, 2025 10:42am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/site-sync-to-restore-eco

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Collaborator

@mohitb35 mohitb35 left a comment

Choose a reason for hiding this comment

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

@sunilsabatp Please review my feedback.

- isSyncedWithRestoreEco to isSiteSyncSuccessful
- loading to syncing
Copy link
Collaborator

@mohitb35 mohitb35 left a comment

Choose a reason for hiding this comment

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

LGTM, but hold off on merging until we receive approval

@mohitb35 mohitb35 marked this pull request as draft November 6, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Should not be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants