* "targetResourceId","value":["Eace933104d443b496b8.nodes.heat.vpg"]}]]}]
*/
public class PolicyItem implements Cloneable {
- protected static final EELFLogger logger = EELFManager.getInstance().getLogger(PolicyItem.class);
- protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
- private String id;
- private String recipe;
- private int maxRetries;
- private int retryTimeLimit;
- private String parentPolicy;
- private List<String> parentPolicyConditions;
- private String actor;
- private String targetResourceId;
+ protected static final EELFLogger logger = EELFManager.getInstance().getLogger(PolicyItem.class);
+ protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
+ private String id;
+ private String recipe;
+ private int maxRetries;
+ private int retryTimeLimit;
+ private String parentPolicy;
+ private List<String> parentPolicyConditions;
+ private String actor;
+ private String targetResourceId;
/**
* Parse Policy given json node.
parentPolicy = AbstractModelElement.getValueByName(node, "parentPolicy");
parentPolicyConditions = AbstractModelElement.getValuesByName(node, "parentPolicyConditions");
targetResourceId = AbstractModelElement.getValueByName(node, "targetResourceId");
-
+ if (targetResourceId != null && targetResourceId.isEmpty()) {
+ this.setTargetResourceId(null);
+ }
}
/**
<label for="targetResourceId" class="col-sm-4 control-label">
Target ResourceId</label>
<div class="col-sm-8">
- <input type="text" class="form-control" id="targetResourceId"
- name="targetResourceId"> </input>
+ <select class="form-control" name="targetResourceId" id="targetResourceId" enableFilter="true" onchange="changeTargetResourceIdOther();">
+ <option value=""></option>
+ <option value="Other:">Other:</option>
+ </select>
</div>
+ <input type="text" style="display:none" class="form-control" id="targetResourceIdOther"
+ name="targetResourceIdOther" value=""></input>
</div>
</div>
</form>
</div>
<script>
+ function changeTargetResourceIdOther() {
+ if ($("#targetResourceId").val()==="Other:") {
+ $("#targetResourceIdOther").show();
+ } else {
+ $("#targetResourceIdOther").hide();
+ $("#targetResourceIdOther").val("");
+ }
+ }
//Basically this method will add a new form. All forms share the same class. When you want one form to show(active form) the other forms get the
// css attribute display:none
$("#add_one_more").click(function(event) {
$(".formId").remove();
if (policyObj !== undefined) {
+ // Set all the Resource Invariant UUID in the target resource ID list (+Empty and other)
+ Object.keys(vf_Services["shared"]["byVf"]).forEach(function(key){
+ $('#targetResourceId').append($('<option></option>').val(key).html(key));
+ });
+
var el = policyObj[id][3]['policyConfigurations']
for (var i = 0; i < el.length; i++) {
loadingId=true;
parent_policy[num]=el[i][j].value
if(el[i][j].name==='recipe' && el[i][j].value.toString()!==''){
$("#go_properties_tab"+num).text(el[i][j].value)
- }
+ }
+ if(el[i][j].name==="targetResourceIdOther" && el[i][j].value.toString()!=='') {
+ // Add the entry and set it
+ $('#targetResourceId').append($('<option></option>').val($('#targetResourceIdOther').val()).html($('#targetResourceIdOther').val()));
+ $('#targetResourceId').val($('#targetResourceIdOther').val());
+ }
+
}
}
}
$("#formId"+k+" #parentPolicy").change();
}
+ // Now load all component with the right value defined in policyObj JSON
for (headInd in policyObj[id]){
if (!(policyObj[id][headInd].hasOwnProperty("policyConfigurations"))){
$("#" + policyObj[id][headInd].name).val(policyObj[id][headInd].value);
}
}
}
-
+
setMultiSelect();
if (readMOnly){
}
$("#savePropsBtn").click(function(event) {
+ if($("#targetResourceIdOther").is(":visible")) {
+ $('#targetResourceId').append($('<option></option>').val($("#targetResourceIdOther").val()).html($("#targetResourceIdOther").val()))
+ $("#targetResourceId").val($("#targetResourceIdOther").val());
+ }
$(".idError").hide();
if ($("#policyTable .highlight td").html() !== $("#pname").val()){
//repeated name
finalSaveList[tableVal] = allPolicies[tableVal];
}
});
-
+
saveProperties(finalSaveList);
$("#close_button").click();
})
# ============LICENSE_START=======================================================
# ONAP CLAMP
# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights
+# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
# reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
major=2
minor=0
-patch=0
+patch=1
base_version=${major}.${minor}.${patch}