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
30 changes: 19 additions & 11 deletions client/htmls/private/ajax/Settings/Dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ <h5 class="widget-title" style="color:#4e5964;">
$('.btn-1 a').click(function(e) {
e.preventDefault();
if($(this).attr('href')){
clearActiveClasses();
$(this).addClass('wizardActiveBtn').attr('href');
$(this).removeClass('process-btn');
$('.contentSetting').load(this.getAttribute('href'));
Expand All @@ -118,28 +119,30 @@ <h5 class="widget-title" style="color:#4e5964;">

//on click of new button to create a new wizard..
$('#createNew').click(function(e) {
clearActiveClasses();
$('#orgDropdown option:selected').val('');
$('.providerSelect').addClass('hidden');
$('#cancelWizard').removeClass('hidden');
$('#createNew').addClass('hidden');
clearActiveClasses();
$('#startConfig a').addClass('green-btn').removeClass('process-btn');
$('#orgConfiguration a').addClass('wizardActiveBtn').removeClass('process-btn');
$('#orgConfiguration a').trigger('click');
});
$('#orgConfiguration a').trigger('click');
var firstOrgValue;
$.get('/d4dMasters/readmasterjsonnew/1', function(data) {
$("#orgDropdown").empty();
for (var i = 0; i < data.length; i++) {
firstOrgValue = data[0].rowid
var $option = $('<option></option>').val(data[i].rowid).attr('rowid', data[i].orgname).html(data[i].orgname);
$('#orgDropdown').append($option);
}
$('#orgDropdown').change(function(e) {
e.preventDefault();
$('#wizardActionListLoader').show();
clearActiveClasses();
orgIdForSetup = $("#orgDropdown").val();
changeWizardStatus(orgIdForSetup);
e.preventDefault();
$('#wizardActionListLoader').hide();
});
$("#orgDropdown").trigger("change");
Expand All @@ -148,7 +151,7 @@ <h5 class="widget-title" style="color:#4e5964;">
$('#cancelWizard').addClass('hidden');
$('.providerSelect').removeClass('hidden');
$('#createNew').removeClass('hidden');
$('#orgConfiguration a').trigger('click');
changeWizardStatus(firstOrgValue);
});
});
var selectedDropdownValue, lastDropdownValue;
Expand All @@ -170,7 +173,6 @@ <h5 class="widget-title" style="color:#4e5964;">
});

