Commit Graph

3713 Commits

Author SHA1 Message Date
flarum-bot
3d27305f2f Bundled output for commit c7d496446b [skip ci] 2020-10-09 23:28:51 +00:00
Alexander Skvortsov
c7d496446b Fix handling of non-409 errors in ExtensionsPage
If the error isn't a 409, we'll want to re-throw the error so it'll be handled by the default system (showing an alert).

For simplicity, we can also move 409-handling logic out of setTimeout.

Finally, we adjust the timeout to 300 milliseconds to match the modal transition animation length.
2020-10-09 19:27:07 -04:00
flarum-bot
95682d1e92 Bundled output for commit 374d958dfb [skip ci] 2020-10-09 23:07:06 +00:00
Alexander Skvortsov
374d958dfb Header UI fixes (#2371)
* Revert "Fix header contents moving when opening modal (#2131)"
* Fix header contents moving when modal opened/closed.

Conditionally apply the navbar-fixed-top class only when needed, so that we can take advantage of it without always having the navbar in position:fixed, as was done in the previous solution. That resulted in a clash with custom headers.

* Show header on refresh of scrolled page

Due to some magic in Mithril 0.1's context:retain flag, some DOM elements were cached across page reloads. Since that has been eliminated, if we refresh the page and we are scrolled down, the "affix" class which makes the header fixed (and as a result, visible) isn't applied until the first scroll. We fix this by running ScrollListener.update() immediately to set initial navbar state.
2020-10-09 19:05:53 -04:00
Wadim Kalmykov
c843f4273c Reduce modal hide timeout (#2367) 2020-10-09 19:04:53 -04:00
Daniël Klabbers
84ce740489 Fixes the queue for beta 14 (#2363)
- rewrite the queue handling for illuminate 6+
- implement missing maintenance mode callable for queue Worker
- Ensure we resolve append the queue commands once the queue bindings are loaded
- Override WorkCommand because it needs the maintenance flag. It tries to use
the isDownForMaintenance method from the Container assuming it is a Laravel
Application. Circumvented this issue by resolving our Config from IOC instead.
2020-10-09 16:06:28 -04:00
Sami Mazouz
32dc54becc Use @control-bg for Slidable content (#2381) 2020-10-09 14:37:47 -04:00
flarum-bot
ce7aa224f0 Bundled output for commit 87c8f60cd4 [skip ci] 2020-10-07 20:25:22 +00:00
Alexander Skvortsov
87c8f60cd4 DiscussionPage: call onNewRoute properly
When on a discussion page, the URL changing doesn't always mean we've moved to a different page. In our custom rerender logic, we only want to call `this.onNewRoute()` if the page has actually changed.
2020-10-07 16:22:41 -04:00
Alexander Skvortsov
16cc1e48ef Restore stricter email validation
In v5.8, Laravel expanded email validation logic to closer match the RFC. This, however, allows emails that aren't conventional (for example, emails lacking a TLD). This commit changes Flarum's UserValidator to use the `email:filter` validator, which uses PHP's filter_var, and is the pre-5.8 behavior.

See https://laravel.com/docs/5.8/validation#rule-email
2020-10-07 15:33:57 -04:00
flarum-bot
e6da195854 Bundled output for commit edf350d80b [skip ci] 2020-10-07 18:11:32 +00:00
Alexander Skvortsov
edf350d80b Slight PostStream scrubber improvement
After we scroll to a post, we redraw to render post content.  We then update the scrubber again so its height is accurate. This commit moves that update to AFTER our adjustment of scroll position, so that scrubber height is based on actual post heights. This fixes some subtle scrubber glitches.
2020-10-07 14:09:53 -04:00
Daniël Klabbers
a3c419fba9 Add test for model object argument in callable for attribute defaults 2020-10-07 11:38:52 +02:00
Daniël Klabbers
f17c6da53e Allows callables for default model attribute to gain access
to the current model in order to calculate the value needed.
2020-10-07 11:26:58 +02:00
Daniël Klabbers
3a736d660b improve deprecated message for b15 2020-10-07 10:23:46 +02:00
flarum-bot
1e7bdf1636 Bundled output for commit 70785df37e [skip ci] 2020-10-06 15:53:21 +00:00
Wadim Kalmykov
70785df37e SubtreeRetainer: fix onbeforeupdate needsRebuild (#2365) 2020-10-06 11:52:05 -04:00
flarum-bot
2cc60d3d7f Bundled output for commit 767b8376d2 [skip ci] 2020-10-06 00:52:30 +00:00
Alexander Skvortsov
767b8376d2 Update mithril request docs link 2020-10-05 20:50:15 -04:00
flarum-bot
3dc0578ebf Bundled output for commit 15bd4f661b [skip ci] 2020-10-05 22:07:23 +00:00
Lucas Henrique
15bd4f661b Convert icon helper to Typescript (#2360) 2020-10-05 18:06:08 -04:00
flarum-bot
2ec8b3670d Bundled output for commit 6c8173a953 [skip ci] 2020-10-05 20:26:46 +00:00
Alexander Skvortsov
6c8173a953 Move drawer hide and modal close into onNewRoute
Let's stay consistent with previous behavior, and run these on "internal route change" (same component handles different route) as well as on initial render of a page component.
2020-10-05 16:25:23 -04:00
Alexander Skvortsov
6ff50874fa Use Symfony TranslatorInterface for tests
This seems to be a leftover change missed in https://github.com/flarum/core/pull/2243
2020-10-05 16:02:12 -04:00
flarum-bot
bf2a56e404 Bundled output for commit f347a45fd1 [skip ci] 2020-10-05 18:41:55 +00:00
Alexander Skvortsov
f347a45fd1 Catch promise reject when not logged in on reply 2020-10-05 14:40:33 -04:00
flarum-bot
401c31a71d Bundled output for commit 7c5b274731 [skip ci] 2020-10-05 14:56:45 +00:00
Wadim Kalmykov
7c5b274731 call parent onremove (#2362) 2020-10-05 10:55:14 -04:00
Abhishek Verma
312bc7d1f4 Fixed Broken Badges in ReadMe.md (#2358) 2020-10-04 16:11:39 -04:00
flarum-bot
24b3e2ed4b Bundled output for commit 51fe530285 [skip ci] 2020-10-03 22:48:56 +00:00
Alexander Skvortsov
51fe530285 Fix email confirmation alert
Currently, the controls are on a new line due to the container div. We want to wrap ALL children of the alert, including the controls, in the container div.

We need to split it into a separate class so that we can add modify the alert vnode AFTER the alert component's `view` logic has been applied.
2020-10-03 18:47:27 -04:00
David Sevilla Martín
ba772ab4fc Remove Mithril namespace export from shims.d.ts (#2347)
From using PhpStorm to try and see if the autocomplete works properly, it appears as it doesn't. The intention was to not have to import Mithril every time we wanted to type something with Mithril.*, but that doesn't seem to be possible - and it's not a big deal anyway
2020-10-02 19:34:06 -04:00
flarum-bot
4446a6fd2e Bundled output for commit 42b3a09c26 [skip ci] 2020-10-02 23:06:45 +00:00
Alexander Skvortsov
42b3a09c26 Eliminate temporary BC layers from rewrite
During the frontend rewrite, we introduced mithril patches for a `route` attr, and for `m.stream`. Later, we decided not to go that route, but not to remove the patches yet to avoid breaking extensions while we were finalizing the replacements. We can now remove these.

Other BC layers are for things from before beta 14, so those remain in place.
2020-10-02 19:05:26 -04:00
flarum-bot
530ab7c715 Bundled output for commit c8cc1ed665 [skip ci] 2020-10-02 22:50:48 +00:00
Alexander Skvortsov
c8cc1ed665 Various TypeScript improvements (#2309)
- Use Mithril.Attributes as base for ComponentAttrs, remove =any from class signature for Component
- Convert Alert to TypeScript, introduce AlertAttrs interface
- Convert AlertManagerState to TypeScript, add overload signatures for `show`, introduce AlertState interface for stored Alerts.
- Set ComponentAttrs as default T for Component
- Make attrs in AlertAttrs optional
- Add AlertIdentifier interface, simplify show type signature
- Remove mithril patch shim, as all patches onto m are now deprecated
- Use Mithril.Static for shim
2020-10-02 18:49:40 -04:00
flarum-bot
d2f55e941b Bundled output for commit 0232ec0edd [skip ci] 2020-10-02 22:05:01 +00:00
Wadim Kalmykov
0232ec0edd Improve DiscussionListState refresh method (#2322)
- Ensure that the discussion list is cleared before it is updated with fetched results
- Rename `clear` to `deferClear`, improve documentation to make its purpose clearer.
2020-10-02 18:03:44 -04:00
flarum-bot
81435a5ca0 Bundled output for commit eb717bb034 [skip ci] 2020-10-02 21:55:59 +00:00
Alexander Skvortsov
eb717bb034 Basic Extension Dependency Support (#2188)
- Don't enable an extension if its dependencies are not enabled
- Don't disable an extension if its dependencies are not disabled
2020-10-02 17:54:28 -04:00
flarum-bot
9251aa925f Bundled output for commit 9e88609a56 [skip ci] 2020-10-02 21:11:38 +00:00
Alexander Skvortsov
9e88609a56 Minor improvements to onNewRoute (#2328)
- Call onNewRoute when page changed with same component in DiscussionPage and UserPage

- Make app.previous and app.current changed in onNewRoute, not in oninit. This way, when the route is changed, but still handled by the same component, a new PageState object will still be created.
2020-10-02 17:10:38 -04:00
flarum-bot
d968f50a64 Bundled output for commit 0aa6eb2b44 [skip ci] 2020-10-02 20:58:06 +00:00
Alexander Skvortsov
0aa6eb2b44 Use Link component for links instead of mithril route patch (#2315)
This new component now also supports external links.
2020-10-02 16:56:40 -04:00
flarum-bot
6f8aa0ed5a Bundled output for commit b69abb87b5 [skip ci] 2020-10-02 15:15:05 +00:00
Alexander Skvortsov
b69abb87b5 Adjust PostStreamScrubber height after scroll (#2333) 2020-10-02 11:13:55 -04:00
Alexander Skvortsov
28056d0c0e Ensure that modal hide animates (#2332)
We want to return a promise in``onbeforeremove` with arbitrary loading time to ensure that the animateHide animation has time to complete.
2020-10-02 11:12:49 -04:00
flarum-bot
07b1ed4d76 Bundled output for commit 2696f02ce1 [skip ci] 2020-10-01 18:52:08 +00:00
Alexander Skvortsov
2696f02ce1 Fix multiple scrolls to same post in PostStream (#2264)
While more pleasant from an FSM standpoint, comparing the current targetPost to the previous one does not work if goToNumber is called twice in a row for the same post. For instance, if a user clicks the mentions link to a post twice, the post stream breaks.
2020-10-01 14:50:54 -04:00
flarum-bot
8e8cfe28ec Bundled output for commit 9b3c94964c [skip ci] 2020-10-01 01:03:05 +00:00