From 5dffc5f05649a82cefa1034bd0896da1625bff3e Mon Sep 17 00:00:00 2001 From: Taka Date: Tue, 29 Sep 2020 07:04:21 +0000 Subject: [PATCH] Removed the "add" button from the LFA upload dialog. --- vasl_templates/webapp/static/lfa-upload.js | 7 +------ vasl_templates/webapp/tests/test_lfa.py | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/vasl_templates/webapp/static/lfa-upload.js b/vasl_templates/webapp/static/lfa-upload.js index 8d1aff9..9796f1e 100644 --- a/vasl_templates/webapp/static/lfa-upload.js +++ b/vasl_templates/webapp/static/lfa-upload.js @@ -93,9 +93,6 @@ window.on_analyze_vlog = function() create: function() { // initialize the dialog init_dialog( $(this), "OK", false ) ; - var $btnPane = $( ".ui-dialog.lfa-upload .ui-dialog-buttonpane" ) ; - var $btn = $( "" ) ; - $btnPane.prepend( $btn ) ; }, open: function() { // initialize the dialog @@ -110,8 +107,6 @@ window.on_analyze_vlog = function() beforeStop: onDragEnd, } ).empty() ; initExternalDragDrop() ; - var $addBtn = $( ".ui-dialog.lfa-upload button.add" ) ; - gEventHandlers.addHandler( $addBtn, "click", onAddFile ) ; gEventHandlers.addHandler( $gLogFilesToUpload, "click", onAddFile ) ; gEventHandlers.addHandler( $dlg.find(".hint"), "click", onAddFile ) ; updateUi() ; @@ -187,7 +182,7 @@ function addFileToUploadList( fname, vlog_data ) $gLogFilesToUpload.append( $item ) ; updateUi() ; - // add click handler to remove the file from the list + // add click handlers to remove the file from the list gEventHandlers.addHandler( $item.children( ".delete" ), "click", function() { gDisableClickToAddTimestamp = new Date() ; removeFileFromUploadList( $(this).parent() ) ; diff --git a/vasl_templates/webapp/tests/test_lfa.py b/vasl_templates/webapp/tests/test_lfa.py index befcdb7..4eebf04 100644 --- a/vasl_templates/webapp/tests/test_lfa.py +++ b/vasl_templates/webapp/tests/test_lfa.py @@ -558,14 +558,14 @@ def _analyze_vlogs( fnames ): dlg = wait_for_elem( 2, ".ui-dialog.lfa-upload" ) # add each log file - for fname in fnames: + for fno,fname in enumerate(fnames): fname = os.path.join( os.path.split(__file__)[0], "fixtures/analyze-vlog/"+fname ) vlog_data = open( fname, "rb" ).read() set_stored_msg( "_vlog-persistence_", "{}|{}".format( os.path.split( fname )[1], base64.b64encode( vlog_data ).decode( "utf-8" ) ) ) - find_child( "button.add", dlg ).click() + find_child( "#lfa-upload .{}".format( "hint" if fno == 0 else "files" ), dlg ).click() wait_for( 2, lambda: get_stored_msg( "_vlog-persistence_" ) == "" ) # start the analysis