-
Notifications
You must be signed in to change notification settings - Fork 43
feat(profile): perfil público em /@username #512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GabrielFVDev
wants to merge
13
commits into
4.x
Choose a base branch
from
feature/public-profile
base: 4.x
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 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
343741c
feat(profile): implement public profile feature with routing and view…
GabrielFVDev bdc0fe6
feat(profile): enhance public profile layout and data handling
GabrielFVDev ddbb2d1
feat(profile): add about, links and resume sections to public profile
GabrielFVDev 6822d39
feat(profile): enhance public profile with gamification features and …
GabrielFVDev db6c36b
feat(profile): implement avatar initials fallback and enhance profile…
GabrielFVDev 3bd6e46
feat(profile): enhance public profile with experience details and mem…
GabrielFVDev 4818ba5
feat: Implement public profile projects feature
GabrielFVDev f634d4c
feat(profile): aplicar a variante Aurora no perfil público
GabrielFVDev 0a92cfd
Merge branch '4.x' into feature/public-profile
GabrielFVDev 5984725
feat(profile): implement public profile caching and SEO enhancements
GabrielFVDev 06eeb18
feat(profile): user photo and nickname is clicable
GabrielFVDev ae7ace0
feat(profile): implement profile card feature with dynamic loading an…
GabrielFVDev 1044c45
feat(profile): refactor user avatar handling and implement profile in…
GabrielFVDev 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
57 changes: 57 additions & 0 deletions
57
app-modules/identity/tests/Unit/ExternalIdentity/IdentityProviderProfileUrlTest.php
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,57 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| use He4rt\Identity\ExternalIdentity\Enums\IdentityProvider; | ||
|
|
||
| it('builds a profile url for the providers that have one', function (IdentityProvider $provider, string $expected): void { | ||
| expect($provider->profileUrl('danielhe4rt'))->toBe($expected); | ||
| })->with([ | ||
| 'github' => [IdentityProvider::GitHub, 'https://github.com/danielhe4rt'], | ||
| 'twitch' => [IdentityProvider::Twitch, 'https://twitch.tv/danielhe4rt'], | ||
| ]); | ||
|
|
||
| it('returns null for discord, which has no public profile page', function (): void { | ||
| expect(IdentityProvider::Discord->profileUrl('danielhe4rt'))->toBeNull(); | ||
| }); | ||
|
|
||
| it('returns null for providers outside the supported set', function (): void { | ||
| expect(IdentityProvider::Steam->profileUrl('danielhe4rt'))->toBeNull() | ||
| ->and(IdentityProvider::Spotify->profileUrl('danielhe4rt'))->toBeNull(); | ||
| }); | ||
|
|
||
| it('strips a leading @ and surrounding spaces from the handle', function (string $handle): void { | ||
| expect(IdentityProvider::GitHub->profileUrl($handle))->toBe('https://github.com/danielhe4rt'); | ||
| })->with([ | ||
| 'plain' => ['danielhe4rt'], | ||
| 'at prefixed' => ['@danielhe4rt'], | ||
| 'padded' => [' danielhe4rt '], | ||
| 'at prefixed and padded' => [' @danielhe4rt '], | ||
| ]); | ||
|
|
||
| it('passes an already absolute url through untouched', function (): void { | ||
| expect(IdentityProvider::GitHub->profileUrl('https://github.com/danielhe4rt')) | ||
| ->toBe('https://github.com/danielhe4rt'); | ||
| }); | ||
|
|
||
| it('returns null for an empty handle', function (?string $handle): void { | ||
| expect(IdentityProvider::GitHub->profileUrl($handle))->toBeNull(); | ||
| })->with([ | ||
| 'null' => [null], | ||
| 'empty' => [''], | ||
| 'only spaces' => [' '], | ||
| ]); | ||
|
|
||
| it('gives every supported provider a decided answer', function (): void { | ||
| $decided = [ | ||
| IdentityProvider::GitHub->value => 'https://github.com/handle', | ||
| IdentityProvider::Twitch->value => 'https://twitch.tv/handle', | ||
| IdentityProvider::DevTo->value => 'https://dev.to/handle', | ||
| IdentityProvider::Discord->value => null, | ||
| ]; | ||
|
|
||
| foreach (IdentityProvider::supportedProviders() as $provider) { | ||
| expect($decided)->toHaveKey($provider->value) | ||
| ->and($provider->profileUrl('handle'))->toBe($decided[$provider->value]); | ||
| } | ||
| }); |
27 changes: 27 additions & 0 deletions
27
app-modules/profile/database/factories/ProfileProjectFactory.php
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,27 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace He4rt\Profile\Database\Factories; | ||
|
|
||
| use He4rt\Profile\Models\Profile; | ||
| use He4rt\Profile\Models\ProfileProject; | ||
| use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
|
||
| /** | ||
| * @extends Factory<ProfileProject> | ||
| */ | ||
| final class ProfileProjectFactory extends Factory | ||
| { | ||
| protected $model = ProfileProject::class; | ||
|
|
||
| public function definition(): array | ||
| { | ||
| return [ | ||
| 'profile_id' => Profile::factory(), | ||
| 'name' => fake()->words(3, asText: true), | ||
| 'description' => fake()->sentence(), | ||
| 'url' => fake()->url(), | ||
| ]; | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
app-modules/profile/database/migrations/2026_08_22_002135_create_profile_projects_table.php
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,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::create('profile_projects', static function (Blueprint $table): void { | ||
| $table->uuid('id')->primary(); | ||
| $table->foreignUuid('profile_id')->constrained('user_profiles')->cascadeOnDelete(); | ||
| $table->string('name'); | ||
| $table->text('description')->nullable(); | ||
| $table->string('url')->nullable(); | ||
| $table->timestampsTz(); | ||
|
|
||
| $table->index(['profile_id', 'created_at']); | ||
| }); | ||
| } | ||
|
Comment on lines
+11
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/sh
set -eu
fd -a '^composer\.(json|lock)$' . -E vendor -x sh -c '
echo "== $1 =="
rg -n "\"laravel/framework\"|\"illuminate/database\"" "$1" || true
' sh {} \;
rg -n -C 2 'function down\s*\(' app-modules/profile/database/migrationsRepository: he4rt/heartdevs.com Length of output: 7309 Add
🤖 Prompt for AI Agents |
||
| }; | ||
50 changes: 50 additions & 0 deletions
50
app-modules/profile/resources/views/components/layout/guest.blade.php
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,50 @@ | ||
| @props ([ | ||
| 'title' => null, | ||
| 'description' => null, | ||
| 'image' => null, | ||
| 'type' => 'website', | ||
| ]) | ||
|
|
||
| @php | ||
| $pageTitle = ($title ? $title . ' - ' : '') . config('app.name'); | ||
| @endphp | ||
|
|
||
| <!DOCTYPE html> | ||
| <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <meta name="color-scheme" content="light dark" /> | ||
| <link rel="icon" href="{{ asset('favicon.ico') }}" /> | ||
| <title>{{ $pageTitle }}</title> | ||
|
|
||
| @if ($description) | ||
| <meta name="description" content="{{ $description }}" /> | ||
| @endif | ||
|
|
||
| <link rel="canonical" href="{{ url()->current() }}" /> | ||
| <meta property="og:site_name" content="{{ config('app.name') }}" /> | ||
| <meta property="og:type" content="{{ $type }}" /> | ||
| <meta property="og:url" content="{{ url()->current() }}" /> | ||
| <meta property="og:title" content="{{ $pageTitle }}" /> | ||
| <meta name="twitter:card" content="{{ $image ? 'summary_large_image' : 'summary' }}" /> | ||
|
|
||
| @if ($description) | ||
| <meta property="og:description" content="{{ $description }}" /> | ||
| @endif | ||
|
|
||
| @if ($image) | ||
| <meta property="og:image" content="{{ $image }}" /> | ||
| <meta property="og:image:alt" content="{{ $title }}" /> | ||
| @endif | ||
|
|
||
|
GabrielFVDev marked this conversation as resolved.
Outdated
|
||
| @vite (['app-modules/he4rt/resources/css/theme.css']) | ||
| @fluxAppearance | ||
| </head> | ||
| <body class="min-h-screen antialiased"> | ||
| <x-portal::navbar /> | ||
|
|
||
| {{ $slot }} | ||
| @fluxScripts | ||
| </body> | ||
| </html> | ||
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.
Uh oh!
There was an error while loading. Please reload this page.