Commit graph

16271 commits

Author SHA1 Message Date
Ashod Nakashian
6dec522a65 wsd: sanitizeURI from to RequestDetails
Change-Id: I8693bd6a36be4c67b62be4b5a997dd227460fbd1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-09-26 17:02:01 -04:00
Ashod Nakashian
347fd43f7c wsd: chunked transfer and tests
Change-Id: I07f7f126891f4d6b5137b45bf91cbcaa11796cda
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 866cb8f2f25e958f834adc51e2191fb60e2e85b9)
2021-09-26 17:02:01 -04:00
Ashod Nakashian
965e5cb37d wsd: verify that the last-editing-session can save
The last-editing-session could still be valid, but
waiting disconnection, in which case the kit might
have already discarded it, and so saving would
fail (silently, and thereby leaving docbroker
waiting for the save response).

To avoid this, we always validate the
last-editing-session before using, and not just
when setting it.

Change-Id: I60cd219d8e5a9945396110c8f8d194e87f81afba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit e1fc6adbfef7ee0678c7a563fd6142c32f2da4a6)
2021-09-26 17:02:01 -04:00
Ashod Nakashian
b82b18e8c9 wsd: autosave using the last editing session
Change-Id: I556b7b49b2d1abc0e61ea7ecaa8e5f9406c408f3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit b3738719a3b7301688faecfd721a97180eab0020)
2021-09-26 17:02:01 -04:00
Ashod Nakashian
ff1ff12663 wsd: each view handles its own url params
Change-Id: I0c6b9b86c970b1f45e7fa34d030f08c6f256d082
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit d4aa0a0f73eef5a90a14a2297f3050c1dba95a2d)
2021-09-26 17:02:01 -04:00
Ashod Nakashian
d395f521df wsd: log stopping-although-modified as warning
This log entry can be misleading on its own.
When shutting down, the modified flag is not reset,
and that in itself is not a cause for concern.
So this log entry is seen much more often than we
expect. If we truely fail to save/upload, there
will be other errors that will be the tell-tale
signs of a serious issue. So it's reasonable to
downgrade this error to a warning (and watch for
other errors).

Change-Id: Ic879c3fbac887ed5b64bdd1a31aa38bcfd863850
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 7db86b3eb2cdc2a44023e7b7491e1ee202146ef5)
2021-09-26 17:02:01 -04:00
Ashod Nakashian
f46b7e2232 leaflet: more accurate wording in comment
Change-Id: Ic4837a8304cece3b482a44f7e925d86e4c1ae8e2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-09-26 17:02:01 -04:00
Ashod Nakashian
2b95acb153 wsd: close the upload socket if exit-save
When we are uploading before exit we don't
want the upload socket to linger, because
that would keep the SocketPoll alive for
longer than necessary, holding up the DocBroker.
Instead, we flag the socket for closure, right
after that single request, via HTTP headers.

This allows for very fast unloading of the
DocBroker right after uploading.

Change-Id: I926763383093d2d2dfb10ed41293b1f5d54d090b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 4e132606d1849f82991c46d641c50794d632233c)
2021-09-26 17:02:01 -04:00
Ashod Nakashian
e3fa38a1d1 leaflet: better docunloading message to the user
Change-Id: I60ac82647a999cf24c694a9db824dfaaf6c44db3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 6b9cdc1c37b09b52332f470d8391492645063d8c)
2021-09-26 17:02:01 -04:00
Ashod Nakashian
9e5043db47 wsd: http: reason phrase is optional
Change-Id: I1bd402b26081a8ff35178c836a5eaa22fd47d033
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 0134e3329c8ea9cd6793fb125585e289b2082cf0)
2021-09-26 17:02:01 -04:00
Ashod Nakashian
0805eaf1bc loleaflet: Process the reconnection in _onSocketClose in a timeout.
We need to make sure that the message slurping processes the events
first, because there could have been a message like "close: idle" from
the server.

Without the timeout, we'd immediately reconnect, because the
"close: idle" was not processed yet by the message slurping.

Co-author: Jan Holesovsky <kendy@collabora.com>
Change-Id: Id3e27164fb00de69f661ba7580075b36100a03c1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit e4d65426ee816d5b49f11b4ea5e7c49e464015a3)
2021-09-26 17:02:01 -04:00
Ashod Nakashian
c4fb58df61 wsd: allow new views while unloading
Unloading duration depends on the time to save
and upload the document, during which a new view
might be opened. We now allow aborting the unloading
and resume reusing the document as-is.

Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 8f299eb2cdfe0ef869a8c90fbc602a93ba2fcb73)

Change-Id: I7bc485177929c0d1c9ef12b02672db493ac402c9
2021-09-26 17:02:01 -04:00
Ashod Nakashian
f6ff3caa8c leaflet: explanatory message when loading fails while unloading
Also, back-off the automatic load retrying exponentially.

It was 1s wait for 10 retries, now it's
.5, 2, 4.5, 8, 12.5, 18, 24.5, 32, 40.5 seconds, which
is more reasonable.

Change-Id: I7693b73327c5e09d7e90fd0cd0340fb9c14c3926
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit f207df5f04f45060157dcc7e944f1e3bd53fcb8a)
2021-09-26 17:02:01 -04:00
Andras Timar
30ef4a62d5 fix Lintian errors: binary-or-shlib-defines-rpath
E: loolwsd: binary-or-shlib-defines-rpath usr/bin/loolconvert /snap/loolwsd/current/usr/lib
E: loolwsd: binary-or-shlib-defines-rpath usr/bin/loolconvert /opt/poco/lib

These RPATHs are not needed when we statically link poco, as we do with production
packages.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I5050fe1f1925937388793d443020fdc6a14ec97d
2021-09-25 19:04:59 +02:00
Pedro Pinto Silva
fa08386379 Notebookbar: Set menu button without hardcoded px
Also avoid using flex (so smartmenu
to show and hide can still work)

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I002b0fc9c5cc0a20f8fa4f0d72757c4b6ffd9697
2021-09-24 11:25:58 +02:00
Pedro Pinto Silva
7c39eaaec2 Notebookbar: shortcutsbar: switch to flex for icon parents
And make sure to set h and v alignment

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I4d4efd179674200688b8b97bb19331a78bd1c393
2021-09-24 10:50:41 +02:00
Pedro Pinto Silva
b694edce3f Notebookbar: Adjust icons to follow the same color as its neighbors
undo and redo to be more consistent within the shortcutsbar

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Ic6323d87f9d9b9887b101579aa37af50283dd2f2
2021-09-24 10:50:41 +02:00
Pedro Pinto Silva
7db8cf5724 Notebookbar: Set menu button with an icon instead of building it from spans
This allows for:
- Better alignments
- Consistent use of hue across all icons from within shortcutsbar
- Consistent style

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Ie659f91786c0e90813c5a234a0cb6f484313ab92
2021-09-24 10:50:41 +02:00
Pedro Pinto Silva
acfa7f241f Notebookbar: Introduce modified status for the save icon
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: If7108796d46b96b82b4626a11cca5246979d11fa
2021-09-24 10:50:41 +02:00
Pedro Pinto Silva
9b7ae6e367 Notebookbar: unotoolbutton hover: remove duplicated rules and
do not use floating point number for pixels (in the hopes of
avoiding changing too much the parent dimensions) instead,
use box-shadow.

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I64e567ad015c842cd42905587eecb6f4e793c753
2021-09-24 10:50:41 +02:00
Pedro Pinto Silva
a407d0e0c8 Mobile: actionbar items: Fix misalignment and css
- Not all elements were uniformly spaced out
- CSS was not targeting properly all elements
- Remove the need to add manually every element by id
every time we add a new one (or change it)

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I6de930e351822c3477c26c8e6569c41975cee142
2021-09-24 09:33:53 +02:00
Andras Timar
dad92dee25 remove EULA from source code
... in order to avoid confusion. Binaries that Collabora compile, and
distribute are under a EULA. Source code is not.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I34c7e089a100b43e6b9c69ee566736a9ae0cb93c
2021-09-23 18:35:52 +02:00
Tor Lillqvist
6f6f756256 Add explanatory comment for the CFBundleShortVersionString
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I41e1ab374868b9f598c054914e29a1a751de1475
2021-09-23 16:07:21 +03:00
Szymon Kłos
8568f36371 sidebar: don't show empty on init
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iab30702bcb2aad8d7eaf1cf6e97f9c536cb4931f
2021-09-23 12:37:08 +02:00
Szymon Kłos
1ecc4e16a1 comments: don't open again on second selection
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I8c19264ea4564f0a9b67841a5adea392bb8a46ba
2021-09-23 11:08:17 +02:00
Pedro Pinto Silva
0586405ed6 Comments: collapsed annotations: Fix position
Display active annotation and do not overlap the remaining avatars

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Ie21d9b0f6abab8f5e19a2f2695f52f52750bf094
2021-09-23 11:08:17 +02:00
Pedro Pinto Silva
3c72cd0b53 Comments (collapsed): Fix cropped tooltips (more options menu)
Make sure tooltips appear aligned to the right inside of its
container

note: changing overflow property on the element
.lokdialog.ui-dialog-content does not solve it properly without
sacrificing the vertical scrollbar (even when targeting
x y separately)

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Iae6212993332aac374e87f49e0a1ef2db4005593
2021-09-23 11:08:17 +02:00
Pedro Pinto Silva
dbcbf0d5c1 Comments: Style popup and make sure annotations are not cards
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Ic5b5484ea793f301fa76f5c4bdfadbb2812d090c
2021-09-23 11:08:17 +02:00
Pedro Pinto Silva
bb8520167a Comments: Style reply count bubble
- Change color depending on the doc type or default to one of
our grays (css var)
- Adjust reply count bubble position so it's more up right
- Change shadows depending on its state (open vs closed)

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Ief0d3e2b0f10d4c0b04993bb648e3e5642d1131e
2021-09-23 11:08:17 +02:00
Pedro Pinto Silva
661abe8b84 Comments: Identify container as part of collapsed group
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I5db5c97977eb0b432fbdfd0824764e025cc3c5a1
2021-09-23 11:08:17 +02:00
Szymon Kłos
400f7ec916 comments: use vex insertion dialog when collapsed and fix cypress
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I134f3de1d16621e849fd414c634da717d3f8dc17
2021-09-23 11:08:17 +02:00
Szymon Kłos
0c44da74d3 comments: fix cypress
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I78e1855488f9c048c8f47357aeb29ab067c510b4
2021-09-23 11:08:17 +02:00
Szymon Kłos
25263297b8 comments: position MobileWizardPopup under annotation marker
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ic74fc6ece926647444941a483f097d54e09bf866
2021-09-23 11:08:17 +02:00
Szymon Kłos
af0f4d48d3 comments: fix collapsed comments in impress
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2f10fa45b52fd1890d6ebf91a622713ee22b51cf
2021-09-23 11:08:17 +02:00
Szymon Kłos
1e5403a347 comments: add reply count indicator
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I421b43675726b28bb911ea417e9726964d281828
2021-09-23 11:08:17 +02:00
Szymon Kłos
c6abdc1d35 comments: update MobileWizardPopup when modified comments
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ie9f87048d53b4a35e07b0b3fe65f6ad7678c994d
2021-09-23 11:08:17 +02:00
Szymon Kłos
fb0ebd41b4 comments: show icon next to MobileWizardPopup
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I59470f02e2848d813c2ff7a3f6f1c5ac86f398c7
2021-09-23 11:08:17 +02:00
Szymon Kłos
f17c8f67c6 comments: in collapsed mode show thread only
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I4ac78c37cd91d06560cd8f3f31f9ad6bb5ff3830
2021-09-23 11:08:17 +02:00
Szymon Kłos
af2523e6a8 comments: don't duplicate reply comment on mobile/tablet
Avoid adding draft reply to the commentList in comments list section.
This will prevent us from having draft and acctual comment in the list.
Only wait for a new comment ack from the server after replied.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I11cc7be90487ebe66d732d970a3e6612bf9a932d
2021-09-23 11:08:17 +02:00
Szymon Kłos
37de456782 comments: in collapsed mode show only root comments
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I31c1596b22891269cc298dd10fa6f47858ffc411
2021-09-23 11:08:17 +02:00
Szymon Kłos
bf5375beb0 Introduce MobileWizardPopup and use for comments
New container which builds the same structure as mobile-wizard.
It will be used in case of smaller screens on desktop and tablets.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I4631750963bb7daec2659b7af021a4b7bc55f033
2021-09-23 11:08:17 +02:00
Szymon Kłos
68b208ee14 comments: create new nodes in mobilewizard
Don't move original annotation nodes in DOM tree.
Instead create new copy od comment widget to use
in mobile-wizard.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I53683055657a68e4729860341f84adc7fa582d92
2021-09-23 11:08:17 +02:00
Szymon Kłos
91d6b87502 comments: collapse to icon when limited space
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iea57c5e4cfe0c3f6b427eacd3dc21db0d5256a10
2021-09-23 11:08:17 +02:00
Szymon Kłos
ed7bb6be76 canvas: add minSize and collapse/expand functionality
It is possible to provide minimal size requirement for section.
When there is less space for a given section other sections
will be collapsed if canCollapse property is set.

As an exaple: tile section should have minimum 800 px
and we collapse comments section if needed.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ie6f1a929834cf7275ca2e61d97be4292df01fa89
2021-09-23 11:08:17 +02:00
Andreas-Kainz
f4ec050090 Icon fix for closedocmobile it was to height at mobile insert menu
Signed-off-by: Andreas-Kainz <kainz.a@gmail.com>
Change-Id: I77491fe09090617123dd6db39b654511993befc7
2021-09-23 07:54:23 +02:00
Andreas-Kainz
ab67196956 Mobile Writer Graphic Context
Add Graphic commands when context is Graphic

Signed-off-by: Andreas-Kainz <kainz.a@gmail.com>
Change-Id: I9e8f66ec87d027666faa942b3ea4f83bb95a5205
2021-09-23 07:53:51 +02:00
Stavros kois
8a8af507fb Also add missing parameters
Signed-off-by: Stavros kois <s.kois@outlook.com>
Change-Id: I27f130dfbba25c2a357600c6cb0cd6903df4f3bf
2021-09-22 23:02:04 +02:00
Szymon Kłos
a5affc89db mobile: reset IgnorePanning on touch end
When we move marker we set IgnorePanning to true.
Unfortunately onUp handler is not called as Map.TouchGesture
overrides that event - so release variable there too.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I0e5a6bb05f54b12351a9deb770a052d7a0f89187
2021-09-22 20:31:35 +02:00
Szymon Kłos
e276e0f52c mobile: don't trigger keyboard hiding when panning
On mobile when keyboard is shown and user starts panning
keyboard shouldn't be hidden - it caused view to flicker
and keyboard was shown after short time again

Instead we want to keep keyboar with the same state as
before panning.

This change also fixes broken comparison between point and number
to detect map height resizing.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ib7b1402f84d88a3a63ffa7e8314d5ec2dc1565ff
2021-09-22 20:31:35 +02:00
Szymon Kłos
78f68fa7ef Cleanup in Unit* subclasses
- we cannot get rid of UnitBase::get() which returns the last
  set Unit class because we use it for example in WebSocketHandler
  where we don't know which kind of test we run

- free memory correctly and reset global variables for subclasses

- setup _type member variable on construction

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ic61b88785bff7de63b11ce2046eecc993c3ddeaf
2021-09-22 20:31:35 +02:00