Commit graph

23529 commits

Author SHA1 Message Date
Neil Guertin
e70143b09f Cypress calc helper: make assertDataClipboardTable retriable
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
2024-03-25 09:31:20 -04:00
Skyler Grey
397c14841a Scroll: Cleanup dead code
Some code in this file is unused. In particular, the conditions to
fulfill touch scrolling will never be met since
I9016fc15ad3ccb3664af348fdcdca006495b0778, and the _performScroll
handler is never called. Let's delete it!

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Id34380f09300935dcb74435d8d94104d235f6f21
2024-03-25 11:24:26 +00:00
Skyler Grey
de4d4c6e18 ScrollSection: fix panning with RTL
Previously we did not take into account whether something was RTL when
scrolling it with ScrollSection. By introduing a new isRTL function to
check this, we can do something different (in this case scrolling the
other direction) if we are controlling an element that should be RTL.

We need to introduce a function, as whether we are using RTL can change
over the lifetime of the ScrollSection

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: If4261a3e32375f6127241b846b97a3b4ac29eb0b
2024-03-25 11:24:26 +00:00
Skyler Grey
0a134f2a7a Draggable, TouchGesture: Fix panning with RTL
Previously when we were in RTL mode panning would be flipped. This
commit unflips it

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Iea4d16918b054d355e6d8695e0dc1d6ededd6793
2024-03-25 11:24:26 +00:00
Szymon Kłos
ae5e33b30c remove-w2ui: convert presentation toolbar to JSDialogs
- 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
2024-03-25 10:48:46 +01:00
Michael Meeks
fd77301ebb polls: switch compiled in delays to 60 seconds.
Forkit forking children is done in response to socket messages,
and parent process death should kill us too.

In general if we are relying on a poll to spin to achieve
something, we have a performance bug; this should exacerbate them
to flush them out.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I60d1c3b3c2532bbd686a3d3cfdea10f2a541a19a
2024-03-25 08:18:35 +00:00
Michael Meeks
c3ff6af81d Cleanup waitForKitPidsReady.
In-line and specialize helper used just once.
Simplify code-flow, and reduce duplication.
Reduce duplicate logging.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I1ed68fdff5edfb10466d8bd13e88e5d2a5a71a63
2024-03-25 08:18:35 +00:00
Michael Meeks
005ba1567e PrisonerPoll - leave unused Kit sockets in the poll.
This lets us detect when Kit processes die without waiting for
the poll() timeout and feebly spinning the PrisonerPoll loop.

Instead we get notified immediately; but to do this we then need
to be able to safely transfer the socket between SocketPolls.

SocketPoll's should own Sockets - so by switching ChildProcess to
use a weak_ptr and also the NewChildren list - we can have standard
ownership and a sensible transfer between SocketPolls. A Socket is
owned either by PrisonerPoll or a DocumentBroker in the normal way.

Clean the NewChildren list as/when children are unexpectedly killed
apparently there are still some ownership issues probably around
the strong ChildProcess _ws pointer.

Change-Id: Ie541a9d03e36aee53fd57c45953e0de21ebe1828
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-03-25 08:18:35 +00:00
Michael Meeks
31f1ce360a crash test - cope with more complexity around re-starting.
With faster starting spare kits we can end up waiting for a state
where there are no live or spare kits, but the spare kit has already
beaten us to the punch:

[testCrashKit] (+1124ms): Killing coolkit instances.| httpcrashtest.cpp:151
[killPid] (+1124ms): Killing 1650047| httpcrashtest.cpp:257
[killPid] (+1124ms): Killing 1650071| httpcrashtest.cpp:257
[waitForKitProcessCount] (+1124ms): Waiting for kit process count: Doc Kits: 0  Spare Kits: 0 | KitPidHelpers.cpp:70
[waitForKitProcessCount] (+1124ms): Current kit processes: Doc Kits: [1650047, ] Spare Kits: [1650071, ]| KitPidHelpers.cpp:80
...
Forking a coolkit process with jailId: 09X67pOy1HAgSk9G as spare coolkit #5.| kit/ForKit.cpp:406
...
[waitForKitProcessCount] (+1558ms): Current kit processes: Doc Kits: [] Spare Kits: [1650083, ]| KitPidHelpers.cpp:94
... fail ...

