Commit graph

23456 commits

Author SHA1 Message Date
Szymon Kłos
cff5442244 jsdialog: enable snackbar on mobile
So far we had duplicated snackbar code.
Desktop version was more advanced, mobile wasn't updated.
Mobile one used mobile-wizard as a base so we had to hide
currently presented menu to show small piece of information.

Let's use desktop snackbar on mobile as well. We will be able to
remove old code path from mobile later.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I1da7a6b75591913ca0fc66f6d0e81d136c874f62
2024-04-04 13:43:35 +02:00
Szymon Kłos
912258fe3e jsdialog: enable dropdowns on mobile
Let's allow usage of JSDialog component previously
used on desktop and tablet only - in some cases on mobile.

This case are dropdowns which we do not want to show
as separate mobile wizard screen (eg. alignment selector
from toolbar).

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ibcfaea457c065c34644738c7bf56a2e4e53c50a3
2024-04-04 13:43:35 +02:00
Szymon Kłos
c2a0d50839 jsdialog: create separate Util.MessageRouter
So we can type our messages, callbacks and better manage
where message is sent

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I3290f5cf9bc08669353d3e71785baffc6fb07003
2024-04-04 13:43:35 +02:00
Szymon Kłos
84e7eb7d03 jsdialog: reduce missing icon warnings
If MenuButton has custom menu defined it should
use original data.id as a command to avoid warnings
about missing icon with "-menu" suffix.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I06dfcdb0412c7d087f4002cdfff83f8157c3f237
2024-04-04 13:43:35 +02:00
Szymon Kłos
46a5b063b7 remove-w2ui: delete library's JS file
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ib279379168d86227b2abf2c979d302c5156fc7f2
2024-04-04 13:43:35 +02:00
Szymon Kłos
72fece4cd1 Add separate mobile commands in docdispatcher
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I6d83f0f5fbd0e373bd28129f8e444795068e3720
2024-04-04 13:43:35 +02:00
Michael Meeks
fd635e4d69 SocketPoll: better re-entrancy protection.
Remove toErase list; instead null socket pointers earlier
to make things more deterministic.

Simplify toErase path, by just removing null sockets.

Check _socketPoll array bounds to cope with a re-entrant
mutation - imperfect; but the fd comparison will help.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I27d81358a7d80b939b50ce4ccb1b2178a091a360
2024-04-04 07:16:53 -04:00
Gökay Şatır
cd014a92c2 Add simple geometry classes.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ic1819ff187edc9c0d33f77b3b82054cb8b27c6dc
2024-04-04 13:05:04 +03:00
Michael Meeks
9ba05ccbe6 Reduce C++ requirement.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I640230950cabd93bf12c86750f6aa6c95eb05021
2024-04-03 22:38:08 +01:00
codewithvk
5a90127236 fix : Present in the window button hides only for mobile apps
Signed-off-by: codewithvk <vivek.javiya@collabora.com>
Change-Id: I8b2824f6a17091d1a5202051cc95b6a53013f0cf
2024-04-03 13:38:36 +00:00
Ashod Nakashian
958f4b0f55 wsd: merge downloadAdvance with download
Change-Id: I0f9ad626c78e81896e42f5a431b0f209a77f563a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
64b4339e00 wsd: pass uriPublic explicitly to download()
Change-Id: I7c333c83598c2a4847efcd96cd59bc595cdae49f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
25d10bf490 wsd: simpler downloadAdvance interface
Change-Id: Ibd8ba73b2f4e926cc078e66f53766ee99478f9d4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
72c368ea0e wsd: refactor the download logic in DocumentBroker
Change-Id: Ic916a8373664f2b4de8d8649bf160effb1fe3dfa
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
b2c980a91a wsd: refactor setting wopiInfo into the session
Change-Id: Id2850c43843cbb418e7c188efcd6d2e6bf652165
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
deb60c095d wsd: simplify uriPublic in DocumentBroker::download()
Change-Id: I5ca31e08716db4c0a47a952b89e6529b330b6370
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
e9591cfa25 wsd: pass uriPublic explicitly to downloadAdvance
Change-Id: I0ac6f32894ada50be59e9801b68a1918affd6a9e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
ac589f5563 wsd: formatting
Change-Id: I365121f2ccfc1bf1f73f4f8e41a8d84e920da1ce
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
577c1fb0d3 wsd: refactor the plugin processing
This reduces code duplication and makes
the code more readable by extracting
the huge block that processes plugins.