$('#providerConfiguration a').click(function(e) {

selectedDropdownValue = $('#orgDropdown option:selected').val();
orgForBg = $('#orgDropdown option:selected').text();
});
Expand All @@ -183,33 +185,39 @@ <h5 class="widget-title" style="color:#4e5964;">
$('#wizardActionListLoader').hide();
} else {
var isCompleted = data.previousStep.isCompleted;
if (isCompleted = 'true') {
if (isCompleted === true) {
if (data.previousStep.name === 'Introduction') {
$('#orgConfiguration a').attr('href','ajax/Settings/settingsWizard.html');
$('#orgConfiguration a').trigger('click');
$('#startConfig a').addClass('green-btn').removeClass('process-btn');
$('#orgConfiguration a').addClass('wizardActiveBtn').removeClass('process-btn');
$('#orgConfiguration a').trigger('click');
$('#configManagement a,#providerConfiguration a,#galleryConfiguration a,#devopsConfiguration a,#cmdbConfiguration a').removeAttr('href');
} else if (data.previousStep.name === 'Org Configuration') {
$('#configManagement a').attr('href','ajax/Settings/configManagementWizard.html');
$('#configManagement a').trigger('click');
$('.providerSelect').removeClass('hidden');
$('#startConfig a, #orgConfiguration a').addClass('green-btn').removeClass('process-btn');
$('#configManagement a').trigger('click');
$('#providerConfiguration a,#galleryConfiguration a,#devopsConfiguration a,#cmdbConfiguration a').removeAttr('href');
toastr.error('Please Configure Teams to Navigate to Workzone');
} else if (data.previousStep.name === 'Config Management') {
$('#providerConfiguration a').attr('href','ajax/Settings/providerWizard.html');
$('#providerConfiguration a').trigger('click');
$('#galleryConfiguration a,#devopsConfiguration a,#cmdbConfiguration a').removeAttr('href');
$('#startConfig a,#orgConfiguration a,#configManagement a').removeClass('wizardActiveBtn process-btn').addClass('green-btn');
$('#providerConfiguration a').trigger('click');
} else if (data.previousStep.name === 'Provider Configuration') {
$('#galleryConfiguration a').attr('href','ajax/Settings/galleryWizard.html');
$('#galleryConfiguration a').trigger('click');
$('#devopsConfiguration a,#cmdbConfiguration a').removeAttr('href');
$('#startConfig a, #orgConfiguration a,#configManagement a,#providerConfiguration a').removeClass('wizardActiveBtn process-btn').addClass('green-btn');
$('#galleryConfiguration a').trigger('click');
} else if (data.previousStep.name === 'Gallery Setup') {
$('#startConfig a, #orgConfiguration a,#configManagement a,#providerConfiguration a,#galleryConfiguration a').removeClass('wizardActiveBtn process-btn').addClass('green-btn');
$('#devopsConfiguration a').attr('href','ajax/Settings/devopsRolesWizard.html');
$('#devopsConfiguration a').trigger('click');
$('#startConfig a, #orgConfiguration a,#configManagement a,#providerConfiguration a,#galleryConfiguration a').removeClass('wizardActiveBtn process-btn').addClass('green-btn');
$('#cmdbConfiguration a').removeAttr('href');
} else if (data.previousStep.name === 'Devops Roles') {
$('#startConfig a, #orgConfiguration a,#configManagement a, #providerConfiguration a,#galleryConfiguration a,#devopsConfiguration a').removeClass('wizardActiveBtn process-btn').addClass('green-btn');
$('#cmdbConfiguration a').attr('href','ajax/Settings/cmdbWizard.html');
$('#cmdbConfiguration a').trigger('click');
$('#startConfig a, #orgConfiguration a,#configManagement a, #providerConfiguration a,#galleryConfiguration a,#devopsConfiguration a').removeClass('wizardActiveBtn process-btn').addClass('green-btn');
}
}
}
Expand Down
26 changes: 18 additions & 8 deletions client/htmls/private/ajax/Settings/bgWizard.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
<form action="" id="myForm2">
<div class="widget-box">
<div class="widget-header">
<h4 class="widget-margin" style="color:black;">Create Business Group</h4>
<h4 class="widget-margin" style="color:black;">Create Business Group
<span class="widget-toolbar no-border">
<div class="wizardAdd">
<a href="ajax/Settings/bgWizard.html" id="createNewBG" style="margin-right:11px;" class="btn btn-primary"><i class="ace-icon ace-icon fa fa-plus bigger-110"></i>&nbsp;Add New BG</a>
</div>
</span>
</h4>
</div>
<div class="widget-body">
<div class="widget-main" style="min-height:200px">
<div class="jarviswidget" data-widget-editbutton="false" data-widget-custombutton="false">
<div>
<div class="col-lg-6 col-md-6">
<label for="name">Business Group Name <span class="control-label redSpan">&nbsp;*</span></label>
<input autofocus name="productgroupname" value="" id="productgroupname" class="form-control" type="text" cdata="catalyst" cat-validation="required,nospecial,max15,nospace">
</div>
<label for="name">Business Group Name <span class="control-label redSpan">&nbsp;*</span></label><input autofocus name="productgroupname" value="" id="productgroupname" class="form-control" type="text" cdata="catalyst" cat-validation="required,nospecial,max15,nospace" unique="true" uniqueconditionedby="productgroupname,orgname">
</div>
<div class="col-lg-6 col-md-6">
<label for="">Organization<span class="control-label redSpan">&nbsp;*</span></label>
<select id="orgname" class="chooseOrganization form-control width-100" cdata="catalyst" cat-validation="required">
Expand All @@ -22,8 +27,7 @@ <h4 class="widget-margin" style="color:black;">Create Business Group</h4>
</div>
<div class="widget-toolbox clearfix">
<div class="btn-group pull-right">
<a href="ajax/Settings/bgWizard.html" id="createNewBG" style="margin-right:11px;" class="btn btn-primary">&nbsp;Add Another</a>
<button name="next1" id="saveBg" style="margin-right:11px;" class="saveFormWizard btn btn-primary"><i class="ace-icon fa fa-check bigger-110"></i>&nbsp;Save</i></button>
<button name="next1" id="saveBg" style="margin-right:11px;" class="saveFormWizard saveBgForm btn btn-primary"><i class="ace-icon fa fa-check bigger-110"></i>&nbsp;Save</i></button>
<input type="button" disabled="disabled" name="next1" id="next1" class="bgWizard nextFormWizard btn btn-primary" value="Next"/>
</div>
</div>
Expand Down Expand Up @@ -55,6 +59,8 @@ <h4 class="widget-margin" style="color:black;">Create Business Group</h4>
});
}

