Repository navigation
Napraw sortowanie po polsku i dodaj obsługę błędów - #6
Merged
Merged
Conversation
- dodaj wspólne funkcje sortujące (Intl.Collator pl) z testami i użyj ich w AdminPanel oraz PrintTables - obsłuż błędy Firestore w Generator, PrintTables i AdminPanel - ogranicz szerokość 600 px tylko do .compact-table - przenieś filtrowanie lotnisk do useMemo w AdminPanel
✅ Deploy Preview for destinations-test ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Co zmienia
src/utils/sort.ts(Intl.Collator("pl")) z testami, używany wAdminPaneliPrintTables. Litery Ł, Ś, Ż, Ć nie lądują już na końcu listy, a oba widoki sortują tak samo.GeneratoriPrintTablespokazują komunikat zamiast wiecznego „Ładowanie…”, gdy pobranie danych się nie powiedzie.AdminPanelma callback błędu wonSnapshotoraztry/catchw dodawaniu i usuwaniu, z komunikatem dla użytkownika.max-width: 600pxdotyczy teraz tylko.compact-table(tabele do wydruku). Tabela w panelu admina ma znów pełną szerokość.useMemowAdminPanel. WcześniejdisplayedDestinationstworzyło nową tablicę przy każdym renderze, więc memo nic nie cache'owało.Dlaczego
Porównanie stringów operatorem
<sortuje po kodach znaków, więc polskie litery trafiały na koniec, aPrintTablesiAdminPaneldawały różne kolejności. Braktry/catchprzygetDocszostawiał ekran ładowania na stałe po błędzie sieci lub reguł.Jak przetestować
npm run lintnpm run test:run(13 testów, w tym nowe dla sortowania)npm run buildUwagi
Nie zmienia logiki sortowania Schengen → kraj → miasto ani uprawnień użytkowników.