Skip to content

Commit

Permalink
Resolve issue with webhook dialog opening on the wrong tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
netwolfuk committed Feb 24, 2019
1 parent f1e74db commit cf06822
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ WebHooksPlugin = {
backgroundColor: "#ffffff"
}, 500 );
},

showDialog: function (title, action, id, tab) {

this.formElement().submitAction.value = action;
Expand All @@ -145,8 +145,10 @@ WebHooksPlugin = {

populateWebHookDialog(id);
doExtraCompleted();
$j("div.tabPane").css('display', 'none');
$j('#tab-container').easytabs('select', tab);
$j(tab).css('display', 'block');
this.showCentered();
$j('#webHookUrl').focus();
},

cleanFields: function (data) {
Expand Down Expand Up @@ -178,18 +180,6 @@ WebHooksPlugin = {
}
},

doValidate: function() {
var errorFound = false;

var name = $j('input[id="debrepo.name"]');
if (name.val() == "") {
this.error(name, "Please set the repository name");
errorFound = true;
}

return !errorFound;
},

doPost: function() {
this.formElement().payloadTemplate.value = lookupTemplate(this.formElement().payloadFormatHolder.value);
this.formElement().payloadFormat.value = lookupFormat(this.formElement().payloadFormatHolder.value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@
<li class='tab' id="templatePaneTab"><a href="#templatePane">Preview &amp; Test</a></li>
</ul>
<div class='panel-container'>
<div id='hookPane'>
<div id='hookPane' class="tabPane">
<table style="border:none;">

<tr style="border:none;">
<td>URL:</td>
<td colspan=2 style="padding-left:0.5em;"><input autocomplete="on" id="webHookUrl" name="URL" type=text maxlength=512 style="margin: 0pt; padding: 0pt; width: 36em;"/></td>
<td colspan=2 style="padding-left:0.5em;"><input autocomplete="on" id="webHookUrl" name="URL" type=text maxlength=512 style="margin: 0pt; padding: 0pt; width: 36em;" autofocus></td>
</tr>
<tr>
<td></td>
<td colspan=2><span class="error" id="error_webHookUrl" style="margin-left: 0.5em;"></span></td>
</tr>
<tr style="border:none;">
<td><label class="webhookEnabled" for="webHooksEnabled">Enabled:</label></td>
<td style="padding-left:2px;" colspan=2><input id="webHooksEnabled" type=checkbox name="webHooksEnabled" style="margin-left:0.5em; padding-left:0.5em;"/></td>
<td style="padding-left:2px;" colspan=2><input id="webHooksEnabled" type=checkbox name="webHooksEnabled" style="margin-left:0.5em; padding-left:0.5em;"></td>
</tr>

<tr style="border:none;"><td style="vertical-align:text-top; padding-top:0.33em;">Payload Format:</td>
Expand Down Expand Up @@ -168,13 +168,13 @@

</div><!--hookPane -->

<div id='buildPane'>
<div id='buildPane' class="tabPane">
<p style="border-bottom:solid 1px #cccccc; margin:0; padding:0.5em;"><label><input name="buildTypeAll" onclick="toggleAllBuildTypesSelected();" type=checkbox style="padding-right: 1em;" class="buildType_all"><strong>All Project Builds</strong></label></p>
<p style="border-bottom:solid 1px #cccccc; margin:0; padding:0.5em;"><label><input id="buildTypeSubProjects" name="buildTypeSubProjects" onclick="updateSelectedBuildTypes();" type=checkbox style="padding-right: 1em;" class="buildType_subprojects"><strong>All Sub-Project Builds</strong></label></p>
<div id='buildList' style="padding:0;">
</div>
</div><!--buildPane -->
<div id='extrasPane'>
<div id='extrasPane' class="tabPane">
<div id='extrasAuthPanel'>
<h2>Authentication</h2>
<div class="extraAuthParametersWrapper">
Expand All @@ -190,7 +190,7 @@
</div>
</div>
</div><!--extrasPane -->
<div id='templatePane'>
<div id='templatePane' class="tabPane">
<div id='templateLeftPanel'>
<div class="webHookPreviewHeader">
<table>
Expand Down

0 comments on commit cf06822

Please sign in to comment.