<commit_before>var updateSubscription = function (apiName, version, provider, appId, newstatus, n, link) {
    //var ahrefId = $('#' + apiName + provider + appId);
    //n is a integer value. But, when this parameter getting passed from the jaggery, it getting passed as 1.0, 2.0 etc instead of 1, 2.
    // Math.round function is called on 'n' to avoid the adding decimals into n.
    n = Math.round(n);
    var ahrefId = $(link);
    var status = ahrefId.text();
    var blockType = $('#blockType' + n + '  option:selected').val();
    var newStatus;
    if (status.trim().toUpperCase() == 'Unblock'.toUpperCase()) {
        newStatus = 'UNBLOCKED';
    } else if(blockType == 'blockProduction') {
    	newStatus = 'PROD_ONLY_BLOCKED';
    } else {
        newStatus = 'BLOCKED';
    }
    jagg.post("/site/blocks/users-keys/ajax/subscriptions.jag", {
        action:"updateSubscription",
        apiName:apiName,
        version:version,
        provider:provider,
        appId:appId,
        newStatus:newStatus
    }, function (result) {
        if (!result.error) {
            if (newStatus == 'UNBLOCKED') {
            	$('#blockType' + n).prop('disabled', 'false');
                ahrefId.html('<span class="icon fw-stack"><i class="fw fw-block fw-stack-1x"></i></span> Block');
            } else {
            	$('#blockType' + n).prop('disabled', 'true');
            	ahrefId.html('<span class="icon fw-stack"><i class="fw fw-check fw-stack-1x"></i></span> Unblock');
            }

        } else {
            jagg.message({content:result.message, type:"error"});
        }


    }, "json");


}

var getRadioValue = function (radioButton) {
    if (radioButton.length > 0) {
        return radioButton.val();
    }
    else {
        return 0;
    }
};


$(function(){

    /***********************************************************
     *  data-tables config
     ***********************************************************/
	$('#manage-subscriptions').datatables_extended({
	     "fnDrawCallback": function(){
	       if(this.fnSettings().fnRecordsDisplay()<=$("#manage-subscriptions_length option:selected" ).val()
	     || $("#manage-subscriptions_length option:selected" ).val()==-1)
	       $('#manage-subscriptions_paginate').hide();
	       else $('#manage-subscriptions_paginate').show();
	     } ,
         "aoColumns": [
         { "bSortable": false },
         null,
         null,
         { "bSortable": false },
         { "bSortable": false }
         ]
	});

});
    <commit_msg>Fixing block dropdown enable/disable issue<commit_after>var updateSubscription = function (apiName, version, provider, appId, newstatus, n, link) {
    //var ahrefId = $('#' + apiName + provider + appId);
    //n is a integer value. But, when this parameter getting passed from the jaggery, it getting passed as 1.0, 2.0 etc instead of 1, 2.
    // Math.round function is called on 'n' to avoid the adding decimals into n.
    n = Math.round(n);
    var ahrefId = $(link);
    var status = ahrefId.text();
    var blockType = $('#blockType' + n + '  option:selected').val();
    var newStatus;
    if (status.trim().toUpperCase() == 'Unblock'.toUpperCase()) {
        newStatus = 'UNBLOCKED';
    } else if(blockType == 'blockProduction') {
    	newStatus = 'PROD_ONLY_BLOCKED';
    } else {
        newStatus = 'BLOCKED';
    }
    jagg.post("/site/blocks/users-keys/ajax/subscriptions.jag", {
        action:"updateSubscription",
        apiName:apiName,
        version:version,
        provider:provider,
        appId:appId,
        newStatus:newStatus
    }, function (result) {
        if (!result.error) {
            if (newStatus == 'UNBLOCKED') {
            	$('#blockType' + n).prop('disabled', false);
                ahrefId.html('<span class="icon fw-stack"><i class="fw fw-block fw-stack-1x"></i></span> Block');
            } else {
            	$('#blockType' + n).prop('disabled', true);
            	ahrefId.html('<span class="icon fw-stack"><i class="fw fw-check fw-stack-1x"></i></span> Unblock');
            }

        } else {
            jagg.message({content:result.message, type:"error"});
        }


    }, "json");


}

var getRadioValue = function (radioButton) {
    if (radioButton.length > 0) {
        return radioButton.val();
    }
    else {
        return 0;
    }
};


$(function(){

    /***********************************************************
     *  data-tables config
     ***********************************************************/
	$('#manage-subscriptions').datatables_extended({
	     "fnDrawCallback": function(){
	       if(this.fnSettings().fnRecordsDisplay()<=$("#manage-subscriptions_length option:selected" ).val()
	     || $("#manage-subscriptions_length option:selected" ).val()==-1)
	       $('#manage-subscriptions_paginate').hide();
	       else $('#manage-subscriptions_paginate').show();
	     } ,
         "aoColumns": [
         { "bSortable": false },
         null,
         null,
         { "bSortable": false },
         { "bSortable": false }
         ]
	});

});
    
{'fraction_non_alphanumeric': 0.20410985971151946, 'fraction_numerical': 0.0043469670025686625, 'mean_word_length': 2.5497896213183733, 'pattern_counts': {'":': 10, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '989799', 'n_tokens_mistral': 1543, 'n_tokens_neox': 1487, 'n_words': 316}