Commit graph

14868 commits

Author SHA1 Message Date
Ashod Nakashian
a8b50f5801 wsd: use http::Response in LOOLWSD file serving
Change-Id: Ia2d592e8b279f69f257d5b216e05de2437fa3d60
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
12c57cb1a0 wsd: use http::Response for LOOLWSD 400 errors
Change-Id: I22f9b78f1ed6500111697b6017b0e654f7b97def
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
e1c1927cc6 wsd: use http::Response for LOOLWSD 401 and 404 errors
Change-Id: I1500939d68db3f68954fcf522d20080420b37e14
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
84798e0b04 wsd: test: unit-http is part of group0
This was accidentally removed. However,
we do want to remove this grouping logic
so that the tests execute faster.
Unfortunately, without the grouping some
tests fail randomly. Specifically, UnitHTTP
had an implicit dependency on the jail temp
to be created before it ran, lest it failed.
This is now fixed in the previous commit,
which paves the way to removing the grouping.

Change-Id: If18f7faf8ed0677b718db48781b387c7b37d6b0b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
04c15755b0 wsd: create the temp directory root recursively
Without this, the conversion test in UnitHTTP
fails because the root of the temp directory
hasn't yet been created (mkdir actually fails,
since the root is missing).

This failure occures when UnitHTTP is executed
before other tests.

Change-Id: I9b5d9a48c8ab9735978ecfa2d29944e037cf794d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
7b7cc141dd leaflet: make: cleanup timestamp files
Change-Id: Ida77111d78b52653142f15c8866409cb573807bb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Pedro Pinto Silva
2a43da7a28 Gitignore: Add test/unithttplib to test list
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Id6c7f31343bb405e634a7d96521fe02adcc40c4c
2021-04-09 23:33:22 +05:30
Pranam Lashkari
1b7d34a815 leaflet: set mouse cursor on cursor show
This is absolutely necessary for impress,
if cursor visible state is not changed,
we do not add or remove the cursor,
which handles the mouse cursor

so we explicitly set mouse cursor

i.e: in impress try to edit in one text box,
now click on the text on another text box
the mouse cursor will be incorrectly set

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I6adda739dc26fb93857bf8dcf70348b07f8eab33
2021-04-09 22:46:41 +05:30
Pedro Pinto Silva
4fe8619a7a Impress: Fix #presentation-toolbar on chrome
- Make sure width doesn't get above the available space
- Do not force scrollbar when there is no content to scroll
  - use visible (default): implicitly compute to auto

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Ib7b6b15dcf093d6172a35346679a7985584f4ef9
2021-04-09 12:27:12 +02:00
Pranam Lashkari
a2757f3a47 loolwsd: after comment operation update status
send status after performing any comment operation,
updating status send page dimensions,
which help in canvas layer to resize actual page size
without updating page size comments may go out of view
and will also not be scrollable into view

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I489648bb5ccd7223746fea42050088e078046a1a
2021-04-09 09:56:13 +02:00
Tor Lillqvist
435ec0941f Add "Delete" to the context menu for graphic selection in the mobile apps, too
This should fix https://github.com/CollaboraOnline/online/issues/1751

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I2f61c43b310a32f5b5d883610b169d2ab47d554d
2021-04-08 16:36:29 +03:00
Dennis Francis
fe2783af07 fix: tiles not rendered on calls from setZoom()
where we set "zoomChanged". So we should have another state variable
waitForTiles to wait for tiles instead of re-using zoomChanged.

Conflicts:
	loleaflet/src/layer/tile/CanvasTileLayer.js

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I3bd71fb97694a56be5f49a9e7b7ac7b9c49caa88
(cherry picked from commit c9d6d9f569fcee3516a55d3f3a8719b7338687a4)
2021-04-08 17:35:53 +05:30
Dennis Francis
47bc41d734 avoid vscode errors in tsconfig.json...
by moving allowJs and checkJs out of tsconfig as vscode assumes default
outDir and rootDir which we can set only via cli call to tsc as they are
makefile configurables.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I3ba3bc98018c6d738c8767ff9f4affc3c33602c3
2021-04-08 14:05:54 +05:30
Dennis Francis
c6f2e2211d typescript: do project level compilation for ts files in src/
There may be warnings on first run after application of this patch due
to ts->js files present src/ due to previous per file compilation.
Cleaning those files will get rid of the warnings.  These are removed
from .gitignore files to avoid confusion.

Now we rely on tsc to do the incremental builds so it is much faster.
Checking of js files is disabled for now as it reports a lot of type
errors.