enableUniqueCheckingForInputs(2);

$('#myForm2').submit(function() {
if ($(this).valid) {
if (!saveform('2'))
Expand All @@ -65,13 +71,17 @@ <h4 class="widget-margin" style="color:black;">Create Business Group</h4>
}
return false; // for demo
});

var bgCreateClick = false;
$('#createNewBG').click(function(e){
e.preventDefault();
$('.content').load(this.getAttribute('href'));
if(!bgCreateClick){
bgCreateClick =true;
$('.content').load(this.getAttribute('href'));
}
});

$(".nextFormWizard").click(function() {
getProjValues();
$('.contentSetting').find('ol li#bgCreate').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#projectCreate').addClass('active');
$('.content').load("ajax/Settings/projWizard.html");
Expand Down
65 changes: 39 additions & 26 deletions client/htmls/private/ajax/Settings/configManagementWizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
</div>
<div class="widget-body">
<div class="widget-main" style="height:500px">
<div class="widget-main" style="height:450px">
<div class="jarviswidget" data-widget-editbutton="false" data-widget-custombutton="false">
<div>
<!-- widget content -->
Expand Down Expand Up @@ -83,7 +83,7 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
</div>
<div class="widget-toolbox clearfix">
<div class="btn-group pull-right">
<button name="next1" id="saveBg" style="margin-right:11px;" class="saveFormWizard btn btn-primary"><i class="ace-icon fa fa-check bigger-110"></i>&nbsp;Save</i></button>
<button name="next1" id="saveConfigWizard" style="margin-right:11px;" class="saveFormWizard btn btn-primary"><i class="ace-icon fa fa-check bigger-110"></i>&nbsp;Save</i></button>
<input type="button" disabled="disabled" name="next1" id="next1" class="nextFormWizard btn btn-primary" value="Next"/>
</div>
</div>
Expand All @@ -103,7 +103,7 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
$(this).next().next().val($(this).val());
});
}
$(document).ready(function(e) {

//api call for getting the status of wizard
var wizardStepsConfig = $('<ol id="configWizard" class="bwizard-steps clearfix clickable"><li aria-selected="true" id="chefCreate" class="active btn-2 chefCreate" style="z-index: 4;"><span class="label badge-inverse">1</span><a href="ajax/Settings/configManagementWizard.html" class="hidden-phone">Create Chef Server</a></li><li aria-selected="false" style="z-index: 3;" id="envCreate" class="btn-3 envCreate"><span class="label">2</span><a href="ajax/Settings/envWizard.html" class="not-activeAnchor hidden-phone">Create Environment</a></li><li aria-selected="false" style="z-index: 3;" id="teamCreate" class="btn-4 teamCreate"><span class="label">3</span><a href="ajax/Settings/teamWizard.html" class="not-activeAnchor hidden-phone">Create Team</a></li></ol>');
$('.wizardFlow').append(wizardStepsConfig);
Expand All @@ -120,9 +120,12 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
bindChange_importPemFile();
var $pemFileLocation = $('#frmconfigmanagement');
$pemFileLocation.find('input.pemFile').val(data[i].userpemfile_filename);
$('input#userpemfile').attr('disabled','disabled');
$('input#kniferbfile').attr('disabled','disabled');
var $knifeFileLocation = $('#knifeFile');
$knifeFileLocation.find('input.knifeFile').val(data[i].kniferbfile_filename);
$knifeFileLocation.find('input.knifeFile').attr('disabled','disabled').val(data[i].kniferbfile_filename);
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('#saveConfigWizard').addClass('hidden');
}
}
});
Expand All @@ -139,6 +142,8 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
$('#myForm1').find('select#environmentname').remove();
$('#myForm1').find('input#environmentName').removeClass('hidden').val(data[i].environmentname).attr('disabled','disabled');
$('.btn-3 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('#myForm1').find('button#saveConfigEnv').addClass('hidden');
$('.nextFormWizard').removeAttr('disabled');
}
}
});
Expand All @@ -152,7 +157,9 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
$('#myForm3').find('select#orgname').append($optionOrgNameEnv).attr('disabled', 'disabled');
$('#myForm3').find('input#teamname').val(data[i].teamname).attr('disabled', 'disabled');
$('#myForm3').find('input#description').val(data[i].description).attr('disabled', 'disabled');
$('.btn-3 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.btn-4 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('#myForm3').find('button#saveConfigTeam').addClass('hidden');
$('.nextFormWizard').removeAttr('disabled');
}
}
});
Expand All @@ -163,35 +170,31 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
clicked = false;
$('.contentSetting').load(this.getAttribute('href'));
});
var clickEnv = false;
$('.envCreate a').click(function(e) {
e.preventDefault();
if(!clickEnv){
clickEnv = true;
getEnvValues();
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active');
$(this).parent('.bwizard-steps li').addClass('active');
$('.content').load(this.getAttribute('href'));
}
e.preventDefault();
$('.content').empty();
getEnvValues();
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active');
$(this).parent('.bwizard-steps li').addClass('active');
$('.content').load(this.getAttribute('href'));
});
var clickTeam = false;