Avoid this by intersecting before & after to ensure are all before are
dead.

Cleanup exposing the more problematic wait-for-zero-spare method.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I6f0ba87139b58f9bf1770ebbc5cac95b5063679e
2024-03-25 08:18:35 +00:00
Szymon Kłos
5355042687 remove-w2ui: convert sheets toolbar to JSDialog
- 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
2024-03-23 18:46:16 +01:00
Szymon Kłos
8777d33f34 dispatcher: fix print action
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ia92483fa900bde5b05383f72199b820a2b178c10
2024-03-23 18:46:16 +01:00
Gökay Şatır
c402ecd41a Introduce docdispatcher.js.
In order to handle commands in a more structured way.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: If7e2aed089cda1df59b2bf2b454b540d36391df0
2024-03-23 18:46:16 +01:00
Gökay Şatır
f44e0e0e3c Make use of shortcutDescriptors more.
In order to simplify keypress handling.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I2c5cfce5cb97ca8bbbbc28368deae708060bfbcc
2024-03-23 18:46:16 +01:00
Gökay Şatır
fadaa38985 Move the shortcut handler upper in the handler function.
To distinguish it from the local variables that it's not using.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I1d1fe3a6506afd43cbfc8b1084a4d321f5d743d1
2024-03-23 18:46:16 +01:00
Gökay Şatır
10786103b1 Merge cmd into ctrl.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ie242d77bb3af20558d71cb0139d92ff069a8e794
2024-03-23 18:46:16 +01:00
Ashod Nakashian
5880312981 wsd: fix support-key build
Change-Id: Ib59494884333a200d768eec8b829e565f6470e2a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-23 09:47:44 +10:30
Skyler Grey
391d68fc61 userlist: Stop hiding images if load failed
Previously there was no dark mode user SVG, which led to a failed load.

Additionally, we were using L.LOUtil.checkIfImageExists which sometimes
hides the image if it is unable to substitute it for a light mode one.
This caused the layout to fail as avatars were required to properly
space everything else.

By changing this so we provide both a dark and light mode user image, we
can avoid using the function which problematically hides the images in
this case.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: I16172a4d3148390896e3d475b7810598d94ceb27
2024-03-22 15:49:00 +01:00
Skyler Grey
0163b4498e following-ui: dark: Make borders and text visible
Previously the borders and text of the following chip were hardcoded to
be black, but this doesn't work excellently in dark mode. Using the css
variable will make the text and user border always be a color that can
be read.

It may be sensible for us to also change the pool of following border
colors as they are all very dark, but that can wait for a future PR.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Ia2dcdf24ae12f5d45f59ef7ba3c2ed8e4ab5acf4
2024-03-22 15:49:00 +01:00
Caolán McNamara
339e724ae6 make profiling script find all coolwsds
there might be coolwsds launched from another service which doesn't
match -u coolwsd, so use -t coolwsd instead to capture all of them

then their output might be interleaved, so switch to another log
format that retains the name[pid] and stable sort on that column
so we have all the matching lines for a name[pid] contiguous but
ordered within that by time. After the sort, cut to drop the
columns that are additional over the 'cat' format.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Id1d1c37001249ff348d6c09c005fb0836133258c
2024-03-22 13:16:59 +01:00
Szymon Kłos
f29a7c63df Skip failing writer/tracked_changes_spec.js for now
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
2024-03-22 13:10:31 +01:00
Szymon Kłos
1945c79169 Skip failing mobile/calc/bottom_toolbar_spec.js for now
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
2024-03-22 13:10:31 +01:00
Neil Guertin
c73cab4479 Fix failing test mobile/calc/spellchecking_spec.js (forward port)
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
2024-03-22 13:10:31 +01:00
Szymon Kłos
5359806efb Skip failing calc/focus_spec.js for now
This is a regression from the following change:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=8f7dd2340b7cc593f1abfea7fbdc22e2d7ec6324
https://gerrit.libreoffice.org/c/core/+/164880

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I8f01ffadf91cea8941d264f03bcc6b371a4a9248
2024-03-22 13:10:31 +01:00
Miklos Vajna
f9fe3c1880 Related: cool#8023 wsd, ClientSession: fix bogus <body> warning with plain text
E.g. unit-copy-paste emitted a warning like this:
wsd-1576653-1576734 2024-03-20 21:28:53.448488 +0000 [ docbroker_002 ] DBG  ToClient-005: Missing <body> ...

