X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fui%2Floading-dialog.service.ts;fp=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fui%2Floading-dialog.service.ts;h=a172d28769cf945e8dd9ff24118c0f247141f063;hb=492897ca754d470da3cbbc31eb49caea8fa7fe2c;hp=0000000000000000000000000000000000000000;hpb=749749f288de7ef42e3d1507c7f07a4453a774b4;p=portal%2Fric-dashboard.git diff --git a/webapp-frontend/src/app/services/ui/loading-dialog.service.ts b/webapp-frontend/src/app/services/ui/loading-dialog.service.ts new file mode 100644 index 00000000..a172d287 --- /dev/null +++ b/webapp-frontend/src/app/services/ui/loading-dialog.service.ts @@ -0,0 +1,51 @@ +/*- + * ========================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; + + startLoading(msg: string) { + this.loadingDialogRef = this.dialog.open(LoadingDialogComponent, { + disableClose: true, + width: '480px', + position: { top: '100px' }, + data: { + message: msg + } + }); + } + + stopLoading() { + this.loadingDialogRef.close() + } + +} + +