Skip to content

Commit

Permalink
feature/bundles-mooncake: fix some sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
leowangchao committed Oct 15, 2024
1 parent 78abb11 commit e94a892
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { StateUtils } from '@spartacus/core';
import { StateUtils, ErrorAction } from '@spartacus/core';
import { OrderEntry } from '@spartacus/cart/base/root';
import { MULTI_CART_DATA } from '../multi-cart-state';
import { ErrorAction } from '@spartacus/core';

export const CART_REMOVE_ENTRYGROUP = '[Cart-entrygroup] Remove EntryGroup';
export const CART_REMOVE_ENTRYGROUP_SUCCESS = '[Cart-entrygroup] Remove EntryGroup Success';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CartModification } from '@spartacus/cart/base/root';
import {
LoggerService,
SiteContextActions,
normalizeHttpError,
tryNormalizeHttpError,
withdrawOn,
} from '@spartacus/core';
import { Observable, from } from 'rxjs';
Expand All @@ -37,7 +37,9 @@ export class CartEntryGroupEffects {
this.actions$.pipe(
ofType(CartActions.CART_REMOVE_ENTRYGROUP),
map((action: CartActions.CartRemoveEntryGroup) => action.payload),
tap((payload) => {console.log('remove bundle payload is '+ JSON.stringify(payload));}),
tap((payload) => {
this.logger.log(`remove bundle payload is ${JSON.stringify(payload)}`);
}),
concatMap((payload) =>
this.cartEntryGroupConnector
.remove(payload.userId, payload.cartId, payload.entryGroupNumber)
Expand All @@ -51,7 +53,7 @@ export class CartEntryGroupEffects {
from([
new CartActions.CartRemoveEntryGroupFail({
...payload,
error: normalizeHttpError(error, this.logger),
error: tryNormalizeHttpError(error, this.logger),
}),
new CartActions.LoadCart({
cartId: payload.cartId,
Expand Down Expand Up @@ -94,7 +96,7 @@ export class CartEntryGroupEffects {
from([
new CartActions.CartAddToEntryGroupFail({
...payload,
error: normalizeHttpError(error, this.logger),
error: tryNormalizeHttpError(error, this.logger),
}),
new CartActions.LoadCart({
cartId: payload.cartId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class HierarchyNodeCollapsibleComponent<T> {
}

editBundle(entryGroupNumber: any) {
console.log('editBundle: ', entryGroupNumber);
// TODO: Implement editBundle
return entryGroupNumber;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export class HierarchyNodeTitleComponent {

removeBundle(entryGroupNumber: any) {
this.activeCartService.removeEntryGroup(entryGroupNumber);
console.log('removeBundle in ' + entryGroupNumber);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ export const defaultHierarchyNodeArgs: Partial<HierarchyNode> = {
export interface Value {
entryGroupNumber?: number;
entries?: any[];
};
}

0 comments on commit e94a892

Please sign in to comment.