Rename controlpanel.component to app.component 07/5607/1
authorelinuxhenrik <henrik.b.andersson@est.tech>
Mon, 8 Feb 2021 14:40:38 +0000 (15:40 +0100)
committerelinuxhenrik <henrik.b.andersson@est.tech>
Mon, 8 Feb 2021 14:42:45 +0000 (15:42 +0100)
To follow Angular naming conventions.

Change-Id: I5208bfab7e025a5dd53e96080aa25b1a1397f724
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
Issue-ID: NONRTRIC-432

webapp-frontend/src/app/app-routing.module.ts [moved from webapp-frontend/src/app/controlpanel-routing.module.ts with 97% similarity]
webapp-frontend/src/app/app.component.html
webapp-frontend/src/app/app.component.sass [deleted file]
webapp-frontend/src/app/app.component.scss [moved from webapp-frontend/src/app/controlpanel.component.scss with 100% similarity]
webapp-frontend/src/app/app.component.spec.ts
webapp-frontend/src/app/app.component.ts
webapp-frontend/src/app/app.module.ts [moved from webapp-frontend/src/app/controlpanel.module.ts with 95% similarity]
webapp-frontend/src/app/controlpanel.component.html [deleted file]
webapp-frontend/src/app/controlpanel.component.spec.ts [deleted file]
webapp-frontend/src/app/controlpanel.component.ts [deleted file]
webapp-frontend/src/main.ts

@@ -42,4 +42,4 @@ const routes: Routes = [
     declarations: []
 })
 