Change-Id: I2dc243173a4122ae1d5fc5b3fa2b40daff9664e4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
04526159df wsd: minor formatting
Change-Id: Ibe9d9d946fc9aba1b2ac754ef952dc6adda47961
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
96bfccd5ae wsd: remove MOBILEAPP for parsing CheckFileInfo json
Change-Id: I72b916d9ed9266afca21934278f8d01c1d97928e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
84fd030707 wsd: DocBroker with wopiFileInfo
Change-Id: I32c7be67a191df063f97d3c5d7f20ba2a57256da
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
ec2e9ccdc3 wsd: CheckFileInfo parses the JSON response
Change-Id: I5a9cd984930c6312de9088acd39b83acf1c07eb9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
4c19afdd01 wsd: capture the file size in StorageBase::FileInfo
Change-Id: I842c730a51cbb336e108f26e717a17b12f12eb49
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
de985834e2 wsd: simplify DocumentBroker construction
Change-Id: I5e908f0f5aed9146e14175eb79335fe9c80db2f2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
062574341f wsd: move wopi stub/dummy interface to MobileApp.hpp
Change-Id: I58ac7467c4e74059e4de08c914546614ed6fe883
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
9782e3eea9 wsd: more accurate load error message
Since we have a more accurate reason
for failing to load, that's what we
should always return.

Change-Id: If9d38cf6de6d41310ba94857efcd073e3f4ef8b7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
21c3b4d3ed wsd: merge single-use findOrCreateDocBroker overload
Change-Id: Ib8087891d793effa3192b4a2b893733eec275f40
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
8e14087ef1 wsd: Support ahead-of-time document loading
Change-Id: Ia1cc7e42f7eea530097a37cce723b8833b998357
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
6bed4e631b wsd: create DocBroker once CheckFileInfo clears
Change-Id: Ie38070b9e8bddd7d546070a00c8bf3779f6e8cf4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
708e4a7746 wsd: uninitialized member
Change-Id: I2eefc58eb0105999277114c70c2b17bf3a615ccd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
034ea8b290 wsd: structured binding in findOrCreateDocBroker
Change-Id: I3387ff00cf11d848bbd24d490f879a17471d7f7c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
f38f5edd7d wsd: move overloaded findOrCreateDocBroker to RVS
Change-Id: I6a35a49ef3631769c4c38f8c63f86ce3e51aa695
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
9148996509 wsd: simplify findOrCreateDocBroker call
Change-Id: I8765b887d6fde34bdbb8ff361af6636d494f2ddd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Ashod Nakashian
042e4366ef wsd: cosmetics
Change-Id: Ib5fd54abcda44ce8c62171cbbf8c51ffcd530344
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-03 14:26:28 +01:00
Pranam Lashkari
f29fe2a197 kit: set creation date when online creates file from template
problem:
when online created file using WOPI clients, creation dates were never set.
in online files are created using templates, even empty files are created using
an empty template

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I312d7af17bf322ca55b6e20bba344e4fc6628e66
2024-04-03 13:26:24 +01:00
codewithvk
c0ab567b31 Added additional menu entries and a new sub-entry under Conditional formatting
- Added 'Contains text...' and 'Duplicate...' as menu entries under Conditional > Condition...
- Introduced a new sub-entry Top/Bottom Rules' under Conditional, with the following options:
    - Top n elements
    - Top n% (n percent)
    - Bottom n elements
    - Bottom n% (n percent)
    - Above Average
    - Below Average

These changes enhance the functionality of the Conditional formatting menu by incorporating commonly used options for users.

Signed-off-by: codewithvk <vivek.javiya@collabora.com>
Change-Id: I1c3c06b21a9d26e6a8966782c0af07381403c08f
2024-04-03 12:09:29 +02:00
Miklos Vajna
ea8202268c Related: cool#8648 clipboard: use JSON when requesting HTML only
Visit the
/cool/clipboard?WOPISrc=...&MimeType=text/html,text/plain;charset=utf-8
endpoint, you get a JSON with HTML and plain text. Visit
/cool/clipboard?WOPISrc=...&MimeType=text/html, you get HTML with a
custom header that is only possibly to skip easily because HTML itself
has as well-known header.

This is decied in ChildSession::getClipboard(), which has 3 cases: 1)
single specific format 2) multiple specific formats and 3) all formats.
So far only 2) used JSON, but the new async clipboard copy will want to
(als) request just plain text, where skipping our own custom header is
hard, given that the text itself has no well-known header (unlike HTML).

Solve the problem by always using JSON when a specific format is
requested, so both the HTML and HTML+plaintext case gives JSON.

