Commit Graph

156 Commits

Author SHA1 Message Date
Teriuihi 48fd133b6d Fix pageChange emission to use history length
Modified the `ngOnChanges` method to emit the length of the history instead of the current page. This ensures accurate data is provided to parent components during changes.
2025-04-12 23:01:35 +02:00
Teriuihi 21b87fbf68 Add appeal endpoints and schema definitions
Introduce new API endpoints for handling Minecraft and Discord appeals, as well as updating appeal email addresses. Define detailed schemas for request and response payloads, supporting streamlined appeal processing across all platforms.
2025-04-12 22:51:16 +02:00
Teriuihi 3a2a54050f Add custom avatar for console entries in ban history
Updated the `getAvatarUrl` method to return a specific avatar image for console entries. This ensures better visual distinction for console-generated actions in the ban history.
2025-04-12 22:20:45 +02:00
Teriuihi a5adb031bd Add pagination handling with pageSize and pageChange EventEmitter
Introduced `pageSize` in `bans.component.ts` to manage pagination logic and updated `buttonActive` to account for page size constraints. Added `pageChange` EventEmitter in `history.component.ts` to notify the parent component of page changes. Updated the template to bind `pageChange` for dynamic page size updates.
2025-04-12 22:11:40 +02:00
Teriuihi d535dd1ba9 Reset page number on search and filter changes
Ensure the page is reset to 0 when performing a search or changing filters. This prevents issues with incorrect page states and improves navigation consistency.
2025-04-12 21:55:51 +02:00
Peter 13122559db Refactor table and pagination UI components.
Replaced inline styles with reusable classes for better maintainability. Improved pagination button styling and added transitions to the history table header for a polished user experience. Updated SCSS variables for consistent naming conventions.
2025-04-12 21:55:25 +02:00
Peter a4d8fc07e9 Updated styles and structure for history table and navigation
Refactored the history buttons to include click handlers in the outer div for better clarity and functionality. Improved the table styling in the history component by adding consistent padding, fixing column widths, and ensuring text overflow handling. Added new CSS variables for table header colors to enhance theming consistency.
2025-04-12 19:42:06 +02:00
Teriuihi 3ed5fcfc0f Add pagination controls with proper state handling in BansComponent
Introduced "First", "Previous", "Next", and "Last page" buttons with state-dependent activations for improved navigation. Refactored pagination logic to utilize a constant PAGE_SIZE and adjusted calculations for max page determination. Ensured page transitions and state updates are accurate and consistent.
2025-04-12 17:41:44 +02:00
Peter 81807b107c Enhance user and punisher avatar display in history table
Refactored the layout for player and punisher avatars by adding a container around usernames and aligning elements vertically. Updated the `getAvatarUrl` method to accept only UUID strings, streamlining its usage. Improved styling for better alignment and presentation.
2025-04-12 17:41:29 +02:00
Peter 5e75c82994 Fix inconsistency in image width and height attributes
Updated the width and height attributes of the avatar image in the history component to use consistent integer values (25) instead of "25px". This ensures proper rendering and prevents potential styling issues.
2025-04-12 17:21:50 +02:00
Peter 2383c291c8 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	frontend/src/app/bans/history/history.component.html
2025-04-12 17:21:10 +02:00
Teriuihi a70159e88d Refactor avatar URL generation into reusable method
Centralized avatar URL generation with `getAvatarUrl()` method to reduce redundancy and improve code maintainability. Updated relevant components to utilize the new method for cleaner and more consistent implementation.
2025-04-12 17:20:47 +02:00
Peter fd1115086a Update header styling and improve avatar image attributes
Adjusted the header height and title text for clarity and consistency in the bans page. Also streamlined avatar image attributes by removing unnecessary units for better HTML standards compliance.
2025-04-12 17:16:10 +02:00
Peter 6a70428c75 Updated styling and components for punishment history 2025-04-12 17:05:08 +02:00
Teriuihi 1264003a44 Adjust scroll activation threshold and reset inverseYPos.
Increased the scroll threshold for activating the header to 5 for better usability. Added a reset for `inverseYPos` to 0 when the scroll position is at the top, ensuring consistent behavior.
2025-04-12 16:51:08 +02:00
Teriuihi a1b42060b0 Revise scroll position calculation in header component
Updated the formula for calculating `inverseYPos` to use a 20% reduction approach instead of dividing by 4 and inverting. This ensures a smoother and more proportional adjustment during scrolling.
2025-04-12 16:47:17 +02:00
Teriuihi 3499f331a0 Add required fields to HistoryCount object in schema
Updated the schema to include `bans`, `mutes`, `warnings`, and `kicks` as required properties in the `HistoryCount` object. This ensures proper validation and consistency across the API.
2025-04-12 01:49:57 +02:00
Teriuihi 2b27fb6955 Add dynamic pagination and state management for history
Introduced dynamic pagination based on punishment types and counts, retrieved via a new API call. Refactored state management with a centralized `pushState` method and updated button logic in the template to reflect the changes. This improves navigation consistency and user experience.
2025-04-12 01:45:59 +02:00
Teriuihi 66d641b825 Add search state persistence and pagination for bans history
Enhanced the bans component to retain search state using the History API. Updated the history component to support paginated and filtered data loading based on user input and search terms.
2025-04-12 01:35:40 +02:00
Teriuihi 0a2338e42e Adjust widths in history component styling
Reduced the width of `.historyReason` and increased the width of `.historyDate` to improve layout alignment. These changes ensure better visual balance and accommodate content more effectively.
2025-04-12 01:02:14 +02:00
Teriuihi aa2797c51c Merge remote-tracking branch 'origin/master'
# Conflicts:
#	frontend/src/app/bans/bans.component.html
2025-04-12 00:55:53 +02:00
Teriuihi c83f95a3de Enable user search and filtering in the bans component
Added support for searching and filtering user names using `HistoryService`. Implemented a dropdown for search suggestions with dynamic filtering and selection. Updated UI and styles to accommodate the new input functionality.
2025-04-12 00:54:58 +02:00
Peter df9c3ac996 Punishment page styling 2025-04-12 00:53:20 +02:00
Teriuihi 02c69b318a Sort history query results by time in descending order.
Added `ORDER BY time DESC` to ensure that history query results are consistently returned with the most recent entries first. This update improves data clarity and usability for end-users.
2025-04-11 23:44:22 +02:00
Peter 4b5a49b82a Alignment fix 2025-04-11 23:40:45 +02:00
Peter 6526bad733 Merge remote-tracking branch 'origin/master' 2025-04-11 23:36:14 +02:00
Peter 9076f6d150 Styling and date changes on punishment page
Some styling changes for the punishments page. Also changes how the dates are displayed - they should display differently depending on what region you're in.
2025-04-11 23:35:57 +02:00
Teriuihi 44d28494e5 Add API endpoint to retrieve total punishment counts
Introduced a new API endpoint `/history/total` for fetching the total counts of bans, mutes, kicks, and warnings. Added database mapping and DTO classes to support this functionality, along with necessary schema and controller updates.
2025-04-11 23:27:20 +02:00
Peter 807569a0a1 More ban pages changes 2025-04-11 22:24:25 +02:00
Teriuihi e7fde81f49 Change page size from 100 to 10 2025-04-11 21:57:10 +02:00
Peter ce9260ede6 Added table headings and darkmode fix 2025-04-11 21:56:46 +02:00
Teriuihi 23367b6dea Fix history not loading 2025-04-11 21:37:21 +02:00
Peter 97e5d202bb Renamed and added Bans nav links 2025-04-11 21:25:18 +02:00
Teriuihi 2289b14b5a Add history page 2025-04-11 21:20:02 +02:00
Teriuihi 4b891dd672 Reworked database setup and added pagination
The database tables are now automatically created
The history lookup now uses a view for names (for simplicity and readability)
The all history lookup now uses a view combining all punishment history for efficiency
2025-04-11 18:22:07 +02:00
Teriuihi 3c6141f7ad Refactor imports in team.component.ts for conciseness
Consolidated and simplified imports from '../../api' to clean up the code. This reduces redundancy and improves readability while maintaining functionality.
2025-04-11 14:48:13 +02:00
Teriuihi 0f9761da3a Refactor history APIs and integrate LiteBans database support
Redesigned history-related APIs to streamline handling of user and UUID punishments, moving from POST to GET endpoints. Added support for LiteBans database with mappers for retrieving punishment records by name and UUID, and implemented global exception handling for better error reporting. Updated schema paths and added enums (UserType, HistoryType) and a new Gradle dependency.
2025-04-11 01:12:46 +02:00
Teriuihi 43a5dafd82 Refactor API structure and update schema references
Moved API files from `sub_api` to `schemas` for better organization. Updated schema references to use `ApiError` instead of `Error`. Adjusted build configuration to include new schema folder in the API generation process.
2025-04-10 23:16:57 +02:00
Teriuihi 2b818fc297 Add removedReason field to bans API schema 2025-04-10 23:12:20 +02:00
Teriuihi 7fa84fec81 Add "removedBy" field to bans.yml
This new field captures the name of the staff member who removed a punishment. It provides additional traceability and accountability for punishment actions.
2025-04-10 22:55:53 +02:00
Teriuihi 1585011143 Refactor API structure and endpoints for history and team.
Updated API definitions and endpoints to better support punishment history and team queries. Introduced new parameters, schemas, and operations to improve functionality, and reorganized related controllers into appropriate packages.
2025-04-10 22:46:30 +02:00
Teriuihi 2137459e9b Refactor API structure and enhance logging/debugging.
Modularized OpenAPI definitions by splitting into dedicated files for teams, bans, and errors. Improved backend logging for database connections, CORS configuration, and debugging. Updated application properties to support environment-specific CORS origins and logging levels.
2025-04-10 21:45:00 +02:00
Teriuihi 23f298b8c9 Log error when database settings fail to load 2025-04-10 21:11:26 +02:00
Teriuihi 02f21169b4 Remove unused TeamMemberDto import in TeamApiController
The TeamMemberDto import was unnecessary and not used in the code. Removing it improves code cleanliness and reduces potential confusion. This is a minor optimization with no functional changes.
2025-04-10 20:39:51 +02:00
Teriuihi f10c3ab2d3 Refactor team component to use dynamic data loading
Replaced static member entries with dynamic rendering using `getTeamMembers` for better scalability. Added caching and data deduplication logic to optimize API calls. This enhances maintainability and reduces redundancy in the team component.
2025-04-10 02:08:27 +02:00
Teriuihi d5daa8458b Refactor database structure and improve player handling.
Reorganized database-related code into a dedicated module, added mappings for UUID handling, and updated SQL queries for clarity. Enhanced team members API to use player data directly, ensuring consistency and better handling of UUIDs. Introduced new database table for connection settings and adjusted Gradle configurations for modularization.
2025-04-10 01:22:19 +02:00
Teriuihi 67a3162ae3 Added backend and fixed openapi generation 2025-04-08 22:24:24 +02:00
Teriuihi 21496baab5 Remove AppModule and enhance Team and Header components
Deleted unused `AppModule` to streamline the project structure. Enhanced the `TeamComponent` by integrating team member data from the API and updating its template. Improved the `HeaderComponent` by adding `priority` to the logo image for better performance.
2025-04-08 22:23:37 +02:00
Teriuihi c2c81de9d0 Convert components to standalone and implement route-based loading
Refactored Angular components to standalone modules, enhancing modularity and reducing dependency on `AppModule`. Updated routes to facilitate lazy loading for improved performance and maintainability. Replaced `platformBrowserDynamic` with `bootstrapApplication` for modern bootstrapping.
2025-04-08 21:45:44 +02:00
Peter 9615139554 Added styling for birthday member component
Introduce new CSS styles to ensure consistent layout and design for the birthday member section. These styles handle width, padding, text alignment, and font styling for improved visual presentation.
2025-04-06 22:10:46 +02:00