@@ -1229,20 +1229,51 @@ function InitializeFields()
12291229 // Always display the button
12301230 approveChangelogButton .style .display = ' inline-block' ;
12311231
1232- // Condition: Enable button only if
1233- // 1. Changelog Check is enabled
1234- // 2. Changelog Approval is neither empty nor "TBD"
1235- if (isChangelogCheckEnabled && changelogApprovalValue && changelogApprovalValue !== ' TBD' )
1232+ // Decide whether we want "Approve" or "Block"
1233+ if (changelogApprovalValue === ' APPROVED' )
12361234 {
1237- approveChangelogButton .disabled = false ; // Enable the button
1238- approveChangelogButton .style .opacity = ' 1' ; // Fully opaque
1239- approveChangelogButton .style .cursor = ' pointer' ; // Pointer cursor for enabled state
1235+ // Change button text to "Block Changelog"
1236+ approveChangelogButton .value = " Block Changelog" ;
1237+
1238+ // Make sure it calls a new function that sends a block command
1239+ approveChangelogButton .onclick = function () {
1240+ blockChangelog ();
1241+ return false ; // Prevent default form submission
1242+ };
1243+
1244+ approveChangelogButton .disabled = false ;
1245+ approveChangelogButton .style .opacity = ' 1' ;
1246+ approveChangelogButton .style .cursor = ' pointer' ;
1247+ }
1248+ else if (changelogApprovalValue === ' BLOCKED' )
1249+ {
1250+ // If it’s "BLOCKED", e.g. "Approve Changelog" again:
1251+ approveChangelogButton .value = " Approve Changelog" ;
1252+ approveChangelogButton .onclick = function () {
1253+ changelogApproval ();
1254+ return false ;
1255+ };
1256+ approveChangelogButton .disabled = false ;
12401257 }
12411258 else
12421259 {
1243- approveChangelogButton .disabled = true ; // Disable the button
1244- approveChangelogButton .style .opacity = ' 0.5' ; // Grayed out appearance
1245- approveChangelogButton .style .cursor = ' not-allowed' ; // Indicate disabled state
1260+ approveChangelogButton .value = " Approve Changelog" ;
1261+
1262+ // Condition: Enable button only if
1263+ // 1. Changelog Check is enabled
1264+ // 2. Changelog Approval is neither empty nor "TBD"
1265+ if (isChangelogCheckEnabled && changelogApprovalValue && changelogApprovalValue !== ' TBD' )
1266+ {
1267+ approveChangelogButton .disabled = false ; // Enable the button
1268+ approveChangelogButton .style .opacity = ' 1' ; // Fully opaque
1269+ approveChangelogButton .style .cursor = ' pointer' ; // Pointer cursor for enabled state
1270+ }
1271+ else
1272+ {
1273+ approveChangelogButton .disabled = true ; // Disable the button
1274+ approveChangelogButton .style .opacity = ' 0.5' ; // Grayed out appearance
1275+ approveChangelogButton .style .cursor = ' not-allowed' ; // Indicate disabled state
1276+ }
12461277 }
12471278 }
12481279
@@ -1778,6 +1809,22 @@ function changelogApproval()
17781809 document .form .submit ();
17791810}
17801811
1812+ function blockChangelog ()
1813+ {
1814+ console .log (" Blocking Changelog..." );
1815+
1816+ if (! confirm (" Are you sure you want to block this changelog?" ))
1817+ {
1818+ return ;
1819+ }
1820+
1821+ document .form .action_script .value = ' start_MerlinAUblockchangelog' ;
1822+ document .form .action_wait .value = 10 ;
1823+
1824+ showLoading ();
1825+ document .form .submit ();
1826+ }
1827+
17811828/** ----------------------------------------**/
17821829/** Modified by Martinski W. [2025-Jan-22] **/
17831830/** ----------------------------------------**/
0 commit comments