From 77bd3eceadc923c688d78b4166301b3edff8307e Mon Sep 17 00:00:00 2001 From: taylanbakircioglu Date: Wed, 1 Apr 2026 12:45:31 +0300 Subject: [PATCH] fix: add missing REJECTED and DELETION values to config_status enum Root cause: config_status enum was created with only PENDING and APPLIED values. The REJECTED value was never added due to a silent duplicate_object exception in create_essential_tables(). This caused SSL certificate listing to crash with "invalid input value for enum config_status: REJECTED" on fresh installations. Also adds scrollable containers to Apply Management page to prevent Agent Sync Status card from being pushed off-screen. Closes #7 Made-with: Cursor --- backend/database/migrations.py | 4 + frontend/src/components/ApplyManagement.js | 182 +++++++++++---------- 2 files changed, 98 insertions(+), 88 deletions(-) diff --git a/backend/database/migrations.py b/backend/database/migrations.py index e6b372a..94958cb 100644 --- a/backend/database/migrations.py +++ b/backend/database/migrations.py @@ -45,6 +45,10 @@ async def ensure_agents_table(): await conn.execute("CREATE TYPE config_status AS ENUM ('PENDING', 'APPLIED');") logger.info("Successfully created config_status enum type.") + await conn.execute("ALTER TYPE config_status ADD VALUE IF NOT EXISTS 'REJECTED';") + await conn.execute("ALTER TYPE config_status ADD VALUE IF NOT EXISTS 'DELETION';") + logger.info("Ensured REJECTED and DELETION values exist in config_status enum.") + # First, create essential tables if they don't exist await create_essential_tables(conn) diff --git a/frontend/src/components/ApplyManagement.js b/frontend/src/components/ApplyManagement.js index 35256bd..1541e6e 100644 --- a/frontend/src/components/ApplyManagement.js +++ b/frontend/src/components/ApplyManagement.js @@ -1243,39 +1243,41 @@ const ApplyManagement = () => { {/* Pending Versions Section */} {pendingVersions.length > 0 && ( -
- + <div style={{ marginBottom: 24, background: '#fffbe6', borderRadius: 8, border: '1px solid #ffe58f', padding: '16px 16px 8px' }}> + <Title level={5} style={{ marginTop: 0 }}> <ClockCircleOutlined style={{ marginRight: 8, color: '#faad14' }} /> Pending Changes ({pendingVersions.length}) - - {pendingVersions.map((version, index) => ( - } - > -
-
{version.version_name}
-
- {new Date(version.created_at).toLocaleString()} +
+ + {pendingVersions.map((version, index) => ( + } + > +
+
{version.version_name}
+
+ {new Date(version.created_at).toLocaleString()} +
+
+ PENDING +
+
-
- PENDING -
- -
- - ))} - + + ))} + +
)} @@ -1298,31 +1300,33 @@ const ApplyManagement = () => { style={{ margin: '20px 0' }} /> ) : ( - - {appliedVersions.map((version, index) => ( - : undefined} - > -
-
{version.version_name}
-
- {new Date(version.created_at).toLocaleString()} +
+ + {appliedVersions.map((version, index) => ( + : undefined} + > +
+
{version.version_name}
+
+ {new Date(version.created_at).toLocaleString()} +
+
- -
- - ))} - + + ))} + +
)} @@ -1343,42 +1347,44 @@ const ApplyManagement = () => { style={{ margin: '20px 0' }} /> ) : ( - - {rejectedVersions.map((version, index) => ( - } - > -
-
{version.version_name}
-
- Rejected: {new Date(version.updated_at || version.created_at).toLocaleString()} +
+ + {rejectedVersions.map((version, index) => ( + } + > +
+
{version.version_name}
+
+ Rejected: {new Date(version.updated_at || version.created_at).toLocaleString()} +
+ + + +
- - - - -
- - ))} - + + ))} + +
)}