Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,9 @@ class="inline-flex items-center gap-1 rounded-full bg-green-50 px-2 py-0.5 text-
'bg-green-50 text-green-700 dark:bg-green-500/10 dark:text-green-400' =>
$seniority === \He4rt\Profile\Enums\SeniorityLevel::Junior,
'bg-blue-50 text-blue-700 dark:bg-blue-500/10 dark:text-blue-400' =>
$seniority === \He4rt\Profile\Enums\SeniorityLevel::Mid,
$seniority === \He4rt\Profile\Enums\SeniorityLevel::Pleno,
'bg-purple-50 text-purple-700 dark:bg-purple-500/10 dark:text-purple-400' =>
$seniority === \He4rt\Profile\Enums\SeniorityLevel::Senior,
'bg-amber-50 text-amber-700 dark:bg-amber-500/10 dark:text-amber-400' =>
$seniority === \He4rt\Profile\Enums\SeniorityLevel::Specialist,
'bg-red-50 text-red-700 dark:bg-red-500/10 dark:text-red-400' =>
$seniority === \He4rt\Profile\Enums\SeniorityLevel::Lead
$seniority === \He4rt\Profile\Enums\SeniorityLevel::Senior
])
>
{{ $seniority->getLabel() }}
Expand Down
8 changes: 4 additions & 4 deletions app-modules/panel-app/tests/Feature/ProfilePageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
test('profile page loads existing profile data', function (): void {
$this->profile->update([
'headline' => 'Backend Developer',
'seniority_level' => SeniorityLevel::Mid,
'seniority_level' => SeniorityLevel::Pleno,
]);

livewire(ProfilePage::class)
->assertOk()
->assertSchemaStateSet([
'headline' => 'Backend Developer',
'seniority_level' => SeniorityLevel::Mid,
'seniority_level' => SeniorityLevel::Pleno,
]);
});

Expand All @@ -52,7 +52,7 @@
->set('data.nickname', 'Dan')
->fillForm([
'headline' => 'Backend Developer',
'seniority_level' => 'mid',
'seniority_level' => 'pleno',
'years_experience' => 5,
'about' => 'Dev PHP apaixonado por Laravel',
])
Expand All @@ -63,7 +63,7 @@

expect($this->profile->nickname)->toBe('Dan')
->and($this->profile->headline)->toBe('Backend Developer')
->and($this->profile->seniority_level)->toBe(SeniorityLevel::Mid)
->and($this->profile->seniority_level)->toBe(SeniorityLevel::Pleno)
->and($this->profile->years_experience)->toBe(5)
->and($this->profile->about)->toBe('Dev PHP apaixonado por Laravel');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<link rel="icon" href="{{ asset('favicon.ico') }}" />
<title>{{ $title ? $title . ' - ' : '' }}{{ config('app.name') }}</title>
@vite (['app-modules/he4rt/resources/css/theme.css'])
@stack ('styles')
@fluxAppearance
</head>
<body class="min-h-screen antialiased">
Expand Down
13 changes: 13 additions & 0 deletions app-modules/profile/database/factories/ProfileFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public function definition(): array
'social_links' => null,
'available_for_proposals' => false,
'start_availability' => null,
'skills' => null,
'work_types' => null,
'languages' => null,
];
}

Expand All @@ -51,6 +54,16 @@ public function complete(): self
],
'available_for_proposals' => true,
'start_availability' => fake()->randomElement(StartAvailability::cases()),
'skills' => [
['name' => 'PHP', 'category' => 'languages_frameworks'],
['name' => 'Laravel', 'category' => 'languages_frameworks'],
['name' => 'PostgreSQL', 'category' => 'infra_databases'],
['name' => 'Docker', 'category' => 'infra_databases'],
],
'work_types' => ['immediate', 'remote'],
'languages' => [
['name' => 'Português', 'level' => 'Nativo'],
],
]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up(): void
{
Schema::table('user_profiles', function (Blueprint $table): void {
$table->jsonb('skills')->nullable()->after('start_availability');
});
}

