Skip to content

Commit 35c52bb

Browse files
committed
sonnar fixes
1 parent e73c4df commit 35c52bb

File tree

6 files changed

+13
-29
lines changed

6 files changed

+13
-29
lines changed

src/app/pages/product-details/product-details.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="details-modal" tabindex="-1" aria-hidden="true" class="flex justify-center overflow-x-hidden fixed top-0 right-0 left-0 z-40 justify-center items-center w-full md:inset-0 h-full max-h-full rounded-lg shadow-2xl">
2-
<div class="relative w-full max-w-7xl max-h-full rounded-t-lg" (click)="$event.stopPropagation();">
2+
<div class="relative w-full max-w-7xl max-h-full rounded-t-lg" (click)="$event.stopPropagation();" (keydown)="$event.stopPropagation();">
33
<!-- Modal content -->
44
<div class="relative sm:m-8 bg-white rounded-lg shadow dark:border-gray-600 dark:bg-secondary-100 bg-cover bg-right-bottom rounded-lg overflow-y-auto max-h-[calc(100vh-10rem)]">
55
<button (click)="hideModal();" type="button" class="absolute top-4 right-4 z-50 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white" data-modal-hide="details-modal">
@@ -40,7 +40,7 @@ <h5 class="md:text-3xl lg:text-4xl font-semibold tracking-tight text-primary-100
4040

4141
<div class="relative h-[200px] overflow-hidden flex justify-center items-center border border-1 border-gray-200 dark:border-gray-700 rounded-tr-lg">
4242
<div class="absolute inset-0 bg-cover bg-center opacity-75" [style.background-image]="'url(' + getProductImage() + ')'" [style.filter]="'blur(20px)'"></div>
43-
<img class="rounded-r-lg h-5/6 w-5/6 object-contain z-10 dark:text-white" src="{{getProductImage()}}" alt="Product image" />
43+
<img class="rounded-r-lg h-5/6 w-5/6 object-contain z-10 dark:text-white" src="{{getProductImage()}}" alt="Product" />
4444
</div>
4545

4646
<hr class="h-px border-gray-200 border-1 dark:border-gray-700">

