Skip to content

Commit

Permalink
Merge pull request #1063 from CruGlobal/fix-aem-nodes
Browse files Browse the repository at this point in the history
Replace give2 with give
  • Loading branch information
wrandall22 authored Oct 24, 2023
2 parents 94cf7d0 + 79891fe commit a2a4fe4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/app/designationEditor/designationEditor.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ class DesignationEditorController {

if (vanityPath) {
if (isArray(vanityPath)) {
return `${vanityPath[0].replace('/content/give2/us/en', '')}${cacheBust}`
return `${vanityPath[0].replace('/content/give/us/en', '')}${cacheBust}`
} else {
return `${vanityPath.replace('/content/give2/us/en', '')}${cacheBust}`
return `${vanityPath.replace('/content/give/us/en', '')}${cacheBust}`
}
} else {
return `/${this.designationNumber}${cacheBust}`
Expand Down
4 changes: 2 additions & 2 deletions src/app/designationEditor/designationEditor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,13 +599,13 @@ describe('Designation Editor', function () {

it('should return the first vanity url', () => {
$ctrl.designationContent = designationSecurityResponse
$ctrl.designationContent['sling:vanityPath'] = [`/content/give2/us/en/${designationNumber}`]
$ctrl.designationContent['sling:vanityPath'] = [`/content/give/us/en/${designationNumber}`]
expect($ctrl.getDoneEditingUrl()).toEqual(`/${designationNumber}${cacheBust}`)
})

it('should return the only vanity url', () => {
$ctrl.designationContent = designationSecurityResponse
$ctrl.designationContent['sling:vanityPath'] = `/content/give2/us/en/${designationNumber}`
$ctrl.designationContent['sling:vanityPath'] = `/content/give/us/en/${designationNumber}`
expect($ctrl.getDoneEditingUrl()).toEqual(`/${designationNumber}${cacheBust}`)
})

Expand Down
4 changes: 2 additions & 2 deletions src/common/services/api/designations.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ class DesignationsService {
const [designationNumber] = code.split('_')

return campaignPage
? `/content/give2/us/en/campaigns/${c}/${designationNumber}/${campaignPage}.infinity.json`
: `/content/give2/us/en/designations/${c}/${designationNumber}.infinity.json`
? `/content/give/us/en/campaigns/${c}/${designationNumber}/${campaignPage}.infinity.json`
: `/content/give/us/en/designations/${c}/${designationNumber}.infinity.json`
}

suggestedAmounts (code, itemConfig) {
Expand Down
18 changes: 9 additions & 9 deletions src/common/services/api/designations.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe('designation service', () => {
describe('suggestedAmounts', () => {
it('should load suggested amounts', () => {
const itemConfig = { amount: 50, 'campaign-page': 9876 }
self.$httpBackend.expectGET('https://give-stage2.cru.org/content/give2/us/en/campaigns/0/1/2/3/4/0123456/9876.infinity.json')
self.$httpBackend.expectGET('https://give-stage2.cru.org/content/give/us/en/campaigns/0/1/2/3/4/0123456/9876.infinity.json')
.respond(200, campaignResponse)
self.designationsService.suggestedAmounts('0123456', itemConfig)
.subscribe(suggestedAmounts => {
Expand All @@ -160,7 +160,7 @@ describe('designation service', () => {

it('should handle an invalid campaign page', () => {
const itemConfig = { amount: 50, 'campaign-page': 9876 }
self.$httpBackend.expectGET('https://give-stage2.cru.org/content/give2/us/en/campaigns/0/1/2/3/4/0123456/9876.infinity.json')
self.$httpBackend.expectGET('https://give-stage2.cru.org/content/give/us/en/campaigns/0/1/2/3/4/0123456/9876.infinity.json')
.respond(400, {})
self.designationsService.suggestedAmounts('0123456', itemConfig)
.subscribe(suggestedAmounts => {
Expand All @@ -173,7 +173,7 @@ describe('designation service', () => {

it('should handle no campaign page', () => {
const itemConfig = { amount: 50 }
self.$httpBackend.expectGET('https://give-stage2.cru.org/content/give2/us/en/designations/0/1/2/3/4/0123456.infinity.json')
self.$httpBackend.expectGET('https://give-stage2.cru.org/content/give/us/en/designations/0/1/2/3/4/0123456.infinity.json')
.respond(200, designationResponse)
self.designationsService.suggestedAmounts('0123456', itemConfig)
.subscribe(suggestedAmounts => {
Expand All @@ -187,7 +187,7 @@ describe('designation service', () => {

describe('facebookPixel', () => {
it('should load facebook pixel id from JCR', () => {
self.$httpBackend.expectGET('https://give-stage2.cru.org/content/give2/us/en/designations/0/1/2/3/4/0123456.infinity.json')
self.$httpBackend.expectGET('https://give-stage2.cru.org/content/give/us/en/designations/0/1/2/3/4/0123456.infinity.json')
.respond(200, designationResponse)
self.designationsService.facebookPixel('0123456')
.subscribe(pixelId => {
Expand All @@ -199,7 +199,7 @@ describe('designation service', () => {

describe('givingLinks', () => {
it('should load givingLinks from JCR', () => {
self.$httpBackend.expectGET('https://give-stage2.cru.org/content/give2/us/en/designations/0/1/2/3/4/0123456.infinity.json')
self.$httpBackend.expectGET('https://give-stage2.cru.org/content/give/us/en/designations/0/1/2/3/4/0123456.infinity.json')
.respond(200, designationResponse)
self.designationsService.givingLinks('0123456')
.subscribe(givingLinks => {
Expand All @@ -216,30 +216,30 @@ describe('designation service', () => {
const productCode = '0123456'

const path = self.designationsService.generatePath(productCode)
expect(path).toEqual('/content/give2/us/en/designations/0/1/2/3/4/0123456.infinity.json')
expect(path).toEqual('/content/give/us/en/designations/0/1/2/3/4/0123456.infinity.json')
})

it('should return the proper path for one time gift to campaign', () => {
const productCode = '0123456'
const campaignPage = 'some-campaign'

const path = self.designationsService.generatePath(productCode, campaignPage)
expect(path).toEqual('/content/give2/us/en/campaigns/0/1/2/3/4/0123456/some-campaign.infinity.json')
expect(path).toEqual('/content/give/us/en/campaigns/0/1/2/3/4/0123456/some-campaign.infinity.json')
})

it('should return the proper path for recurring gift to non-campaign', () => {
const productCode = '0123456_mon'

const path = self.designationsService.generatePath(productCode)
expect(path).toEqual('/content/give2/us/en/designations/0/1/2/3/4/0123456.infinity.json')
expect(path).toEqual('/content/give/us/en/designations/0/1/2/3/4/0123456.infinity.json')
})

it('should return the proper path for recurring gift to campaign', () => {
const productCode = '0123456_mon'
const campaignPage = 'some-campaign'

const path = self.designationsService.generatePath(productCode, campaignPage)
expect(path).toEqual('/content/give2/us/en/campaigns/0/1/2/3/4/0123456/some-campaign.infinity.json')
expect(path).toEqual('/content/give/us/en/campaigns/0/1/2/3/4/0123456/some-campaign.infinity.json')
})
})

Expand Down

0 comments on commit a2a4fe4

Please sign in to comment.