Ean Search Bugfix

This commit is contained in:
Nino
2023-09-11 16:53:43 +02:00
parent 71cd95587d
commit d7a3641fed
7 changed files with 33 additions and 7 deletions

View File

@@ -245,7 +245,7 @@ export class ArticleDetailsComponent implements OnInit, OnDestroy {
}
getDetailsPath(ean?: string) {
return this._navigationService.getArticleDetailsPath({ processId: this.applicationService.activatedProcessId, ean }).path;
return this._navigationService.getArticleDetailsPathByEan({ processId: this.applicationService.activatedProcessId, ean }).path;
}
async updateBreadcrumb(item: ItemDTO) {

View File

@@ -19,6 +19,6 @@ export class ArticleRecommendationsComponent {
) {}
getDetailsPath(ean?: string) {
return this._navigationService.getArticleDetailsPath({ processId: this._applicationService.activatedProcessId, ean }).path;
return this._navigationService.getArticleDetailsPathByEan({ processId: this._applicationService.activatedProcessId, ean }).path;
}
}

View File

@@ -221,7 +221,7 @@ export class ArticleSearchResultsComponent implements OnInit, OnDestroy, AfterVi
// Navigation from Cart uses ean
if (!!ean) {
await this._navigationService
.getArticleDetailsPath({
.getArticleDetailsPathByEan({
processId,
ean,
extras: { queryParams: this.isTablet ? undefined : params },

View File

@@ -45,12 +45,17 @@ const routes: Routes = [
component: ArticleSearchResultsComponent,
outlet: 'side',
},
{
path: 'results/:ean/ean',
component: ArticleSearchResultsComponent,
outlet: 'side',
},
{
path: 'details/:id',
component: ArticleDetailsComponent,
},
{
path: 'details/:ean',
path: 'details/:ean/ean',
component: ArticleDetailsComponent,
},
{

View File

@@ -123,7 +123,7 @@ export class ShoppingCartItemComponent extends ComponentStore<ShoppingCartItemCo
}
get productSearchDetailsPath() {
return this._productNavigationService.getArticleDetailsPath({
return this._productNavigationService.getArticleDetailsPathByEan({
processId: this.application.activatedProcessId,
ean: this.item?.product?.ean,
}).path;

View File

@@ -206,7 +206,7 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
}
getProductSearchDetailsPath(ean: string) {
return this._productNavigationService.getArticleDetailsPath({
return this._productNavigationService.getArticleDetailsPathByEan({
processId: this.processId,
ean,
}).path;

View File

@@ -48,6 +48,27 @@ export class ProductCatalogNavigationService extends NavigationService {
getArticleDetailsPath({
processId,
itemId,
extras,
}: {
processId: number;
itemId?: number;
ean?: string;
extras?: NavigationExtras;
}): { path: any[]; extras?: NavigationExtras; navigate: () => Promise<boolean> } {
const path = [
'/kunde',
processId,
'product',
{ outlets: { primary: ['details', itemId].filter((x) => !!x), side: ['results', itemId].filter((x) => !!x) } },
].filter((x) => !!x);
return {
path,
navigate: this._createNavigationFn(path, extras),
};
}
getArticleDetailsPathByEan({
processId,
ean,
extras,
}: {
@@ -60,7 +81,7 @@ export class ProductCatalogNavigationService extends NavigationService {
'/kunde',
processId,
'product',
{ outlets: { primary: ['details', ean, itemId].filter((x) => !!x), side: ['results', ean, itemId].filter((x) => !!x) } },
{ outlets: { primary: ['details', ean, 'ean'].filter((x) => !!x), side: ['results', ean, 'ean'].filter((x) => !!x) } },
].filter((x) => !!x);
return {
path,