aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--features.properties.md6
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/properties/Features.java1
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteServiceCypress2.java10
-rw-r--r--vid-automation/src/main/java/vid/automation/test/infra/Features.java2
-rw-r--r--vid-automation/src/main/java/vid/automation/test/sections/ViewEditPage.java12
-rw-r--r--vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java6
-rw-r--r--vid-automation/src/main/java/vid/automation/test/test/VidBaseTestCase.java2
-rw-r--r--vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest3.java4
-rw-r--r--vid-automation/src/test/resources/asyncInstantiation/vidRequestDelete1Create1Network.json2
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/ala-carte.e2e.ts2
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/network.popup.e2e.ts14
-rw-r--r--vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json3
-rw-r--r--vid-webpack-master/cypress/support/steps/fill.network.step.ts7
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.spec.ts7
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts25
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.spec.ts13
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts30
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.spec.ts14
-rw-r--r--vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.ts44
19 files changed, 100 insertions, 104 deletions
diff --git a/features.properties.md b/features.properties.md
index 54be31b1a..505a82bcf 100644
--- a/features.properties.md
+++ b/features.properties.md
@@ -221,4 +221,8 @@
* FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF
When flag is true new VF Modules on Alacarte service will inherit LCP-Region and Tenant from parent VNF.
- When off, user is requested to specify LCP-Region and Tenant for each VF Module. \ No newline at end of file
+ When off, user is requested to specify LCP-Region and Tenant for each VF Module.
+
+* FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT
+ When flag is true the platform will appear as a multi select field, if false the platform will be dropdown list.
+ \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java
index 939684c58..5e966a989 100644
--- a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java
@@ -89,6 +89,7 @@ public enum Features implements Feature {
FLAG_2006_LIMIT_OWNING_ENTITY_SELECTION_BY_ROLES,
FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF,
FLAG_EXP_TOPOLOGY_TREE_VFMODULE_NAMES_FROM_OTHER_TOSCA_VERSIONS,
+ FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT,
;
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteServiceCypress2.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteServiceCypress2.java
index 356b59d9f..b7f629c8a 100644
--- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteServiceCypress2.java
+++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteServiceCypress2.java
@@ -5,18 +5,22 @@ public class PresetMSOCreateNetworkALaCarteServiceCypress2 extends PresetMSOBase
private String networkName;
private String serviceModelName;
private String serviceModelVersionId;
+ private String platformName;
public PresetMSOCreateNetworkALaCarteServiceCypress2(String overrideRequestId, String serviceInstanceId, String networkName) {
- this(overrideRequestId, serviceInstanceId, networkName, "ComplexService", "6e59c5de-f052-46fa-aa7e-2fca9d674c44");
+ this(overrideRequestId, serviceInstanceId, networkName, "ComplexService", "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
+ "xxx1");
}
- public PresetMSOCreateNetworkALaCarteServiceCypress2(String overrideRequestId, String serviceInstanceId, String networkName, String serviceModelName, String serviceModelVersionId) {
+ public PresetMSOCreateNetworkALaCarteServiceCypress2(String overrideRequestId, String serviceInstanceId,
+ String networkName, String serviceModelName, String serviceModelVersionId, String platformName) {
super(overrideRequestId);
this.serviceInstanceId = serviceInstanceId;
this.networkName = networkName;
this.serviceModelName = serviceModelName;
this.serviceModelVersionId = serviceModelVersionId;
+ this.platformName = platformName;
}
@Override
@@ -43,7 +47,7 @@ public class PresetMSOCreateNetworkALaCarteServiceCypress2 extends PresetMSOBase
"{\"lcpCloudRegionId\":\"hvf6\"," +
addCloudOwnerIfNeeded() +
"\"tenantId\":\"229bcdc6eaeb4ca59d55221141d01f8e\"}," +
- "\"platform\":{\"platformName\":\"xxx1\"}," +
+ "\"platform\":{\"platformName\":\"" + platformName + "\"}," +
"\"modelInfo\":" +
"{\"modelCustomizationId\":\"94fdd893-4a36-4d70-b16a-ec29c54c184f\"," +
"\"modelCustomizationName\":\"ExtVL 0\"," +
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 ff06bf98e..f0065869f 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
@@ -61,6 +61,8 @@ public enum Features implements Feature {
FLAG_2006_USER_PERMISSIONS_BY_OWNING_ENTITY,
FLAG_2006_LIMIT_OWNING_ENTITY_SELECTION_BY_ROLES,
FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF,
+ FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT,
+
;
public boolean isActive() {
diff --git a/vid-automation/src/main/java/vid/automation/test/sections/ViewEditPage.java b/vid-automation/src/main/java/vid/automation/test/sections/ViewEditPage.java
index adba6f28f..3943af0e8 100644
--- a/vid-automation/src/main/java/vid/automation/test/sections/ViewEditPage.java
+++ b/vid-automation/src/main/java/vid/automation/test/sections/ViewEditPage.java
@@ -1,19 +1,17 @@
package vid.automation.test.sections;
+import static org.hamcrest.core.Is.is;
+
+import java.util.List;
import org.junit.Assert;
import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import vid.automation.test.Constants;
-import vid.automation.test.infra.Features;
import vid.automation.test.infra.Get;
import vid.automation.test.infra.SelectOption;
-import static org.hamcrest.core.Is.is;
-/**
- * Created by itzikliderman on 13/06/2017.
- */
public class ViewEditPage extends VidBasePage {
public ViewEditPage selectNodeInstanceToAdd(String vnfName) {
selectFromDropdownByTestId(Constants.ViewEdit.VNF_OPTION_TEST_ID_PREFIX + vnfName,
@@ -133,8 +131,8 @@ public class ViewEditPage extends VidBasePage {
// return this;
// }
- public ViewEditPage selectPlatform(String platform) {
- SelectOption.byValue(platform, Constants.OwningEntity.PLATFORM_SELECT_TEST_ID);
+ public ViewEditPage selectPlatform(List<String> platformList) {
+ SelectOption.selectOptionsFromMultiselectById("multi-selectPlatform", platformList);
return this;
}
}
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 4fdf825d3..99e824086 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
@@ -1200,11 +1200,9 @@ public class NewServiceInstanceTest extends ModernUITestBase {
assertSetButtonDisabled(VNF_SET_BUTTON_TEST_ID);
+ SelectOption.selectOptionsFromMultiselectById("multi-selectPlatform", ImmutableList.of("platform"));
- if(isNetwork){
- browseASDCPage.selectPlatform("platform");
- }else {
- SelectOption.selectOptionsFromMultiselectById("multi-selectPlatform", ImmutableList.of("platform"));
+ if(!isNetwork){
SelectOption.byTestIdAndVisibleText("TYLER SILVIA", Constants.ViewEdit.PRODUCT_FAMILY_SELECT_TESTS_ID);
browseASDCPage.selectProductFamily("e433710f-9217-458d-a79d-1c7aff376d89");
}
diff --git a/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestCase.java b/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestCase.java
index 842142751..74ceec635 100644
--- a/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestCase.java
+++ b/vid-automation/src/main/java/vid/automation/test/test/VidBaseTestCase.java
@@ -357,7 +357,7 @@ public class VidBaseTestCase extends SetupCDTest{
viewEditPage.selectSuppressRollback(suppressRollback);
if(platform != null){
- viewEditPage.selectPlatform(platform);
+ viewEditPage.selectPlatform(ImmutableList.of(platform));
}
viewEditPage.clickConfirmButton();
viewEditPage.assertMsoRequestModal(Constants.ViewEdit.MSO_SUCCESSFULLY_TEXT);
diff --git a/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest3.java b/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest3.java
index 7e98f3c93..70ded1c09 100644
--- a/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest3.java
+++ b/vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest3.java
@@ -377,7 +377,9 @@ public class AsyncInstantiationALaCarteApiTest3 extends AsyncInstantiationBase {
new PresetAAIGetSubscribersGet(),
new PresetMSODeleteNetworkAlaCarteCypress(deleteRequestId, serviceInstanceId, networkInstanceId, "us16807000"),
new PresetMSOOrchestrationRequestGet(COMPLETE, deleteRequestId),
- new PresetMSOCreateNetworkALaCarteServiceCypress2(createRequestId, serviceInstanceId, "ExtVL", "action-data", "6b528779-44a3-4472-bdff-9cd15ec93450"),
+ new PresetMSOCreateNetworkALaCarteServiceCypress2(createRequestId, serviceInstanceId,
+ "ExtVL", "action-data",
+ "6b528779-44a3-4472-bdff-9cd15ec93450", "xxx1,platform"),
new PresetMSOOrchestrationRequestGet(COMPLETE, createRequestId),
PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MTN6_TO_ATT_AIC
), RegistrationStrategy.CLEAR_THEN_SET);
diff --git a/vid-automation/src/test/resources/asyncInstantiation/vidRequestDelete1Create1Network.json b/vid-automation/src/test/resources/asyncInstantiation/vidRequestDelete1Create1Network.json
index fe4aab145..114565ee3 100644
--- a/vid-automation/src/test/resources/asyncInstantiation/vidRequestDelete1Create1Network.json
+++ b/vid-automation/src/test/resources/asyncInstantiation/vidRequestDelete1Create1Network.json
@@ -64,7 +64,7 @@
"productFamilyId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
"lcpCloudRegionId":"hvf6",
"tenantId":"229bcdc6eaeb4ca59d55221141d01f8e",
- "platformName":"xxx1",
+ "platformName":"xxx1,platform" ,
"lineOfBusiness":"zzz1",
"instanceParams":[
{
diff --git a/vid-webpack-master/cypress/integration/iFrames/ala-carte.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/ala-carte.e2e.ts
index b9072139e..4988ec8e8 100644
--- a/vid-webpack-master/cypress/integration/iFrames/ala-carte.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/ala-carte.e2e.ts
@@ -195,7 +195,7 @@ describe('A la carte', function () {
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
cy.getElementByDataTestsId("node-ExtVL 0-add-btn").click({force: true});
- cy.selectDropdownOptionByText("platform", "xxx1");
+ cy.selectPlatformValue("xxx1");
cy.selectDropdownOptionByText("lcpRegion", "AAIAIC25");
cy.selectDropdownOptionByText("tenant", "USP-SIP-IC-24335-T-01");
cy.selectDropdownOptionByText("productFamily", "ERICA");
diff --git a/vid-webpack-master/cypress/integration/iFrames/network.popup.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/network.popup.e2e.ts
index 2baab721c..a17443135 100644
--- a/vid-webpack-master/cypress/integration/iFrames/network.popup.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/network.popup.e2e.ts
@@ -57,14 +57,14 @@ describe('Network popup', function () {
cy.checkIsOptionSelected('lcpRegion', 'hvf6');
cy.checkIsOptionSelected('tenant', '229bcdc6eaeb4ca59d55221141d01f8e');
cy.checkIsOptionSelected('lineOfBusiness', 'zzz1');
- cy.checkIsOptionSelected('platform', 'xxx1');
+ cy.checkPlatformValue('xxx1');
//change platform value
- cy.selectDropdownOptionByText('platform', 'platform');
+ cy.selectPlatformValue('platform');
cy.getElementByDataTestsId('form-set').click({force: true}).then(() => {
cy.getElementByDataTestsId('numberButton').contains('1');
cy.getElementByDataTestsId('node-ddc3f20c-08b5-40fd-af72-c6d14636b986-ExtVL 0-menu-btn').click({force: true})
.getElementByDataTestsId('context-menu-edit').click({force: true}).then(() => {
- cy.checkIsOptionSelected('platform', 'platform');
+ cy.checkPlatformValue( 'platform');
// cancel button should close the dialog
cy.getElementByDataTestsId('cancelButton').click({force: true}).then(() => {
// duplicate network
@@ -130,7 +130,7 @@ describe('Network popup', function () {
cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2');
cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
- cy.selectDropdownOptionByText('platform', 'xxx1');
+ cy.selectPlatformValue('xxx1');
cy.getElementByDataTestsId('form-set').should('not.have.attr', 'disabled');
// clear required dynamic input.
@@ -175,9 +175,10 @@ describe('Network popup', function () {
//add one network
cy.getElementByDataTestsId('node-ExtVL 0-add-btn').click({force: true}).then(() => {
verifyServiceModelNameInModelInfo();
- cy.fillNetworkPopup();
+ cy.fillNetworkPopup(true);
});
+
const networkNodeToDelete = "node-ddc3f20c-08b5-40fd-af72-c6d14636b986-ExtVL 0";
cy.getElementByDataTestsId(`${networkNodeToDelete}-menu-btn`).eq(0).click({force: true})
.getElementByDataTestsId('context-menu-delete').click();
@@ -214,7 +215,8 @@ describe('Network popup', function () {
"FLAG_SERVICE_MODEL_CACHE": true,
"FLAG_ADVANCED_PORTS_FILTER": true,
"FLAG_REGION_ID_FROM_REMOTE": true,
- "FLAG_ADD_MSO_TESTAPI_FIELD": true
+ "FLAG_ADD_MSO_TESTAPI_FIELD": true,
+ "FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT": true
},
"type": "[FLAGS] Update"
},
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json
index d9602d139..148f6b4d5 100644
--- a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json
+++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json
@@ -24,5 +24,6 @@
"FLAG_2002_UNLIMITED_MAX" : true,
"FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE": true,
"FLAG_2006_VFM_SDNC_PRELOAD_FILES" : true,
- "FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF": true
+ "FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF": true,
+ "FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT" :true
}
diff --git a/vid-webpack-master/cypress/support/steps/fill.network.step.ts b/vid-webpack-master/cypress/support/steps/fill.network.step.ts
index c981ac4b2..4ca1796f1 100644
--- a/vid-webpack-master/cypress/support/steps/fill.network.step.ts
+++ b/vid-webpack-master/cypress/support/steps/fill.network.step.ts
@@ -5,12 +5,15 @@ declare namespace Cypress {
}
}
-function fillNetworkPopup(): Chainable<any> {
+function fillNetworkPopup(shouldSelectAdditionalPlatform: boolean = false): Cypress.Chainable<any> {
cy.selectDropdownOptionByText('productFamily', 'Emanuel');
cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2');
cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
- cy.selectDropdownOptionByText('platform', 'xxx1');
+ cy.selectPlatformValue('xxx1');
+ if(shouldSelectAdditionalPlatform){
+ cy.selectPlatformValue('platform');
+ }
return cy.getElementByDataTestsId('form-set').click({force : true}).then((done)=>{
return done;
});
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.spec.ts
index b5277b48d..3fadd34ff 100644
--- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.spec.ts
+++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.spec.ts
@@ -7,10 +7,15 @@ import {GenericFormService} from "../../generic-form.service";
import {FormBuilder} from "@angular/forms";
import {LogService} from "../../../../utils/log/log.service";
import {FormControlNames, NetworkControlGenerator} from "./network.control.generator";
-import {FormControlModel, ValidatorModel, ValidatorOptions} from "../../../../models/formControlModels/formControl.model";
+import {
+ FormControlModel,
+ ValidatorModel,
+ ValidatorOptions
+} from "../../../../models/formControlModels/formControl.model";
import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service";
import {SharedControllersService} from "../sharedControlles/shared.controllers.service";
+
class MockAppStore<T> {
getState(){
return {
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts
index a7f16db4b..e0418fcfa 100644
--- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts
+++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts
@@ -9,12 +9,11 @@ import * as _ from 'lodash';
import {FormControlModel,} from "../../../../models/formControlModels/formControl.model";
import {LogService} from "../../../../utils/log/log.service";
import {AppState} from "../../../../store/reducers";
-import {DropdownFormControl} from "../../../../models/formControlModels/dropdownFormControl.model";
-import {FormControlType} from "../../../../models/formControlModels/formControlTypes.enum";
import {NetworkInstance} from "../../../../models/networkInstance";
import {NetworkModel} from "../../../../models/networkModel";
import {SharedControllersService} from "../sharedControlles/shared.controllers.service";
+
export enum FormControlNames {
INSTANCE_NAME = 'instanceName',
PRODUCT_FAMILY_ID = 'productFamilyId',
@@ -56,6 +55,7 @@ export class NetworkControlGenerator {
const networkInstance = this._basicControlGenerator.retrieveInstanceIfUpdateMode(this.store, this.getNetworkInstance(serviceId, networkStoreKey, isUpdateMode));
const networkModel = new NetworkModel(this.store.getState().service.serviceHierarchy[serviceId].networks[networkName]);
let result: FormControlModel[] = [];
+ const flags = this.store.getState().global.flags;
if (!_.isNil(networkModel)) {
result.push(this.getInstanceName(networkInstance, serviceId, networkName, networkModel.isEcompGeneratedNaming));
@@ -63,7 +63,7 @@ export class NetworkControlGenerator {
result.push(this._sharedControllersService.getLcpRegionControl(serviceId, networkInstance, result));
result.push(this._sharedControllersService.getLegacyRegion(networkInstance));
result.push(this._sharedControllersService.getTenantControl(serviceId, networkInstance));
- result.push(this.getPlatformControl(networkInstance));
+ result.push(this._sharedControllersService.getPlatformMultiselectControl(networkInstance, result, flags['FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT']));
result.push(this._sharedControllersService.getLineOfBusinessControl(networkInstance));
}
return result;
@@ -80,6 +80,7 @@ export class NetworkControlGenerator {
let result: FormControlModel[] = [];
const networkInstance = this._basicControlGenerator.retrieveInstanceIfUpdateMode(this.store, this.getNetworkInstance(serviceId, networkStoreKey, isUpdateMode));
const networkModel = new NetworkModel(this.store.getState().service.serviceHierarchy[serviceId].networks[networkName]);
+ const flags = this.store.getState().global.flags;
if (!_.isNil(networkModel)) {
result.push(this.getInstanceName(networkInstance, serviceId, networkName, networkModel.isEcompGeneratedNaming));
@@ -87,7 +88,7 @@ export class NetworkControlGenerator {
result.push(this._sharedControllersService.getLcpRegionControl(serviceId, networkInstance, result));
result.push(this._sharedControllersService.getLegacyRegion(networkInstance));
result.push(this._sharedControllersService.getTenantControl(serviceId, networkInstance));
- result.push(this.getPlatformControl(networkInstance));
+ result.push(this._sharedControllersService.getPlatformMultiselectControl(networkInstance, result, flags['FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT']));
result.push(this._sharedControllersService.getLineOfBusinessControl(networkInstance));
result.push(this._sharedControllersService.getRollbackOnFailureControl(networkInstance));
}
@@ -99,20 +100,4 @@ export class NetworkControlGenerator {
const networkModel: NetworkModel = this.store.getState().service.serviceHierarchy[serviceId].networks[networkName];
return this._sharedControllersService.getInstanceNameController(instance, serviceId, isEcompGeneratedNaming, networkModel);
}
-
- getPlatformControl = (instance: any): DropdownFormControl => {
- return new DropdownFormControl({
- type: FormControlType.DROPDOWN,
- controlName: 'platformName',
- displayName: 'Platform',
- dataTestId: 'platform',
- placeHolder: 'Select Platform',
- isDisabled: false,
- name: "platform",
- value: instance ? instance.platformName : null,
- validations: [],
- onInitSelectedField: ['platformList'],
- onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters)
- })
- };
}
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.spec.ts
index 58ee33b53..f456a747a 100644
--- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.spec.ts
+++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.spec.ts
@@ -11,7 +11,6 @@ import {FormControlModel, ValidatorOptions} from "../../../../models/formControl
import {ControlGeneratorUtil} from "../control.generator.util.service";
-
describe('Shared Controllers Service', () => {
let injector;
let service: SharedControllersService;
@@ -118,6 +117,18 @@ describe('Shared Controllers Service', () => {
const legacyRegionControl: FormControlModel = service.getLegacyRegion(instance);
expect(legacyRegionControl.isVisible).toBeFalsy();
});
+
+ test('multiSelectFlag is not activated should generate platform multi select control with 1 as limitSelection', ()=>{
+ const control = service.getPlatformMultiselectControl(null, [],false);
+ expect(control.dataTestId).toEqual('multi-selectPlatform');
+ expect(control.limitSelection).toEqual(1);
+ });
+
+ test('multiSelectFlag is activated should generate platform multi select control with 1000 as limitSelection', ()=>{
+ const control = service.getPlatformMultiselectControl(null, [],true);
+ expect(control.dataTestId).toEqual('multi-selectPlatform');
+ expect(control.limitSelection).toEqual(1000);
+ });
});
class MockAppStore<T> {
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts
index 4b567328d..c41c6c282 100644
--- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts
+++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts
@@ -18,6 +18,8 @@ import {InputFormControl} from "../../../../models/formControlModels/inputFormCo
import {NodeModel} from "../../../../models/nodeModel";
import {LcpRegion} from "../../../../models/lcpRegion";
import {Tenant} from "../../../../models/tenant";
+import {MultiselectFormControl} from "../../../../models/formControlModels/multiselectFormControl.model";
+import {MultiSelectItem} from "../../../formControls/component/multiselect/multiselect.model";
@Injectable()
export class SharedControllersService {
@@ -284,4 +286,32 @@ export class SharedControllersService {
formControlModel.value = instance ? instance.instanceName : null;
return formControlModel;
}
+
+ getPlatformMultiselectControl = (instance: any, controls: FormControlModel[], isMultiSelected: boolean) : MultiselectFormControl => {
+ return new MultiselectFormControl({
+ type: FormControlType.MULTI_SELECT,
+ controlName: 'platformName',
+ displayName: 'Platform',
+ dataTestId: 'multi-selectPlatform',
+ selectedFieldName: 'name',
+ ngValue: 'name',
+ placeHolder: 'Select Platform',
+ isDisabled: false,
+ name: "platform",
+ value: instance ? instance.platformName : '',
+ limitSelection: isMultiSelected ? 1000 : 1,
+ validations: [new ValidatorModel(ValidatorOptions.required, 'is required')],
+ onInitSelectedField: ['platformList'],
+ onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters),
+ onChange: (param: MultiSelectItem[], form: FormGroup) => {
+ form.controls['platformName'].setValue(param.map((multiSelectItem: MultiSelectItem) => {
+ return multiSelectItem.itemName
+ }).join(','));
+ },
+ convertOriginalDataToArray: (value?: string) => {
+ if (_.isNil(value)) return [];
+ return value.split(',');
+ }
+ });
+ }
}
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.spec.ts
index c7d623671..08afb417e 100644
--- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.spec.ts
+++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.spec.ts
@@ -14,7 +14,6 @@ import {
import {LogService} from "../../../../utils/log/log.service";
import {VnfControlGenerator} from "./vnf.control.generator";
import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service";
-import {FormControlType} from "../../../../models/formControlModels/formControlTypes.enum";
import {SharedControllersService} from "../sharedControlles/shared.controllers.service";
class MockAppStore<T> {
@@ -940,19 +939,6 @@ describe('VNF Control Generator', () => {
})().then(done).catch(done.fail));
-
- test('should generate platform multi select control', ()=>{
- const control = service.getPlatformMultiselectControl(null, [],false);
- expect(control.type).toEqual(FormControlType.MULTI_SELECT);
- expect(control.controlName).toEqual('platformName');
- expect(control.displayName).toEqual('Platform');
- expect(control.dataTestId).toEqual('multi-selectPlatform');
- expect(control.selectedFieldName).toEqual('name');
- expect(control.value).toEqual('');
- expect(control.onChange).toBeDefined();
- expect(control.convertOriginalDataToArray).toBeDefined();
- });
-
test('getMacroFormControls check for mandatory controls', () => {
const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
const vnfName : string = "VF_vGeraldine 0";
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.ts
index ef58bc761..4b325b286 100644
--- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.ts
+++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.ts
@@ -4,19 +4,11 @@ import {AaiService} from "../../../../services/aaiService/aai.service";
import {NgRedux} from "@angular-redux/store";
import {HttpClient} from "@angular/common/http";
import {ControlGeneratorUtil} from "../control.generator.util.service";
-import {
- FormControlModel,
- ValidatorModel,
- ValidatorOptions
-} from "../../../../models/formControlModels/formControl.model";
+import {FormControlModel} from "../../../../models/formControlModels/formControl.model";
import {LogService} from "../../../../utils/log/log.service";
import {VNFModel} from "../../../../models/vnfModel";
import {AppState} from "../../../../store/reducers";
-import {FormGroup} from "@angular/forms";
-import {FormControlType} from "../../../../models/formControlModels/formControlTypes.enum";
import * as _ from 'lodash';
-import {MultiselectFormControl} from "../../../../models/formControlModels/multiselectFormControl.model";
-import {MultiSelectItem} from "../../../formControls/component/multiselect/multiselect.model";
import {SharedControllersService} from "../sharedControlles/shared.controllers.service";
import {FeatureFlagsService, Features} from "../../../../services/featureFlag/feature-flags.service";
@@ -60,7 +52,7 @@ export class VnfControlGenerator {
result.push(this._sharedControllersService.getLcpRegionControl(serviceId, vnfInstance, result));
result.push(this._sharedControllersService.getLegacyRegion(vnfInstance));
result.push(this._sharedControllersService.getTenantControl(serviceId, vnfInstance));
- result.push(this.getPlatformMultiselectControl(vnfInstance, result, flags['FLAG_2002_VNF_PLATFORM_MULTI_SELECT']));
+ result.push(this._sharedControllersService.getPlatformMultiselectControl(vnfInstance, result, flags['FLAG_2002_VNF_PLATFORM_MULTI_SELECT']));
result.push(this._sharedControllersService.getLineOfBusinessControl(vnfInstance));
}
return result;
@@ -91,12 +83,12 @@ export class VnfControlGenerator {
result.push(this._sharedControllersService.getLcpRegionByLineOfBusinessControl(serviceId, vnfInstance, result));
result.push(this._sharedControllersService.getLegacyRegion(vnfInstance));
result.push(this._sharedControllersService.getTenantByLcpRegionControl(serviceId, vnfInstance));
- result.push(this.getPlatformMultiselectControl(vnfInstance, result, isMultiSelected));
+ result.push(this._sharedControllersService.getPlatformMultiselectControl(vnfInstance, result, isMultiSelected));
} else {
result.push(this._sharedControllersService.getLcpRegionControl(serviceId, vnfInstance, result));
result.push(this._sharedControllersService.getLegacyRegion(vnfInstance));
result.push(this._sharedControllersService.getTenantControl(serviceId, vnfInstance));
- result.push(this.getPlatformMultiselectControl(vnfInstance, result, isMultiSelected));
+ result.push(this._sharedControllersService.getPlatformMultiselectControl(vnfInstance, result, isMultiSelected));
result.push(this._sharedControllersService.getLineOfBusinessControl(vnfInstance));
}
@@ -109,32 +101,4 @@ export class VnfControlGenerator {
const vnfModel : VNFModel = this.store.getState().service.serviceHierarchy[serviceId].vnfs[vnfName];
return this._sharedControllersService.getInstanceNameController(instance, serviceId, isEcompGeneratedNaming, vnfModel);
}
-
- getPlatformMultiselectControl = (instance: any, controls: FormControlModel[], isMultiSelected: boolean) : MultiselectFormControl => {
- return new MultiselectFormControl({
- type: FormControlType.MULTI_SELECT ,
- controlName: 'platformName',
- displayName: 'Platform',
- dataTestId: 'multi-selectPlatform',
- selectedFieldName : 'name' ,
- ngValue : 'name',
- placeHolder: 'Select Platform',
- isDisabled: false,
- name: "platform",
- value: instance ? instance.platformName : '',
- limitSelection : isMultiSelected ? 1000 : 1,
- validations: [new ValidatorModel(ValidatorOptions.required, 'is required')],
- onInitSelectedField: ['platformList'],
- onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters),
- onChange : (param: MultiSelectItem[], form: FormGroup) => {
- form.controls['platformName'].setValue(param.map((multiSelectItem: MultiSelectItem)=>{
- return multiSelectItem.itemName
- }).join(','));
- },
- convertOriginalDataToArray : (value?: string) => {
- if(_.isNil(value)) return [];
- return value.split(',');
- }
- });
- };
}