Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3.1.0 hot fixes #483

Merged
merged 3 commits into from
Jun 29, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,105 +4,105 @@
* Written by Relevance UI Team,
* Aug 2015
*/

(function(angular){
"use strict";
"use strict";
angular.module('workzone.application')
.controller('configurePipelineViewCtrl', ['$scope', '$modalInstance', 'workzoneServices', 'chefSelectorComponent', 'responseFormatter', 'items', '$q',
function($scope, $modalInstance, workzoneServices, chefSelectorComponent, responseFormatter, items, $q) {
$scope.isConfigurePipelineLoading = true;
var helper = {
getLeftRightEnvs: function(response){
var envIds = response.envId;
var envSequence = response.envSequence;
var leftEnvList = [];
var rightEnvList = [];
for(var i=0;i<envSequence.length;i++) {
if(envIds.indexOf(envSequence[i])!==-1) {
rightEnvList.push(envSequence[i]);
} else {
leftEnvList.push(envSequence[i]);
.controller('configurePipelineViewCtrl', ['$scope', '$modalInstance', 'workzoneServices', 'chefSelectorComponent', 'responseFormatter', 'items', '$q',
function($scope, $modalInstance, workzoneServices, chefSelectorComponent, responseFormatter, items, $q) {
$scope.isConfigurePipelineLoading = true;
var helper = {
getLeftRightEnvs: function(response){
var envIds = response.envId;
var envSequence = response.envSequence;
var leftEnvList = [];
var rightEnvList = [];
for(var i=0;i<envIds.length;i++) {
if(envSequence.indexOf(envIds[i])!==-1) {
rightEnvList.push(envIds[i]);
} else {
leftEnvList.push(envIds[i]);
}
}
return {
left: leftEnvList,
right: rightEnvList
};
}
return {
left: leftEnvList,
right: rightEnvList
};
}
};
var projectID = items;
var compositeSelector;
var d = workzoneServices.getUpdatedEnvConfig(items);
$q.all([d]).then(function(allPromise) {
$scope.isConfigurePipelineLoading = false;
var allEnvListLeftRight = [], allEnvListLeft = [], activeEnvList = [], list = [], selectedElements = [];
allEnvListLeftRight = helper.getLeftRightEnvs(allPromise[0].data[0]);
allEnvListLeft = allEnvListLeftRight.left;
for(var i=0; i<allEnvListLeft.length; i++) {
var item = {
"className": "environment",
"value": allEnvListLeft[i],
"data": {
"key": allEnvListLeft[i],
"value": allEnvListLeft[i]
}
};
list.push(item);
}
activeEnvList = allEnvListLeftRight.right;
for(var j=0; j<activeEnvList.length; j++) {
var items = {
"className": "environment",
"value": activeEnvList[j],
"data": {
"key": activeEnvList[j],
"value": activeEnvList[j]
}
};
selectedElements.push(items);
}
var factory = chefSelectorComponent.getComponent;
compositeSelector = new factory({
scopeElement: '#configure_environments',
optionList: list,
selectorList: selectedElements,
isSortList: true,
isSearchBoxEnable: false,
isOverrideHtmlTemplate: true,
isPriorityEnable: true,
isExcludeDataFromOption: false,
});
});
angular.extend($scope, {
ok:function(){
var newEnv=[];
var envListLeft=[];
var envSequence=[];
//To get the right side list
angular.forEach(compositeSelector.getSelectorList(),function(val){
newEnv.push(val.value);
});
//To get the left side list
angular.forEach(compositeSelector.getOptionList(),function(val){
envListLeft.push(val.value);
};
var projectID = items;
var compositeSelector;
var d = workzoneServices.getUpdatedEnvConfig(items);
$q.all([d]).then(function(allPromise) {
$scope.isConfigurePipelineLoading = false;
var allEnvListLeftRight = [], allEnvListLeft = [], activeEnvList = [], list = [], selectedElements = [];
allEnvListLeftRight = helper.getLeftRightEnvs(allPromise[0].data[0]);
allEnvListLeft = allEnvListLeftRight.left;
for(var i=0; i<allEnvListLeft.length; i++) {
var item = {
"className": "environment",
"value": allEnvListLeft[i],
"data": {
"key": allEnvListLeft[i],
"value": allEnvListLeft[i]
}
};
list.push(item);
}
activeEnvList = allEnvListLeftRight.right;
for(var j=0; j<activeEnvList.length; j++) {
var items = {
"className": "environment",
"value": activeEnvList[j],
"data": {
"key": activeEnvList[j],
"value": activeEnvList[j]
}
};
selectedElements.push(items);
}
var factory = chefSelectorComponent.getComponent;
compositeSelector = new factory({
scopeElement: '#configure_environments',
optionList: list,
selectorList: selectedElements,
isSortList: true,
isSearchBoxEnable: false,
isOverrideHtmlTemplate: true,
isPriorityEnable: true,
isExcludeDataFromOption: false,
});
envSequence = envListLeft.concat(newEnv);
var envList = {
});
angular.extend($scope, {
ok:function(){
var newEnv=[];
var envListLeft=[];
var envSequence=[];
//To get the right side list
angular.forEach(compositeSelector.getSelectorList(),function(val){
newEnv.push(val.value);
});
//To get the left side list
angular.forEach(compositeSelector.getOptionList(),function(val){
envListLeft.push(val.value);
});
envSequence = envListLeft.concat(newEnv);
var envList = {
"projectId": projectID,
"envId": newEnv,
"envSequence": envSequence
"envId": envSequence,
"envSequence": newEnv
};

workzoneServices.postEnvConfig(envList).then(function (envListResult) {
$modalInstance.close(envListResult.data[0]);
},function(error){
console.log(error);
});
},
cancel: function() {
$modalInstance.dismiss('cancel');
}
});
}
]);
workzoneServices.postEnvConfig(envList).then(function (envListResult) {
$modalInstance.close(envListResult.data[0]);
},function(error){
console.log(error);
});
},
cancel: function() {
$modalInstance.dismiss('cancel');
}
});
}
]);
})(angular);
4 changes: 2 additions & 2 deletions server/app/cronjobs/cron-jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var awsRDSS3ProviderSync = require('_pr/cronjobs/provider-rds-s3-sync');

module.exports.start = function start() {

logger.info('Cost aggregation started with interval ==> '+ costAggregation.getInterval());
/*logger.info('Cost aggregation started with interval ==> '+ costAggregation.getInterval());
var costAggregationJobId
= crontab.scheduleJob(costAggregation.getInterval(), costAggregation.execute);

Expand All @@ -48,5 +48,5 @@ module.exports.start = function start() {

logger.info('AWS S3 and RDS Provider Sync started with interval ==> '+ awsRDSS3ProviderSync.getInterval());
var awsRDSS3ProviderSyncJobId
= crontab.scheduleJob(awsRDSS3ProviderSync.getInterval(), awsRDSS3ProviderSync.execute);
= crontab.scheduleJob(awsRDSS3ProviderSync.getInterval(), awsRDSS3ProviderSync.execute);*/
}
51 changes: 36 additions & 15 deletions server/app/lib/utils/masterUtil.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
Copyright [2016] [Relevance Lab]
Copyright [2016] [Relevance Lab]

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
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

https://www.apache.org/licenses/LICENSE-2.0
https://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.
*/
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.
*/



Expand Down Expand Up @@ -165,7 +165,7 @@ var MasterUtil = function() {
d4dModelNew.d4dModelMastersProductGroup.find({
orgname_rowid: orgId,
id:'2'
}, function(err, productGroupData) {
}, function(err, productGroupData) {
if(err) {
logger.debug("getBusinessGroupsByOrgId: "+err);
callback(err, null);
Expand Down Expand Up @@ -1585,7 +1585,7 @@ var MasterUtil = function() {
})
}





Expand Down Expand Up @@ -1932,6 +1932,27 @@ var MasterUtil = function() {
});
}

this.updateParticularProject = function(projectData, callback) {
d4dModelNew.d4dModelMastersProjects.update({
id: "4",
rowid: projectData.projectId
},{
$set: {
environmentname:projectData.envNames,
environmentname_rowid:projectData.envIds
}
}, {
upsert: false
}, function(err, projects) {
if (err) {
callback(err, null);
} else {
callback(null, projects);
}
});
}



// Return Docker
this.getDockerById = function(anId, callback) {
Expand Down Expand Up @@ -1985,7 +2006,7 @@ var MasterUtil = function() {

// Get all appDeploy informations for project.
// Note: This method logic has to change with stored procedure for better performance.
// For now due to time constraints implementing with for loop.(Gobinda)
// For now due to time constraints implementing with for loop.(Gobinda)
this.getAppDeployListForProject = function getAppDeployListForProject(projectId, callback) {
logger.debug("projectId: ", projectId);
d4dModelNew.d4dModelMastersProjects.find({
Expand Down Expand Up @@ -2080,7 +2101,7 @@ var MasterUtil = function() {
}
});
} else {
return callback(null, null);
return callback(null, null);
}
});
};
Expand Down
Loading