Other Pause and Resume Related Scenarios
Please see the user story for more details.
Issue-ID: VID-875
Signed-off-by: Rachitha Ramappa <rachitha.ramappa@att.com>
Change-Id: Ib2b9f62c6c0c5f0f8c162cc776dc128d39dbb37e
diff --git a/vid-webpack-master/src/app/drawingBoard/drawingBoard.routing.ts b/vid-webpack-master/src/app/drawingBoard/drawingBoard.routing.ts
index aebbdee..dd3b676 100644
--- a/vid-webpack-master/src/app/drawingBoard/drawingBoard.routing.ts
+++ b/vid-webpack-master/src/app/drawingBoard/drawingBoard.routing.ts
@@ -45,6 +45,15 @@
canActivate: [DrawingBoardGuard]
},
{
+ path: 'RESUME',
+ component: ServicePlanningComponent,
+ resolve: {
+ flags: FlagsResolve,
+ viewEditResolver: RetryResolver
+ },
+ canActivate: [DrawingBoardGuard]
+ },
+ {
path: 'RETRY',
component: ServicePlanningComponent,
resolve: {
diff --git a/vid-webpack-master/src/app/drawingBoard/guards/servicePlanningGuard/drawingBoardGuard.ts b/vid-webpack-master/src/app/drawingBoard/guards/servicePlanningGuard/drawingBoardGuard.ts
index d486fb4..8b50580 100644
--- a/vid-webpack-master/src/app/drawingBoard/guards/servicePlanningGuard/drawingBoardGuard.ts
+++ b/vid-webpack-master/src/app/drawingBoard/guards/servicePlanningGuard/drawingBoardGuard.ts
@@ -12,7 +12,9 @@
constructor(private store: NgRedux<AppState>, private _http: HttpClient, private _router : Router) { }
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
let url : string = `../../roles/service_permissions?subscriberId=${next.queryParams['subscriberId']}&serviceType=${next.queryParams['serviceType']}`;
- const viewMode = state.url.includes(DrawingBoardModes.RETRY_EDIT)? DrawingBoardModes.RETRY: DrawingBoardModes.VIEW;
+ const viewMode = state.url.includes(DrawingBoardModes.RETRY_EDIT)? DrawingBoardModes.RETRY:
+ state.url.includes(DrawingBoardModes.RESUME)? DrawingBoardModes.RESUME:
+ DrawingBoardModes.VIEW;
return this._http.get(url)
.map((result : DrawingBoardPermissions) => {
if(!result.isEditPermitted){
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts
index 4e8e311..8cebb23 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts
@@ -68,7 +68,7 @@
if (!_.isNil(this.errorMsgService.errorMsgObject) && mode !== DrawingBoardModes.RETRY_EDIT) return true;
if(validationCounter > 0) return true;
if(serviceInstance.action !== ServiceInstanceActions.None) return false;
- if(mode === DrawingBoardModes.RETRY_EDIT) return false;
+ if(mode === DrawingBoardModes.RETRY_EDIT || mode === DrawingBoardModes.RESUME) return false;
return !serviceInstance.isDirty;
}
return true;
@@ -80,6 +80,8 @@
return 'UPDATE';
case DrawingBoardModes.RETRY_EDIT:
return 'REDEPLOY';
+ case DrawingBoardModes.RESUME:
+ return 'RESUME';
default: return 'DEPLOY';
}
}
@@ -91,6 +93,8 @@
case DrawingBoardModes.RETRY_EDIT:
case DrawingBoardModes.RETRY:
return 'REDEPLOY';
+ case DrawingBoardModes.RESUME:
+ return 'RESUME';
}
}
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board.modes.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board.modes.ts
index 78e2b62..427c691 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board.modes.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board.modes.ts
@@ -5,5 +5,6 @@
EDIT = 'EDIT',
OLD_VIEW_EDIT = 'OLD_VIEW_EDIT',
CREATE = 'CREATE',
- RECREATE = 'RECREATE'
+ RECREATE = 'RECREATE',
+ RESUME = 'RESUME'
}
diff --git a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts
index e59c16a..cdbe890 100644
--- a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts
+++ b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts
@@ -115,6 +115,7 @@
}
navigateToNewViewEdit(item: InstantiationBase, mode: DrawingBoardModes): void {
+ console.log("Mode : ", mode);
this._store.dispatch(updateDrawingBoardStatus(mode));
const viewEditUrlTree:UrlTree = this.getNewViewEditUrlTree(item, mode);
this._router.navigateByUrl(viewEditUrlTree);
@@ -180,6 +181,10 @@
this.navigateToNewViewEdit(item, DrawingBoardModes.RETRY_EDIT);
}
+ resume(item: ServiceInfoModel): void {
+ this.navigateToNewViewEdit(item, DrawingBoardModes.RESUME);
+ }
+
recreate(item: ServiceInfoModel): void {
this.navigateToNewViewEdit(item, DrawingBoardModes.RECREATE);
}
diff --git a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts
index 4dccb9e..b5f54bc 100644
--- a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts
+++ b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts
@@ -48,7 +48,15 @@
className: "fa-repeat",
click: (item: ServiceInfoModel) => this.retryItem(item),
enabled: () => true,
- visible: (item: ServiceInfoModel) => item.isRetryEnabled,
+ visible: (item: ServiceInfoModel) => (item.isRetryEnabled && (item.jobStatus !== JobStatus.COMPLETED_AND_PAUSED)),
+ },
+ {
+ name: "Resume",
+ dataTestId: "context-menu-retry",
+ className: "fa-repeat",
+ click: (item: ServiceInfoModel) => this.resumeItem(item),
+ enabled: () => true,
+ visible: (item: ServiceInfoModel) => item.jobStatus === JobStatus.COMPLETED_AND_PAUSED,
},
{
name: "Open",
@@ -175,6 +183,12 @@
}
}
+ resumeItem(item: ServiceInfoModel) : void {
+ if(item.isRetryEnabled && item.jobStatus === JobStatus.COMPLETED_AND_PAUSED){
+ this._instantiationStatusComponentService.resume(item);
+ }
+ }
+
auditInfo(jobData : ServiceInfoModel): void {
AuditInfoModalComponent.openModal.next(jobData);
}
diff --git a/vid-webpack-master/src/app/shared/components/auditInfoModal/auditInfoModal.component.html b/vid-webpack-master/src/app/shared/components/auditInfoModal/auditInfoModal.component.html
index 3dff92c..0866690 100644
--- a/vid-webpack-master/src/app/shared/components/auditInfoModal/auditInfoModal.component.html
+++ b/vid-webpack-master/src/app/shared/components/auditInfoModal/auditInfoModal.component.html
@@ -52,6 +52,7 @@
<div class="row">
<div class="col-md-6 leftColumn"><span class="table-title">MSO status</span></div>
+ <!-- -->
<div class="col-md-6 rightColumn"><span><a id="glossary_link" target="_blank" href="#" (click)="onNavigate()">Building Block (BB) glossary</a></span></div>
</div>
<table id="service-instantiation-audit-info-mso" class="table table-bordered">
diff --git a/vid-webpack-master/src/app/shared/models/serviceInstanceActions.ts b/vid-webpack-master/src/app/shared/models/serviceInstanceActions.ts
index e029f48..e7eb55d 100644
--- a/vid-webpack-master/src/app/shared/models/serviceInstanceActions.ts
+++ b/vid-webpack-master/src/app/shared/models/serviceInstanceActions.ts
@@ -25,7 +25,8 @@
STOPPED = 'STOPPED',
COMPLETED_WITH_ERRORS = 'COMPLETED_WITH_ERRORS',
CREATING = 'CREATING',
- PAUSE_UPON_COMPLETION = 'PAUSE_UPON_COMPLETION'
+ PAUSE_UPON_COMPLETION = 'PAUSE_UPON_COMPLETION',
+ COMPLETED_AND_PAUSED = 'COMPLETED_AND_PAUSED'
}
export enum PauseStatus {
AFTER_COMPLETION = 'afterCompletion',