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
21 changes: 20 additions & 1 deletion client/htmls/private/ajax/Settings/Dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,20 @@ <h5 class="widget-title" style="color:#4e5964;">

//on click of new button to create a new wizard..
$('#createNew').click(function(e) {
$('#wizardActionListLoader').show();
clearActiveClasses();
$('#orgDropdown option:selected').val('');
$('.providerSelect').addClass('hidden');
$('#cancelWizard').removeClass('hidden');
$('#createNew').addClass('hidden');
$('#startConfig a').addClass('green-btn').removeClass('process-btn');
$('#orgConfiguration a').addClass('wizardActiveBtn').removeClass('process-btn');
$('#orgConfiguration a').attr('href','ajax/Settings/settingsWizard.html');
$('#orgConfiguration a').trigger('click');
$('#wizardActionListLoader').hide();
});
$('#orgConfiguration a').trigger('click');
var firstOrgValue;
var firstOrgValue,currentOrgValue;
$.get('/d4dMasters/readmasterjsonnew/1', function(data) {
$("#orgDropdown").empty();
for (var i = 0; i < data.length; i++) {
Expand Down Expand Up @@ -163,6 +166,7 @@ <h5 class="widget-title" style="color:#4e5964;">
if (selectedDropdownValue) {
getOrgValues();
} else {
$('.wizardFlow').empty();
lastDropdownValue = $('#orgDropdown option:last').val();
}
});
Expand All @@ -177,6 +181,21 @@ <h5 class="widget-title" style="color:#4e5964;">
orgForBg = $('#orgDropdown option:selected').text();
});

$('#galleryConfiguration a').click(function(e) {
selectedDropdownValue = $('#orgDropdown option:selected').val();
orgForBg = $('#orgDropdown option:selected').text();
});

$('#devopsConfiguration a').click(function(e) {
selectedDropdownValue = $('#orgDropdown option:selected').val();
orgForBg = $('#orgDropdown option:selected').text();
});

$('#cmdbConfiguration a').click(function(e) {
selectedDropdownValue = $('#orgDropdown option:selected').val();
orgForBg = $('#orgDropdown option:selected').text();
});

