seed keywords
This commit is contained in:
@@ -356,11 +356,13 @@ export default function App() {
|
||||
} />
|
||||
|
||||
{/* Setup Pages */}
|
||||
<Route path="/setup/industries-sectors-keywords" element={
|
||||
<Route path="/setup/add-keywords" element={
|
||||
<Suspense fallback={null}>
|
||||
<IndustriesSectorsKeywords />
|
||||
</Suspense>
|
||||
} />
|
||||
{/* Legacy redirect */}
|
||||
<Route path="/setup/industries-sectors-keywords" element={<Navigate to="/setup/add-keywords" replace />} />
|
||||
|
||||
{/* Automation Module - Redirect dashboard to rules */}
|
||||
<Route path="/automation" element={<Navigate to="/automation/rules" replace />} />
|
||||
|
||||
@@ -159,6 +159,11 @@ export function useImportExport(
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400 mt-2">
|
||||
Upload a CSV file (max {maxFileSize / 1024 / 1024}MB)
|
||||
</p>
|
||||
{filename === 'keywords' && (
|
||||
<p className="text-xs text-gray-600 dark:text-gray-300 mt-2 p-2 bg-blue-50 dark:bg-blue-900/20 rounded border border-blue-200 dark:border-blue-800">
|
||||
<strong>Expected columns:</strong> keyword, volume, difficulty, intent, status
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end gap-4 pt-4">
|
||||
|
||||
@@ -85,8 +85,8 @@ const AppSidebar: React.FC = () => {
|
||||
const setupItems: NavItem[] = [
|
||||
{
|
||||
icon: <DocsIcon />,
|
||||
name: "Industry, Sectors & Keywords",
|
||||
path: "/setup/industries-sectors-keywords", // Merged page
|
||||
name: "Add Keywords",
|
||||
path: "/setup/add-keywords",
|
||||
},
|
||||
{
|
||||
icon: <GridIcon />,
|
||||
|
||||
@@ -260,11 +260,32 @@ export default function MasterStatus() {
|
||||
setLoading(false);
|
||||
}, [fetchSystemMetrics, fetchApiHealth, checkWorkflowHealth, checkIntegrationHealth]);
|
||||
|
||||
// Initial load and auto-refresh
|
||||
// Initial load and auto-refresh (pause when page not visible)
|
||||
useEffect(() => {
|
||||
let interval: NodeJS.Timeout;
|
||||
|
||||
const handleVisibilityChange = () => {
|
||||
if (document.hidden) {
|
||||
// Page not visible - clear interval
|
||||
if (interval) clearInterval(interval);
|
||||
} else {
|
||||
// Page visible - refresh and restart interval
|
||||
refreshAll();
|
||||
interval = setInterval(refreshAll, 30000);
|
||||
}
|
||||
};
|
||||
|
||||
// Initial setup
|
||||
refreshAll();
|
||||
const interval = setInterval(refreshAll, 30000); // 30 seconds
|
||||
return () => clearInterval(interval);
|
||||
interval = setInterval(refreshAll, 30000);
|
||||
|
||||
// Listen for visibility changes
|
||||
document.addEventListener('visibilitychange', handleVisibilityChange);
|
||||
|
||||
return () => {
|
||||
clearInterval(interval);
|
||||
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
||||
};
|
||||
}, [refreshAll]);
|
||||
|
||||
// Status badge component
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -133,6 +133,15 @@ interface TablePageTemplateProps {
|
||||
onRowAction?: (actionKey: string, row: any) => Promise<void>;
|
||||
getItemDisplayName?: (row: any) => string; // Function to get display name from row (e.g., row.keyword or row.name)
|
||||
className?: string;
|
||||
// Custom actions to display in action buttons area (near column selector)
|
||||
customActions?: ReactNode;
|
||||
// Custom bulk actions configuration (overrides table-actions.config.ts)
|
||||
bulkActions?: Array<{
|
||||
key: string;
|
||||
label: string;
|
||||
icon?: ReactNode;
|
||||
variant?: 'primary' | 'success' | 'danger';
|
||||
}>;
|
||||
}
|
||||
|
||||
export default function TablePageTemplate({
|
||||
@@ -167,6 +176,8 @@ export default function TablePageTemplate({
|
||||
onExport,
|
||||
getItemDisplayName = (row: any) => row.name || row.keyword || row.title || String(row.id),
|
||||
className = '',
|
||||
customActions,
|
||||
bulkActions: customBulkActions,
|
||||
}: TablePageTemplateProps) {
|
||||
const location = useLocation();
|
||||
const [isBulkActionsDropdownOpen, setIsBulkActionsDropdownOpen] = useState(false);
|
||||
@@ -181,7 +192,8 @@ export default function TablePageTemplate({
|
||||
|
||||
// Get actions from config (edit/delete always included)
|
||||
const rowActions = tableActionsConfig?.rowActions || [];
|
||||
const bulkActions = tableActionsConfig?.bulkActions || [];
|
||||
// Use custom bulk actions if provided, otherwise use config
|
||||
const bulkActions = customBulkActions || tableActionsConfig?.bulkActions || [];
|
||||
|
||||
// Selection and expanded rows state
|
||||
const [selectedIds, setSelectedIds] = useState<string[]>(selection?.selectedIds || []);
|
||||
@@ -737,6 +749,9 @@ export default function TablePageTemplate({
|
||||
|
||||
{/* Action Buttons - Right aligned */}
|
||||
<div className="flex gap-2 items-center">
|
||||
{/* Custom Actions */}
|
||||
{customActions}
|
||||
|
||||
{/* Column Selector */}
|
||||
<ColumnSelector
|
||||
columns={columns.map(col => ({
|
||||
|
||||
Reference in New Issue
Block a user