Merge "When opening new VNF modal the modal should be empty."
diff --git a/epsdk-app-onap/pom.xml b/epsdk-app-onap/pom.xml
index 0dc8eac..95c1ce2 100755
--- a/epsdk-app-onap/pom.xml
+++ b/epsdk-app-onap/pom.xml
@@ -16,7 +16,7 @@
<parent>
<groupId>org.onap.oparent</groupId>
<artifactId>oparent</artifactId>
- <version>2.0.0</version>
+ <version>2.1.0</version>
<relativePath/>
</parent>
diff --git a/pom.xml b/pom.xml
index cd5a4fc..62120e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
<parent>
<groupId>org.onap.oparent</groupId>
<artifactId>oparent</artifactId>
- <version>2.0.0</version>
+ <version>2.1.0</version>
<relativePath/>
</parent>
diff --git a/vid-app-common/pom.xml b/vid-app-common/pom.xml
index f618ec8..c935677 100755
--- a/vid-app-common/pom.xml
+++ b/vid-app-common/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.onap.oparent</groupId>
<artifactId>oparent</artifactId>
- <version>2.0.0</version>
+ <version>2.1.0</version>
<relativePath/>
</parent>
diff --git a/vid-automation/pom.xml b/vid-automation/pom.xml
index e2ef865..34abd22 100644
--- a/vid-automation/pom.xml
+++ b/vid-automation/pom.xml
@@ -167,7 +167,7 @@
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
- <version>1.9.3</version>
+ <version>1.9.4</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
diff --git a/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java b/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java
index b65e797..9651002 100644
--- a/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java
+++ b/vid-automation/src/test/java/org/onap/vid/more/LoggerFormatTest.java
@@ -64,9 +64,10 @@
@DataProvider
public static Object[][] logsAndFormats(Method test) {
return new Object[][]{
- {LogName.debug, "debug", 0.65 },
+ {LogName.debug, "debug", 0.95 },
{LogName.metrics2019, "metric-ELS-2019.11", 0.95},
- {LogName.audit2019, "audit-ELS-2019.11", 0.95}
+ {LogName.audit2019, "audit-ELS-2019.11", 0.95},
+ {LogName.error, "error", 0.75 }
};
}
diff --git a/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json
index a874fec..a7b3a04 100644
--- a/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json
+++ b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json
@@ -41,12 +41,12 @@
"modelType": "vnf",
"modelVersion": "1.0"
},
- "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
+ "productFamilyId": "e433710f-9217-458d-a79d-1c7aff376d89",
"instanceName": "hvf6arlba007",
"action": "Create",
"platformName": "xxx1",
"lcpCloudRegionId": "hvf6",
- "tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
+ "tenantId": "4914ab0ab3a743e58f0eefdacc1dde77",
"instanceParams": [
{}
],
@@ -67,7 +67,7 @@
"instanceName": "hvf6arlba007_lba_Base_01",
"action": "Create",
"lcpCloudRegionId": "hvf6",
- "tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
+ "tenantId": "4914ab0ab3a743e58f0eefdacc1dde77",
"instanceParams": [
{}
],
@@ -90,7 +90,7 @@
"instanceName": "hvf6arlba007_lba_dj_01",
"action": "Create",
"lcpCloudRegionId": "hvf6",
- "tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
+ "tenantId": "4914ab0ab3a743e58f0eefdacc1dde77",
"instanceParams": [
{}
],
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 8f76908..dbb9bca 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 @@
cy.clearSessionStorage();
cy.setTestApiParamToVNF();
cy.initAAIMock();
+ cy.initGetAAISubDetails();
cy.initVidMock();
cy.initDrawingBoardUserPermission();
cy.login();
@@ -21,7 +22,7 @@
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 @@
.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 @@
.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 @@
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 b862e56..3caa4e8 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,6 +49,28 @@
cy.initAAIMock();
cy.initVidMock();
cy.login();
+
+ 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');
+ });
+
+ cy.route(Cypress.config('baseUrl') + "/asyncInstantiation**", asyncInstantiation);
+
+ cy.openIframe('/app/ui/#/servicePopup?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd&isCreate=true');
+
+
+
+
});
afterEach(() => {
@@ -15,64 +78,6 @@
});
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');
- });
-
- 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');
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 @@
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 c510391..342818a 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 @@
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 @@
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 59e15d3..60b2e12 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 @@
['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 @@
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 7854899..ae3bf6d 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 @@
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 00a9457..1151736 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 @@
interface Chainable {
genericFormSubmitForm: typeof genericFormSubmitForm
selectPlatformValue: typeof selectPlatformValue
+ checkPlatformValue: typeof checkPlatformValue
}
}
@@ -12,6 +13,9 @@
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 @@
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 76fc28a..7e28b2a 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 @@
})().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 634fa62..4e8e311 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 @@
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 089f812..f26ab0c 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 @@
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 3ba4a2c..486ac93 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 {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 {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 @@
}
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 276c0ae..85e5761 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 @@
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 1ce4527..1e4a22c 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 @@
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 ff86925..a5a85c4 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 {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 @@
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 b330b72..504dc86 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 @@
"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 b8eddbb..7f5b6e3 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 {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 @@
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 4bfedd9..3c45632 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 {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 @@
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 @@
};
}
- 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 58227c9..4f84b71 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 @@
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 19f641a..fe08bf0 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 4d89750..7b16b66 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 {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 @@
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 @@
private _iframeService: IframeService,
private _serviceInfoService: ServiceInfoService,
private _templateModalComponentService: InstantiationTemplatesModalService,
+ private _instantiationStatusComponentService: InstantiationStatusComponentService,
private _route: ActivatedRoute) {
super(dialogService);
this.templateModalComponentService = _templateModalComponentService;
@@ -42,6 +45,7 @@
}
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 7126da3..8377ccf 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 @@
@Injectable()
export class InstantiationTemplatesModalService {
+
convertResponseToUI = (jobsResponse: any[]): InstantiationTemplatesRowModel[] => {
let tableRows: InstantiationTemplatesRowModel[] = [];
@@ -12,4 +13,5 @@
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 08982cc..e68c34b 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 @@
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 @@
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 0000000..afa8a81
--- /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 a507e07..5a2b37a 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 @@
subscriberId: string;
serviceInstanceId: string;
serviceInstanceName: string;
- serviceModelId: string;
serviceModelName: string;
serviceModelVersion: string;
templateId: string;
auditUserId: string;
- jobId: string;
action: ServiceAction;
isRetryEnabled: boolean;
}