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
6 changes: 4 additions & 2 deletions server/app/routes/v1.0/routes_d4dMasters.js
Original file line number Diff line number Diff line change
Expand Up @@ -2736,8 +2736,7 @@ module.exports.setRoutes = function (app, sessionVerification) {
logger.error('Hit getting setting wizard error', err);
res.send(500);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.name === 'User Configuration') {
}else if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.name === 'User Configuration') {
var settingWizardSteps = appConfig.settingWizardSteps;
settingWizards.currentStep.nestedSteps[1].isCompleted = true;
settingWizards.currentStep.isCompleted = true;
Expand All @@ -2753,6 +2752,9 @@ module.exports.setRoutes = function (app, sessionVerification) {
res.send(200);
return;
});
}else {
res.send(200);
return;
}
})
}
Expand Down
37 changes: 20 additions & 17 deletions server/app/services/settingsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,25 @@ settingsService.updateProjectData = function updateProjectData(enviornment,callb
};

settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callback){
if(id === '1'){
if(orgId === null || orgId === ''){
callback(null,orgId);
return;
}else if(id === '1'){
settingWizard.removeSettingWizardByOrgId(orgId,function(err,data){
if(err){
callback(err,null);
return;
}
callback(null,data);
})
}else if(id === '2'){
}else if(id === '2'){
settingWizard.getSettingWizardByOrgId(orgId,function(err,settingWizards) {
if (err) {
callback(err, null);
return;
}
logger.debug(JSON.stringify(settingWizards));
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Org Configuration'
&& settingWizards.currentStep.nestedSteps[1].isCompleted === true) {
settingWizards.currentStep.nestedSteps[1].isCompleted = false;
Expand All @@ -113,13 +116,13 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
return;
}
})
}else if(id === '4'){
}else if(id === '4'){
settingWizard.getSettingWizardByOrgId(orgId,function(err,settingWizards) {
if (err) {
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Config Management' && settingWizards.currentStep.nestedSteps[0].isCompleted === false) {
var settingWizardSteps = appConfig.settingWizardSteps;
settingWizards.currentStep = settingWizards.previousStep;
Expand All @@ -145,7 +148,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Config Management'
&& settingWizards.currentStep.nestedSteps[1].isCompleted === false) {
settingWizards.currentStep.nestedSteps[0].isCompleted = false;
Expand All @@ -167,7 +170,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'User Configuration'
&& settingWizards.currentStep.nestedSteps[0].isCompleted === false) {
var settingWizardSteps = appConfig.settingWizardSteps;
Expand Down Expand Up @@ -199,7 +202,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'User Configuration'
&& settingWizards.currentStep.nestedSteps[1].isCompleted === false) {
settingWizards.currentStep.nestedSteps[0].isCompleted = false;
Expand All @@ -222,7 +225,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Provider Configuration'
&& settingWizards.currentStep.nestedSteps[0].isCompleted === false) {
var settingWizardSteps = appConfig.settingWizardSteps;
Expand Down Expand Up @@ -253,7 +256,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Devops Roles'
&& settingWizards.currentStep.nestedSteps[1].isCompleted === false) {
settingWizards.currentStep.nestedSteps[0].isCompleted = false;
Expand All @@ -275,7 +278,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Devops Roles'
&& settingWizards.currentStep.nestedSteps[2].isCompleted === false) {
settingWizards.currentStep.nestedSteps[1].isCompleted = false;
Expand All @@ -297,7 +300,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Wizard Status'
&& settingWizards.currentStep.isCompleted === true) {
var settingWizardSteps = appConfig.settingWizardSteps;
Expand Down Expand Up @@ -329,7 +332,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Gallery Setup'
&& settingWizards.nestedSteps[1].isCompleted === false) {
settingWizards.nestedSteps[0].isCompleted = false;
Expand All @@ -351,7 +354,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Gallery Setup'
&& settingWizards.nestedSteps[2].isCompleted === false) {
settingWizards.nestedSteps[1].isCompleted = false;
Expand All @@ -373,7 +376,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Provider Configuration'
&& settingWizards.currentStep.nestedSteps[1].isCompleted === false) {
settingWizards.currentStep.nestedSteps[0].isCompleted = false;
Expand All @@ -395,7 +398,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Gallery Setup'
&& settingWizards.currentStep.nestedSteps[0].isCompleted === false) {
var settingWizardSteps = appConfig.settingWizardSteps;
Expand Down Expand Up @@ -426,7 +429,7 @@ settingsService.trackSettingWizard = function trackSettingWizard(id,orgId,callba
callback(err, null);
return;
}
if (settingWizards.currentStep && settingWizards.currentStep.nestedSteps
if (settingWizards !== null && settingWizards.currentStep && settingWizards.currentStep.nestedSteps
&& settingWizards.currentStep.name === 'Devops Roles' && settingWizards.currentStep.nestedSteps[0].isCompleted === false) {
var settingWizardSteps = appConfig.settingWizardSteps;
var previousStep = settingWizardSteps[4];
Expand Down