Commit graph

51 commits

Author SHA1 Message Date
Travis Ralston
90a898d03f Move dispatcher into a subdirectory
We're expecting to have a whole bunch of types for the dispatched payloads, so pull the thing into a directory we can throw them in.
2020-05-13 21:07:50 -06:00
Bruno Windels
a8958458aa fix lint, add jsdoc 2020-02-06 15:29:35 +01:00
Bruno Windels
4cd4110a52 fixup: this is already done in _buildModal 2020-02-06 13:13:37 +01:00
Bruno Windels
c44ebef06f add onBeforeClose option to Modal
so we can throw up another "are you sure" dialog
in the cases we want to do so. This also
passes a reason so we can only do so for ways of
dismissing (like backgroundClick)
that are easy to do by accident.
2020-02-06 13:10:06 +01:00
Bruno Windels
7e07a42dc1 resolve finished promise when closing dialog by clicking background
... by calling the same close method as otherwise and not
have a special path that just calls the onFinished callback.
This will also not close all the dialogs anymore,
but that sort of seems like the intented behaviour?
2020-02-06 13:07:13 +01:00
Bruno Windels
a0c2a39dc7 make a static dialog close again if background is clicked 2020-02-05 13:43:30 +01:00
David Baker
688f7029d2 Split AsyncWrapper out from Modal
So we can use it outside of modals & dialogs
2020-01-24 12:28:03 +00:00
Travis Ralston
d56f0f2a25 Convert many imports to handle ES6 exports
Reliant upon https://github.com/matrix-org/matrix-react-sdk/pull/3761
2019-12-22 21:04:42 -07:00
Michael Telatynski
d4d51dc61f Rip out the remainder of Bluebird 2019-11-18 10:03:05 +00:00
Michael Telatynski
2ea239d192 Replace rest of defer usages using small shim. Add homebrew promise utils
(cherry picked from commit 6850c14739)
2019-11-12 12:07:56 +00:00
Michael Telatynski
7a512f7299 Revert "Replace rest of defer usages using small shim. Add homebrew promise utils"
This reverts commit 6850c147
2019-11-12 11:56:43 +00:00
Michael Telatynski
6850c14739 Replace rest of defer usages using small shim. Add homebrew promise utils 2019-11-12 11:45:28 +00:00
Michael Telatynski
49c7730503 change Modal async/await signature to use raw promises
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-08-09 17:29:22 +01:00
Michael Telatynski
7fe078c07a Modal.createX return thenable which extends onFinished, for async/await
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-08-09 16:47:22 +01:00
Michael Telatynski
aa98a6dfcb Start using create-react-class polyfill
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-08-05 10:08:30 +01:00
Travis Ralston
12e7953f64 Append keyshare request dialogs instead of replacing the current dialog
Fixes https://github.com/vector-im/riot-web/issues/8798

By default, Modal dialogs are put up front. For this particular dialog we don't need to deal with it right away, therefore it can wait.
2019-06-28 14:34:19 -06:00
David Baker
cd0dcc2668 delint Modal.js 2019-04-05 10:18:41 +01:00
David Baker
7925e7169a Design tweaks to dialogs
Little bit of a mix of things in this one:
 * Support variable-width dialogs. Default is fixed-width as before,
   only UploadConformDialog is variable-width. Controlled by a prop
   to BaseDialog.
 * Fixes to the cancel 'x' - scale the mask image, tweak size & colour
 * Colour & boldness of dialog titles
 * Align the dialog title & cancel 'x'
 * Remove gap between dialog buttons & right hand side of dialog(!)
 * Round corners on dialogs
 * Add grey border on image preview in upload confirm dialog
 * and, squeezing in slightly randomly, finish the partially renamed
   ChatInviteDialog to AddressPickerDialog.
2019-04-03 16:27:45 +01:00
Travis Ralston
e5f7563dec Ask the user for debug logs when the timeline explodes
Fixes https://github.com/vector-im/riot-web/issues/9260
Workaround for https://github.com/vector-im/riot-web/issues/8593
Requires https://github.com/matrix-org/matrix-js-sdk/pull/869

