Removed unneeded console.logs (#131)
Co-authored-by: mikolaj widla <mikolaj.widla@gmail.com> Co-authored-by: Adam Bem <adam.bem@zoho.eu> Reviewed-on: #131
This commit is contained in:
		@@ -38,8 +38,8 @@ function getData(){
 | 
			
		||||
    $.getJSON(host + '/api/mock/'+clientUUID, function(data) {
 | 
			
		||||
        json = data;
 | 
			
		||||
        checkUuid();
 | 
			
		||||
        console.log(JSON.stringify(json));
 | 
			
		||||
        console.log("Json received");
 | 
			
		||||
        
 | 
			
		||||
        
 | 
			
		||||
        refreshData();
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
@@ -104,11 +104,11 @@ const idToDisplay = function(){
 | 
			
		||||
function refreshData(){
 | 
			
		||||
    $("#uuid-input").val(clientUUID);
 | 
			
		||||
    fillMessageList();
 | 
			
		||||
    console.log("List initiated");
 | 
			
		||||
    
 | 
			
		||||
    let id = idToDisplay();
 | 
			
		||||
    console.log('Loading message of id: ' + id);
 | 
			
		||||
    
 | 
			
		||||
    loadMessage(id);
 | 
			
		||||
    console.log("Message loaded");
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function setCookie(){
 | 
			
		||||
@@ -262,7 +262,7 @@ async function fetchUUIDCheck(givenUUID , strategy){
 | 
			
		||||
                .then ( response => response.text() )
 | 
			
		||||
                .then ( data => {
 | 
			
		||||
                    newUUID = data;
 | 
			
		||||
                    console.log("newUUID: "+newUUID);
 | 
			
		||||
                    
 | 
			
		||||
                } )
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
@@ -271,7 +271,7 @@ async function fetchUUIDCheck(givenUUID , strategy){
 | 
			
		||||
                .then (response => response.text() )
 | 
			
		||||
                .then (data => {
 | 
			
		||||
                    newUUID = data;
 | 
			
		||||
                    console.log("restoreUUID: "+newUUID);
 | 
			
		||||
                    
 | 
			
		||||
                } )
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
@@ -281,11 +281,8 @@ async function fetchUUIDCheck(givenUUID , strategy){
 | 
			
		||||
 | 
			
		||||
function checkUUIDChars(uuid) {
 | 
			
		||||
    uuid.replace(/ /g,'')
 | 
			
		||||
    if (uuid.length > 128)
 | 
			
		||||
        return "invalid";
 | 
			
		||||
    console.log("UUID in check: " + uuid);
 | 
			
		||||
    const regex = new RegExp("^[A-z0-9-]+$");
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    if(regex.test(uuid) && uuid != ""){
 | 
			
		||||
        return uuid ;
 | 
			
		||||
    } 
 | 
			
		||||
@@ -409,14 +406,14 @@ function fillMessageList(){
 | 
			
		||||
    $('.tile').click(function(e) {
 | 
			
		||||
        var element = $(this);
 | 
			
		||||
        var button = element.find('.btn-tile').children().get(0);
 | 
			
		||||
        console.log(button == e.target);
 | 
			
		||||
        
 | 
			
		||||
        if(!(button == e.target)){
 | 
			
		||||
            console.log("Button is not a target. Loading message.")
 | 
			
		||||
            
 | 
			
		||||
            callLoadMessage(parseInt($(this).attr('tileid')));
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
    $('.btn-tile').click(function(){
 | 
			
		||||
        // console.log(this);
 | 
			
		||||
        // 
 | 
			
		||||
        callRemoveMessage($(this).closest('.tile').attr('tileId'));
 | 
			
		||||
    })
 | 
			
		||||
}
 | 
			
		||||
@@ -442,35 +439,35 @@ function callLoadMessage(id){
 | 
			
		||||
 | 
			
		||||
function loadMessage(id){
 | 
			
		||||
    if(id == null || id == undefined){
 | 
			
		||||
        console.log('id is null');
 | 
			
		||||
        
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    lastId = id;
 | 
			
		||||
    setCookie();
 | 
			
		||||
    setDataOrigin();
 | 
			
		||||
    for(let i=0; i<json.length; i++){
 | 
			
		||||
        console.log('id == ' + id + ' mockedId == ' + json[i].mockedResponseId);
 | 
			
		||||
        
 | 
			
		||||
        if(id == json[i].mockedResponseId){
 | 
			
		||||
            jsonIndex = i;
 | 
			
		||||
            console.log("Message found");
 | 
			
		||||
            
 | 
			
		||||
            initializeMock(jsonIndex);
 | 
			
		||||
            console.log("Fields initialized");
 | 
			
		||||
            
 | 
			
		||||
            selectMessage(id);
 | 
			
		||||
            console.log("Selection complete");
 | 
			
		||||
            
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    console.log("Message not found");
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function selectMessage(id){
 | 
			
		||||
    const tiles = $('.tile');
 | 
			
		||||
    console.log("Selecting message...");
 | 
			
		||||
    
 | 
			
		||||
    tiles.removeClass("active");
 | 
			
		||||
    console.log("Selected message deselected");
 | 
			
		||||
    
 | 
			
		||||
    $('.tile[tileid="'+id+'"]').addClass("active");
 | 
			
		||||
    console.log("Selected message selected");
 | 
			
		||||
    
 | 
			
		||||
    initializeHistory();
 | 
			
		||||
    refreshHeaderTable(innerHTML);
 | 
			
		||||
}
 | 
			
		||||
@@ -524,7 +521,7 @@ function generateJson(){
 | 
			
		||||
            httpHeaders: {},
 | 
			
		||||
        };
 | 
			
		||||
    newJson['httpHeaders'] = convertTableToJson();
 | 
			
		||||
    console.log(JSON.stringify(newJson, null, 2));
 | 
			
		||||
    
 | 
			
		||||
    json[jsonIndex] = newJson;
 | 
			
		||||
    return newJson;
 | 
			
		||||
}
 | 
			
		||||
@@ -532,7 +529,7 @@ function generateJson(){
 | 
			
		||||
 | 
			
		||||
function convertTableToJson(){
 | 
			
		||||
    const rows = $('#headerMapTable').children();
 | 
			
		||||
    console.log("Rows: "+rows.length);
 | 
			
		||||
    
 | 
			
		||||
    var obj = {};
 | 
			
		||||
    var key;
 | 
			
		||||
    for(let i=0; i<rows.length; i++){
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user