From b61e48f4fca67085480993453aa42afa827cdfd5 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 11 Sep 2025 13:42:07 -0600 Subject: [PATCH] Updates to user management --- map/Instuctions.md | 1 + map/app/controllers/cutsController.js | 4 +- map/app/public/admin.html | 44 ++- map/app/public/css/admin/cuts-shifts.css | 14 + map/app/public/css/admin/responsive.css | 324 +++++++++------ map/app/public/css/admin/user-management.css | 272 +++++++++++-- map/app/public/js/admin-core.js | 14 +- map/app/public/js/admin-users.js | 393 ++++++++++++++----- 8 files changed, 810 insertions(+), 256 deletions(-) diff --git a/map/Instuctions.md b/map/Instuctions.md index 36dd0e0..c8666a2 100644 --- a/map/Instuctions.md +++ b/map/Instuctions.md @@ -36,6 +36,7 @@ Welcome to the Map project! This application is a canvassing tool for political - **Error handling.** Always provide user feedback for errors (both backend and frontend). - **Environment variables.** Use `.env` for secrets/config, never hardcode sensitive data. - **Testing.** Test new features locally and ensure they do not break existing functionality. +- **Pagination** Use pagination for API endpoints returning large datasets to avoid performance issues. For example, getAll should be getAllPaginated ## How to Add a Feature diff --git a/map/app/controllers/cutsController.js b/map/app/controllers/cutsController.js index 64f434a..117d548 100644 --- a/map/app/controllers/cutsController.js +++ b/map/app/controllers/cutsController.js @@ -313,8 +313,8 @@ class CutsController { logger.info(`Fetching public cuts from table ID: ${config.nocodb.cutsSheetId}`); - // Use the same pattern as getAll method that's known to work - const response = await nocodbService.getAll( + // Use getAllPaginated to get ALL cuts, not just first page + const response = await nocodbService.getAllPaginated( config.nocodb.cutsSheetId ); diff --git a/map/app/public/admin.html b/map/app/public/admin.html index 89cf465..d636959 100644 --- a/map/app/public/admin.html +++ b/map/app/public/admin.html @@ -625,18 +625,42 @@ - -
-
-

All Users

- -
- -

Loading users...

+ +
+
+

All Users

+
+
+ +
+ +
+ +
+
+ + +
+ +
+ + +
+