-export class ControlpanelRoutingModule { }
+export class AppRoutingModule { }
index 838606d..494477e 100644 (file)
@@ -1,8 +1,117 @@
-<div style="text-align:center">
-    <h1>
-      Welcome to {{title}}!
-    </h1>
-    <img width="300" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyNTAgMjUwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNTAgMjUwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDojREQwMDMxO30NCgkuc3Qxe2ZpbGw6I0MzMDAyRjt9DQoJLnN0MntmaWxsOiNGRkZGRkY7fQ0KPC9zdHlsZT4NCjxnPg0KCTxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMTI1LDMwIDEyNSwzMCAxMjUsMzAgMzEuOSw2My4yIDQ2LjEsMTg2LjMgMTI1LDIzMCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAJIi8+DQoJPHBvbHlnb24gY2xhc3M9InN0MSIgcG9pbnRzPSIxMjUsMzAgMTI1LDUyLjIgMTI1LDUyLjEgMTI1LDE1My40IDEyNSwxNTMuNCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAxMjUsMzAgCSIvPg0KCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xMjUsNTIuMUw2Ni44LDE4Mi42aDBoMjEuN2gwbDExLjctMjkuMmg0OS40bDExLjcsMjkuMmgwaDIxLjdoMEwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMQ0KCQlMMTI1LDUyLjF6IE0xNDIsMTM1LjRIMTA4bDE3LTQwLjlMMTQyLDEzNS40eiIvPg0KPC9nPg0KPC9zdmc+DQo=">
-  </div>
-<router-outlet></router-outlet>
\ No newline at end of file
+<!--
+  ========================LICENSE_START=================================
+  O-RAN-SC
+  %%
+  Copyright (C) 2019 AT&T Intellectual Property
+  %%
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ========================LICENSE_END===================================
+  -->
+<!-- Slide Menu-->
+<mat-drawer-container autosize>
+  <mat-drawer #drawer mode="push" [ngClass]="{'side-menu__dark': darkMode}">
+    <section class="menu-header" [ngClass]="{'menu-header__dark': darkMode}">
+
+      <div class="left__section3Col" *ngIf="drawer.opened" [ngClass]="{'menumargin-top': drawer.opened}">
+        <svg (click)="drawer.toggle()" class="hamburger__icon" id="Menu_Burger_Icon" data-name="Menu Burger Icon"
+          viewBox="31.5 30 49.9 32">
+          <rect id="Rectangle_9" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+            class="hamburger__icon__fill" data-name="Rectangle 9" rx="2" transform="translate(31.5 58)" />
+          <rect id="Rectangle_10" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+            class="hamburger__icon__fill" data-name="Rectangle 10" rx="2" transform="translate(31.5 44)" />
+          <rect id="Rectangle_11" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+            class="hamburger__icon__fill" data-name="Rectangle 11" rx="2" transform="translate(31.5 30)" />
+        </svg>
+        <img src="assets/oran-logo.png" width="180%" height="100%" style="position: relative; z-index: 50" />
+        <svg class="logo__icon" viewBox="150.3 22.2 450 50">
+          <text [ngClass]="{'logo__text-dark': darkMode}" class="logo__text" fill="#432c85" font-size="30"
+            font-weight="600" letter-spacing=".1em" transform="translate(149 56)">
+            <tspan x="0" y="0">Non-RT RIC Control Panel</tspan>
+          </text>
+        </svg>
+
+      </div>
+
+      <div class="profile-image__container">
+        <img src="assets/profile_default.png" alt="profile-image" class="profile__image">
+      </div>
+      <div class="account-details">
+        <span class="name__text">Demo</span>
+        <span class="email__text">demo@o-ran-sc.org</span>
+      </div>
+    </section>
+    <section #sidenav class="menu-body">
+      <nrcp-sidenav-list (sidenavClose)="drawer.toggle()">></nrcp-sidenav-list>
+    </section>
+    <section class="menu-footer">
+
+    </section>
+  </mat-drawer>
+
+  <mat-drawer-content>
+    <div class="root__container">
+
+      <header [ngClass]="{'main__header-dark': darkMode}" class="main__header">
+
+        <div class="left__section3Col" *ngIf="!drawer.opened">
+          <svg (click)="drawer.toggle()" class="hamburger__icon" id="Menu_Burger_Icon" data-name="Menu Burger Icon"
+            viewBox="31.5 30 49.9 32">
+            <rect id="Rectangle_9" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+              class="hamburger__icon__fill" data-name="Rectangle 9" rx="2" transform="translate(31.5 58)" />
+            <rect id="Rectangle_10" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+              class="hamburger__icon__fill" data-name="Rectangle 10" rx="2" transform="translate(31.5 44)" />
+            <rect id="Rectangle_11" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
+              class="hamburger__icon__fill" data-name="Rectangle 11" rx="2" transform="translate(31.5 30)" />
+          </svg>
+          <img src="assets/oran-logo.png" width="180%" height="100%" style="position: relative; z-index: 50" />
+          <svg class="logo__icon" viewBox="150.3 22.2 450 50">
+            <text [ngClass]="{'logo__text-dark': darkMode}" class="logo__text" fill="#432c85" font-size="30"
+              font-weight="600" letter-spacing=".1em" transform="translate(149 56)">
+              <tspan x="0" y="0">Non-RT RIC Control Panel</tspan>
+            </text>
+          </svg>
+
+        </div>
+
+        <h3 class="date__text"></h3>
+
+        <div class="mode-toggle__container">
+          <span class="mode-toggle__text">Light</span>
+          <label class="toggle-button__container">
+            <input (click)="modeToggleSwitch()" type="checkbox" class="mode-toggle__input" />
+            <span [ngClass]="{'mode-toggle__bg-checked': darkMode}" class="mode-toggle__bg"></span>
+            <span [ngClass]="{'mode-toggle__circle-checked': darkMode}" class="mode-toggle__circle"></span>
+          </label>
+          <span class="mode-toggle__text">Dark</span>
+        </div>
+
+      </header>
+
+      <!-- Main Content -->
+      <main class="main__container" [ngClass]="{'main-container__bg-dark': darkMode}">
+        <div class=main__container__body [ngClass]="{'dark-theme': darkMode}">
+          <div class="main-container__bg"></div>
+          <router-outlet></router-outlet>
+        </div>
+      </main>
+
+      <!-- Footer -->
+      <footer class="main__footer" [ngClass]="{'main-footer__bg-dark': darkMode}">
+        <div class="main-footer__bg">
+          <nrcp-footer></nrcp-footer>
+        </div>
+      </footer>
+
+    </div>
+  </mat-drawer-content>
+</mat-drawer-container>
\ No newline at end of file
diff --git a/webapp-frontend/src/app/app.component.sass b/webapp-frontend/src/app/app.component.sass
deleted file mode 100644 (file)
index e69de29..0000000
index 3e707be..24a2d6f 100644 (file)
@@ -1,29 +1,52 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
 import { TestBed, async } from '@angular/core/testing';
 import { RouterTestingModule } from '@angular/router/testing';
+import { CookieService } from 'ngx-cookie';
 import { AppComponent } from './app.component';
