Fixed bug, that broke UUID changer when user provides spaces in UUID. (#102)
fixed bug Co-authored-by: mikolaj widla <mikolaj.widla@gmail.com> Reviewed-on: R11/release11-tools-web#102 Co-authored-by: Mikolaj Widla <widlam@noreply.example.com> Co-committed-by: Mikolaj Widla <widlam@noreply.example.com>
This commit is contained in:
		@@ -280,9 +280,10 @@ async function fetchUUIDCheck(givenUUID , strategy){
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function checkUUIDChars(uuid) {
 | 
			
		||||
    uuid.replace(/ /g,'')
 | 
			
		||||
    console.log("UUID in check: " + uuid);
 | 
			
		||||
    const regex = new RegExp("^[A-z0-9-]+$");
 | 
			
		||||
    if(regex.test(uuid)){
 | 
			
		||||
    if(regex.test(uuid) || uuid == ""){
 | 
			
		||||
        return uuid ;
 | 
			
		||||
    } 
 | 
			
		||||
    return "invalid";
 | 
			
		||||
@@ -309,7 +310,6 @@ function changeUUID(element){
 | 
			
		||||
            changeMessage = "success";
 | 
			
		||||
        }
 | 
			
		||||
        clientUUID = data;
 | 
			
		||||
        $("#uuid-input").attr("disabled", true);
 | 
			
		||||
        $("#editable").attr("checked", false);
 | 
			
		||||
        
 | 
			
		||||
        uuidChangeModalDisplay(changeMessage);
 | 
			
		||||
 
 | 
			
		||||
@@ -74,13 +74,16 @@ function showModal(jmodal){
 | 
			
		||||
 | 
			
		||||
function hideModal(jmodal){
 | 
			
		||||
    if(!modalDisplayed) return;
 | 
			
		||||
    if ($(uuidChangeModal).hasClass('active')) window.location.reload();
 | 
			
		||||
    overlay.removeClass('active');
 | 
			
		||||
    jmodal.removeClass('active');
 | 
			
		||||
    modalDisplayed = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
btnModalClose.click(closeModals);
 | 
			
		||||
 | 
			
		||||
overlay.click(closeModals);
 | 
			
		||||
 | 
			
		||||
dataLossModalNo.click(closeModals);
 | 
			
		||||
dataLossModalYes.click(dropChangesAndClose);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user