<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>
</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>
<build>
<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>
<build>
<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>
# 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
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
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());
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());
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;
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);
+ }
}
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;
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
}
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;
@Size(max = 1000)
private String description;
+ @NotNull
+ private EntitlementPoolType type;
+
private Integer thresholdValue;
private ThresholdUnit thresholdUnits;
this.description = description;
}
+ public EntitlementPoolType getType() {
+ return type;
+ }
+
+ public void setType(EntitlementPoolType type) {
+ this.type = type;
+ }
+
public Integer getThresholdValue() {
return thresholdValue;
}
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;
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,
entitlementPool.setVersion(version);
entitlementPool.setName(name);
entitlementPool.setDescription(desc);
+ entitlementPool.setType(type);
entitlementPool.setThresholdValue(threshold);
entitlementPool.setThresholdUnit(thresholdUnit);
entitlementPool.setIncrements(increments);
}
@Before
- public void setUp() throws Exception {
+ public void setUp() {
MockitoAnnotations.initMocks(this);
}
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");
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));
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));
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));
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");
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);
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));
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));
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");
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");
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");
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'");
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);
private String id;
private String name;
private String description;
+ private EntitlementPoolType type;
@Column(name = "threshold")
private Integer thresholdValue;
this.description = description;
}
+ public EntitlementPoolType getType() {
+ return type;
+ }
+
+ public void setType(EntitlementPoolType type) {
+ this.type = type;
+ }
+
public Integer getThresholdValue() {
return thresholdValue;
}
@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);
}
&& 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)
+ ", id='" + id + '\''
+ ", name='" + name + '\''
+ ", description='" + description + '\''
+ + ", type=" + type
+ ", thresholdValue=" + thresholdValue
+ ", thresholdUnit='" + thresholdUnit + '\''
+ ", increments='" + increments + '\''
--- /dev/null
+/*-
+ * ============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);
+ }
+ }
+}
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());
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;
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
<build>
<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>
@extend .heading-1;
color: $purple;
}
+ .type {
+ color: $orange;
+ }
}
}
display: flex;
flex-direction: column;
justify-content: space-between;
- *:last-child {
- margin-top: 20px;
- }
*:only-child {
margin-top: 0;
}
* 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.
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,
{
name: entitlementPool.name,
description: entitlementPool.description,
+ type: entitlementPool.type,
thresholdValue: entitlementPool.thresholdValue,
thresholdUnits: getValue(entitlementPool.thresholdUnits),
increments: entitlementPool.increments,
};
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' },
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)
: '';
};
errorText: '',
validations: [{ type: 'maxLength', data: 1000 }]
},
+ type: {
+ isValid: true,
+ errorText: '',
+ validations: [{ type: 'required', data: true }]
+ },
increments: {
isValid: true,
errorText: '',
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 = {
let {
id,
name,
+ type,
description,
thresholdValue,
thresholdUnits,
<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">
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';
}) => {
let {
name,
+ type,
description,
thresholdUnits,
thresholdValue,
versionUUID
} = data;
return (
- <GridSection hasLastColSet>
+ <GridSection hasLostColSet>
<GridItem colSpan={2}>
<Input
onChange={name =>
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
)
)}
</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 =>
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"
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>
groupClassName="no-bottom-margin"
/>
</GridItem>
-
<GridItem colSpan={2}>
<Input
onChange={increments =>
*/
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';
epData: {
name,
description,
+ type,
thresholdValue,
thresholdUnits,
manufacturerReferenceNumber
<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"
thresholdValue: 76,
thresholdUnits: '%',
increments: 'string',
+ type: 'Universal',
startDate: new Date().getTime(),
expiryDate: new Date().getTime()
});
<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>