Added in support for navigating to Topo View from Intent View
Change-Id: Ia62428dee29013cc7fa52727662b67f5673d725c
diff --git a/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.html b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.html
index 040b3c2..e067611 100644
--- a/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.html
+++ b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.html
@@ -40,9 +40,8 @@
</div>
</span>
<div class="separator"></div>
- <!-- TO-DO showIntent() need to correct once topology page is available-->
- <div (click)="showIntent()">
- <onos-icon classes="{active: canShowIntent()}" iconId="topo" iconSize="42" toolTip="{{ topoTip }}"></onos-icon>
+ <div routerLink="/topo2" [queryParams]="{ intentId: selId, appId: intentData.appId, appName: intentData.appName, intentType: intentData.type }" routerLinkActive="active">
+ <onos-icon classes="{{!!selId ? 'active-rect' :undefined}}" iconId="topo" iconSize="42" toolTip="{{ topoTip }}"></onos-icon>
</div>
<div (click)="!!selId && intentState() === 'Withdrawn' ? confirmAction(IntentActionEnum.RESUBMIT):''">
<onos-icon classes="{{!!selId && intentState() === 'Withdrawn' ? 'active-rect' :undefined}}" iconId="play" iconSize="42"
diff --git a/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.spec.ts b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.spec.ts
index 8a5a9a5..b42147b 100644
--- a/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.spec.ts
+++ b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.spec.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import { ActivatedRoute, Params } from '@angular/router';
+import {ActivatedRoute, Params} from '@angular/router';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { DebugElement } from '@angular/core';
@@ -34,6 +34,7 @@
import { } from 'jasmine';
import { IntentComponent } from './intent.component';
+import {RouterTestingModule} from '@angular/router/testing';
class MockActivatedRoute extends ActivatedRoute {
constructor(params: Params) {
@@ -84,7 +85,7 @@
};
fs = new FnService(ar, logSpy, windowMock);
TestBed.configureTestingModule({
- imports: [BrowserAnimationsModule, FormsModule],
+ imports: [BrowserAnimationsModule, FormsModule, RouterTestingModule],
declarations: [
IntentComponent,
IconComponent,
diff --git a/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.ts b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.ts
index 585514d..6bd490e 100644
--- a/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.ts
+++ b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.ts
@@ -129,6 +129,7 @@
this.intentData.appId = splittedRowAppId[0].trim();
this.intentData.appName = splittedRowAppId[1].trim();
this.intentData.key = this.selId;
+ this.intentData.type = selRow.type;
}
briefToggle() {
@@ -153,20 +154,6 @@
}
/**
- * TO-DO intent view related function need to implement once
- * topology page will be available
- */
- showIntent() {
- }
-
- /**
- * TO-DO intent view related function need to implement once
- * topology page will be available
- */
- canShowIntent() {
- }
-
- /**
* Perform one of the intent actions - resubmit, remove, purge or purge withdrawn
* Raises a dialog which calls back the dOk() below
*/