$('.btn-4 a').click(function(e) {
e.preventDefault();
if(!clickTeam){
clickTeam = true
getTeamValues();
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active');
$(this).parent('.bwizard-steps li').addClass('active');
$('.content').load(this.getAttribute('href'));
}
$('.content').empty();
getTeamValues();
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active');
$(this).parent('.bwizard-steps li').addClass('active');
$('.content').load(this.getAttribute('href'));
});
orgIdForSetup = selectedDropdownValue;
if (clicked) {
$.get('/setting-wizard/org/' + orgIdForSetup, function(data) {
if(orgIdForSetup){
$.get('/setting-wizard/org/' + orgIdForSetup, function(data) {
if (data.currentStep.name === 'Config Management') {
if (data.currentStep.nestedSteps) {
var nestedSteps = data.currentStep.nestedSteps;
if (nestedSteps[0].name === 'ChefServer' && nestedSteps[0].isCompleted === true && nestedSteps[1].name === 'Environment' && nestedSteps[1].isCompleted === false && nestedSteps[2].name === 'Teams' && nestedSteps[2].isCompleted === false) {

$('.btn-2 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#envCreate').addClass('active');
$('.content').load('ajax/Settings/envWizard.html');
Expand All @@ -205,21 +208,26 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
}
} else {
getConfigValues();
$('#saveConfigWizard').addClass('hidden');
$('.nextFormWizard').removeAttr('disabled');
$('.btn-3 a').removeClass('not-activeAnchor');
$('.btn-4 a').removeClass('not-activeAnchor');
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.btn-3 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.btn-4 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
}
});
}
} else {
//comes when the chefServer is created and navigates back to it.
$('.btn-3 a').removeClass('not-activeAnchor');
$('.btn-4 a').removeClass('not-activeAnchor');
$('.btn-5 a').removeClass('not-activeAnchor');
getConfigValues();
getEnvValues();
}

$('#wizardActionListLoader').hide();
});


function setfolderpath() {
var folderpath = '/' + $('#loginname').val() + "/.chef/";
Expand All @@ -235,8 +243,13 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
});

$(".nextFormWizard").click(function() {

$('.content').empty();
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#envCreate').addClass('active');
$('.content').load('ajax/Settings/envWizard.html');
getEnvValues();
});


</script>
6 changes: 4 additions & 2 deletions client/htmls/private/ajax/Settings/devopsRolesWizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,17 @@ <h4 class="modal-title">
$('.contentSetting').load(this.getAttribute('href'));
});
$('.btn-3 a').click(function(e) {
e.preventDefault();
$('.content').empty();
$('.btn-2 a,.btn-4 a').parent('.bwizard-steps li').removeClass('active');
$(this).parent('.bwizard-steps li').addClass('active');
e.preventDefault();
$('.content').load(this.getAttribute('href'));
});
$('.btn-4 a').click(function(e) {
e.preventDefault();
$('.content').empty();
$('.btn-2 a,.btn-3 a').parent('.bwizard-steps li').removeClass('active');
$(this).parent('.bwizard-steps li').addClass('active');
e.preventDefault();
$('.content').load(this.getAttribute('href'));
});

Expand Down
Loading