Refactor Dropdown Handlers and Update WordPress Integration
- Updated dropdown onChange handlers across multiple components to use direct value passing instead of event target value for improved clarity and consistency. - Changed `url` to `site_url` in WordPress integration configuration for better semantic clarity. - Enhanced Vite configuration to include `fast-deep-equal` for compatibility with `react-dnd`. - Updated navigation paths in `SiteContentEditor` and `SiteList` for consistency with new routing structure.
This commit is contained in:
@@ -225,7 +225,10 @@ export default function SiteSettings() {
|
||||
<div className="flex gap-4">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setActiveTab('general')}
|
||||
onClick={() => {
|
||||
setActiveTab('general');
|
||||
navigate(`/sites/${siteId}/settings`, { replace: true });
|
||||
}}
|
||||
className={`px-4 py-2 font-medium border-b-2 transition-colors ${
|
||||
activeTab === 'general'
|
||||
? 'border-brand-500 text-brand-600 dark:text-brand-400'
|
||||
@@ -237,7 +240,10 @@ export default function SiteSettings() {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setActiveTab('seo')}
|
||||
onClick={() => {
|
||||
setActiveTab('seo');
|
||||
navigate(`/sites/${siteId}/settings?tab=seo`, { replace: true });
|
||||
}}
|
||||
className={`px-4 py-2 font-medium border-b-2 transition-colors ${
|
||||
activeTab === 'seo'
|
||||
? 'border-brand-500 text-brand-600 dark:text-brand-400'
|
||||
@@ -249,7 +255,10 @@ export default function SiteSettings() {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setActiveTab('og')}
|
||||
onClick={() => {
|
||||
setActiveTab('og');
|
||||
navigate(`/sites/${siteId}/settings?tab=og`, { replace: true });
|
||||
}}
|
||||
className={`px-4 py-2 font-medium border-b-2 transition-colors ${
|
||||
activeTab === 'og'
|
||||
? 'border-brand-500 text-brand-600 dark:text-brand-400'
|
||||
@@ -261,7 +270,10 @@ export default function SiteSettings() {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setActiveTab('schema')}
|
||||
onClick={() => {
|
||||
setActiveTab('schema');
|
||||
navigate(`/sites/${siteId}/settings?tab=schema`, { replace: true });
|
||||
}}
|
||||
className={`px-4 py-2 font-medium border-b-2 transition-colors ${
|
||||
activeTab === 'schema'
|
||||
? 'border-brand-500 text-brand-600 dark:text-brand-400'
|
||||
@@ -273,7 +285,10 @@ export default function SiteSettings() {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setActiveTab('integrations')}
|
||||
onClick={() => {
|
||||
setActiveTab('integrations');
|
||||
navigate(`/sites/${siteId}/settings?tab=integrations`, { replace: true });
|
||||
}}
|
||||
className={`px-4 py-2 font-medium border-b-2 transition-colors ${
|
||||
activeTab === 'integrations'
|
||||
? 'border-brand-500 text-brand-600 dark:text-brand-400'
|
||||
@@ -316,7 +331,7 @@ export default function SiteSettings() {
|
||||
<SelectDropdown
|
||||
options={SITE_TYPES}
|
||||
value={formData.site_type}
|
||||
onChange={(e) => setFormData({ ...formData, site_type: e.target.value })}
|
||||
onChange={(value) => setFormData({ ...formData, site_type: value })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -325,7 +340,7 @@ export default function SiteSettings() {
|
||||
<SelectDropdown
|
||||
options={HOSTING_TYPES}
|
||||
value={formData.hosting_type}
|
||||
onChange={(e) => setFormData({ ...formData, hosting_type: e.target.value })}
|
||||
onChange={(value) => setFormData({ ...formData, hosting_type: value })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -572,8 +587,8 @@ export default function SiteSettings() {
|
||||
initialData={
|
||||
wordPressIntegration
|
||||
? {
|
||||
url: wordPressIntegration.config_json?.url || '',
|
||||
username: wordPressIntegration.config_json?.username || '',
|
||||
url: wordPressIntegration.config_json?.site_url || '',
|
||||
username: wordPressIntegration.credentials_json?.username || '',
|
||||
app_password: '', // Never show password
|
||||
is_active: wordPressIntegration.is_active,
|
||||
sync_enabled: wordPressIntegration.sync_enabled,
|
||||
|
||||
Reference in New Issue
Block a user