* limitations under the License.
* ============LICENSE_END=========================================================
*/
-angular.module('abs').controller('dcaeMicroServiceController', function ($scope, $window, $compile, PolicyAppService, modalService, $modal, Notification) {
+angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$window', '$compile', 'PolicyAppService', 'policyNavigator', 'modalService', '$modal', 'Notification', function ($scope, $window, $compile, PolicyAppService, PolicyNavigator, modalService, $modal, Notification) {
$("#dialog").hide();
+
+ $scope.policyNavigator;
$scope.isCheck = false;
$scope.savebutton = true;
- $scope.finalPath = null;
+ $scope.refreshCheck = false;
+
+ $scope.refresh = function(){
+ if($scope.refreshCheck){
+ $scope.policyNavigator.refresh();
+ }
+ $scope.modal('createNewPolicy', true);
+ $scope.temp.policy = "";
+ };
+
+ $scope.modal = function(id, hide) {
+ return $('#' + id).modal(hide ? 'hide' : 'show');
+ };
-// $scope.temp.policy.ttlDate = "2016-12-31";
if ($scope.temp.policy.editPolicy != undefined|| $scope.temp.policy.readOnly != undefined){
if ($scope.temp.policy.configName == undefined){
$scope.isCheck = false;
}
function getList(attribute) {
-
+ var enumName = attribute;
+ console.log("In getList: attribute => " + attribute);
+ if(attribute){
+ if(attribute.includes(":")){
+ enumName = attribute.split(":")[0];
+ }
+ }
var baseEnum = $scope.dcaeModelData.enumValues;
- var enumList = baseEnum.split(splitEnum);
+ var enumList = [];
+ if(baseEnum != null){
+ enumList = baseEnum.split(splitEnum);
+ }
var enumAttributes;
- var patternTest = new RegExp(attribute);
+ var patternTest = new RegExp(enumName);
for (k=0; k < enumList.length; k += 1){
if(patternTest.test(enumList[k]) == true){
enumAttributes = enumList[k].trim();
enumAttributes = enumAttributes.replace("[", "");
enumAttributes = enumAttributes.replace("]", "");
enumAttributes = enumAttributes.replace(/ /g, '');
-
var dropListAfterCommaSplit = enumAttributes.split(splitEqual);
listemunerateValues = dropListAfterCommaSplit[1].split(splitComma);
-
- enumKeyList.push(attribute);
-
+ //enumKeyList.push(attribute);
return listemunerateValues;
}
option.appendChild(document.createTextNode(listemunerateValues[i]));
listField.appendChild(option);
}
- listField.setAttribute("id" , ''+ labelLevel + attributeName + '');;
+ listField.setAttribute("id" , ''+ labelLevel + attributeName + '');
+
+ enumKeyList.push(attributeName);
+
document.getElementById(divID).appendChild(label);
document.getElementById(divID).appendChild(br);
}
$scope.savePolicy = function(policy){
+ if(policy.itemContent != undefined){
+ $scope.refreshCheck = true;
+ $scope.policyNavigator = policy.itemContent;
+ policy.itemContent = "";
+ }
$scope.savebutton = false;
var splitAt = '*';
var dot ='.';
}
return obj;
}
-});
\ No newline at end of file
+}]);
\ No newline at end of file