This is a real problem in case the clipboard has HTML, but it's fine
when the clipboard is just plain text.

Fix the noise by returning early when the body of the clipboardcontent
message contains just plain text.

This works because the body never starts with plain text when HTML is
also available: the JSON case is not an issue and the entire clipboard
dump lists HTML before plain text.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I1ff51249fb710e3a9c127917aae4178c22738668
2024-03-22 08:32:41 +01:00
Andras Timar
6686aaa01a Remove unused viamapi-client.js file
It was part of the removed Vereign document signing feature.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ibe8a31102eaefcfba1898ad2f31226c24e12f330
2024-03-21 10:09:29 +00:00
Ashod Nakashian
fe3c3bc135 wsd: test: move WebSocketSession under test
WebSocketSession is used exclusively for tests,
so it's best that it is located in the test
directory.

Change-Id: I88333d619902df7991c3f26b94ed309246446ae0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-21 09:08:51 +00:00
Pranam Lashkari
581ce772ee fixed js console error
problem:
in impress get into textbox editing and then try to drag and move text box,
you get js error because map is null

regression from 9cf64b0726

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I586c5f242241aa50f62c49371c994aeb7c370525
2024-03-21 13:58:03 +05:30
Darshan-upadhyay1110
868ba940aa accessebility: replace <span> tag with header tag in modal(js dialog) title
- The title of the modal window is currently marked with a <span> tag instead of an appropriate heading
tag (such as <h2> , <h3> , etc.).
 - This affects the semantic structure of the page and makes it difficult for
users with assistive technologies like screen readers to effectively navigate the page.
- The modal title is not recognized as such, which hinders orientation and understanding of the content.

- Solution:
    - replace <span> tag with <h2>(header tag) for `ui-dialog-title`.
    - to make font-size consistent added css rule for `ui-dialog-title`.

Note: this will change all js dialog title withg header tags ( not only specific to writer but also effeted for every document type)
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: I5a1e276c3a129400aa5834e186a263db95f01833
2024-03-21 10:59:42 +05:30
Szymon Kłos
5efe701294 Reenable cypress mobile tests
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
2024-03-20 08:46:49 -04:00
Neil Guertin
e7782149e1 Skip mobile/calc/cell_appearance_spec.js border test
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ife1faecf4471292f1aaddd98adc0b57329a8807d
2024-03-20 08:46:49 -04:00
Neil Guertin
4d4f999f24 Skip mobile/impress/apply_paragraph_props_text_spec.js
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I299ddd958e26c49746ce77f1a1e9fca383779ed3
2024-03-20 08:46:49 -04:00
Neil Guertin
42a36b9afb Fix mobile/impress/apply_font_text_spec.js
Exclude placeholder text
Fix removeShapeSelection detection

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ie8cfd791ae4468fa6994e3a49efe05577e7aae37
2024-03-20 08:46:49 -04:00
Neil Guertin
9e5f6c17dc Fix copy-plain-container in cypress tests
Container was showing in cypress mobile tests.
In Calc, this blocked clicks from reaching the top left cell.

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I7ceab551b7247962d9517f52560e6e03646511bf
2024-03-20 08:46:49 -04:00
Neil Guertin
83d8df81bd Fix mobile/writer/apply_font_spec.js FontColor tests
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I47ed365d9f3b3d884ea883aa0834e39f563feab3
2024-03-20 08:46:49 -04:00
Miklos Vajna
b14f3fffff cool#8465 clipboard: improve handling of plain text copy, complex case
In case the selection is complex (not simple), we used to just request
HTML, and then the browser converted that to plain text, which has the
downsides already mentioned in commit
7f9de46688 (cool#8465 clipboard: improve
handling of plain text copy, simple case, 2024-03-08).

Steps to support this:

1) Clipboard.js now asks for the text/html,text/plain;charset=utf-8 MIME
   types.

2) wsd: ClientRequestDispatcher::handleClipboardRequest() now maps this
   to DocumentBroker::CLIP_REQUEST_GET_HTML_PLAIN_ONLY

