Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Search Functionality for Employee and Company Modules #8

Merged
merged 9 commits into from
Sep 7, 2024

Conversation

gabrizord
Copy link
Owner

Search Functionality: Added a search bar to both employee and company list pages, allowing users to filter records easily.
UI Enhancements:
Replaced the "Cadastrar Novo Colaborador" button with a green "Adicionar" button and icon.
Improved the layout by adding a dark-themed container around the search bar and button.
Updated form controls with custom borders and enhanced button styling for consistency.
Impact:
These changes enhance the user experience by improving functionality and visual design on both employee and company pages.

- Updated the employee list page to include a search input for filtering employees.
- Replaced the "Cadastrar Novo Colaborador" button with a green "Adicionar" button that includes an icon.
- Improved the styling with a dark background and shadow for the search and add button container.
- Updated CSS styles for form control borders and button success state.
added new styles for the search bar and add button, improving consistency across the company and employee templates. adjusted padding, borders, and shadows for a modern UI. replaced the old button styles with new custom ones for better aesthetics.

changes affect the `tables-styles.css`, `company.html`, and `employee.html` files, providing a unified design experience.
Added a search endpoint in EmployeeRestController to allow users to search for employees by name. Enhanced EmployeeRepository and EmployeeService with a method to perform case-insensitive name searches. Updated frontend JavaScript to implement search functionality and dynamically update the employee table with the results.

Also included improvements to form submissions and actions such as register, edit, and delete for both employees and companies, adding better AJAX handling for these operations. Updated UI components and templates, ensuring consistent behavior for modals and input forms across different views.
Refactored the form submission and deletion logic for both company and employee scripts by introducing generic setup functions. This reduces code duplication and improves maintainability. Handlers for specific actions like registering, editing, and deleting companies and employees have been separated into distinct functions. Added phone number masking functionality for better user input experience.

Also improved the initialization logic for both company and employee management setups, including search functionality and input masking.
implemented a new search endpoint in CompanyRestController to allow searching for companies by name. Added a corresponding method in CompanyService and CompanyRepository to handle the search query. In the front-end, enhanced company management by adding a search bar and dynamic table population for displaying search results. Improved input formatting for CNPJ and phone numbers in company-script.js and company.html.
…code

- Updated the search input field IDs in both employee and company templates for better clarity and consistency.
- Removed unimplemented or redundant form submission and delete action handlers in `form-utils.js`.
- Refactored label additions for search fields to improve accessibility in employee and company templates.

These changes improve code maintainability and user experience but do not affect functionality.
Removed unnecessary `System.out.println` debug statements from the `findByNameContainingIgnoreCase` method in `EmployeeService`. This improves code cleanliness and performance.
add logic to reload the page when the search input is cleared, ensuring that the original table is restored. Also updated comment for custom button actions section.

This change improves user experience by resetting the table when no query is present.
…tion

refactor search input handling to use a debounced function, improving performance by reducing redundant API calls during typing. Updated comments and error messages to include localized Portuguese translations, providing better user context.

Added a debounce function to delay search requests by 300ms. Updated the table handling logic to reinitialize action buttons after search result updates. Improved code readability by translating key actions to Portuguese.
Copy link

sonarqubecloud bot commented Sep 7, 2024

@gabrizord gabrizord merged commit be6376c into dev Sep 7, 2024
3 checks passed
@gabrizord gabrizord deleted the feat-searchtable branch September 7, 2024 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant