Skip to content

Commit

Permalink
feat: introduce Footer Top component that integrates the Store Locator
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzRS authored and shauke committed Feb 7, 2022
1 parent 2f3bc1a commit 9a433e9
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 3 deletions.
13 changes: 13 additions & 0 deletions src/app/shell/footer/footer-top/footer-top.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<ng-container *ishFeature="'storeLocator'">
<div class="footer-top">
<div class="container">
<div class="row">
<div class="col-md-4 storefinder clearfix">
<fa-icon [icon]="['fas', 'map-marker-alt']"></fa-icon>
<h4>{{ 'store_locator.link.title' | translate }}</h4>
<a routerLink="/store-finder">{{ 'store_locator.link.subtitle' | translate }}</a>
</div>
</div>
</div>
</div>
</ng-container>
33 changes: 33 additions & 0 deletions src/app/shell/footer/footer-top/footer-top.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { TranslateModule } from '@ngx-translate/core';
import { MockComponent } from 'ng-mocks';

import { FeatureToggleModule } from 'ish-core/feature-toggle.module';

import { FooterTopComponent } from './footer-top.component';

describe('Footer Top Component', () => {
let component: FooterTopComponent;
let fixture: ComponentFixture<FooterTopComponent>;
let element: HTMLElement;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [FooterTopComponent, MockComponent(FaIconComponent)],
imports: [FeatureToggleModule.forTesting('storeLocator'), TranslateModule.forRoot()],
}).compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(FooterTopComponent);
component = fixture.componentInstance;
element = fixture.nativeElement;
});

it('should be created', () => {
expect(component).toBeTruthy();
expect(element).toBeTruthy();
expect(() => fixture.detectChanges()).not.toThrow();
});
});
8 changes: 8 additions & 0 deletions src/app/shell/footer/footer-top/footer-top.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
selector: 'ish-footer-top',
templateUrl: './footer-top.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FooterTopComponent {}
1 change: 1 addition & 0 deletions src/app/shell/footer/footer/footer.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<ng-container *ishHasNotRole="['APP_B2B_CXML_USER', 'APP_B2B_OCI_USER']">
<ish-footer-top></ish-footer-top>
<div [ishServerHtml]="'footer.content' | translate: { appVersion: appVersion }" class="clearfix"></div>
</ng-container>
5 changes: 3 additions & 2 deletions src/app/shell/footer/footer/footer.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserTransferStateModule } from '@angular/platform-browser';
import { TranslateModule } from '@ngx-translate/core';
import { MockDirective } from 'ng-mocks';
import { MockComponent, MockDirective } from 'ng-mocks';

import { ServerHtmlDirective } from 'ish-core/directives/server-html.directive';
import { RoleToggleModule } from 'ish-core/role-toggle.module';
import { FooterTopComponent } from 'ish-shell/footer/footer-top/footer-top.component';

import { FooterComponent } from './footer.component';

Expand All @@ -16,7 +17,7 @@ describe('Footer Component', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [BrowserTransferStateModule, RoleToggleModule.forTesting(), TranslateModule.forRoot()],
declarations: [FooterComponent, MockDirective(ServerHtmlDirective)],
declarations: [FooterComponent, MockComponent(FooterTopComponent), MockDirective(ServerHtmlDirective)],
}).compileComponents();
});

Expand Down
2 changes: 2 additions & 0 deletions src/app/shell/shell.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { TrackingExportsModule } from '../extensions/tracking/exports/tracking-e
import { WishlistsExportsModule } from '../extensions/wishlists/exports/wishlists-exports.module';

import { CookiesBannerComponent } from './application/cookies-banner/cookies-banner.component';
import { FooterTopComponent } from './footer/footer-top/footer-top.component';
import { FooterComponent } from './footer/footer/footer.component';
import { HeaderCheckoutComponent } from './header/header-checkout/header-checkout.component';
import { HeaderDefaultComponent } from './header/header-default/header-default.component';
Expand Down Expand Up @@ -59,6 +60,7 @@ const exportedComponents = [CookiesBannerComponent, FooterComponent, HeaderCompo
declarations: [
...exportedComponents,
CookiesBannerComponent,
FooterTopComponent,
HeaderCheckoutComponent,
HeaderDefaultComponent,
HeaderNavigationComponent,
Expand Down
2 changes: 1 addition & 1 deletion src/styles/components/footer/footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ footer {
}

.footer-top {
padding: 40px 0 60px;
padding: 20px 0;
background: $color-primary;

h4 {
Expand Down

0 comments on commit 9a433e9

Please sign in to comment.