3) ClientSession::handleClipboardRequest() maps this to the HTML+plain
   text MIME type list.

4) kit: ChildSession::getClipboard() is now improved to take a list of
   MIME types, not just 1 or everything.

5) kit: ChildSession::getClipboard() now emits JSON in case not all, but
   multiple MIME types are requested.

6) wsd: ClientSession::postProcessCopyPayload() now knows how to
   postprocess clipboardcontent messages, which may or may not be JSON
   (it's JSON if more formats are requested explicitly, leaving the 1
   format or all format cases unchanged)

7) Control.DownloadProgress.js now handles the case when we get JSON and
   sets the core-provided plain text next to the HTML.

   Leave the handling of non-JSON case in, because this means we can
   copy from an old COOL server to a new one.

Note that this approach has the benefit that once the clipboard marker
is inserted, the length of the text/html format would change, which
means we can't parse the clipboard data till the marker is removed.
Emitting JSON for html+text means adding the marker keeps the ability to
parse the HTML and the plain text part of the clipboard in JS.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I67a1f669e8a638d34cc25a2f288a7b30884b9892
2024-03-20 10:21:59 +01:00
Jaume Pujantell
8921e19d84 reduce uses of MOBILEAPP on some files
Reduce the uses of MOBILEAPP conditionals by using the isMobileApp
function.

Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: If541307fbc457b342674cc560b6c53454f3904cf
2024-03-20 09:13:00 +01:00
Jaume Pujantell
3ba713aabf add isMobileApp util function to reduce ifdefs
Removed all MOBILEAPP preprocessor conditionals from Util.hpp/.cpp
Added isMobileApp function to help remove further conditionals.

Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: I038a4db47ec2a2c7bb10f5696df5571b13bd9a61
2024-03-20 09:13:00 +01:00
Ashod Nakashian
0241aa5aca wsd: use http::Response in FileServerRequestHandler::preprocessFile
Change-Id: I5afa5d8b56017568f02e7ed5cd6cb93df12d895e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
4387168d94 wsd: reuse the response in FileServer
This allows for setting common headers
only once and have it on all file
types and scenarios.

Change-Id: Ia9d67ac5dbf59dd6e22beea0b4ae162ccb846b33
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
a48917d052 killpoco: use http::Response in admin file serving
Change-Id: I9ad49002bc85071770aba08c23e0210bb10ff55b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
4dfb7ee312 killpoco: use http::Response for Admin metrics
Change-Id: I86eed98061bdb24d4bca8de452e4d4f925f27e93
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
882350ed70 wsd: remove sendWithDateAndAgent
The explicit header entries were needed
with Poco, but since we always set them
in our http::Response constructor, these
are redundant.

Change-Id: Ifde48fd3048018747dae3e84560b31960e511a25
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
7fb6ccf4ee wsd: remove duplicate Server and Date headers
We always create http::Response instances
with these headers. These explicit entries
are vestiges from Poco sockets.

Change-Id: I65c263e95b253e22e4e6deae57fffc5616311c84
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
00d483f67d wsd: minor cleanup of Admin::getLogLines
Change-Id: Ic238dcb7996c2967355366c062f0b94912d7adc7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
0a78d691ab wsd: parse config only once in Admin
Change-Id: I7b21f526145abd7f16eb4da8b2d4784798cf8b9b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
0ffdc19b3f wsd: simplify jwtToken extraction
Change-Id: I190817a0086d762bacfadac76b5edacbdf84dc12
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
727beabc94 wsd: simplify isAdminLoggedIn
Change-Id: I9ec2a585b2256882ee89ee6479a752735927e678
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
355dfdd58a wsd: add authenticateAdmin helper
Change-Id: I183ddef3378e19ce43845aa73804fe8c142e8e0e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
f034709b69 wsd: include cleanup
Change-Id: I9e63d673b25ac29f8070a81b35e5def96d6a165f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00
Ashod Nakashian
ccb29243c6 wsd: move stringifyBoolFromConfig to anonymous namespace
This is an internal helper and doesn't need
to pollute widely used headers, especially
that it pulls Poco headers with it.

Change-Id: I67a5aa64589d3f37141aff612f7fb807bb190d6f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-19 20:51:02 -04:00