src/app/pages/product-details/product-details.component.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type AttachmentRefOrValue = components["schemas"]["AttachmentRefOrValue"];
2222
})
2323
export class ProductDetailsComponent implements OnInit {
2424
@Input() productOff: Product | undefined;
25-
@Output() close = new EventEmitter<void>();
25+
@Output() closeModal = new EventEmitter<void>();
2626

2727
protected readonly faClose = faClose;
2828
protected readonly faEllipsis = faEllipsis;
@@ -57,16 +57,14 @@ export class ProductDetailsComponent implements OnInit {
5757
} else {
5858
this.images = profile;
5959
}
60-
let specId:any|undefined=this.productOff?.productSpecification?.id;
60+
let specId = this.productOff?.productSpecification?.id;
6161
if(specId != undefined){
6262
this.api.getProductSpecification(specId).then(spec => {
6363
this.prodSpec = spec;
6464
let prodPrices: any[] | undefined= this.productOff?.productOfferingPrice;
65-
let prices: any[]=[];
6665
if(prodPrices!== undefined){
6766
for(const element of prodPrices){
6867
this.api.getProductPrice(element.id).then(price => {
69-
prices.push(price);
7068
if(price.priceType == 'custom'){
7169
this.checkCustom=true;
7270
}
@@ -104,7 +102,7 @@ export class ProductDetailsComponent implements OnInit {
104102
}
105103

106104
hideModal() {
107-
this.close.emit();
105+
this.closeModal.emit();
108106
this.loadMoreCats=false;
109107
this.checkMoreCats=true;
110108
}

src/app/services/product-service.service.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
import { HttpClient, HttpHeaders } from '@angular/common/http';
1+
import { HttpClient } from '@angular/common/http';
22
import { Injectable } from '@angular/core';
3-
import {catchError, lastValueFrom, map, of} from 'rxjs';
4-
import { Category, LoginInfo } from '../models/interfaces';
3+
import {catchError, lastValueFrom,of} from 'rxjs';
4+
import { Category } from '../models/interfaces';
55
import { environment } from 'src/environments/environment';
6-
import {components} from "../models/product-catalog";
7-
type ProductOffering = components["schemas"]["ProductOffering"];
8-
import {LocalStorageService} from "./local-storage.service";
9-
import * as moment from 'moment';
10-
import { jwtDecode } from "jwt-decode";
116

127
@Injectable({
138
providedIn: 'root'
@@ -19,7 +14,7 @@ export class ApiServiceService {
1914
public static CATALOG_LIMIT: number= environment.CATALOG_LIMIT;
2015
public static CATEGORY_LIMIT: number = environment.CATEGORY_LIMIT;
2116

22-
constructor(private http: HttpClient,private localStorage: LocalStorageService) { }
17+
constructor(private http: HttpClient) { }
2318

2419
getProducts(page:any,keywords:any) {
2520
let url = `${ApiServiceService.BASE_URL}${ApiServiceService.PRODUCT_CATALOG_MANAGEMENT_URL}/productOffering?limit=${ApiServiceService.PRODUCT_LIMIT}&offset=${page}&lifecycleStatus=Launched`;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ <h5 class="text-xl font-semibold line-clamp-2 tracking-tight text-primary-100 da
9898

9999
<!-- Main modal -->
100100
@if (showModal){
101-
<app-product-details [productOff]="productOff" (close)="showModal = false"></app-product-details>
101+
<app-product-details [productOff]="productOff" (closeModal)="showModal = false"></app-product-details>
102102
}
103103

104104

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@ import { faAtom, faClose, faEllipsis} from "@fortawesome/pro-solid-svg-icons";
1212
type Product = components["schemas"]["ProductOffering"];
1313
type ProductSpecification = components["schemas"]["ProductSpecification"];
1414
type AttachmentRefOrValue = components["schemas"]["AttachmentRefOrValue"];
15-
import {LocalStorageService} from "../../services/local-storage.service";
1615
import {EventMessageService} from "../../services/event-message.service";
1716
import { ApiServiceService } from 'src/app/services/product-service.service';
18-
import { AccountServiceService } from 'src/app/services/account-service.service';
1917
import { Modal } from 'flowbite';
20-
import { Router } from '@angular/router';
2118
import { PriceServiceService } from 'src/app/services/price-service.service';
2219
import { initFlowbite } from 'flowbite';
23-
import { LoginInfo, cartProduct,productSpecCharacteristicValueCart } from '../../models/interfaces';
20+
import { cartProduct,productSpecCharacteristicValueCart } from '../../models/interfaces';
2421
import { ShoppingCartServiceService } from 'src/app/services/shopping-cart-service.service';
25-
import * as moment from 'moment';
2622
import { certifications } from 'src/app/models/certification-standards.const';
2723
import { environment } from 'src/environments/environment';
2824
import { ErrorMessageComponent } from '../error-message/error-message.component';

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
import { Component, Input, OnInit, ElementRef, ViewChild,ChangeDetectorRef, HostListener, inject } from '@angular/core';
2-
import { ActivatedRoute, Router } from '@angular/router';
3-
import { ApiServiceService } from 'src/app/services/product-service.service';
1+
import { Component, Input, OnInit, ChangeDetectorRef, HostListener, inject } from '@angular/core';
42
import {components} from "../../models/product-catalog";
5-
import { PriceServiceService } from 'src/app/services/price-service.service';
63
type Product = components["schemas"]["ProductOffering"];
7-
type ProductSpecification = components["schemas"]["ProductSpecification"];
84
type AttachmentRefOrValue = components["schemas"]["AttachmentRefOrValue"];
9-
import { LocalStorageService } from 'src/app/services/local-storage.service';
10-
import { LoginInfo, cartProduct,productSpecCharacteristicValueCart } from '../../models/interfaces';
5+
import { cartProduct,productSpecCharacteristicValueCart } from '../../models/interfaces';
116
import { ShoppingCartServiceService } from 'src/app/services/shopping-cart-service.service';
127
import {EventMessageService} from "../../services/event-message.service";
138
import { ErrorMessageComponent } from '../error-message/error-message.component';

0 commit comments

Comments
 (0)