feat : bump 1.0.0 => 1.1.0

This commit is contained in:
styve Lioumba
2025-12-03 16:43:45 +01:00
parent 45b4dd1dad
commit 735afc1d4a
8 changed files with 143 additions and 80 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "trouve-ton-profile", "name": "trouve-ton-profile",
"version": "1.0.0", "version": "1.1.0",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "bash replace-prod-env.sh src/environments/environment.development.ts $ENV_URL && ng serve", "start": "bash replace-prod-env.sh src/environments/environment.development.ts $ENV_URL && ng serve",

View File

@@ -55,9 +55,9 @@ describe('AppComponent', () => {
expect(app).toBeTruthy(); expect(app).toBeTruthy();
}); });
it(`should have the 'TrouveTonProfile' title`, () => { it(`should have the 'TrouveTonProfil' title`, () => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance; const app = fixture.componentInstance;
expect(app.title).toEqual('TrouveTonProfile'); expect(app.title).toEqual('TrouveTonProfil');
}); });
}); });

View File

@@ -13,6 +13,6 @@ import { ThemeService } from '@app/core/services/theme/theme.service';
styleUrl: './app.component.scss', styleUrl: './app.component.scss',
}) })
export class AppComponent { export class AppComponent {
title = 'TrouveTonProfile'; title = 'TrouveTonProfil';
themeService = inject(ThemeService); themeService = inject(ThemeService);
} }

View File

