Commit Graph

25527 Commits

Author SHA1 Message Date
Penar Musaraj
8a250a1eac
UX: Ensure sticky elements don't overflow header (#14432) 2021-09-23 14:51:06 -04:00
Jean
fd0e287da6
FIX: make update banner always available on the categories view (#14431) 2021-09-23 13:10:05 -04:00
Penar Musaraj
8115e5ef76
UX: Better placement for bulk select actions button (#14419) 2021-09-23 10:50:10 -04:00
Joffrey JAFFEUX
456189795a
FIX: more robust tabindex restriction on preview (#14425) 2021-09-23 16:27:51 +02:00
Joffrey JAFFEUX
372479bada
UX: move fast edit before sharing (#14429)
As sharing has some hover behavior, it was looking slightly clunky with fast edit changing position. Putting sharing at the last position will reduce this effect.
2021-09-23 09:56:00 -04:00
David Taylor
688e03fc42
FIX: Ensure subcategory list is hidden when not required (#14424)
When the loading spinner is removed (e.g. via the loading-slider component), the subcategory list view will persist, even when no longer required. This is because we were conditionally rendering the list into the `header-list-container` outlet. When the condition was false, we were doing nothing. Instead, we should use `disconectOutlet` to make sure the content is removed from the DOM.
2021-09-23 12:18:24 +01:00
Martin Brennan
ec087027b3
DEV: Disable upload instrumentation if performance.measure returns undefined (#14427)
Firefox does not return a PerformanceMeasure object when using
performance.mark and performance.measure, even though MDN says it
should https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure#return_value

So for now, we disable the upload instrumentation with a test
to see if a PerformanceMeasure (or anything really) is returned.
2021-09-23 11:34:51 +10:00
Martin Brennan
57f17854fb
FIX: Do not error _removeDeleteOnOwnerReplyBookmarks on navigate (#14426)
When creating a reply after already navigating out of the
topic (e.g. open the reply composer, go to a different topic,
then create the post), the _removeDeleteOnOwnerReplyBookmarks
function was erroring because it relied on the topic model
being present.

We can skip this function altogether if the topic model is _not_
present, because the PostCreator already takes care of deleting
bookmarks with the on_owner_reply auto_delete_preference. The
_removeDeleteOnOwnerReplyBookmarks function just cleans up the
in-memory post stream and topic model.
2021-09-23 11:18:49 +10:00
Rafael dos Santos Silva
38b8eb5971
FIX: Don't try to boot the ember app on old browsers (#14423) 2021-09-22 16:54:57 -03:00
Penar Musaraj
e8182a133a
DEV: Fix flaky search-full-page test (#14421) 2021-09-22 15:05:00 -04:00
Jarek Radosz
db69b87187
DEV: Fix theme qunit error messages (#14420) 2021-09-22 20:00:19 +02:00
Rafael dos Santos Silva
a4cef67e14
FIX: Feature detect globalThis (#14410)
* FIX: Feature detect globalThis

So browsers without support will receive a warning and browse our JS-less view.
2021-09-22 11:39:41 -03:00
Dan Ungureanu
2e085915cc
FIX: include_ serializer methods must end with ? (#14407)
Otherwise, they are simply dead code and the attribute is visible by
default. These bugs did not expose any sensitive information.
2021-09-22 16:01:25 +03:00
Penar Musaraj
c599469e9d
UX: Adjust quote button position on mobile (#14411) 2021-09-22 09:34:29 +02:00
Martin Brennan
a27d2b124c
FIX: Use unread post excerpt for topic-level bookmark excerpt (#14414)
In the user bookmark list, when we show the excerpt of the bookmark
(which is usually just the bookmarked post excerpt), we want to show
the first unread post's excerpt instead for for_topic bookmarks. This
is because when the user clicks on that bookmark link, they are taken
to the first unread post in the topic, not the OP, as per:

27699648ef
2021-09-22 12:47:36 +10:00
Martin Brennan
effc3ef7b4
DEV: Use i18n.toHumanSize instead of formatBytes (#14415)
Follow up to dba6a5eabf. I
introduced a new formatBytes function there unnecessarily
instead of using the existing toHumanSize.
2021-09-22 10:27:18 +10:00
Martin Brennan
d0e1c222f7
DEV: Add instrumentation for uploads (#14397)
This commit allows for measuring the time taken for
individual uploads via the new uppy interfaces, only
if the enable_upload_debug_mode site setting is enabled.

Also in this PR, for upload errors with a specific message
locally, we return the real message to show in the modal
instead of the upload.failed message so the developer
does not have to dig around in logs.
2021-09-22 08:43:02 +10:00
Martin Brennan
dba6a5eabf
FEATURE: Humanize file size error messages (#14398)
The file size error messages for max_image_size_kb and
max_attachment_size_kb are shown to the user in the KB
format, regardless of how large the limit is. Since we
are going to support uploading much larger files soon,
this KB-based limit soon becomes unfriendly to the end
user.

For example, if the max attachment size is set to 512000
KB, this is what the user sees:

> Sorry, the file you are trying to upload is too big (maximum
size is 512000KB)

This makes the user do math. In almost all file explorers that
a regular user would be familiar width, the file size is shown
in a format based on the maximum increment (e.g. KB, MB, GB).

This commit changes the behaviour to output a humanized file size
instead of the raw KB. For the above example, it would now say:

> Sorry, the file you are trying to upload is too big (maximum
size is 512 MB)

This humanization also handles decimals, e.g. 1536KB = 1.5 MB
2021-09-22 07:59:45 +10:00
Penar Musaraj
3e3043dbaa
UX: Add second Search button on mobile (#14404) 2021-09-21 13:02:00 -04:00
Jean
ed0b6a3660
FEATURE: add update banner to the categories and latest topics view (#14403) 2021-09-21 12:35:38 -04:00
David Taylor
4bdeb45727 DEV: Add plugin-related parameters to the QUnit web UI
This commit also hides a number of options which are not used during Discourse development.

Change have been tested on both the legacy `/qunit` route, and the Ember CLI `/tests` route.
2021-09-21 16:50:30 +01:00
David Taylor
402162e18a DEV: Add qunit filter parameter support to Ember CLI tests route
This adds support for `qunit_skip_core`, `qunit_skip_plugins` and `qunit_single_plugin` parameters on the Ember CLI `/tests` route using the `addModuleExcludeMatcher` API. Legacy support is maintained for the `/qunit` route.
2021-09-21 16:50:30 +01:00
Penar Musaraj
c52513c445
A11Y: Add more descriptive labels for some dropdowns (#14402) 2021-09-21 11:19:49 -04:00
Penar Musaraj
c13127b024
A11Y: Use listbox role for dropdowns (#14391) 2021-09-21 09:31:40 -04:00
Bianca Nenciu
bba973f0d5
DEV: Trigger an app event when a card is shown (#14399)
This replaces the unused lastEvent field with an app event trigger.
2021-09-21 15:51:45 +03:00
Bianca Nenciu
d940a8e41a
DEV: Use a better selector for search menu (#14390)
".search-menu" matches the parent element of the element that was
previously selected. This is a better choice because it offers some
flexibility over the DOM structure without breaking the keyboard
shortcuts.
2021-09-21 15:51:29 +03:00
Martin Brennan
27699648ef
FEATURE: Go to last unread for topic-level bookmark links (#14396)
Instead of going to the OP of the topic for topic-level bookmarks
(which are bookmarks where for_topic is true) when clicking on the
bookmark in the quick access menu or on the user bookmark list,
this commit takes the user to the last unread post in
the topic instead. This should be generally more useful than landing
on the unchanging OP.

To make this work nicely, I needed to add the last_read_post_number to
the BookmarkQuery based on the TopicUser association. It should not add
too much extra weight to the query, because it is limited to the user
that we are fetching bookmarks for.

Also fixed an issue where the bookmark serializer highest_post_number was
not taking into account whether the user was staff, which is when we
should use highest_staff_post_number instead.
2021-09-21 13:49:56 +10:00
Vinoth Kannan
28be284b27
FIX: use active record update_attribute instead of mini sql. (#14367)
* DEV: use active record `save!` instead of mini sql.

The "save" method will trigger the before_save callback "match_primary_group_changes" for User model. Else `flair_group_id` won't be removed from the user.

* check whether the method `match_primary_group_changes` called or not.
2021-09-21 09:29:12 +08:00
Martin Brennan
0c42a1e5f3
FEATURE: Topic-level bookmarks (#14353)
Allows creating a bookmark with the `for_topic` flag introduced in d1d2298a4c set to true. This happens when clicking on the Bookmark button in the topic footer when no other posts are bookmarked. In a later PR, when clicking on these topic-level bookmarks the user will be taken to the last unread post in the topic, not the OP. Only the OP can have a topic level bookmark, and users can also make a post-level bookmark on the OP of the topic.

I had to do some pretty heavy refactors because most of the bookmark code in the JS topics controller was centred around instances of Post JS models, but the topic level bookmark is not centred around a post. Some refactors were just for readability as well.

Also removes some missed reminderType code from the purge in 41e19adb0d
2021-09-21 08:45:47 +10:00
Martin Brennan
02f7035cbe
DEV: Improve uppy plugin base and large file handling (#14395)
We want to be able to skip plugins from doing any work under
certain conditions, and to be able raise their own errors if
a file being uploaded is completely incompatible with the concept
of the plugin if it is enabled. For example, the UppyChecksum plugin
is happy to skip hashing large files, but the UppyUploadEncrypt
plugin from discourse-encrypt relies on the file being encrypted
to do anything with the upload, so it is considered a blocking
error if the user uploads a file that is too large.

This improves the base functions available in uppy-plugin-base and
extendable-uploader to handle this, as well as introducing a
HUGE_FILE_THRESHOLD_BYTES variable which represents 100MB in bytes,
matching the ExternalUploadManager::DOWNLOAD_LIMIT on the
server side.

discourse-encrypt to take advantage of this new functionality will
follow in discourse/discourse-encrypt#141
2021-09-21 08:41:07 +10:00
Osama Sayegh
37a3bf9c11
DEV: Add post_alerter_after_save_post event (#14388)
Also promote the `create_notification_alert` and `push_notification`
methods from instance methods to class methods so that plugins can call
them. This is temporary until we add a more comprehensive API for
extending `PostAlerter`.
2021-09-20 21:18:38 +03:00
Kris
a7c342ccb9
REFACTOR: move composer min-height to CSS (#14378) 2021-09-20 12:21:24 -04:00
Kris
a5f8996b99
UX: Share button margin consistency (#14376)
* UX: make share modal space consistent

* remove duplicate margin
2021-09-20 12:21:13 -04:00
Kris
78481832a4
UX: fix profile button spacing (#14375) 2021-09-20 12:21:04 -04:00
Bianca Nenciu
5e8a42e55b
FIX: Do not reload card if already loaded (#14129)
This changes include some used for making it easier to extend user card
functionality.
2021-09-20 19:00:04 +03:00
Penar Musaraj
dfeca42bf8
FEATURE: user/category/tag results in full page search (#14346)
See PR for details, this commit also changes the layout of the full page search.
2021-09-20 10:01:11 -04:00
Penar Musaraj
a736ff5f69
DEV: Clean up some styles (#14374) 2021-09-20 09:52:03 -04:00
Joffrey JAFFEUX
0dd28cdd95
DEV: observes used properties in reason text (#14389) 2021-09-20 14:56:33 +02:00
Martin Brennan
5fb45e712f
Revert "DEV: Improve uppy plugin base and large file handling (#14383)" (#14387)
This reverts commit 36bd6e8c3b.
2021-09-20 16:59:23 +10:00
Martin Brennan
36bd6e8c3b
DEV: Improve uppy plugin base and large file handling (#14383)
We want to be able to skip plugins from doing any work under
certain conditions, and to be able raise their own errors if
a file being uploaded is completely incompatible with the concept
of the plugin if it is enabled. For example, the UppyChecksum plugin
is happy to skip hashing large files, but the UppyUploadEncrypt
plugin from discourse-encrypt relies on the file being encrypted
to do anything with the upload, so it is considered a blocking
error if the user uploads a file that is too large.

This improves the base functions available in uppy-plugin-base and
extendable-uploader to handle this, as well as introducing a
HUGE_FILE_THRESHOLD_BYTES variable which represents 100MB in bytes,
matching the ExternalUploadManager::DOWNLOAD_LIMIT on the
server side.

discourse-encrypt to take advantage of this new functionality will
follow in https://github.com/discourse/discourse-encrypt/pull/141
2021-09-20 16:12:26 +10:00
Vinoth Kannan
a8b2e7e343
DEV: trash category definition topic instead of destroying. (#14356)
After deleting a category, we should soft-delete the category definition topic instead of hard deleting it. Else it causes issues while doing the user merge action if the source user has an orphan post that belongs to the deleted topic.
2021-09-20 11:20:49 +05:30
Andrei Prigorshnev
b6ccc9c37a
FIX: empty state message on the group messages pages (#14371) 2021-09-20 11:38:57 +08:00
Penar Musaraj
e316467169
UX: Improve composer button bar on mobile (#14373) 2021-09-17 17:26:48 -04:00
Mark VanLandingham
cb1210da35
DEV: Set composer upload btn selectors in component (#14324) 2021-09-17 13:06:31 -05:00
Mark VanLandingham
cb0b39d16e
DEV: Add chat to notifications to test notification-types (#14372) 2021-09-17 11:56:21 -05:00
Penar Musaraj
fe17bcbcc3
UX: Prevent invite form fields from resizing (#14370) 2021-09-17 12:42:48 -04:00
Penar Musaraj
cbf6895981
UX: Fix date input icon display issues (#14369) 2021-09-17 12:07:10 -04:00
Joffrey JAFFEUX
5a5b166b6d
UX: minor fast edit tweaks (#14368)
- do not reduce opacity of disabled buttons if they are loading
- replace ‘|’ by single quotes not double quotes
- always start from index 0
- reduces amount of work by checking row's length
- apply quotefix to fallback
- do not add 1 to caretposition if index is 0
2021-09-17 15:36:57 +02:00
Bianca Nenciu
c9ad9bff8a
FIX: Update only passed custom fields (#14357)
It used to replace custom fields instead of updating only the custom
fields that were passed. The changes to custom fields will also be
logged.
2021-09-17 13:37:56 +03:00
Joffrey JAFFEUX
8002b95682
UX: improves fast edit fallback handling (#14366)
The algorithm will now do the following:
- split selection to retain only first line
- removes possible "* "
- check for first inclusion
- fallback to first row if nothing found
2021-09-17 11:21:50 +02:00