This repository was archived by the owner on Dec 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
#21 - Pet Preferences Selection Page #51
Open
TomaszRebizant
wants to merge
44
commits into
main
Choose a base branch
from
21-pet-preferences-selection-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 33 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
b9e907d
Add pet preferences page with Polish translations and routing
TomaszRebizant 862cd93
edit style of form, add background, extract config adn styles
TomaszRebizant fe7899e
Improve form design and functionality
TomaszRebizant ef13c11
Restore all preference functionality
TomaszRebizant 0a50c46
Refactor preferences page
TomaszRebizant d0d5e57
remove trails mode in background gradient
TomaszRebizant 4eecd43
clean app.css
TomaszRebizant b1ff888
add pinia to the project
TomaszRebizant cf3fd8c
fix linter errors
TomaszRebizant 695256a
make linter fixes
TomaszRebizant 601fc45
Merge branch 'main' into 21-pet-preferences-selection-page
TomaszRebizant d19f219
resolve issue causing make test to fail
TomaszRebizant afe92b1
clean code
TomaszRebizant 03db946
navigate to dashboard after applying filters
TomaszRebizant cfc2238
use database data in Pet Show view
TomaszRebizant d7c4f63
merge: main into 21-pet-preferences-selection-page; resolve Preferenc…
TomaszRebizant 981e34c
remove dark mode
TomaszRebizant 00d15c7
delete dark mode
TomaszRebizant 97c7d2f
fix dark mode
TomaszRebizant e7f70f1
delete comment
TomaszRebizant 069d421
fix linter errors
TomaszRebizant 812ddb2
Revert package-lock.json to previous state
TomaszRebizant 22e2be8
fix errors
TomaszRebizant 6b83de6
fix test issues
TomaszRebizant 67d21bd
Merge branch 'main' into 21-pet-preferences-selection-page
TomaszRebizant eb5b4be
add small fixes
TomaszRebizant 0cccc0a
Add PR sugestions
TomaszRebizant c56b977
linter fixes
TomaszRebizant 534dd9e
fix tags in specific pet view
TomaszRebizant a471ff8
linter fixes
TomaszRebizant 7672601
delete comments
TomaszRebizant b8f13a0
improve accessibility across UI components
TomaszRebizant 011a1d4
remoeve empty lines
TomaszRebizant 602463c
fix linter errors
TomaszRebizant 5beb228
Dashboard fixes, pet view improvements, preferences UX, connecting pr…
TomaszRebizant 87045dd
Merge branch 'main' into 21-pet-preferences-selection-page
TomaszRebizant 298ecfe
fix tests
TomaszRebizant e5e9cc7
Add cursor pointer improvements to UI elements
TomaszRebizant fe6a9e5
Merge branch 'main' into 21-pet-preferences-selection-page
TomaszRebizant 7ed679a
Merge branch 'main' into 21-pet-preferences-selection-page
TomaszRebizant 11d4a21
add image handling
TomaszRebizant 25437e6
Delete .vite files
krzysztofkozyra021 e2fb116
linter
krzysztofkozyra021 cbd69bf
Merge main ,resolve conflicts
krzysztofkozyra021 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ public function run(): void | |
| { | ||
| $this->call([ | ||
| DemoSeeder::class, | ||
| PetsOnlySeeder::class, | ||
| ]); | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Database\Seeders; | ||
|
|
||
| use App\Models\Pet; | ||
| use App\Models\PetShelter; | ||
| use App\Models\Tag; | ||
| use Illuminate\Database\Seeder; | ||
| use Illuminate\Support\Facades\DB; | ||
| use Illuminate\Support\Str; | ||
|
|
||
| class PetsOnlySeeder extends Seeder | ||
| { | ||
| public function run(): void | ||
| { | ||
| $driver = DB::connection()->getDriverName(); | ||
|
|
||
| if ($driver === "pgsql") { | ||
| DB::statement("TRUNCATE TABLE pet_tag RESTART IDENTITY CASCADE"); | ||
| DB::statement("TRUNCATE TABLE pets RESTART IDENTITY CASCADE"); | ||
| } elseif ($driver === "mysql") { | ||
| DB::statement("SET FOREIGN_KEY_CHECKS=0;"); | ||
| DB::table("pet_tag")->truncate(); | ||
| DB::table("pets")->truncate(); | ||
| DB::statement("SET FOREIGN_KEY_CHECKS=1;"); | ||
| } else { | ||
| DB::table("pet_tag")->truncate(); | ||
| DB::table("pets")->truncate(); | ||
| } | ||
|
|
||
| if (PetShelter::count() < 5) { | ||
| PetShelter::factory()->count(5 - PetShelter::count())->create(); | ||
| } | ||
|
|
||
| $requiredTagNames = [ | ||
| "friendly", "playful", "calm", "active", "gentle", "smart", "independent", "curious", | ||
| "good with kids", "good with dogs", "good with cats", "house trained", "leash trained", "low shedding", | ||
| ]; | ||
|
|
||
| foreach ($requiredTagNames as $name) { | ||
| Tag::firstOrCreate(["name" => $name]); | ||
| } | ||
|
|
||
| $tags = Tag::whereIn("name", $requiredTagNames)->get(); | ||
| $shelters = PetShelter::all(); | ||
|
|
||
| $curatedPets = [ | ||
| ["name" => "Buddy", "species" => "dog", "breed" => "Labrador Retriever", "sex" => "male", "age" => 24, "size" => "large", "weight" => 28.5, "color" => "yellow", "adoption_status" => "available", "tags" => ["friendly", "playful", "good with kids"]], | ||
| ["name" => "Luna", "species" => "cat", "breed" => "Siamese", "sex" => "female", "age" => 12, "size" => "small", "weight" => 3.8, "color" => "seal point", "adoption_status" => "available", "tags" => ["curious", "smart", "independent"]], | ||
| ["name" => "Max", "species" => "dog", "breed" => "German Shepherd", "sex" => "male", "age" => 36, "size" => "large", "weight" => 32.0, "color" => "black and tan", "adoption_status" => "available", "tags" => ["smart", "active", "leash trained"]], | ||
| ["name" => "Bella", "species" => "dog", "breed" => "Golden Retriever", "sex" => "female", "age" => 48, "size" => "large", "weight" => 29.0, "color" => "golden", "adoption_status" => "available", "tags" => ["gentle", "friendly", "good with kids"]], | ||
| ["name" => "Oliver", "species" => "cat", "breed" => "British Shorthair", "sex" => "male", "age" => 24, "size" => "medium", "weight" => 5.5, "color" => "blue", "adoption_status" => "available", "tags" => ["calm", "low shedding"]], | ||
| ["name" => "Milo", "species" => "cat", "breed" => "Maine Coon", "sex" => "male", "age" => 36, "size" => "large", "weight" => 7.2, "color" => "brown tabby", "adoption_status" => "available", "tags" => ["friendly", "good with kids"]], | ||
| ["name" => "Coco", "species" => "dog", "breed" => "Poodle", "sex" => "female", "age" => 60, "size" => "medium", "weight" => 18.0, "color" => "white", "adoption_status" => "available", "tags" => ["smart", "low shedding", "house trained"]], | ||
| ["name" => "Charlie", "species" => "dog", "breed" => "Beagle", "sex" => "male", "age" => 24, "size" => "medium", "weight" => 11.0, "color" => "tricolor", "adoption_status" => "available", "tags" => ["curious", "playful"]], | ||
| ["name" => "Rocky", "species" => "dog", "breed" => "Boxer", "sex" => "male", "age" => 48, "size" => "large", "weight" => 30.5, "color" => "fawn", "adoption_status" => "available", "tags" => ["active", "friendly"]], | ||
| ["name" => "Daisy", "species" => "dog", "breed" => "Bulldog", "sex" => "female", "age" => 36, "size" => "medium", "weight" => 22.0, "color" => "brindle", "adoption_status" => "available", "tags" => ["gentle", "calm"]], | ||
| ["name" => "Simba", "species" => "cat", "breed" => "Bengal", "sex" => "male", "age" => 24, "size" => "medium", "weight" => 4.5, "color" => "brown spotted", "adoption_status" => "available", "tags" => ["active", "curious"]], | ||
| ["name" => "Chloe", "species" => "cat", "breed" => "Ragdoll", "sex" => "female", "age" => 36, "size" => "large", "weight" => 6.0, "color" => "seal bicolor", "adoption_status" => "available", "tags" => ["gentle", "friendly"]], | ||
| ["name" => "Nala", "species" => "cat", "breed" => "Sphynx", "sex" => "female", "age" => 24, "size" => "medium", "weight" => 3.2, "color" => "pink", "adoption_status" => "available", "tags" => ["friendly", "curious"]], | ||
| ["name" => "Sadie", "species" => "dog", "breed" => "Dachshund", "sex" => "female", "age" => 72, "size" => "small", "weight" => 8.0, "color" => "red", "adoption_status" => "available", "tags" => ["independent", "house trained"]], | ||
| ["name" => "Zeus", "species" => "dog", "breed" => "Rottweiler", "sex" => "male", "age" => 60, "size" => "large", "weight" => 45.0, "color" => "black and tan", "adoption_status" => "available", "tags" => ["smart", "leash trained"]], | ||
| ["name" => "Lily", "species" => "dog", "breed" => "Yorkshire Terrier", "sex" => "female", "age" => 48, "size" => "small", "weight" => 3.2, "color" => "blue and tan", "adoption_status" => "available", "tags" => ["playful", "low shedding"]], | ||
| ["name" => "Leo", "species" => "cat", "breed" => "Russian Blue", "sex" => "male", "age" => 36, "size" => "medium", "weight" => 4.2, "color" => "blue", "adoption_status" => "available", "tags" => ["calm", "smart"]], | ||
| ["name" => "Misty", "species" => "cat", "breed" => "Persian", "sex" => "female", "age" => 60, "size" => "medium", "weight" => 4.0, "color" => "white", "adoption_status" => "available", "tags" => ["gentle", "low shedding"]], | ||
| ["name" => "Finn", "species" => "dog", "breed" => "Border Collie", "sex" => "male", "age" => 24, "size" => "medium", "weight" => 19.0, "color" => "black and white", "adoption_status" => "available", "tags" => ["smart", "active"]], | ||
| ["name" => "Zoe", "species" => "cat", "breed" => "Norwegian Forest", "sex" => "female", "age" => 48, "size" => "large", "weight" => 5.8, "color" => "brown tabby", "adoption_status" => "available", "tags" => ["friendly", "curious"]], | ||
| ]; | ||
|
|
||
| foreach ($curatedPets as $data) { | ||
| $descBySpecies = [ | ||
| "dog" => "Lubi spacery i zabawę, łagodny w domu i towarzyski na zewnątrz.", | ||
| "cat" => "Ciekawska i spokojna, lubi wylegiwać się na słońcu i bawić wędką.", | ||
| ]; | ||
| $healthPool = ["healthy", "healthy", "healthy", "recovering"]; | ||
| $health = $healthPool[array_rand($healthPool)]; | ||
| $currentTreatment = $health === "recovering" ? "Krótka rekonwalescencja po szczepieniu, zalecany odpoczynek." : null; | ||
| $sterilized = rand(0, 1) === 1; | ||
| $vaccinated = rand(0, 1) === 1; | ||
| $hasChip = rand(0, 1) === 1; | ||
| $chip = $hasChip ? strtoupper(Str::random(12)) : null; | ||
| $dewormed = rand(0, 1) === 1; | ||
| $deflea = rand(0, 1) === 1; | ||
| $medicalTests = $health === "healthy" ? "basic: negative" : "blood: normal; xray: clear"; | ||
| $food = collect(["dry", "wet", "mixed"])->random(); | ||
| $behavioral = $data["species"] === "dog" ? "Spokojny w domu, energiczny na zewnątrz." : "Lubi drapaki i ciche otoczenie."; | ||
| $admission = now()->subDays(rand(7, 180)); | ||
| $city = collect(["Warsaw", "Krakow", "Gdansk", "Wroclaw", "Poznan"])->random(); | ||
| $adoptionUrl = "https://adopt.local/pets/" . Str::slug($data["name"] . " " . $data["breed"]); | ||
|
|
||
| $pet = Pet::create([ | ||
| "name" => $data["name"], | ||
| "adoption_url" => $adoptionUrl, | ||
| "species" => $data["species"], | ||
| "breed" => $data["breed"], | ||
| "sex" => $data["sex"], | ||
| "age" => $data["age"], | ||
| "size" => $data["size"], | ||
| "weight" => $data["weight"], | ||
| "color" => $data["color"], | ||
| "sterilized" => $sterilized, | ||
| "description" => $descBySpecies[$data["species"]] ?? "Przyjazny i towarzyski.", | ||
| "health_status" => $health, | ||
| "current_treatment" => $currentTreatment, | ||
| "vaccinated" => $vaccinated, | ||
| "has_chip" => $hasChip, | ||
| "chip_number" => $chip, | ||
| "dewormed" => $dewormed, | ||
| "deflea_treated" => $deflea, | ||
| "medical_tests" => $medicalTests, | ||
| "food_type" => $food, | ||
| "attitude_to_people" => "friendly", | ||
| "attitude_to_dogs" => "friendly", | ||
| "attitude_to_cats" => "neutral", | ||
| "attitude_to_children" => "gentle", | ||
| "activity_level" => collect(["low", "medium", "high"])->random(), | ||
| "behavioral_notes" => $behavioral, | ||
| "admission_date" => $admission, | ||
| "found_location" => $city, | ||
| "adoption_status" => $data["adoption_status"], | ||
| "shelter_id" => $shelters->random()->id, | ||
| "is_accepted" => true, | ||
| ]); | ||
|
|
||
| $tagIds = $tags->whereIn("name", $data["tags"])->pluck("id")->toArray(); | ||
|
|
||
| if (!empty($tagIds)) { | ||
| $pet->tags()->sync($tagIds); | ||
| } | ||
| } | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,20 @@ | ||
| import blumilkDefault from '@blumilksoftware/eslint-config' | ||
| import globals from 'globals' | ||
|
|
||
| export default [ | ||
| ...blumilkDefault, | ||
| { | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.es2022, | ||
| }, | ||
| }, | ||
| rules: { | ||
| 'n/no-unsupported-features/node-builtins': ['error', { | ||
| allowExperimental: true, | ||
| ignores: ['fetch', 'localStorage', 'sessionStorage', 'AbortController'], | ||
| }], | ||
| }, | ||
| }, | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function types