+import { UiService } from './services/ui/ui.service';
 
 describe('AppComponent', () => {
   beforeEach(async(() => {
+    const cookieSpy = jasmine.createSpyObj('CookieService', [ 'get' ]);
     TestBed.configureTestingModule({
-      declarations: [
-        AppComponent
-      ],
       imports: [
         RouterTestingModule
       ],
-      providers: []
+      schemas: [
+        CUSTOM_ELEMENTS_SCHEMA
+      ],
+      declarations: [
+        AppComponent
+      ],
+      providers: [
+        { provide: CookieService, useValue: cookieSpy },
+        UiService
+      ]
     }).compileComponents();
   }));
 
-  it('should create the app', async(() => {
+  it('should create the app', () => {
     const fixture = TestBed.createComponent(AppComponent);
     const app = fixture.debugElement.componentInstance;
     expect(app).toBeTruthy();
-  }));
-
-  it(`should have as title 'controlpanelApp'`, async(() => {
-    const fixture = TestBed.createComponent(AppComponent);
-    const app = fixture.debugElement.componentInstance;
-    expect(app.title).toEqual('controlpanelApp');
-  }));
-});
\ No newline at end of file
+  });
+});
index 7115687..544f0c4 100644 (file)
@@ -1,10 +1,57 @@
-import { Component } from '@angular/core';
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+import { Component, OnInit } from '@angular/core';
+import { UiService } from './services/ui/ui.service';
+import { CookieService } from 'ngx-cookie';
 
 @Component({
-  selector: 'app-root',
+  selector: 'nrcp-root',
   templateUrl: './app.component.html',
-  styleUrls: ['./app.component.sass']
+  styleUrls: ['./app.component.scss']
 })
-export class AppComponent {
-  title = 'controlpanelApp';
-}
\ No newline at end of file
+export class AppComponent implements OnInit {
+  private showMenu = false;
+  darkMode: boolean;
+  private 'DARK_MODE_COOKIE' = 'darkMode';
+
+  constructor(private cookieService: CookieService, private ui: UiService) {
+  }
+
+  ngOnInit() {
+    const dark = this.cookieService.get(this.DARK_MODE_COOKIE);
+    if (dark) {
+      this.ui.darkModeState.next(dark === 'yes');
+    }
+
+    this.ui.darkModeState.subscribe((value) => {
+      this.darkMode = value;
+    });
+  }
+
+  toggleMenu() {
+    this.showMenu = !this.showMenu;
+  }
+
+  modeToggleSwitch() {
+    this.ui.darkModeState.next(!this.darkMode);
+    this.cookieService.put(this.DARK_MODE_COOKIE, this.darkMode ? 'yes' : 'no');
+  }
+
+}
similarity index 95%
rename from webapp-frontend/src/app/controlpanel.module.ts
rename to webapp-frontend/src/app/app.module.ts
index ea14a5d..6cfabc8 100644 (file)
@@ -50,8 +50,8 @@ import { PolicyCardComponent } from './ui/policy-card/policy-card.component';
 import { PolicyControlComponent } from './policy-control/policy-control.component';
 import { PolicyInstanceComponent } from './policy-control/policy-instance.component';
 import { PolicyInstanceDialogComponent } from './policy-control/policy-instance-dialog.component';
-import { ControlpanelComponent } from './controlpanel.component';
-import { ControlpanelRoutingModule } from './controlpanel-routing.module';
+import { AppComponent } from './app.component';
+import { AppRoutingModule } from './app-routing.module';
 import { SidenavListComponent } from './navigation/sidenav-list/sidenav-list.component';
 import { UiService } from './services/ui/ui.service';
 import { CookieModule } from 'ngx-cookie';
@@ -66,8 +66,8 @@ export const isMock = environment.mock;
 
 @NgModule({
   declarations: [
+    AppComponent,
     ConfirmDialogComponent,
-    ControlpanelComponent,
     EICardComponent,
     EICoordinatorComponent,
     ErrorDialogComponent,
@@ -82,10 +82,10 @@ export const isMock = environment.mock;
     SidenavListComponent,
   ],
   imports: [
+    AppRoutingModule,
     BrowserModule,
     BrowserAnimationsModule,
     ChartsModule,
-    ControlpanelRoutingModule,
     CookieModule.forRoot(),
     FlexLayoutModule,
     FormsModule,
@@ -153,6 +153,6 @@ export const isMock = environment.mock;
       multi: true
       }
   ],
-  bootstrap: [ControlpanelComponent]
+  bootstrap: [AppComponent]
 })
