Commit Graph

18099 Commits

Author SHA1 Message Date
Kris
55007fbf55
UX: crawler view always shows 0 votes, hide count (#15903) 2022-02-11 16:38:10 -05:00
Alan Guo Xiang Tan
76aadc67bb
Revert "DEV: Prefix deprecation notices and api warnings with theme name/id" (#15902)
This reverts commit a4ff69bd99.

Follow-up to 8e5b945b0f
2022-02-11 11:37:12 +08:00
Alan Guo Xiang Tan
8e5b945b0f
Revert "DEV: Improve theme error handling UX" (#15900)
`PrettyText.cook` is breaking on some sites. Revert for now while we
investigate.

This reverts commit c81d369ab6.
2022-02-11 11:30:36 +08:00
Krzysztof Kotlarek
51a31f7835
FIX: subcategory filter limits results (#15655)
When the subcategory dropdown is searched, it should only display categories belonging to the same parent category.
2022-02-11 11:24:01 +11:00
Martin Brennan
e814f77eaa
DEV: Allow focusComposer to reply to existing topic (#15896)
Another use case for focusComposer() is if the user is
already inside a topic but another component (such as the
floating chat window) needs to open the composer. This
commit also fixes the appendText option to only prepend
2 new lines if there is text before the text to be appended.

Follow up 7850ee318f
2022-02-11 10:16:06 +10:00
David Taylor
a4ff69bd99 DEV: Prefix deprecation notices and api warnings with theme name/id 2022-02-10 22:56:11 +00:00
David Taylor
c81d369ab6 DEV: Improve theme error handling UX
- Update UI to improve contrast
- Make it clear that the message is only shown to administrators
- Add theme name and id to the console output
- Parse the error backtrace to identify the theme-id for post-decoration errors
- Improve console output to include the theme name / URL
- Add `?safe_mode=no_custom` to the admin panel link, so that it will work even if the theme is causing the site to break
2022-02-10 22:56:11 +00:00
Kris
35697c6076
Add classes to user stats, move likes received (#15892) 2022-02-10 16:18:55 -05:00
Bianca Nenciu
3170577ee1
FIX: Defer upload extension check for iOS (#15890)
accept HTML attribute is not fully supported on iOS yet and can contain
only MIME types. This changes the input to allow all files and the
extension check is performed later in JavaScript.
2022-02-10 21:48:22 +02:00
Jordan Vidrine
b07c70d843
UX: Search spacing & position changes (#15882) 2022-02-10 12:32:21 -06:00
Krzysztof Kotlarek
9610aea189
FEATURE: cache last post number (#15772)
Instead of relaying on /timings request, we should cache last read post number. That should protect from having incorrect unread counter when going back to topic list.

This additional cache is very temporary as once /timings request is finished, serializer will have a correct result.

Simplified flow is:
1. Store in cache information about last seen post number before /timings request is sent
2. When getting back to topic list compare value of last seen post number returned by /latest request and information in cache. If cache number is higher, than use it instead of information returned by /latest. In addition delete cache item as there is high chance that `/timings` request already finished.
3. Optionally, delete cache when timings request is done and topic list was not yet visited.

Keeping cache reasonably small should not affect performance.
2022-02-10 13:09:28 +11:00
Krzysztof Kotlarek
d4be987cc8
FIX: topic tracking state for tags (#15623)
TopicTrackingState should correctly set filterCategory and filterTag for all different configurations.

When filterTag exists and new_topic message arrives, it ensures that filterTag is included in payload tags

If filterTag is part of payload tags, message that new topics are available is displayed and after click, new topics are included in the list.
2022-02-09 22:53:08 +01:00
Jarek Radosz
45572f9431
DEV: Deprecate assert.not() (#15595)
Use QUnit's standard `assert.notOk()` instead.
2022-02-09 18:49:05 +01:00
Vinoth Kannan
1f30bacb65
FIX: use prev_period data if prev30Days value is not available. (#15867)
Previously, reports of likes and flags doesn't include the 30 days trend icon and title.
2022-02-09 22:09:33 +05:30
Ayke Halder
5ff3a9c4bb
DEV: add native lazy loading for emojis (#15830) 2022-02-09 12:18:59 +01:00
Joffrey JAFFEUX
b3ecf00c98
DEV: adds initial support for custom blocks using code fencing (#15743)
Allows to write custom code blocks:

```
   ```mermaid height=200,foo=bar
   test
   ```
```

Which will then get converted to:

```
<pre data-code-wrap="mermaid" data-code-height="200" data-code-foo="bar">
  <code class="lang-nohighlight">
    test
  </code>
</pre>
```
2022-02-09 11:23:44 +01:00
Martin Brennan
c1ad9c3276
DEV: Make clipboardCopy util available for import (#15874)
We need this in other places, this commit moves clipboardCopy
to the utilities.js lib. Had to remove use of Promise as well because
lib/utilities cannot import it, otherwise it will cause a mini racer error.
2022-02-09 16:11:41 +10:00
Martin Brennan
7850ee318f
DEV: Add focusComposer to composer controller (#15872)
This commit adds a new helpful function to the composer controller
which can be used to focus the composer and insert text, regardless
of whether the consumer knows whether the composer is open or has
a draft. This is good for cases where an action needs to copy text
to the composer or open it with text after navigating to a URL.

The inspiration for this addition is the discourse-chat plugin,
which needs to be able to copy quoted markdown from the chat
and insert it into the composer, and unlike in the topic controller
we have no idea of the state of the composer from chat.
2022-02-09 15:25:03 +10:00
janzenisaac
8abc4a0fd6
Revert "DEV: Prioritize full name when setting active (#15820)" (#15869)
This reverts commit 5a93ce421d.
2022-02-08 13:25:19 -06:00
janzenisaac
5a93ce421d
DEV: Prioritize full name when setting active (#15820)
Prioritize full name in these places (when setting active):
See: https://meta.discourse.org/t/display-full-name-not-username-when-attributing-quote-or-reply/203533/6 for context

- Reply to post
- Composer reply to post
- Quoting
2022-02-08 08:37:20 -06:00
David Taylor
03b7d71827
DEV: Ensure that Discourse global is available for widget init (#15862)
Under ember-cli, we rely on the `ember-export-application-global` addon to make `window.Discourse` available. This happens in an initializer. Previously this inititalizer would run after `auto-load-modules`, and so any widget/helper modules would not be able to access it. This commit sets some `after` parameters on the `auto-load-modules` and `inject-objects` initializers to ensure that `export-application-global` is run first.
2022-02-08 10:45:36 +00:00
Jordan Vidrine
eadf618752
FIX: Align progress text (#15856) 2022-02-07 18:18:17 -06:00
David Taylor
4cceb55621
Revert "PERF: Update ember-auto-import (#15814)" (#15854)
This reverts commit f4c6a61855 and a8325c9016

This update of ember-auto-import and webpack causes significantly higher memory use during rebuilds. This made ember-cli totally unusable on 1GB RAM / 2GB swap environments. We don't have a specific need for this upgrade right now, so reverting for now.
2022-02-07 22:41:07 +00:00
Jordan Vidrine
7223d5e012
UX: Fix login header z-index (#15848) 2022-02-07 13:31:03 -06:00
Penar Musaraj
e83d603bbc
DEV: Send message to DiscourseHub when dismissing (#15849) 2022-02-07 20:15:26 +01:00
David Taylor
cd460155aa
DEV: Add Ember-CLI backwards compatibility for Discourse.Site (#15847) 2022-02-07 18:39:34 +00:00
Penar Musaraj
45c00c72bd
FIX: Do not override mobile scroll on docked progress element (#15840) 2022-02-07 13:51:07 +01:00
Martin Brennan
357186ab7e
FIX: User option fields definition was being mutated on save (#15837)
In the commit d8bf2810ff we hoisted
the userOptionFields array to a module-level variable, but kept
the code inside save() the same. This causes an issue where if
save() is called twice on the same user with some array of user
option fields, the userOptionFields array is mutated, which means
the second save is likely not saving the fields intended.

This commit fixes the issue by not mutating the array. We cannot
change them into consts though, because we have an API to add more
items to the array.
2022-02-07 16:58:27 +10:00
Martin Brennan
0a738bd5bc
FEATURE: Allow sending group SMTP emails with from alias (#15687)
This commit allows group SMTP emails to be sent with a
different from email address that has been set up as an
alias in the email provider. Emails from the alias will
be grouped correctly using Message-IDs in the mail client,
and replies to the alias go into the correct group inbox.
2022-02-07 13:52:01 +10:00
Ayke Halder
81e175e6ba
FIX: allow native lazy loading attribute for quoted avatar image (#15834) 2022-02-07 09:28:26 +08:00
Alan Guo Xiang Tan
cc7a04afdc DEV: Improve test paths pattern for Ember CLI.
Ember tests follows a convention where test files have a postfix of
`-test.js`. This ensures that any files in the tests folder which
follows this pattern is included.
2022-02-07 09:22:15 +08:00
Andrei Prigorshnev
62029ec4eb
DEV: remove the includeMidFuture option on future-date-input (#15818)
This option was always on. Essentially, we set it only in two places and always use `|| true` with it.

Note that we're going to switch future-date-input-selector to another source of time shortcuts(https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/time-shortcut.js) and also change its API to make it more customizable. Removing the includeMidFuture option is a part of that change.
2022-02-04 21:33:11 +04:00
Penar Musaraj
f0c15dc399
Revert "FIX: Image sizes were slightly off in some cases (#15678)" (#15815)
This reverts commit eff0106efb. It causes
visible layout issues, especially on mobile.
2022-02-04 15:40:54 +01:00
Andrei Prigorshnev
778abb067f
FIX: Caret moves to a wrong position when uploading an image via toolbar (#15684)
When uploading an image, we change the uploading placeholder several times. Every time, we correct the position of the cursor after replacing. But we schedule repositioning of cursor to the afterRender queue in Ember Run Loop. As a result, sometimes we replace the placeholder several times but correct the cursor position only once at the end.

It just cannot work correctly with scheduling, we'll always be dealing with cumulative error. Removing scheduling fixes the problem.

Sadly, I cannot make the test work, I skipped it for now, going to give it another try later.
2022-02-04 18:26:48 +04:00
Penar Musaraj
d13117fa05
FEATURE: Select range in topic list with Shift + click (#15682) 2022-02-04 15:20:38 +01:00
Andrei Prigorshnev
c52e8ef8b6
DEV: dry up formatting of time options in time-shortcut-picker (#15810) 2022-02-04 17:18:21 +04:00
David Taylor
f4c6a61855
PERF: Update ember-auto-import (#15814)
This makes a small improvement to 'cold cache' ember-cli build times, and a large improvement to 'warm cache' build times

The ember-auto-import update means that vendor is now split into multiple files for efficiency. These are named `chunk.*`, and should be included immediately after the `vendor.js` file. This commit also updates the rails app to render script tags for these chunks
2022-02-04 11:00:51 +00:00
Martin Brennan
f3467ee673
FEATURE: Add requestCustomMarkdownCookFunction API (#15753)
This commit adds a requestCustomMarkdownCookFunction function
to the `helper` that is provided to custom markdown rules
via their `setup` function.

The way this works is that once the default markdown engine that
we use for cooking posts has been set up, we loop through all
of the callbacks registered by `requestCustomMarkdownCookFunction`
and call `_buildCustomMarkdownCookFunction`. This creates
a new markdown engine using many of the same settings as the
default one, but will allow for the following options to be
changed by the markdown rule requesting the custom function:

* featuresOverride - The markdown-it features to allow for the engine
* markdownItRules - The markdown-it rules to allow for the engine

After this engine is set up a render function which renders + sanitizes
the output is returned for use by the markdown rule.

The use case for this API is mainly for block BBCode markdown rules
which want to render their content with a limited subset of the
markdown features/rules. Our initial use case for this is chat message
quoting.

This commit also does some minor refactoring of discourse-markdown-it
to accommodate this new engine building.
2022-02-04 09:00:40 +10:00
Martin Brennan
9fc33d310b
FIX: Table pasting issues with uppy (#15787)
When changing to uppy for file uploads we forgot to add
these conditions to the paste event from 9c96511ec4

Basically, if you are pasting more than just a file (e.g. text,
html, rtf), then we should not handle the file and upload it, and
instead just paste in the text. This causes issues with spreadsheet
tools, that will copy the text representation and also an image
representation of cells to the user's clipboard.

This also moves the paste event for composer-upload-uppy to the
element found by the `editorClass` property, so it shares the paste
event with d-editor (via TextareaTextManipulation), which makes testing
this possible as the ember paste bindings are not picked up unless both
paste events are on the same element.
2022-02-04 08:45:55 +10:00
Keegan George
1485dab12e
FEATURE: Ability to re-order value lists (#15775)
Adds up and down buttons next to the inputs of value lists when there is more than 1 item present. This helps to re-order the items in the value lists if necessary.
2022-02-03 22:47:02 +01:00
janzenisaac
6e4af0e36f
DEV: update show social login logic (#15809)
Only display text if one or more social login options are enabled
2022-02-03 15:17:36 -06:00
Kris
b44950c3d9
DEV: new plugin outlet on user page (#15808) 2022-02-03 16:11:35 -05:00
Jordan Vidrine
5f322605c6
DEV: Add category-color variable (#15807) 2022-02-03 13:16:27 -06:00
janzenisaac
cffc2836cb
DEV: Don't allow users to immediately reinvite (#15722)
- Limit bulk re-invite to 1 time per day
- Move bulk invite by csv behind a site setting (hidden by default)
- Bump invite expiry from 30 -> 90 days

## Updates to rate_limiter
When limiting reinvites I found that **staff** are never limited in any way. So I updated the **rate_limiter** model to allow for a few things:
- add an optional param of `staff_limit`, which (when included and passed values, and the user passes `.staff?`) will override the default `max` & `secs` values and apply them to the user.
- in the case you **do** pass values to `staff_limit` but the user **does not** pass `staff?` the standard `max` & `secs` values will be applied to the user.

This should give us enough flexibility to 
1. continue to apply a strict rate limit to a standard user
2. but also apply a secondary (less strict) limit to staff
2022-02-03 13:07:40 -06:00
David Taylor
569fa8a135
DEV: Improve Ember module shims under Ember CLI (#15795) (#15806)
In our legacy environment, Ember RFC176 shims are included in `discourse-loader.js` which is part of the `vendor.js` bundle. This meant that the module shims were available as soon as the vendor.js asset was loaded.

Under Ember CLI, we were defining these shims in `discourse-boot.js`. This is loaded by the browser much later, and meant that the shims were not available to themes/plugins that call `require()` before Discourse has booted. This was causing errors under some circumstances.

This commit refactors the Ember CLI implementation so that the shims are included in the vendor.js bundle. This is done via an addon which leans on the ember-rfc176-data NPM package. This will ensure we have all the definitions, without the need for manual copy/paste.
2022-02-03 17:36:32 +00:00
David Taylor
c985f82174
Revert "PERF: Update ember-auto-import (#15695)" (#15805)
This reverts commit 76022132f7. This update introduced 'chunking' of vendored dependencies, which we don't support in the rails app.
2022-02-03 16:54:48 +00:00
David Taylor
ea37b30ab2
Revert "DEV: Improve Ember module shims under Ember CLI (#15795)" (#15803)
This reverts commit 7933278ef4. This isn't working in production, reverting pending investigations.
2022-02-03 16:13:33 +00:00
David Taylor
7933278ef4
DEV: Improve Ember module shims under Ember CLI (#15795)
In our legacy environment, Ember RFC176 shims are included in `discourse-loader.js` which is part of the `vendor.js` bundle. This meant that the module shims were available as soon as the vendor.js asset was loaded.

Under Ember CLI, we were defining these shims in `discourse-boot.js`. This is loaded by the browser much later, and meant that the shims were not available to themes/plugins that call `require()` before Discourse has booted. This was causing errors under some circumstances.

This commit refactors the Ember CLI implementation so that the shims are included in the vendor.js bundle. This is done via an addon which leans on the ember-rfc176-data NPM package. This will ensure we have all the definitions, without the need for manual copy/paste.
2022-02-03 12:57:57 +00:00
Penar Musaraj
3b75120b3d
UX: Support type=search inputs in inline forms (#15790) 2022-02-03 13:50:24 +01:00
David Taylor
84c2c2f477
DEV: Refactor Site creation in tests (#15707)
Previously, `resetSite()` would immediately generate a new `Site` instance, and run all the initialization logic within the model. This included initializing Category objects.

This was problematic because `resetSite()` is called before any initializers have been run. That means that any modifications to the Site or Category classes would not have any effect on the already-initialized Site/Category instances.

This commit makes two main changes so so that the test environment is more production-like:

1. Update `resetSite` so that it simply stores the new data in the PreloadStore, and destroys the old Site instance. Initialization of a new site instance happens 'just in time' (normally during the `inject-discourse-objects` initializer)

2. Update the `helperContext` in tests to use getters. This avoids the need to look up `Site.current()` before initializers have run

It also makes a minor adjustment to one test which was relying on a side-effect of the previous behavior.

This should resolve the failing tests for discourse-category-expert under Ember-CLI: https://github.com/discourse/discourse-category-experts/pull/69
2022-02-03 10:02:47 +00:00
David Taylor
76022132f7
PERF: Update ember-auto-import (#15695)
This makes a small improvement to 'cold cache' ember-cli build times, and a large improvement to 'warm cache' build times
2022-02-03 10:01:59 +00:00
Penar Musaraj
7d5d2bf13e
A11Y: Use autocomplete=off more widely (#15780) 2022-02-03 16:16:49 +11:00
Natalie Tay
23a8341b28
FEATURE: Validate domain settings for blocked_onebox_domain only (#15754)
We want to prevent the user from adding ? or * minimally
when setting domains in sitesettings
2022-02-03 11:26:53 +08:00
Penar Musaraj
febe997bee
FIX: Regression in timezone name localizations (#15761)
This also switches to using the NPM package for better build stability. And adds a clearer label in the alert that is displayed to show your current timezone (when changing timezones).
2022-02-02 23:41:42 +01:00
Jordan Vidrine
c23ccd87f8
DEV: Add plugin outlet to topic-list-item.hbs (#15776) 2022-02-02 15:50:14 -06:00
Robin Ward
6f25f17360
DEV: Revisit skipped tests (#15769)
* Some are no longer flaky or easily fixed

* Some are out of date or test things we can't do accurately (scroll
  position) and are removed.

* Unwinds some uppy tests and makes sure all promises and runloops are
  resolved.

Everything has been run in legacy/ember cli multiple times to ensure no
obvious suite regressions.
2022-02-02 12:09:03 -05:00
Krzysztof Kotlarek
a1adc13125
FIX: aria label for popup-input-tip (#15724)
popup-input-tip is used for composer validation.
Aria label is essential to for accessibility.
Also, HTML tags have to be removed
2022-02-02 16:23:56 +11:00
Krzysztof Kotlarek
bb01563682
FIX: post mover validation color and message (#15688)
When the record is not saved, we should display a proper message.
One potential reason can be plugins for example discourse-calendar is specifying that only first post can contain event
2022-02-02 16:22:52 +11:00
tshenry
3da6f6b717
FEATURE: New plugin outlets for categories-boxes template (#15771)
Adds new category-box-before-each-box and category-box-after-each-box outlets to improve flexibility with customizations.
2022-02-01 19:53:02 -08:00
Jarek Radosz
eff0106efb
FIX: Image sizes were slightly off in some cases (#15678)
This fixes rare cases of layout shift caused by images appearing slightly smaller after being loaded.

For example, a 371x1031 image is uploaded. It gets lightboxed, with the generated thumbnail of size 179x500. `height: auto` changes that thumbnail's size (only after being loaded) to 179x497, causing a 3px shift.

I did not observe any regressions with this change.
2022-02-01 23:30:21 +01:00
Jarek Radosz
6f8c91254e
FEATURE: Partial match aliases in emoji filter (#15613) 2022-02-01 22:36:48 +01:00
Jarek Radosz
ce2c5ffb29
DEV: Simplify header width css (#15746) 2022-02-01 22:36:34 +01:00
Jarek Radosz
692b6543ff
FIX: Composer fields on small desktop sizes (#15729) 2022-02-01 21:33:06 +01:00
Jarek Radosz
7806857841
UX: Highlight "Users" link when on adminUser path (#15739) 2022-02-01 21:32:48 +01:00
Jarek Radosz
36194398e5
UX: Slightly tweak admin/customize/themes CSS (#15712) 2022-02-01 20:07:23 +01:00
Jarek Radosz
82a46beecb
UX: Add hover style to refresh-page dismiss button (#15711)
Also fixes icon size and position
2022-02-01 20:04:46 +01:00
Jarek Radosz
2e74f1dd28
DEV: Refactor clean-dom (#15609)
* Move it out of page-tracking initializer
* Don't use jQuery anymore
* Remove `activeElement` IE10 bug workaround
* Remove `$("html").data("hide-dropdown")` support; it dates back to the "initial" commit (68ad545f0f/app/assets/javascripts/discourse/routes/discourse_route.js.coffee (L26-L27)) and I don't think it was being used for years now
2022-02-01 19:29:53 +01:00
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
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
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
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
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
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
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