Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions client/cat3/src/factory/chefDataFormatterService.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,35 +294,6 @@
}
return temp;
},
//method to get the runlist array and then assign the className to each value.
findDataForEditValueString: function (list) {
var runlist = list;

runlist = runlist.split(',');
var temp = [];
if (runlist) {
/*jslint forin: true */
for (var i = 0; i < runlist.length; i++) {
var className;
if (runlist[i].indexOf('recipe') === 0) {
className = "cookbook";
} else if (runlist[i].indexOf('role') === 0) {
className = "role";
} else {
className = "template";
}
var item = runlist[i];
temp.push({
value: item,
className: className,
data: {}
});
}
}else {

}
return temp;
},
//formatting the name and removing the default name style coming from server.
chefRunlistFormatter: function (list) {
var runlist = list;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
organObjectId.buss=$rootScope.organNewEnt.buss.rowid;
organObjectId.proj=$rootScope.organNewEnt.proj.rowId;
var params;
if(tempType === 'docker' || tempType === 'arm'){
if(tempType === 'docker' || tempType === 'arm' || tempType === 'composite'){
params = {
url: '/organizations/'+organObjectId.org+'/businessgroups/'+organObjectId.buss+'/projects/'+organObjectId.proj+'/blueprintList?pagination='+pagination+'&templateType='+tempType+'&providerType='
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@
$scope.nextEnabled = true;
$scope.templateSelected = templateDetail;
if($scope.templateSelected.templatescookbooks !== '' && $scope.templateSelected.templatetypename === "SoftwareStack"){
$scope.chefComponentSelectorList = $scope.templateSelected.templatescookbooks;
$scope.chefrunlist = responseFormatter.findDataForEditValueString($scope.chefComponentSelectorList);
var chefComponentSelector = $scope.templateSelected.templatescookbooks;
var chefRunlist = chefComponentSelector.split(',');
$scope.chefComponentSelectorList = responseFormatter.findDataForEditValue(chefRunlist);
$scope.chefrunlist = responseFormatter.chefRunlistFormatter($scope.chefComponentSelectorList);
}
$scope.dockerDetails = [];
//items gives the details of the selected blueprint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
pbList.viewTypeList=true;
pbList.selectedCards=[];
pbList.blueprintType=$state.params.templateName;

var treeNames=['Design', $state.params.providerName,$state.params.templateObj.templatetypename];
$rootScope.$emit('treeNameUpdate', treeNames);
pbList.createList = function (){
Expand All @@ -33,10 +32,10 @@
{ name:'Docker Path',minWidth:150,field:'blueprintConfig.dockerCompose[0].dockercontainerpaths'},
{ name:'Docker Path Title',minWidth:150,field:'blueprintConfig.dockerCompose[0].dockercontainerpathstitle'},
{ name:'Docker RepoTag',minWidth:150,field:'blueprintConfig.dockerCompose[0].dockerrepotags'},
{ name:'Action',minWidth:150,cellTemplate:'<span class="badge cat-btn-update" title="Clone" ng-click="grid.appScope.copyBp(row.entity._id)"><i class="fa fa-clone fa-2 white" aria-hidden="true"></i></span> ' +
'&nbsp; <span class="badge cat-btn-update" title="Info" ng-click="grid.appScope.blueprintInfo($event,row.entity,null);"><i class="fa fa-info fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="badge cat-btn-update" title="Launch" ng-click="grid.appScope.launchInstance($event,row.entity);"><i class="fa fa-location-arrow fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="badge cat-btn-update" title="Delete" ng-click="grid.appScope.deleteBp($event,row.entity,null);"><i class="fa fa-trash-o fa-2 white" aria-hidden="true"></i></span>'}
{ name:'Action',minWidth:150,cellTemplate:'<span class="btn btn-xs cat-btn-update bpvicon" title="Clone" ng-click="grid.appScope.copyBp(row.entity._id)"><i class="fa fa-clone fa-2 white" aria-hidden="true"></i></span> ' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Info" ng-click="grid.appScope.blueprintInfo($event,row.entity,null);"><i class="fa fa-info fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Launch" ng-click="grid.appScope.launchInstance($event,row.entity);"><i class="fa fa-location-arrow fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Delete" ng-click="grid.appScope.deleteBp($event,row.entity,null);"><i class="fa fa-trash-o fa-2 white" aria-hidden="true"></i></span>'}
];
bpcolumnDefs = dockerOptions;
} else if(val.templateType === 'chef' || val.templateType === 'ami'){
Expand All @@ -50,10 +49,10 @@
{ name:'Keypair',minWidth:150,field:'blueprintConfig.cloudProviderData.keyPairId',visible: false},
{ name:'Subnet',minWidth:150,field:'blueprintConfig.cloudProviderData.subnetId',visible: false},
{ name:'Security Group',width:150,field:'blueprintConfig.cloudProviderData.securityGroupIds[0]'},
{ name:'Action',minWidth:150,cellTemplate:'<span class="badge cat-btn-update" title="Clone" ng-click="grid.appScope.copyBp(row.entity._id)"><i class="fa fa-clone fa-2 white" aria-hidden="true"></i></span> ' +
'&nbsp; <span class="badge cat-btn-update" title="Info" ng-click="grid.appScope.blueprintInfo($event,row.entity,null);"><i class="fa fa-info fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="badge cat-btn-update" title="Launch" ng-click="grid.appScope.launchInstance($event,row.entity);"><i class="fa fa-location-arrow fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="badge cat-btn-update" title="Delete" ng-click="grid.appScope.deleteBp($event,row.entity,null);"><i class="fa fa-trash-o fa-2 white" aria-hidden="true"></i></span>'}
{ name:'Action',minWidth:200,cellTemplate:'<span class="btn btn-xs cat-btn-update bpvicon" title="Clone" ng-click="grid.appScope.copyBp(row.entity._id)"><i class="fa fa-clone fa-2 white" aria-hidden="true"></i></span> ' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Info" ng-click="grid.appScope.blueprintInfo($event,row.entity,null);"><i class="fa fa-info fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Launch" ng-click="grid.appScope.launchInstance($event,row.entity);"><i class="fa fa-location-arrow fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Delete" ng-click="grid.appScope.deleteBp($event,row.entity,null);"><i class="fa fa-trash-o fa-2 white" aria-hidden="true"></i></span>'}
];
bpcolumnDefs = bpOptions;
} else if(val.templateType === 'cft') {
Expand All @@ -62,10 +61,10 @@
{ name:'Cloud Provider',minWidth:150,field:'blueprintConfig.cloudProviderType'},
{ name:'Region',minWidth:150,field:'blueprintConfig.region'},
{ name:'Template Type',minWidth:150,cellTemplate:'<div>{{grid.appScope.getTemplate(row.entity.templateType)}}</div>'},
{ name:'Action',minWidth:150,cellTemplate:'<span class="badge cat-btn-update" title="Clone" ng-click="grid.appScope.copyBp(row.entity._id)"><i class="fa fa-clone fa-2 white" aria-hidden="true"></i></span> ' +
'&nbsp; <span class="badge cat-btn-update" title="Info" ng-click="grid.appScope.blueprintInfo($event,row.entity,null);"><i class="fa fa-info fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="badge cat-btn-update" title="Launch" ng-click="grid.appScope.launchInstance($event,row.entity);"><i class="fa fa-location-arrow fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="badge cat-btn-update" title="Delete" ng-click="grid.appScope.deleteBp($event,row.entity,null);"><i class="fa fa-trash-o fa-2 white" aria-hidden="true"></i></span>'}
{ name:'Action',minWidth:150,cellTemplate:'<span class="btn btn-xs cat-btn-update bpvicon" title="Clone" ng-click="grid.appScope.copyBp(row.entity._id)"><i class="fa fa-clone fa-2 white" aria-hidden="true"></i></span> ' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Info" ng-click="grid.appScope.blueprintInfo($event,row.entity,null);"><i class="fa fa-info fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Launch" ng-click="grid.appScope.launchInstance($event,row.entity);"><i class="fa fa-location-arrow fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Delete" ng-click="grid.appScope.deleteBp($event,row.entity,null);"><i class="fa fa-trash-o fa-2 white" aria-hidden="true"></i></span>'}
];
bpcolumnDefs = cftOptions;
} else if(val.templateType === 'arm') {
Expand All @@ -74,31 +73,16 @@
{ name:'Infra Manager Type',minWidth:150,field:'blueprintConfig.infraMangerType'},
{ name:'Resource Group',minWidth:150,field:'blueprintConfig.resourceGroup'},
{ name:'Template Type',minWidth:150,cellTemplate:'<div>{{grid.appScope.getTemplate(row.entity.templateType)}}</div>'},
{ name:'Action',minWidth:150,cellTemplate:'<span class="badge cat-btn-update" title="Clone" ng-click="grid.appScope.copyBp(row.entity._id)"><i class="fa fa-clone fa-2 white" aria-hidden="true"></i></span> ' +
'&nbsp; <span class="badge cat-btn-update" title="Info" ng-click="grid.appScope.blueprintInfo($event,row.entity,null);"><i class="fa fa-info fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="badge cat-btn-update" title="Launch" ng-click="grid.appScope.launchInstance($event,row.entity);"><i class="fa fa-location-arrow fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="badge cat-btn-update" title="Delete" ng-click="grid.appScope.deleteBp($event,row.entity,null);"><i class="fa fa-trash-o fa-2 white" aria-hidden="true"></i></span>'}
{ name:'Action',minWidth:150,cellTemplate:'<span class="btn btn-xs cat-btn-update bpvicon" title="Clone" ng-click="grid.appScope.copyBp(row.entity._id)"><i class="fa fa-clone fa-2 white" aria-hidden="true"></i></span> ' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Info" ng-click="grid.appScope.blueprintInfo($event,row.entity,null);"><i class="fa fa-info fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Launch" ng-click="grid.appScope.launchInstance($event,row.entity);"><i class="fa fa-location-arrow fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="btn btn-xs cat-btn-update bpvicon" title="Delete" ng-click="grid.appScope.deleteBp($event,row.entity,null);"><i class="fa fa-trash-o fa-2 white" aria-hidden="true"></i></span>'}
];
bpcolumnDefs = cftOptions;
}

});
pbList.blueprintList.list.columnDefs = bpcolumnDefs;
/*pbList.blueprintList.list.columnDefs = [
{ name:'Name',minWidth:150,field:'name' },
{ name:'InstanceOs',minWidth:150,field:'blueprintConfig.cloudProviderData.instanceOS'},
{ name:'vpcId',minWidth:150,field:'blueprintConfig.cloudProviderData.vpcId'},
{ name:'Region',minWidth:150,field:'blueprintConfig.cloudProviderData.region',visible: false},
{ name:'Template Type',minWidth:150,cellTemplate:'<div>{{grid.appScope.getTemplate(row.entity.templateType)}}</div>'},
{ name:'Instance Type',minWidth:150,field:'blueprintConfig.cloudProviderData.instanceType'},
{ name:'Keypair',minWidth:150,field:'blueprintConfig.cloudProviderData.keyPairId',visible: false},
{ name:'Subnet',minWidth:150,field:'blueprintConfig.cloudProviderData.subnetId',visible: false},
{ name:'Security Group',width:150,field:'blueprintConfig.cloudProviderData.securityGroupIds[0]'},
{ name:'Action',minWidth:150,cellTemplate:'<span class="badge cat-btn-update" title="Clone" ng-click="grid.appScope.copyBp(row.entity._id)"><i class="fa fa-clone fa-2 white" aria-hidden="true"></i></span> ' +
'&nbsp; <span class="badge cat-btn-update" title="Info" ng-click="grid.appScope.blueprintInfo($event,row.entity,null);"><i class="fa fa-info fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="badge cat-btn-update" title="Launch" ng-click="grid.appScope.launchInstance($event,row.entity);"><i class="fa fa-location-arrow fa-2 white" aria-hidden="true"></i></span>' +
'&nbsp; <span class="badge cat-btn-update" title="Delete" ng-click="grid.appScope.deleteBp($event,row.entity,null);"><i class="fa fa-trash-o fa-2 white" aria-hidden="true"></i></span>'}
];*/
});
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
(function (angular) {
"use strict";
angular.module('dashboard.design')
.controller('createCompositeCtrl',['$scope','$rootScope','$state','toastr','blueprintService','genericServices', function ($scope,$rootScope,$state,toastr,bpServ,gencSers) {
.controller('createCompositeCtrl',['$scope','$rootScope','$state','toastr','blueprintService','genericServices','responseFormatter', function ($scope,$rootScope,$state,toastr,bpServ,gencSers,responseFormatter) {
var createCBP = this;
createCBP.ExBlueprintList=[];
createCBP.SelectedBPList=[];
createCBP.selectBlueprintId='';
createCBP.selectedBPDetails='';
createCBP.compositeBPType='chef';
$scope.chefrunlist,$scope.cookbookAttributes = [];
createCBP.onSubmit =false;
createCBP.newEnt={
bpName:''
Expand Down Expand Up @@ -36,41 +37,63 @@
createCBP.SelectedBPList.splice(indexArr,1);

};
createCBP.selectBpInfo =function ($event,bpDetails){
createCBP.selectBpInfo =function ($event,bpDetails,bpType){
$event.stopPropagation();
gencSers.moreInfo(bpDetails,null);
gencSers.moreInfo(bpDetails,bpType);
};
createCBP.editSelectBpInfo =function ($event,bpDetails){
createCBP.selectBlueprintId=bpDetails._id;
createCBP.selectedBPDetails=bpDetails;
$scope.cookbookAttributes = [];
if(createCBP.selectedBPDetails.blueprintConfig.infraManagerData.versionsList[0].runlist) {
$scope.chefComponentSelectorList = responseFormatter.findDataForEditValue(createCBP.selectedBPDetails.blueprintConfig.infraManagerData.versionsList[0].runlist);
if(createCBP.selectedBPDetails.blueprintConfig.infraManagerData.versionsList[0].attributes){
$scope.cookbookAttributes = responseFormatter.formatSavedCookbookAttributes(createCBP.selectedBPDetails.blueprintConfig.infraManagerData.versionsList[0].attributes);
}
$scope.chefrunlist = responseFormatter.chefRunlistFormatter($scope.chefComponentSelectorList);
}
};
$scope.updateCookbook = function() {
gencSers.editRunlist($scope.chefrunlist,$scope.cookbookAttributes);
};
$rootScope.$on('WZ_ORCHESTRATION_REFRESH_CURRENT', function(event,reqParams) {
$scope.chefrunlist = reqParams.list;
$scope.cookbookAttributes = reqParams.cbAttributes;
});
createCBP.ord =function (){
console.log(createCBP.selectedBpOrder);
};
$rootScope.compositeSave =function (vali) {
$scope.compositeSave =function () {
createCBP.onSubmit =true;
if(!createCBP.newEnt.bpName || !createCBP.SelectedBPList.length > 0){
return true;
}
if($rootScope.organObject){
createCBP.newEnt.org =$rootScope.organNewEnt.org.rowid;
createCBP.newEnt.buss=$rootScope.organNewEnt.buss.rowid;
createCBP.newEnt.proj=$rootScope.organNewEnt.proj.rowid;
}
createCBP.newEnt.proj=$rootScope.organNewEnt.proj.rowId;
};
$scope.blueprintList = [];
angular.forEach(createCBP.SelectedBPList, function(val){
var blueprintObj={
id: val._id,
attributes: val.blueprintConfig.infraManagerData.versionsList[0].attributes
};
$scope.blueprintList.push(blueprintObj);
});
var params = {
url: '/composite-blueprints/',
data:{
"name": createCBP.newEnt.bpName,
"organizationId":createCBP.newEnt.org,
"businessGroupId": createCBP.newEnt.buss,
"projectId":createCBP.newEnt.proj,
"blueprints": createCBP.SelectedBPList,
"cloudProviderType": 'aws'
"blueprints": $scope.blueprintList
}
};
gencSers.promisePost(params).then(function () {
toastr.success('Successfully Created.');
$state.go('dashboard.designSubView',{subItem:$state.params.subItem,view:'list'});
$state.go('dashboard.design.list',{providerName:$state.params.providerName,templateObj:$state.params.templateObj});
});
};
createCBP.createList();
Expand Down
Loading