diff options
author | Ben David, Elad (eb7504) <eb7504@intl.att.com> | 2020-03-17 18:12:17 +0200 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-03-23 08:06:19 +0000 |
commit | ec7da6aea30a1b73d1e0f5f75d2b6119ed8fa251 (patch) | |
tree | de325ed98badf0aa456b52d3f10257dec26a8228 | |
parent | 1a64c83fc436e17f93e468f7d46ff9f5fcb081ce (diff) |
Entitlement Pool - Support Type Field
Change-Id: Ibd9996cce04849332bd23dd62e6143386cdd9a70
Issue-ID: SDC-2820
Signed-off-by: Ben David, Elad (eb7504) <eb7504@intl.att.com>
27 files changed, 285 insertions, 163 deletions
diff --git a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-component-tests/pom.xml b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-component-tests/pom.xml index e03aee5ace..b5aec18b26 100644 --- a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-component-tests/pom.xml +++ b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-component-tests/pom.xml @@ -12,11 +12,6 @@ <artifactId>onap-generic-artifact-browser-component-tests</artifactId> - <properties> - <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> - <dependencies> <!--tested packages--> <dependency> @@ -40,20 +35,4 @@ </dependency> </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>${maven-compiler-plugin.version}</version> - <configuration> - <encoding>${project.build.sourceEncoding}</encoding> - <source>8</source> - <target>8</target> - <compilerArgument>-Werror</compilerArgument> - </configuration> - </plugin> - </plugins> - </build> </project> diff --git a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/pom.xml b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/pom.xml index 93a571a3c1..81555a08f6 100644 --- a/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/pom.xml +++ b/common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/pom.xml @@ -70,14 +70,6 @@ <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>8</source> - <target>8</target> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${maven-surefire-plugin.version}</version> </plugin> diff --git a/common/pom.xml b/common/pom.xml index 4a405fcc33..44bd6a4bd5 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -42,11 +42,6 @@ <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>${mvn.compiler.version}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>${mvn.jar.version}</version> </plugin> diff --git a/cucumber-js-test-apis-ci/features/UserFeedback/TestMRN.feature b/cucumber-js-test-apis-ci/features/UserFeedback/TestMRN.feature index 161ea57341..e63d3df253 100644 --- a/cucumber-js-test-apis-ci/features/UserFeedback/TestMRN.feature +++ b/cucumber-js-test-apis-ci/features/UserFeedback/TestMRN.feature @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -Feature: User Feedback - Enhance EP & LKG to include MRN +Feature: User Feedback - Enhance EP to include MRN and Type Scenario: Test Feature Group and Entitlement Pool @@ -24,27 +24,46 @@ Feature: User Feedback - Enhance EP & LKG to include MRN Then I want to create input data Then I want to update the input property "name" with value "FG_01" - Then I want to update the input property "description" with value "FG without MRN" + Then I want to update the input property "description" with value "FG" Then I want to update the input property "partNumber" with value "999" Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/feature-groups" with the input data from the context When I want to create input data Then I want to update the input property "name" with value "EP_01" + Then I want to update the input property "type" with value "Universal" Then I want to update the input property "description" with value "EP without MRN" Then I want the following to fail Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools" with the input data from the context - When I want to create input data Then I want to update the input property "name" with value "EP_02" - Then I want to update the input property "description" with value "EP with MRN" Then I want to update the input property "manufacturerReferenceNumber" with value "12345" + Then I want to update the input property "description" with value "EP without Type" + Then I want the following to fail Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools" with the input data from the context - Then I want to get path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools/{responseData.value}" - Then I want to check property "manufacturerReferenceNumber" for value "12345" - - - + When I want to create input data + Then I want to update the input property "name" with value "EP_03" + Then I want to update the input property "type" with value "_Universal" + Then I want to update the input property "manufacturerReferenceNumber" with value "12345" + Then I want to update the input property "description" with value "EP with wrong type" + Then I want the following to fail + Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools" with the input data from the context + When I want to create input data + Then I want to update the input property "name" with value "EP_04" + Then I want to update the input property "type" with value "" + Then I want to update the input property "manufacturerReferenceNumber" with value "12345" + Then I want to update the input property "description" with value "EP with empty Type" + Then I want the following to fail + Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools" with the input data from the context + When I want to create input data + Then I want to update the input property "name" with value "EP_05" + Then I want to update the input property "description" with value "EP with valid type and MRN" + Then I want to update the input property "type" with value "Universal" + Then I want to update the input property "manufacturerReferenceNumber" with value "12345" + Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools" with the input data from the context + Then I want to get path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools/{responseData.value}" + Then I want to check property "manufacturerReferenceNumber" for value "12345" + Then I want to check property "type" for value "Universal"
\ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java index 52135fad55..2510bd0634 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java @@ -32,6 +32,7 @@ public class MapEntitlementPoolEntityToEntitlementPoolEntityDto target.setId(source.getId()); target.setName(source.getName()); target.setDescription(source.getDescription()); + target.setType(source.getType()); target.setThresholdValue(source.getThresholdValue()); target.setThresholdUnits(source.getThresholdUnit()); target.setIncrements(source.getIncrements()); diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java index 5832596580..5c45ed652a 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java @@ -32,6 +32,7 @@ public class MapEntitlementPoolRequestDtoToEntitlementPoolEntity target.setName(source.getName()); target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); target.setDescription(source.getDescription()); + target.setType(source.getType()); target.setThresholdValue(source.getThresholdValue()); target.setThresholdUnit(source.getThresholdUnits()); target.setIncrements(source.getIncrements()); diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/test/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDtoTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/test/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDtoTest.java index f2010e62de..999b430bd8 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/test/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDtoTest.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/test/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDtoTest.java @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType; import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; @@ -154,4 +155,16 @@ public class MapEntitlementPoolEntityToEntitlementPoolEntityDtoTest { mapper.doMapping(source, target); assertEquals(target.getManufacturerReferenceNumber(), param); } + + @Test + public void testType() { + EntitlementPoolEntity source = new EntitlementPoolEntity(); + EntitlementPoolEntityDto target = new EntitlementPoolEntityDto(); + MapEntitlementPoolEntityToEntitlementPoolEntityDto mapper = + new MapEntitlementPoolEntityToEntitlementPoolEntityDto(); + EntitlementPoolType entitlementPoolType = EntitlementPoolType.One_Time; + source.setType(entitlementPoolType); + mapper.doMapping(source, target); + assertEquals(target.getType(), entitlementPoolType); + } } diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/test/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntityTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/test/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntityTest.java index 7ff6fb78f5..0c28ceef36 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/test/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntityTest.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/test/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntityTest.java @@ -21,6 +21,7 @@ import static org.testng.Assert.assertEquals; import java.util.Collections; import java.util.HashSet; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto; import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; @@ -126,6 +127,19 @@ public class MapEntitlementPoolRequestDtoToEntitlementPoolEntityTest { assertEquals(target.getManufacturerReferenceNumber(), param); } + @Test + public void testType() { + EntitlementPoolRequestDto source = new EntitlementPoolRequestDto(); + EntitlementPoolEntity target = new EntitlementPoolEntity(); + MapEntitlementPoolRequestDtoToEntitlementPoolEntity mapper = new + MapEntitlementPoolRequestDtoToEntitlementPoolEntity(); + EntitlementPoolType entitlementPoolType = EntitlementPoolType.Universal; + source.setType(entitlementPoolType); + mapper.doMapping(source, target); + assertEquals(target.getType(), entitlementPoolType); + } + + enum TestEnum { Yes } diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java index dbd6ddc063..f9a04566b2 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java @@ -24,6 +24,7 @@ package org.openecomp.sdcrests.vendorlicense.types; import io.swagger.v3.oas.annotations.media.Schema; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.hibernate.validator.constraints.NotBlank; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit; @@ -46,6 +47,9 @@ public class EntitlementPoolRequestDto { @Size(max = 1000) private String description; + @NotNull + private EntitlementPoolType type; + private Integer thresholdValue; private ThresholdUnit thresholdUnits; @@ -82,6 +86,14 @@ public class EntitlementPoolRequestDto { this.description = description; } + public EntitlementPoolType getType() { + return type; + } + + public void setType(EntitlementPoolType type) { + this.type = type; + } + public Integer getThresholdValue() { return thresholdValue; } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/EntitlementPoolTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/EntitlementPoolTest.java index 5db85fef06..d7edce3c78 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/EntitlementPoolTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/EntitlementPoolTest.java @@ -31,6 +31,7 @@ import org.openecomp.sdc.vendorlicense.dao.LimitDao; import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime; import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; @@ -78,6 +79,7 @@ public class EntitlementPoolTest { public EntitlementPoolEntity createEntitlementPool(String vlmId, Version version, String id, String name, String desc, int threshold, ThresholdUnit thresholdUnit, + EntitlementPoolType type, EntitlementMetric entitlementMetricChoice, String entitlementMetricOther, String increments, @@ -93,6 +95,7 @@ public class EntitlementPoolTest { entitlementPool.setVersion(version); entitlementPool.setName(name); entitlementPool.setDescription(desc); + entitlementPool.setType(type); entitlementPool.setThresholdValue(threshold); entitlementPool.setThresholdUnit(thresholdUnit); entitlementPool.setIncrements(increments); @@ -102,7 +105,7 @@ public class EntitlementPoolTest { } @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); } @@ -121,7 +124,7 @@ public class EntitlementPoolTest { opScopeChoices.add(OperationalScope.Network_Wide); EntitlementPoolEntity ep2 = createEntitlementPool("vlm1Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, ThresholdUnit - .Absolute, + .Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); @@ -144,8 +147,8 @@ public class EntitlementPoolTest { opScopeChoices.add(OperationalScope.Network_Wide); EntitlementPoolEntity ep2 = createEntitlementPool("vlm2Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, - EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, + ThresholdUnit.Absolute, EntitlementPoolType.Unique, + EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); ep2.setStartDate(LocalDate.now().format(formatter)); @@ -166,8 +169,8 @@ public class EntitlementPoolTest { opScopeChoices.add(OperationalScope.Network_Wide); EntitlementPoolEntity ep2 = createEntitlementPool("vlm3Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, - EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, + ThresholdUnit.Absolute, EntitlementPoolType.Unique, + EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); ep2.setExpiryDate(LocalDate.now().plusDays(2L).format(formatter)); @@ -187,8 +190,8 @@ public class EntitlementPoolTest { opScopeChoices.add(OperationalScope.Network_Wide); EntitlementPoolEntity ep2 = createEntitlementPool("vlm4Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, - EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, + ThresholdUnit.Absolute, EntitlementPoolType.Unique, + EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); ep2.setStartDate(LocalDate.now().format(formatter)); @@ -208,7 +211,7 @@ public class EntitlementPoolTest { opScopeChoices.add(OperationalScope.Network_Wide); EntitlementPoolEntity ep2 = createEntitlementPool("vlm2Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, + ThresholdUnit.Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); @@ -230,7 +233,7 @@ public class EntitlementPoolTest { opScopeChoices.add(OperationalScope.Network_Wide); EntitlementPoolEntity ep2 = createEntitlementPool("vlm2Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, + ThresholdUnit.Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); ep2.setStartDate(null); @@ -250,9 +253,8 @@ public class EntitlementPoolTest { opScopeChoices.add(OperationalScope.Network_Wide); EntitlementPoolEntity ep2 = createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit - .Absolute, - EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, + ThresholdUnit.Absolute, EntitlementPoolType.Unique, + EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); ep2.setStartDate(LocalDate.now().minusDays(3L).format(formatter)); @@ -271,8 +273,8 @@ public class EntitlementPoolTest { opScopeChoices.add(OperationalScope.Network_Wide); EntitlementPoolEntity ep2 = createEntitlementPool("vlm2Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, - EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, + ThresholdUnit.Absolute, EntitlementPoolType.Unique, + EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); ep2.setStartDate(LocalDate.now().format(formatter)); @@ -294,8 +296,8 @@ public class EntitlementPoolTest { opScopeChoices.add(OperationalScope.Network_Wide); EntitlementPoolEntity ep2 = createEntitlementPool("vlm3Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, - EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, + ThresholdUnit.Absolute, EntitlementPoolType.Unique, + EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); @@ -318,8 +320,8 @@ public class EntitlementPoolTest { opScopeChoices.add(OperationalScope.Network_Wide); EntitlementPoolEntity ep2 = createEntitlementPool("vlm4Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, - EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, + ThresholdUnit.Absolute, EntitlementPoolType.Unique, + EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); @@ -342,7 +344,7 @@ public class EntitlementPoolTest { EntitlementPoolEntity entitlementPool = createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric2", "inc2", + ThresholdUnit.Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); @@ -371,7 +373,7 @@ public class EntitlementPoolTest { EntitlementPoolEntity entitlementPool = createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric2", "inc2", + ThresholdUnit.Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy'T'HH:mm:ss'Z'"); @@ -400,11 +402,11 @@ public class EntitlementPoolTest { doReturn(Arrays.asList( createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP1 dec", 70, - ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric1", + ThresholdUnit.Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric1", "inc1", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time1", "sku1"), createEntitlementPool(vlm1_id, VERSION01, ep2_id, EP2_NAME, "EP2 dec", 70, - ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric2", + ThresholdUnit.Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null, opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"))) .when(vendorLicenseFacade).listEntitlementPools(vlm1_id, VERSION01); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java index 4c2435a3a5..4d3c1d63a7 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java @@ -57,6 +57,7 @@ public class EntitlementPoolEntity implements VersionableEntity { private String id; private String name; private String description; + private EntitlementPoolType type; @Column(name = "threshold") private Integer thresholdValue; @@ -179,6 +180,14 @@ public class EntitlementPoolEntity implements VersionableEntity { this.description = description; } + public EntitlementPoolType getType() { + return type; + } + + public void setType(EntitlementPoolType type) { + this.type = type; + } + public Integer getThresholdValue() { return thresholdValue; } @@ -311,7 +320,7 @@ public class EntitlementPoolEntity implements VersionableEntity { @Override public int hashCode() { return Objects - .hash(vendorLicenseModelId, version, id, name, description, thresholdValue, thresholdUnit, + .hash(vendorLicenseModelId, version, id, name, description, type, thresholdValue, thresholdUnit, increments, operationalScope, referencingFeatureGroups, startDate, expiryDate); } @@ -329,6 +338,7 @@ public class EntitlementPoolEntity implements VersionableEntity { && Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(description, that.description) + && type == that.type && Objects.equals(thresholdUnit, that.thresholdUnit) && Objects.equals(increments, that.increments) && Objects.equals(that.operationalScope, operationalScope) @@ -346,6 +356,7 @@ public class EntitlementPoolEntity implements VersionableEntity { + ", id='" + id + '\'' + ", name='" + name + '\'' + ", description='" + description + '\'' + + ", type=" + type + ", thresholdValue=" + thresholdValue + ", thresholdUnit='" + thresholdUnit + '\'' + ", increments='" + increments + '\'' diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java new file mode 100644 index 0000000000..3b66fab110 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.vendorlicense.dao.types; + +public enum EntitlementPoolType { + Universal, + Unique, + One_Time; + + public static EntitlementPoolType permissiveValueOf(String name) { + if (name == null){ + return null; + } else { + return EntitlementPoolType.valueOf(name); + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java index aa9c249007..e084cf1c1b 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java @@ -238,6 +238,7 @@ public class EntitlementPoolZusammenDaoImpl implements EntitlementPoolDao { info.setDescription(entitlementPool.getDescription()); info.addProperty(ElementPropertyName.elementType.name(), ElementType.EntitlementPool); info.addProperty("version_uuid", entitlementPool.getVersionUuId()); + info.addProperty("EntitlementPoolType", entitlementPool.getType()); info.addProperty("thresholdValue", entitlementPool.getThresholdValue()); info.addProperty("threshold_unit", entitlementPool.getThresholdUnit()); info.addProperty("increments", entitlementPool.getIncrements()); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java index 258886c601..2f06b9b0d0 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java @@ -25,6 +25,7 @@ import com.amdocs.zusammen.datatypes.item.Info; import com.amdocs.zusammen.datatypes.item.Relation; import org.openecomp.convertor.ElementConvertor; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType; import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit; @@ -78,6 +79,7 @@ public class ElementToEntitlementPoolConvertor extends ElementConvertor { entitlementPool.setName(info.getName()); entitlementPool.setDescription(info.getDescription()); entitlementPool.setVersionUuId(info.getProperty("version_uuid")); + entitlementPool.setType(EntitlementPoolType.permissiveValueOf(info.getProperty("EntitlementPoolType"))); entitlementPool.setThresholdValue(toInteger(info.getProperty("thresholdValue"))); String thresholdUnit = info.getProperty("threshold_unit"); entitlementPool diff --git a/openecomp-be/pom.xml b/openecomp-be/pom.xml index 09f6dafcd6..7c99ba52c6 100644 --- a/openecomp-be/pom.xml +++ b/openecomp-be/pom.xml @@ -61,11 +61,6 @@ <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>${mvn.compiler.version}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>${mvn.jar.version}</version> </plugin> diff --git a/openecomp-ui/resources/scss/modules/_entitlementPools.scss b/openecomp-ui/resources/scss/modules/_entitlementPools.scss index 736927fb51..8e8b820e99 100644 --- a/openecomp-ui/resources/scss/modules/_entitlementPools.scss +++ b/openecomp-ui/resources/scss/modules/_entitlementPools.scss @@ -4,6 +4,9 @@ @extend .heading-1; color: $purple; } + .type { + color: $orange; + } } } diff --git a/openecomp-ui/resources/scss/modules/_licenseModelOverview.scss b/openecomp-ui/resources/scss/modules/_licenseModelOverview.scss index eca87b6962..02a8922e45 100644 --- a/openecomp-ui/resources/scss/modules/_licenseModelOverview.scss +++ b/openecomp-ui/resources/scss/modules/_licenseModelOverview.scss @@ -346,9 +346,6 @@ $lkg-ep-color: $light-blue; display: flex; flex-direction: column; justify-content: space-between; - *:last-child { - margin-top: 20px; - } *:only-child { margin-top: 0; } diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js index be33af7910..d6a3c8b095 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js index dec7d9c3b8..f1e2f2d956 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js @@ -41,6 +41,7 @@ function postEntitlementPool(licenseModelId, entitlementPool, version) { return RestAPIUtil.post(baseUrl(licenseModelId, version), { name: entitlementPool.name, description: entitlementPool.description, + type: entitlementPool.type, thresholdValue: entitlementPool.thresholdValue, thresholdUnits: getValue(entitlementPool.thresholdUnits), increments: entitlementPool.increments, @@ -62,6 +63,7 @@ function putEntitlementPool( { name: entitlementPool.name, description: entitlementPool.description, + type: entitlementPool.type, thresholdValue: entitlementPool.thresholdValue, thresholdUnits: getValue(entitlementPool.thresholdUnits), increments: entitlementPool.increments, diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsConstants.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsConstants.js index d4a2f0954c..571b512007 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsConstants.js +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsConstants.js @@ -58,6 +58,12 @@ export const thresholdUnitType = { }; export const optionsInputValues = { + TYPE: [ + { enum: '', title: i18n('please select…') }, + { enum: 'Universal', title: 'Universal' }, + { enum: 'Unique', title: 'Unique' }, + { enum: 'One_Time', title: 'One Time' } + ], TIME: [ { enum: '', title: i18n('please select…') }, { enum: 'Hour', title: 'Hour' }, @@ -91,9 +97,9 @@ export const extractValue = item => { return ''; } //TODO fix it later return item - ? item.choice === optionInputOther.OTHER - ? item.other - : InputOptions.getTitleByName(optionsInputValues, item.choice) + ? item === optionInputOther.OTHER + ? item + : InputOptions.getTitleByName(optionsInputValues, item) : ''; }; diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorReducer.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorReducer.js index eb9cd51346..674a8eba51 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorReducer.js +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorReducer.js @@ -56,6 +56,11 @@ export default (state = {}, action) => { errorText: '', validations: [{ type: 'maxLength', data: 1000 }] }, + type: { + isValid: true, + errorText: '', + validations: [{ type: 'required', data: true }] + }, increments: { isValid: true, errorText: '', diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsListEditorView.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsListEditorView.jsx index 2592687298..7e980f1320 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsListEditorView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsListEditorView.jsx @@ -20,7 +20,8 @@ import i18n from 'nfvo-utils/i18n/i18n.js'; import ListEditorView from 'nfvo-components/listEditor/ListEditorView.jsx'; import ListEditorItemView from 'nfvo-components/listEditor/ListEditorItemView.jsx'; -import { extractUnits } from './EntitlementPoolsConstants'; +import { optionsInputValues, extractUnits } from './EntitlementPoolsConstants'; +import InputOptions from 'nfvo-components/input/validation/InputOptions.jsx'; class EntitlementPoolsListEditorView extends React.Component { static propTypes = { @@ -89,6 +90,7 @@ class EntitlementPoolsListEditorView extends React.Component { let { id, name, + type, description, thresholdValue, thresholdUnits, @@ -111,7 +113,12 @@ class EntitlementPoolsListEditorView extends React.Component { <div className="textEllipses text name">{name}</div> </div> </div> - + <div className="list-editor-item-view-field"> + <div className="title">{i18n('Type')}</div> + <div className="text type"> + {InputOptions.getTitleByName(optionsInputValues, type)} + </div> + </div> <div className="list-editor-item-view-field"> <div className="title">{i18n('Entitlement')}</div> <div className="entitlement-pools-count"> diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/components/FormContent.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/components/FormContent.jsx index b734a88d67..9eb38dec64 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/components/FormContent.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/components/FormContent.jsx @@ -19,7 +19,10 @@ import i18n from 'nfvo-utils/i18n/i18n.js'; import GridSection from 'nfvo-components/grid/GridSection.jsx'; import GridItem from 'nfvo-components/grid/GridItem.jsx'; import Input from 'nfvo-components/input/validation/Input.jsx'; -import { SP_ENTITLEMENT_POOL_FORM } from '../EntitlementPoolsConstants.js'; +import { + optionsInputValues, + SP_ENTITLEMENT_POOL_FORM +} from 'sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsConstants.js'; import { DATE_FORMAT } from 'sdc-app/onboarding/OnboardingConstants.js'; import { optionsInputValues as LicenseModelOptionsInputValues } from '../../LicenseModelConstants.js'; import UuId from 'sdc-app/onboarding/licenseModel/components/UuId.jsx'; @@ -34,6 +37,7 @@ export const EntitlementPoolsFormContent = ({ }) => { let { name, + type, description, thresholdUnits, thresholdValue, @@ -45,7 +49,7 @@ export const EntitlementPoolsFormContent = ({ versionUUID } = data; return ( - <GridSection hasLastColSet> + <GridSection hasLostColSet> <GridItem colSpan={2}> <Input onChange={name => @@ -62,7 +66,44 @@ export const EntitlementPoolsFormContent = ({ type="text" /> </GridItem> - <GridItem colSpan={2} lastColInRow> + <GridItem colSpan={2}> + <Input + isRequired={true} + onChange={e => { + const selectedIndex = e.target.selectedIndex; + const val = e.target.options[selectedIndex].value; + onDataChanged({ type: val }, SP_ENTITLEMENT_POOL_FORM); + }} + value={type} + label={i18n('Type')} + data-test-id="create-ep-type" + isValid={genericFieldInfo.type.isValid} + errorText={genericFieldInfo.type.errorText} + groupClassName="bootstrap-input-options" + className="input-options-select" + overlayPos="bottom" + type="select"> + {optionsInputValues.TYPE.map(type => ( + <option key={type.enum} value={type.enum}> + {type.title} + </option> + ))} + </Input> + </GridItem> + <GridItem colSpan={2} stretch> + <Input + onChange={description => + onDataChanged({ description }, SP_ENTITLEMENT_POOL_FORM) + } + isValid={genericFieldInfo.description.isValid} + errorText={genericFieldInfo.description.errorText} + label={i18n('Description')} + value={description} + data-test-id="create-ep-description" + type="textarea" + /> + </GridItem> + <GridItem> <Input onChange={e => { // setting the unit to the correct value @@ -97,21 +138,30 @@ export const EntitlementPoolsFormContent = ({ ) )} </Input> - </GridItem> - <GridItem colSpan={2} stretch> <Input - onChange={description => - onDataChanged({ description }, SP_ENTITLEMENT_POOL_FORM) + type="date" + label={i18n('Start Date')} + value={startDate} + dateFormat={DATE_FORMAT} + startDate={startDate} + endDate={expiryDate} + onChange={startDate => + onDataChanged( + { + startDate: startDate + ? startDate.format(DATE_FORMAT) + : '' + }, + SP_ENTITLEMENT_POOL_FORM, + { startDate: validateStartDate } + ) } - isValid={genericFieldInfo.description.isValid} - errorText={genericFieldInfo.description.errorText} - label={i18n('Description')} - value={description} - data-test-id="create-ep-description" - type="textarea" + isValid={genericFieldInfo.startDate.isValid} + errorText={genericFieldInfo.startDate.errorText} + selectsStart /> </GridItem> - <GridItem colSpan={2} lastColInRow> + <GridItem> <Input className="entitlement-pools-form-row-threshold-value" onChange={thresholdValue => @@ -131,16 +181,30 @@ export const EntitlementPoolsFormContent = ({ type="text" /> <Input - onChange={increments => - onDataChanged({ increments }, SP_ENTITLEMENT_POOL_FORM) - } - label={i18n('Increments')} - value={increments} - data-test-id="create-ep-increments" - type="text" + type="date" + label={i18n('Expiry Date')} + value={expiryDate} + dateFormat={DATE_FORMAT} + startDate={startDate} + endDate={expiryDate} + onChange={expiryDate => { + onDataChanged( + { + expiryDate: expiryDate + ? expiryDate.format(DATE_FORMAT) + : '' + }, + SP_ENTITLEMENT_POOL_FORM + ); + onDataChanged({ startDate }, SP_ENTITLEMENT_POOL_FORM, { + startDate: validateStartDate + }); + }} + isValid={genericFieldInfo.expiryDate.isValid} + errorText={genericFieldInfo.expiryDate.errorText} + selectsEnd /> </GridItem> - <GridItem colSpan={2}> <Input className="entitlement-pools-form-row-threshold-value" @@ -161,64 +225,19 @@ export const EntitlementPoolsFormContent = ({ data-test-id="create-ep-manufacturerReferenceNumber-value" value={manufacturerReferenceNumber} type="text" - groupClassName="no-bottom-margin" /> </GridItem> - <GridItem colSpan={2} lastColInRow> - <div className="date-section"> - <Input - groupClassName="no-bottom-margin" - type="date" - label={i18n('Start Date')} - value={startDate} - dateFormat={DATE_FORMAT} - startDate={startDate} - endDate={expiryDate} - onChange={startDate => - onDataChanged( - { - startDate: startDate - ? startDate.format(DATE_FORMAT) - : '' - }, - SP_ENTITLEMENT_POOL_FORM, - { startDate: validateStartDate } - ) - } - isValid={genericFieldInfo.startDate.isValid} - errorText={genericFieldInfo.startDate.errorText} - selectsStart - /> - <Input - groupClassName="no-bottom-margin" - type="date" - label={i18n('Expiry Date')} - value={expiryDate} - dateFormat={DATE_FORMAT} - startDate={startDate} - endDate={expiryDate} - onChange={expiryDate => { - onDataChanged( - { - expiryDate: expiryDate - ? expiryDate.format(DATE_FORMAT) - : '' - }, - SP_ENTITLEMENT_POOL_FORM - ); - onDataChanged( - { startDate }, - SP_ENTITLEMENT_POOL_FORM, - { - startDate: validateStartDate - } - ); - }} - isValid={genericFieldInfo.expiryDate.isValid} - errorText={genericFieldInfo.expiryDate.errorText} - selectsEnd - /> - </div> + <GridItem colSpan={2}> + <Input + onChange={increments => + onDataChanged({ increments }, SP_ENTITLEMENT_POOL_FORM) + } + label={i18n('Increments')} + value={increments} + data-test-id="create-ep-increments" + groupClassName="no-bottom-margin" + type="text" + /> </GridItem> {id && versionUUID && <UuId id={id} versionUUID={versionUUID} />} </GridSection> diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/components/FormContent.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/components/FormContent.jsx index c2c62b1402..24864289e1 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/components/FormContent.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/components/FormContent.jsx @@ -214,7 +214,6 @@ const LicenseKeyGroupFormContent = ({ groupClassName="no-bottom-margin" /> </GridItem> - <GridItem colSpan={2}> <Input onChange={increments => diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/listItems/EntitlementPool.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/listItems/EntitlementPool.jsx index ec5c76bd79..cceca25c71 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/listItems/EntitlementPool.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/listItems/EntitlementPool.jsx @@ -15,7 +15,10 @@ */ import React, { Component } from 'react'; import i18n from 'nfvo-utils/i18n/i18n.js'; -import { extractUnits } from '../../entitlementPools/EntitlementPoolsConstants.js'; +import { + extractValue, + extractUnits +} from 'sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsConstants.js'; import ArrowCol from './listItemsComponents/ArrowCol.jsx'; import ItemInfo from './listItemsComponents/ItemInfo.jsx'; import IconCol from './listItemsComponents/IconCol.jsx'; @@ -30,6 +33,7 @@ class EntitlementPool extends Component { epData: { name, description, + type, thresholdValue, thresholdUnits, manufacturerReferenceNumber @@ -46,6 +50,13 @@ class EntitlementPool extends Component { <IconCol className="ep-icon" text="EP" /> <ItemInfo name={name} description={description} /> <AdditionalDataCol> + {type && ( + <AdditionalDataElement + className="vlm-list-item-entitlement-metric" + name={i18n('Type')} + value={extractValue(type)} + /> + )} {thresholdValue && ( <AdditionalDataElement className="vlm-list-item-entitlement-metric" diff --git a/openecomp-ui/test-utils/factories/licenseModel/EntitlementPoolFactories.js b/openecomp-ui/test-utils/factories/licenseModel/EntitlementPoolFactories.js index 11422b4d18..d558b9ab5e 100644 --- a/openecomp-ui/test-utils/factories/licenseModel/EntitlementPoolFactories.js +++ b/openecomp-ui/test-utils/factories/licenseModel/EntitlementPoolFactories.js @@ -28,6 +28,7 @@ Factory.define('EntitlementPoolExtendedBaseFactory') thresholdValue: 76, thresholdUnits: '%', increments: 'string', + type: 'Universal', startDate: new Date().getTime(), expiryDate: new Date().getTime() }); @@ -386,7 +386,7 @@ Modifications copyright (c) 2018-2019 Nokia <plugin> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> - <version>2.2.6</version> + <version>4.0.0</version> </plugin> </plugins> </pluginManagement> |