Conversation
|
Toi nappihomma on kova! Hakutoiminnosta pari kyssäriä: Ekana, voiko tolla hakea nyt useammalla nimen osalla samaan aikaan? Esim. kun killassa on miljoona Mikaelia, saanko pelkästään itseni näkyviin kirjoittamalla "Mikael Uusitalo" hakuun? Edit: eiku hetkonen, kyl taitaa saada, eiks vaan? Ja toiseksi: saisko ID:llä hakemisen edelleen käyttöön? Mä ainakin haen itseni kolmimerkkisellä ID:llä nimen sijaan. |
|
|
||
| const conditions = queryParts.map((part) => ({ | ||
| [Op.or]: [ | ||
| Sequelize.where(Sequelize.fn("lower", Sequelize.col("first_name")), { |
There was a problem hiding this comment.
Saisko tähän vielä ton ID:n takasin? Mä oon ainaki yleensä hakenu tilini nimeomaan ID:llä enkä nimelläni.
There was a problem hiding this comment.
nyt pitäis toimii, mitä mietteit
|
joo ei ollu tarkoitus poistaa id:tä lisäsin sen takas ja refaktoroin koodia paremmaks nyt tää kuitenkin hajos itellä ja näyttää mul 500 xdd |
…ombining old and new approach
There was a problem hiding this comment.
Pull Request Overview
This PR implements small UI/UX improvements to enhance user experience in the player management interface. The changes focus on visual clarity and preventing accidental duplicate submissions.
- Added text color styling to the player search input for better visibility
- Implemented button disable functionality to prevent duplicate player creation
- Enhanced search functionality with multi-word query support and error handling
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/app/components/ui/PlayerSearch/PlayerSearchLink.tsx | Added text-black class to search input for better text visibility |
| src/app/components/Player/PlayerForm/index.tsx | Added button disable state to prevent duplicate submissions during player creation |
| src/server/db/players/index.ts | Enhanced search algorithm with multi-word support and error handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| }; | ||
|
|
||
| const submitNewPlayer = async (newPlayer: NewPlayer) => { | ||
| setButtonPressed(!isButtonPressed); |
There was a problem hiding this comment.
This toggle logic is incorrect. The button should be disabled during submission and re-enabled after completion. This should be setButtonPressed(true) at the start of submission and setButtonPressed(false) after the request completes (both success and error cases).
| const options = await Promise.all( | ||
| queryParts.map(async (part) => { | ||
| return await Promise.all( | ||
| permutations.map(async (perm) => { |
There was a problem hiding this comment.
Nested Promise.all creates unnecessary async operations. The inner permutations.map doesn't perform any async operations, so the inner Promise.all and async/await are redundant and could impact performance.
Made text black in the player search input box and also added disable to "create new player" button