Commit Graph

423 Commits

Author SHA1 Message Date
David Wheatley
57d91b2d87
Revert "chore: better typings for DiscussionListState"
This reverts commit e9b3d3d313.
2021-10-27 17:17:24 +02:00
David Wheatley
e9b3d3d313
chore: better typings for DiscussionListState 2021-10-27 17:17:01 +02:00
Alexander Skvortsov
2b0d55632e
ExtensionPage: rename "Uninstall" to "Purge" (#3123)
https://i.imgur.com/aOOkqhk.png
2021-10-26 17:32:39 -04:00
Alexander Skvortsov
a661376d16
Catch errors when uploading white avatar (#3119) 2021-10-25 17:34:39 -04:00
Clark Winkelmann
9416b1c150
Fix mail settings select component never being used (#3120) 2021-10-25 01:44:46 -04:00
Alexander Skvortsov
60f0ef0bd5
Handle post rendering errors to avoid bricking (#3061)
Whether it's due to corrupted content, missing tags, caching issues, or other assorted reasons, post content can't be rendered. Currently, this results in an exception that crashes the entire forum and is hard to debug. Instead, we should log the error and show an indicator message that rendering has failed.

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: David Wheatley <hi@davwheat.dev>
2021-10-14 14:30:18 -04:00
Sami Mazouz
713d95eb36
fix: import app from common app instead (#3104)
Introduced in #3099
2021-10-14 14:41:22 +01:00
David Sevilla Martin
05121b928a
Lazy draw dropdowns to improve performance (#2925) 2021-10-13 14:55:32 -04:00
Fransiscus Rolanda Malau
0a7e885eab
Add missing autocomplete attributes to input fields (#3088)
* Add missing autocomplete attributes to input fields
* Add autocomplete attributes to password fields
* Attribute should use new-password
2021-10-13 14:53:35 -04:00
Braunson Yager
2a86c25297
Added ES6 local support for formatNumber helper as per #2951 (#3099) 2021-10-13 14:48:37 -04:00
Alexander Skvortsov
1c2465b2da Support filter params in discussion list state
https://github.com/flarum/core/pull/3068 accidentially broke the user discussions page, as up until this commit, `DiscussionListState`didn't accept any filter params.
2021-10-06 23:30:32 -04:00
Alexander Skvortsov
a6717ee981 Remove .html on all docs urls
Now that Flarum docs have been moved to docusaurus, URLs no longer end with `.html`.

Closes https://github.com/flarum/core/issues/3092
2021-10-05 10:13:19 -04:00
Sami Mazouz
e2f01c040b
fix: Anchors should not have type="button" (#3086) 2021-09-29 11:30:31 -04:00
David Wheatley
5dd48e1b86
[A11Y] Accessibility improvements for the Search component (#3017)
* Remove deprecated code

* Accessibility improvements for Search component
2021-09-20 16:06:15 +01:00
Rafael Horvat
1b193196da
Use author filter parameter instead of q with gambit to get a user's discussions on the DiscussionsUserPage (#3068) 2021-09-11 09:24:15 +01:00
David Sevilla Martín
eb0dd1f0d0
Add extra error handling for avatar file size & large payload (#3042)
* Add extra error handling for avatar file size & large payload

* Change error message to return 'upload failure' on most errors instead of 'no file' message
2021-09-05 20:43:59 -04:00
Rafael Horvat
71073b064a
Allow adding page parameters to PaginatedListState, like limit. (#2935) 2021-08-26 10:33:22 +01:00
Sami Mazouz
c2a0cf8d04
fix: Extension admin page erroring out (#3054)
Extension admin pages are currently not working because of a JS error.
The settings record is never defined but directly used, it used to be defined as an empty object in oninit.
2021-08-25 13:33:19 -04:00
David Wheatley
0a2b28ebe0
Rewrite AdminPage abstract component into Typescript (#2996)
* Rewrite AdminPage.js into Typescript

* Export more interfaces and types

* Use Stream type

* Update js/src/admin/components/AdminPage.tsx

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Move `HTMLInputTypes` type to global declarations

* Add missing app import

* Export options interface

* Remove unused method

* Add random element ID generator

* Add attrs for Page component

Full rewrite needed later

* Provide correct attrs

* Add missing a11y attributes for help text and labels

* Update TSDoc comment

* Allow Children to be passed for label/help text

* Extract setting types to arrays

* Make Page class abstract; fix incorrect Component generic call

* Mark AdminPage as abstract

* Mark `content` as abstract

* Revert "Move `HTMLInputTypes` type to global declarations"

This reverts commit c900cb3f6d.

* Restore TSDoc on HTMLInputTypes type

* Fix typo

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2021-08-23 01:59:50 +01:00
David Wheatley
66aaa862fd
fix: reference to undefined variable discussion 2021-08-22 23:46:34 +01:00
David Wheatley
3cf19dd2ea
Rewrite Button to Typescript (#2984)
* Rename Button file

* Convert to TS

* Add debug warning helper

Fires `console.warn`, but only when the forum is in debug mode. Can help to inform extension developers of possible issues with their JS code.

* Simplify button content template

* Rewrite Button component

- Prefer `aria-label` over `title`
- Don't duplicate button content to `title` attribute
- Warn in debug mode if button has no accessible content
- Use modern JS/TS syntax (`||=`, spread, etc)

* Update to work with new Button component

* Update warning

Co-authored-by: Matt Kilgore <tankerkiller125@gmail.com>

* Fire warning in `oncreate`

* Format

* Make Button have extensible Attributes type via generics

* Update args type

* Update js/src/common/components/Button.tsx

Co-authored-by: Matt Kilgore <tankerkiller125@gmail.com>
Co-authored-by: David Sevilla Martin <me@datitisev.me>
Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>
2021-08-22 20:38:01 +01:00
Clark Winkelmann
aba6836bdd
Replace username with display name in more places (#3040)
* Replace username with display name in more places

* More readable spread operator and translator user magic
2021-08-21 23:34:34 +01:00
David Wheatley
656cc35a0d
Use ItemList for DiscussionPage content (#3004)
* Use ItemList for DiscussionPage content

* Don't import Mithril
2021-08-21 09:53:56 +02:00
David Wheatley
7f2e6543ed
Add typings for class component state attribute (#2995)
* Add `state` typings to class components
2021-08-19 10:14:50 +01:00
David Wheatley
2831ce226c
Fix global typings for extensions (#2992)
* Fix global typings for extensions

* Deprecate global `app` typings

See https://github.com/flarum/core/issues/2857#issuecomment-889841326

* Add `app` export for common namespace

* Add missing `app` imports within core

* Add missing `app` imports to JS files

* Fix incorrect import

* Fix admin file importing forum `app`

* Add `flarum` global variable

* Format

* Update JSDoc comment

* Update JSDoc comment

Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>

* Fix frontend JS error

* Empty commit

Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>
2021-08-19 10:10:40 +01:00
David Wheatley
83529e23de
[A11Y] Make checkboxes focusable (#3014)
* Add extra feature to a11y focusring mixin

* Add visually hidden CSS class and mixin

* Visually hide checkboxes (keep in focus/a11y tree)

* Place checkbox focus ring around display element

* Improve mobile checkbox/switch accessibility
2021-08-16 11:56:10 +02:00
Sami Mazouz
ef20e29b20
[1.x] Custom Colorising with CSS Custom Properties (#3001)
* Start of conversion to CSS variables
* Use variable for Badge colors
* Use variable for avatar bg
* Use variable for user card bg
* Use css variables for hero
* Use css variables for buttons
* Use css variables for sidenav links
* Cleaner style attr

Co-authored-by: David Wheatley <hi@davwheat.dev>
2021-08-16 10:17:48 +01:00
David Wheatley
afc1a1bbbe
[A11Y] Explicitly state aria-hidden value; hide icons from screenreaders (#3027)
* Set explicit `aria-hidden` value
* Hide icons from screen-readers
2021-08-15 20:54:50 +02:00
Ornanovitch
634dfc69f3
Permission Grid: stick the headers to handle a lot of tags (#2887)
* sticky thead th & tbody th, adapt PermissionPage and PermissionGrid layout

* adjust height size

* cleanup

* cleanup with some SychO9's recommendation

* remove the `thead th` `first-child` "protection"
2021-08-15 00:21:08 +01:00
Hasan Özbey
b32496d30c
don't show excerpt if there are no plain content (#2964)
for https://github.com/flarum/core/issues/2942
2021-08-13 23:22:56 +01:00
Ornanovitch
13d302b650
make user.editGroups depending on viewHiddenGroups (#2880)
should resolve #2610
2021-08-10 14:52:34 +01:00
SychO9
81e6b17f83 npm run format 2021-07-26 13:03:09 +02:00
David Wheatley
f949b0a28e Remove class from text input 2021-07-26 13:03:09 +02:00
David Wheatley
66064ca9be Remove class from Mail Select setting component 2021-07-26 13:03:09 +02:00
David Wheatley
f9fc78a10d Prevent class attrs overriding default Select classes 2021-07-26 13:03:09 +02:00
David
e195ca27a8 Fix Select-based setting breaking admin pages 2021-07-26 13:03:09 +02:00
David Wheatley
3130e3de5e
Allow extra attrs provided to <Select> to be passed through to the DOM element (#2959)
* Allow extra attrs provided to `<Select>` to be passed through to the DOM element

* Allow direct passing attrs to the Select wrapper

* Format
2021-07-13 13:42:46 +01:00
David Wheatley
da20d75e3c
Hide post footer when empty (#2926)
* Add `Post-footer--empty` class if the post footer contains no items

* Hide post footer when it has class `Post-footer--empty`

* Swap to `:empty` pseudoselector

* Prefer ternary operator

* Fix typo
2021-07-13 13:42:19 +01:00
Lucas Henrique
42dabea81f
Move Day.js plugin types import to global typings (#2954) 2021-07-05 16:35:37 +01:00
ctml91
3fcc7bd3b9 use display name for avatar color gen 2021-06-22 00:14:37 +02:00
David Wheatley
440bed81b8 Fix XSS vulnerability 2021-06-06 02:41:48 +01:00
Alexander Skvortsov
9ee3cd6a18 Fix insertText
In dd8323ee36, insertText was modified from the original to work with reply mentioning. This was done due to a misunderstanding of the API: the selection range isn't the selection to replace, but rather the final selection state after replacing the *current* selection with the text. This commit restores the original, correct implementation of insertText and instead adjusts the `insertBetween`method of BasicEditorDriver to set selection state before executing `insertText`.

Fixes https://github.com/flarum/core/issues/2877
2021-05-18 01:37:19 -04:00
David Wheatley
e010cbc319
Fix Badge className not being correctly set
Fixes group icons on Admin permissions page
2021-05-17 01:27:30 +01:00
SychO9
1b8c77d034 Remove Beta leftover warning code 2021-05-17 00:02:21 +01:00
Alexander Skvortsov
9040e62c0e Drop JS copyright blocks 2021-05-15 20:11:38 -04:00
Alexander Skvortsov
9eb74fdc8a Fix CustomFooterModal Appearance
The textarea in the CustomFooterModal was much larger than in the other appearance page modals, and did not use a monospaced font. Turns out the other 2 were explicitly specified in the less. This commit adds a class that can be applied to all these modals for simpler maintenance.

Fixes https://github.com/flarum/core/issues/2865
2021-05-14 21:36:06 -04:00
Alexander Skvortsov
05dda5b083 Fix KeyboardNavigatable
In b2d053f686, I tried to be clever and create a new KeyboardNavigatable object as a return value for `when`. My approach to cloning was incorrect, and caused the util to break entirely.

My original intent for having this "clone"-based behavior is that a single KeyboardNavigatable instance could be created with multiple listeners, and then "cloned" like this with different "activators" registered via "then" calls. In hindsight, this change introduces more issues than it solves: outside of just not working, the cloned "KeyboardNavigatable" instances have shared internal state (the set of callbacks), and each has write access to this internal state. This is a recipe for unpredictable behavior and confusing bugs, so best to keep things simple for now, and maybe introduce more functional behavior in later releases.

Fixes https://github.com/flarum/QualityAssurance/issues/25
2021-05-14 21:21:58 -04:00
Alexander Skvortsov
d1e987a240 Fix 0s in notification dropdown
By casting the length int to a bool, if there are no badges, we don't display a  0. It seems that mithril will render integers, but not booleans.

Fixes https://github.com/flarum/QualityAssurance/issues/28
2021-05-14 21:08:48 -04:00
Alexander Skvortsov
8ffeac4315 NotificationListState separate content method
This fixes an error where an empty notification list wouldn't show the "empty" text.

It also simplifies flow of logic and breaks the component up a bit for readability.
2021-05-14 21:04:26 -04:00
Sami Mazouz
13d341e014
Use slugs for user pages (#2864) 2021-05-14 23:35:50 +01:00
Alexander Skvortsov
1d5d0688aa Fix "add numbered list" styleSelectedText action
Looks like I missed the `numberedLines` function used by the `orderedList` function in dd8323ee36
2021-05-14 18:35:11 -04:00
Christian Lopez
88df26d722
Replace removed hasDiscussions method from DiscussionListPane (#2860) 2021-05-13 15:56:55 -04:00
Alexander Skvortsov
422525a9bb hasDiscussions method of DiscussionListState has been removed 2021-05-12 19:41:28 -04:00
Alexander Skvortsov
42eacd616c Use proper attrs for viewForum and searchUsers 2021-05-12 18:49:11 -04:00
David Wheatley
9dca657edf
Fix formatting error in Tooltip.tsx
Prettier is acting differently on different systems.
2021-05-12 23:14:50 +01:00
Alexander Skvortsov
bba6485eff Tooltip formatting fix 2021-05-11 23:55:52 -04:00
David Sevilla Martín
4e0fdb4c77
Create abstract PaginatedListState for DiscussionList and others (#2781) 2021-05-11 19:14:26 -04:00
Alexander Skvortsov
d64750b3eb
Rename viewDiscussions => viewForum, viewUserList => searchUsers (#2854)
This naming is clearer as to the intended effect. Changes include:

- A migration to rename all permissions
- Updating the seed migration to use the original naming from the start
- Replacing usage of the old names with new names in code
- Throwing warnings when the old names are used.
2021-05-11 15:15:27 -04:00
Alexander Skvortsov
b2d053f686
Search frontend cleanup (#2849)
- Convert KeyboardNavigatable to TypeScript, as that is used internally here.
- Convert search sources to TypeScript
- Convert Search component to TypeScript
- Convert Search States to Typescript
- Add `getInitialSearch` to `SearchState`
- Fix search disappearing on page reload / direct link
2021-05-10 22:30:04 -04:00
Alexander Skvortsov
7f596db09b
Some minor JS cleanup (#2846)
- Change index files to ts
- Remove deprecated EditUserModal from forum compat
- Remove b14-specific error
- Remove transChoice method (ICU should be used instead)
- Translator to TypeScript
- Small JS => TS cleanup
* Trivial js => ts change

Co-authored-by: David Wheatley <hi@davwheat.dev>
2021-05-10 17:54:58 -04:00
Alexander Skvortsov
dd8323ee36
Use github markdown utils in core, support key handlers (#2826)
This simplifies the markdown extension and allows BBCode to use these features.
It also allows undoing stuff like inserting replies/mentions
2021-05-10 17:53:32 -04:00
David Wheatley
f9e8424620
Add tooltip component (#2843)
* Add Tooltip component to common

Will be used to provide backwards compatibility when we switch to CSS tooltips.

All other methods of creating tooltips are deprecated and this component-based method should be used instead.

* Modify direct child instead of using container element

Instead of using a container to house the tooltip, we'll now modify the
first direct child of the Tooltip component.

The Tooltip component will ensure that:
- children are passed to it
- only one child is present
- that child is an actual HTML Element and not a text node, or similar
- that child is currently present in the DOM

Only after all of the above are satisfied, will the tooltip be created
on that element. We store a reference to the DOM node that the tooltip
should be created on, then use this to perform tooltip actions via
jQuery. If this element gets changes (e.g. the tooltip content is
updated to another element) then the tooltip will be recreated.

If any of the first 3 requirements are not satisfied, an error will
be thrown to alert the developer to their misuse of this component.

To make this work, we do need to overwrite the title attribute of
the element with the tooltip, but this is the only solution other than
specifying `title` as an option when making the tooltip, but this is
not accessible by screenreaders unless they simulate a hover on the
element.

* Add warning about component overwriting `title` attr

* Update previous uses of Tooltip component
2021-05-10 21:06:40 +01:00
Alexander Skvortsov
d4e3254395
Use all Mithril lifecycle stubs (#2847) 2021-05-09 18:09:45 -04:00
David Wheatley
6d9bb709c7
Fix typo in LoadingIndicator docblock 2021-05-09 22:33:33 +01:00
David Wheatley
707889abc8
Fix required selector argument to Component.$() (#2844) 2021-05-09 17:22:22 -04:00
Alexander Skvortsov
8a451e0bfc Fix exception in bootExtensions
Frontend extenders exist in a weird state of limbo, where they are technically defined, but aren't used or tested at all. In da5db714c2, we shifted from passing `extension.extend` to `flattenDeep` to calling `flat` on `extension.extend`. If an extension doesn't define extenders (as is the case for most extensions), the change breaks the forum. All we do here is add a null check.
2021-05-07 12:29:10 -04:00
David Wheatley
da5db714c2
Remove lodash from core (#2827)
* Remove `lodash-es` dependency

* Replace `escapeRegExp` with home-made util

* Replace `throttle` with `throttle-debounce` library

* Use native browser methods for `deepFlatten`

We need a polyfill for iOS 11 and below. I think using a native method with this polyfill is better than having our own function instead, even if the bundle size is ~150B more.

* Save a few bytes in `escapeRegExp`

* Fix typo in comment

* Undo import re-organisation

* Use spread instead of slice

* Use smaller Array.flat polyfill from MDN

* Export new utils in `compat.js`
2021-05-06 00:28:22 +01:00
David Wheatley
588a9f952f
Remove unneeded delete (#2835) 2021-05-05 15:46:23 +01:00
David Wheatley
3ca035f9aa
Revamp notifications stylesheet (grid and flex) (#2822) 2021-05-02 17:13:04 +01:00
David Wheatley
f5cd5f202f Allow multiple methods to be provided to extend and override 2021-05-02 11:37:19 +01:00
Alexander Skvortsov
b45519974a
Switch to ICU MessageFormat (#2759) 2021-04-30 12:44:39 -04:00
Sami Mazouz
2b7e7f3ff4
Fix class naming (#2811) 2021-04-26 17:14:22 +01:00
David Wheatley
f9779284e4
Add users list to admin dashboard (#2626)
* Commit initial WIP code

* Fix squashed grid on mobile

* Add pagination support; rename to userList

* Improve grid sizing

* Improve grid row shading

* Move EditUserModal to common

* Add link to profile page in grid

* Use Less styling vars

* Move EditUserModal translations to lib

* Add edit user button to grid

* Fix incorrect profile link priority

* Update profile link translation key

* Add priorities to other columns

* Add group badges to grid

* Add username to profile link tooltip

* Organise imports

* Use variable for header border bottom color

* Fix broken export

* Add total user count to API payload's metadata

* Add new metadata to ApiPayload type

* Implement correct page number

* Remove debug code

* Use function to get the total pages

This allows us to use the raw count elsewhere in the component (pssst... check the next commit!)

* Center profile link in column

* Add profile link header

* Show total users above table

* Use ItemList's itemName property for column data attributes

* Add user email column, hidden by default

This column is hidden by default using a placeholder email and blur filter. These are then removed when the visibility toggle is pressed.

This prevents any over-the-shoulder accidental data leakage, as emails are classed as PII under GDPR.

* Fix incorrect tooltip translation keys

* Add extra padding between email and visibility toggle button

* Prevent selection of blurred email

* Fix incorrect icon state for email toggle

* Update API response type to include metadata (for now)

* Increase number of users per page to 50

* Update compat files with new locations

* Format

* Add @deprecated notices for forum compat export

* Use AdminPayload for user count instead of supplying as REST API metadata

* Make nav look less squashed using bottom margin

* Suppress TS warning

* StyleCI fixes

* Fix TS error

* Update based on review comments

* Rename user list -> users

* Rename internal instances of user_list to users

* Fix formatting

* Use CSS custom properties for the table column count

* Use .Button--icon instead of custom style

* Make fake email more realistic length

* Add a11y attributes

* Use padding bottom instead of margin bottom for page spacing

* Make compatible with new CSS LoadingIndicator

I won't let it break here! :P

* Integrate profile link into username column

* Don't force columns to be 300px

This made the grid look very bloated and intimidating -- lets instead increase the padding between items and make it only the width it needs to be.

* Center edit user button in column

* Increase spacing between email and visibility toggle button

* Rename `statistics` to `modelStatistics` in Admin payload

This prevents any possible conflicts with core and `flarum/statistics`. We might want to consider migrating the stats extension to extend this object in the future.

* Update comments, fix TS error

* Various translation key changes

* Change gmail.com -> example.com

* Stretch 'edit user' button to entire cell size

* Update translations

* Is the YAML formatted right this time? 🙈

* Remove email placeholder

Fixes an issue where the table would jump if an email was unhidden that was longer than the placeholder.

* Re-order lib translations

* Clicking blurred email now unblurs

* Correct header class

* Improve edit user button centring

* Improve vertical row item centering

* Fix incorrect column length in aria attribute

* Use .Button--text!
2021-04-22 23:35:42 +01:00
David Wheatley
33bd99d376
Fix uses of loading spinner (#2797)
* Update Loading Indicator

- Fix mistake in LoadingIndicator Less
- Middle align the loading indicator when inline
- Fix Loading Indicator not correctly accepting container class names
- Add inline and block attributes

* Fix loading indicator in composer

* Fix loading indicator on notification list

* Fix loading indicator on discussion page

* Fix loading indicator on button

* Update more uses of loading indicator

* Fix loading indicator in Search box

* Fix AvatarEditor loading spinner

* Set default spinner props

* Replace "tiny" with "small" in Less

* Improve spinner vertical centring in buttons

* Reduce size specificity

* Use single attribute for block/inline

* Use new display attribute

* Use classes for different sizes

* Use `display=block` by default
2021-04-21 12:26:09 +01:00
David Wheatley
9716a15c31
Add accessibility attributes to loading spinner (#2799) 2021-04-20 17:25:23 +01:00
Alexander Skvortsov
0f9526ba9f
Adjust search height on resize (#2775)
Identified as a potential issue in https://github.com/flarum/core/pull/2650

When typing, the keyboard generally obstructs half the screen. However, when the keyboard is closed, search results don't expand to take up full space.
2021-04-19 10:36:04 -04:00
David Wheatley
f76524a5de
Replace spin.js with a CSS-only loading spinner (#2764)
* Create CSS only loading indicator

* Core mods to fix Loading Indicator usage

* Remove extra whitespace

* Attrs interface extends ComponentAttrs and is exported

* Add doc block about custom styling
2021-04-09 00:42:32 +01:00
David Wheatley
c75db75efe
Bump dependencies, add missing typing libraries (#2753)
* Bump dependencies and add missing typing libraries

* Fix expose-loader breaking changes

* Expose jQuery using its own typings instead of ours

* Extend jQuery typings with our own custom $.fn helpers

* Use jQuery typings for Component's `this.$` attribute

* Format webpack config file

* Use Spin.js 3.1.0
2021-04-08 12:35:10 +01:00
Alexander Skvortsov
40dc6d0feb
Preloaded API document Improvements (#2754)
* Invalidate preloadedApiDocument if URL has changed
* Revert to using `getRouteData()[0]`
2021-04-07 23:25:01 +01:00
David Wheatley
19465fb522
Fix missing vendor prefix on post scrubber; move styles to Less 2021-04-05 23:19:52 +01:00
David Wheatley
4b69a35260
Replace classList with clsx library (#2760) 2021-04-05 16:27:16 +01:00
David Wheatley
3dae397c65
Merge "Small Admin Patches" (#2739) from flarum/ck/adminux-patch2 into master
- Fixes #2736
- Fixes #2728
2021-04-03 03:14:41 +01:00
David Sevilla Martin
2de57af7c8 Move forum & admin app declarations to separate files 2021-03-29 20:19:15 -04:00
KyrneDev
0eefbf0374
Help on redraw 2021-03-24 17:30:13 -10:00
KyrneDev
90c0bc410e
Null name/desc breaks search fix 2021-03-24 17:29:54 -10:00
Alexander Skvortsov
908d087e00
Remove deprecated code from beta 16 (#2705) 2021-03-19 19:13:50 +01:00
David Wheatley
cd9ee48af6
[A11Y] Add aria-label and landmark role to search input (#2669)
* Adds role="search" to Search container
* Add aria-label to search input

See this page for more info:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Search_role
2021-03-18 23:03:01 +01:00
David Wheatley
0cc12aed95
[A11Y] Fix nav drawer being focusable when off-screen on small viewports (#2666)
* Fix nav drawer being focusable when off-screen on small viewports

Fixes #2565

* Implement review suggestions

* Format
2021-03-18 22:38:32 +01:00
David Wheatley
0d139e6133
[A11Y] Add aria-label to dropdown toggles (#2668)
Implement custom accessible dropdown toggle labels for forum components

Making the a11y label more specific to the specific action it performs is critical for good UX with assistive technologies.
2021-03-16 10:50:36 -04:00
David Sevilla Martín
386f3d3db1
Fix Stream function code being shown when renaming discussion (#2693) 2021-03-15 21:42:22 -04:00
Alexander Skvortsov
a64c39835a Fix shaky composer on safari mobile
When the composer is opened while scrolled to the absolute bottom of the page (via hitting the "reply" button, `window.scrollTop` has a value of ~600px greater than it should. This doesn't seem to be the composer element's height (which appears to be 0 at the time). This incorrect scrollTop positions the composer off screen, which causes Safari to freak out and shake the element violently as it tries to scroll to the cursor (which is now off screen).

We can get around this by calculating scrollTop ourselves.

Fixes https://github.com/flarum/core/issues/2683
2021-03-12 00:23:37 -05:00
Alexander Skvortsov
b88a7cb33b Search: dont adjust height if not rendered 2021-03-08 22:45:39 -05:00
Alexander Skvortsov
30017eef09 Send username as author filter value instead of id.
For consistency with the Discussion AuthorFilterGambit, this should be sent usernames, not numerical ids.
2021-03-08 16:29:48 -05:00
Alexander Skvortsov
612a57c466 Use new author key for filtering posts
Fixes https://github.com/flarum/core/issues/2671
2021-03-08 16:21:36 -05:00
Alexander Skvortsov
8eea0985a4
Split JSDoc directives to separate lines. 2021-03-07 17:35:58 -05:00
Sami Mazouz
91d5d9c176
Use absolute positioning for the Composer on Safari (#2660) 2021-03-07 16:31:46 -05:00
Alexander Skvortsov
3aa118ab94
Fix search box out of screen (#2650)
Programatically set search results max height
2021-03-07 16:31:23 -05:00
Alexander Skvortsov
ddac07d991
Move TextEditor to common (#2649) 2021-03-04 16:51:34 -05:00
daniellesniak
a65e1de641
Convert common helpers to Typescript (#2541) 2021-03-03 18:50:54 -05:00
Charlie
b7379bf91b
Simplify Extension Categories (#2604) 2021-03-01 17:25:55 -05:00