Caveat: Compilation of mocha tests, admin (those outside src/) are still
using the file by file compilation.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ic22b265de0b111165224885c4736486fffa016d8
2021-04-08 14:05:54 +05:30
Dennis Francis
d2780e9317 update typescript version
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I539b23b9006022b053e8c21484e6f200be66e25a
2021-04-08 14:05:54 +05:30
Tor Lillqvist
75a3ab02ca Add an iOS setting for the user's name or nickname
Used for comments added to documents by the user.

The setting, like templateListURL, can be set through a mobile device
management system.

There is no trivial way on iOS for an app to programmatically find out
the name of the user, and that is good from a privacy point of view.

Fixes https://github.com/CollaboraOnline/online/issues/1843

Change-Id: Ie68fcbacf886ec8f1c74021a71879b38d4180c15
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-04-08 00:37:05 +03:00
Yaron Shahrabani
aa670eb72c Translated using Weblate (Hebrew)
Currently translated at 61.6% (259 of 420 strings)

Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/help/he/
Translation: Collabora Online/Help
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I5099dd5ef414f8bcbc932ca237a39313aeca766a
2021-04-07 19:50:47 +02:00
Ashod Nakashian
0459ca4a1e wsd: test: convert cerr to proper logging in UnitHTTP
Change-Id: I0fc59375d92a0947f7e3478438f4d6b30c7bde65
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
050e142260 killpoco: use http::Request in UnitHosting
Change-Id: I6ac23d18496735994b4059923a667cdce07c4db5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
e6579d39ea wsd: set http 'Connection: close' header before disconnecting
Per the RFC, the server must set the 'Connection'
header to 'close' to signify that the current
request is the last.

With this patch, we now properly notify all the
clients when we do not intend on resuming communication.
Although, technically, there is no reason why we
shouldn't allow the client to reuse the connection,
we may consider that in the future.

See https://tools.ietf.org/html/rfc7230#section-6.3

Change-Id: Ic6250c0afe8124314a9122452040f6a75728a525
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
bc7b36e904 wsd: log the inBuffer size not the outBuffer
Change-Id: Id8f75576bbf44d881338cd03b2ae7f30f4d092ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
d9fa64b4a0 wsd: http: support http Connection: close header
According to the RFC, HTTP/1.1 assumes persistent
connection unless the client or server sends
'Connection: close' header. See
https://tools.ietf.org/html/rfc7230#section-6.3

Now we fully support disconnecting when we
get this header, which is important for when
reusing the same http::Session (we need to
reconnect in such a case).

Change-Id: Ib278eff21be32c1414478296e90e2e807ab24132
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
4b43b3cd6e wsd: http: set the port in the Host header entry
Change-Id: I2d46c1ef3b72e21ce8924dcf7616cd26fb5bc98d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
94325c8319 killpoco: use http::Request in HTTPServerTest
Change-Id: I6e0afedf971dc6a5e4d4396ea9ab9fbcb96aa858
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
41275f0423 wsd: http: new syncRequest with timeout and new helper
Change-Id: I64a5d6f0984b9f35fe0224683527d80cf77fff99
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
9d5f8fc73e wsd: http: improved parseUri and new parseUrl with tests
Change-Id: Icee821ab6176d17e08bfc6bc581eaf4b3986da60
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
2bb07adb54 wsd: http: simplify syncRequest to return Response
Since the return value of syncRequest and syncDownload
was derived from Response anyway, there is no reason
to have multiple values for callers to look at.

This simplifies the API.

Change-Id: I0f136e515dd0ef6eda84f6a7cd662b260809d2f1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
8aa329c17d wsd: http: default Session timeout is now public
Change-Id: I34376a68a130ccb0d36f04b90ff26af1a1535873
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
45b15803ad wsd: http: use std::move
Change-Id: I3c287b96ccce5f8b3cb245c065922a9c35df5bf7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
29b4866dcd killpoco: use http::Request in UnitHosting
Change-Id: I4455ad24d9ac3c2e2d6f22f402649b187ef2ff23
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
455a71ab9c wsd: test: http: more parseUri tests
Change-Id: I85fc927a0d27bb774570ff8d04c009d02ca6cd83
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
fb6e7793ff wsd: http: use parseUri
Change-Id: I5c1e95acb30509f2b1865da31a8a0e622a94c4e3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
49a13798eb wsd: http: parse the host and validate
Change-Id: I3ad1bcf51d59295e411a949a714bb680ff789f34
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
6f8b6057b1 wsd: http: use std::move where sensible
Change-Id: Ie1c880224822f8c0b2db0e58dd83693335fbfd1f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
9a2acf2558 wsd: test: better loggin in UnitCopyPaste
Change-Id: Idf684249b87b9b73d21fd6ee101364bf49ae7a5d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
f74234a354 wsd: test: log before asserting
Change-Id: Ic6769159a5f91bd59ccca578f1e80a880b6de344
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
885b5ab0b7 wsd: test new unit-httplib test for http tests
Change-Id: Id22a83620a2ef6543d27f7426d79d78d093168ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Gökay Şatır
84e003fdd6 Calc: Filter with split panes improvement.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I866edb95f55d8b16a6ce3ba4e0cb4bbaa79e182d
2021-04-07 11:38:50 +03:00
Dennis Francis
40ff6989fe lint typescript files too
Fix some issues it found and disable the following checks for now. Some
of them needs module support to work and some of them needs project
compilation using tsc rather than per file compilation.

