Skip to content

Commit

Permalink
add nesy-customer-bff-gateway project
Browse files Browse the repository at this point in the history
  • Loading branch information
ubeniz committed Apr 18, 2024
1 parent b3a3a61 commit c64d5a9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ <h1>Git Automation </h1>
<div class="col-sm-4">
<input type="text" class="form-control" id="commitMessage" placeholder="Enter commit message">
</div>
</div>
<div class="form-group row">
<label for="isBffGatewayProject" class="col-sm-2 col-form-label">Is Project ?</label>
<div class="col-sm-4">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="isBffGateway" value="isBffGateway">
<label class="form-check-label" for="isBffGateway">nesy-customer-bff-gateway</label>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-sm-4">
Expand Down Expand Up @@ -127,9 +136,7 @@ <h1>Git Automation </h1>
<div id="footer">
<span>Geliştirme talepleri veya hata bildirimi için → <a
href="mailto:umitbeniz@araskargo.com.tr">umitbeniz@araskargo.com.tr</a></span>
<span id="version">v1.0.0</span>
<span id="version">v1.1.0</span>
</div>
<script>$(document).ready(function () { $("#generateBtn").click(function () { var commitMessage = $("#commitMessage").val(); if (!commitMessage) { alert("Commit Message is required!"); return; } var branchType = $("#branchType").val(); var issueNumber = $("#issueNumber").val(); var branchNameOptional = $("#branchNameOptional").val(); if (!issueNumber && !branchNameOptional) { alert("Either Issue Number or Branch Name is required!"); return; } var formattedBranchNameOptional = "xxxxxxx"; if (branchNameOptional) { formattedBranchNameOptional = branchNameOptional.toLowerCase().replace(/\s+/g, '-'); } var branchName = (issueNumber ? branchType + '/iss-' + issueNumber + '-' : branchType + '/') + formattedBranchNameOptional; var commitMsgPrefix = (issueNumber ? 'aras-digital/nesy-analysis#' + issueNumber : branchType.toUpperCase()); var commitMessageFull = commitMsgPrefix + ' | ' + commitMessage; var prMsgPrefix = ""; if (!issueNumber) { if (branchType === 'feat') { prMsgPrefix = branchType.toUpperCase() + ' | PR'; } else if (branchType === 'bugfix') { prMsgPrefix = branchType.toUpperCase() + ' | PR'; } else if (branchType === 'hotfix') { prMsgPrefix = branchType.toUpperCase() + ' | PR'; } } else { prMsgPrefix = (branchType === 'feat') ? 'ISS #' + issueNumber + ' | PR' : (branchType === 'bugfix') ? 'BUGFIX #' + issueNumber + ' | PR' : 'HOTFIX #' + issueNumber + ' | PR'; } var prMessage = prMsgPrefix; var warningMessage = ""; if (branchType === 'bugfix') { warningMessage = "Dikkat! Bu branch <b>rel/env-test</b> branchinden oluşturulmalıdır"; } else if (branchType === 'hotfix') { warningMessage = "Dikkat! Bu branch <b>rel/env-hr</b> branchinden oluşturulmalıdır"; } $("#branchWarning").html(warningMessage ? '(' + warningMessage + ')' : ''); $("#branchNameText").text(branchName); $("#commitMessageText").text(commitMessageFull); $("#prMessageText").text(prMessage); $("#result-container").show(); }); $("#copyBranchName").click(function () { copyToClipboard($("#branchNameText").text()); alert("Branch Name kopyalandı!"); }); $("#copyCommitMessage").click(function () { copyToClipboard($("#commitMessageText").text()); alert("Commit Message kopyalandı!"); }); $("#copyPrMessage").click(function () { copyToClipboard($("#prMessageText").text()); alert("PR Message kopyalandı!"); }); function copyToClipboard(text) { var dummy = document.createElement("textarea"); document.body.appendChild(dummy); dummy.value = text; dummy.select(); document.execCommand("copy"); document.body.removeChild(dummy); } }); </script>
</body>

<script>$(document).ready(function () { $("#generateBtn").click(function () { var commitMessage = $("#commitMessage").val(); if (!commitMessage) { alert("Commit Message is required!"); return; } var branchType = $("#branchType").val(); var issueNumber = $("#issueNumber").val(); var branchNameOptional = $("#branchNameOptional").val(); if (!issueNumber && !branchNameOptional) { alert("Either Issue Number or Branch Name is required!"); return; } var formattedBranchNameOptional = "xxxxxxx"; if (branchNameOptional) { formattedBranchNameOptional = branchNameOptional.toLowerCase().replace(/\s+/g, '-'); } var branchName = (issueNumber ? branchType + '/iss-' + issueNumber + '-' : branchType + '/') + formattedBranchNameOptional; if (issueNumber) { if ($("#isBffGateway").is(":checked")) { commitMsgPrefix = 'aras-digital/nesy-customer-bff-gateway#' + issueNumber; } else { commitMsgPrefix = 'aras-digital/nesy-analysis#' + issueNumber; }} else { commitMsgPrefix = branchType.toUpperCase();} var commitMessageFull = commitMsgPrefix + ' | ' + commitMessage; var prMsgPrefix = ""; if (!issueNumber) { if (branchType === 'feat') { prMsgPrefix = branchType.toUpperCase() + ' | PR'; } else if (branchType === 'bugfix') { prMsgPrefix = branchType.toUpperCase() + ' | PR'; } else if (branchType === 'hotfix') { prMsgPrefix = branchType.toUpperCase() + ' | PR'; } } else { prMsgPrefix = (branchType === 'feat') ? 'ISS #' + issueNumber + ' | PR' : (branchType === 'bugfix') ? 'BUGFIX #' + issueNumber + ' | PR' : 'HOTFIX #' + issueNumber + ' | PR'; } var prMessage = prMsgPrefix; var warningMessage = ""; if (branchType === 'bugfix') { warningMessage = "Dikkat! Bu branch <b>rel/env-test</b> branchinden oluşturulmalıdır"; } else if (branchType === 'hotfix') { warningMessage = "Dikkat! Bu branch <b>rel/env-hr</b> branchinden oluşturulmalıdır"; } $("#branchWarning").html(warningMessage ? '(' + warningMessage + ')' : ''); $("#branchNameText").text(branchName); $("#commitMessageText").text(commitMessageFull); $("#prMessageText").text(prMessage); $("#result-container").show(); }); $("#copyBranchName").click(function () { copyToClipboard($("#branchNameText").text()); alert("Branch Name kopyalandı!"); }); $("#copyCommitMessage").click(function () { copyToClipboard($("#commitMessageText").text()); alert("Commit Message kopyalandı!"); }); $("#copyPrMessage").click(function () { copyToClipboard($("#prMessageText").text()); alert("PR Message kopyalandı!"); }); function copyToClipboard(text) { var dummy = document.createElement("textarea"); document.body.appendChild(dummy); dummy.value = text; dummy.select(); document.execCommand("copy"); document.body.removeChild(dummy); } }); </script></body>
</html>

0 comments on commit c64d5a9

Please sign in to comment.