- Updated the `IntegrationService` to perform connection tests using only the API key, removing reliance on username and app password. - Simplified health check logic and improved error messaging for better clarity. - Added functionality to revoke API keys in the `WordPressIntegrationForm` component. - Enhanced site settings page with a site selector and improved integration status display. - Cleaned up unused code and improved overall structure for better maintainability.
2.7 KiB
2.7 KiB
Site Settings Page - New Features Added
Date: 2025-11-22
Feature 1: Site URL Field in General Tab
Added a new "Site URL" field in the General settings tab to allow users to specify their site's URL.
Changes Made:
- Added
site_urlto formData state - Added field in
loadSite()to populate fromdata.domainordata.url - Added input field in General tab UI after the Slug field
Location in UI:
- Tab: General
- Position: After "Slug" field, before "Site Type"
- Placeholder:
https://example.com
Feature 2: Site Selector at Top Right
Added a site selector dropdown in the page header that allows users to quickly switch between sites.
Behavior:
- Only shows if user has MORE THAN 1 site
- Located at top right, same row as page title
- Shows current site name with grid icon
- Dropdown lists all user's sites
- Clicking a site navigates to that site's settings page
- Preserves current tab when switching sites
Implementation Details:
- Added new imports:
fetchSites,Site,ChevronDownIcon,Dropdown,DropdownItem - Added state for sites list and dropdown
- Added
loadSites()function to fetch all user sites - Added
handleSiteSelect()to navigate to selected site - Modified header layout from
flex items-center gap-4toflex items-center justify-between gap-4 - Added site selector component with conditional rendering
Visual Design:
- Matches homepage site selector styling
- Shows checkmark for currently selected site
- Responsive hover states
- Dark mode support
- Smooth animations (chevron rotation)
Files Modified
File: /data/app/igny8/frontend/src/pages/Sites/Settings.tsx
Changes:
- ✅ Added imports for site selector components
- ✅ Added site selector state variables
- ✅ Added
site_urlto formData - ✅ Added loadSites() and handleSiteSelect() functions
- ✅ Added Site URL input field in General tab
- ✅ Added site selector component in header
- ✅ Modified header layout for proper spacing
Testing
Tested on: https://app.igny8.com/sites/15/settings?tab=general
✅ Site URL field displays correctly ✅ Site selector appears in top right (when user has > 1 site) ✅ Can enter site URL ✅ Can switch between sites using selector ✅ Tab preservation works when switching sites ✅ No linting errors
Notes
- Site selector only appears if user has more than 1 site (as requested)
- Site URL field is optional (no validation added yet)
- Site URL data is saved to backend when user clicks "Save Changes"
- The site selector maintains the same tab when switching (e.g., if on "SEO Meta Tags" tab, switching sites will load that site's "SEO Meta Tags" tab)