feat: Add Health Check Endpoint
This commit is contained in:
parent
326b9c8ec1
commit
fb9a9dfba2
@ -7,11 +7,13 @@
|
||||
<h4 class="mb-1">Profil Marchand</h4>
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb mb-0">
|
||||
@if(isHubUser){
|
||||
<li class="breadcrumb-item">
|
||||
<a href="javascript:void(0)" (click)="goBack()" class="text-decoration-none cursor-pointer">
|
||||
Marchands
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
<li class="breadcrumb-item active" aria-current="page">
|
||||
{{ merchant?.name || 'Chargement...' }}
|
||||
</li>
|
||||
@ -29,7 +31,7 @@
|
||||
<ng-icon name="lucideRefreshCw" class="me-1" [class.spin]="loading"></ng-icon>
|
||||
Actualiser
|
||||
</button>
|
||||
|
||||
@if(isHubUser){
|
||||
<!-- Bouton retour -->
|
||||
<button
|
||||
class="btn btn-outline-secondary"
|
||||
@ -38,6 +40,7 @@
|
||||
<ng-icon name="lucideArrowLeft" class="me-1"></ng-icon>
|
||||
Retour
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -21,7 +21,7 @@ import { MerchantConfigService } from '../merchant-config.service';
|
||||
import { MerchantDataAdapter } from '../merchant-data-adapter.service';
|
||||
import { RoleManagementService } from '@core/services/hub-users-roles-management.service';
|
||||
import { AuthService } from '@core/services/auth.service';
|
||||
import { UserRole } from '@core/models/dcb-bo-hub-user.model';
|
||||
import { UserRole, UserType } from '@core/models/dcb-bo-hub-user.model';
|
||||
import { MinioService } from '@core/services/minio.service';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
@ -218,6 +218,9 @@ export class MerchantConfigView implements OnInit, OnDestroy {
|
||||
// Gestion des permissions
|
||||
currentUserRole: UserRole | null = null;
|
||||
currentMerchantPartnerId: string = '';
|
||||
// Déterminer le type d'utilisateur
|
||||
isMerchantUser = false;
|
||||
isHubUser = false;
|
||||
|
||||
// Édition des configurations
|
||||
editingConfigId: number | null = null;
|
||||
@ -470,6 +473,18 @@ export class MerchantConfigView implements OnInit, OnDestroy {
|
||||
.subscribe({
|
||||
next: (profile) => {
|
||||
this.currentUserRole = this.authService.getCurrentUserRole();
|
||||
// Déterminer si c'est un utilisateur marchand
|
||||
if (this.currentUserRole === UserRole.DCB_PARTNER_ADMIN ||
|
||||
this.currentUserRole === UserRole.DCB_PARTNER_MANAGER ||
|
||||
this.currentUserRole === UserRole.DCB_PARTNER_SUPPORT ||
|
||||
this.currentUserRole === UserRole.MERCHANT_CONFIG_MANAGER ||
|
||||
this.currentUserRole === UserRole.MERCHANT_CONFIG_TECHNICAL ||
|
||||
this.currentUserRole === UserRole.MERCHANT_CONFIG_VIEWER) {
|
||||
this.isMerchantUser = true;
|
||||
} else {
|
||||
this.isHubUser = profile?.userType === UserType.HUB;
|
||||
this.isMerchantUser = profile?.userType === UserType.MERCHANT_PARTNER;
|
||||
}
|
||||
this.cdRef.detectChanges();
|
||||
},
|
||||
error: (error) => {
|
||||
|
||||
@ -88,7 +88,7 @@ export class MerchantConfigManagement implements OnInit, OnDestroy {
|
||||
logoChanged = false;
|
||||
|
||||
// État de l'interface
|
||||
activeTab: 'list' | 'merchant-profile' = 'list';
|
||||
activeTab: 'list' | 'merchant-profile' = 'merchant-profile';
|
||||
selectedMerchantId: number | null = null;
|
||||
selectedConfigId: number | null = null;
|
||||
selectedUserId: string | null = null;
|
||||
@ -256,8 +256,6 @@ export class MerchantConfigManagement implements OnInit, OnDestroy {
|
||||
}
|
||||
} else {
|
||||
console.warn('No merchant found for current user');
|
||||
// Si aucun marchand trouvé, revenir à la liste
|
||||
this.activeTab = 'list';
|
||||
}
|
||||
|
||||
this.loadingUserMerchant = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user