diff --git a/frontend/src/App.js b/frontend/src/App.js index 605f5be..c2425be 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -6,8 +6,6 @@ import UserMenu from './components/UserMenu'; import UserManagement from './components/UserManagement'; import AuditLog from './components/AuditLog'; import NvdSyncModal from './components/NvdSyncModal'; -import KnowledgeBaseModal from './components/KnowledgeBaseModal'; -import KnowledgeBaseViewer from './components/KnowledgeBaseViewer'; import NavDrawer from './components/NavDrawer'; import CalendarWidget from './components/CalendarWidget'; import VulnerabilityTriagePage from './components/pages/ReportingPage'; @@ -185,9 +183,6 @@ export default function App() { const [showUserManagement, setShowUserManagement] = useState(false); const [showAuditLog, setShowAuditLog] = useState(false); const [showNvdSync, setShowNvdSync] = useState(false); - const [showKnowledgeBase, setShowKnowledgeBase] = useState(false); - const [knowledgeBaseArticles, setKnowledgeBaseArticles] = useState([]); - const [selectedKBArticle, setSelectedKBArticle] = useState(null); const [newCVE, setNewCVE] = useState({ cve_id: '', vendor: '', @@ -311,19 +306,6 @@ export default function App() { } }; - const fetchKnowledgeBaseArticles = async () => { - try { - const response = await fetch(`${API_BASE}/knowledge-base`, { - credentials: 'include' - }); - if (!response.ok) throw new Error('Failed to fetch knowledge base articles'); - const data = await response.json(); - setKnowledgeBaseArticles(data); - } catch (err) { - console.error('Error fetching knowledge base articles:', err); - } - }; - const fetchJiraTickets = async () => { try { const response = await fetch(`${API_BASE}/jira-tickets`, { @@ -442,45 +424,6 @@ export default function App() { alert(`Exporting ${selectedDocuments.length} documents for report attachment`); }; - const handleViewKBArticle = async (articleId) => { - try { - const response = await fetch(`${API_BASE}/knowledge-base/${articleId}`, { - credentials: 'include' - }); - - if (!response.ok) throw new Error('Failed to fetch article'); - - const article = await response.json(); - setSelectedKBArticle(article); - } catch (err) { - console.error('Error fetching knowledge base article:', err); - setError('Failed to load article'); - } - }; - - const handleDownloadKBArticle = async (id, filename) => { - try { - const response = await fetch(`${API_BASE}/knowledge-base/${id}/download`, { - credentials: 'include' - }); - - if (!response.ok) throw new Error('Download failed'); - - const blob = await response.blob(); - const url = window.URL.createObjectURL(blob); - const a = document.createElement('a'); - a.href = url; - a.download = filename; - document.body.appendChild(a); - a.click(); - window.URL.revokeObjectURL(url); - document.body.removeChild(a); - } catch (err) { - console.error('Error downloading knowledge base article:', err); - setError('Failed to download document'); - } - }; - const handleAddCVE = async (e) => { e.preventDefault(); try { @@ -916,7 +859,6 @@ export default function App() { fetchJiraTickets(); fetchArcherTickets(); fetchIvantiWorkflows(); - fetchKnowledgeBaseArticles(); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [isAuthenticated]); @@ -1063,14 +1005,6 @@ export default function App() { setShowNvdSync(false)} onSyncComplete={() => fetchCVEs()} /> )} - {/* Knowledge Base Modal */} - {showKnowledgeBase && ( - setShowKnowledgeBase(false)} - onUpdate={fetchKnowledgeBaseArticles} - /> - )} - {/* Add CVE Modal */} {showAddCVE && (
@@ -1661,90 +1595,11 @@ export default function App() {
)} - {/* Three Column Layout - Home page only */} + {/* Two Column Layout - Home page only */} {currentPage === 'home' &&
- {/* LEFT PANEL - Wiki/Knowledge Base */} -
-
-
-

- Knowledge Base -

- {(user?.role === 'admin' || user?.role === 'editor') && ( - - )} -
- - {/* Knowledge Base Entries */} -
- {knowledgeBaseArticles.length === 0 ? ( -
- -

No documents yet

- {(user?.role === 'admin' || user?.role === 'editor') && ( - - )} -
- ) : ( - knowledgeBaseArticles.slice(0, 5).map((article) => ( -
handleViewKBArticle(article.id)} - style={{ background: 'linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(51, 65, 85, 0.75) 100%)', border: '1px solid rgba(16, 185, 129, 0.25)', borderRadius: '0.375rem', padding: '0.75rem', cursor: 'pointer', transition: 'all 0.2s' }} - className="hover:border-intel-success" - > -

{article.title}

- {article.description && ( -

{article.description}

- )} -
- - {new Date(article.created_at).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })} - - {article.category && article.category !== 'General' && ( - - {article.category} - - )} -
-
- )) - )} - {knowledgeBaseArticles.length > 5 && ( - - )} -
-
-
- {/* CENTER PANEL - Main Content */} -
- {/* Knowledge Base Viewer */} - {selectedKBArticle ? ( - setSelectedKBArticle(null)} - /> - ) : ( - <> +
+ <> {/* Quick Check */}
@@ -2216,7 +2071,6 @@ export default function App() {
)} - )}
{/* End Center Panel */}