GUI2 Changed loading screen display to be a component
Change-Id: Id1592b498e6827ec4cd3544dec92e46f00e8d378
diff --git a/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.html b/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.html
index 4a07787..77d5967 100644
--- a/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.html
+++ b/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.html
@@ -14,9 +14,10 @@
~ limitations under the License.
-->
<div id="ov-app" (dragover)="onDragOver($event)" (dragleave)="onDragLeave($event)" (drop)="onDrop($event)">
+ <onos-flash id="appMsgFlash" message="{{ alertMsg }}" dwell="5000" warning="true" (closed)="alertMsg = ''"></onos-flash>
+ <onos-loading [theme]="'light'" [running]="loadingIconShown"></onos-loading>
+ <onos-confirm title="{{ lionFn('dlg_confirm_action') }}" message="{{ confirmMsg }}" warning="{{ strongWarning }}" (chosen)="dOk($event)"></onos-confirm>
<div class="tabular-header">
- <onos-flash id="appMsgFlash" message="{{ alertMsg }}" dwell="5000" warning="true" (closed)="alertMsg = ''"></onos-flash>
- <onos-confirm title="{{ lionFn('dlg_confirm_action') }}" message="{{ confirmMsg }}" warning="{{ strongWarning }}" (chosen)="dOk($event)"></onos-confirm>
<h2>
{{lionFn('title_apps')}}
({{ tableData.length }}
diff --git a/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.spec.ts b/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.spec.ts
index 5864743..3e541bb 100644
--- a/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.spec.ts
+++ b/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.spec.ts
@@ -25,16 +25,14 @@
FnService,
IconService,
LionService,
- LoadingService,
LogService,
- TableBaseImpl, TableResponse, TableFilter, SortParams, SortDir,
UrlFnService,
WebSocketService,
TableFilterPipe,
ConfirmComponent,
FlashComponent,
IconComponent,
- ThemeService,
+ ThemeService, LoadingComponent,
} from 'gui2-fw-lib';
import { AppsComponent } from './apps.component';
@@ -57,12 +55,6 @@
loadIconDef() { }
}
-class MockLoadingService {
- startAnim() { }
- stop() { }
- waiting() { }
-}
-
class MockThemeService { }
class MockUrlFnService { }
@@ -118,7 +110,8 @@
IconComponent,
AppsDetailsComponent,
TableFilterPipe,
- FlashComponent
+ FlashComponent,
+ LoadingComponent
],
providers: [
{ provide: FnService, useValue: fs },
@@ -133,7 +126,6 @@
};
})
},
- { provide: LoadingService, useClass: MockLoadingService },
{ provide: LogService, useValue: logSpy },
{ provide: ThemeService, useClass: MockThemeService },
{ provide: UrlFnService, useClass: MockUrlFnService },
diff --git a/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.ts b/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.ts
index c933053..59d91ed 100644
--- a/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.ts
+++ b/web/gui2/src/main/webapp/app/view/apps/apps/apps.component.ts
@@ -14,18 +14,16 @@
* limitations under the License.
*/
import { Component, OnInit, OnDestroy, Inject } from '@angular/core';
-import { HttpClient, HttpErrorResponse } from '@angular/common/http';
+import { HttpClient } from '@angular/common/http';
import {
FnService,
IconService,
LionService,
- LoadingService,
LogService,
- TableBaseImpl, TableResponse, TableFilter, SortParams, SortDir,
+ TableBaseImpl, TableResponse, SortDir,
UrlFnService,
- WebSocketService,
- TableFilterPipe
+ WebSocketService
} from 'gui2-fw-lib';
const INSTALLED = 'INSTALLED';
@@ -133,14 +131,13 @@
protected fs: FnService,
private is: IconService,
private lion: LionService,
- protected ls: LoadingService,
protected log: LogService,
private ufs: UrlFnService,
protected wss: WebSocketService,
@Inject('Window') private window: Window,
private httpClient: HttpClient
) {
- super(fs, null, log, wss, 'app');
+ super(fs, log, wss, 'app');
this.responseCallback = this.appResponseCb;
this.parentSelCb = this.rowSelection;
// pre-populate sort so active apps are at the top of the list
diff --git a/web/gui2/src/main/webapp/app/view/apps/appsdetails/appsdetails.component.ts b/web/gui2/src/main/webapp/app/view/apps/appsdetails/appsdetails.component.ts
index d01d409..0aa6c7c 100644
--- a/web/gui2/src/main/webapp/app/view/apps/appsdetails/appsdetails.component.ts
+++ b/web/gui2/src/main/webapp/app/view/apps/appsdetails/appsdetails.component.ts
@@ -18,7 +18,6 @@
import {
FnService,
LionService,
- LoadingService,
LogService,
DetailsPanelBaseImpl,
WebSocketService
@@ -66,12 +65,11 @@
lionFn; // Function
constructor(
protected fs: FnService,
- protected ls: LoadingService,
protected log: LogService,
protected wss: WebSocketService,
protected lion: LionService,
) {
- super(fs, ls, log, wss, 'app');
+ super(fs, log, wss, 'app');
if (this.lion.ubercache.length === 0) {
this.lionFn = this.dummyLion;
this.lion.loadCbs.set('appsdetails', () => this.doLion());