Commit Graph

17513 Commits

Author SHA1 Message Date
Penar Musaraj
74706bab10
UX: Add Enter hint to search dropdown (#14587) 2021-10-13 12:09:28 -04:00
Penar Musaraj
a3fde50b62
A11Y: Don't output aria label identical to title (#14586) 2021-10-13 11:19:38 -04:00
Joffrey JAFFEUX
11bd3438c4
FIX: groups using users icon were lacking margin in search (#14591) 2021-10-13 12:38:35 +02:00
Bianca Nenciu
c4843fc1c1
FEATURE: Allow admins to permanently delete posts and topics (#14406)
Sometimes administrators want to permanently delete posts and topics
from the database. To make sure that this is done for a good reasons,
administrators can do this only after one minute has passed since the
post was deleted or immediately if another administrator does it.
2021-10-13 12:53:23 +03:00
Gerhard Schlager
76c9de2d04
UX: Add missing translation (#14592) 2021-10-13 11:23:53 +02:00
Joffrey JAFFEUX
b59c419253
FIX: attempts to observe preview mutation asap (#14590) 2021-10-13 09:28:55 +02:00
Joffrey JAFFEUX
00e8baffa2
FIX: attempts to enforce caret position in filter (#14589) 2021-10-13 08:19:34 +02:00
Penar Musaraj
308823a253
FIX: Use absolute URLs in search shortcut (#14585) 2021-10-13 10:14:45 +05:30
Vinoth Kannan
1b99f99ff7
UX: remove aria-label for buttons when title attribute exists. (#14529)
Both `aria-label` and `title` have the same value and NVDA reading both the texts while navigating between buttons. NVDA already has an open issue https://github.com/nvaccess/nvda/issues/7841. We're removing `aria-label` until they fix it.
2021-10-12 23:55:59 +05:30
David Taylor
100095af50
UX: Improve route hierarchy in for user-invites (#14583)
Previously the sidebar was being rendered in the `-show` routes, which meant that it disappeared and re-appeared when each tab was loading. This commit creates a parent `user-invited` route with the sidebar, and then renders the `-show` view in an outlet.

To avoid an extra HTTP request, the invite counts for the sidebar are fetched by the `-show` routes, and then applied to the parent controller. This means that there can be a very slight delay before the counts are displayed, but it is almost unnoticeable in normal use.
2021-10-12 17:39:47 +01:00
Joffrey JAFFEUX
be7dcf694e
DEV: correct argument names for addGlobalNotice (#14582) 2021-10-12 17:01:54 +02:00
Arpit Jalan
d2f9108470
FIX: show group filter only when user is logged in and groups are present (#14578) 2021-10-12 19:46:39 +05:30
Penar Musaraj
915c93625a
DEV: Add pluginApi support for quick search tips (#14556) 2021-10-12 09:54:00 -04:00
Alan Guo Xiang Tan
baaee1ca26
UX: Restore new messages button on mobile on PM route. (#14576)
Follow-up to 9d5da2b383
2021-10-12 10:38:31 +08:00
Alan Guo Xiang Tan
d0595127cc
FIX: Missing excerpt for post small actions in topic timeline. (#14547) 2021-10-12 09:20:35 +08:00
David Taylor
821f14d8e0 DEV: Add basic acceptance tests for quote shortcut and fast-edit 2021-10-11 10:46:38 +01:00
David Taylor
9a3a5b19e9 DEV: Move duplicate selectText helper into qunit-helpers 2021-10-11 10:46:38 +01:00
David Taylor
9efc57f0c6 FEATURE: shortcuts for quote (q) and fast edit (e)
Reimplemented following the revert in ce0daae636

This approach uses the global `e`/`q` shortcuts, rather than shifting focus to the `quote-button` component. The current `quoteState` is used to determine whether the quote-button is currently visible. If yes, an appEvent transmits the intention to the quote-button component. If no, the old behavior is maintained.

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2021-10-11 10:46:38 +01:00
Robin Ward
bef5223672 DEV: Plugin API for customizing text in the composer conditionally
Co-authored-by: Isaac Janzen <issac.janzen@discourse.org>
2021-10-08 13:58:18 -04:00
David Taylor
ce0daae636
FIX: Resolve quoting issues by reverting new shortcuts (#14560)
This reverts the new e and q shortcuts for quick-edit, and quote. The current implementation of these is causing issues with quoting on mobile devices.

We intend restore these new shortcuts soon.

* Revert "FIX: Apply quote selection workaround to all browsers (#14558)"

This reverts commit 488f716c16.

* Revert "FIX: selection going missing in Safari (#14557)"

This reverts commit 538fe2cc31.

* Revert "UX: adds shortcuts for quote (q) and fast edit (e) (#14552)"

This reverts commit 2af6052307.
2021-10-08 15:31:43 +01:00
Bianca Nenciu
ba81d1853b
FIX: Disable previews if diffhtml is enabled (#14537)
diffhtml should not rerender video and audio elements so there is no
point in having these.
2021-10-08 15:57:08 +03:00
Penar Musaraj
488f716c16
FIX: Apply quote selection workaround to all browsers (#14558)
Firefox also needs this.
2021-10-07 16:17:14 -04:00
Penar Musaraj
538fe2cc31
FIX: selection going missing in Safari (#14557) 2021-10-07 14:55:38 -04:00
Penar Musaraj
aa00960638
FIX: JS error when showing topic search results (#14551) 2021-10-07 11:47:01 -04:00
Joffrey JAFFEUX
2af6052307
UX: adds shortcuts for quote (q) and fast edit (e) (#14552) 2021-10-07 17:22:28 +02:00
David Taylor
a55642a30a
DEV: Various behind-the-scenes improvements to PresenceChannel (#14518)
- Allow the `/presence/get` endpoint to return multiple channels in a single request (limited to 50)
- When multiple presence channels are initialized in a single Ember runloop, batch them into a single GET request
- Introduce the `presence-pretender` to allow easy testing of PresenceChannel-related features
- Introduce a `use_cache` boolean (default true) on the the server-side PresenceChannel initializer. Useful during testing.
2021-10-07 15:50:14 +01:00
Penar Musaraj
8a377130f4
UX: Add keyboard shortcut for fast edits (#14543) 2021-10-07 11:25:58 +02:00
Penar Musaraj
0dbc83132a
DEV: Fix flaky search test (#14546) 2021-10-06 20:57:28 -04:00
Arpit Jalan
be75d20fad
FIX: do not persist tags query param (#14527)
This commit fixes the inconsistent behaviour where a user lands on blank
page from the `/new-topic` route if the tag beign used does not have any
topic attached.

https://meta.discourse.org/t/tag-route-when-creating-a-topic-via-url/204973
2021-10-07 06:03:52 +05:30
Gerhard Schlager
d6a24e9cd7
FIX: Tooltip in quick search didn't work (#14542) 2021-10-06 23:30:05 +02:00
Penar Musaraj
6141ed31c7
UX: More consistent shortcut labels for macOS (#14538) 2021-10-06 16:20:43 -04:00
Penar Musaraj
3d5ff23b16
UX: Fix alignment of composer when tags are disabled (#14535) 2021-10-06 14:58:08 -04:00
Penar Musaraj
e9b1d29d8b
UX: Revamp quick search (#14499)
Co-authored-by: Robin Ward <robin.ward@gmail.com>
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2021-10-06 11:42:52 -04:00
Bianca Nenciu
14efd17b7b
FIX: Hide form after password reset (#14526)
When hide_email_address_taken was disabled, the forgot password modal
showed a flash message and continued to display the form causing
confusion. This change shows the flash message only when an error occurs
and in all other cases it shows a success message and hides the form.
2021-10-06 17:16:59 +03:00
Joffrey JAFFEUX
20e70d0ac5
DEV: adds a topic level bookmark toggle (#14471) 2021-10-06 11:53:57 +02:00
Krzysztof Kotlarek
6f76fb960b
FIX: select all button on group assigned page (#14523)
Button is not working properly because `updateAutoAddTopicsToBulkSelect` function is not available.

Meta: https://meta.discourse.org/t/select-all-in-group-assigned-doesnt-work/205270
2021-10-06 16:18:16 +11:00
Krzysztof Kotlarek
cb5b0cb9d8
FEATURE: save local date to calendar (#14486)
It allows saving local date to calendar.
Modal is giving option to pick between ics and google. User choice can be remembered as a default for the next actions.
2021-10-06 14:11:52 +11:00
Jordan Vidrine
6ab5f70090
UX: Change layout of invites page to match other user pages (#14520)
* UX: Change layout of invites page to match other user pages
2021-10-05 15:30:31 -05:00
Roman Rizzi
e5c257e5b5
FIX: Reenable global setting HTML support. (#14521) 2021-10-05 16:25:41 -03:00
Roman Rizzi
766d337d42
FIX: Display embeddable host's post to category. (#14517)
The host's category was successfully updated on the database, but the category property was not properly set when rendering the component for the first time.
2021-10-05 13:59:27 -03:00
Dan Ungureanu
5569723321
DEV: Add plugin outlet to the bottom of flag modal (#14413)
This will be used by discourse-akismet to show the current status of the
Akismet scan (post marked as spam, not spam, etc).
2021-10-05 17:37:16 +03:00
Jarek Radosz
d3a59e3f69
DEV: Use Set instead of array-as-an-object (#14511)
I don't know if JS engines were able to optimize-away those gigantic arrays but in any case that's a definite anti-pattern.
2021-10-05 14:35:32 +02:00
Robin Ward
cd8a608d17 FIX: Ember CLI was always loading the admin payload in dev mode
The admin payload should only be loaded if the user is staff.
2021-10-05 08:34:10 -04:00
Joffrey JAFFEUX
71cf05fbc6
DEV: observe all elements to prevent any missed mutation (#14507) 2021-10-05 12:00:05 +02:00
Alan Guo Xiang Tan
12856ab8c2
FIX: Stop tracking incoming message after navigating away take 2. (#14508)
* FIX: Stop tracking incoming message after navigating away take 2.

Previous fix in d82e5cd37c resulted in
counts being flappy as we cleared the active inbox between routes.

Co-authored-by: Osama Sayegh <asooomaasoooma90@gmail.com>
2021-10-05 15:00:44 +08:00
Alan Guo Xiang Tan
085eb56ea4
DEV: Allow onStateChange callbacks for PM topic tracking state. (#14479)
The changes here are in anticipation of a private plugin that will soon
be merged into Discourse core.
2021-10-05 14:12:01 +08:00
Alan Guo Xiang Tan
d82e5cd37c
FIX: Stop incoming message tracking after navigating away. (#14498) 2021-10-05 11:17:20 +08:00
Penar Musaraj
724c836ffa
UX: Use consistent category badge font size in dropdowns (#14502) 2021-10-04 17:05:31 -04:00
Penar Musaraj
23df78acb3
UX: Fix label in search when tagging is disabled (#14503) 2021-10-04 17:04:34 -04:00
Roman Rizzi
90a3fbc07b
DEV: Remove HTML setting type and sanitization logic. (#14440)
* DEV: Remove HTML setting type and sanitization logic.

We concluded that we don't want settings to contain HTML, so I'm removing the setting type and sanitization logic. Additionally, we no longer allow the global-notice text to contain HTML.

I searched for usages of this setting type in the `all-the-plugins` repo and found none, so I haven't added a migration for existing settings.

* Mark Global notices containing links as HTML Safe.
2021-10-04 15:40:35 -03:00
Andrei Prigorshnev
9f626f2735
FIX: empty state message on the user bookmarks page (#14257)
After adding an empty state banner to the user bookmarks page, we have found the bug. Steps to reproduce:

- Go to the user bookmarks page
- Search for something that doesn’t exist in bookmarks
- Click again Bookmarked on the sidebar or View All Bookmarks on the user menu again
2021-10-04 16:48:45 +04:00
Kris
aba08d1929
DEV: add plugin outlet to categories page (#14491) 2021-10-01 15:50:50 -04:00
David Taylor
b6937e936b
FIX: Do not show 'new or updated topics' for mobile categories page (#14490)
This banner should only show on the 'categories + latest topics' view, which is desktop-only

https://meta.discourse.org/t/204979
2021-10-01 16:52:35 +01:00
Alan Guo Xiang Tan
f38fd1a5a7
FIX: Error loading suggested topics for anon users. (#14485)
Follow-up to fc1fd1b416
2021-10-01 10:53:05 +08:00
Alan Guo Xiang Tan
dad4781806
UX: PM inboxes being expanded incorrectly when viewing tags. (#14478)
Follow-up to 9d5da2b383
2021-10-01 10:48:30 +08:00
Mark VanLandingham
0cc151c296
DEV: Export resetIdle function in desktop-notifications.js (#14474) 2021-09-29 12:41:31 -05:00
Jean
7737d56dd0
FIX: Notify incoming to categories and latest topics view specifically. (#14473) 2021-09-29 10:05:38 -04:00
David Taylor
928f102516
DEV: Clear pretender request log between test runs (#14456)
Previously we would store every FakeRequest object for all tests, resulting in many hundreds/thousands of objects in the `handledRequests` array.

This commit ensures all pretender state is reset between tests.
2021-09-29 14:43:55 +01:00
Joffrey JAFFEUX
2d4b9595e8
DEV: uses standard browser_start_timeout (#14472) 2021-09-29 13:25:34 +02:00
Andrei Prigorshnev
31970bd6fc
DEV: little cleanup in the notifications-index component (#14464)
- There's no need to pass `filter` to `user-notifications-large`. The component doesn't use it.
- Rename css class to avoid confusion (this div has nothing to-do with the Select Kit)
- Remove duplicated declarations in test fixtures
2021-09-29 15:24:55 +04:00
Joffrey JAFFEUX
fc432a9cab
FIX: incorrect interpolation was limiting to 1 dispatch / component (#14470) 2021-09-29 11:14:53 +02:00
Alan Guo Xiang Tan
a1745e05ae
FIX: Do not publish post for PM topic tracking if not new for user. (#14469) 2021-09-29 13:54:24 +08:00
Alan Guo Xiang Tan
9998090e5b
UX: Don't display group messages link for group with no messages. (#14453) 2021-09-29 10:18:56 +08:00
David Taylor
b7fc576a8c
DEV: Increase chrome JS memory limit in CI (#14446) 2021-09-28 16:36:01 +01:00
David Taylor
4fa296c3ec
DEV: Print usedJSHeapSize to the console after QUnit run (#14462)
This is `console.log`'d to the browser console. run-qunit will print this to stdout. testem will not, so a custom reporter is implemented to print this message.

The `--enable-precise-memory-info` is added so that chrome provides high-resolution memory information. This API is not supported by firefox. The logic will degrade gracefully.
2021-09-28 16:32:56 +01:00
Joffrey JAFFEUX
4dc14e3a3f
DEV: prevents route nodes to leak on each test run (#14457)
Note this commit is also adding support for teardown in pre-initializers just like we have for initializers.

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: David Taylor <david@taylorhq.com>
2021-09-28 17:08:05 +02:00
Penar Musaraj
b0b87efb83
UX: Show scrollbar only when needed in dropdowns (#14461)
Avoids showing a disabled scrollbar when not necessary.
2021-09-28 10:36:16 -04:00
David Taylor
89cc910303
DEV: Use isLegacyEmber helper in setup-tests (#14458)
We were using multiple methods to check which environment we're running in. This commit switches us to use the isLegacyEmber helper consistently. This should be a no-op, but makes the code much easier to read
2021-09-28 14:30:55 +01:00
David Taylor
7fa2eb52f7
DEV: Destroy application instance after each test (#14455)
Under Ember CLI, we create a new application instance for each test. We were not correctly destroying it after the test, causing many references to be maintaned (e.g. at the end of a test run, `Ember.Namespace.NAMESPACES` would have an entry for each application instance).

Calling `destroy` on the application instance tidies up these references, and is one step towards fixing our test memory leak problem. Unfortunately there still seem to be other references being held to the application, so this commit is not a total fix.
2021-09-28 11:37:40 +01:00
Alan Guo Xiang Tan
9d5da2b383
PERF: Revert all inboxes from messages route. (#14445)
The all inboxes was introduced in
016efeadf6 but we decided to roll it back
for performance reasons. The main performance challenge here is that PG
has to basically loop through all the PMs that a user is allowed to view
before being able to order by `Topic#bumped_at`. The all inboxes was not
planned as part of the new/unread filter so we've decided not to tackle
the performance issue for the upcoming release.

Follow-up to 016efeadf6
2021-09-28 11:58:04 +08:00
Penar Musaraj
0b69675060
UX: Adjust mobile spacing for full page search (#14450) 2021-09-27 18:03:56 -04:00
Mark VanLandingham
ba49eaccfe
DEV: Plugin API to add to document title count (#14449) 2021-09-27 13:18:49 -05:00
Rafael dos Santos Silva
1c73b97d50
FIX: Workaround Safari 15 createImageBitmap bug (#14448) 2021-09-27 15:02:17 -03:00
Joffrey JAFFEUX
6273dfad4b
REFACTOR: minor changes to api-keys-new (#14435)
- moves loading scopes to controller
- avoids declaring array
- simplify code
2021-09-27 10:43:47 +02:00
Joffrey JAFFEUX
1abe807528
REFACTOR: setting component mixin (#14437)
* REFACTOR: setting component mixing

- drops jquery usage
- extract spit function
- uses @action
- removes get usage where possible
- uses helpers
- minor changes

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-09-27 10:43:26 +02:00
Jarek Radosz
37413f180a
FIX: Do not display userColorSchemeId in the UI (#14441)
A followup to #14066. The previous fix worked correctly only if the user had the default theme active.
2021-09-24 22:50:10 +02:00
Kris
d19a64fffe
DEV: Tag topic list needs discovery outlets (#14438) 2021-09-24 13:39:07 -04:00
Penar Musaraj
9235e2ad5d
A11Y: Fix several minor issues (#14436) 2021-09-24 11:52:07 -04:00
Kris
e5754dedf4
DEV: Adding plugin outlets to avoid overrides (#14433) 2021-09-23 21:52:33 -04:00
Penar Musaraj
8cef6dabb5
A11Y: Add labels to some search fields, category notification selector (#14430) 2021-09-23 14:52:34 -04:00
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
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
Penar Musaraj
c599469e9d
UX: Adjust quote button position on mobile (#14411) 2021-09-22 09:34:29 +02: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
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
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
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
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
Penar Musaraj
ab9c63e4ee
UX: Optionally show a "Summarize" button in topic timeline (#13533) 2021-09-16 15:15:00 -04:00
Andrei Prigorshnev
804274af47
FEATURE: improve blank page syndrome on the activity/topics, activity/read and group messages pages (#14313) 2021-09-16 22:24:27 +04:00
Andrei Prigorshnev
477bbc372e
FEATURE: improve blank page syndrome on the user activity pages (#14311)
This improves blank page syndrome on the next pages:
* activity
* activity/replies
* activity/drafts
* activity/likes-given
2021-09-16 21:35:34 +04:00
Alan Guo Xiang Tan
98dcbd214c
FIX: Remove incoming messages for read events. (#14352)
This prevents the incoming message banner from showing unnecessarily
when reading a post and then navigating back to the unread list.
2021-09-16 11:53:23 +08:00
Martin Brennan
41e19adb0d
DEV: Ignore reminder_type for bookmarks (#14349)
We don't actually use the reminder_type for bookmarks anywhere;
we are just storing it. It has no bearing on the UI. It used
to be relevant with the at_desktop bookmark reminders (see
fa572d3a7a)

This commit marks the column as readonly, ignores it, and removes
the index, and it will be dropped in a later PR. Some plugins
are relying on reminder_type partially so some stubs have been
left in place to avoid errors.
2021-09-16 09:56:54 +10:00
Joffrey JAFFEUX
b83868bfb0
FEATURE: experimental fast edit (#14340)
Fast edit allows you to quickly edit a typo in a post, this is experimental ATM and behind a site setting: `enable_fast_edit` (default false)
2021-09-15 17:10:30 +02:00
Martin Brennan
f6afcdf8a8
DEV: Change to show failed tests only Ember tests (#14335)
This commit sets `tap_failed_tests_only` to `true` in our testem config, so now only the failing tests will show in our GitHub CI Ember test runs, which saves developers from having to hunt through all of the passing tests using GitHub's janky console output scrollback.
2021-09-15 08:31:37 +10:00
Mark VanLandingham
68bb7c5a66
DEV: Support translated title in desktop/notifications (#14325) 2021-09-14 09:57:38 -05:00
Joffrey JAFFEUX
e263b84196
FIX: prevents extreme cases to overflow in selected content (#14339)
It would for example cause an issue for a lot of selected items with long names.
2021-09-14 10:49:43 -04:00
Dan Ungureanu
856732786f
FIX: Do not suggest Emoji when in open code blocks (#14337)
There was a check for closed code blocks (which had both opening and
closing markups), but it did not work for the case when the text ends
in an open code block.
2021-09-14 17:37:14 +03:00
Penar Musaraj
19b14d6ec2
UX: Fix tab groups editing layout issues on mobile (#14329) 2021-09-14 09:55:40 -04:00
Bianca Nenciu
6a7ea66670
FEATURE: Use second factor for admin confirmation (#14293)
Administrators can use second factor to confirm granting admin access
without using email. The old method of confirmation via email is still
used as a fallback when second factor is unavailable.
2021-09-14 15:19:28 +03:00
Dan Ungureanu
f517b6997c
FEATURE: Cook drafts excerpt in user activity (#14315)
The previous excerpt was a simple truncated raw message. Starting with
this commit, the raw content of the draft is cooked and an excerpt is
extracted from it. The logic for extracting the excerpt mimics the the
`ExcerptParser` class, but does not implement all functionality, being
a much simpler implementation.

The two draft controllers have been merged into one and the /draft.json
route has been changed to /drafts.json to be consistent with the other
route names.
2021-09-14 15:18:01 +03:00
Bianca Nenciu
dde66b9e16
FIX: Update only present fields in request (#14310)
Some category fields were always updated, even if they were not present
in the request. When this happened, these field were erased.
2021-09-14 15:04:54 +03:00
Penar Musaraj
9360ccdc20
DEV: Match viewport metadata on mobile in Ember CLI (#14330) 2021-09-13 21:14:04 -04:00
Robin Ward
7f769e9e76 FIX: Optimistically fix topic timeline state issues
This is my second try at this. The first b246a63a59 raised an issue
with the event delegation not working because the topic id changed.

This adds support for delegating events to dynamic keys by passing a
function where a static key would normally be needed. This means that
each timeline will have its own unique state key and events will only
delegate to the proper topic.
2021-09-13 16:29:39 -04:00
Penar Musaraj
b90eb0da14
Revert "DEV: Define --footer-nav-height css var (#14008)" (#14327)
This reverts commit 3119b881aa.
2021-09-13 15:09:06 -04:00
Penar Musaraj
97c0659fcc
UX: Use standard font size for buttons at the end of /top page (#14326) 2021-09-13 14:18:41 -04:00
David Taylor
928f000b4b
FIX: Use <textarea> for theme translations (#14322)
Translations are often multi-line. Using a regular `<input>` doesn't allow newlines, so if you try to edit a multiline theme translation, all the line breaks will be removed.

This commit updates the theme translations UI to use `<textarea>`, just like the core translation editing UI.
2021-09-13 18:57:19 +01:00
Penar Musaraj
a03d8a147f
UX: Fix mobile styling for admin color schemes (#14314) 2021-09-13 13:43:57 -04:00
Penar Musaraj
954f8f8e7e
UX: Fix alignment for admin controls on mobile (#14312) 2021-09-13 13:43:43 -04:00
Martin Brennan
f3273bd43e
FIX: Do not error mobile upload button if !allowUpload (#14317)
allowUpload can be false for the composer if there are no
allowed file extensions. This causes the _bindMobileUploadButton
code to fail because the button does not get rendered in the
template if !allowUpload. This commit changes composer-editor
to only bind upload functionality if allowUpload.
2021-09-13 09:16:03 +10:00
Robin Ward
4e0a43f211 Revert "FIX: Give the topic timeline unique keys for state"
This reverts commit b246a63a59.
2021-09-10 19:56:19 -04:00
Penar Musaraj
33fb3b7ec8
UX: Fix date input display in iOS (#14307) 2021-09-10 15:13:45 -04:00
Penar Musaraj
6c7f4e15b6
FIX: Mobile nav styling (#14309) 2021-09-10 15:13:26 -04:00
Robin Ward
b246a63a59 FIX: Give the topic timeline unique keys for state
We've observed an error where the back button is displayed improperly in
the topic timeline. It's unfortunately been hard to reproduce but we
suspect it's related to leftover state when re-rendering.

This fix optimistically tries to fix the error by introducing the
topic's id to the unique key the widgets use for state. We can deploy
this and keep an eye out for the bug in the future.
2021-09-10 13:03:45 -04:00
Penar Musaraj
299d0ca445
UX: Minor layout tweaks to dropdowns (#14299)
- fixes mini-tag-chooser validation message
- fixes ellipsis overflow in mini-tag-chooser
- removes redundant `border-radius: 0` styles
- simplifies `user-notifications-dropdown` styling and adds example to styleguide
2021-09-10 09:00:41 -04:00