Files
igny8/SITE_SETTINGS_NEW_FEATURES.md
IGNY8 VPS (Salman) 029c66a0f1 Refactor WordPress integration service to use API key for connection testing
- 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.
2025-11-22 09:31:07 +00:00

85 lines
2.7 KiB
Markdown

# 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:**
1. Added `site_url` to formData state
2. Added field in `loadSite()` to populate from `data.domain` or `data.url`
3. 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:**
1. Added new imports: `fetchSites`, `Site`, `ChevronDownIcon`, `Dropdown`, `DropdownItem`
2. Added state for sites list and dropdown
3. Added `loadSites()` function to fetch all user sites
4. Added `handleSiteSelect()` to navigate to selected site
5. Modified header layout from `flex items-center gap-4` to `flex items-center justify-between gap-4`
6. 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:
1. ✅ Added imports for site selector components
2. ✅ Added site selector state variables
3. ✅ Added `site_url` to formData
4. ✅ Added loadSites() and handleSiteSelect() functions
5. ✅ Added Site URL input field in General tab
6. ✅ Added site selector component in header
7. ✅ 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)