GUI2 Changed loading screen display to be a component
Change-Id: Id1592b498e6827ec4cd3544dec92e46f00e8d378
diff --git a/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.html b/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.html
index 5829acf..2984d3e 100644
--- a/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.html
+++ b/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.html
@@ -14,6 +14,7 @@
~ limitations under the License.
-->
<div id="ov-tunnel">
+ <onos-loading [theme]="'light'" [running]="loadingIconShown"></onos-loading>
<div class="tabular-header">
<h2>Tunnels ({{tableData.length}} total)</h2>
<div class="ctrl-btns">
@@ -71,4 +72,4 @@
</table>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
diff --git a/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.spec.ts b/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.spec.ts
index 30c5ead..f5ab3d6 100644
--- a/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.spec.ts
+++ b/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.spec.ts
@@ -22,12 +22,12 @@
FnService,
IconService,
IconComponent,
- LoadingService,
LogService,
- WebSocketService
+ WebSocketService, LoadingComponent
} from 'gui2-fw-lib';
import { DebugElement } from '@angular/core';
import { By } from '@angular/platform-browser';
+import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
class MockActivatedRoute extends ActivatedRoute {
constructor(params: Params) {
@@ -40,12 +40,6 @@
loadIconDef() { }
}
-class MockLoadingService {
- startAnim() { }
- stop() { }
- waiting() { }
-}
-
class MockWebSocketService {
createWebSocket() { }
isConnected() { return false; }
@@ -83,11 +77,15 @@
fs = new FnService(ar, logSpy, windowMock);
TestBed.configureTestingModule({
- declarations: [TunnelComponent, IconComponent],
+ imports: [BrowserAnimationsModule],
+ declarations: [
+ TunnelComponent,
+ IconComponent,
+ LoadingComponent
+ ],
providers: [
{ provide: FnService, useValue: fs },
{ provide: IconService, useClass: MockIconService },
- { provide: LoadingService, useClass: MockLoadingService },
{ provide: LogService, useValue: logSpy },
{ provide: WebSocketService, useClass: MockWebSocketService },
]
diff --git a/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.ts b/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.ts
index 388e69e..91eb7e6 100644
--- a/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.ts
+++ b/web/gui2/src/main/webapp/app/view/tunnel/tunnel/tunnel.component.ts
@@ -16,7 +16,6 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import {
FnService,
- LoadingService,
LogService,
WebSocketService,
SortDir, TableBaseImpl, TableResponse
@@ -55,11 +54,10 @@
constructor(
protected fs: FnService,
- protected ls: LoadingService,
protected log: LogService,
protected wss: WebSocketService,
) {
- super(fs, ls, log, wss, 'tunnel');
+ super(fs, log, wss, 'tunnel');
this.responseCallback = this.tunnelResponseCb;
this.sortParams = {
firstCol: 'id',