From 2ad6b4fa4ea3c257af0b9cd05804f7e7e9f613e0 Mon Sep 17 00:00:00 2001 From: fadingNA Date: Fri, 15 Nov 2024 23:16:58 -0500 Subject: [PATCH 01/10] update table styling --- .../src/components/DocumentPagination.tsx | 2 +- frontend/src/index.css | 12 +- frontend/src/settings/Documents.tsx | 224 ++++++++++-------- 3 files changed, 128 insertions(+), 110 deletions(-) diff --git a/frontend/src/components/DocumentPagination.tsx b/frontend/src/components/DocumentPagination.tsx index b0532362b..4000f83d9 100644 --- a/frontend/src/components/DocumentPagination.tsx +++ b/frontend/src/components/DocumentPagination.tsx @@ -42,7 +42,7 @@ const Pagination: React.FC = ({ }; return ( -
+
Rows per page: onRowsPerPageChange(Number(e.target.value))} - className="border border-gray-300 rounded px-2 py-1 dark:bg-dark-charcoal dark:text-gray-50" - > - {rowsPerPageOptions.map((option) => ( - - ))} - +
+ +
+ {rowsPerPageOptions.map((option) => ( +
handleSelectRowsPerPage(option)} + className={`cursor-pointer px-4 py-2 text-xs hover:bg-gray-100 dark:hover:bg-neutral-700 ${ + rowsPerPage === option + ? 'bg-gray-100 dark:bg-neutral-700 dark:text-light-gray' + : 'bg-white dark:bg-dark-charcoal dark:text-light-gray' + }`} + > + {option} +
+ ))} +
+
+ {/* Pagination controls */}
Page {currentPage} of {totalPages}
-
@@ -85,7 +108,7 @@ const Pagination: React.FC = ({ > arrow @@ -96,7 +119,7 @@ const Pagination: React.FC = ({ > arrow @@ -107,7 +130,7 @@ const Pagination: React.FC = ({ > arrow diff --git a/frontend/src/components/DropdownMenu.tsx b/frontend/src/components/DropdownMenu.tsx index 787d3b847..2e6c922c4 100644 --- a/frontend/src/components/DropdownMenu.tsx +++ b/frontend/src/components/DropdownMenu.tsx @@ -48,7 +48,7 @@ export default function DropdownMenu({
+ {/* outside scrollable area */} + { + setCurrentPage(page); + refreshDocs(undefined, page, rowsPerPage); + }} + onRowsPerPageChange={(rows) => { + setRowsPerPage(rows); + setCurrentPage(1); + refreshDocs(undefined, 1, rows); + }} + /> + {/* Conditionally render the Upload modal based on modalState */} {modalState === 'ACTIVE' && (
From e5bd194b6c7a29bd62e89f00e4a485de45d0f5a6 Mon Sep 17 00:00:00 2001 From: fadingNA Date: Sat, 23 Nov 2024 20:04:53 -0500 Subject: [PATCH 06/10] Remove dangling console log --- frontend/src/settings/Documents.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/settings/Documents.tsx b/frontend/src/settings/Documents.tsx index 074d5516e..7efd9016c 100644 --- a/frontend/src/settings/Documents.tsx +++ b/frontend/src/settings/Documents.tsx @@ -134,7 +134,7 @@ const Documents: React.FC = ({ }; useEffect(() => { - console.log('modalState', modalState); + // console.log('modalState', modalState); if (modalState === 'INACTIVE') { refreshDocs(sortField, currentPage, rowsPerPage); } From 2709994ede7d644afb1973b2d1b0734552bba735 Mon Sep 17 00:00:00 2001 From: fadingNA Date: Sun, 24 Nov 2024 11:18:42 -0500 Subject: [PATCH 07/10] update APIKey Table and dark styling --- frontend/src/settings/APIKeys.tsx | 85 +++++++++++++++++------------ frontend/src/settings/Documents.tsx | 7 ++- 2 files changed, 55 insertions(+), 37 deletions(-) diff --git a/frontend/src/settings/APIKeys.tsx b/frontend/src/settings/APIKeys.tsx index b039477c3..6775ba87e 100644 --- a/frontend/src/settings/APIKeys.tsx +++ b/frontend/src/settings/APIKeys.tsx @@ -109,41 +109,56 @@ export default function APIKeys() { {loading ? ( ) : ( - - - - - - - - - - - {!apiKeys?.length && ( - - - - )} - {apiKeys?.map((element, index) => ( - - - - - - - ))} - -
{t('settings.apiKeys.name')}{t('settings.apiKeys.sourceDoc')}{t('settings.apiKeys.key')}
- {t('settings.apiKeys.noData')} -
{element.name}{element.source}{element.key} - Delete handleDeleteKey(element.id)} - /> -
+
+
+
+ + + + + + + + + + + {!apiKeys?.length && ( + + + + )} + {Array.isArray(apiKeys) && + apiKeys?.map((element, index) => ( + + + + + + + ))} + +
{t('settings.apiKeys.name')} + {t('settings.apiKeys.sourceDoc')} + {t('settings.apiKeys.key')}
+ {t('settings.apiKeys.noData')} +
{element.name}{element.source}{element.key} + Delete handleDeleteKey(element.id)} + /> +
+
+
+
)}
diff --git a/frontend/src/settings/Documents.tsx b/frontend/src/settings/Documents.tsx index 7efd9016c..4003f6552 100644 --- a/frontend/src/settings/Documents.tsx +++ b/frontend/src/settings/Documents.tsx @@ -183,7 +183,7 @@ const Documents: React.FC = ({ ) : (
-
+
@@ -228,7 +228,10 @@ const Documents: React.FC = ({ {!currentDocuments?.length && ( - From b5e5fb7f10337ea2c774a9b6a5f32e3c7cb080b1 Mon Sep 17 00:00:00 2001 From: fadingNA Date: Sun, 24 Nov 2024 17:02:57 -0500 Subject: [PATCH 08/10] fix table header text wrap --- frontend/src/settings/Documents.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/settings/Documents.tsx b/frontend/src/settings/Documents.tsx index 4003f6552..0fd82aa8b 100644 --- a/frontend/src/settings/Documents.tsx +++ b/frontend/src/settings/Documents.tsx @@ -186,7 +186,7 @@ const Documents: React.FC = ({
+ {t('settings.documents.noData')}
- + @@ -201,7 +201,7 @@ const Documents: React.FC = ({ /> - From d89bd0941d7cda6dc0287955ab9cf1829efb2916 Mon Sep 17 00:00:00 2001 From: fadingNA Date: Mon, 25 Nov 2024 08:35:24 -0500 Subject: [PATCH 10/10] change visible to block --- frontend/src/components/DocumentPagination.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/DocumentPagination.tsx b/frontend/src/components/DocumentPagination.tsx index af849ed4d..f02ef1c05 100644 --- a/frontend/src/components/DocumentPagination.tsx +++ b/frontend/src/components/DocumentPagination.tsx @@ -62,17 +62,17 @@ const Pagination: React.FC = ({ {rowsPerPage}
{rowsPerPageOptions.map((option) => (
handleSelectRowsPerPage(option)} - className={`cursor-pointer px-4 py-2 text-xs hover:bg-gray-100 dark:hover:bg-neutral-700 ${ + className={`cursor-pointer px-4 py-2 text-xs hover:bg-gray-100 dark:hover:bg-neutral-700 ${ rowsPerPage === option ? 'bg-gray-100 dark:bg-neutral-700 dark:text-light-gray' : 'bg-white dark:bg-dark-charcoal dark:text-light-gray'
{t('settings.documents.name')} +
{t('settings.documents.tokenUsage')} Date: Sun, 24 Nov 2024 17:05:36 -0500 Subject: [PATCH 09/10] add text center when no data --- frontend/src/settings/Documents.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/settings/Documents.tsx b/frontend/src/settings/Documents.tsx index 0fd82aa8b..0987b5d70 100644 --- a/frontend/src/settings/Documents.tsx +++ b/frontend/src/settings/Documents.tsx @@ -230,7 +230,7 @@ const Documents: React.FC = ({
{t('settings.documents.noData')}