Commit Graph

26335 Commits

Author SHA1 Message Date
Joffrey JAFFEUX
c0e2a01d9f
PERF: attempts to resort to compute markdown in less cases (#15762) 2022-02-01 15:28:50 +01:00
Rafael dos Santos Silva
3f694e4ab5
FEATURE: Use native color-picker (#15748) 2022-02-01 11:18:13 -03:00
Andrei Prigorshnev
810391f474
FIX: some options on the topic timer modal weren't timezone aware (#15749)
These options weren't timezone aware:
- Two Weeks
- Six Months
2022-02-01 16:55:26 +04:00
Andrei Prigorshnev
cd2e7d5436
FEATURE: show the this weekend option on the bookmark modal (#15755) 2022-02-01 16:10:09 +04:00
Joffrey JAFFEUX
bb9015e811
DEV: uses innerHTML to decide if fast-edit is possible (#15760)
We don't need raw to decide if we can fast edit or not, we will fetch the raw later when we do the replacement, but this step can be done directly from innerHTML.
2022-02-01 11:58:04 +01:00
Joffrey JAFFEUX
c46b55dc3b
PERF: prevents any fast edit work if you can't edit (#15759) 2022-02-01 11:28:07 +01:00
Penar Musaraj
48cf5e2fbc
A11Y: Use autocomplete="off" for composer title (#15758) 2022-02-01 10:08:58 +01:00
Kyle E. Mitchell
89a051eac1
UX: Add text-decoration to <ins> and <del> (#15726) 2022-02-01 09:42:14 +11:00
Robin Ward
e3c5a40432
DEV: Clean up skipped tests (#15747)
Many of the tests work now that other, general fixes have been made.
I've deleted some that seem to have lost functionality.
2022-01-31 15:31:13 -05:00
Andrei Prigorshnev
18116433ee
FIX: show the Next Monday label instead of Monday on Sundays (#15745) 2022-01-31 15:15:20 +04:00
Penar Musaraj
30454b3f27
UX: try select-kit autocomplete Chrome fix (#15752) 2022-01-31 15:35:51 +11:00
Andrei Prigorshnev
5cce39278a
DEV: remove unused function in d-editor (#15680) 2022-01-28 17:12:58 +04:00
David Taylor
fe1e66ba9d
DEV: Add backwards-compat for SiteSettings/User globals in ember-cli (#15719) 2022-01-28 11:31:19 +00:00
Martin Brennan
0b8d0a14d7
DEV: Add markdown_additional_options to Site (#15738)
Sometimes plugins need to have additional data or options available
when rendering custom markdown features/rules that are not available
on the default opts.discourse object. These additional options should
be namespaced to the plugin adding them.

```
Site.markdown_additional_options["chat"] = { limited_pretty_text_markdown_rules: [] }
```

These are passed down to markdown rules on opts.discourse.additionalOptions.

The main motivation for adding this is the chat plugin, which currently stores
chat_pretty_text_features and chat_pretty_text_markdown_rules on
the Site object via additions to the serializer, and the Site object is
not accessible to import via markdown rules (either through
Site.current() or through container.lookup). So, to have this working
for both front + backend code, we need to attach these additional options
from the Site object onto the markdown options object.
2022-01-28 13:02:02 +10:00
Martin Brennan
68fe6903f7
DEV: Remove jQuery UI vendor dependencies (#15700)
We no longer use jQuery UI for anything since getting
rid of jQuery file uploader in 667a8a63b3,
so we can safely remove these now.
2022-01-28 11:21:59 +11:00
Robin Ward
5c694e62ba Update app/assets/javascripts/discourse/tests/setup-tests.js
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2022-01-27 16:37:48 -05:00
Robin Ward
3350657553 DEV: Clean up HTML state between tests
A bunch of tests were leaving leftovers in the DOM like class names,
custom styles and scroll positions. This ensures they are cleared
between tests.
2022-01-27 16:37:48 -05:00
Robin Ward
14d31417de Revert "Revert "DEV: Run Ember CLI tests in random order" (#15717)"
The worst of the flaky tests should be fixed now, so let's re-enable
this.
2022-01-27 12:22:20 -05:00
Alan Guo Xiang Tan
09ec0ce744 DEV: Fix typo in comment. 2022-01-27 14:58:11 +08:00
Gerhard Schlager
1fef96a2e7
FIX: Prevent "integer out of range" when merging post timings (#15723) 2022-01-26 23:34:28 +01:00
Robin Ward
a560f9d44b FIX: This was causing a flaky test in Ember CLI
The path should be `/topics/bulk` not `topics/bulk` (leading slash.)
2022-01-26 14:53:25 -05:00
David Taylor
2464839cbf
Revert "DEV: Run Ember CLI tests in random order" (#15717)
This reverts commit f43bba8d59.

Adding randomness has introduced a lot of flakiness in our ember-cli tests. We should fix those issues at the source. However, given the upcoming stable release, this randomness has been reverted so that the stable release includes a stable test suite. Having a stable test suite on stable will make backporting future commits much easier.
2022-01-26 15:30:03 +00:00
Dan Ungureanu
f5b94f152f
FIX: Allow staff to reset passwords by username (#15709)
When staff visits the user profile of another user, the `email` field
in the model is empty. In this case, staff cannot send the reset email
password because nothing is passed in the `login` field.

This commit changes the behavior for staff users to allow resetting
password by username instead.
2022-01-26 10:39:58 +02:00
Robin Ward
f43bba8d59 DEV: Run Ember CLI tests in random order
In browser this uses the `seed` config, in ember exam it adds `--random`
as a parameter.
2022-01-25 14:49:40 -05:00
David Taylor
c6f8729b5c
DEV: Move OAuth2UserInfo deprecation to after_save (#15704)
We initialize models as part of the warmup process in production, so this was being logged on every boot. We only want to log if a plugin is actually using the model, so after_save is a safer bet.
2022-01-25 10:29:31 +00:00
Osama Sayegh
5dd8b827e8
DEV: Update fixture to fix tests (#15699)
Follow-up to a742952c8d.
2022-01-25 00:44:14 +03:00
Osama Sayegh
a742952c8d
FIX: Client should be able to route ID-less topic URLs (#15697)
The topic ID portion of the topic URL is optional in Discourse as long as the topic slug is unique across the site. If you navigate to a topic without the ID in the URL, Discourse will redirect you to the canonical version of the URL that includes the ID.

However, we have a now regression where the client app doesn't correctly handle ID-less topic URLs displays an error message when the user clicks on such URL. The regression was introduced b537d591b3 when we switched from `DiscourseURL.routeTo` to using Ember's router to perform the redirecting to the canonical version of the URL, but the problem is that the canonical version comes from the server and it contains the hostname which the Ember router doesn't understand because it expects a relative URL.

This PR fixes the problem by constructing a relative URL that contains the topic slug and ID and passing that to the Ember route.
2022-01-24 23:19:35 +03:00
Alan Guo Xiang Tan
77137c5d29 FIX: Single line emojis has emoji metadata indexed twice.
This commit fixes a bug where we our `HTMLScrubber` was only searching
for emoji img tags which contains only the "emoji" class. However, our emoji image tags
may contain more than just the "emoji" class like "only-emoji" when an
emoji exists by itself on a single line.
2022-01-24 14:03:17 +08:00
Bianca Nenciu
48e5d1af03
FIX: Improve top links section from user summary (#15675)
* Do not extract links for hotlinked images
* Include only links that have been clicked at least once in user
summary
2022-01-24 11:33:23 +11:00
Andrei Prigorshnev
cd68279f5c
DEV: use query() instead of queryAll() in tests (#15681) 2022-01-24 11:27:58 +11:00
Penar Musaraj
1f2226270e
FIX: Restore outlet in mobile views (#15683) 2022-01-23 18:41:01 +01:00
Blake Erickson
4bf6789bd7
DEV: Do not use hard-coded everyone group id (#15679)
Follow up to: 12f041de5d

Probably best to lookup the "everyone" group_id instead of hard-coding
it to `0`. Also now its more clear what this `0` means.
2022-01-21 15:56:45 -07:00
Robin Ward
78852e9754 FIX: Tests should never cloak posts
Depending on the load order of modules, the post cloaking code might
not be disabled properly in test mode, which results in flakey failures.
2022-01-21 14:32:26 -05:00
David Taylor
6c3df84a93
DEV: In themes:update, only update themes which are out-of-date (#15676)
Running `update_from_remote` and `save!` cause a number of side-effects, including instructing all clients to reload CSS files. If there are no changes, then this is wasteful, and can even cause a 'flicker' effect on clients as they reload CSS.

This commit checks if any updates are available before triggering `update_from_remote` / `save!`. This should be much faster, and stop the 'flickering' UX from happening on every themes:update run.

It also improves the output of the command to include the from/to commit hashes, which may be useful for debugging issues. For example:

```
Checking 'Alien Night | A Dark Discourse Theme' for 'default'... already up to date
Checking 'Star Wars' for 'default'... updating from d8a170dd to 66b9756f
Checking 'Media Overlay' for 'default'... already up to date
```
2022-01-21 18:23:26 +00:00
Bianca Nenciu
3bb1cd5c4d
FIX: Select topics instead of posts (#15674)
A code error caused post objects to be added to the selected array.
2022-01-21 19:52:09 +02:00
Dan Ungureanu
984089c94a
DEV: Add test for avatar-uploader (#15633)
Follow up to 64b089072a.
2022-01-21 19:51:24 +02:00
Dan Ungureanu
d0f4f408af
DEV: Simplify emoji-uploader tests (#15672)
Removes one layer of indirection in the tests. `emoji-uploader`'s
`uploadDone` can call the test handler directly without going through
an additional action method.
2022-01-21 19:51:04 +02:00
Martin Brennan
70af45055a
DEV: Clear custom field preload proxy on preload_custom_fields (#15671)
If a model class calls preload_custom_fields twice then
we have to clear this otherwise the fields are cached inside the
already existing proxy and no new ones are added, so when we check
for custom_fields[KEY] an error is likely to occur
2022-01-21 14:29:51 +10:00
Martin Brennan
c1ae214c7b
DEV: Add more info to N1 custom field error (#15670)
This commit makes a more specific N1NotPreLoadedError from
StandardError to raise when a custom field is loaded before
being preloaded, so it is easier to test that this does
not happen from plugins. Also adds the name of the class
trying to load the custom field to the error message.
2022-01-21 13:21:13 +10:00
Alan Guo Xiang Tan
e4e37257cc FIX: Handle malformed URLs in TopicEmbed.absolutize_urls. 2022-01-21 11:18:54 +08:00
Robin Ward
d28808e866 FIX: The service observer was using this incorrectly
It was pointing at nothing due to context.
2022-01-20 16:51:36 -05:00
Régis Hanol
a582c49601
FIX: possible ReDOS in markdown newline rule (#15646)
Backport ffc49ab46b
2022-01-20 22:32:01 +01:00
Robin Ward
224f0a2655 DEV: This ensures that teardowns are executed if initializers are run
It does this by creating a new initializer that runs every time the app
is booted to track the current test. Then after each test, we see if the
app needs to be torn down.
2022-01-20 16:23:54 -05:00
Osama Sayegh
688be607c9
FIX: Allowed URLs for API scopes added by plugins (#15662) 2022-01-20 22:29:03 +03:00
Robin Ward
2dc0f36e07 DEV: A bunch of tests (like controller) weren't cleaning up
This creates a helper function with all the cleanup tasks we need to do
after tests, then makes sure to call it after tests that previously
weren't.

This fixes a lot of flakey tests.
2022-01-20 11:58:58 -05:00
Jarek Radosz
23aceedbd5
FIX: Display composer popovers over dropdowns (#15659) 2022-01-20 17:55:55 +01:00
Joffrey JAFFEUX
2426e3510d
FIX: correctly access last poster username (#15661)
Testing this is kinda complicated ATM (especially mobile template with hbr) , this is a component we should definitely aim to test very extensively when we move away from hbr templates.
2022-01-20 17:27:14 +01:00
Kris
1d02b9728d
A11Y: tag should be "role" not "aria-role" (#15653) 2022-01-20 09:58:32 -05:00
Kris
6a48106ed4
A11Y: do not use duplicate IDs (#15654) 2022-01-20 08:58:08 -05:00
Jarek Radosz
b9f650e55e
UX: Fix composer popup placement (#15660) 2022-01-20 14:21:13 +01:00