cypress_test/ extends loleaflet's eslintrc so, its package.json needs to
have the typescript lint plugin as well.

Disabled checks:

@typescript-eslint/no-unused-vars // This can be enabled after fixing
all places it finds.

@typescript-eslint/no-inferrable-types // Lets do explicit typing
whenever we can.

no-var  // This needs a lot of conversion of var to let.

@typescript-eslint/no-explicit-any

@typescript-eslint/no-namespace // ES5 has no module support

no-inner-declarations // ,,

no-constant-condition // This is sometimes useful

@typescript-eslint/triple-slash-reference // ES5 no module support.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ib4fd8b4fcee42216d4322fd043a1873302db375a
2021-04-07 14:03:42 +05:30
Dennis Francis
ac6ba02ade test: calc has 0-alpha empty tiles which are not black
A black tile pixel is 0xff000000 (alpha channel must be 255) should not
be confused with empty Calc tile pixels whose alpha is 0. This is true
since we disabled grid+background painting in core and do it in client
canvas.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I94eac4748f28a4d9a01c4a3b73b71f2ce7efc5ea
2021-04-07 13:59:06 +05:30
Dennis Francis
4b2a6b98e8 fix: grid lines spill to adjacent tile area
Ensure grid lines drawn for specified area confines to that.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I9b294db3e9cdf4721717b695aead35bce5333c08
2021-04-07 13:59:06 +05:30
Dennis Francis
3ec3af8707 client-side-grid: disable core grid and bg
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ib8fdba0ea3f8ddca761f9e0d8c56773e86b5e2f4
2021-04-07 13:59:06 +05:30
Dennis Francis
1e2001db3a client-side-grid: force white canvas bg for Calc
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ia84d5ab66b3a7b06b4874193479b585a9f11c464
2021-04-07 13:59:06 +05:30
Miklos Vajna
f38e0db765 test helpers: fix -Werror,-Wreturn-type
./test/helpers.hpp:211:1: error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type]

Perhaps it could go further and even call LOK_ASSERT_FAIL().

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I4f68f6d290bcb0a832ea71153d5f699d5366def9
2021-04-07 10:27:07 +02:00
Pedro Pinto Silva
3a87f57ede Loleaflet: postmessage-api: update documentation
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I9af5dc9d20fe90b4a9b289d214c7209adf606ea0
2021-04-07 09:42:55 +02:00
Pedro Pinto Silva
8239f80309 WSD: Update documentation, add new url
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I50f9efbc2bac3ab30e56424f4dfb4cd8d09f79ea
2021-04-07 09:42:55 +02:00
Tor Lillqvist
f60f3945d9 Add some more source files for breakpointing convenience
Change-Id: Iba566d62bb65e7b63d8125710fc1371de5df02fc
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-04-06 22:17:35 +02:00
Szymon Kłos
1219851b0d notebookbar: disable change tracking in calc
Change-Id: Ib510f00666f4bf5af9d7780327b9f97c0f8964bd
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-04-06 16:33:21 +02:00
Szymon Kłos
781191bb85 Blinking cursor only when window is focused
use window instead of document.
now it works also in chrome.
always show curos on add.

Change-Id: Id58b8810fb6a8d5ba00369308cce1dd201b7340a
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-04-06 16:33:21 +02:00
Szymon Kłos
48d30fcf4a ObjectFocusDarkOverlay showing all pieces
When Points were created with floating point numbers
the overlay wasn't shown on the right side of the chart.

Change-Id: I069927c5e6a97a7155878bdd8f4645b11dbe8493
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-04-06 16:33:21 +02:00