Clean up the frontend of ECS 87/5387/2
authorelinuxhenrik <henrik.b.andersson@est.tech>
Tue, 5 Jan 2021 07:27:06 +0000 (08:27 +0100)
committerelinuxhenrik <henrik.b.andersson@est.tech>
Tue, 5 Jan 2021 13:32:37 +0000 (14:32 +0100)
Also added "owner" data to the mocked jobs.
Also fixed so the side navigation bar is closed when a selection has
been made.

Change-Id: I651ae7e8eea3f40992fdcbe9900489534e0562f4
Issue-ID: NONRTRIC-372
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
webapp-frontend/src/app/controlpanel.component.html
webapp-frontend/src/app/controlpanel.module.ts
webapp-frontend/src/app/footer/footer.component.ts
webapp-frontend/src/app/interfaces/controlpanel.types.ts
webapp-frontend/src/app/mock/ei-jobs.json
webapp-frontend/src/app/services/controlpanel/controlpanel.service.spec.ts [deleted file]
webapp-frontend/src/app/services/controlpanel/controlpanel.service.ts [deleted file]

index a6ae9e0..649a5d5 100644 (file)
@@ -51,7 +51,7 @@
       </div>
     </section>
     <section #sidenav class="menu-body">
-      <rd-sidenav-list></rd-sidenav-list>
+      <rd-sidenav-list (sidenavClose)="drawer.toggle()">></rd-sidenav-list>
     </section>
     <section class="menu-footer">
 
index 8e958a9..d635823 100644 (file)
@@ -39,7 +39,6 @@ import { MDBBootstrapModule } from 'angular-bootstrap-md';
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { ToastrModule } from 'ngx-toastr';
 import { ConfirmDialogComponent } from './ui/confirm-dialog/confirm-dialog.component';
-import { ControlpanelService } from './services/controlpanel/controlpanel.service';
 import { ErrorDialogComponent } from './ui/error-dialog/error-dialog.component';
 import { ErrorDialogService } from './services/ui/error-dialog.service';
 import { FlexLayoutModule } from '@angular/flex-layout';
@@ -146,7 +145,6 @@ export const isMock = environment.mock;
     PolicyInstanceDialogComponent
   ],
   providers: [
-    ControlpanelService,
     ErrorDialogService,
     UiService,
     {
index 47e768e..dc4c3c3 100644 (file)
@@ -20,8 +20,6 @@
  * ========================LICENSE_END===================================
  */
 import { Component, OnInit } from '@angular/core';
-import { ControlpanelSuccessTransport } from '../interfaces/controlpanel.types';
-import { ControlpanelService } from '../services/controlpanel/controlpanel.service';
 import { UiService } from '../services/ui/ui.service';
 
 @Component({
@@ -38,12 +36,10 @@ export class FooterComponent implements OnInit {
   controlpanelVersion: string;
 
   // Inject the service
-  constructor(private controlpanelService: ControlpanelService,
-    private ui: UiService) { }
+  constructor(private ui: UiService) { }
 
   ngOnInit() {
     this.controlpanelVersion = '0.0';
-    // this.controlpanelService.getVersion().subscribe((res: ControlpanelSuccessTransport) => this.controlpanelVersion = res.data);
     this.ui.darkModeState.subscribe((isDark) => {
       this.darkMode = isDark;
     });
index 44e1d9f..cad0630 100644 (file)
@@ -25,34 +25,3 @@ export interface ControlpanelSuccessTransport {
   status: number;
   data: string;
 }
-
-export interface EcompRoleFunction {
-  name: string;
-  code: string;
-  type: string;
-  action: string;
-}
-
-export interface EcompRole {
-  id: number;
-  name: string;
-  [position: number]: EcompRoleFunction;
-}
-
-export interface EcompUser {
-  orgId?: number;
-  managerId?: string;
-  firstName?: string;
-  middleInitial?: string;
-  lastName?: string;
-  phone?: string;
-  email?: string;
-  hrid?: string;
-  orgUserId?: string;
-  orgCode?: string;
-  orgManagerUserId?: string;
-  jobTitle?: string;
-  loginId: string;
-  active: boolean;
-  [position: number]: EcompRole;
-}
index ffe37d7..6d96872 100644 (file)
@@ -2,6 +2,7 @@
     {
       "ei_job_identity": "job1",
       "ei_type_identity": "type1",
+      "owner": "owner1",
       "ei_job_data": {
         "jobparam2": "value2_job1",
         "jobparam3": "value3_job1",
diff --git a/webapp-frontend/src/app/services/controlpanel/controlpanel.service.spec.ts b/webapp-frontend/src/app/services/controlpanel/controlpanel.service.spec.ts
deleted file mode 100644 (file)
index d94a779..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2019 AT&T Intellectual Property
- * Modifications Copyright (C) 2020 Nordix Foundation
- * %%
- * 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 } from '@angular/core/testing';
-
-import { ControlpanelService } from './controlpanel.service';
-
-describe('ControlpanelService', () => {
-  beforeEach(() => TestBed.configureTestingModule({}));
-
-  it('should be created', () => {
-    const service: ControlpanelService = TestBed.get(ControlpanelService);
-    expect(service).toBeTruthy();
-  });
-});
diff --git a/webapp-frontend/src/app/services/controlpanel/controlpanel.service.ts b/webapp-frontend/src/app/services/controlpanel/controlpanel.service.ts
deleted file mode 100644 (file)
index 5aed53b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2019 AT&T Intellectual Property
- * Modifications Copyright (C) 2020 Nordix Foundation
- * %%
- * 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 { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
-import { Observable } from 'rxjs';
-import { ControlpanelSuccessTransport, EcompUser } from '../../interfaces/controlpanel.types';
-
-@Injectable({
-  providedIn: 'root'
-})
-
-/**
- * Services to query the Control Panel's admin endpoints.
- */
-export class ControlpanelService {
-
-  private basePath = 'api/admin/';
-
-  constructor(private httpClient: HttpClient) {
-    // injects to variable httpClient
-  }
-
- /**
-   * Checks app health
-   * @returns Observable that should yield a ControlpanelSuccessTransport
-   */
-  getHealth(): Observable<ControlpanelSuccessTransport> {
-    return this.httpClient.get<ControlpanelSuccessTransport>(this.basePath + 'health');
-  }
-
-  /**
-   * Gets Control Panel version details
-   * @returns Observable that should yield a ControlpanelSuccessTransport object
-   */
-  getVersion(): Observable<ControlpanelSuccessTransport> {
-    return this.httpClient.get<ControlpanelSuccessTransport>(this.basePath + 'version');
-  }
-
-  /**
-   * Gets Control Panel users
-   * @returns Observable that should yield a EcompUser array
-   */
-  getUsers(): Observable<EcompUser[]> {
-    return this.httpClient.get<EcompUser[]>(this.basePath + 'user');
-  }
-
-}