* Use snake_case (not camelCase) names in AC policy front end
* Update A1 mediator client to spec version 0.10.3
* Extend AC control screen to read policy from A1
+* Create loading-dialog component and service
+* Showing the loading-dialog while making API call
+* Add notification and error handling for xapp configuration
Version 1.0.5, 5 July 2019
--------------------------
* ========================LICENSE_END===================================
*/
-import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { HttpResponse } from '@angular/common/http';
+import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { MatSort } from '@angular/material';
import { MatDialog } from '@angular/material/dialog';
import { fromEvent } from 'rxjs/observable/fromEvent';
-import { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators';
+import { debounceTime, distinctUntilChanged, finalize, tap } from 'rxjs/operators';
import { ANRNeighborCellRelation } from '../interfaces/anr-xapp.types';
import { ANRXappService } from '../services/anr-xapp/anr-xapp.service';
import { ErrorDialogService } from '../services/ui/error-dialog.service';
+import { LoadingDialogService } from '../services/ui/loading-dialog.service';
import { ConfirmDialogService } from './../services/ui/confirm-dialog.service';
import { NotificationService } from './../services/ui/notification.service';
import { AnrEditNcrDialogComponent } from './anr-edit-ncr-dialog.component';
private dialog: MatDialog,
private confirmDialogService: ConfirmDialogService,
private errorDialogService: ErrorDialogService,
+ private loadingDialogService: LoadingDialogService,
private notificationService: NotificationService) { }
ngOnInit() {
.openConfirmDialog('Are you sure you want to delete this relation?')
.afterClosed().subscribe(res => {
if (res) {
+ this.loadingDialogService.startLoading("Deleting");
this.anrXappService.deleteNcr(ncr.servingCellNrcgi, ncr.neighborCellNrpci)
+ .pipe(
+ finalize(() => this.loadingDialogService.stopLoading())
+ )
.subscribe(
(response: HttpResponse<Object>) => {
switch (response.status) {
* ========================LICENSE_END===================================
*/
-import { Component, OnInit, Inject } from '@angular/core';
+import { Component, Inject, OnInit } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
-import { AppMgrService } from '../services/app-mgr/app-mgr.service';
-import { ErrorDialogService } from '../services/ui/error-dialog.service';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { finalize } from 'rxjs/operators';
-
+import { AppMgrService } from '../services/app-mgr/app-mgr.service';
+import { ErrorDialogService } from '../services/ui/error-dialog.service';
+import { LoadingDialogService } from '../services/ui/loading-dialog.service';
+import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
+import { NotificationService } from './../services/ui/notification.service';
@Component({
selector: 'rd-app-configuration',
private dialogRef: MatDialogRef<AppConfigurationComponent>,
private appMgrService: AppMgrService,
private errorDiaglogService: ErrorDialogService,
+ private loadingDialogService: LoadingDialogService,
+ private notificationService: NotificationService,
@Inject(MAT_DIALOG_DATA) private data
) { }
xappMetadata: any;
xappConfigSchema: any;
- xappConfigData: any;
+ xappConfigData: any;
xappLayout:any;
ngOnInit() {
this.loadingSubject.next(true);
config: event,
layout: this.xappLayout
}
+ this.loadingDialogService.startLoading("Updating " + this.data.name + " configuration");
this.appMgrService.putConfig(config)
- this.dialogRef.close();
+ .pipe(
+ finalize(() => {
+ this.loadingDialogService.stopLoading();
+ this.dialogRef.close();
+ })
+ )
+ .subscribe(
+ (response: HttpResponse<Object>) => {
+ this.notificationService.success('Configuration update succeeded!');
+ },
+ ((her: HttpErrorResponse) => {
+ let msg = her.message;
+ if (her.error && her.error.message) {
+ msg = her.error.message;
+ }
+ this.notificationService.warn('Configuration update failed: ' + msg);
+ })
+ );
}
loadConfigForm(name: string, allConfig: any) {
* limitations under the License.
* ========================LICENSE_END===================================
*/
+import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
import { Component, OnInit, ViewChild } from '@angular/core';
-import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
import { MatSort } from '@angular/material/sort';
import { Router } from '@angular/router';
import { XappControlRow } from '../interfaces/app-mgr.types';
import { AppMgrService } from '../services/app-mgr/app-mgr.service';
import { ConfirmDialogService } from '../services/ui/confirm-dialog.service';
import { ErrorDialogService } from '../services/ui/error-dialog.service';
+import { LoadingDialogService } from '../services/ui/loading-dialog.service';
import { NotificationService } from '../services/ui/notification.service';
import { AppControlAnimations } from './app-control.animations';
import { AppControlDataSource } from './app-control.datasource';
+import { finalize } from 'rxjs/operators';
@Component({
selector: 'rd-app-control',
private router: Router,
private confirmDialogService: ConfirmDialogService,
private errorDialogService: ErrorDialogService,
+ private loadingDialogService: LoadingDialogService,
private notificationService: NotificationService) { }
ngOnInit() {
this.confirmDialogService.openConfirmDialog('Are you sure you want to undeploy App ' + app.xapp + '?')
.afterClosed().subscribe( (res: boolean) => {
if (res) {
- this.appMgrSvc.undeployXapp(app.xapp).subscribe(
+ this.loadingDialogService.startLoading("Undeploying " + app.xapp);
+ this.appMgrSvc.undeployXapp(app.xapp)
+ .pipe(
+ finalize(() => this.loadingDialogService.stopLoading())
+ )
+ .subscribe(
( httpResponse: HttpResponse<Object>) => {
// Answers 204/No content on success
this.notificationService.success('App undeployed successfully!');
* limitations under the License.
* ========================LICENSE_END===================================
*/
-import { Component, OnInit, ViewChild } from '@angular/core';
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { MatDialog } from '@angular/material/dialog';
import { MatSort } from '@angular/material/sort';
-import { ErrorDialogService } from '../services/ui/error-dialog.service';
+import { finalize } from 'rxjs/operators';
+import { XMDeployableApp } from '../interfaces/app-mgr.types';
import { AppMgrService } from '../services/app-mgr/app-mgr.service';
+import { ErrorDialogService } from '../services/ui/error-dialog.service';
+import { LoadingDialogService } from '../services/ui/loading-dialog.service';
+import { AppConfigurationComponent } from './../app-configuration/app-configuration.component';
import { ConfirmDialogService } from './../services/ui/confirm-dialog.service';
import { NotificationService } from './../services/ui/notification.service';
import { CatalogDataSource } from './catalog.datasource';
-import { XMDeployableApp } from '../interfaces/app-mgr.types';
-import { MatDialog } from '@angular/material/dialog';
-import { AppConfigurationComponent } from './../app-configuration/app-configuration.component';
@Component({
selector: 'rd-app-catalog',
private confirmDialogService: ConfirmDialogService,
private dialog: MatDialog,
private errorDiaglogService: ErrorDialogService,
+ private loadingDialogService: LoadingDialogService,
private notificationService: NotificationService) { }
ngOnInit() {
this.confirmDialogService.openConfirmDialog('Deploy application ' + app.name + '?')
.afterClosed().subscribe( (res: boolean) => {
if (res) {
- this.appMgrService.deployXapp(app.name).subscribe(
+ this.loadingDialogService.startLoading("Deploying " + app.name);
+ this.appMgrService.deployXapp(app.name)
+ .pipe(
+ finalize(() => this.loadingDialogService.stopLoading())
+ )
+ .subscribe(
(response: HttpResponse<Object>) => {
this.notificationService.success('App deploy succeeded!');
},
* limitations under the License.
* ========================LICENSE_END===================================
*/
-import { Component, OnInit, Inject } from '@angular/core';
-import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
-import { FormGroup, FormControl, Validators } from '@angular/forms';
-import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
+import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
+import { Component, OnInit } from '@angular/core';
+import { FormControl, FormGroup, Validators } from '@angular/forms';
+import { MatDialogRef } from '@angular/material/dialog';
import { Observable } from 'rxjs';
+import { finalize } from 'rxjs/operators';
+import { E2SetupRequest, RanDialogFormData } from '../interfaces/e2-mgr.types';
import { E2ManagerService } from '../services/e2-mgr/e2-mgr.service';
-import { NotificationService } from '../services/ui/notification.service';
import { ErrorDialogService } from '../services/ui/error-dialog.service';
-import { E2SetupRequest, RanDialogFormData } from '../interfaces/e2-mgr.types';
+import { LoadingDialogService } from '../services/ui/loading-dialog.service';
+import { NotificationService } from '../services/ui/notification.service';
@Component({
- selector: 'rd-ran-control-connect-dialog',
- templateUrl: './ran-connection-dialog.component.html',
- styleUrls: ['./ran-connection-dialog.component.scss']
+ selector: 'rd-ran-control-connect-dialog',
+ templateUrl: './ran-connection-dialog.component.html',
+ styleUrls: ['./ran-connection-dialog.component.scss']
})
export class RanControlConnectDialogComponent implements OnInit {
- public ranDialogForm: FormGroup;
- public processing = false;
+ public ranDialogForm: FormGroup;
+ public processing = false;
- constructor(
- private dialogRef: MatDialogRef<RanControlConnectDialogComponent>,
- private service: E2ManagerService,
- private errorService: ErrorDialogService,
- private notifService: NotificationService) {
- // opens with empty fields; accepts no data to display
- }
+ constructor(
+ private dialogRef: MatDialogRef<RanControlConnectDialogComponent>,
+ private service: E2ManagerService,
+ private errorService: ErrorDialogService,
+ private loadingDialogService: LoadingDialogService,
+ private notifService: NotificationService) {
+ // opens with empty fields; accepts no data to display
+ }
- ngOnInit() {
- const namePattern = /^([A-Z]){4}([0-9]){6}$/;
- // tslint:disable-next-line:max-line-length
- const ipPattern = /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/;
- const portPattern = /^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/;
- this.ranDialogForm = new FormGroup({
- ranType: new FormControl('endc'),
- ranName: new FormControl('', [Validators.required, Validators.pattern(namePattern)]),
- ranIp: new FormControl('', [Validators.required, Validators.pattern(ipPattern)]),
- ranPort: new FormControl('', [Validators.required, Validators.pattern(portPattern)])
- });
- }
+ ngOnInit() {
+ const namePattern = /^([A-Z]){4}([0-9]){6}$/;
+ // tslint:disable-next-line:max-line-length
+ const ipPattern = /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/;
+ const portPattern = /^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/;
+ this.ranDialogForm = new FormGroup({
+ ranType: new FormControl('endc'),
+ ranName: new FormControl('', [Validators.required, Validators.pattern(namePattern)]),
+ ranIp: new FormControl('', [Validators.required, Validators.pattern(ipPattern)]),
+ ranPort: new FormControl('', [Validators.required, Validators.pattern(portPattern)])
+ });
+ }
- onCancel() {
- this.dialogRef.close(false);
- }
+ onCancel() {
+ this.dialogRef.close(false);
+ }
- setupConnection = (ranFormValue: RanDialogFormData) => {
- if (!this.ranDialogForm.valid) {
- // should never happen
- return;
- }
- this.processing = true;
- const setupRequest: E2SetupRequest = {
- ranName: ranFormValue.ranName,
- ranIp: ranFormValue.ranIp,
- ranPort: ranFormValue.ranPort
- };
- let observable: Observable<HttpResponse<Object>>;
- if (ranFormValue.ranType === 'endc') {
- observable = this.service.endcSetup(setupRequest);
- } else {
- observable = this.service.x2Setup(setupRequest);
- }
- observable.subscribe(
- (response: any) => {
- this.processing = false;
- this.notifService.success('Connect succeeded!');
- this.dialogRef.close(true);
- },
- ( (her: HttpErrorResponse) => {
- this.processing = false;
- // the error field carries the server's response
- let msg = her.message;
- if (her.error && her.error.message) {
- msg = her.error.message;
- }
- this.errorService.displayError('Connect failed: ' + msg);
- // keep the dialog open
- })
- );
+ setupConnection = (ranFormValue: RanDialogFormData) => {
+ if (!this.ranDialogForm.valid) {
+ // should never happen
+ return;
+ }
+ this.processing = true;
+ const setupRequest: E2SetupRequest = {
+ ranName: ranFormValue.ranName,
+ ranIp: ranFormValue.ranIp,
+ ranPort: ranFormValue.ranPort
+ };
+ this.loadingDialogService.startLoading("Setting up connection ");
+ let observable: Observable<HttpResponse<Object>>;
+ if (ranFormValue.ranType === 'endc') {
+ observable = this.service.endcSetup(setupRequest);
+ } else {
+ observable = this.service.x2Setup(setupRequest);
}
+ observable
+ .pipe(
+ finalize(() => this.loadingDialogService.stopLoading())
+ )
+ .subscribe(
+ (response: any) => {
+ this.processing = false;
+ this.notifService.success('Connect succeeded!');
+ this.dialogRef.close(true);
+ },
+ ((her: HttpErrorResponse) => {
+ this.processing = false;
+ // the error field carries the server's response
+ let msg = her.message;
+ if (her.error && her.error.message) {
+ msg = her.error.message;
+ }
+ this.errorService.displayError('Connect failed: ' + msg);
+ // keep the dialog open
+ })
+ );
+ }
- hasError(controlName: string, errorName: string) {
- if (this.ranDialogForm.controls[controlName].hasError(errorName)) {
- return true;
- }
- return false;
+ hasError(controlName: string, errorName: string) {
+ if (this.ranDialogForm.controls[controlName].hasError(errorName)) {
+ return true;
}
+ return false;
+ }
- validateControl(controlName: string) {
- if (this.ranDialogForm.controls[controlName].invalid && this.ranDialogForm.controls[controlName].touched) {
- return true;
- }
- return false;
+ validateControl(controlName: string) {
+ if (this.ranDialogForm.controls[controlName].invalid && this.ranDialogForm.controls[controlName].touched) {
+ return true;
}
+ return false;
+ }
}
* limitations under the License.
* ========================LICENSE_END===================================
*/
+import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
-import { HttpResponse, HttpErrorResponse } from '@angular/common/http';
import { MatDialog } from '@angular/material/dialog';
-import { RanControlConnectDialogComponent } from './ran-connection-dialog.component';
+import { finalize } from 'rxjs/operators';
import { E2ManagerService } from '../services/e2-mgr/e2-mgr.service';
-import { ErrorDialogService } from '../services/ui/error-dialog.service';
import { ConfirmDialogService } from '../services/ui/confirm-dialog.service';
+import { ErrorDialogService } from '../services/ui/error-dialog.service';
+import { LoadingDialogService } from '../services/ui/loading-dialog.service';
import { NotificationService } from '../services/ui/notification.service';
+import { RanControlConnectDialogComponent } from './ran-connection-dialog.component';
import { RANControlDataSource } from './ran-control.datasource';
@Component({
private errorDialogService: ErrorDialogService,
private confirmDialogService: ConfirmDialogService,
private notificationService: NotificationService,
+ private loadingDialogService: LoadingDialogService,
public dialog: MatDialog) { }
ngOnInit() {
this.confirmDialogService.openConfirmDialog('Are you sure you want to disconnect all RAN connections?')
.afterClosed().subscribe( (res: boolean) => {
if (res) {
- this.e2MgrSvc.nodebPut().subscribe(
+ this.loadingDialogService.startLoading("Disconnecting");
+ this.e2MgrSvc.nodebPut()
+ .pipe(
+ finalize(() => this.loadingDialogService.stopLoading())
+ )
+ .subscribe(
( body: any ) => {
this.notificationService.success('Disconnect succeeded!');
this.dataSource.loadTable();
import { ErrorDialogService } from './services/ui/error-dialog.service';
import { FlexLayoutModule } from '@angular/flex-layout';
import { FooterComponent } from './footer/footer.component';
+import { LoadingDialogComponent } from './ui/loading-dialog/loading-dialog.component';
import { MainComponent } from './main/main.component';
import { MaterialDesignFrameworkModule } from 'angular6-json-schema-form';
import { ModalEventComponent } from './ui/modal-event/modal-event.component';
EditDashboardUserDialogComponent,
ErrorDialogComponent,
FooterComponent,
+ LoadingDialogComponent,
MainComponent,
ModalEventComponent,
RanControlComponent,
ConfirmDialogComponent,
EditDashboardUserDialogComponent,
ErrorDialogComponent,
+ LoadingDialogComponent,
RanControlConnectDialogComponent
],
providers: [
// injects to variable httpClient
}
- private basePath = 'api/appmgr/xapps';
+ private basePath = 'api/appmgr';
getDeployable(): Observable<XMDeployableApp[]> {
- return this.httpClient.get<XMDeployableApp[]>(this.basePath + '/list');
+ return this.httpClient.get<XMDeployableApp[]>(this.basePath + '/xapps/list');
}
getDeployed(): Observable<XMDeployedApp[]> {
- return this.httpClient.get<XMDeployedApp[]>(this.basePath);
+ return this.httpClient.get<XMDeployedApp[]>(this.basePath + '/xapps');
}
deployXapp(name: string): Observable<HttpResponse<Object>> {
const xappInfo: XMXappInfo = { name: name };
- return this.httpClient.post(this.basePath, xappInfo, { observe: 'response' });
+ return this.httpClient.post((this.basePath + '/xapps'), xappInfo, { observe: 'response' });
}
undeployXapp(name: string): Observable<HttpResponse<Object>> {
- return this.httpClient.delete((this.basePath + '/' + name), { observe: 'response' });
+ return this.httpClient.delete((this.basePath + '/xapps'+ '/' + name), { observe: 'response' });
}
getConfig(): Observable<any[]>{
return this.httpClient.get<any[]>("/assets/mockdata/config.json");
- //return this.httpClient.get<any[]>((this.basePath + '/config'));
+ //return this.httpClient.get<any[]>((this.basePath + '/config'));
}
putConfig(config: any): Observable<HttpResponse<Object>> {
- return this.httpClient.post((this.basePath + '/config' ), config, { observe: 'response' });
+ return this.httpClient.put((this.basePath + '/config' ), config, { observe: 'response' });
}
--- /dev/null
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * 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 { LoadingDialogService } from './loading-dialog.service';
+
+describe('LoadingDialogService', () => {
+ beforeEach(() => TestBed.configureTestingModule({}));
+
+ it('should be created', () => {
+ const service: LoadingDialogService = TestBed.get(LoadingDialogService);
+ expect(service).toBeTruthy();
+ });
+});
--- /dev/null
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * 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 { MatDialog, MatDialogRef } from '@angular/material/dialog';
+import { LoadingDialogComponent } from './../../ui/loading-dialog/loading-dialog.component';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class LoadingDialogService {
+
+ constructor(private dialog: MatDialog) { }
+
+ private loadingDialogRef: MatDialogRef<LoadingDialogComponent>;
+
+ startLoading(msg: string) {
+ this.loadingDialogRef = this.dialog.open(LoadingDialogComponent, {
+ disableClose: true,
+ width: '480px',
+ position: { top: '100px' },
+ data: {
+ message: msg
+ }
+ });
+ }
+
+ stopLoading() {
+ this.loadingDialogRef.close()
+ }
+
+}
+
+
--- /dev/null
+<!--
+ ========================LICENSE_START=================================
+ O-RAN-SC
+ %%
+ Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ %%
+ 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===================================
+ -->
+
+
+ <div mat-dialog-content>
+ {{data.message}}
+ </div>
+ <mat-spinner diameter=70></mat-spinner>
+
+
--- /dev/null
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * 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===================================
+ */
+
+mat-spinner {
+ margin: 10px
+}
--- /dev/null
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * 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 { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { LoadingDialogComponent } from './loading-dialog.component';
+
+describe('LoadingDialogComponent', () => {
+ let component: LoadingDialogComponent;
+ let fixture: ComponentFixture<LoadingDialogComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ LoadingDialogComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(LoadingDialogComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * 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, Inject } from '@angular/core';
+import { MAT_DIALOG_DATA } from '@angular/material';
+
+@Component({
+ selector: 'rd-loading-dialog',
+ templateUrl: './loading-dialog.component.html',
+ styleUrls: ['./loading-dialog.component.scss']
+})
+export class LoadingDialogComponent implements OnInit {
+
+ constructor(@Inject(MAT_DIALOG_DATA) public data) { }
+
+ ngOnInit() {
+ }
+
+}