diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9293a471e..ebe03744e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,9 +16,9 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} release: needs: [config, locales, lint] - if: needs.locales.outputs.made_commit != 'true' && needs.config.outputs.made_commit != 'true' + if: needs.locales.outputs.made_commit != 'true' && needs.config.outputs.made_commit != 'true' && always() uses: ./.github/workflows/release.yml docker: needs: [config, locales, lint] - if: needs.locales.outputs.made_commit != 'true' && needs.config.outputs.made_commit != 'true' + if: needs.locales.outputs.made_commit != 'true' && needs.config.outputs.made_commit != 'true' && always() uses: ./.github/workflows/docker.yml diff --git a/.vscode/settings.json b/.vscode/settings.json index edcdb9f37..99cca89a4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,5 +14,6 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "editor.formatOnSave": true, - "docwriter.style": "JSDoc" + "docwriter.style": "JSDoc", + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/CHANGELOG.md b/CHANGELOG.md index d72424585..4dc045413 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,84 @@ +# [1.33.0-develop.7](https://github.com/WatWowMap/ReactMap/compare/v1.33.0-develop.6...v1.33.0-develop.7) (2024-05-11) + + +### Bug Fixes + +* update uicons lib ([8c82e8d](https://github.com/WatWowMap/ReactMap/commit/8c82e8dfe93f3341fdf76a8b925dda02e3519a1f)) + +# [1.33.0-develop.6](https://github.com/WatWowMap/ReactMap/compare/v1.33.0-develop.5...v1.33.0-develop.6) (2024-05-11) + + +### Bug Fixes + +* add   ([0cd5f0f](https://github.com/WatWowMap/ReactMap/commit/0cd5f0f3fc77464b6a175e277ef5fe6341c72b42)) +* add type to gpd object ([0501b8d](https://github.com/WatWowMap/ReactMap/commit/0501b8d8c531a46cc794760291b8a81f9240eea4)) +* no more react components ([1469280](https://github.com/WatWowMap/ReactMap/commit/1469280d98c2c530ec008b9555e02cd891ba7228)) +* use number instead ([38c3542](https://github.com/WatWowMap/ReactMap/commit/38c3542e4faff6507b3273cb68dee59e4fac064a)) + + +### Features + +* support displaying best buddy badge in gym defenders ([5f53b8f](https://github.com/WatWowMap/ReactMap/commit/5f53b8f512539a971a9ffbe1c3561e40a901b660)) + +# [1.33.0-develop.5](https://github.com/WatWowMap/ReactMap/compare/v1.33.0-develop.4...v1.33.0-develop.5) (2024-05-11) + + +### Bug Fixes + +* possible fix edgecase scenario for missing `selectedWebhook` ([5f8d1c9](https://github.com/WatWowMap/ReactMap/commit/5f8d1c9a2ade62959894f1dda6d71e8d659aeefa)) + +# [1.33.0-develop.4](https://github.com/WatWowMap/ReactMap/compare/v1.33.0-develop.3...v1.33.0-develop.4) (2024-05-09) + + +### Bug Fixes + +* add JSON.parse as requested ([cadf5e9](https://github.com/WatWowMap/ReactMap/commit/cadf5e98accef4bc5ba3cd7dea65fefbbd8872ec)) +* add temp_evo to display as well ([02ce747](https://github.com/WatWowMap/ReactMap/commit/02ce747811a4c8ac3d505403e95ee475da1e234d)) +* assign to the correct object ([fffb64f](https://github.com/WatWowMap/ReactMap/commit/fffb64f164cc7ae13e8a70ea5ab7673e4f89e30b)) +* fix nullability as requested ([9e6692a](https://github.com/WatWowMap/ReactMap/commit/9e6692af8f75d145fe776154460652ea481d642d)) +* new variable just4u ([6fdc152](https://github.com/WatWowMap/ReactMap/commit/6fdc15267734fd247d98ebde4a38b4bac902e99d)) +* tyie ([0634d89](https://github.com/WatWowMap/ReactMap/commit/0634d8959a3543933a3f31e0817589c53e68272a)) + + +### Features + +* add support for guarding_pokemon_display ([0579fc4](https://github.com/WatWowMap/ReactMap/commit/0579fc451f48795aa41f7253cb17592aa669ed31)) + +# [1.33.0-develop.3](https://github.com/WatWowMap/ReactMap/compare/v1.33.0-develop.2...v1.33.0-develop.3) (2024-04-27) + + +### Bug Fixes + +* pvp filter in when `all` is set ([2acf75f](https://github.com/WatWowMap/ReactMap/commit/2acf75fb107f2b06f31a9e195b1d3ae158c8368a)) + +# [1.33.0-develop.2](https://github.com/WatWowMap/ReactMap/compare/v1.33.0-develop.1...v1.33.0-develop.2) (2024-04-23) + + +### Bug Fixes + +* gym badge counts ([67f3b0d](https://github.com/WatWowMap/ReactMap/commit/67f3b0de9837924b0e6e37645a199f2b0b54e795)) + +# [1.33.0-develop.1](https://github.com/WatWowMap/ReactMap/compare/v1.32.1-develop.1...v1.33.0-develop.1) (2024-04-21) + + +### Bug Fixes + +* added migration for gym badges, fixed gold badge count not appearing on profile ([e9f9474](https://github.com/WatWowMap/ReactMap/commit/e9f947436d62e68b46ade0948441d2507dbf01d5)) +* fixed new badge type in profile, refactored ternary in a positive way ([8bd1f90](https://github.com/WatWowMap/ReactMap/commit/8bd1f905347933e68dd00d8708067cb7ea29dfe8)) +* updating translations based on feedback from Fabio1988 and lenisko ([7d9ec75](https://github.com/WatWowMap/ReactMap/commit/7d9ec75886b0fa0365b37d86c4377011ec39cd6c)) + + +### Features + +* added "basic" level gym badge ([4c4d3a4](https://github.com/WatWowMap/ReactMap/commit/4c4d3a4ee131a65c5c55f1c42f3972245de54f0f)) + +## [1.32.1-develop.1](https://github.com/WatWowMap/ReactMap/compare/v1.32.0...v1.32.1-develop.1) (2024-04-12) + + +### Bug Fixes + +* ci ([6b4fa8a](https://github.com/WatWowMap/ReactMap/commit/6b4fa8a5316454d2da32c1999271835f83822a99)) + # [1.32.0](https://github.com/WatWowMap/ReactMap/compare/v1.31.0...v1.32.0) (2024-04-12) diff --git a/package.json b/package.json index 14d47fe2c..f71662374 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reactmap", - "version": "1.32.0", + "version": "1.33.0-develop.7", "private": true, "description": "React based frontend map.", "license": "MIT", @@ -155,7 +155,7 @@ "lodash": "^4.17.21", "moment-timezone": "^0.5.43", "morgan": "^1.10.0", - "mysql2": "^3.4.0", + "mysql2": "^3.9.7", "node-cache": "^5.1.2", "node-fetch": "2.6.7", "node-geocoder": "^4.2.0", @@ -176,7 +176,7 @@ "source-map": "^0.7.4", "suncalc": "^1.9.0", "supercluster": "^8.0.1", - "uicons.js": "^1.1.1", + "uicons.js": "^1.1.4", "zustand": "4.4.6" }, "devDependencies": { diff --git a/packages/config/.configref b/packages/config/.configref index 4790e2cfb..3d15bc5e2 100644 --- a/packages/config/.configref +++ b/packages/config/.configref @@ -1 +1 @@ -24122 \ No newline at end of file +24145 \ No newline at end of file diff --git a/packages/locales/lib/generated/de.json b/packages/locales/lib/generated/de.json index 7e41a1416..9034edfcf 100644 --- a/packages/locales/lib/generated/de.json +++ b/packages/locales/lib/generated/de.json @@ -466,9 +466,10 @@ "timer_unverified": "Dieser Timer ist nicht verifiziert", "all": "Alle", "badge_0": "Keins", - "badge_1": "Bronze", - "badge_2": "Silber", - "badge_3": "Gold", + "badge_1": "Basis", + "badge_2": "Bronze", + "badge_3": "Silber", + "badge_4": "Gold", "gym_badge_menu": "Fitness Abzeichen bearbeiten", "gym_badges": "Fitness Abzeichen", "gym_badge_diamonds": "Zeige Fitness Abzeichen", diff --git a/packages/locales/lib/generated/es.json b/packages/locales/lib/generated/es.json index b3f82df80..3aec2ecd4 100644 --- a/packages/locales/lib/generated/es.json +++ b/packages/locales/lib/generated/es.json @@ -466,9 +466,10 @@ "timer_unverified": "Este Temporizador no está Verificado", "all": "Todos", "badge_0": "Ninguno", - "badge_1": "Bronce", - "badge_2": "Plata", - "badge_3": "Oro", + "badge_1": "Básico", + "badge_2": "Bronce", + "badge_3": "Plata", + "badge_4": "Oro", "gym_badge_menu": "Editar Insignia de Gimnasio", "gym_badges": "Insignias de Gimnasio", "gym_badge_diamonds": "Mostrar Insignias de Gimnasio", diff --git a/packages/locales/lib/generated/fr.json b/packages/locales/lib/generated/fr.json index c2c36f609..e0d17558f 100644 --- a/packages/locales/lib/generated/fr.json +++ b/packages/locales/lib/generated/fr.json @@ -466,9 +466,10 @@ "timer_unverified": "Ce Minuteur n'est pas Vérifié", "all": "Tout", "badge_0": "Aucun", - "badge_1": "Bronze", - "badge_2": "Argent", - "badge_3": "Or", + "badge_1": "Basique", + "badge_2": "Bronze", + "badge_3": "Argent", + "badge_4": "Or", "gym_badge_menu": "Modifier le Badge de Salle de Sport", "gym_badges": "Badges de Salle de Sport", "gym_badge_diamonds": "Afficher les Badges de Salle de Sport", diff --git a/packages/locales/lib/generated/hi.json b/packages/locales/lib/generated/hi.json index 821c137ef..75be63c91 100644 --- a/packages/locales/lib/generated/hi.json +++ b/packages/locales/lib/generated/hi.json @@ -466,9 +466,10 @@ "timer_unverified": "यह टाइमर असत्यापित है", "all": "सभी", "badge_0": "कोई नहीं", - "badge_1": "कांस्य", - "badge_2": "रजत", - "badge_3": "सोना", + "badge_1": "मूल", + "badge_2": "कांस्य", + "badge_3": "रजत", + "badge_4": "सोना", "gym_badge_menu": "जिम बैज संपादित करें", "gym_badges": "जिम बैज", "gym_badge_diamonds": "जिम बैज दिखाएं", diff --git a/packages/locales/lib/generated/id.json b/packages/locales/lib/generated/id.json index 065388227..922862ef9 100644 --- a/packages/locales/lib/generated/id.json +++ b/packages/locales/lib/generated/id.json @@ -466,9 +466,10 @@ "timer_unverified": "Timer ini Tidak Terverifikasi", "all": "Semua", "badge_0": "Tidak Ada", - "badge_1": "Bronze", - "badge_2": "Perak", - "badge_3": "Emas", + "badge_1": "Dasar", + "badge_2": "Bronze", + "badge_3": "Perak", + "badge_4": "Emas", "gym_badge_menu": "Edit Lencana Gym", "gym_badges": "Lencana Gym", "gym_badge_diamonds": "Tampilkan Lencana Gym", diff --git a/packages/locales/lib/generated/it.json b/packages/locales/lib/generated/it.json index bda0316b7..accd3ea05 100644 --- a/packages/locales/lib/generated/it.json +++ b/packages/locales/lib/generated/it.json @@ -466,9 +466,10 @@ "timer_unverified": "Este Timer não está Verificado", "all": "Todos", "badge_0": "Nenhum", - "badge_1": "Bronze", - "badge_2": "Prata", - "badge_3": "Ouro", + "badge_1": "Básico", + "badge_2": "Bronze", + "badge_3": "Prata", + "badge_4": "Ouro", "gym_badge_menu": "Editar Insígnia de Ginásio", "gym_badges": "Insígnias de Ginásio", "gym_badge_diamonds": "Mostrar Insígnias de Ginásio", diff --git a/packages/locales/lib/generated/ja.json b/packages/locales/lib/generated/ja.json index 06dfa60ed..c20dded5c 100644 --- a/packages/locales/lib/generated/ja.json +++ b/packages/locales/lib/generated/ja.json @@ -466,9 +466,10 @@ "timer_unverified": "このタイマーは未検証です", "all": "すべて", "badge_0": "なし", - "badge_1": "ブロンズ", - "badge_2": "シルバー", - "badge_3": "ゴールド", + "badge_1": "基本", + "badge_2": "ブロンズ", + "badge_3": "シルバー", + "badge_4": "ゴールド", "gym_badge_menu": "ジムバッジを編集", "gym_badges": "ジムバッジ", "gym_badge_diamonds": "ジムバッジを表示", diff --git a/packages/locales/lib/generated/ko.json b/packages/locales/lib/generated/ko.json index 968615509..348763816 100644 --- a/packages/locales/lib/generated/ko.json +++ b/packages/locales/lib/generated/ko.json @@ -377,9 +377,10 @@ "timer_unverified": "이 타이머는 미검증", "all": "모두", "badge_0": "없음", - "badge_1": "브론즈", - "badge_2": "실버", - "badge_3": "골드", + "badge_1": "기본", + "badge_2": "브론즈", + "badge_3": "실버", + "badge_4": "골드", "gym_badge_menu": "체육관 배지 편집", "gym_badges": "체육관 배지", "gym_badge_diamonds": "체육관 배지 보기", diff --git a/packages/locales/lib/generated/nl.json b/packages/locales/lib/generated/nl.json index 7a3f1428f..b47665b2e 100644 --- a/packages/locales/lib/generated/nl.json +++ b/packages/locales/lib/generated/nl.json @@ -466,9 +466,10 @@ "timer_unverified": "Deze Timer is Niet Geverifieerd", "all": "Alles", "badge_0": "Geen", - "badge_1": "Brons", - "badge_2": "Zilver", - "badge_3": "Goud", + "badge_1": "Basis", + "badge_2": "Brons", + "badge_3": "Zilver", + "badge_4": "Goud", "gym_badge_menu": "Bewerk Gym Badge", "gym_badges": "Gym Badges", "gym_badge_diamonds": "Toon Gym Badges", diff --git a/packages/locales/lib/generated/pl.json b/packages/locales/lib/generated/pl.json index 9a2b65f95..458025256 100644 --- a/packages/locales/lib/generated/pl.json +++ b/packages/locales/lib/generated/pl.json @@ -466,9 +466,10 @@ "timer_unverified": "Ten Timer Nie Jest Zweryfikowany", "all": "Wszystkie", "badge_0": "Brak", - "badge_1": "Brązowy", - "badge_2": "Srebrny", - "badge_3": "Złoty", + "badge_1": "Podst.", + "badge_2": "Brązowy", + "badge_3": "Srebrny", + "badge_4": "Złoty", "gym_badge_menu": "Edytuj Odznaki Siłowni", "gym_badges": "Odznaki Siłowni", "gym_badge_diamonds": "Pokaż Odznaki Siłowni", diff --git a/packages/locales/lib/generated/pt-br.json b/packages/locales/lib/generated/pt-br.json index 1e5411e67..3873dad69 100644 --- a/packages/locales/lib/generated/pt-br.json +++ b/packages/locales/lib/generated/pt-br.json @@ -466,9 +466,10 @@ "timer_unverified": "Este Temporizador não está Verificado", "all": "Todos", "badge_0": "Nenhum", - "badge_1": "Bronze", - "badge_2": "Prata", - "badge_3": "Ouro", + "badge_1": "Básico", + "badge_2": "Bronze", + "badge_3": "Prata", + "badge_4": "Ouro", "gym_badge_menu": "Editar Insígnia de Ginásio", "gym_badges": "Insígnias de Ginásio", "gym_badge_diamonds": "Mostrar Insígnias de Ginásio", diff --git a/packages/locales/lib/generated/ru.json b/packages/locales/lib/generated/ru.json index 6d609124e..e9f4d5c92 100644 --- a/packages/locales/lib/generated/ru.json +++ b/packages/locales/lib/generated/ru.json @@ -466,9 +466,10 @@ "timer_unverified": "Этот Таймер Не Проверен", "all": "Все", "badge_0": "Нет", - "badge_1": "Бронза", - "badge_2": "Серебро", - "badge_3": "Золото", + "badge_1": "Базовый", + "badge_2": "Бронза", + "badge_3": "Серебро", + "badge_4": "Золото", "gym_badge_menu": "Редактировать Значок Спортзала", "gym_badges": "Значки Спортзалов", "gym_badge_diamonds": "Показать Значки Спортзала", diff --git a/packages/locales/lib/generated/sv.json b/packages/locales/lib/generated/sv.json index ec37d6404..e33f0cb6a 100644 --- a/packages/locales/lib/generated/sv.json +++ b/packages/locales/lib/generated/sv.json @@ -466,9 +466,10 @@ "timer_unverified": "Denna Timer är Ej Verifierad", "all": "Alla", "badge_0": "Ingen", - "badge_1": "Brons", - "badge_2": "Silver", - "badge_3": "Guld", + "badge_1": "Grundläggande", + "badge_2": "Brons", + "badge_3": "Silver", + "badge_4": "Guld", "gym_badge_menu": "Redigera Gymmärke", "gym_badges": "Gymmärken", "gym_badge_diamonds": "Visa Gymmärken", diff --git a/packages/locales/lib/generated/th.json b/packages/locales/lib/generated/th.json index f2be55bec..51fdf905e 100644 --- a/packages/locales/lib/generated/th.json +++ b/packages/locales/lib/generated/th.json @@ -466,9 +466,10 @@ "timer_unverified": "ตัวจับเวลานี้ยังไม่ได้รับการยืนยัน", "all": "ทั้งหมด", "badge_0": "ไม่มี", - "badge_1": "ทองแดง", - "badge_2": "เงิน", - "badge_3": "ทอง", + "badge_1": "พื้นฐาน", + "badge_2": "ทองแดง", + "badge_3": "เงิน", + "badge_4": "ทอง", "gym_badge_menu": "แก้ไขเหรียญยิม", "gym_badges": "เหรียญยิม", "gym_badge_diamonds": "แสดงเหรียญยิม", diff --git a/packages/locales/lib/generated/tr.json b/packages/locales/lib/generated/tr.json index 03ab9ffff..6ab4623b9 100644 --- a/packages/locales/lib/generated/tr.json +++ b/packages/locales/lib/generated/tr.json @@ -466,9 +466,10 @@ "timer_unverified": "Bu Zamanlayıcı Doğrulanmadı", "all": "Tümü", "badge_0": "Yok", - "badge_1": "Bronz", - "badge_2": "Gümüş", - "badge_3": "Altın", + "badge_1": "Temel", + "badge_2": "Bronz", + "badge_3": "Gümüş", + "badge_4": "Altın", "gym_badge_menu": "Spor Salonu Rozeti Düzenle", "gym_badges": "Spor Salonu Rozetleri", "gym_badge_diamonds": "Spor Salonu Rozetlerini Göster", diff --git a/packages/locales/lib/generated/zh-tw.json b/packages/locales/lib/generated/zh-tw.json index 0964ffb26..0369aea57 100644 --- a/packages/locales/lib/generated/zh-tw.json +++ b/packages/locales/lib/generated/zh-tw.json @@ -466,9 +466,10 @@ "timer_unverified": "此計時器未經驗證", "all": "全部", "badge_0": "無", - "badge_1": "銅", - "badge_2": "銀", - "badge_3": "金", + "badge_1": "基礎", + "badge_2": "銅", + "badge_3": "銀", + "badge_4": "金", "gym_badge_menu": "編輯健身房徽章", "gym_badges": "健身房徽章", "gym_badge_diamonds": "顯示健身房徽章", diff --git a/packages/locales/lib/human/de.json b/packages/locales/lib/human/de.json index bc96f376a..4c7112bbb 100644 --- a/packages/locales/lib/human/de.json +++ b/packages/locales/lib/human/de.json @@ -479,9 +479,10 @@ "without_ar": "Ohne AR", "both": "Beide", "badge_0": "keiner", - "badge_1": "Bronze", - "badge_2": "Silber", - "badge_3": "Gold", + "badge_1": "Basis", + "badge_2": "Bronze", + "badge_3": "Silber", + "badge_4": "Gold", "gym_badge_menu": "Arenaorden bearbeiten", "gym_badges": "Arenaorden", "gym_badge_diamonds": "Arenaorden anzeigen", diff --git a/packages/locales/lib/human/en.json b/packages/locales/lib/human/en.json index 97f7f2f70..574a341d9 100644 --- a/packages/locales/lib/human/en.json +++ b/packages/locales/lib/human/en.json @@ -141,6 +141,7 @@ "starts": "Starts", "ends": "Ends", "defender": "Defender", + "best_buddy": "Best buddy", "cp": "CP", "kilogram": "kg", "meter": "m", @@ -517,9 +518,10 @@ "timer_unverified": "This Timer is Unverified", "all": "All", "badge_0": "None", - "badge_1": "Bronze", - "badge_2": "Silver", - "badge_3": "Gold", + "badge_1": "Basic", + "badge_2": "Bronze", + "badge_3": "Silver", + "badge_4": "Gold", "gym_badge_menu": "Edit Gym Badge", "gym_badges": "Gym Badges", "gym_badge_diamonds": "Show Gym Badges", diff --git a/packages/locales/lib/human/fr.json b/packages/locales/lib/human/fr.json index bec6db202..10d01fc57 100644 --- a/packages/locales/lib/human/fr.json +++ b/packages/locales/lib/human/fr.json @@ -466,9 +466,10 @@ "timer_unverified": "Ce timer n'est pas vérifié", "all": "Tout", "badge_0": "Sans", - "badge_1": "Bronze", - "badge_2": "Argent", - "badge_3": "Or", + "badge_1": "Basique", + "badge_2": "Bronze", + "badge_3": "Argent", + "badge_4": "Or", "gym_badge_menu": "Editer Badge d'Arène", "gym_badges": "Badges d'Arènes", "gym_badge_diamonds": "Afficher les Badges d'Arènes", diff --git a/packages/locales/lib/human/ja.json b/packages/locales/lib/human/ja.json index 9e26dfeeb..8ac6fb2d2 100644 --- a/packages/locales/lib/human/ja.json +++ b/packages/locales/lib/human/ja.json @@ -1 +1,26 @@ -{} \ No newline at end of file +{ + "locale_selection": "言語選択", + "invasions": "ロケット団", + "total_cp": "合計CP", + "selected": "選択済み", + "alt_forms": "他のフォルム", + "wayfarer_options": "Wayfarerオプション", + "raid_timers": "レイドタイマー", + "invasion_timers": "ロケット団タイマー", + "lure_timers": "ルアータイマー", + "candy": "アメ", + "invasion": "ロケット団", + "nest": "巣", + "stardust": "ほしのすな", + "all_gyms": "全てのジム", + "event_stops_subtitle": "カクレオンのような特別なイベントポケストップを表示", + "rocket_pokemon": "シャドウポケモン", + "showcase": "おひろめ", + "contribute": "貢献", + "level_circles": "レベルインジケータ", + "showcase_rankings": "おひろめランキング", + "showcase_rankings_subtitle": "ポケストップのおひろめのトップランキングのリストを表示", + "hisuian": "ヒスイ", + "spacial_rend_range": "あくうせつだんの範囲", + "individual_filters": "部分的にフィルターされています" +} diff --git a/packages/locales/lib/human/pl.json b/packages/locales/lib/human/pl.json index 15bf2aa51..fba7266ce 100644 --- a/packages/locales/lib/human/pl.json +++ b/packages/locales/lib/human/pl.json @@ -39,10 +39,10 @@ "backups": "Kopie zapasowe", "backups_subtitle": "Umożliwia tworzenie kopii zapasowych i ładowanie ustawień na różne urządzenia", "badge_0": "Brak", - "badge_1": "Brąz", - "badge_2": "Srebro", - "badge_3": "Złoto", - "basic": "Podstawowy", + "badge_1": "Podst.", + "badge_2": "Brąz", + "badge_3": "Srebro", + "badge_4": "Złoto", "basic_description": "Łatwe wybieranie Pokémonów i zastosowanie globalnego filtra", "battle_changes": "W bitwie", "battle_changes_poracle": "battle_changes", diff --git a/packages/types/lib/scanner.d.ts b/packages/types/lib/scanner.d.ts index f6c2216a4..89b51563f 100644 --- a/packages/types/lib/scanner.d.ts +++ b/packages/types/lib/scanner.d.ts @@ -28,6 +28,17 @@ export interface Device { export type FullDevice = FullModel +export interface PokemonDisplay { + form: number + costume: number + gender: number + shiny: boolean + temp_evolution: number + alignment: number + badge: number + location_card: number +} + export interface Gym { id: string lat: number @@ -41,6 +52,7 @@ export interface Gym { raid_pokemon_id: number updated: number guarding_pokemon_id: number + guarding_pokemon_display: PokemonDisplay available_slots: number team_id: number raid_level: number diff --git a/server/src/configs/custom-environment-variables.json b/server/src/configs/custom-environment-variables.json index 8556676fa..6d28900c4 100644 --- a/server/src/configs/custom-environment-variables.json +++ b/server/src/configs/custom-environment-variables.json @@ -1001,6 +1001,10 @@ "__name": "DEFAULT_FILTERS_POKESTOPS_CANDY", "__format": "boolean" }, + "xlCandy": { + "__name": "DEFAULT_FILTERS_POKESTOPS_XL_CANDY", + "__format": "boolean" + }, "pokemon": { "__name": "DEFAULT_FILTERS_POKESTOPS_POKEMON", "__format": "boolean" diff --git a/server/src/configs/default.json b/server/src/configs/default.json index 791e9023a..0e3524d38 100644 --- a/server/src/configs/default.json +++ b/server/src/configs/default.json @@ -485,6 +485,7 @@ "items": true, "megaEnergy": true, "candy": true, + "xlCandy": true, "pokemon": true, "invasions": false, "allInvasions": true, diff --git a/server/src/db/migrations/20240416222131_basicGymBadge.cjs b/server/src/db/migrations/20240416222131_basicGymBadge.cjs new file mode 100644 index 000000000..b705db3fe --- /dev/null +++ b/server/src/db/migrations/20240416222131_basicGymBadge.cjs @@ -0,0 +1,22 @@ +/* eslint-disable no-unused-vars */ +const config = require('@rm/config') + +/** + * @param {import("knex").Knex} knex + */ +exports.up = async (knex) => { + // Increment all non-zero badges by 1 (e.g., moving Bronze from value 1 to value 2, making room for a basic badge) + await knex(config.getSafe('database.settings.gymBadgeTableName')) + .where('badge', '>', 0) + .update({ badge: knex.raw('?? + 1', ['badge']) }) +} + +/** + * @param {import("knex").Knex} knex + */ +exports.down = async (knex) => { + // Decrement all non-zero badges by 1 (e.g., moving Bronze from value 2 to value 1) + await knex(config.getSafe('database.settings.gymBadgeTableName')) + .where('badge', '>', 0) + .update({ badge: knex.raw('?? - 1', ['badge']) }) +} diff --git a/server/src/graphql/typeDefs/scanner.graphql b/server/src/graphql/typeDefs/scanner.graphql index 1fff195a7..bb9a8ecc9 100644 --- a/server/src/graphql/typeDefs/scanner.graphql +++ b/server/src/graphql/typeDefs/scanner.graphql @@ -23,6 +23,7 @@ type Gym { raid_pokemon_id: Int updated: Int guarding_pokemon_id: Int + guarding_pokemon_display: JSON available_slots: Int team_id: Int raid_level: Int diff --git a/server/src/models/Gym.js b/server/src/models/Gym.js index f05089286..262efd3a7 100644 --- a/server/src/models/Gym.js +++ b/server/src/models/Gym.js @@ -28,6 +28,7 @@ const gymFields = [ 'team_id', 'in_battle', 'guarding_pokemon_id', + 'guarding_pokemon_display', 'total_cp', 'power_up_points', 'power_up_level', @@ -369,6 +370,14 @@ class Gym extends Model { if (gym.updated > ts - gymValidDataLimit * 86400) { gymFields.forEach((field) => (newGym[field] = gym[field])) } + if ( + typeof gym.guarding_pokemon_display === 'string' && + gym.guarding_pokemon_display + ) { + newGym.guarding_pokemon_display = JSON.parse( + gym.guarding_pokemon_display, + ) + } } if ( onlyRaids && diff --git a/server/src/services/DiscordClient.js b/server/src/services/DiscordClient.js index 4c18a90a3..e81cf5c42 100644 --- a/server/src/services/DiscordClient.js +++ b/server/src/services/DiscordClient.js @@ -7,7 +7,7 @@ const passport = require('passport') const config = require('@rm/config') const { log, HELPERS } = require('@rm/logger') -const { Db } = require('./initialization') +const { Db, Event } = require('./initialization') const logUserAuth = require('./logUserAuth') const areaPerms = require('./functions/areaPerms') const webhookPerms = require('./functions/webhookPerms') @@ -311,6 +311,9 @@ class DiscordClient { .findOne(req.user ? { id: req.user.id } : { discordId: discordUser.id }) .then( async (/** @type {import('@rm/types').FullUser} */ userExists) => { + const selectedWebhook = Object.keys(Event.webhookObj).find((x) => + discordUser?.perms?.webhooks.includes(x), + ) if (req.user && userExists?.strategy === 'local') { await Db.models.User.query() .update({ @@ -343,6 +346,7 @@ class DiscordClient { .whereNot('id', req.user.id) .delete() return done(null, { + selectedWebhook, ...discordUser, ...req.user, username: userExists.username || discordUser.username, @@ -350,11 +354,13 @@ class DiscordClient { perms: mergePerms(req.user.perms, discordUser.perms), }) } + if (!userExists) { userExists = await Db.models.User.query().insertAndFetch({ discordId: discordUser.id, strategy: 'discord', tutorial: !config.getSafe('map.misc.forceTutorial'), + selectedWebhook, }) } if (userExists.strategy !== 'discord') { @@ -363,6 +369,12 @@ class DiscordClient { .where('id', userExists.id) userExists.strategy = 'discord' } + if (!userExists.selectedWebhook && selectedWebhook) { + await Db.models.User.query() + .update({ selectedWebhook }) + .where('id', userExists.id) + userExists.selectedWebhook = selectedWebhook + } return done(null, { ...discordUser, ...userExists, diff --git a/server/src/services/TelegramClient.js b/server/src/services/TelegramClient.js index 80bab455d..ecd8573f5 100644 --- a/server/src/services/TelegramClient.js +++ b/server/src/services/TelegramClient.js @@ -5,7 +5,7 @@ const passport = require('passport') const config = require('@rm/config') const { log, HELPERS } = require('@rm/logger') -const { Db } = require('./initialization') +const { Db, Event } = require('./initialization') const areaPerms = require('./functions/areaPerms') const webhookPerms = require('./functions/webhookPerms') const scannerPerms = require('./functions/scannerPerms') @@ -139,6 +139,9 @@ class TelegramClient { .findOne({ telegramId: user.id }) .then( async (/** @type {import('@rm/types').FullUser} */ userExists) => { + const selectedWebhook = Object.keys(Event.webhookObj).find((x) => + user?.perms?.webhooks.includes(x), + ) if (req.user && userExists?.strategy === 'local') { await Db.models.User.query() .update({ @@ -158,6 +161,7 @@ class TelegramClient { 'Authenticated successfully.', ) return done(null, { + selectedWebhook, ...user, ...req.user, username: userExists.username || user.username, @@ -170,6 +174,7 @@ class TelegramClient { telegramId: user.id, strategy: user.provider, tutorial: !config.getSafe('map.misc.forceTutorial'), + selectedWebhook, }) } if (userExists.strategy !== 'telegram') { @@ -178,6 +183,12 @@ class TelegramClient { .where('id', userExists.id) userExists.strategy = 'telegram' } + if (!userExists.selectedWebhook && selectedWebhook) { + await Db.models.User.query() + .update({ selectedWebhook }) + .where('id', userExists.id) + userExists.selectedWebhook = selectedWebhook + } log.info( HELPERS.custom(this.rmStrategy, '#26A8EA'), user.username, diff --git a/server/src/services/filters/builder/pokestop.js b/server/src/services/filters/builder/pokestop.js index d9837fff4..251c449d3 100644 --- a/server/src/services/filters/builder/pokestop.js +++ b/server/src/services/filters/builder/pokestop.js @@ -1,4 +1,6 @@ // @ts-check +const { log, HELPERS } = require('@rm/logger') + const BaseFilter = require('../Base') const { Event, Db } = require('../../initialization') @@ -56,12 +58,32 @@ function buildPokestops(perms, defaults) { if (perms.quests) { if (avail.startsWith('q')) { quests[avail] = new BaseFilter(defaults.items) - } - if (avail.startsWith('d')) { + } else if (avail.startsWith('d')) { quests[avail] = new BaseFilter(defaults.stardust.enabled) - } - if (avail.startsWith('u')) { + } else if (avail.startsWith('u')) { quests[avail] = new BaseFilter(defaults.rewardTypes) + } else if (avail.startsWith('p')) { + quests[avail] = new BaseFilter(defaults.xp.enabled) + } else if (avail.startsWith('c')) { + quests[avail] = new BaseFilter(defaults.candy) + } else if (avail.startsWith('x')) { + quests[avail] = new BaseFilter(defaults.xlCandy) + } else if (avail.startsWith('m')) { + quests[avail] = new BaseFilter(defaults.megaEnergy) + } else if ( + !avail.startsWith('i') && + !avail.startsWith('l') && + !avail.startsWith('a') && + !avail.startsWith('b') && + !avail.startsWith('f') && + !avail.startsWith('h') && + !Number.isInteger(+avail.charAt(0)) + ) { + log.warn( + HELPERS.available, + `Unknown quest type: ${avail} probably should open a PR or issue`, + ) + quests[avail] = new BaseFilter(true) } } if (perms.invasions) { diff --git a/server/src/services/filters/pokemon/Backend.js b/server/src/services/filters/pokemon/Backend.js index c7d33ca9c..782e583fd 100644 --- a/server/src/services/filters/pokemon/Backend.js +++ b/server/src/services/filters/pokemon/Backend.js @@ -226,7 +226,7 @@ module.exports = class PkmnBackend { */ getRanks(league, data) { const filtered = - this.mods.onlyAllPvp || this.mods.onlyLegacy + this.mods.onlyAllPvp || this.mods.onlyLegacy || this.filter.all ? data : data.filter((entry) => { const valid = diff --git a/src/assets/constants.js b/src/assets/constants.js index 727401b55..2842a3bee 100644 --- a/src/assets/constants.js +++ b/src/assets/constants.js @@ -6,7 +6,7 @@ export const NUNDO_HUNDO = /** @type {const} */ (['zeroIv', 'hundoIv']) export const ENUM_GENDER = /** @type {const} */ ([0, 1, 2, 3]) -export const ENUM_BADGES = /** @type {const} */ ([0, 1, 2, 3]) +export const ENUM_BADGES = /** @type {const} */ ([0, 1, 2, 3, 4]) export const S2_LEVELS = /** @type {const} */ ([ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, @@ -19,6 +19,7 @@ export const BADGES = /** @type {const} */ ([ 'badge_1', 'badge_2', 'badge_3', + 'badge_4', ]) export const QUEST_SETS = /** @type {const} */ ([ diff --git a/src/assets/css/main.css b/src/assets/css/main.css index a2fa23534..fcb0b7582 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -132,7 +132,7 @@ body { -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 1); } -.badge-1 { +.badge-2 { background: linear-gradient( to right, #cd7f32, @@ -142,7 +142,8 @@ body { #cd7f32 ); } -.badge-2 { + +.badge-3 { background: linear-gradient( to right, #c0c0c0, @@ -152,7 +153,8 @@ body { #c0c0c0 ); } -.badge-3 { + +.badge-4 { background: linear-gradient( to right, #bf953f, @@ -395,15 +397,15 @@ input[type='time']::-webkit-calendar-picker-indicator { filter: invert(100%); } -.badge_3 { +.badge_4 { color: #ffd700; } -.badge_2 { +.badge_3 { color: #c0c0c0; } -.badge_1 { +.badge_2 { color: #cd7f32; } diff --git a/src/features/gym/GymPopup.jsx b/src/features/gym/GymPopup.jsx index 923c3202b..0c22d2b1c 100644 --- a/src/features/gym/GymPopup.jsx +++ b/src/features/gym/GymPopup.jsx @@ -634,6 +634,7 @@ const ExtraGymInfo = ({ updated, total_cp, guarding_pokemon_id, + guarding_pokemon_display, }) => { const { t, i18n } = useTranslation() const Icons = useMemory((s) => s.Icons) @@ -643,12 +644,35 @@ const ExtraGymInfo = ({ ) const numFormatter = new Intl.NumberFormat(i18n.language) + /** @type {Partial} */ + const gpd = guarding_pokemon_display || {} return ( {!!guarding_pokemon_id && updated > gymValidDataLimit && ( - + + {gpd.badge === 1 && ( + <> + {t('best_buddy')} +   + + )} {t(`poke_${guarding_pokemon_id}`)} diff --git a/src/features/gym/gymMarker.js b/src/features/gym/gymMarker.js index 6f156cd01..17be932cb 100644 --- a/src/features/gym/gymMarker.js +++ b/src/features/gym/gymMarker.js @@ -85,17 +85,21 @@ export function gymMarker({ transform: translateX(-38%) translateY(-82%); " > - ${badge}` + ${ + badge > 1 + ? `${badge}` + : '' + }` : /* html */ ` { - const counter = { bronze: 0, silver: 0, gold: 0 } + const counter = { basic: 0, bronze: 0, silver: 0, gold: 0 } if (data?.badges) { data.badges.forEach((gym) => { switch (gym.badge) { - case 3: + case 4: counter.gold += 1 break - case 2: + case 3: counter.silver += 1 break - case 1: + case 2: counter.bronze += 1 break + case 1: + counter.basic += 1 + break default: } }) @@ -53,7 +56,7 @@ export function UserGymBadges() { {Object.entries(counts).map(([key, count], i) => ( - + s.Icons.getMisc(`badge_${badge}`)) + const badgeIcon = useMemory((s) => s.Icons.getMisc(`badge_${badge - 1}`)) return badge ? ( @@ -104,7 +107,7 @@ function BadgeTile({ badge, ...gym }) { width={120} /> {gym.deleted &&
} - {badge && ( + {badge && badge > 1 && ( {t(`badge_${badge}`)} { ) if (children.length === 0) return null return ( - + {group ? ( - + ), )} diff --git a/src/services/queries/gym.js b/src/services/queries/gym.js index f12eaa5f9..5de1818c2 100644 --- a/src/services/queries/gym.js +++ b/src/services/queries/gym.js @@ -20,6 +20,7 @@ const gym = gql` team_id in_battle guarding_pokemon_id + guarding_pokemon_display total_cp badge power_up_level diff --git a/yarn.lock b/yarn.lock index 9889593fd..bfbf6d77d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6856,10 +6856,10 @@ mysql2@3.2.0: seq-queue "^0.0.5" sqlstring "^2.3.2" -mysql2@^3.4.0: - version "3.6.5" - resolved "https://registry.yarnpkg.com/mysql2/-/mysql2-3.6.5.tgz#46bfed7c1c1e4288283f8c8f1c4a5f20669dd3d6" - integrity sha512-pS/KqIb0xlXmtmqEuTvBXTmLoQ5LmAz5NW/r8UyQ1ldvnprNEj3P9GbmuQQ2J0A4LO+ynotGi6TbscPa8OUb+w== +mysql2@^3.9.7: + version "3.9.7" + resolved "https://registry.yarnpkg.com/mysql2/-/mysql2-3.9.7.tgz#843755daf65b5ef08afe545fe14b8fb62824741a" + integrity sha512-KnJT8vYRcNAZv73uf9zpXqNbvBG7DJrs+1nACsjZP1HMJ1TgXEy8wnNilXAn/5i57JizXKtrUtwDB7HxT9DDpw== dependencies: denque "^2.1.0" generate-function "^2.3.1" @@ -9257,10 +9257,10 @@ uglify-js@^3.1.4: resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== -uicons.js@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/uicons.js/-/uicons.js-1.1.1.tgz#37340b5cdcfc9043c6c1e21e3f4311c641cf0df1" - integrity sha512-1Zt3BKiGobef55FqGgD8FQs7xTZmPLbeHm25QIaQH1cw+oYaphvMStv5K93Aq6XYvei7mw82gKvprvLD5ZNhtw== +uicons.js@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/uicons.js/-/uicons.js-1.1.4.tgz#8c7eb94c80286f0a04d194e3cafff5d85f773c7f" + integrity sha512-dsn8sGHF+IaHXngd556JxFVP5VYEp67uKOTPC6ximDpRoCaPxwRu3LBp7ue0ot3V5iX8J3B9VfeH1/jhnIe3sA== uid-safe@~2.1.5: version "2.1.5"