From 86ed35d19918b97f7ffe8c1829fd02dc76414c64 Mon Sep 17 00:00:00 2001 From: Elena Garrone <8397116+elenagarrone@users.noreply.github.com> Date: Thu, 3 Feb 2022 13:29:06 +0000 Subject: [PATCH] refactor(footer): update variable name for secondary logo BREAKING CHANGE: the input for the second logo has been changed from `secondLogo` to `secondaryLogo`. fix: #670 --- .../canopy/src/lib/footer/footer.component.html | 6 +++--- .../src/lib/footer/footer.component.spec.ts | 12 ++++++------ .../canopy/src/lib/footer/footer.component.ts | 16 ++++++++-------- projects/canopy/src/lib/footer/footer.notes.ts | 4 ++-- projects/canopy/src/lib/footer/footer.stories.ts | 8 ++++---- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/projects/canopy/src/lib/footer/footer.component.html b/projects/canopy/src/lib/footer/footer.component.html index a230dd8b7..867ca1a85 100644 --- a/projects/canopy/src/lib/footer/footer.component.html +++ b/projects/canopy/src/lib/footer/footer.component.html @@ -60,10 +60,10 @@ diff --git a/projects/canopy/src/lib/footer/footer.component.spec.ts b/projects/canopy/src/lib/footer/footer.component.spec.ts index a6b940290..10149a642 100644 --- a/projects/canopy/src/lib/footer/footer.component.spec.ts +++ b/projects/canopy/src/lib/footer/footer.component.spec.ts @@ -83,9 +83,9 @@ describe('FooterComponent', () => { }); }); - describe('second logo', () => { + describe('secondary logo', () => { it('renders the logo when the property is set', () => { - component.secondLogo = logo; + component.secondaryLogo = logo; fixture.detectChanges(); const image = fixture.debugElement.query(By.css('.lg-footer__second-logo')); expect(image).toBeTruthy(); @@ -93,14 +93,14 @@ describe('FooterComponent', () => { }); it('does not render a logo when the property is not set', () => { - component.secondLogo = null; + component.secondaryLogo = null; fixture.detectChanges(); const image = fixture.debugElement.query(By.css('.lg-footer__second-logo')); expect(image).toBeFalsy(); }); it('adds a silent alt when there is a logo', () => { - component.secondLogo = logo; + component.secondaryLogo = logo; fixture.detectChanges(); const image = fixture.debugElement.query(By.css('.lg-footer__second-logo')); expect(image).toBeTruthy(); @@ -108,8 +108,8 @@ describe('FooterComponent', () => { }); it('adds a standard alt when alt and logo are set', () => { - component.secondLogo = logo; - component.secondLogoAlt = logoAlt; + component.secondaryLogo = logo; + component.secondaryLogoAlt = logoAlt; fixture.detectChanges(); const image = fixture.debugElement.query(By.css('.lg-footer__second-logo')); expect(image).toBeTruthy(); diff --git a/projects/canopy/src/lib/footer/footer.component.ts b/projects/canopy/src/lib/footer/footer.component.ts index 889fa634c..264e3ffb4 100644 --- a/projects/canopy/src/lib/footer/footer.component.ts +++ b/projects/canopy/src/lib/footer/footer.component.ts @@ -34,20 +34,20 @@ export class LgFooterComponent { } } - private _secondLogo: string; + private _secondaryLogo: string; @Input() - get secondLogo(): string | null { - return this._secondLogo; + get secondaryLogo(): string | null { + return this._secondaryLogo; } - set secondLogo(secondLogo) { - this._secondLogo = secondLogo; - if (!this.secondLogoAlt) { - this.secondLogoAlt = ''; + set secondaryLogo(secondaryLogo) { + this._secondaryLogo = secondaryLogo; + if (!this.secondaryLogoAlt) { + this.secondaryLogoAlt = ''; } } @Input() logoAlt: string | null; - @Input() secondLogoAlt: string | null; + @Input() secondaryLogoAlt: string | null; @Input() copyright: string; @Input() primaryLinks: Array | null; @Input() secondaryLinks: Array | null; diff --git a/projects/canopy/src/lib/footer/footer.notes.ts b/projects/canopy/src/lib/footer/footer.notes.ts index d56c8cb66..0a263fdf2 100644 --- a/projects/canopy/src/lib/footer/footer.notes.ts +++ b/projects/canopy/src/lib/footer/footer.notes.ts @@ -34,8 +34,8 @@ and in your HTML: |------|-------------|:----:|:-----:|:-----:| | \`\`logo\`\` | A url link to the logo | string | null | Yes | | \`\`logoAlt\`\` | alt text to display alongside the logo | string | '' | Yes | -| \`\`secondLogo\`\` | A url link to the second logo | string | null | No | -| \`\`secondLogoAlt\`\` | alt text to display alongside the second logo | string | '' | No | +| \`\`secondaryLogo\`\` | A url link to the secondary logo | string | null | No | +| \`\`secondaryLogoAlt\`\` | alt text to display alongside the secondary logo | string | '' | No | | \`\`copyright\`\` | Copyright text to display in footer | string | undefined | No | | \`\`primaryLinks\`\` | The primary footer links | \`[{ text: string, href: string, id?: string, target?: string }]\` | null | No | | \`\`secondaryLinks\`\` | The secondary footer links | \`[{ text: string, href: string, id?: string, class?: string, target?: string, type?: 'button' }]\` | null | No | diff --git a/projects/canopy/src/lib/footer/footer.stories.ts b/projects/canopy/src/lib/footer/footer.stories.ts index 2924f1d90..129421bab 100644 --- a/projects/canopy/src/lib/footer/footer.stories.ts +++ b/projects/canopy/src/lib/footer/footer.stories.ts @@ -101,8 +101,8 @@ export const coBranded = () => ({ [copyright]="copyright" [logo]="logo" [logoAlt]="logoAlt" - [secondLogo]="secondLogo" - [secondLogoAlt]="secondLogoAlt" + [secondaryLogo]="secondaryLogo" + [secondaryLogoAlt]="secondaryLogoAlt" [primaryLinks]="primaryLinks" [secondaryLinks]="secondaryLinks" (primaryLinkClicked)="primaryLinkClicked($event)" @@ -112,8 +112,8 @@ export const coBranded = () => ({ props: { logo: text('logo', 'legal-and-general-logo.svg', groupId), logoAlt: text('logoAlt', 'Company name', groupId), - secondLogo: text('secondLogo', 'dummy-logo.svg', groupId), - secondLogoAlt: text('secondLogoAlt', 'Second company name', groupId), + secondaryLogo: text('secondaryLogo', 'dummy-logo.svg', groupId), + secondaryLogoAlt: text('secondaryLogoAlt', 'Second company name', groupId), copyright: text('copyright', '© Some Company plc 2018', groupId), secondaryLinks: object('secondaryLinks', secondaryLinks, groupId), primaryLinks: object('primaryLinks', primaryLinks, groupId),