From 033d39e3bd5a4f426a03d55acaf2636f357735d6 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:17:22 +0200 Subject: [PATCH] PER-9422 Renamed the files from banner to mobile-banner for less confusion. --- src/app/auth/components/auth/auth.component.html | 2 +- src/app/core/components/main/main.component.html | 2 +- .../components/onboarding/onboarding.component.html | 2 +- .../mobile-banner.component.html} | 0 .../mobile-banner.component.scss} | 0 .../mobile-banner.component.spec.ts} | 12 ++++++------ .../mobile-banner.component.ts} | 12 ++++++------ .../mobile-banner.service.spec.ts} | 11 +++++------ .../mobile-banner.service.ts} | 10 +++++----- src/app/shared/shared.module.ts | 6 +++--- 10 files changed, 28 insertions(+), 29 deletions(-) rename src/app/shared/components/{banner/banner.component.html => mobile-banner/mobile-banner.component.html} (100%) rename src/app/shared/components/{banner/banner.component.scss => mobile-banner/mobile-banner.component.scss} (100%) rename src/app/shared/components/{banner/banner.component.spec.ts => mobile-banner/mobile-banner.component.spec.ts} (83%) rename src/app/shared/components/{banner/banner.component.ts => mobile-banner/mobile-banner.component.ts} (76%) rename src/app/shared/services/{banner/banner.service.spec.ts => mobile-banner/mobile-banner.service.spec.ts} (78%) rename src/app/shared/services/{banner/banner.service.ts => mobile-banner/mobile-banner.service.ts} (80%) diff --git a/src/app/auth/components/auth/auth.component.html b/src/app/auth/components/auth/auth.component.html index 52a4b144c..420c76875 100644 --- a/src/app/auth/components/auth/auth.component.html +++ b/src/app/auth/components/auth/auth.component.html @@ -5,7 +5,7 @@ - + diff --git a/src/app/core/components/main/main.component.html b/src/app/core/components/main/main.component.html index 70c6c2470..33f1a97cf 100644 --- a/src/app/core/components/main/main.component.html +++ b/src/app/core/components/main/main.component.html @@ -6,7 +6,7 @@ - + diff --git a/src/app/onboarding/components/onboarding/onboarding.component.html b/src/app/onboarding/components/onboarding/onboarding.component.html index 7475d75ea..bc32cbe02 100644 --- a/src/app/onboarding/components/onboarding/onboarding.component.html +++ b/src/app/onboarding/components/onboarding/onboarding.component.html @@ -44,6 +44,6 @@
Loading...
- + diff --git a/src/app/shared/components/banner/banner.component.html b/src/app/shared/components/mobile-banner/mobile-banner.component.html similarity index 100% rename from src/app/shared/components/banner/banner.component.html rename to src/app/shared/components/mobile-banner/mobile-banner.component.html diff --git a/src/app/shared/components/banner/banner.component.scss b/src/app/shared/components/mobile-banner/mobile-banner.component.scss similarity index 100% rename from src/app/shared/components/banner/banner.component.scss rename to src/app/shared/components/mobile-banner/mobile-banner.component.scss diff --git a/src/app/shared/components/banner/banner.component.spec.ts b/src/app/shared/components/mobile-banner/mobile-banner.component.spec.ts similarity index 83% rename from src/app/shared/components/banner/banner.component.spec.ts rename to src/app/shared/components/mobile-banner/mobile-banner.component.spec.ts index 1dc72eb4c..1fa6b52f5 100644 --- a/src/app/shared/components/banner/banner.component.spec.ts +++ b/src/app/shared/components/mobile-banner/mobile-banner.component.spec.ts @@ -2,8 +2,8 @@ import { SharedModule } from '@shared/shared.module'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Shallow } from 'shallow-render'; -import { BannerService } from '@shared/services/banner/banner.service'; -import { BannerComponent } from './banner.component'; +import { MobileBannerService } from '@shared/services/mobile-banner/mobile-banner.service'; +import { MobileBannerComponent } from './mobile-banner.component'; const mockBannerService = { get isIos() { @@ -21,12 +21,12 @@ const mockBannerService = { hideBanner() {}, }; -describe('BannerComponent', () => { - let shallow: Shallow; +describe('MobileBannerComponent', () => { + let shallow: Shallow; beforeEach(() => { - shallow = new Shallow(BannerComponent, SharedModule) - .mock(BannerService, mockBannerService) + shallow = new Shallow(MobileBannerComponent, SharedModule) + .mock(MobileBannerService, mockBannerService) .dontMock(NoopAnimationsModule) .import(NoopAnimationsModule); }); diff --git a/src/app/shared/components/banner/banner.component.ts b/src/app/shared/components/mobile-banner/mobile-banner.component.ts similarity index 76% rename from src/app/shared/components/banner/banner.component.ts rename to src/app/shared/components/mobile-banner/mobile-banner.component.ts index 66c67cec8..e4f7567d3 100644 --- a/src/app/shared/components/banner/banner.component.ts +++ b/src/app/shared/components/mobile-banner/mobile-banner.component.ts @@ -2,18 +2,18 @@ import { PromptService } from '@shared/services/prompt/prompt.service'; import { ngIfSlideUpAnimation } from '@shared/animations'; import { Component } from '@angular/core'; -import { BannerService } from '@shared/services/banner/banner.service'; +import { MobileBannerService } from '@shared/services/mobile-banner/mobile-banner.service'; @Component({ - selector: 'pr-banner', - templateUrl: './banner.component.html', - styleUrls: ['./banner.component.scss'], + selector: 'pr-mobile-banner', + templateUrl: './mobile-banner.component.html', + styleUrls: ['./mobile-banner.component.scss'], animations: [ngIfSlideUpAnimation], }) -export class BannerComponent { +export class MobileBannerComponent { public url = ''; constructor( - public bannerService: BannerService, + public bannerService: MobileBannerService, private prompt: PromptService ) { this.url = this.bannerService.isIos diff --git a/src/app/shared/services/banner/banner.service.spec.ts b/src/app/shared/services/mobile-banner/mobile-banner.service.spec.ts similarity index 78% rename from src/app/shared/services/banner/banner.service.spec.ts rename to src/app/shared/services/mobile-banner/mobile-banner.service.spec.ts index 0b82629e8..100cb4805 100644 --- a/src/app/shared/services/banner/banner.service.spec.ts +++ b/src/app/shared/services/mobile-banner/mobile-banner.service.spec.ts @@ -1,9 +1,8 @@ -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; /* @format */ import { DeviceService } from '@shared/services/device/device.service'; import { CoreModule } from '@core/core.module'; import { Shallow } from 'shallow-render'; -import { BannerService } from './banner.service'; +import { MobileBannerService } from './mobile-banner.service'; const mockAndroidDeviceService = { isAndroid: () => true, @@ -15,11 +14,11 @@ const mockIosDeviceService = { }; describe('BannerService', () => { - let shallow: Shallow; + let shallow: Shallow; describe('when on an Android device', () => { beforeEach(() => { - shallow = new Shallow(BannerService, CoreModule).mock( + shallow = new Shallow(MobileBannerService, CoreModule).mock( DeviceService, mockAndroidDeviceService ); @@ -36,7 +35,7 @@ describe('BannerService', () => { describe('when on an iOS device', () => { beforeEach(() => { - shallow = new Shallow(BannerService, CoreModule).mock( + shallow = new Shallow(MobileBannerService, CoreModule).mock( DeviceService, mockIosDeviceService ); @@ -46,7 +45,7 @@ describe('BannerService', () => { const { instance } = await shallow.createService(); expect(instance.isVisible).toBeTrue(); - + expect(instance.isIos).toBeTrue(); }); }); diff --git a/src/app/shared/services/banner/banner.service.ts b/src/app/shared/services/mobile-banner/mobile-banner.service.ts similarity index 80% rename from src/app/shared/services/banner/banner.service.ts rename to src/app/shared/services/mobile-banner/mobile-banner.service.ts index 0ca171a2e..7e8892564 100644 --- a/src/app/shared/services/banner/banner.service.ts +++ b/src/app/shared/services/mobile-banner/mobile-banner.service.ts @@ -5,12 +5,12 @@ import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root', }) -export class BannerService { +export class MobileBannerService { private _isVisible = false; - private _appStoreUrl = - 'https://apps.apple.com/app/permanent-archive/id1571883070' as const; - private _playStoreUrl = - 'https://play.google.com/store/apps/details?id=org.permanent.PermanentArchive' as const; + private readonly _appStoreUrl = + 'https://apps.apple.com/app/permanent-archive/id1571883070'; + private readonly _playStoreUrl = + 'https://play.google.com/store/apps/details?id=org.permanent.PermanentArchive'; private _isIos = false; diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index c93ae4af6..f5c16a87c 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -66,7 +66,7 @@ import { PrependProtocolPipe } from './pipes/prepend-protocol.pipe'; import { SwitcherComponent } from './components/switcher/switcher.component'; import { GetAltTextPipe } from './pipes/get-alt-text.pipe'; import { AccessRolePipe } from './pipes/access-role.pipe'; -import { BannerComponent } from './components/banner/banner.component'; +import { MobileBannerComponent } from './components/mobile-banner/mobile-banner.component'; @NgModule({ imports: [ @@ -134,7 +134,7 @@ import { BannerComponent } from './components/banner/banner.component'; SwitcherComponent, GetAltTextPipe, AccessRolePipe, - BannerComponent, + MobileBannerComponent, ], declarations: [ ThumbnailComponent, @@ -183,7 +183,7 @@ import { BannerComponent } from './components/banner/banner.component'; SwitcherComponent, GetAltTextPipe, AccessRolePipe, - BannerComponent, + MobileBannerComponent, ], providers: [PublicLinkPipe, PublicRoutePipe, PrLocationPipe, DatePipe], })