public function down(): void
{
Schema::table('user_profiles', function (Blueprint $table): void {
$table->dropColumn('skills');
});
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up(): void
{
Schema::table('user_profiles', function (Blueprint $table): void {
$table->jsonb('work_types')->nullable()->after('available_for_proposals');
});
}

public function down(): void
{
Schema::table('user_profiles', function (Blueprint $table): void {
$table->dropColumn('work_types');
});
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up(): void
{
Schema::table('user_profiles', function (Blueprint $table): void {
$table->jsonb('languages')->nullable()->after('work_types');
});
}

public function down(): void
{
Schema::table('user_profiles', function (Blueprint $table): void {
$table->dropColumn('languages');
});
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up(): void
{
Schema::create('user_projects', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->foreignUuid('user_id')->constrained('users')->cascadeOnDelete();
$table->foreignUuid('tenant_id')->constrained('tenants')->cascadeOnDelete();
$table->string('name');
$table->text('description')->nullable();
$table->string('url')->nullable();
$table->jsonb('tags')->nullable();
$table->unsignedInteger('stars')->nullable();
$table->unsignedInteger('forks')->nullable();
$table->unsignedInteger('sort_order')->default(0);
$table->timestamps();

$table->index(['user_id', 'tenant_id']);
});
}

public function down(): void
{
Schema::dropIfExists('user_projects');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up(): void
{
Schema::create('user_pull_requests', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->foreignUuid('user_id')->constrained('users')->cascadeOnDelete();
$table->foreignUuid('tenant_id')->constrained('tenants')->cascadeOnDelete();
$table->string('title');
$table->string('repo');
$table->enum('status', ['open', 'merged', 'closed']);
$table->unsignedInteger('number');
$table->string('url')->nullable();
$table->timestamp('pr_created_at')->nullable();
$table->unsignedInteger('sort_order')->default(0);
$table->timestamps();

$table->index(['user_id', 'tenant_id']);
});
}

public function down(): void
{
Schema::dropIfExists('user_pull_requests');
}
};
26 changes: 18 additions & 8 deletions app-modules/profile/lang/en/enums.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
return [
'seniority_level' => [
'junior' => 'Junior',
'mid' => 'Mid-Level',
'pleno' => 'Pleno',
'senior' => 'Senior',
'specialist' => 'Specialist',
'lead' => 'Lead',
],

'social_platform' => [
Expand All @@ -17,15 +15,27 @@
'website' => 'Website',
'youtube' => 'YouTube',
'bluesky' => 'Bluesky',
'whatsapp' => 'WhatsApp',
'linkedin' => 'LinkedIn',
'github' => 'GitHub',
'devto' => 'Dev.to',
],

'start_availability' => [
'immediate' => 'Immediate',
'1_week' => '1 Week',
'2_weeks' => '2 Weeks',
'3_weeks' => '3 Weeks',
'1_month' => '1 Month',
'2_months' => '2 Months',
'1_week' => '1 week',
'2_weeks' => '2 weeks',
'3_weeks' => '3 weeks',
'1_month' => '1 month',
'2_months' => '2 months',
'negotiable' => 'Negotiable',
],

'work_type' => [
'immediate' => 'Immediate start',
'remote' => 'Remote',
'clt' => 'CLT',
'pj' => 'PJ',
'freelance' => 'Freelance',
],
];
16 changes: 13 additions & 3 deletions app-modules/profile/lang/pt_BR/enums.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
return [
'seniority_level' => [
'junior' => 'Júnior',
'mid' => 'Pleno',
'pleno' => 'Pleno',
'senior' => 'Sênior',
'specialist' => 'Especialista',
'lead' => 'Lead',
],

'social_platform' => [
Expand All @@ -17,6 +15,10 @@
'website' => 'Website',
'youtube' => 'YouTube',
'bluesky' => 'Bluesky',
'whatsapp' => 'WhatsApp',
'linkedin' => 'LinkedIn',
'github' => 'GitHub',
'devto' => 'Dev.to',
],

'start_availability' => [
Expand All @@ -28,4 +30,12 @@
'2_months' => '2 meses',
'negotiable' => 'Negociável',
],

'work_type' => [
'immediate' => 'Início imediato',
'remote' => 'Remoto',
'clt' => 'CLT',
'pj' => 'PJ',
'freelance' => 'Freelance',
],
];
Loading