v2.0.5 #141

Merged
PxlLoewe merged 5 commits from staging into release 2025-12-27 15:23:33 +00:00
PxlLoewe commented 2025-12-27 15:22:23 +00:00 (Migrated from github.com)

This pull request introduces significant improvements to the filtering and search capabilities of various admin tables in the application, standardizing the use of Prisma's type-safe filtering and enhancing the user experience with more flexible and powerful search options. Additionally, it includes some UI consistency tweaks and a few bug fixes.

Key changes:

Filtering and Search Improvements

API and Data Fetching Adjustments

UI and UX Enhancements

Permissions and Validation

Minor Fixes and Cleanups

  • Updated the AircraftMarker component to import and use the checkSimulatorConnected utility.
  • Changed filter prop to supressQuery where needed in appointment-related tables for clarity and correctness. [1] [2]

These changes collectively modernize the admin interface, making it more robust, user-friendly, and maintainable.

This pull request introduces significant improvements to the filtering and search capabilities of various admin tables in the application, standardizing the use of Prisma's type-safe filtering and enhancing the user experience with more flexible and powerful search options. Additionally, it includes some UI consistency tweaks and a few bug fixes. **Key changes:** ### Filtering and Search Improvements * Replaced static `filter` and `searchFields` props with dynamic `getFilter` functions using Prisma types across multiple admin tables (`PaginatedTable`), enabling more flexible, type-safe, and case-insensitive search and filtering. This affects components for changelog, heliport, keyword, station, user, event, participant, appointment, report, and connected aircraft. [[1]](diffhunk://#diff-87bc2db08338fc3f032310920a5ac7d7b7c73f2c92b2d975c9aeb50f6cb603aeL15-R23) [[2]](diffhunk://#diff-1766274fa5791d01949fd655df944d01e26c504cfee7539e4383cc22d5940ba7L6-R24) [[3]](diffhunk://#diff-0b6995cbe36c6a8edb96804188626c664dad70d55c9c896879b34eebdd98a0d7L15-R24) [[4]](diffhunk://#diff-f609120e54a11757744a2478242cb745bde3eec9ff1911e8dbaa7ca0495e126dL6-R21) [[5]](diffhunk://#diff-398a9da8c3f404ca513fcdf92e0908ed6ca9d1c87e8e8b5796d6ebdbcf7d7694L201-R211) [apps/hub/app/(app)/admin/user/[id]/_components/forms.tsxL269-R296](diffhunk://#diff-a772df66091e0b934c1b0aa99ddd4187bdd97a1f48c5fbbed962a0c252818f5aL269-R296), [apps/hub/app/(app)/admin/user/[id]/_components/forms.tsxL331-R367](diffhunk://#diff-a772df66091e0b934c1b0aa99ddd4187bdd97a1f48c5fbbed962a0c252818f5aL331-R367), [[6]](diffhunk://#diff-cdd6f8c786a029a71914f6104f42094acf7d24faeb42517a5eeceab65cd48fb5L15-R30) [[7]](diffhunk://#diff-9abe0785ce41faf3a16583753f3905292a4199df62af66e177e9604d28627dd7L162-R166) [[8]](diffhunk://#diff-9abe0785ce41faf3a16583753f3905292a4199df62af66e177e9604d28627dd7R255-R283) [[9]](diffhunk://#diff-9abe0785ce41faf3a16583753f3905292a4199df62af66e177e9604d28627dd7R355) [[10]](diffhunk://#diff-2a48f3535e02451c2e8d236e69133ae879a87a234a15fc1273795e0693f6f240L170-R174) [[11]](diffhunk://#diff-745389a4a27c7079dc7bbdfb7d2f8798bec3463720eb6603fb837ce68d49b9e8L152-R156) * Added the `showSearch` prop to relevant tables to enable the search UI where appropriate. [[1]](diffhunk://#diff-87bc2db08338fc3f032310920a5ac7d7b7c73f2c92b2d975c9aeb50f6cb603aeL15-R23) [[2]](diffhunk://#diff-1766274fa5791d01949fd655df944d01e26c504cfee7539e4383cc22d5940ba7L6-R24) [[3]](diffhunk://#diff-0b6995cbe36c6a8edb96804188626c664dad70d55c9c896879b34eebdd98a0d7L15-R24) [[4]](diffhunk://#diff-f609120e54a11757744a2478242cb745bde3eec9ff1911e8dbaa7ca0495e126dL6-R21) [[5]](diffhunk://#diff-398a9da8c3f404ca513fcdf92e0908ed6ca9d1c87e8e8b5796d6ebdbcf7d7694L201-R211) [[6]](diffhunk://#diff-9abe0785ce41faf3a16583753f3905292a4199df62af66e177e9604d28627dd7R255-R283) ### API and Data Fetching Adjustments * Refactored the aircraft fetching logic in `AircraftLayer` to use a direct API call with filtering for connected simulators, replacing the previous `useQuery` approach. * Updated imports to include Prisma types where needed for new filtering logic. [[1]](diffhunk://#diff-87bc2db08338fc3f032310920a5ac7d7b7c73f2c92b2d975c9aeb50f6cb603aeL6-R6) [[2]](diffhunk://#diff-1766274fa5791d01949fd655df944d01e26c504cfee7539e4383cc22d5940ba7L6-R24) [[3]](diffhunk://#diff-0b6995cbe36c6a8edb96804188626c664dad70d55c9c896879b34eebdd98a0d7L6-R6) [[4]](diffhunk://#diff-f609120e54a11757744a2478242cb745bde3eec9ff1911e8dbaa7ca0495e126dL6-R21) [[5]](diffhunk://#diff-398a9da8c3f404ca513fcdf92e0908ed6ca9d1c87e8e8b5796d6ebdbcf7d7694L5-R5) [apps/hub/app/(app)/admin/user/[id]/_components/forms.tsxR11](diffhunk://#diff-a772df66091e0b934c1b0aa99ddd4187bdd97a1f48c5fbbed962a0c252818f5aR11), [[6]](diffhunk://#diff-cdd6f8c786a029a71914f6104f42094acf7d24faeb42517a5eeceab65cd48fb5L2-R2) [[7]](diffhunk://#diff-9abe0785ce41faf3a16583753f3905292a4199df62af66e177e9604d28627dd7L3-R3) [[8]](diffhunk://#diff-2a48f3535e02451c2e8d236e69133ae879a87a234a15fc1273795e0693f6f240L1-R1) [[9]](diffhunk://#diff-745389a4a27c7079dc7bbdfb7d2f8798bec3463720eb6603fb837ce68d49b9e8L5-R5) ### UI and UX Enhancements * Standardized icon sizes and className order for consistency across admin pages and tables. [[1]](diffhunk://#diff-cdd6f8c786a029a71914f6104f42094acf7d24faeb42517a5eeceab65cd48fb5L15-R30) [[2]](diffhunk://#diff-0b6995cbe36c6a8edb96804188626c664dad70d55c9c896879b34eebdd98a0d7L44-R57) [[3]](diffhunk://#diff-f609120e54a11757744a2478242cb745bde3eec9ff1911e8dbaa7ca0495e126dL47-R59) * Improved table ordering by adding `initialOrderBy` to connection history tables for users, sorting by `loginTime` descending. ([apps/hub/app/(app)/admin/user/[id]/_components/forms.tsxL269-R296](diffhunk://#diff-a772df66091e0b934c1b0aa99ddd4187bdd97a1f48c5fbbed962a0c252818f5aL269-R296), [apps/hub/app/(app)/admin/user/[id]/_components/forms.tsxL331-R367](diffhunk://#diff-a772df66091e0b934c1b0aa99ddd4187bdd97a1f48c5fbbed962a0c252818f5aL331-R367)) ### Permissions and Validation * Added logic to prevent users from changing their own permissions or assigning/removing permissions they do not possess, improving security in the user admin form. ([apps/hub/app/(app)/admin/user/[id]/_components/forms.tsxR80-R94](diffhunk://#diff-a772df66091e0b934c1b0aa99ddd4187bdd97a1f48c5fbbed962a0c252818f5aR80-R94)) ### Minor Fixes and Cleanups * Updated the `AircraftMarker` component to import and use the `checkSimulatorConnected` utility. * Changed `filter` prop to `supressQuery` where needed in appointment-related tables for clarity and correctness. [[1]](diffhunk://#diff-2a48f3535e02451c2e8d236e69133ae879a87a234a15fc1273795e0693f6f240L67-R67) [[2]](diffhunk://#diff-9abe0785ce41faf3a16583753f3905292a4199df62af66e177e9604d28627dd7R255-R283) --- These changes collectively modernize the admin interface, making it more robust, user-friendly, and maintainable.
Sign in to join this conversation.