added validation and posibility to add custom http status
This commit is contained in:
		@@ -34,7 +34,7 @@
 | 
				
			|||||||
                            <!-- status -->
 | 
					                            <!-- status -->
 | 
				
			||||||
                            <div class="max-width  small-vertical-margin">
 | 
					                            <div class="max-width  small-vertical-margin">
 | 
				
			||||||
                                <label for="httpStatus">Http Status</label>
 | 
					                                <label for="httpStatus">Http Status</label>
 | 
				
			||||||
                                <!-- <input id="httpStatus" class="bordered-field max-width data-field" type="text" value="200" list="httpStatusSuggestion"> -->
 | 
					                                <!--
 | 
				
			||||||
                                <select id="httpStatus" class="bordered-field max-width data-field" value="200">
 | 
					                                <select id="httpStatus" class="bordered-field max-width data-field" value="200">
 | 
				
			||||||
                                    <option value="200">200</option>
 | 
					                                    <option value="200">200</option>
 | 
				
			||||||
                                    <option value="300">300</option>
 | 
					                                    <option value="300">300</option>
 | 
				
			||||||
@@ -43,6 +43,9 @@
 | 
				
			|||||||
                                    <option value="404">404</option>
 | 
					                                    <option value="404">404</option>
 | 
				
			||||||
                                    <option value="500">500</option>
 | 
					                                    <option value="500">500</option>
 | 
				
			||||||
                                </select>
 | 
					                                </select>
 | 
				
			||||||
 | 
					                                -->
 | 
				
			||||||
 | 
					                                <input id="httpStatus" type="number" class="bordered-field max-width data-field" value="200"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            </div>
 | 
					                            </div>
 | 
				
			||||||
                            <!-- content type -->
 | 
					                            <!-- content type -->
 | 
				
			||||||
                            <div class="max-width  small-vertical-margin">
 | 
					                            <div class="max-width  small-vertical-margin">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -41,7 +41,6 @@ function getData(){
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
function checkUuid(){
 | 
					function checkUuid(){
 | 
				
			||||||
    if(clientUUID == null || clientUUID == undefined || clientUUID == ''){
 | 
					    if(clientUUID == null || clientUUID == undefined || clientUUID == ''){
 | 
				
			||||||
        clientUUID = json[0].clientUUID;
 | 
					        clientUUID = json[0].clientUUID;
 | 
				
			||||||
@@ -56,8 +55,19 @@ function getDomain(){
 | 
				
			|||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function httpStatusInvalid(){
 | 
				
			||||||
 | 
					    value = $('#httpStatus').val();
 | 
				
			||||||
 | 
					    return value == '';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setDataModified(){
 | 
					function setDataModified(){
 | 
				
			||||||
 | 
					    console.log("dupadupagówno")
 | 
				
			||||||
    if(dataModified) return;
 | 
					    if(dataModified) return;
 | 
				
			||||||
 | 
					    if(httpStatusInvalid()){
 | 
				
			||||||
 | 
					        $('#btn-save').removeClass('active');
 | 
				
			||||||
 | 
					        $('#btn-save').off();
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    dataModified = true;
 | 
					    dataModified = true;
 | 
				
			||||||
    $('#btn-save').addClass('active');
 | 
					    $('#btn-save').addClass('active');
 | 
				
			||||||
    $('#btn-save').click(getUpdate);
 | 
					    $('#btn-save').click(getUpdate);
 | 
				
			||||||
@@ -197,7 +207,7 @@ function clearMock(){
 | 
				
			|||||||
    $('#httpStatusValues').html('');
 | 
					    $('#httpStatusValues').html('');
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function initializeMock(index){
 | 
					function initializeMocksetModified(index){
 | 
				
			||||||
        clearMock();
 | 
					        clearMock();
 | 
				
			||||||
        fillStaticFields(json[index].clientUUID
 | 
					        fillStaticFields(json[index].clientUUID
 | 
				
			||||||
            , json[index].mockedResponseId
 | 
					            , json[index].mockedResponseId
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user