From 6fe0c00678b0db029bf3159590967dd3c6c2ee26 Mon Sep 17 00:00:00 2001 From: mashm Date: Mon, 16 Dec 2024 19:01:12 +0530 Subject: [PATCH] Mashup code cleanup changes --- .../header.component.html} | 0 .../header.component.scss} | 0 .../header.component.spec.ts} | 12 +++++----- .../header.component.ts} | 8 +++---- .../main-screen/main-screen.component.html | 6 ++--- .../main-screen/main-screen.component.ts | 4 ++-- .../mc-main-content.component.html | 4 ---- .../mc-main-content.component.scss | 4 ---- .../mc-main-content.component.spec.ts | 24 ------------------- .../mc-main-content.component.ts | 22 ----------------- .../shopping-card.component.html} | 0 .../shopping-card.component.scss} | 0 .../shopping-card.component.spec.ts} | 12 +++++----- .../shopping-card.component.ts} | 8 +++---- projects/angular-test-app/src/app/routes.ts | 12 +++++----- 15 files changed, 31 insertions(+), 85 deletions(-) rename projects/angular-test-app/src/app/_samples/embedded/{mc-nav/mc-nav.component.html => header/header.component.html} (100%) rename projects/angular-test-app/src/app/_samples/embedded/{mc-nav/mc-nav.component.scss => header/header.component.scss} (100%) rename projects/angular-test-app/src/app/_samples/embedded/{mc-nav/mc-nav.component.spec.ts => header/header.component.spec.ts} (57%) rename projects/angular-test-app/src/app/_samples/embedded/{mc-nav/mc-nav.component.ts => header/header.component.ts} (97%) delete mode 100644 projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.html delete mode 100644 projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.scss delete mode 100644 projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.spec.ts delete mode 100644 projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.ts rename projects/angular-test-app/src/app/_samples/embedded/{bundle-swatch/bundle-swatch.component.html => shopping-card/shopping-card.component.html} (100%) rename projects/angular-test-app/src/app/_samples/embedded/{bundle-swatch/bundle-swatch.component.scss => shopping-card/shopping-card.component.scss} (100%) rename projects/angular-test-app/src/app/_samples/embedded/{bundle-swatch/bundle-swatch.component.spec.ts => shopping-card/shopping-card.component.spec.ts} (54%) rename projects/angular-test-app/src/app/_samples/embedded/{bundle-swatch/bundle-swatch.component.ts => shopping-card/shopping-card.component.ts} (86%) diff --git a/projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.html b/projects/angular-test-app/src/app/_samples/embedded/header/header.component.html similarity index 100% rename from projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.html rename to projects/angular-test-app/src/app/_samples/embedded/header/header.component.html diff --git a/projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.scss b/projects/angular-test-app/src/app/_samples/embedded/header/header.component.scss similarity index 100% rename from projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.scss rename to projects/angular-test-app/src/app/_samples/embedded/header/header.component.scss diff --git a/projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.spec.ts b/projects/angular-test-app/src/app/_samples/embedded/header/header.component.spec.ts similarity index 57% rename from projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.spec.ts rename to projects/angular-test-app/src/app/_samples/embedded/header/header.component.spec.ts index b8cce6f1..3275b9ea 100644 --- a/projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.spec.ts +++ b/projects/angular-test-app/src/app/_samples/embedded/header/header.component.spec.ts @@ -1,19 +1,19 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { MCNavComponent } from './mc-nav.component'; +import { HeaderComponent } from './header.component'; -describe('MCNavComponent', () => { - let component: MCNavComponent; - let fixture: ComponentFixture; +describe('HeaderComponent', () => { + let component: HeaderComponent; + let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [MCNavComponent] + declarations: [HeaderComponent] }).compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(MCNavComponent); + fixture = TestBed.createComponent(HeaderComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.ts b/projects/angular-test-app/src/app/_samples/embedded/header/header.component.ts similarity index 97% rename from projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.ts rename to projects/angular-test-app/src/app/_samples/embedded/header/header.component.ts index 5d7f0879..a140ea32 100644 --- a/projects/angular-test-app/src/app/_samples/embedded/mc-nav/mc-nav.component.ts +++ b/projects/angular-test-app/src/app/_samples/embedded/header/header.component.ts @@ -26,14 +26,14 @@ declare global { } @Component({ - selector: 'app-mc-nav', - templateUrl: './mc-nav.component.html', - styleUrls: ['./mc-nav.component.scss'], + selector: 'app-header', + templateUrl: './header.component.html', + styleUrls: ['./header.component.scss'], providers: [Utils], standalone: true, imports: [CommonModule, MatProgressSpinnerModule, MatToolbarModule, MatIconModule, MatButtonModule, MainScreenComponent] }) -export class MCNavComponent implements OnInit, OnDestroy { +export class HeaderComponent implements OnInit, OnDestroy { starterPackVersion$: string = endpoints.SP_VERSION; pConn$: typeof PConnect; diff --git a/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.html b/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.html index 150ea9cd..fa837ea4 100644 --- a/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.html +++ b/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.html @@ -3,9 +3,9 @@
Combine TV, Internet, and Voice for the best deal
- - - + + +
diff --git a/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.ts b/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.ts index d89010d7..ed623985 100644 --- a/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.ts +++ b/projects/angular-test-app/src/app/_samples/embedded/main-screen/main-screen.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, Input, OnDestroy } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ResolutionScreenComponent } from '../resolution-screen/resolution-screen.component'; -import { BundleSwatchComponent } from '../bundle-swatch/bundle-swatch.component'; +import { ShoppingCardComponent } from '../shopping-card/shopping-card.component'; import { ProgressSpinnerService } from '../../../../../../../packages/angular-sdk-components/src/lib/_messages/progress-spinner.service'; import { ServerConfigService } from '../../../../../../../packages/angular-sdk-components/src/lib/_services/server-config.service'; import { ComponentMapperComponent } from '../../../../../../../packages/angular-sdk-components/src/lib/_bridge/component-mapper/component-mapper.component'; @@ -11,7 +11,7 @@ import { ComponentMapperComponent } from '../../../../../../../packages/angular- templateUrl: './main-screen.component.html', styleUrls: ['./main-screen.component.scss'], standalone: true, - imports: [CommonModule, BundleSwatchComponent, ComponentMapperComponent, ResolutionScreenComponent] + imports: [CommonModule, ShoppingCardComponent, ComponentMapperComponent, ResolutionScreenComponent] }) export class MainScreenComponent implements OnInit, OnDestroy { @Input() pConn$: typeof PConnect; diff --git a/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.html b/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.html deleted file mode 100644 index 3a6f07ef..00000000 --- a/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.html +++ /dev/null @@ -1,4 +0,0 @@ - -
- -
diff --git a/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.scss b/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.scss deleted file mode 100644 index a7bd8ef8..00000000 --- a/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.scss +++ /dev/null @@ -1,4 +0,0 @@ -.psdk-main-content { - height: 100%; - overflow: auto; -} diff --git a/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.spec.ts b/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.spec.ts deleted file mode 100644 index 8eacd573..00000000 --- a/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { MCMainContentComponent } from './mc-main-content.component'; - -describe('MainContentComponent', () => { - let component: MCMainContentComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [MCMainContentComponent] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(MCMainContentComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.ts b/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.ts deleted file mode 100644 index acc92727..00000000 --- a/projects/angular-test-app/src/app/_samples/embedded/mc-main-content/mc-main-content.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { ComponentMapperComponent } from '../../../../../../../packages/angular-sdk-components/src/lib/_bridge/component-mapper/component-mapper.component'; - -@Component({ - selector: 'app-mc-main-content', - templateUrl: './mc-main-content.component.html', - styleUrls: ['./mc-main-content.component.scss'], - standalone: true, - imports: [CommonModule, ComponentMapperComponent] -}) -export class MCMainContentComponent implements OnInit { - @Input() pConn$: typeof PConnect; - - sComponentName$: string | undefined; - - ngOnInit(): void { - if (this.pConn$) { - this.sComponentName$ = this.pConn$.getComponentName(); - } - } -} diff --git a/projects/angular-test-app/src/app/_samples/embedded/bundle-swatch/bundle-swatch.component.html b/projects/angular-test-app/src/app/_samples/embedded/shopping-card/shopping-card.component.html similarity index 100% rename from projects/angular-test-app/src/app/_samples/embedded/bundle-swatch/bundle-swatch.component.html rename to projects/angular-test-app/src/app/_samples/embedded/shopping-card/shopping-card.component.html diff --git a/projects/angular-test-app/src/app/_samples/embedded/bundle-swatch/bundle-swatch.component.scss b/projects/angular-test-app/src/app/_samples/embedded/shopping-card/shopping-card.component.scss similarity index 100% rename from projects/angular-test-app/src/app/_samples/embedded/bundle-swatch/bundle-swatch.component.scss rename to projects/angular-test-app/src/app/_samples/embedded/shopping-card/shopping-card.component.scss diff --git a/projects/angular-test-app/src/app/_samples/embedded/bundle-swatch/bundle-swatch.component.spec.ts b/projects/angular-test-app/src/app/_samples/embedded/shopping-card/shopping-card.component.spec.ts similarity index 54% rename from projects/angular-test-app/src/app/_samples/embedded/bundle-swatch/bundle-swatch.component.spec.ts rename to projects/angular-test-app/src/app/_samples/embedded/shopping-card/shopping-card.component.spec.ts index baff0edc..855c48ac 100644 --- a/projects/angular-test-app/src/app/_samples/embedded/bundle-swatch/bundle-swatch.component.spec.ts +++ b/projects/angular-test-app/src/app/_samples/embedded/shopping-card/shopping-card.component.spec.ts @@ -1,19 +1,19 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { BundleSwatchComponent } from './bundle-swatch.component'; +import { ShoppingCardComponent } from './shopping-card.component'; -describe('BundleSwatchComponent', () => { - let component: BundleSwatchComponent; - let fixture: ComponentFixture; +describe('ShoppingCardComponent', () => { + let component: ShoppingCardComponent; + let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [BundleSwatchComponent] + declarations: [ShoppingCardComponent] }).compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(BundleSwatchComponent); + fixture = TestBed.createComponent(ShoppingCardComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/projects/angular-test-app/src/app/_samples/embedded/bundle-swatch/bundle-swatch.component.ts b/projects/angular-test-app/src/app/_samples/embedded/shopping-card/shopping-card.component.ts similarity index 86% rename from projects/angular-test-app/src/app/_samples/embedded/bundle-swatch/bundle-swatch.component.ts rename to projects/angular-test-app/src/app/_samples/embedded/shopping-card/shopping-card.component.ts index 81dde04c..a6a49da9 100644 --- a/projects/angular-test-app/src/app/_samples/embedded/bundle-swatch/bundle-swatch.component.ts +++ b/projects/angular-test-app/src/app/_samples/embedded/shopping-card/shopping-card.component.ts @@ -1,12 +1,12 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; @Component({ - selector: 'app-bundle-swatch', - templateUrl: './bundle-swatch.component.html', - styleUrls: ['./bundle-swatch.component.scss'], + selector: 'app-shopping-card', + templateUrl: './shopping-card.component.html', + styleUrls: ['./shopping-card.component.scss'], standalone: true }) -export class BundleSwatchComponent implements OnInit { +export class ShoppingCardComponent implements OnInit { @Input() swatchConfig$: any; @Output() ShopNowButtonClick: EventEmitter = new EventEmitter(); diff --git a/projects/angular-test-app/src/app/routes.ts b/projects/angular-test-app/src/app/routes.ts index f2e38bc6..8942d981 100644 --- a/projects/angular-test-app/src/app/routes.ts +++ b/projects/angular-test-app/src/app/routes.ts @@ -1,7 +1,7 @@ import { Routes } from '@angular/router'; import { TopAppMashupComponent } from './_samples/full-portal/top-app-mashup/top-app-mashup.component'; import { NavigationComponent } from './_samples/simple-portal/navigation/navigation.component'; -import { MCNavComponent } from './_samples/embedded/mc-nav/mc-nav.component'; +import { HeaderComponent } from './_samples/embedded/header/header.component'; import { endpoints } from '../../../../packages/angular-sdk-components/src/lib/_services/endpoints'; // Adding path to remove "Cannot match routes" error at launch @@ -17,15 +17,15 @@ import { endpoints } from '../../../../packages/angular-sdk-components/src/lib/_ // similiar to Nebula/Constellaion) export const routes: Routes = [ - { path: '', component: MCNavComponent }, + { path: '', component: HeaderComponent }, { path: endpoints.PORTAL, component: TopAppMashupComponent }, { path: endpoints.PORTALHTML, component: TopAppMashupComponent }, { path: endpoints.FULLPORTAL, component: TopAppMashupComponent }, { path: endpoints.FULLPORTALHTML, component: TopAppMashupComponent }, { path: endpoints.SIMPLEPORTAL, component: NavigationComponent }, { path: endpoints.SIMPLEPORTALHTML, component: NavigationComponent }, - { path: endpoints.EMBEDDED, component: MCNavComponent }, - { path: endpoints.EMBEDDEDHTML, component: MCNavComponent }, - { path: endpoints.MASHUP, component: MCNavComponent }, - { path: endpoints.MASHUPHTML, component: MCNavComponent } + { path: endpoints.EMBEDDED, component: HeaderComponent }, + { path: endpoints.EMBEDDEDHTML, component: HeaderComponent }, + { path: endpoints.MASHUP, component: HeaderComponent }, + { path: endpoints.MASHUPHTML, component: HeaderComponent } ];