Skip to content

Commit 8da207d

Browse files
committed
card fixes
1 parent 3a76c0f commit 8da207d

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

src/app/shared/card/card.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="flex flex-col w-full h-full bg-secondary-50 dark:bg-secondary-100 rounded-lg dark:border-secondary-100 border-secondary-50 border">
22

33

4-
<div (click)="goToProductDetails(productOff)" class="rounded overflow-hidden cursor-pointer">
4+
<div (click)="toggleDetailsModal();$event.stopPropagation();" class="rounded overflow-hidden cursor-pointer">
55
<div class="relative h-48 flex justify-center items-center">
66
<!-- Imagen de fondo difuminada -->
77
<!--<div class="absolute inset-0 bg-cover bg-center opacity-75" style="background-color: {{bgColor}};"></div>-->
@@ -39,7 +39,7 @@
3939
</a>
4040
}
4141
</div>
42-
<a (click)="goToProductDetails(productOff)" class="cursor-pointer">
42+
<a (click)="toggleDetailsModal();$event.stopPropagation();" class="cursor-pointer">
4343
<h5 class="text-xl font-semibold line-clamp-2 tracking-tight text-primary-100 dark:text-white text-wrap break-all">{{productOff?.name}}</h5>
4444
</a>
4545
<markdown class="min-h-19 h-19 line-clamp-2 text-gray-600 dark:text-gray-400" [data]="productOff?.description"></markdown>

src/app/shared/card/card.component.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export class CardComponent implements OnInit, AfterViewInit {
8383

8484
errorMessage:any='';
8585
showError:boolean=false;
86-
orgInfo:any=undefined;
8786

8887
selectedPricePlanId: string | null = null;
8988
selectedPricePlan:any = null;
@@ -97,9 +96,7 @@ export class CardComponent implements OnInit, AfterViewInit {
9796
private readonly eventMessage: EventMessageService,
9897
private readonly api: ApiServiceService,
9998
private readonly priceService: PriceServiceService,
100-
private readonly cartService: ShoppingCartServiceService,
101-
private readonly accService: AccountServiceService,
102-
private readonly router: Router
99+
private readonly cartService: ShoppingCartServiceService
103100
) {
104101
this.targetModal = document.getElementById('details-modal');
105102
this.modal = new Modal(this.targetModal);
@@ -198,7 +195,6 @@ export class CardComponent implements OnInit, AfterViewInit {
198195
if(specId != undefined){
199196
this.api.getProductSpecification(specId).then(spec => {
200197
this.prodSpec = spec;
201-
this.getOwner();
202198
})
203199
}
204200

@@ -386,30 +382,6 @@ async deleteProduct(product: Product | undefined){
386382
this.cdr.detectChanges();
387383
}
388384

389-
goToProductDetails(productOff:Product| undefined) {
390-
document.querySelector("body > div[modal-backdrop]")?.remove()
391-
this.router.navigate(['/search', productOff?.id]);
392-
}
393-
394-
goToOrgDetails(id:any) {
395-
document.querySelector("body > div[modal-backdrop]")?.remove()
396-
this.router.navigate(['/org-details', id]);
397-
}
398-
399-
getOwner(){
400-
let parties = this.prodSpec?.relatedParty;
401-
if(parties)
402-
for(let i=0; i<parties.length;i++){
403-
if(parties[i].role=='Owner'){
404-
if(parties[i].id.includes('organization')){
405-
this.accService.getOrgInfo(parties[i].id).then(org => {
406-
this.orgInfo=org;
407-
})
408-
}
409-
}
410-
}
411-
}
412-
413385
onPricePlanSelected(pricePlan:any) {
414386
this.selectedPricePlanId = pricePlan.id;
415387
this.selectedPricePlan = pricePlan;

0 commit comments

Comments
 (0)