To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I8ba49faa7eb5926993111d03a961f750174d3bea
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I8cc3d77a42d66c80882e44f5cd09ac88f53dfa9c
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I74f253bb7df509c731a6b3bb22a077e1142e4580
a problem since:
commit 72b2ce4bb6
Author: Caolán McNamara <caolan.mcnamara@collabora.com>
Date: Wed Oct 25 19:19:08 2023 +0100
we don't need to round-trip through core to reposition notes
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: If00ae17a8e80ca3f8d2a530efa6cdba90207be56
Fix getViewRectangles function - it's used now.
Remove "_cellCursor" usage from CalcTileLayer.
Modify tests for the new changes.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ia5ec5a6e89d7d64df2041112936a16ec06c4da93
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I6d8f5429fafa77cc4e3019878c0791555225abd0
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Id6e1e2099273d22f9ae9718e18c70afbc27e64e7
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I72fca080c13b4d0954ba3fff67faaa6a4927ba3e
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ie60c7a27d88a47f00c9b793a48d4c8e533ac32d2
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: If5ecd80c5b16f8f5f3f1154de6d42ca0cd803773
Query included the header of the table, which was then
printed in the logs including lots of whitespace noise
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I361f60c9b42972f580ccb10986dd4b3b9400ca0c
The bug referenced has been fixed for a long time
so the workaround is no longer necessary
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ifac6555c711a0f142dd5d00ba4f4133dd4aece9f
To work even if we don't automatically fetch HTML when a text selection
is created. This was the first mobile suite that needed fixing.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Iad772d878d20d76bcf3770b7acc6abafa74859b2
To work even if we don't automatically fetch HTML when a text selection
is created. This was the last desktop suite that needed fixing.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I428153c89c9ff46dc41541713c13fe19455e0c14
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I7d2f870d7c694ca7305477c614c3ddb698e0c501
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I80c8534b456ec5930a79d8339b297905bb5ba2de
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I5e6d435fc9322fd5478d78f8e9ba0ef525b6c5cd
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ib53e71546cc1965f4a1073d507b07caef086c628
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I6148fdbdff6390c20e454ed9f26c6e55e774cc69
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I3562d90ff20963bb77afebb8ea7430586f0b6bbd
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Idb62d8496f8ff9503654ecea1747f097463afb1b
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic499b60dde450b32464dc2b8cd959066ac5c2e7e
error is:
1) Joining a document should not trigger an invalidation
Join after document save and modify:
CypressError: Timed out retrying after 10050ms: `cy.click()` failed because this element:
`<div class="leaflet-layer" style="position: absolute; width: 642px; height: 484px;"></div>`
is being covered by another element:
`<div class="jsdialog ui-button-box end" id="">...</div>`
Fix this problem, or use {force: true} to disable error checking.
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I8b0dde030b2aadf554db75872facb6c5c96a321c
- Now as we hide the button for none edit modified
- we need to check for items visiblity and not the disabled attr
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: Ic0b1765cd12381ea359a8ff65dd88a350d9e9f33
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Iff00cdd8e1a8863c09362cefa3a2bfdf6275f837
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I60028b22e570d2566a4d64b0cd70150530830852
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I52851e3473532781fb03f2ac9d7c14614c2d7814
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ia518a7f60c39109de82e0c9b38185ebe757df1cf
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ieb789f923357b3ff7749fee0202b15990491cfdc
Type a word into Writer, select it, Ctrl-K, the link text should default
to the selection, but it was empty.
This happens because Toolbar.js getTextForLink() doesn't have the
pre-fetched clipboard anymore, so we return an empty string there.
Fix the problem by triggering a text selection fetch (and leaving the
clipboard alone), and then handling the hyperlink dialog on the
CanvasTileLayer.js side.
Once this is done, the usual dummy clipboard registration & copy() calls
need adding and the test passes even with the patch from
<https://github.com/CollaboraOnline/online/issues/8648#issuecomment-2037278091>.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ibd8313588e705c4b027643b452099bbf02cfe8ec
To work even if we don't automatically fetch HTML when a text selection
is created.
'Insert hyperlink.' needs more work, leave that one alone for now.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I6abdc40e46d5347c8c005c1289b59ef8933f08d2
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I1b674504b682dc7fce2c6a437dc91aadd8065531
To work even if we don't automatically fetch HTML when a text selection
is created.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic55ddf984d8605c8627e87454a4b4916e15523d1
Move two functions from desktop/writer/copy_paste_spec.js to
common/helper.js, this way desktop/calc/clipboard_spec.js can do an
explicit Copy and then it passes even with the async copy.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I7874f0ac00a4237a90015b0fbcd67dcfd2e9ad68
Once the patch from
<https://github.com/CollaboraOnline/online/issues/8648#issuecomment-2037278091>
is applied to make CanvasTileLayer.js _onTextSelectionMsg() not fetch
the clipboard proactively, this test started to fail.
This happened because the test assumed that once a text selection is
created, we have the HTML for it, which is no longer the case.
Fix the problem by extending the dummy clipboard code to also handle
plain text and by adding a function which triggers the copy(), to
minimize the changes to the actual test code.
This is just a start, lots of other tests still need fixing, and once
the pattern is clear, common code should be extracted to
cypress_test/integration_tests/common/helper.js, probably.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I21ed1143470fa8026e133b0519e114a40fc0ed90
For one, getting the selection HTML all the time when we create a text
selection is a waste of resources, since only a subsequent copy needs
that HTML. For another, the complex selection case required a confusing
"two step copy" workflow, where first you press Ctrl-C, then you
download the large selection, finally you press Ctrl-C again.
The underlying problem is the same: the document.execCommand() API for
copy (and cut) is synchronous, but network operations are async, which
don't play well together.
Fix the problem by trying to use navigator.clipboard.write() instead:
the write() call still has to happen inside a magic security context
(keyboard used, click happened), but it can take a callback as a
parameter, and inside that callback it's fine to perform async network
operations, which allows both using a one-step copy and getting rid of
the HTML download on text selection change (when most of the time we
don't need it).
Tested:
- Chrome and Safari; the behavior for Firefox is unchanged, unless
about:config opts in to expose the new Clipboard API.
- HTML, plain text and image copy.
- Cut, not only copy.
- Doing this with the notebookbar button & keyboard.
- A single cypress test now uses a fake clipboard to assert copy. The
rest of the tests are left unchanged for now, but likely we need to
get rid of this implicit assumption that the copy container is updated
on selection change: different behavior for automated vs manual testing
is ugly.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ifcf16474a339f3f1dae3dc99181836e645340048
- fix typo in cypress function name
- unify mobile and desktop searchbar controls
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2212f588ca720634b073111b1c78f10c6ee6b7ea
- it failed due to click on disabled button
- make waiting for idle click be aware of that
- add small waits after doing table changes to
allow updates to be applied
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: If19352923aeca4c18024f3a2ffcc3731a8aff96f
so we will not fail with some themes used
also not fail when we didn't show sidebar switch
on the toolbar
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Id511004176dcf91b553417a74cb3b71c239873eb
- reuse old code as much as possible
- font, fontsize, style are managed by old select2 wrapper
- move some commands to dispatcher
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2fd1820b36f3c63a5fdcc482afbcc5ffe04e299f
- move plain html controls into HTMLContent widget
- reuse scrollable bar from notebookbar
- use dynamically loaded menu entries in MenuButton
- allow to update MenuButton which contains menu id in the id
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2b77479520c03420fefeb32dd09d6b34279e5686
The core commit 'show cell cursor on in place editing' introduced a
regression: cell cursor messages grabs focus from the formula bar when
used for editing. The regression was causing the failure of
desktop/calc/focus_spec.js cypress unit test.
Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: If4274cc510af065feb7aa13806a86746302b22b2
On switching tab not clear other view messages saved for replay.
Added cypress unit tests for checking the cell view cursor bounds.
Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I788828783a86038bb9d7f26648925b0e03bd560a
Replace four helper functions (insertMultipleComment setupUIforCommentInsert
createComment saveComment) with one (insertComment)
Simplify code flow
Remove unneeded docType conditionals
Remove unneded identical arguments from every call
Add more relevant assertions
Use force click to remove extra toolbar clicks
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ia4bc4ac964fd0ee754a481843d55682b87b63086
Finally, a robust solution for checking sheet contents
Uses .should() to make a retriable assertion, subject to normal
timeouts and with no need to wait before.
Fixes sporadic failures in desktop/calc/autofilter_spec.js
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I9c4e36b3bcdf0968e9b95237f3f17f284d2628de
- it is on the left below slides list
- handle disabled state in CSS for regular unotoolbuttons
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iebff6e7db0234a4f61c532397bab697c1071595d
- SheetsBar is on the bottom in Calc, with buttons + tabs
- add callabck for edit field - only fired after ENTER
this fixes issue from FormulaBar conversion to JSDialog
- fix cypress mobile
- simplify CSS
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7a286c87564e5ee0a89055ab4faa4daef9af31f5
Comment Undo-Redo:
AssertionError: Timed out retrying after 10000ms: expected '<div#comment-container-2.cool-annotation.cool-annotation-collapsed-show>' to have class 'tracked-deleted-comment-show'
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iae9361e5189ec8795a6dc6e0ac83cc99d653a538
Merge cells:
AssertionError: Timed out retrying after 10000ms: Expected to find element: `#copy-paste-container table td`, but never found it. Queried from:
> cy.get(#coolframe, [object Object]).its(0.contentDocument, [object Object])
at Context.eval (integration_tests/mobile/calc/bottom_toolbar_spec.js:74:50)
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I8ecca00d9a1c5cc35949b4b6f875092b487d60c4
Test failed in 23.05 because of a change in .leaflet-marker-icon
Rewrite openContextMenu and remove uses of .leaflet-marker-icon
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Iecfacdd192ea723001ed56e6c9f0c32645a6af2c
Partial revert of commit aa259d7337.
Also make idle tests run before multiuser
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I87024193d81bcadc9ea77e9033dceb3c6250d966
Add a cypress test for the change in commit dfe1e1b5
Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: Id829d271efe7ccebf58c9f83cc67e6b1cf8b72e9
Wait for formula bar buttons before typing
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I0603fee2acd7ba3090f7b8536a5e5d6f18a52179
- reuse MenuButton as base for colorControl
- add only last color indicator and activation on left side button
- make possible to clreate split button from unotoolbutton
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I8cd20149cc5bc25bedf4e0b0c56fc93d53339f4b
so we will check desktop only which can pass
This change should be reverted after we fix problems
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Id34bf6446c7ea56fc8dd8ddf750abafd693c0aa1
It fails on triggerNewSVGForShapeInTheCenter()
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2693ea645a4103ecfd51db0405022764a0130d5a
Timed out retrying after 10050ms: `cy.click()` failed because this element: `<td id="tb_editbar_item_sidebar" style="" class="" valign="middle" title="Sidebar">...</td>`
is being covered by another element:
`<div class="w2ui-scroll-right" onmousedown="event.preventDefault()" onclick="var el=w2ui['editbar']; if (el) el.scroll('right');" style="display: block;"></div>`
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ifa8aa4e9229c3c909b7f118c008904a78d0cd38b
Currently the current selection is always requested as HTML by the
browser, and then we ask the browser to convert it to plain text.
The problem is that e.g. Writer can produce much better plain text from
its model, compared to the plain text by the browser, e.g. bullet
characters for bullet points.
Fix the problem by:
- CanvasTileLayer.js, _onTextSelectionMsg(): requesting both HTML and
plain text. Use ',' as a separator, as that's already established,
e.g. the HTTP Accept header does that already
- Switching the textselectioncontent protocol message from just HTML to
JSON that contains both HTML and plain text. This is produced in
ChildSession::getTextSelection() and parsed in CanvasTileLayer.js,
_onMessage()
- Clipboard.js, setTextSelectionHTML(): allowing setting both HTML and
plain text.
- ClientSession::postProcessCopyPayload(): knowing if the content to be
processed is HTML-in-JSON or just HTML, do additional escaping in the
JSON / textselectioncontent case, but leave the other clipboardcontent
case unchanged.
So far this only handles the simple case, the behavior for complex
selections are left unchanged for now. The payload is also unchanged
when a single format is requested, as many tests depend on test.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I2fe1378a8d50b7901ac9e808eb78858cd8ff8575
There are now two .avatar-img elements after recent user list changes
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ia229422b4dc3e90ede240e36927b4615091cb97d
it was introduced in 13bc532
and it was removed from use in 2f77b3a
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Iec401a9505491fe69196cdb1e7192fa499d3d38f
This will be a class for storing keyboard shortcuts in
a unified way. We can easily define shortcuts for different
languages so we don't have to write long if-statements
which can cause problems if done not very carefully.
Added tests protecting from regressions.
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I4dfa2d757eab4ecc1f21279e68d1ee97ae261dc5
Protect us from regressions.
We had issues with jumping view in calc, it was related to
switching tabs (not all was visible in the UI).
One case was repeated selection of the same tab.
Second one was using a keyboard shortcut to select multiple
sheets (ctrl + shift + page up/down).
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Icda723ee51b1a4aa8876208d52b4739ca380bb78
Previously used combobox dropdown is online-only so it
will not block editing.
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: If6bc092e8bc32ef78c63e8e7cf76922682bc0f19
- it should cover cases like all pop dialogs should be closed for idle mode
- cell should be editable after we re-activate the screen
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: I34c681ebffdc0107f8787ddc0ad16e5fa35c2f0c
Close confirm overwrite dialog after pressing insert
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I4dacb731c70b1bfd9bcbc2134f6e3cd7e242d468
Exact positions have changed between core 23.05 and core 24.04.
Allowed for a range because failures report different positions
on different machines.
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Iec8024a4e2c8d310748c3b9f52dcb9b325d1529b
Move selection from beforeAll to each testpoint
Remove clickOnIdle
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I1ef87e7df34319c4a1307695ffaa0011b6dbb4cd
Use force click on buttons instead of scrolling the statusbar to make
them visible
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ib6e7eadcfb02f47e7bd4b44c71f44387f0b19168
Use force click on buttons instead of scrolling the statusbar to make
them visible
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I58f9571dd31d775cadd586f49a545bbc2198471c
If the notebookbar's paste or paste special button is pressed and
Chrome's clipboard permisson popup is rejected, then nothing happened,
while Firefox case was showing a more helpful popup, explaining the
problem.
This has two sides: error handling should be better and also the error
should not happen in the first place. The error can also happen when the
<iframe> is not set up correctly, but that's to be handled on the
nextcloud side.
When there *is* an error, improve error handling by restoring the
codepath that matches Firefox:
- extract the rest of the code after invoking the async clipboard read
in _execCopyCutPaste() to a new _afterCopyCutPaste()
- paste case: invoke _afterCopyCutPaste() when the paste fails
- paste special case: only pretend we're in paste special mode if the
success fallback is called
- if the failure callback is called, then invoke
_openPasteSpecialPopup()
With this, the "has async clipboard, but the permission request
rejected" and the "don't have async clipboard" codepath matches.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I727f00a1cf94dd1837e15e60410e1798de5daecc