diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 6ccca4793..7fc5680ff 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -2,13 +2,24 @@ namespace App\Http\Controllers; -use Spatie\Activitylog\Models\Activity; +use App\Models\Project; class ProjectController extends Controller { - public function environments() + public function all() { - $project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first(); + $team_id = session('currentTeam')->id; + + $projects = Project::where('team_id', $team_id)->get(); + return view('projects', ['projects' => $projects]); + } + + public function show() + { + $project_uuid = request()->route('project_uuid'); + $team_id = session('currentTeam')->id; + + $project = Project::where('team_id', $team_id)->where('uuid', $project_uuid)->first(); if (!$project) { return redirect()->route('dashboard'); } @@ -16,7 +27,7 @@ public function environments() if (count($project->environments) == 1) { return redirect()->route('project.resources', ['project_uuid' => $project->uuid, 'environment_name' => $project->environments->first()->name]); } - return view('project.environments', ['project' => $project]); + return view('project.show', ['project' => $project]); } public function new() diff --git a/app/Http/Livewire/Project/New/EmptyProject.php b/app/Http/Livewire/Project/New/EmptyProject.php index 6763fa4ab..c5a4c36ea 100644 --- a/app/Http/Livewire/Project/New/EmptyProject.php +++ b/app/Http/Livewire/Project/New/EmptyProject.php @@ -13,6 +13,6 @@ public function createEmptyProject() 'name' => generateRandomName(), 'team_id' => session('currentTeam')->id, ]); - return redirect()->route('project.environments', ['project_uuid' => $project->uuid, 'environment_name' => 'production']); + return redirect()->route('project.show', ['project_uuid' => $project->uuid, 'environment_name' => 'production']); } } diff --git a/composer.json b/composer.json index e9eaf4d6a..437e04e77 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,10 @@ "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], + "keywords": [ + "framework", + "laravel" + ], "license": "MIT", "require": { "php": "^8.2", @@ -84,4 +87,4 @@ }, "minimum-stability": "stable", "prefer-stable": true -} +} \ No newline at end of file diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index b0fc53227..c488fb4f3 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -18,7 +18,6 @@ class UserFactory extends Factory public function definition(): array { return [ - 'name' => fake()->name(), 'uuid' => Str::uuid(), 'email' => fake()->unique()->safeEmail(), 'email_verified_at' => now(), diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 9acafc53c..ff7a7e716 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -15,7 +15,7 @@ public function up(): void $table->id(); $table->string('uuid')->unique(); $table->boolean('is_root_user')->default(false); - $table->string('name'); + $table->string('name')->default('Your Name Here'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php index 85760830d..3cc459fe1 100644 --- a/database/seeders/UserSeeder.php +++ b/database/seeders/UserSeeder.php @@ -11,12 +11,10 @@ public function run(): void { User::factory()->create([ "id" => 0, - 'name' => 'Root User', 'email' => 'test@example.com', 'is_root_user' => true, ]); User::factory()->create([ - 'name' => 'Normal User', 'email' => 'test2@example.com', ]); } diff --git a/resources/css/app.css b/resources/css/app.css index 202fe1ab3..f7983c87a 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -13,10 +13,10 @@ body { @apply bg-coolgray-100 text-neutral-400 min-h-full antialiased; } input[type="checkbox"] { - @apply toggle toggle-warning toggle-sm; + @apply toggle toggle-warning toggle-xs rounded; } input { - @apply input input-sm placeholder:text-neutral-700 text-white; + @apply input input-sm placeholder:text-neutral-700 text-white rounded-none; } input[type="text"],[type="number"],[type="email"],[type="password"] { @apply read-only:opacity-40; @@ -26,17 +26,17 @@ .label-text, label { } textarea { - @apply textarea placeholder:text-neutral-700 text-white; + @apply textarea placeholder:text-neutral-700 text-white rounded-none; } select { - @apply select select-sm disabled:opacity-40 font-normal placeholder:text-neutral-700 text-white; + @apply select select-sm disabled:opacity-40 font-normal placeholder:text-neutral-700 text-white rounded-none; } button[type="button"] { - @apply btn btn-xs btn-ghost no-animation normal-case text-white; + @apply btn btn-xs btn-ghost no-animation normal-case text-white rounded; } button[type="submit"] { - @apply btn btn-xs no-animation normal-case text-white btn-primary; + @apply btn btn-xs no-animation normal-case text-white btn-primary rounded; } button[isWarning] { @apply text-error; @@ -57,8 +57,20 @@ a { @apply text-neutral-400 hover:text-white text-sm link link-hover hover:bg-transparent; } +main { + @apply h-full w-full min-h-screen px-32 xl:px-10 pt-4 mx-auto max-w-7xl; +} +.main-navbar { + @apply fixed top-0 left-0 min-h-screen overflow-hidden; +} +.icon { + @apply w-6 h-6; +} +.icon:hover { + @apply text-white; +} .box { - @apply flex items-center justify-center text-sm rounded cursor-pointer h-14 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white p-2 hover:no-underline; + @apply flex items-center justify-center text-sm rounded cursor-pointer h-14 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white p-2 hover:no-underline transition-colors; } .main-menu { @@ -66,17 +78,20 @@ .main-menu { } .main-menu:after { content: "/"; - @apply absolute border border-dotted rounded border-neutral-600 right-0 top-0 text-warning mx-1 px-2 mt-[0.7rem]; + @apply absolute border border-dotted rounded border-neutral-600 right-0 top-0 text-warning mx-1 px-2 mt-[0.3rem] text-sm; +} +.magic-badge { + @apply min-w-fit px-2 rounded text-center border border-dotted border-primary text-white text-xs; } .magic-input { - @apply input w-96 placeholder:text-neutral-700 text-sm; + @apply input input-sm w-96 placeholder:text-neutral-700 text-sm rounded-none; } .magic-items { - @apply absolute top-16 mt-2 w-[24rem] bg-coolgray-200 rounded-xl outline outline-coolgray-500; + @apply absolute top-12 mt-2 w-[24rem] bg-coolgray-200 rounded z-50; } .magic-item { - @apply text-sm flex items-center gap-4 m-2 py-2 pl-4 cursor-pointer hover:bg-coolgray-500 text-neutral-400 hover:text-white rounded-xl transition-colors hover:shadow; + @apply text-sm flex items-center gap-4 m-2 py-2 pl-4 cursor-pointer hover:bg-coolgray-500 text-neutral-400 hover:text-white transition-colors hover:shadow; } .magic-item-focused { - @apply bg-neutral-700 text-white; + @apply bg-coolgray-400 text-white; } diff --git a/resources/views/components/applications/navbar.blade.php b/resources/views/components/applications/navbar.blade.php index 553f64160..8b85decea 100644 --- a/resources/views/components/applications/navbar.blade.php +++ b/resources/views/components/applications/navbar.blade.php @@ -1,5 +1,5 @@ diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index 7b494df43..d25f87392 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -25,16 +25,18 @@ - @livewireScripts @auth @endauth -
+
+
+ +
{{ $slot }}
v{{ config('version') }} + class="fixed text-xs cursor-pointer right-2 bottom-1 opacity-60 hover:opacity-100 hover:text-white">v{{ config('version') }} @auth