We check if any dialogs are open before moving forward because we don't want to risk showing so many dialogs that the user is unable to click a button. We're also not overly concerned if the dialog being shown is irrelevant because whatever the user is doing will likely be unaffected, and we can scream in pain when they're finished.
2019-03-22 20:23:35 -06:00
Travis Ralston
0978ab3da0 Support stacking dialogs to prevent unmounting
Fixes https://github.com/vector-im/riot-web/issues/8371
2019-02-28 15:55:58 -07:00
David Baker
2ba4d8a2d9 Remove outdated logging & log on failure 2018-11-21 17:35:28 +00:00
David Baker
985966f8be Update async dialog interface to use promises
Hopefully makes the syntax a bit nicer. Also uses ES6 async import
rather than require.ensure which is now deprecated. Also also
displays an error if the component fails to load rather than falling
over in a heap, which is nice.
2018-11-21 16:56:44 +00:00
Luke Barnard
e602213806 Add concept of priority modal to modal manager 2018-05-22 15:47:05 +01:00
Peter Vágner
410570936a Reimplement setting aria-hidden on the main app node by dispatching actions rather than assuming we can find and manipulate the node directly 2018-02-08 22:51:07 +01:00
Peter Vágner
14991afbe5 Merge branch 'develop' into dialog-a11y 2018-02-06 23:04:15 +01:00
Aidan Gauland
35780f5ae0 Remove use of deprecated React.PropTypes
Replace all uses of React.PropTypes with PropTypes and importing PropTypes from
'prop-types'.
2017-12-26 14:03:18 +13:00
Peter Vágner
20c485d85e Move aria-hidden management from the BaseDialog component to the Modal 2017-12-20 10:09:26 +01:00
Peter Vágner
4f83f6cf25 Move keyboard focus management back to the BaseDialog rather than
leaving it in the Modal manager.
We are using Modal manager to load other components not just BaseDialog
and its subclasses and they might require different keyboard handling.
Also depend on focus-trap-react rather than react-focus-trap for locking
keyboard focus inside the dialog. The experience is much nicer and even
the FocusTrap element it-self no longer gains the focus.
On a side note using the FocusTrap element outside the dialog (on
its parent) stops it from working properly.
2017-12-05 08:50:40 +01:00
Peter Vágner
5ccbcf02e2 Several changes improving accessibility of the dialogs
- Wrapped all the modals inside a react-focus-trap component disabling
keyboard navigation outside the modal dialogs
- Disabled our custom key handling at dialog level. Cancelling on esc
key is now handled via FocusTrap component.
- Removed onEnter prop from the BaseDialog component. Dialogs that
submit data all now embed a form with onSubmit handler. And since
keyboard focus is now managed better via FocusTrap it no longer makes
sense for the other dialog types. Fixes
https://github.com/vector-im/riot-web/issues/5736
- Set aria-hidden on the matrixChat outer node when showing dialogs to
disable navigating outside the modals by using screen reader specific
features.
2017-12-03 21:38:21 +01:00
Luke Barnard
d3f9a3aeb5 Run eslint --fix
Fixing 1000s of lint issues. Some rules cannot be `--fix`ed but this goes some way to linting the entire codebase.
2017-10-11 17:56:17 +01:00
Michael Telatynski
72a412589d
Fix vector-im/riot-web#4799 regression by fixing fn signature
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-08-15 15:52:38 +01:00
Michael Telatynski
bf98c0da7c
un-i18n Modal Analytics
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-27 17:19:18 +01:00
Luke Barnard
4344af58ee Ask for email address after setting password for the first time
So that the user can reset their password.
2017-06-14 09:31:16 +01:00
Michael Telatynski
bdf94b14a4 changed my mind, no point sending spinner over to analytics
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-30 00:10:36 +01:00
Michael Telatynski
5dde23ae54 fall back to className if no props?.title - for mx_Dialog_spinner primarily
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-30 00:01:36 +01:00
Michael Telatynski
b65e4960a5 move Dialog analytics to Modal controller
mark title as required, it sorta is, why isn't this based on BaseDialog?

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-29 17:39:03 +01:00
Richard van der Hoff
484d9d708e Logging to try to track down riot-web#3148
Since I can't figure out how this is happening, add a shedload of logging to
try to pin it down.
2017-02-06 16:01:25 +00:00
Matthew Hodgson
5e5b7f89f4 support scrollable content for UnknownDeviceDialog 2017-02-02 00:25:49 +00:00
Richard van der Hoff
10018374f8 Allow modals to stack up
Show the most recent modal; if we end up with more than one, just show the most
recent.
2017-01-25 07:44:33 +00:00
Richard van der Hoff
dc08d9dfdf Fix device verification from e2e info
Don't attempt to reuse the same AsyncWrapper for different dialogs - which ends
up pushing the props for the new dialog into the old dialog.

Fixes https://github.com/vector-im/riot-web/issues/3020
2017-01-23 12:18:41 +00:00
David Baker
18d4d3392a Fix a bunch of linting errors
eslint --fix and a few manual ones
2017-01-20 14:22:27 +00:00
Richard van der Hoff
ac22803ba0 Allow Modal to be used with async-loaded components
Add Modal.createDialogAsync, which can be used to display asynchronously-loaded
React components. Also make EncryptedEventDialog use it as a handy
demonstration.
2017-01-16 17:18:38 +00:00
Matthew Hodgson
deaa5c350a Remove unnecessary Modal.createDialogWithElement, complete with its broken onFinished() support. Switch SetDisplayNameDialog to use Modal.createDialog(). Explicitly pass false to closeDialog if the user tries to cancel dialogs by clicking on the background, rather than passing in an event object which evaluates to true. 2016-03-18 11:15:06 +00:00
Matthew Hodgson
0772f50fab update copyright for 2016 2016-01-07 04:06:52 +00:00
Matthew Hodgson
368c24e146 s/React/ReactDOM 2015-11-10 19:53:29 +00:00
Matthew Hodgson
efd88b9a83 upgrade to react 0.14 2015-11-09 23:13:43 +00:00
Matthew Hodgson
9df7337a6d actually commit ability to apply a custom class to modal dialogs, used for lightboxing 2015-10-29 10:17:34 +00:00
David Baker
0791cac572 Add method to Modal to create dialog with instantiated React elements as well as Classes. 2015-10-09 11:54:46 +01:00
David Baker
fe369858b7 Unused variables & redundant stuff 2015-09-25 15:17:46 +01:00
David Baker
3838569625 Port memberlist branch fixes 2015-09-22 16:37:39 +01:00