@@ -12,7 +12,7 @@ export class PbProfileRepository implements ProfileRepository {
private pb = new PocketBase(environment.baseUrl); private pb = new PocketBase(environment.baseUrl);
private defaultOptions = { private defaultOptions = {
expand: 'utilisateur', expand: 'utilisateur,secteur',
}; };
list(params?: SearchFilters): Observable<ProfilePaginated> { list(params?: SearchFilters): Observable<ProfilePaginated> {
@@ -53,7 +53,7 @@ export class PbProfileRepository implements ProfileRepository {
if (params) { if (params) {
if (params.secteur) { if (params.secteur) {
filters.push(`secteur ~ '${params.secteur}'`); filters.push(`secteur.nom ~ '${params.secteur}'`);
} }
if (params.profession) { if (params.profession) {

View File

@@ -17,7 +17,7 @@
<span <span
class="text-xl sm:text-2xl font-semibold text-gray-900 dark:text-white group-hover:text-indigo-600 dark:group-hover:text-indigo-400 transition-colors" class="text-xl sm:text-2xl font-semibold text-gray-900 dark:text-white group-hover:text-indigo-600 dark:group-hover:text-indigo-400 transition-colors"
> >
TrouveTonProfile TrouveTonProfil
</span> </span>
</a> </a>
@@ -120,7 +120,7 @@
<!-- Copyright (optionnel) --> <!-- Copyright (optionnel) -->
<div class="pt-6 border-t border-gray-200 dark:border-gray-800"> <div class="pt-6 border-t border-gray-200 dark:border-gray-800">
<p class="text-center text-xs sm:text-sm text-gray-500 dark:text-gray-500"> <p class="text-center text-xs sm:text-sm text-gray-500 dark:text-gray-500">
© {{ currentYear }} TrouveTonProfile. Tous droits réservés. © {{ currentYear }} TrouveTonProfil. Tous droits réservés.
</p> </p>
</div> </div>
</div> </div>

View File

@@ -17,37 +17,7 @@
</a> </a>
<!-- Actions utilisateur --> <!-- Actions utilisateur -->
<div class="flex items-center gap-2 sm:gap-3"> <div class="flex items-center gap-2 sm:gap-4">
<!-- Avatar utilisateur (si connecté) -->
@if (isAuthenticated() && isEmailVerified() && user()) {
<a
[routerLink]="['my-profile']"
[state]="{ user: user() }"
class="w-9 h-9 sm:w-10 sm:h-10 rounded-full overflow-hidden bg-gray-200 border-2 border-transparent hover:border-indigo-500 dark:hover:border-indigo-400 transition-all ring-2 ring-transparent hover:ring-2 hover:ring-indigo-200 dark:hover:ring-indigo-900"
aria-label="Mon profil"
>
@if (user()!.avatar) {
<img
[alt]="user()!.username"
class="object-cover w-full h-full"
[src]="
environment.baseUrl + '/api/files/users/' + user()!.id + '/' + user()!.avatar
"
loading="lazy"
/>
} @else {
<img
[alt]="user()!.username"
class="object-cover w-full h-full"
src="https://api.dicebear.com/9.x/initials/svg?seed={{
user()!.name ? user()!.name : user()!.username ? user()!.username : user()!.email
}}"
loading="lazy"
/>
}
</a>
}
<!-- Toggle thème --> <!-- Toggle thème -->
<button <button
type="button" type="button"
@@ -88,51 +58,128 @@
} }
</button> </button>
<!-- Séparateur -->
<div class="h-6 w-px bg-gray-300 dark:bg-gray-700"></div>
<!-- Bouton de connexion/déconnexion -->
@if (isAuthenticated() && isEmailVerified()) { @if (isAuthenticated() && isEmailVerified()) {
<a <!-- Menu utilisateur connecté -->
[routerLink]="['/auth']" <div class="flex items-center gap-2">
(click)="authFacade.logout()" <!-- Lien Mon Profil - visible sur desktop -->
class="flex items-center gap-2 px-3 py-2 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors" <a
aria-label="Se déconnecter" [routerLink]="['my-profile']"
> [state]="{ user: user() }"
<svg class="hidden sm:flex items-center gap-2 px-4 py-2 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors font-medium"
xmlns="http://www.w3.org/2000/svg" aria-label="Mon profil"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-5 h-5"
> >
<path <svg
stroke-linecap="round" xmlns="http://www.w3.org/2000/svg"
stroke-linejoin="round" fill="none"
d="M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15M12 9l-3 3m0 0 3 3m-3-3h12.75" viewBox="0 0 24 24"
/> stroke-width="1.5"
</svg> stroke="currentColor"
<span class="hidden sm:inline text-sm font-medium">Déconnexion</span> class="w-5 h-5"
</a> >
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"
/>
</svg>
<span class="text-sm">Mon Profil</span>
</a>
<!-- Icône Mon Profil - visible sur mobile uniquement -->
<a
[routerLink]="['my-profile']"
[state]="{ user: user() }"
class="sm:hidden p-2 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
aria-label="Mon profil"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-5 h-5"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"
/>
</svg>
</a>
<!-- Séparateur (desktop seulement) -->
<div class="hidden sm:block h-6 w-px bg-gray-300 dark:bg-gray-700"></div>
<!-- Bouton Déconnexion - version desktop -->
<a
[routerLink]="['/auth']"
(click)="authFacade.logout()"
class="hidden sm:flex items-center gap-2 px-4 py-2 rounded-lg bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors font-medium border border-red-200 dark:border-red-800"
aria-label="Se déconnecter"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-5 h-5"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15M12 9l-3 3m0 0 3 3m-3-3h12.75"
/>
</svg>
<span class="text-sm">Déconnexion</span>
</a>
<!-- Icône Déconnexion - version mobile -->
<a
[routerLink]="['/auth']"
(click)="authFacade.logout()"
class="sm:hidden p-2 rounded-lg bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors border border-red-200 dark:border-red-800"
aria-label="Se déconnecter"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-5 h-5"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15M12 9l-3 3m0 0 3 3m-3-3h12.75"
/>
</svg>
</a>
</div>
} @else { } @else {
<a <!-- Boutons pour utilisateur non connecté -->
[routerLink]="['/auth']" <div class="flex items-center gap-2">
class="flex items-center gap-2 px-3 py-2 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors" <!-- Bouton Connexion mis en valeur -->
aria-label="Se connecter" <a
> [routerLink]="['/auth']"
<svg class="flex items-center gap-2 px-4 py-2 rounded-lg bg-indigo-600 dark:bg-indigo-500 text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 transition-colors font-medium shadow-md hover:shadow-lg"
xmlns="http://www.w3.org/2000/svg" aria-label="Se connecter"
viewBox="0 -960 960 960"
fill="currentColor"
class="w-5 h-5"
> >
<path <svg
d="M234-276q51-39 114-61.5T480-360q69 0 132 22.5T726-276q35-41 54.5-93T800-480q0-133-93.5-226.5T480-800q-133 0-226.5 93.5T160-480q0 59 19.5 111t54.5 93Zm246-164q-59 0-99.5-40.5T340-580q0-59 40.5-99.5T480-720q59 0 99.5 40.5T620-580q0 59-40.5 99.5T480-440Zm0 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q53 0 100-15.5t86-44.5q-39-29-86-44.5T480-280q-53 0-100 15.5T294-220q39 29 86 44.5T480-160Zm0-360q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm0-60Zm0 360Z" xmlns="http://www.w3.org/2000/svg"
/> viewBox="0 -960 960 960"
</svg> fill="currentColor"
<span class="hidden sm:inline text-sm font-medium">Connexion</span> class="w-5 h-5"
</a> >
<path
d="M234-276q51-39 114-61.5T480-360q69 0 132 22.5T726-276q35-41 54.5-93T800-480q0-133-93.5-226.5T480-800q-133 0-226.5 93.5T160-480q0 59 19.5 111t54.5 93Zm246-164q-59 0-99.5-40.5T340-580q0-59 40.5-99.5T480-720q59 0 99.5 40.5T620-580q0 59-40.5 99.5T480-440Zm0 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q53 0 100-15.5t86-44.5q-39-29-86-44.5T480-280q-53 0-100 15.5T294-220q39 29 86 44.5T480-160Zm0-360q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm0-60Zm0 360Z"
/>
</svg>
<span class="text-sm">Connexion</span>
</a>
</div>
} }
</div> </div>
</div> </div>

View File

@@ -55,6 +55,7 @@ export class FilterComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.sectorFacade.load(); this.sectorFacade.load();
this.profileFacade.load(); this.profileFacade.load();
this.initFormValues();
} }
// Vérifier si des filtres sont actifs pour afficher le bouton "Effacer" // Vérifier si des filtres sont actifs pour afficher le bouton "Effacer"
@@ -65,5 +66,19 @@ export class FilterComponent implements OnInit {
clearAllFilters(): void { clearAllFilters(): void {
this.searchService.reset(); this.searchService.reset();
this.onFilterChange.emit(this.activeFilters());
this.initFormValues();
}
private initFormValues() {
const filters = this.searchService.getFilters();
this.activeFilters.set(filters());
this.filterForm.setValue({
verified: this.activeFilters().verified,
secteur: this.activeFilters().secteur,
profession: this.activeFilters().profession,
sort: this.activeFilters().sort || 'recent',
});
} }
} }

View File

@@ -85,6 +85,7 @@ export class AuthFacade {
logout() { logout() {
this.logoutUseCase.execute(); this.logoutUseCase.execute();
this.isAuthenticated.set(false);
this.getCurrentUser(); this.getCurrentUser();
} }