summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master')
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts26
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts138
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts3
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts3
-rw-r--r--vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardModel.steps.ts1
-rw-r--r--vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts5
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.spec.ts24
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts2
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.spec.ts10
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts24
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.spec.ts2
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts2
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts4
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts8
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts8
-rw-r--r--vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts9
-rw-r--r--vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts4
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html6
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts6
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.ts2
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts7
-rw-r--r--vid-webpack-master/src/app/shared/models/InstantiationBase.ts11
-rw-r--r--vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts5
23 files changed, 206 insertions, 104 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
index 8f76908b9..dbb9bca4d 100644
--- a/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
@@ -8,6 +8,7 @@ describe('Drawing Board: Instantiation Templates', function () {
cy.clearSessionStorage();
cy.setTestApiParamToVNF();
cy.initAAIMock();
+ cy.initGetAAISubDetails();
cy.initVidMock();
cy.initDrawingBoardUserPermission();
cy.login();
@@ -21,7 +22,7 @@ describe('Drawing Board: Instantiation Templates', function () {
describe('Load Page and Deploy', () => {
- it(`Given a stored template - when click "deploy" - then a coherent request should be sent upon deploy`, function () {
+ it(`Given a stored template - when click "deploy" - then a coherent request should be sent upon deploy`, () => {
loadDrawingBoardWithRecreateMode();
@@ -43,9 +44,8 @@ describe('Drawing Board: Instantiation Templates', function () {
.getElementByDataTestsId("lcpRegion").should('contain', 'hvf6')
.getElementByDataTestsId("lineOfBusiness").should('contain', 'zzz1')
.getElementByDataTestsId("rollback").should('contain', 'Rollback')
-
-
- .getElementByDataTestsId("cancelButton").click();
+ .checkPlatformValue('xxx1')
+ .getElementByDataTestsId("cancelButton").click();
cy.drawingBoardTreeOpenContextMenuByElementDataTestId("node-c5b26cc1-a66f-4b69-aa23-6abc7c647c88-vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0")
.drawingBoardTreeClickOnContextMenuOptionByName('Edit')
@@ -53,7 +53,6 @@ describe('Drawing Board: Instantiation Templates', function () {
.getElementByDataTestsId("lcpRegion").should('contain', 'hvf6')
.getElementByDataTestsId("tenant").should('contain', 'DN5242-Nov21-T1')
.getElementByDataTestsId("rollback").should('contain', 'Rollback')
-
.getElementByDataTestsId("cancelButton").click();
cy.drawingBoardTreeOpenContextMenuByElementDataTestId("node-c09e4530-8fd8-418f-9483-2f57ce927b05-vprobe_nc_vnf0..VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1")
@@ -68,16 +67,25 @@ describe('Drawing Board: Instantiation Templates', function () {
assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd();
});
- it(`Edit the service`, function () {
+ it(`Edit the service`, function () {
loadDrawingBoardWithRecreateMode();
cy.openServiceContextMenu()
- .getElementByDataTestsId("context-menu-header-edit-item").click({force : true})
- });
+ .getElementByDataTestsId("context-menu-header-edit-item").click()
+ .getElementByDataTestsId("instanceName").should('have.value', 'vProbe_NC_Service_DG_new_SI')
+ .getElementByDataTestsId("subscriberName").should('contain', 'SILVIA ROBBINS')
+ .getElementByDataTestsId("serviceType").should('contain', 'TYLER SILVIA')
+ .getElementByDataTestsId("owningEntity").should('contain', 'WayneHolland')
+ .getElementByDataTestsId("project").should('contain', 'WATKINS')
+ .getElementByDataTestsId("rollback").should('contain', 'Rollback');
+
+
+
+
+ });
});
});
-
});
function loadDrawingBoardWithRecreateMode() {
diff --git a/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
index b862e568d..3caa4e81d 100644
--- a/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
@@ -1,6 +1,47 @@
///<reference path="../../../node_modules/cypress/types/index.d.ts"/>
describe('Template', () => {
+ const asyncInstantiation = [
+ {
+ "id": 8,
+ "created": 1525075968000,
+ "modified": 1525075971000,
+ "action": "INSTANTIATE",
+ "createdId": null,
+ "modifiedId": null,
+ "rowNum": null,
+ "auditUserId": null,
+ "auditTrail": null,
+ "jobId": "5c2cd8e5-27d0-42e3-85a1-85db5eaba459",
+ "templateId": "d42ba7c8-9e19-4e34-ae2c-d8af3f24498e",
+ "userId": "16807000",
+ "aLaCarte": false,
+ "msoRequestId": "c0011670-0e1a-4b74-945d-8bf5aede1d9c",
+ "jobStatus": "FAILED",
+ "statusModifiedDate": 1525075968000,
+ "hidden": false,
+ "pause": false,
+ "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
+ "owningEntityName": "WayneHolland",
+ "project": "WATKINS",
+ "aicZoneId": "NFT1",
+ "aicZoneName": "NFTJSSSS-NFT1",
+ "tenantId": "bae71557c5bb4d5aac6743a4e5f1d054",
+ "tenantName": "AIN Web Tool-15-D-testalexandria",
+ "regionId": "hvf6",
+ "regionName": null,
+ "serviceType": "TYLER SILVIA",
+ "subscriberName": "e433710f-9217-458d-a79d-1c7aff376d89",
+ "serviceInstanceId": null,
+ "serviceInstanceName": "nWUfl instance name_002",
+ "serviceModelId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
+ "serviceModelName": "action-data",
+ "serviceModelVersion": "1.0",
+ "createdBulkDate": 1525075968000,
+ "isRetryEnabled": true
+ }
+ ];
+
beforeEach(() => {
cy.clearSessionStorage();
cy.setReduxState();
@@ -8,71 +49,35 @@ describe('Template', () => {
cy.initAAIMock();
cy.initVidMock();
cy.login();
- });
-
- afterEach(() => {
- cy.screenshot();
- });
- it('when open service popup should show template button', function () {
cy.readFile('cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json').then((flags) => {
cy.server()
- .route({
- method: 'GET',
- delay: 0,
- status: 200,
- url: Cypress.config('baseUrl') + "/flags**",
- response: {
- "FLAG_VF_MODULE_RESUME_STATUS_CREATE": false,
- "FLAG_2004_INSTANTIATION_TEMPLATES_POPUP": true
- }
- }).as('initFlags');
+ .route({
+ method: 'GET',
+ delay: 0,
+ status: 200,
+ url: Cypress.config('baseUrl') + "/flags**",
+ response: {
+ "FLAG_VF_MODULE_RESUME_STATUS_CREATE": false,
+ "FLAG_2004_INSTANTIATION_TEMPLATES_POPUP": true
+ }
+ }).as('initFlags');
});
- const asyncInstantiation = [
- {
- "id": 8,
- "created": 1525075968000,
- "modified": 1525075971000,
- "action": "INSTANTIATE",
- "createdId": null,
- "modifiedId": null,
- "rowNum": null,
- "auditUserId": null,
- "auditTrail": null,
- "jobId": "5c2cd8e5-27d0-42e3-85a1-85db5eaba459",
- "templateId": "d42ba7c8-9e19-4e34-ae2c-d8af3f24498e",
- "userId": "16807000",
- "aLaCarte": false,
- "msoRequestId": "c0011670-0e1a-4b74-945d-8bf5aede1d9c",
- "jobStatus": "FAILED",
- "statusModifiedDate": 1525075968000,
- "hidden": false,
- "pause": false,
- "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
- "owningEntityName": "WayneHolland",
- "project": "WATKINS",
- "aicZoneId": "NFT1",
- "aicZoneName": "NFTJSSSS-NFT1",
- "tenantId": "bae71557c5bb4d5aac6743a4e5f1d054",
- "tenantName": "AIN Web Tool-15-D-testalexandria",
- "regionId": "hvf6",
- "regionName": null,
- "serviceType": "TYLER SILVIA",
- "subscriberName": "e433710f-9217-458d-a79d-1c7aff376d89",
- "serviceInstanceId": null,
- "serviceInstanceName": "nWUfl instance name_002",
- "serviceModelId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
- "serviceModelName": "action-data",
- "serviceModelVersion": "1.0",
- "createdBulkDate": 1525075968000,
- "isRetryEnabled": true
- }
- ];
-
cy.route(Cypress.config('baseUrl') + "/asyncInstantiation**", asyncInstantiation);
cy.openIframe('/app/ui/#/servicePopup?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd&isCreate=true');
+
+
+
+
+ });
+
+ afterEach(() => {
+ cy.screenshot();
+ });
+
+ it('when open service popup should show template button', function () {
cy.getElementByDataTestsId('templateButton').contains('Template')
.getElementByDataTestsId('templateButton').click({force: true}) // Open template Modal
.getElementByDataTestsId('template-modal-title').contains('Templates') // Check Modal header
@@ -106,5 +111,24 @@ describe('Template', () => {
cy.getElementByDataTestsId('LoadTemplateButton').should('not.be.disabled')
});
+
+ it('clicking on load template button, go to expected url', function () {
+
+ cy.getElementByDataTestsId('templateButton').contains('Template')
+ .getElementByDataTestsId('templateButton').click({force: true}) // Open template Modal
+
+ const serviceModelId = 'e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0';
+ const jobId = '5c2cd8e5-27d0-42e3-85a1-85db5eaba459';
+ const vidBaseUrl = `http://localhost:8080/vid/serviceModels.htm`;
+
+ cy.getElementByDataTestsId('row-5c2cd8e5-27d0-42e3-85a1-85db5eaba459').click();
+ cy.getElementByDataTestsId('LoadTemplateButton').click()
+
+ cy.location().should((loc) => {
+ expect(loc.toString()).to.eq(`${vidBaseUrl}#/servicePlanning/RECREATE?serviceModelId=${serviceModelId}&jobId=${jobId}`);
+ });
+ });
+
+
});
diff --git a/vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts
index c510391cb..342818a71 100644
--- a/vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts
@@ -7,7 +7,7 @@ import {AsyncInstantiationModel} from '../../support/jsonBuilders/models/asyncIn
describe('Instantiation status', function () {
var jsonBuilderInstantiationBuilder : JsonBuilder<AsyncInstantiationModel> = new JsonBuilder<AsyncInstantiationModel>();
var asyncRes: Array<any>;
- const contextMenuCreateAnotherOne = 'context-menu-recreate';
+ const contextMenuCreateAnotherOne = 'context-menu-create-another-one';
beforeEach(() => {
cy.clearSessionStorage();
@@ -126,6 +126,7 @@ describe('Instantiation status', function () {
cy.openIframe('app/ui/#/instantiationStatus');
clickOnTitleAndThenOnMenuWithJobId(jobId);
+ cy.get('.dropdown-menu').getElementByDataTestsId(contextMenuCreateAnotherOne).contains('Create another one');
cy.get('.dropdown-menu').getElementByDataTestsId(contextMenuCreateAnotherOne).click();
cy.location().should((loc) => {
expect(loc.toString()).to.eq(`${vidBaseUrl}#/servicePlanning/RECREATE?serviceModelId=${serviceModelId}&jobId=${jobId}`);
diff --git a/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts
index 59e15d325..60b2e123d 100644
--- a/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts
@@ -345,6 +345,7 @@ describe('View only drawing board', function () {
['Model customization ID', '55b1be94-671a-403e-a26c-667e9c47d091'],
['Base module', 'false'],
['Min instances', '0'],
+ ['Max instances', 'Unlimited (default)'],
['Initial instances count', '0']
];
const extraLabelsAndValuesForInstance = [['In maintenance','true'], ['Instance ID', '2c1ca484-cbc2-408b-ab86-25a2c15ce280']];
@@ -356,6 +357,8 @@ describe('View only drawing board', function () {
function testComponentInfoForNetwork(){
const labelsAndValuesForModel = [
['Model version', '37.0'],
+ ['Min instances', '0'],
+ ['Max instances', 'Unlimited (default)'],
['Model customization ID', '94fdd893-4a36-4d70-b16a-ec29c54c184f'],
['Network role','network role 1, network role 2']
];
diff --git a/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardModel.steps.ts b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardModel.steps.ts
index 7854899f8..ae3bf6da7 100644
--- a/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardModel.steps.ts
+++ b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardModel.steps.ts
@@ -18,6 +18,7 @@ function getDrawingBoardDeployBtn() : Chainable<any> {
return cy.getElementByDataTestsId('deployBtn');
}
+
Cypress.Commands.add('drawingBoardPressAddButtonByElementName', drawingBoardPressAddButtonByElementName);
Cypress.Commands.add('drawingBoardNumberOfExistingElementsShouldContains', drawingBoardNumberOfExistingElementsShouldContains);
Cypress.Commands.add('getDrawingBoardDeployBtn', getDrawingBoardDeployBtn);
diff --git a/vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts b/vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts
index 00a945711..115173632 100644
--- a/vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts
+++ b/vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts
@@ -2,6 +2,7 @@ declare namespace Cypress {
interface Chainable {
genericFormSubmitForm: typeof genericFormSubmitForm
selectPlatformValue: typeof selectPlatformValue
+ checkPlatformValue: typeof checkPlatformValue
}
}
@@ -12,6 +13,9 @@ function selectPlatformValue(selectOption: string) {
cy.getElementByDataTestsId("multi-selectPlatform").get('.c-btn').click({force: true});
}
+function checkPlatformValue(value: string){
+ return cy.getElementByDataTestsId("multi-selectPlatform").should("contain", value)
+}
function genericFormSubmitForm(): Chainable<any> {
return cy.getElementByDataTestsId('form-set').click({force: true});
@@ -20,3 +24,4 @@ function genericFormSubmitForm(): Chainable<any> {
Cypress.Commands.add('genericFormSubmitForm', genericFormSubmitForm);
Cypress.Commands.add('selectPlatformValue', selectPlatformValue);
+Cypress.Commands.add('checkPlatformValue', checkPlatformValue);
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.spec.ts
index 76fc28a9e..7e28b2a65 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.spec.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.spec.ts
@@ -63,6 +63,30 @@ describe('Generate path to old View/Edit ', () => {
})().then(done).catch(done.fail));
+ each([
+ ['', DrawingBoardModes.RECREATE, true],
+ ['', DrawingBoardModes.CREATE, true],
+ ['Create', DrawingBoardModes.EDIT, true],
+ ['Create', DrawingBoardModes.RETRY_EDIT, true],
+ ['Create', DrawingBoardModes.VIEW, false],
+ ['Create', DrawingBoardModes.OLD_VIEW_EDIT, false],
+
+
+ ]).
+ test('should show edit button in correct Drawing Board Mode state', (action: string, mode: DrawingBoardModes, expected: boolean) => {
+ jest.spyOn(store, 'getState').mockReturnValue(<any>{
+ service: {
+ serviceInstance : {
+ 'serviceInstanceId' : {
+ action: action
+ }
+ }
+ }
+ });
+
+ let result = service.showEditService(mode,'serviceInstanceId' );
+ expect (result).toBe(expected);
+ });
test('should generate url to old view/edit ', () => {
const query: string = 'subscriberId=subscriberId&subscriberName=subscriberName&serviceType=serviceType&serviceInstanceId=serviceInstanceId';
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 634fa6271..4e8e31163 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
@@ -96,7 +96,7 @@ export class DrawingBoardHeaderService{
showEditService(mode: DrawingBoardModes, serviceModelId: string): boolean{
const serviceInstance = this.store.getState().service.serviceInstance;
- return mode === DrawingBoardModes.CREATE || ((mode === DrawingBoardModes.RETRY_EDIT || mode === DrawingBoardModes.EDIT || mode === DrawingBoardModes.RECREATE )&&
+ return mode === DrawingBoardModes.CREATE || mode === DrawingBoardModes.RECREATE || ((mode === DrawingBoardModes.RETRY_EDIT || mode === DrawingBoardModes.EDIT)&&
!_.isNil(serviceInstance) && !_.isNil(serviceInstance[serviceModelId])&& serviceInstance[serviceModelId].action === ServiceInstanceActions.Create);
}
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.spec.ts
index 089f812a7..f26ab0cf1 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.spec.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.spec.ts
@@ -311,13 +311,21 @@ describe('Network Model Info', () => {
const instance = getNetworkInstance();
let actualNetworkInfo = networkModel.getInfo(model, instance);
let expectedNetworkInfo = [
+ ModelInformationItem.createInstance("Min instances", "0"),
+ ModelInformationItem.createInstance("Max instances", "1"),
ModelInformationItem.createInstance('Network role', "network role 1, network role 2"),
ModelInformationItem.createInstance("Route target id", null),
- ModelInformationItem.createInstance("Route target role", null)
+ ModelInformationItem.createInstance("Route target role", null),
];
expect(actualNetworkInfo).toEqual(expectedNetworkInfo);
});
+ test('When there is no max Max instances text is: Unlimited (default)', () => {
+ let actualVNFInfo = networkModel.getInfo({just:"not empty"},null);
+ const maxInstancesItem = actualVNFInfo.find((item)=> item.label == 'Max instances');
+ expect(maxInstancesItem.values[0]).toEqual('Unlimited (default)');
+ });
+
function getNetworkModel() {
return {
"customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts
index 3ba4a2c4b..486ac93c0 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts
@@ -7,10 +7,7 @@ import {SharedTreeService} from "../../shared.tree.service";
import {InputType} from "../../../../../shared/models/inputTypes";
import {NgRedux} from "@angular-redux/store";
import {AppState} from "../../../../../shared/store/reducers";
-import {
- GenericFormPopupComponent,
- PopupType
-} from "../../../../../shared/components/genericFormPopup/generic-form-popup.component";
+import {GenericFormPopupComponent, PopupType} from "../../../../../shared/components/genericFormPopup/generic-form-popup.component";
import {DialogService} from "ng2-bootstrap-modal";
import {NetworkPopupService} from "../../../../../shared/components/genericFormPopup/genericFormServices/network/network.popup.service";
import * as _ from "lodash";
@@ -22,11 +19,7 @@ import {IframeService} from "../../../../../shared/utils/iframe.service";
import {SdcUiServices} from "onap-ui-angular";
import {DuplicateService} from "../../../duplicate/duplicate.service";
import {ServiceInstanceActions} from "../../../../../shared/models/serviceInstanceActions";
-import {
- deleteActionNetworkInstance,
- undoDeleteActionNetworkInstance,
- updateNetworkPosition
-} from "../../../../../shared/storeUtil/utils/network/network.actions";
+import {deleteActionNetworkInstance, undoDeleteActionNetworkInstance, updateNetworkPosition} from "../../../../../shared/storeUtil/utils/network/network.actions";
import {IModalConfig} from "onap-ui-angular/dist/modals/models/modal-config";
import {ComponentInfoType} from "../../../component-info/component-info-model";
import {ModelInformationItem} from "../../../../../shared/components/model-information/model-information.component";
@@ -265,10 +258,15 @@ export class NetworkModelInfo implements ILevelNodeInfo {
}
getInfo(model, instance): ModelInformationItem[] {
- const modelInformation = !_.isEmpty(model) && !_.isEmpty(model.properties) ? [
- ModelInformationItem.createInstance("Network role", model.properties.network_role)] : [];
- ModelInformationItem.createInstance("Min instances", !_.isNull(model.min) ? String(model.min) : null),
- ModelInformationItem.createInstance("Max instances", !_.isNull(model.max) ? String(model.max) : null)
+ const modelInformation = !_.isEmpty(model) ? [
+ ModelInformationItem.createInstance("Min instances", !_.isNull(model.min) ? String(model.min) : null),
+ this._sharedTreeService.createMaximumToInstantiateModelInformationItem(model)
+ ] : [];
+
+ if (!_.isEmpty(model) && !_.isEmpty(model.properties)) {
+ modelInformation.push(ModelInformationItem.createInstance("Network role", model.properties.network_role))
+ }
+
const instanceInfo = !_.isEmpty(instance) ? [
ModelInformationItem.createInstance("Route target id", instance.routeTargetId ? instance.routeTargetId : null),
ModelInformationItem.createInstance("Route target role", instance.routeTargetRole ? instance.routeTargetRole : null)] :
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.spec.ts
index 276c0aeb2..85e57613a 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.spec.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.spec.ts
@@ -477,7 +477,7 @@ describe('VFModule Model Info', () => {
let expectedVNFInfo = [
ModelInformationItem.createInstance('Base module', false),
ModelInformationItem.createInstance('Min instances', "0"),
- ModelInformationItem.createInstance("Max instances", null),
+ ModelInformationItem.createInstance("Max instances", 'Unlimited (default)'),
ModelInformationItem.createInstance('Initial instances count',"0")
];
expect(actualVNFInfo).toEqual(expectedVNFInfo);
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts
index 1ce452793..1e4a22c45 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts
@@ -418,7 +418,7 @@ export class VFModuleModelInfo implements ILevelNodeInfo {
const modelInformation = !_.isEmpty(model) && !_.isEmpty(model.properties) ? [
ModelInformationItem.createInstance("Base module", model.properties.baseModule),
ModelInformationItem.createInstance("Min instances", !_.isNull(model.properties.minCountInstances) ? String(model.properties.minCountInstances) : null),
- ModelInformationItem.createInstance("Max instances", !_.isNull(model.properties.maxCountInstances) ? String(model.properties.maxCountInstances) : null),
+ this._sharedTreeService.createMaximumToInstantiateModelInformationItem(model),
ModelInformationItem.createInstance("Initial instances count", !_.isNull(model.properties.initialCount) ? String(model.properties.initialCount) : null)
] : [];
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts
index ff86925f1..a5a85c41a 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts
@@ -31,7 +31,6 @@ import {ComponentInfoService} from "../../../component-info/component-info.servi
import {ModelInformationItem} from "../../../../../shared/components/model-information/model-information.component";
import {VfModuleUpgradePopupService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popuop.service";
import {FeatureFlagsService} from "../../../../../shared/services/featureFlag/feature-flags.service";
-import {Constants} from "../../../../../shared/utils/constants";
export class VnfModelInfo implements ILevelNodeInfo {
constructor(private _dynamicInputsService: DynamicInputsService,
@@ -319,8 +318,7 @@ export class VnfModelInfo implements ILevelNodeInfo {
getInfo(model, instance): ModelInformationItem[] {
const modelInformation = !_.isEmpty(model) ? [
ModelInformationItem.createInstance("Min instances", !_.isNil(model.min) ? String(model.min) : null),
- ModelInformationItem.createInstance("Max instances", !_.isNil(model.max) ? String(model.max) :
- Constants.ModelInfo.UNLIMITED_DEFAULT)
+ this._sharedTreeService.createMaximumToInstantiateModelInformationItem(model)
] : [];
const instanceInfo = !_.isEmpty(instance) ? [
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
index b330b72dc..504dc86bd 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
@@ -186,6 +186,14 @@ describe('Shared Tree Service', () => {
"type": instanceTypeMock
});
});
+ each([
+ ['undefined', 'Unlimited (default)', {}],
+ ['null', 'Unlimited (default)', {max:null}],
+ ['3', '3', {max:3}],
+ ]).
+ test("when there is %s max instances in model , shell return %s text", (desc, expected, model) =>{
+ expect(service.createMaximumToInstantiateModelInformationItem(model).values[0]).toBe(expected);
+ });
test('shouldShowDeleteInstanceWithChildrfenModal should not open modal if all childs with action None', () => {
let foo = () => {
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
index b8eddbbf7..7f5b6e33c 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
@@ -14,6 +14,7 @@ import {undoUpgradeService, upgradeService} from "../../../shared/storeUtil/util
import {VNFMethods} from "../../../shared/storeUtil/utils/vnf/vnf.actions";
import {FeatureFlagsService, Features} from "../../../shared/services/featureFlag/feature-flags.service";
import {Utils} from "../../../shared/utils/utils";
+import {Constants} from "../../../shared/utils/constants";
@Injectable()
export class SharedTreeService {
@@ -368,4 +369,11 @@ export class SharedTreeService {
const modelInfoItemsWithoutEmpty = _.filter(modelInfoItems, function(item){ return !item.values.every(_.isNil)});
return new ComponentInfoModel(type, modelInfoItemsWithoutEmpty, [], instance != null);
}
+
+ createMaximumToInstantiateModelInformationItem(model): ModelInformationItem {
+ return ModelInformationItem.createInstance(
+ "Max instances",
+ !_.isNil(model.max) ? String(model.max) : Constants.ModelInfo.UNLIMITED_DEFAULT
+ );
+ }
}
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 4bfedd913..3c45632ee 100644
--- a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts
+++ b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts
@@ -13,6 +13,7 @@ import {Router, UrlTree} from "@angular/router";
import {of} from "rxjs";
import {MsoService} from "../shared/services/msoService/mso.service";
import {ServiceAction} from "../shared/models/serviceInstanceActions";
+import {InstantiationBase} from "../shared/models/InstantiationBase";
export let PENDING : string = "pending";
export let INPROGRESS : string = "in_progress";
@@ -112,21 +113,21 @@ export class InstantiationStatusComponentService {
window.parent.location.assign('../../serviceModels.htm#/instantiate?' + query);
}
- navigateToNewViewEdit(item: ServiceInfoModel, mode: DrawingBoardModes): void{
+ navigateToNewViewEdit(item: InstantiationBase, mode: DrawingBoardModes): void {
this._store.dispatch(updateDrawingBoardStatus(mode));
const viewEditUrlTree:UrlTree = this.getNewViewEditUrlTree(item, mode);
this._router.navigateByUrl(viewEditUrlTree);
window.parent.location.assign(this.getViewEditUrl(viewEditUrlTree));
}
- getNewViewEditUrlTree(item: ServiceInfoModel, mode: DrawingBoardModes): UrlTree {
+ getNewViewEditUrlTree(item: InstantiationBase, mode: DrawingBoardModes): UrlTree {
return this._router.createUrlTree(
['/servicePlanning/' + mode],
{
queryParams:
mode==DrawingBoardModes.RECREATE ?
this.getRecreateQueryParams(item) :
- this.getDefaultViewEditQueryParams(item)
+ this.getDefaultViewEditQueryParams(<ServiceInfoModel> item)
});
}
@@ -140,7 +141,7 @@ export class InstantiationStatusComponentService {
};
}
- private getRecreateQueryParams(item: ServiceInfoModel) {
+ private getRecreateQueryParams(item: InstantiationBase) {
return {
serviceModelId: item.serviceModelId,
jobId: item.jobId
diff --git a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts
index 58227c9eb..4f84b7125 100644
--- a/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts
+++ b/vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts
@@ -59,8 +59,8 @@ export class InstantiationStatusComponent implements OnInit {
visible: () => true,
},
{
- name: "Recreate",
- dataTestId: "context-menu-recreate",
+ name: "Create another one",
+ dataTestId: "context-menu-create-another-one",
className: "fa-clone",
click: (item: ServiceInfoModel) => this.instantiationStatusComponentService.recreate(item),
enabled: (item: ServiceInfoModel) => this.instantiationStatusComponentService.isRecreateEnabled(item),
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html
index 19f641a56..fe08bf086 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.html
@@ -50,8 +50,8 @@
<tbody>
<tr class="member-table-row"
*ngFor="let item of filterTableData | searchFilter: filterText ;"
- (click)="selectedJobId = item.jobId"
- [ngClass]="{'selected' : selectedJobId === item.jobId}"
+ (click)="selectedInstantiation = item"
+ [ngClass]="{'selected' : selectedInstantiation && selectedInstantiation.jobId === item.jobId}"
[attr.data-tests-id]="'row-' + item.jobId">
<td>
<div>
@@ -148,7 +148,7 @@
</div>
<div class="col-md-6" style="padding: 15px;padding-right: 35px;">
<button
- [disabled]="selectedJobId === null"
+ [disabled]="selectedInstantiation === null"
[attr.data-tests-id]="'LoadTemplateButton'"
type="button" class="btn btn-primary submit"
(click)="loadTemplate()"><span>Load Template</span>
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts
index 4d89750f9..7b16b6677 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts
@@ -5,6 +5,8 @@ import {ActivatedRoute} from "@angular/router";
import {ServiceInfoService} from "../../../server/serviceInfo/serviceInfo.service";
import {InstantiationTemplatesModalService} from "./instantiation.templates.modal.service";
import {InstantiationTemplatesRowModel} from "./instantiation.templates.row.model";
+import {DrawingBoardModes} from "../../../../drawingBoard/service-planning/drawing-board.modes";
+import {InstantiationStatusComponentService} from "../../../../instantiationStatus/instantiationStatus.component.service";
@Component({
selector: 'template-modal',
@@ -14,7 +16,7 @@ import {InstantiationTemplatesRowModel} from "./instantiation.templates.row.mode
export class InstantiationTemplatesModalComponent extends DialogComponent<string, boolean> implements OnInit, OnDestroy {
- selectedJobId : string = null;
+ selectedInstantiation: InstantiationTemplatesRowModel = null;
templateModalComponentService: InstantiationTemplatesModalService;
originalTableData: InstantiationTemplatesRowModel[] = [];
filterTableData : InstantiationTemplatesRowModel[] = [];
@@ -24,6 +26,7 @@ export class InstantiationTemplatesModalComponent extends DialogComponent<string
private _iframeService: IframeService,
private _serviceInfoService: ServiceInfoService,
private _templateModalComponentService: InstantiationTemplatesModalService,
+ private _instantiationStatusComponentService: InstantiationStatusComponentService,
private _route: ActivatedRoute) {
super(dialogService);
this.templateModalComponentService = _templateModalComponentService;
@@ -42,6 +45,7 @@ export class InstantiationTemplatesModalComponent extends DialogComponent<string
}
loadTemplate = () => {
+ this._instantiationStatusComponentService.navigateToNewViewEdit(this.selectedInstantiation, DrawingBoardModes.RECREATE)
};
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.ts
index 7126da36a..8377ccf42 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.service.ts
@@ -3,6 +3,7 @@ import {InstantiationTemplatesRowModel} from "./instantiation.templates.row.mode
@Injectable()
export class InstantiationTemplatesModalService {
+
convertResponseToUI = (jobsResponse: any[]): InstantiationTemplatesRowModel[] => {
let tableRows: InstantiationTemplatesRowModel[] = [];
@@ -12,4 +13,5 @@ export class InstantiationTemplatesModalService {
return tableRows;
};
+
}
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts
index 08982cc67..e68c34b85 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.row.model.ts
@@ -1,8 +1,8 @@
import * as moment from 'moment';
import * as _ from 'lodash';
+import {InstantiationBase} from "../../../models/InstantiationBase";
-export class InstantiationTemplatesRowModel {
- readonly jobId: string;
+export class InstantiationTemplatesRowModel extends InstantiationBase{
readonly userId ?: string;
readonly createDate ?: string;
readonly instanceName ?: string;
@@ -13,7 +13,7 @@ export class InstantiationTemplatesRowModel {
readonly aicZone?: string;
constructor(data) {
- this.jobId = data.jobId;
+ super(data);
this.userId = !_.isNil(data.created) ? data.userId : null;
this.createDate = !_.isNil(data.created) ? moment(data.created).format("YYYY-MM-DD HH:mm:ss") : null;
this.instanceName = this.getInstanceName(data.serviceInstanceName);
@@ -22,7 +22,6 @@ export class InstantiationTemplatesRowModel {
this.region = this.getRegion(data.regionId, data.owningEntityName);
this.tenant = !_.isNil(data.tenantName) ? data.tenantName : null;
this.aicZone = !_.isNil(data.aicZoneName) ? data.aicZoneName : null;
-
}
diff --git a/vid-webpack-master/src/app/shared/models/InstantiationBase.ts b/vid-webpack-master/src/app/shared/models/InstantiationBase.ts
new file mode 100644
index 000000000..afa8a8136
--- /dev/null
+++ b/vid-webpack-master/src/app/shared/models/InstantiationBase.ts
@@ -0,0 +1,11 @@
+export class InstantiationBase {
+ readonly jobId: string;
+ readonly serviceModelId: string;
+
+ constructor(data?) {
+ if(data){
+ this.jobId = data.jobId;
+ this.serviceModelId = data.serviceModelId;
+ }
+ }
+}
diff --git a/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts b/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts
index a507e073e..5a2b37a7d 100644
--- a/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts
+++ b/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.model.ts
@@ -1,7 +1,8 @@
import {ServiceStatus} from '../../../instantiationStatus/instantiationStatus.component.service';
import {ServiceAction} from "../../models/serviceInstanceActions";
+import {InstantiationBase} from "../../models/InstantiationBase";
-export class ServiceInfoModel {
+export class ServiceInfoModel extends InstantiationBase{
id: number;
created: Date;
modified: Date;
@@ -28,12 +29,10 @@ export class ServiceInfoModel {
subscriberId: string;
serviceInstanceId: string;
serviceInstanceName: string;
- serviceModelId: string;
serviceModelName: string;
serviceModelVersion: string;
templateId: string;
auditUserId: string;
- jobId: string;
action: ServiceAction;
isRetryEnabled: boolean;
}