[Libreoffice-commits] online.git: cypress_test/integration_tests loleaflet/src

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 6 12:14:06 UTC 2020


 cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js   |   46 +--------
 cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js |   51 ++--------
 loleaflet/src/control/Control.Menubar.js                            |   12 +-
 3 files changed, 28 insertions(+), 81 deletions(-)

New commits:
commit 304d26af19f31050df6f02d9737a60f98551745b
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed May 6 10:12:52 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Jul 6 14:13:47 2020 +0200

    Add find & replace dialog in menu
    
    Change-Id: I4cf7f773e46d39fac521f607df4db6922a3c70bf
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97702
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js b/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js
index 2f25a8072..7d631cc11 100644
--- a/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js
@@ -326,52 +326,24 @@ describe('Trigger hamburger menu options.', function() {
 			.click();
 
 		// Search bar become visible
-		cy.get('#toolbar-search')
-			.should('be.visible');
+		cy.get('#mobile-wizard-content')
+			.should('not.be.empty');
 
-		// Search for some word
-		cy.get('#search-input')
-			.type('a');
+		cy.wait(1500);
 
-		cy.get('.w2ui-tb-image.w2ui-icon.next')
-			.click();
+		// Search for some word
+		cy.get('#searchterm')
+			.type('a{enter}');
 
-		// First cell should be selected
-		cy.get('input#addressInput')
-			.should('have.prop', 'value', 'A1');
+		cy.get('#search')
+			.should('not.have.attr', 'disabled');
 
-		// Go for the second match
-		cy.get('.w2ui-tb-image.w2ui-icon.next')
-			.click();
-
-		//Second cell should be selected
-		cy.get('input#addressInput')
-			.should('have.prop', 'value', 'B1');
-
-		// Go back to the first match
-		cy.get('.w2ui-tb-image.w2ui-icon.prev')
+		cy.get('#search')
 			.click();
 
 		// First cell should be selected
 		cy.get('input#addressInput')
 			.should('have.prop', 'value', 'A1');
-
-		// Remove search word
-		cy.get('#search-input')
-			.should('have.prop', 'value', 'a');
-
-		cy.get('#tb_searchbar_item_cancelsearch')
-			.click();
-
-		cy.get('#search-input')
-			.should('have.prop', 'value', '');
-
-		// Close search toolbar
-		cy.get('.w2ui-tb-image.w2ui-icon.unfold')
-			.click();
-
-		cy.get('#toolbar-search')
-			.should('not.be.visible');
 	});
 
 	it('Sheet: insert row before.', function() {
diff --git a/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js b/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js
index ba569caa6..c0e921e8d 100644
--- a/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js
@@ -656,59 +656,30 @@ describe('Trigger hamburger menu options.', function() {
 			.click();
 
 		// Search bar become visible
-		cy.get('#toolbar-search')
-			.should('be.visible');
-
-		// Search for some word
-		cy.get('#search-input')
-			.type('a');
+		cy.get('#mobile-wizard-content')
+			.should('not.be.empty');
 
-		// Part of the text should be selected
-		cy.get('.leaflet-marker-icon')
-			.should('exist');
+		cy.wait(1500);
 
-		cy.get('#copy-paste-container p')
-			.should('have.text', '\na');
+		// Search for some word
+		cy.get('#searchterm')
+			.type('a{enter}');
 
-		cy.get('#copy-paste-container p b')
-			.should('not.exist');
+		cy.get('#search')
+			.should('not.have.attr', 'disabled');
 
-		// Go for the second match
-		cy.get('.w2ui-tb-image.w2ui-icon.next')
+		cy.get('#search')
 			.click();
 
-		cy.get('#copy-paste-container p b')
+		// Part of the text should be selected
+		cy.get('.leaflet-marker-icon')
 			.should('exist');
 
 		cy.get('#copy-paste-container p')
 			.should('have.text', '\na');
 
-		// Go back to the first match
-		cy.get('.w2ui-tb-image.w2ui-icon.prev')
-			.click();
-
 		cy.get('#copy-paste-container p b')
 			.should('not.exist');
-
-		cy.get('#copy-paste-container p')
-			.should('have.text', '\na');
-
-		// Remove search word
-		cy.get('#search-input')
-			.should('have.prop', 'value', 'a');
-
-		cy.get('.w2ui-tb-image.w2ui-icon.cancel')
-			.click();
-
-		cy.get('#search-input')
-			.should('have.prop', 'value', '');
-
-		// Close search toolbar
-		cy.get('.w2ui-tb-image.w2ui-icon.unfold')
-			.click();
-
-		cy.get('#toolbar-search')
-			.should('not.be.visible');
 	});
 
 	it('Check word counts.', function() {
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index c391ea052..8d8f84b61 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1222,10 +1222,14 @@ L.Control.Menubar = L.Control.extend({
 		} else if (id === 'repair') {
 			this._map._socket.sendMessage('commandvalues command=.uno:DocumentRepair');
 		} else if (id === 'searchdialog') {
-			$('#toolbar-down').hide();
-			$('#toolbar-search').show();
-			$('#mobile-edit-button').hide();
-			L.DomUtil.get('search-input').focus();
+			if (this._map._permission === 'readonly') {
+				$('#toolbar-down').hide();
+				$('#toolbar-search').show();
+				$('#mobile-edit-button').hide();
+				L.DomUtil.get('search-input').focus();
+			} else {
+				this._map.sendUnoCommand('.uno:SearchDialog');
+			}
 		} else if (id === 'inserttextbox') {
 			this._map.sendUnoCommand('.uno:Text?CreateDirectly:bool=true');
 		} else if (id === 'insertslidefield') {


More information about the Libreoffice-commits mailing list