summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vid-automation/src/main/java/vid/automation/test/infra/Features.java1
-rw-r--r--vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java50
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java5
-rw-r--r--vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json6
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts6
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/vnf.popup.e2e.ts16
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/basic.popup.service.spec.ts4
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/basic.popup.service.ts12
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service.ts2
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service.spec.ts4
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service.ts14
11 files changed, 71 insertions, 49 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/infra/Features.java b/vid-automation/src/main/java/vid/automation/test/infra/Features.java
index 289151b88..01e4b7558 100644
--- a/vid-automation/src/main/java/vid/automation/test/infra/Features.java
+++ b/vid-automation/src/main/java/vid/automation/test/infra/Features.java
@@ -55,6 +55,7 @@ public enum Features implements Feature {
FLAG_2002_VFM_UPGRADE_ADDITIONAL_OPTIONS,
FLAG_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND,
FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER,
+ FLAG_2002_UNLIMITED_MAX,
;
public boolean isActive() {
diff --git a/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java b/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java
index 5a9dc2c01..fb57070d6 100644
--- a/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java
+++ b/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java
@@ -121,6 +121,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
private final VidBasePage vidBasePage = new VidBasePage();
public static final String VNF_SET_BUTTON_TEST_ID = "form-set";
private static final Logger logger = LogManager.getLogger(NewServiceInstanceTest.class);
+ private static final String NO_MAX_INSTANCES_IN_MODEL = "NO_MAX_INSTANCES_IN_MODEL";
@BeforeClass
protected void dropAllAsyncJobs() {
@@ -234,7 +235,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
IS_GENERATED_NAMING.FALSE, true, true, true,
"2017-488_PASQUALE-vPE 0",
"2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1",
- 0, 1, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5", false);
+ 0, NO_MAX_INSTANCES_IN_MODEL, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5", false);
prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails, false);
@@ -281,7 +282,8 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
Collections.singletonList("2017488 pasqualevpe0 asn:"),
IS_GENERATED_NAMING.FALSE, false, true, false,
"2017-488_PASQUALE-vPE 0",
- "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", 0, 1, ImmutableList.of("Bandwidth", "Bandwidth units"),
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", 0,
+ NO_MAX_INSTANCES_IN_MODEL, ImmutableList.of("Bandwidth", "Bandwidth units"),
"25284168-24bb-4698-8cb4-3f509146eca5", false);
// this is the instance-name that createMacroService is going to use
@@ -366,7 +368,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.TRUE_BUT_GIVE_NAME_EITHER_WAY, true, true, false,
null,
- null, 0, 1, new ArrayList<>(), null, false);
+ null, 0, null, new ArrayList<>(), null, false);
final String serviceInstanceName = createMacroService(serviceData, false);
SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
@@ -407,7 +409,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.TRUE, true, true, false,
null,
- null, 0, 1, new ArrayList<>(), null, false);
+ null, 0, null, new ArrayList<>(), null, false);
createMacroService(serviceData, false, randomAlphabetic(5), true, 1);
drawingBoardPage.deploy();
@@ -431,7 +433,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.TRUE, true, true, false,
null,
- null, 0, 1, new ArrayList<>(), null, false);
+ null, 0, null, new ArrayList<>(), null, false);
createMacroService(serviceData, false, randomAlphabetic(5), false, 1);
drawingBoardPage.deploy();
@@ -448,7 +450,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
aLaCarteVnfGroupingService.modelVersionId,
ImmutableList.of(),
IS_GENERATED_NAMING.FALSE, false, true, false,
- null, null, 0, 1, ImmutableList.of(), null, false);
+ null, null, 0, null, ImmutableList.of(), null, false);
prepareServicePreset(aLaCarteVnfGroupingService, false);
createALaCarteService(serviceData, randomAlphabetic);
@@ -546,7 +548,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.FALSE, true, false, true,
"2017-488_PASQUALE-vPE 0",
- vfModule0Name, 1, 1, new ArrayList<>(), vfModule0UUID, false);
+ vfModule0Name, 1, NO_MAX_INSTANCES_IN_MODEL, new ArrayList<>(), vfModule0UUID, false);
prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails, false);
@@ -563,7 +565,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.FALSE, false, false, false,
"2017-488_PASQUALE-vPE 0",
- vfModule0Name, 1, 1, new ArrayList<>(), vfModule0UUID, false);
+ vfModule0Name, 1, NO_MAX_INSTANCES_IN_MODEL, new ArrayList<>(), vfModule0UUID, false);
prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse, false);
@@ -580,7 +582,8 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
new ArrayList<>(),
IS_GENERATED_NAMING.FALSE, false, true, false,
"2017-488_PASQUALE-vPE 0",
- "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", 0, 1, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5", false);
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", 0,
+ NO_MAX_INSTANCES_IN_MODEL, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5", false);
prepareServicePreset(macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse, false);
@@ -598,7 +601,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
String serviceInstanceName = "ALaCarteWithVnf"+randomAlphabetic(5);
String vnfInstanceName= "VnfForALaCarte"+randomAlphabetic(5);
VnfData vnfData = new VnfData("vOCG_1804_VF 0", "aca3f7b1-15f9-45a5-b182-b8b5aca84a76", vnfInstanceName, true);
- VfData vfmData = new VfData("vocg_1804_vf0..Vocg1804Vf..base_ocg..module-0", false, 1, 1, emptyList(), "815db6e5-bdfd-4cb6-9575-82c36df8747a", null);
+ VfData vfmData = new VfData("vocg_1804_vf0..Vocg1804Vf..base_ocg..module-0", false, 1, "1", emptyList(), "815db6e5-bdfd-4cb6-9575-82c36df8747a", null);
ServiceData serviceData = new ServiceData(IS_GENERATED_NAMING.TRUE, vnfData, vfmData, true);
resetGetServicesCache();
@@ -698,9 +701,9 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
createVnf(vnfData, false, serviceInstanceName);
createVfModule(serviceData, serviceInstanceName, true, false);
- serviceData.vfData = new VfData("vocg_1804_vf0..Vocg1804Vf..ocgmgr..module-1", true, 0, 1, emptyList(), "9c219e70-1177-494b-8977-1395c9f9168c", vgName);
+ serviceData.vfData = new VfData("vocg_1804_vf0..Vocg1804Vf..ocgmgr..module-1", true, 0, NO_MAX_INSTANCES_IN_MODEL, emptyList(), "9c219e70-1177-494b-8977-1395c9f9168c", vgName);
createVfModule(serviceData, serviceInstanceName, false, false);
- serviceData.vfData = new VfData("vocg_1804_vf0..Vocg1804Vf..ocgapp_001..module-12", true, 0, 1, emptyList(), "b601eef4-62fd-4201-a788-ae30e06a1aec", null);
+ serviceData.vfData = new VfData("vocg_1804_vf0..Vocg1804Vf..ocgapp_001..module-12", true, 0, NO_MAX_INSTANCES_IN_MODEL, emptyList(), "b601eef4-62fd-4201-a788-ae30e06a1aec", null);
createVfModule(serviceData, serviceInstanceName, false, false);
drawingBoardPage.deploy();
drawingBoardPage.verifyServiceCompletedOnTime(serviceInstanceName, "service "+serviceInstanceName);
@@ -767,7 +770,9 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
serviceDynamicFields,
IS_GENERATED_NAMING.TRUE, true, true, false,
"2017-488_PASQUALE-vPE 0",
- "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", 0, 1, new ArrayList<>(), "25284168-24bb-4698-8cb4-3f509146eca5", false);
+ "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", 0,
+ NO_MAX_INSTANCES_IN_MODEL, new ArrayList<>(),
+ "25284168-24bb-4698-8cb4-3f509146eca5", false);
prepareServicePreset(macroSriovWithDynamicFieldsEcompNamingTruePartialModelDetails, false);
@@ -1199,8 +1204,6 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
Wait.waitByTestId("model-item-value-subscriberName", 10);
Assert.assertEquals(Get.byTestId("model-item-value-subscriberName").getText(), "SILVIA ROBBINS", "Subscriber name should be shown in vf module");
- Assert.assertEquals(Get.byTestId("model-item-value-min"), null, "Min value should not be shown in VNF popup");
- Assert.assertEquals(Get.byTestId("model-item-value-max"), null, "Max value should not be show in VNF popup");
if (!vnfData.isGeneratedNaming) {
Assert.assertEquals(Get.byTestId("model-item-value-serviceName").getText(), serviceInstanceName, "Subscriber name should be shown in vf module");
}
@@ -1313,7 +1316,16 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
Wait.waitByTestId("model-item-value-subscriberName", 10);
Assert.assertEquals(Get.byTestId("model-item-value-subscriberName").getText(), "SILVIA ROBBINS", "Subscriber name should be shown in vf module");
Assert.assertEquals(Get.byTestId("model-item-value-min").getText(), Integer.toString(serviceData.vfData.vfMin), "Min should be shown");
- Assert.assertEquals(Get.byTestId("model-item-value-max").getText(), Integer.toString(serviceData.vfData.vfMax), "Max should be shown");
+ if (serviceData.vfData.vfMax!=null) {
+ if (!serviceData.vfData.vfMax.equals(NO_MAX_INSTANCES_IN_MODEL)) {
+ Assert.assertEquals(Get.byTestId("model-item-value-max").getText(), serviceData.vfData.vfMax, "Max should be shown");
+ }
+ else {
+ String defaultMaxText = Features.FLAG_2002_UNLIMITED_MAX.isActive() ? "Unlimited (default)" : "1";
+ Assert.assertEquals(Get.byTestId("model-item-value-max").getText(), defaultMaxText, "Max should be shown with default value");
+ }
+ }
+
if (serviceData.isGeneratedNaming!=IS_GENERATED_NAMING.TRUE) {
Wait.byText(serviceInstanceName);
Assert.assertEquals(Get.byTestId("model-item-value-serviceName").getText(), serviceInstanceName, "Service name should be shown in vf module");
@@ -1406,7 +1418,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
ServiceData(String modelUuid, List<String> dynamicFields, IS_GENERATED_NAMING isServiceGeneratedNaming,
boolean isVnfGeneratedNaming, boolean isVgEnabled, boolean multiStageDesign, String vnfName,
- String vfName, int vfMin, int vfMax, List<String> vfModuleDynamicFields, String vfVersionId, boolean isALaCarte) {
+ String vfName, int vfMin, String vfMax, List<String> vfModuleDynamicFields, String vfVersionId, boolean isALaCarte) {
this.modelUuid = modelUuid;
this.dynamicFields = dynamicFields;
this.isGeneratedNaming = isServiceGeneratedNaming;
@@ -1450,7 +1462,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
private static class VfData {
- VfData(String vfName, boolean vgEnabled, int vfMin, int vfMax, List<String> dynamicFields, String uuid, String vgName) {
+ VfData(String vfName, boolean vgEnabled, int vfMin, String vfMax, List<String> dynamicFields, String uuid, String vgName) {
this.vfName = vfName;
this.vgEnabled = vgEnabled;
this.vfMin = vfMin;
@@ -1461,7 +1473,7 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest {
}
final int vfMin;
- final int vfMax;
+ final String vfMax;
final String uuid;
final String vfName;
final boolean vgEnabled;
diff --git a/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java
index f6fbd268d..ab59f087d 100644
--- a/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java
+++ b/vid-automation/src/test/java/org/onap/vid/api/InstantiationTemplatesApiTest.java
@@ -23,6 +23,7 @@ import org.springframework.http.HttpMethod;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;
import vid.automation.test.Constants;
+import vid.automation.test.Constants.Users;
import vid.automation.test.model.User;
import vid.automation.test.services.AsyncJobsService;
import vid.automation.test.services.SimulatorApi.RegistrationStrategy;
@@ -59,8 +60,8 @@ public class InstantiationTemplatesApiTest extends AsyncInstantiationBase {
@Override
public UserCredentials getUserCredentials() {
- User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
- return new UserCredentials(user.credentials.userId, user.credentials.password, Constants.Users.EMANUEL_EMANUEL, "", "");
+ User user = usersService.getUser(Users.SILVIA_ROBBINS_TYLER_SILVIA);
+ return new UserCredentials(user.credentials.userId, user.credentials.password, Users.SILVIA_ROBBINS_TYLER_SILVIA, "", "");
}
@AfterMethod
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 8a6401083..a874fec4c 100644
--- a/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json
+++ b/vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json
@@ -46,7 +46,7 @@
"action": "Create",
"platformName": "xxx1",
"lcpCloudRegionId": "hvf6",
- "tenantId": "4914ab0ab3a743e58f0eefdacc1dde77",
+ "tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"instanceParams": [
{}
],
@@ -67,7 +67,7 @@
"instanceName": "hvf6arlba007_lba_Base_01",
"action": "Create",
"lcpCloudRegionId": "hvf6",
- "tenantId": "4914ab0ab3a743e58f0eefdacc1dde77",
+ "tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"instanceParams": [
{}
],
@@ -90,7 +90,7 @@
"instanceName": "hvf6arlba007_lba_dj_01",
"action": "Create",
"lcpCloudRegionId": "hvf6",
- "tenantId": "4914ab0ab3a743e58f0eefdacc1dde77",
+ "tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
"instanceParams": [
{}
],
diff --git a/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts
index 133dbe72a..4eb5445ad 100644
--- a/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts
@@ -257,6 +257,12 @@ describe('Drawing board', function () {
cy.addMacroVfModule(vnfName, vfModuleName, 'module-3');
cy.getElementByDataTestsId('node-d6557200-ecf2-4641-8094-5393ae3aae60-VF_vGeraldine 0').click();
cy.getElementByDataTestsId('node-41708296-e443-4c71-953f-d9a010f059e1-vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2').should('have.length', 3);
+
+ //make sure max instances in model info show Unlimited (default)
+ cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-41708296-e443-4c71-953f-d9a010f059e1-vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2', 0)
+ .drawingBoardTreeClickOnContextMenuOptionByName('Edit')
+ .getElementByDataTestsId('model-item-value-max').contains('Unlimited (default)')
+ .getElementByDataTestsId("cancelButton").click();
});
it('when there is no max_instances for VNF, it can be added multiple times ', () => {
diff --git a/vid-webpack-master/cypress/integration/iFrames/vnf.popup.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/vnf.popup.e2e.ts
index 41ab83399..74ce2a772 100644
--- a/vid-webpack-master/cypress/integration/iFrames/vnf.popup.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/vnf.popup.e2e.ts
@@ -49,10 +49,10 @@ describe('Vnf popup', function () {
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
cy.getElementByDataTestsId('node-2017-488_PASQUALE-vPE 0-add-btn').click({force : true});
- cy.getElementByDataTestsId('model-item-label-vnf-min').contains('Minimum to instantiate');
- cy.getElementByDataTestsId('model-item-value-vnf-min').contains('100');
- cy.getElementByDataTestsId('model-item-label-vnf-max').contains('Maximum to instantiate');
- cy.getElementByDataTestsId('model-item-value-vnf-max').contains('200');
+ cy.getElementByDataTestsId('model-item-label-min').contains('Minimum to instantiate');
+ cy.getElementByDataTestsId('model-item-value-min').contains('100');
+ cy.getElementByDataTestsId('model-item-label-max').contains('Maximum to instantiate');
+ cy.getElementByDataTestsId('model-item-value-max').contains('200');
})
});
@@ -63,10 +63,10 @@ describe('Vnf popup', function () {
cy.setReduxState(<any>res);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
cy.getElementByDataTestsId('node-2017-488_PASQUALE-vPE 0-add-btn').click({force : true});
- cy.getElementByDataTestsId('model-item-label-vnf-min').contains('Minimum to instantiate');
- cy.getElementByDataTestsId('model-item-value-vnf-min').contains('0');
- cy.getElementByDataTestsId('model-item-label-vnf-max').contains('Maximum to instantiate');
- cy.getElementByDataTestsId('model-item-value-vnf-max').contains('Unlimited (default)');
+ cy.getElementByDataTestsId('model-item-label-min').contains('Minimum to instantiate');
+ cy.getElementByDataTestsId('model-item-value-min').contains('0');
+ cy.getElementByDataTestsId('model-item-label-max').contains('Maximum to instantiate');
+ cy.getElementByDataTestsId('model-item-value-max').contains('Unlimited (default)');
})
});
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/basic.popup.service.spec.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/basic.popup.service.spec.ts
index a3c83263c..ebabc89b7 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/basic.popup.service.spec.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/basic.popup.service.spec.ts
@@ -2032,4 +2032,8 @@ describe('Basic popup service', () => {
}, 'modelType', 'modelName');
expect(result).toBeUndefined();
});
+
+ test('when there is no max instances in model , shell return maximum item with Unlimited text', () =>{
+ expect(service.createMaximumToInstantiateModelInformationItem({}).values[0]).toEqual('Unlimited (default)');
+ });
});
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/basic.popup.service.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/basic.popup.service.ts
index 1d44a9e5e..f8b40dd99 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/basic.popup.service.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/basic.popup.service.ts
@@ -11,6 +11,8 @@ import {VfModule} from "../../../models/vfModule";
import {VNFModel} from "../../../models/vnfModel";
import {VnfGroupModel} from "../../../models/vnfGroupModel";
import {FeatureFlagsService} from "../../../services/featureFlag/feature-flags.service";
+import {ModelInformationItem} from "../../model-information/model-information.component";
+import {Constants} from "../../../utils/constants";
@Injectable()
export class BasicPopupService {
@@ -53,4 +55,14 @@ export class BasicPopupService {
let dynamic = this._defaultDataGeneratorService.getArbitraryInputs(this._store.getState().service.serviceHierarchy[serviceId][type][modelName].inputs);
return this._basicControlGenerator.getDynamicInputsByType(dynamic, serviceId, storeKey, type );
}
+
+ createMaximumToInstantiateModelInformationItem(model): ModelInformationItem {
+ return new ModelInformationItem(
+ "Maximum to instantiate",
+ "max",
+ [!_.isNil(model.max) ? model.max.toString() : Constants.ModelInfo.UNLIMITED_DEFAULT],
+ "",
+ true
+ );
+ }
}
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service.ts
index 20336e5eb..3119cc8f8 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service.ts
@@ -81,7 +81,7 @@ export abstract class VfModulePopupServiceBase {
new ModelInformationItem("Service type", "serviceType", [this.serviceModel.serviceType]),
new ModelInformationItem("Service role", "serviceRole", [this.serviceModel.serviceRole]),
new ModelInformationItem("Minimum to instantiate", "min", this.model.min == undefined ? ['0'] : [this.model.min.toString()], "", true),
- new ModelInformationItem("Maximum to instantiate", "max", this.model.max == undefined ? ['1'] : [this.model.max.toString()], "", true),
+ this._basicPopupService.createMaximumToInstantiateModelInformationItem(this.model),
new ModelInformationItem("Recommended to instantiate", "initial", [this.model.initial])
];
});
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service.spec.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service.spec.ts
index c4317f241..2f1904468 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service.spec.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service.spec.ts
@@ -2334,10 +2334,6 @@ describe('vnf new popup service', () => {
expect(service.modelInformations[13].values).toEqual(['5']);
});
- test('when there is no max instances in model , shell return maximum item with Unlimited text', () =>{
- expect(service.createMaximumToInstantiateModelInformationItem({}).values[0]).toEqual('Unlimited (default)');
- });
-
test('getSubLeftTitle new vnf popup should return service model name', () => {
service.uuidData = {
serviceId: '6e59c5de-f052-46fa-aa7e-2fca9d674c44',
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service.ts
index 283603275..3e117ca74 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service.ts
@@ -96,22 +96,12 @@ export class VnfPopupService implements GenericPopupInterface{
new ModelInformationItem("Invariant UUID", "invariantUuid", [this.model.invariantUuid], Constants.ServicePopup.TOOLTIP_INVARIANT_UUID, true),
new ModelInformationItem("Service type", "serviceType", [this.serviceModel.serviceType]),
new ModelInformationItem("Service role", "serviceRole", [this.serviceModel.serviceRole]),
- new ModelInformationItem("Minimum to instantiate", "vnf-min", [!_.isNil(this.model.min) ? this.model.min.toString() : '0'], "", false),
- (this.createMaximumToInstantiateModelInformationItem(this.model))
+ new ModelInformationItem("Minimum to instantiate", "min", [!_.isNil(this.model.min) ? this.model.min.toString() : '0'], "", false),
+ this._basicPopupService.createMaximumToInstantiateModelInformationItem(this.model)
];
})
}
- createMaximumToInstantiateModelInformationItem(model) {
- return new ModelInformationItem(
- "Maximum to instantiate",
- "vnf-max",
- [!_.isNil(model.max) ? model.max.toString() : Constants.ModelInfo.UNLIMITED_DEFAULT],
- "",
- false
- );
- }
-
getSubLeftTitle(): string {
return "VNF MODEL: " + this._store.getState().service.serviceHierarchy[this.uuidData['serviceId']].vnfs[this.uuidData['modelName']].name;
}