-export class ControlpanelModule { }
+export class AppModule { }
diff --git a/webapp-frontend/src/app/controlpanel.component.html b/webapp-frontend/src/app/controlpanel.component.html
deleted file mode 100644 (file)
index 494477e..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-<!--
-  ========================LICENSE_START=================================
-  O-RAN-SC
-  %%
-  Copyright (C) 2019 AT&T Intellectual Property
-  %%
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  ========================LICENSE_END===================================
-  -->
-<!-- Slide Menu-->
-<mat-drawer-container autosize>
-  <mat-drawer #drawer mode="push" [ngClass]="{'side-menu__dark': darkMode}">
-    <section class="menu-header" [ngClass]="{'menu-header__dark': darkMode}">
-
-      <div class="left__section3Col" *ngIf="drawer.opened" [ngClass]="{'menumargin-top': drawer.opened}">
-        <svg (click)="drawer.toggle()" class="hamburger__icon" id="Menu_Burger_Icon" data-name="Menu Burger Icon"
-          viewBox="31.5 30 49.9 32">
-          <rect id="Rectangle_9" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
-            class="hamburger__icon__fill" data-name="Rectangle 9" rx="2" transform="translate(31.5 58)" />
-          <rect id="Rectangle_10" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
-            class="hamburger__icon__fill" data-name="Rectangle 10" rx="2" transform="translate(31.5 44)" />
-          <rect id="Rectangle_11" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
-            class="hamburger__icon__fill" data-name="Rectangle 11" rx="2" transform="translate(31.5 30)" />
-        </svg>
-        <img src="assets/oran-logo.png" width="180%" height="100%" style="position: relative; z-index: 50" />
-        <svg class="logo__icon" viewBox="150.3 22.2 450 50">
-          <text [ngClass]="{'logo__text-dark': darkMode}" class="logo__text" fill="#432c85" font-size="30"
-            font-weight="600" letter-spacing=".1em" transform="translate(149 56)">
-            <tspan x="0" y="0">Non-RT RIC Control Panel</tspan>
-          </text>
-        </svg>
-
-      </div>
-
-      <div class="profile-image__container">
-        <img src="assets/profile_default.png" alt="profile-image" class="profile__image">
-      </div>
-      <div class="account-details">
-        <span class="name__text">Demo</span>
-        <span class="email__text">demo@o-ran-sc.org</span>
-      </div>
-    </section>
-    <section #sidenav class="menu-body">
-      <nrcp-sidenav-list (sidenavClose)="drawer.toggle()">></nrcp-sidenav-list>
-    </section>
-    <section class="menu-footer">
-
-    </section>
-  </mat-drawer>
-
-  <mat-drawer-content>
-    <div class="root__container">
-
-      <header [ngClass]="{'main__header-dark': darkMode}" class="main__header">
-
-        <div class="left__section3Col" *ngIf="!drawer.opened">
-          <svg (click)="drawer.toggle()" class="hamburger__icon" id="Menu_Burger_Icon" data-name="Menu Burger Icon"
-            viewBox="31.5 30 49.9 32">
-            <rect id="Rectangle_9" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
-              class="hamburger__icon__fill" data-name="Rectangle 9" rx="2" transform="translate(31.5 58)" />
-            <rect id="Rectangle_10" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
-              class="hamburger__icon__fill" data-name="Rectangle 10" rx="2" transform="translate(31.5 44)" />
-            <rect id="Rectangle_11" width="49.9" height="4" [ngClass]="{'hamburger__icon__fill-dark': darkMode}"
-              class="hamburger__icon__fill" data-name="Rectangle 11" rx="2" transform="translate(31.5 30)" />
-          </svg>
-          <img src="assets/oran-logo.png" width="180%" height="100%" style="position: relative; z-index: 50" />
-          <svg class="logo__icon" viewBox="150.3 22.2 450 50">
-            <text [ngClass]="{'logo__text-dark': darkMode}" class="logo__text" fill="#432c85" font-size="30"
-              font-weight="600" letter-spacing=".1em" transform="translate(149 56)">
-              <tspan x="0" y="0">Non-RT RIC Control Panel</tspan>
-            </text>
-          </svg>
-
-        </div>
-
-        <h3 class="date__text"></h3>
-
-        <div class="mode-toggle__container">
-          <span class="mode-toggle__text">Light</span>
-          <label class="toggle-button__container">
-            <input (click)="modeToggleSwitch()" type="checkbox" class="mode-toggle__input" />
-            <span [ngClass]="{'mode-toggle__bg-checked': darkMode}" class="mode-toggle__bg"></span>
-            <span [ngClass]="{'mode-toggle__circle-checked': darkMode}" class="mode-toggle__circle"></span>
-          </label>
-          <span class="mode-toggle__text">Dark</span>
-        </div>
-
-      </header>
-
-      <!-- Main Content -->
-      <main class="main__container" [ngClass]="{'main-container__bg-dark': darkMode}">
-        <div class=main__container__body [ngClass]="{'dark-theme': darkMode}">
-          <div class="main-container__bg"></div>
-          <router-outlet></router-outlet>
-        </div>
-      </main>
-
-      <!-- Footer -->
-      <footer class="main__footer" [ngClass]="{'main-footer__bg-dark': darkMode}">
-        <div class="main-footer__bg">
-          <nrcp-footer></nrcp-footer>
-        </div>
-      </footer>
-
-    </div>
-  </mat-drawer-content>
-</mat-drawer-container>
\ No newline at end of file
diff --git a/webapp-frontend/src/app/controlpanel.component.spec.ts b/webapp-frontend/src/app/controlpanel.component.spec.ts
deleted file mode 100644 (file)
index 4a86e91..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2019 AT&T Intellectual Property
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-import { TestBed, async } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { AppComponent } from './app.component';
-
-describe('AppComponent', () => {
-  beforeEach(async(() => {
-    TestBed.configureTestingModule({
-      imports: [
-        RouterTestingModule
-      ],
-      declarations: [
-        AppComponent
-      ],
-    }).compileComponents();
-  }));
-
-  it('should create the app', () => {
-    const fixture = TestBed.createComponent(AppComponent);
-    const app = fixture.debugElement.componentInstance;
-    expect(app).toBeTruthy();
-  });
-
-  it(`should have as title 'controlpanelApp'`, () => {
-    const fixture = TestBed.createComponent(AppComponent);
-    const app = fixture.debugElement.componentInstance;
-    expect(app.title).toEqual('controlpanelApp');
-  });
-
-  it('should render title in a h1 tag', () => {
-    const fixture = TestBed.createComponent(AppComponent);
-    fixture.detectChanges();
-    const compiled = fixture.debugElement.nativeElement;
-    expect(compiled.querySelector('h1').textContent).toContain('Welcome to controlpanelApp!');
-  });
-});
diff --git a/webapp-frontend/src/app/controlpanel.component.ts b/webapp-frontend/src/app/controlpanel.component.ts
deleted file mode 100644 (file)
index b85d524..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2019 AT&T Intellectual Property
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-import { Component, OnInit } from '@angular/core';
-import { UiService } from './services/ui/ui.service';
-import { CookieService } from 'ngx-cookie';
-
-@Component({
-  selector: 'nrcp-root',
-  templateUrl: './controlpanel.component.html',
-  styleUrls: ['./controlpanel.component.scss']
-})
-export class ControlpanelComponent implements OnInit {
-  private showMenu = false;
-  private darkMode: boolean;
-  private 'DARK_MODE_COOKIE' = 'darkMode';
-
-  constructor(private cookieService: CookieService, private ui: UiService) {
-  }
-
-  ngOnInit() {
-    const dark = this.cookieService.get(this.DARK_MODE_COOKIE);
-    if (dark) {
-      this.ui.darkModeState.next(dark === 'yes');
-    }
-
-    this.ui.darkModeState.subscribe((value) => {
-      this.darkMode = value;
-    });
-  }
-
-  toggleMenu() {
-    this.showMenu = !this.showMenu;
-  }
-
-  modeToggleSwitch() {
-    this.ui.darkModeState.next(!this.darkMode);
-    this.cookieService.put(this.DARK_MODE_COOKIE, this.darkMode ? 'yes' : 'no');
-  }
-
-}
index 8aaa09a..7b06452 100644 (file)
 import { enableProdMode } from '@angular/core';
 import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
 
-import { ControlpanelModule } from './app/controlpanel.module';
+import { AppModule } from './app/app.module';
 import { environment } from './environments/environment';
 
 if (environment.production) {
   enableProdMode();
 }
 
-platformBrowserDynamic().bootstrapModule(ControlpanelModule)
+platformBrowserDynamic().bootstrapModule(AppModule)
   .catch(err => console.error(err));