The client side of this is the recently introduced Clipboard.js
parseClipboard(), which can cope with JSON already.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I8298f3f82d2a3871777c369f5aee6bb81d66a553
2024-04-02 21:41:57 +01:00
Darshan-upadhyay1110
5b6042f896 A11y improvements
Problem:

    - At various places, form elements are linked to the same label both through the 'for' attribute in the
associated label, and through the 'aria-labelled by' attribute in the element itself.
    -  This double linkage
can lead to confusion and redundancy, especially when using assistive technologies.

What should we do:

    - Remove Redundant Linkage: In most cases, the 'for' attribute in the label is sufficient to
    establish a clear linkage. The 'aria-labelled by' attribute can be removed in this case to avoid
    redundancy.

    - Consistent Use of Attributes: Ensure consistent use of attributes throughout the website. Use
    either 'for' or 'aria-labelled by' depending on the context and requirements, but avoid double
    linkage

Solution :

    - as we made label `for` attribute value consistent with `id` value for its corresponding `input/select` element
        - https://github.com/CollaboraOnline/online/pull/8646
    - now we can remove 'aria-labelled by' as there is already linkage present
    - there are some cases where labels are not present, we must use `aria-labelledby` in that case.

Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>

Change-Id: I389d271280a80835fd7345e8221e3777f8f8ed51
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
2024-04-02 18:35:56 +05:30
Szymon Kłos
a214088801 Convert SearchBar.js to TypeScript file
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I12dc1f0f6744d76a863ed0598185340a898a8b58
2024-04-02 15:02:53 +02:00
Szymon Kłos
13a16ace0a remove-w2ui: convert mobile search bar to JSDialog
- 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
2024-04-02 15:02:53 +02:00
Miklos Vajna
25342ed317 Related: cool#8648 clipboard: extract parseClipboard() from Control.DownloadProgress.js
This way it can be reused in future code in Clipboard.js when
navigator.clipboard.write() is used, without duplication.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I843577e55802bcb7ad6cbdc5f83919172bc7d3e0
2024-04-02 13:32:23 +01:00
codewithvk
7e63d2e9d2 fix : Format -> Conditional Menu Button Not Working
Signed-off-by: codewithvk <vivek.javiya@collabora.com>
Change-Id: I6d23bc3c1c4b080ade32a97dd8408149f49d160d
2024-04-02 10:25:20 +02:00
Darshan-upadhyay1110
2009123f18 Direct Label Association
Problem:

- The labels for the <select> elements are being associated with a <div> element that surrounds the
corresponding <select> element instead of directly linking it to the <select> element.
- This creates an unclear semantic relationship between the label and the actual form element, affecting usability for
users with assistive technologies
- this was not only issue with `select` element but for all input selection elements in JSDialogBuilder

Solution:

- `lable` and it's corresponding `input/select` element should have same `for` and `id` values
-  this patch will make `for` attr of `label` equals to `id` attr value of 'input/select' elements
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: If341174edcdb72af6fde3da14d5ed36ba0c3ae95
2024-04-02 09:54:31 +02:00
Szymon Kłos
855f520989 Fix TypeError on accept formula button
- in the formulabar in Calc
- type "=" then click "accept formula"

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I120f655766bc5e2b4688aec0e598da9c847478a8
2024-04-02 08:54:39 +02:00
Szymon Kłos
ad5826e4c3 cypress: make mobile toolbar tests more reliable
- wait for enabled state
- then click internal button

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7663deb668de2e98b007fbace60386a4a7157058
2024-04-01 14:04:08 +03:00
Szymon Kłos
db86e87c30 cypress: make table_operation_spec.js more reliable
- 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
2024-04-01 14:04:08 +03:00
Szymon Kłos
128ce410f1 remove-w2ui: stop using old toolbars on tablet
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Id8fd8e67c80eab7f48d1c519ecddb3d8dfd16062
2024-04-01 14:04:08 +03:00
Szymon Kłos
fb017302f1 remove-w2ui: convert mobile top bar to JSDialogs
- use dispatcher to invoke commands
- TODO: checked state for buttons + cypress check

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I652a163ea0c831b47ce7725ffd0f9f190a98d9bf
2024-04-01 14:04:08 +03:00
Szymon Kłos
7a087600e9 jsdialog: use attribute not class for disabled state
- but still use class for css rules
- after rework in styling to use attribute we can drop that

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I568eedf45440f6636c31430cb98adcfdeab6aa4e
2024-04-01 14:04:08 +03:00