Skip to content

Commit

Permalink
Move variables to cartEvents.js to avoid circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
caleballdrin committed Dec 19, 2024
1 parent 4408c96 commit 545412e
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/app/cart/cart.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import productModalService from 'common/services/productModal.service'
import desigSrcDirective from 'common/directives/desigSrc.directive'

import displayRateTotals from 'common/components/displayRateTotals/displayRateTotals.component'
import { cartUpdatedEvent } from 'common/components/nav/navCart/navCart.component'
import { cartUpdatedEvent } from 'common/lib/cartEvents'

import analyticsFactory from 'app/analytics/analytics.factory'

Expand Down
2 changes: 1 addition & 1 deletion src/app/cart/cart.component.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Observable } from 'rxjs/Observable'
import 'rxjs/add/observable/of'
import 'rxjs/add/observable/throw'

import { cartUpdatedEvent } from 'common/components/nav/navCart/navCart.component'
import { cartUpdatedEvent } from 'common/lib/cartEvents'

describe('cart', () => {
beforeEach(angular.mock.module(module.name))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
} from 'common/services/giftHelpers/giftDates.service'
import desigSrcDirective from 'common/directives/desigSrc.directive'
import showErrors from 'common/filters/showErrors.filter'
import { giftAddedEvent, cartUpdatedEvent } from 'common/components/nav/navCart/navCart.component'
import { giftAddedEvent, cartUpdatedEvent } from 'common/lib/cartEvents'
import { giveGiftParams } from '../giveGiftParams'
import loading from 'common/components/loading/loading.component'
import analyticsFactory from 'app/analytics/analytics.factory'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'rxjs/add/observable/of'
import 'rxjs/add/observable/throw'

import module, { brandedCoverFeeCheckedEvent } from './productConfigForm.component'
import { giftAddedEvent, cartUpdatedEvent } from 'common/components/nav/navCart/navCart.component'
import { giftAddedEvent, cartUpdatedEvent } from 'common/lib/cartEvents'
import { giveGiftParams } from '../giveGiftParams'
import { brandedCheckoutAmountUpdatedEvent } from '../../../common/components/paymentMethods/coverFees/coverFees.component'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import concat from 'lodash/concat'
import step1SelectRecentRecipients from './step1/selectRecentRecipients.component'
import step1SearchRecipients from './step1/searchRecipients.component'
import step2EnterAmounts from './step2/enterAmounts.component'
import { giftAddedEvent } from 'common/components/nav/navCart/navCart.component'
import { giftAddedEvent } from 'common/lib/cartEvents'

import RecurringGiftModel from 'common/models/recurringGift.model'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'rxjs/add/observable/from'
import 'rxjs/add/observable/throw'

import RecurringGiftModel from 'common/models/recurringGift.model'
import { giftAddedEvent } from 'common/components/nav/navCart/navCart.component'
import { giftAddedEvent } from 'common/lib/cartEvents'

import module from './giveOneTimeGift.modal.component'

Expand Down
4 changes: 1 addition & 3 deletions src/common/components/nav/navCart/navCart.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import orderService from 'common/services/api/order.service'
import analyticsFactory from 'app/analytics/analytics.factory'

import template from './navCart.tpl.html'

export const giftAddedEvent = 'giftAddedToCart'
export const cartUpdatedEvent = 'cartUpdatedEvent'
import { giftAddedEvent, cartUpdatedEvent } from 'common/lib/cartEvents'

const componentName = 'navCart'

Expand Down
3 changes: 2 additions & 1 deletion src/common/components/nav/navCart/navCart.component.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Observable } from 'rxjs/Observable'
import { Subject } from 'rxjs/Subject'
import 'rxjs/add/observable/of'
import 'rxjs/add/observable/throw'
import module, { giftAddedEvent, cartUpdatedEvent } from './navCart.component'
import module from './navCart.component'
import { giftAddedEvent, cartUpdatedEvent } from 'common/lib/cartEvents'

describe('navCart', () => {
beforeEach(angular.mock.module(module.name))
Expand Down
3 changes: 2 additions & 1 deletion src/common/components/nav/navCartIcon.component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import angular from 'angular'

import navCart, { giftAddedEvent, cartUpdatedEvent } from 'common/components/nav/navCart/navCart.component'
import navCart from 'common/components/nav/navCart/navCart.component'
import { giftAddedEvent, cartUpdatedEvent } from 'common/lib/cartEvents'
import uibDropdown from 'angular-ui-bootstrap/src/dropdown'
import analyticsFactory from 'app/analytics/analytics.factory'

Expand Down
2 changes: 1 addition & 1 deletion src/common/components/nav/navCartIcon.component.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import angular from 'angular'
import 'angular-mocks'
import module from './navCartIcon.component'

import { giftAddedEvent, cartUpdatedEvent } from 'common/components/nav/navCart/navCart.component'
import { giftAddedEvent, cartUpdatedEvent } from 'common/lib/cartEvents'

describe('nav cart icon', function () {
beforeEach(angular.mock.module(module.name))
Expand Down
2 changes: 2 additions & 0 deletions src/common/lib/cartEvents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const giftAddedEvent = 'giftAddedToCart'
export const cartUpdatedEvent = 'cartUpdatedEvent'

0 comments on commit 545412e

Please sign in to comment.