sd
This commit is contained in:
@@ -148,8 +148,8 @@ class SiteAdmin(AccountAdminMixin, admin.ModelAdmin):
|
||||
|
||||
def get_api_key_status(self, obj):
|
||||
"""Show API key status in list view"""
|
||||
from django.utils.html import format_html
|
||||
if obj.wp_api_key:
|
||||
from django.utils.html import format_html
|
||||
return format_html('<span style="color:green;">●</span> Active')
|
||||
return format_html('<span style="color:gray;">○</span> None')
|
||||
get_api_key_status.short_description = 'API Key'
|
||||
|
||||
@@ -202,19 +202,9 @@ export default function SiteSettings() {
|
||||
const response = await fetchIndustries();
|
||||
let allIndustries = response.industries || [];
|
||||
|
||||
// Filter to show only user's pre-selected industries/sectors from account preferences
|
||||
try {
|
||||
const { fetchAccountSetting } = await import('../../services/api');
|
||||
const setting = await fetchAccountSetting('user_preferences');
|
||||
const preferences = setting.config as { selectedIndustry?: string; selectedSectors?: string[] } | undefined;
|
||||
|
||||
if (preferences?.selectedIndustry) {
|
||||
// Filter industries to only show the user's pre-selected industry
|
||||
allIndustries = allIndustries.filter(i => i.slug === preferences.selectedIndustry);
|
||||
}
|
||||
} catch (error: any) {
|
||||
// Silently handle errors - show all industries
|
||||
}
|
||||
// Note: For existing sites with industries already configured,
|
||||
// we show ALL industries so users can change their selection.
|
||||
// The filtering by user preferences only applies during initial site creation.
|
||||
|
||||
setIndustries(allIndustries);
|
||||
} catch (error: any) {
|
||||
@@ -262,14 +252,11 @@ export default function SiteSettings() {
|
||||
const getIndustrySectors = () => {
|
||||
if (!selectedIndustry) return [];
|
||||
const industry = industries.find(i => i.slug === selectedIndustry);
|
||||
let sectors = industry?.sectors || [];
|
||||
|
||||
// Filter to show only user's pre-selected sectors from account preferences
|
||||
if (userPreferences?.selectedSectors && userPreferences.selectedSectors.length > 0) {
|
||||
sectors = sectors.filter(s => userPreferences.selectedSectors!.includes(s.slug));
|
||||
}
|
||||
|
||||
return sectors;
|
||||
// Note: For existing sites in Settings page, show ALL sectors from the selected industry
|
||||
// so users can change their sector selection. The filtering by user preferences
|
||||
// only applies during initial site creation (in the Sites wizard).
|
||||
return industry?.sectors || [];
|
||||
};
|
||||
|
||||
const handleSelectSectors = async () => {
|
||||
|
||||
@@ -86,7 +86,8 @@ class Igny8RestAPI {
|
||||
));
|
||||
|
||||
// Manual publish endpoint - for triggering WordPress publish from IGNY8
|
||||
register_rest_route('igny8/v1', '/publish-content/', array(
|
||||
// Route: /wp-json/igny8/v1/publish
|
||||
register_rest_route('igny8/v1', '/publish', array(
|
||||
'methods' => 'POST',
|
||||
'callback' => array($this, 'publish_content_to_wordpress'),
|
||||
'permission_callback' => array($this, 'check_permission'),
|
||||
|
||||
Reference in New Issue
Block a user