function changeWizardStatus(orgIdForSetup) {
$('#wizardActionListLoader').show();
$.get('/setting-wizard/org/' + orgIdForSetup, function(data) {
Expand Down
17 changes: 9 additions & 8 deletions client/htmls/private/ajax/Settings/bgWizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h4 class="widget-margin" style="color:black;">Create Business Group
</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">
<select id="orgname" class="chooseOrganization orgBgDropdown form-control width-100" cdata="catalyst" cat-validation="required">
</select>
</div>
</div>
Expand All @@ -33,17 +33,16 @@ <h4 class="widget-margin" style="color:black;">Create Business Group
</div>
</div>
</form>



<script>

$('.providerSelect').removeClass('hidden');
if (selectedDropdownValue) {
var $optionSelect = $('<option></option').val(orgForBg).attr('rowid', selectedDropdownValue).html(orgForBg);
$('#orgname').append($optionSelect);
$('.nextFormWizard').removeAttr('disabled');
} else {
$('#cancelWizard').addClass('hidden');
$('#orgname').empty();
$.get('/d4dMasters/readmasterjsonnew/1', function(data) {
$("#orgDropdown").empty();
for (var i = 0; i < data.length; i++) {
Expand All @@ -53,10 +52,9 @@ <h4 class="widget-margin" style="color:black;">Create Business Group
orgNameForSetup = $('#orgDropdown option:last').attr('rowid');
orgIdForSetup = $('#orgDropdown option:last').val();
lastDropdownValue = $('#orgDropdown option:last').val();
$('#orgDropdown option:last').attr('selected', 'selected')
var $optionSelect = $('<option></option').val(orgNameForSetup).attr('rowid', orgIdForSetup).html(orgNameForSetup);
$('#orgname').append($optionSelect);
getBgValues();
$('#orgDropdown option:last').attr('selected', 'selected');
var $optionSelectOrgBG = $('<option></option').val(orgNameForSetup).attr('rowid', orgIdForSetup).html(orgNameForSetup);
$('.orgBgDropdown').append($optionSelectOrgBG);
});
}

Expand All @@ -82,9 +80,12 @@ <h4 class="widget-margin" style="color:black;">Create Business Group
});

$(".nextFormWizard").click(function() {
if(selectedDropdownValue){
getProjValues();
}
$('.contentSetting').find('ol li#bgCreate').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#projectCreate').addClass('active');
$('.content').load("ajax/Settings/projWizard.html");
});

</script>
48 changes: 35 additions & 13 deletions client/htmls/private/ajax/Settings/configManagementWizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
</div>
</form>
</div>
<input type="hidden" id="configWizardValueNewEdit"/>
<script>
//jQuery time
orgNameForSetup = $('#orgDropdown option:selected').attr('rowid');
orgIdForSetup = $('#orgDropdown option:selected').val();
var $option = $('<option></option>').val(orgNameForSetup).attr('rowid', orgIdForSetup).html(orgNameForSetup);
$('#orgname').append($option);

function bindChange_importPemFile() {
$('input[type="file"]').off('change').on('change', function() {
$(this).next().val(this.files[0].name);
Expand All @@ -107,7 +107,7 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
//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);

$('.btn-2 a').addClass('not-activeAnchor');
function getConfigValues() {
$.get('/d4dMasters/readmasterjsonnew/10', function(data) {
for (var i = 0; i < data.length; i++) {
Expand All @@ -126,6 +126,7 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
$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');
$('.nextFormWizard').removeAttr('disabled');
}
}
});
Expand Down Expand Up @@ -168,11 +169,14 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
$('.btn-2 a').click(function(e) {
e.preventDefault();
clicked = false;
$('.btn-3 a').removeClass('not-activeAnchor');
$('.btn-4 a').removeClass('not-activeAnchor');
$('.contentSetting').load(this.getAttribute('href'));
});
$('.envCreate a').click(function(e) {
e.preventDefault();
$('.content').empty();
$('.btn-2 a').removeClass('not-activeAnchor');
getEnvValues();
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active');
$(this).parent('.bwizard-steps li').addClass('active');
Expand All @@ -182,14 +186,14 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
$('.btn-4 a').click(function(e) {
e.preventDefault();
$('.content').empty();
$('.btn-2 a').removeClass('not-activeAnchor');
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) {
if(orgIdForSetup){

function configWizardStatus(orgIdForSetup) {
$.get('/setting-wizard/org/' + orgIdForSetup, function(data) {
if (data.currentStep.name === 'Config Management') {
if (data.currentStep.nestedSteps) {
Expand All @@ -201,13 +205,16 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
} else if (nestedSteps[0].name === 'ChefServer' && nestedSteps[0].isCompleted === true && nestedSteps[1].name === 'Environment' && nestedSteps[1].isCompleted === true && nestedSteps[2].name === 'Teams' && nestedSteps[2].isCompleted === false) {
$('.btn-2 a,.btn-3 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#teamCreate').addClass('active');
$('.btn-3 a').removeClass('not-activeAnchor');
$('.content').load('ajax/Settings/teamWizard.html');
} else {

}
}
} else {
getConfigValues();
getEnvValues();
getTeamValues();
$('#saveConfigWizard').addClass('hidden');
$('.nextFormWizard').removeAttr('disabled');
$('.btn-3 a').removeClass('not-activeAnchor');
Expand All @@ -217,16 +224,31 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
$('.btn-4 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
}
});
$('#wizardActionListLoader').hide();
}
var configWizardStatusValue = $('#configWizardValueNewEdit').val('new');
var configWizardEditValue;
orgIdForSetup = selectedDropdownValue || firstOrgValue;
if (clicked) {
if(orgIdForSetup){
if(configWizardStatusValue){
configWizardStatus(orgIdForSetup);
}
}
} 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();
if(orgIdForSetup){
configWizardEditValue = $('#configWizardValueNewEdit').val('edit');
if(configWizardEditValue){
$('#wizardActionListLoader').hide();
getConfigValues();
$('.btn-3 a').removeClass('not-activeAnchor');
$('.btn-4 a').removeClass('not-activeAnchor');
$('.nextFormWizard').removeAttr('disabled');
}
}
}

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


function setfolderpath() {
Expand All @@ -243,12 +265,12 @@ <h4 class="widget-margin" style="color:black;">New Configuration Management</h4>
});

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

$('.content').empty();
$('.content').empty();
getEnvValues();
$('.btn-2 a').removeClass('not-activeAnchor');
$('.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();
});


Expand Down
2 changes: 1 addition & 1 deletion client/htmls/private/ajax/Settings/devopsRolesWizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ <h4 class="modal-title">
$tr.append($tdName).append($tdAction);
$repoDeployTbody.append($tr);
$repoDetails.row.add($tr).draw();
$("#repodetailsModal").hide();
$("#repodetailsModal").modal('hide');
}
$("#repoNameCreate").empty();
$('#repoNameCreate').append('<option value = "" > Choose Repository </option>');
Expand Down
32 changes: 18 additions & 14 deletions client/htmls/private/ajax/Settings/envWizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ <h4 class="modal-title">Add a Chef Environment</h4>
</div>

<script>
function preprocess() {
$('#createenvinchefform')[0].reset();
if (typeof $('#configname').find('option:selected').attr('rowid') == 'undefined') {
bootbox.alert('Select a Chef Server before adding an environments.');
return (false);
} else
return (true);
}
$(document).ready(function(e){
var $optionOrg = $('<option></option>').val(orgNameForSetup).attr('rowid', orgIdForSetup).html(orgNameForSetup);
$('#orgname').append($optionOrg);
Expand Down Expand Up @@ -134,14 +142,7 @@ <h4 class="modal-title">Add a Chef Environment</h4>

$('#orgname').trigger('change');

function preprocess() {
$('#createenvinchefform')[0].reset();
if (typeof $('#configname').find('option:selected').attr('rowid') == 'undefined') {
bootbox.alert('Select a Chef Server before adding an environments.');
return (false);
} else
return (true);
}

$('#createenvinchefform').submit(function(e) {
var reqBodyEnv = {};
var chefid = $('#configname').find('option:selected').attr('rowid');
Expand Down Expand Up @@ -248,12 +249,15 @@ <h4 class="modal-title">Add a Chef Environment</h4>
$('.content').load(this.getAttribute('href'));
});
$(".nextFormWizard").click(function() {
$('.content').empty();
clickTeam = false;
getTeamValues();
$('.btn-3 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#teamCreate').addClass('active');
$('.content').load('ajax/Settings/teamWizard.html');
$('.content').empty();
if(configWizardEditValue){
getTeamValues();
}
$('.btn-2 a').removeClass('not-activeAnchor');
$('.btn-3 a').removeClass('not-activeAnchor');
$('.btn-3 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#teamCreate').addClass('active');
$('.content').load('ajax/Settings/teamWizard.html');
});
});
</script>
45 changes: 24 additions & 21 deletions client/htmls/private/ajax/Settings/galleryWizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,28 +169,31 @@ <h4 class="widget-margin" style="color:black;">Create Templates</h4>


//api call for getting the status of wizard
orgIdForSetup = selectedDropdownValue || firstOrgValue
if(clicked){
$('#wizardActionListLoader').show();
$.get('/setting-wizard/org/' + orgIdForSetup, function(data) {
if (data.currentStep.nestedSteps) {
var nestedSteps = data.currentStep.nestedSteps;
if (nestedSteps[0].name === 'Templates' && nestedSteps[0].isCompleted === true &&
nestedSteps[1].name === 'ServiceCommand' && nestedSteps[1].isCompleted === false &&
nestedSteps[2].name === 'ScriptGallery' && nestedSteps[2].isCompleted === false) {
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#serviceCreate').addClass('active');
$('.content').load('ajax/Settings/serviceCommandWizard.html');
} else if (nestedSteps[0].name === 'Templates' && nestedSteps[0].isCompleted === true &&
nestedSteps[1].name === 'ServiceCommand' && nestedSteps[1].isCompleted === true &&
nestedSteps[2].name === 'ScriptGallery' && nestedSteps[2].isCompleted === false) {
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#serviceCreate').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#scriptCreate').addClass('active');
$('.content').load('ajax/Settings/scriptWizard.html');
} else {}
}
});
$('#wizardActionListLoader').hide();
if(orgIdForSetup){
$('#wizardActionListLoader').show();
$.get('/setting-wizard/org/' + orgIdForSetup, function(data) {
if (data.currentStep.nestedSteps) {
var nestedSteps = data.currentStep.nestedSteps;
if (nestedSteps[0].name === 'Templates' && nestedSteps[0].isCompleted === true &&
nestedSteps[1].name === 'ServiceCommand' && nestedSteps[1].isCompleted === false &&
nestedSteps[2].name === 'ScriptGallery' && nestedSteps[2].isCompleted === false) {
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#serviceCreate').addClass('active');
$('.content').load('ajax/Settings/serviceCommandWizard.html');
} else if (nestedSteps[0].name === 'Templates' && nestedSteps[0].isCompleted === true &&
nestedSteps[1].name === 'ServiceCommand' && nestedSteps[1].isCompleted === true &&
nestedSteps[2].name === 'ScriptGallery' && nestedSteps[2].isCompleted === false) {
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#serviceCreate').removeClass('active').addClass('green-btn');
$('.contentSetting').find('ol li#scriptCreate').addClass('active');
$('.content').load('ajax/Settings/scriptWizard.html');
} else {}
}
});
$('#wizardActionListLoader').hide();
}
} else {
//getTemplateValues();
$('.btn-2 a').parent('.bwizard-steps li').removeClass('active').addClass('green-btn');
Expand Down
3 changes: 2 additions & 1 deletion client/htmls/private/ajax/Settings/projWizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ <h4 class="widget-margin" style="color:black;">Create Project
getBusinessGroupName(selectedDropdownValue);
$('.nextFormWizard').removeAttr('disabled');
} else {
$('.btn-3 a').removeClass('not-activeAnchor');
orgNameForSetup = $('#orgDropdown option:last').attr('rowid');
orgIdForSetup = $('#orgDropdown option:last').val();
$('#orgDropdown option:last').attr('selected', 'selected')
Expand Down Expand Up @@ -111,7 +112,7 @@ <h4 class="widget-margin" style="color:black;">Create Project

$(".nextFormWizard").click(function() {
$('#wizardActionListLoader').show();
$('#providerConfiguration a').attr('href','ajax/Settings/providerWizard.html');
$('#configManagement a').attr('href','ajax/Settings/configManagementWizard.html');
$('#configManagement a').trigger('click');
$('#startConfig a, #orgConfiguration a').addClass('green-btn').removeClass('process-btn');
$('.wizardFlow').empty();
Expand Down
Loading