Commit Graph

26588 Commits

Author SHA1 Message Date
Jarek Radosz ecfbd45607
FIX: Ember test entries in discourse-loader (#16201)
Those aren't available in the production build.
(+ Move to test-shims)
2022-03-16 16:06:34 +01:00
Bianca Nenciu 44c8f4940e
FIX: Show bookmark options by default when editing (#16189)
These changes also update user bookmark preferences on the client side
immediately in case user creates more than a bookmark during the same
session.
2022-03-16 16:41:24 +02:00
Mark VanLandingham cea0b9cefb
DEV: Reserve usernames for chat and sunset `chat_group_mention` (#16200) 2022-03-16 08:55:21 -05:00
Mark VanLandingham a0f4c7fe88
FIX: remove racing requests for admin users (#15936) 2022-03-16 08:47:48 -05:00
Jarek Radosz 704606e731
DEV: Support `registerWaiter` import in legacy env (#16195)
Throw in `unregisterWaiter` too
2022-03-16 14:32:38 +01:00
Bianca Nenciu 6a295ea9e9
DEV: Log more when verbose_upload_logging is enabled (#16177)
A message was logged when download started, but it was not known if a error
during the download.
2022-03-15 23:55:05 +02:00
Bianca Nenciu 08a1f41582
FEATURE: Replace share-popup with share-topic (#16108)
share-topic modal is used everywhere expect when clicking on the top
right corner of the post. This changes standardize on share-topic modal
and add the missing features from share-popup.
2022-03-15 21:27:18 +02:00
Penar Musaraj d19b5fe80b
DEV: Stop live-reloading locally on SCSS changes (#16193)
The `testem.scss` include triggers a live reload locally. We need these
styles when running `ember test --server`, so this loads that stylesheet
only in that scenario.
2022-03-15 16:46:12 +01:00
Penar Musaraj 593f3e5dd8
UX: Styling changes to global banner (#16191) 2022-03-15 16:19:55 +01:00
Jarek Radosz 383f164672
FIX: Always include the first poster when converting to PM (#16187)
Regressed in #15626
2022-03-15 10:51:10 +01:00
Sam de9a031073
FEATURE: use canonical links in posts.rss feed (#16190)
* FEATURE: use canonical links in posts.rss feed

Previously we used non canonical links in posts.rss

These links get crawled frequently by crawlers when discovering new
content forcing crawlers to hop to non canonical pages just to end up
visiting canonical pages

This uses up expensive crawl time and adds load on Discourse sites

Old links were of the form:

`https://DOMAIN/t/SLUG/43/21`

New links are of the form

`https://DOMAIN/t/SLUG/43?page=2#post_21`

This also adds a post_id identified element to crawler view that was
missing.

Note, to avoid very expensive N+1 queries required to figure out the
page a post is on during rss generation, we cache that information.

There is a smart "cache breaker" which ensures worst case scenario is
a "page drift" - meaning we would publicize a post is on page 11 when
it is actually on page 10 due to post deletions. Cache holds for up to
12 hours.

Change only impacts public post RSS feeds (`/posts.rss`)
2022-03-15 20:17:06 +11:00
David Taylor 8664712c1a
PERF: Fix n+1 for categories + featured topics (#16188)
`topic.featured_topic` and `topic.category` are used by `TopicGuardian#can_see_topic?`
2022-03-14 22:23:39 +00:00
Ella E bfe9ba3039
UX: Hide group avatar flair block if it's empty 2022-03-14 11:42:37 -06:00
David Taylor 349a4acc9f
DEV: Use Ember CLI for docker.rake CI testing (#16182) 2022-03-14 17:32:03 +00:00
Jarek Radosz 172d030a45
DEV: Check if show-modal container is viable (#16170) 2022-03-14 15:14:42 +01:00
Jarek Radosz bb153c49a1
DEV: Deprecate /posts/:id/reply-ids/all (#16136)
* DEV: Deprecate /posts/:id/reply-ids/all

It was added in ed4c0c4a63 and its only use was removed in b58867b6e9

Nothing in all-the* seems to be using this endpoint.

* Update app/controllers/posts_controller.rb

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2022-03-14 15:13:26 +01:00
Jarek Radosz fa7d34f593
DEV: Make decorator method names debug-friendly (#16181)
Example

Before: `_decorate_5`
After: `_decorate_5_chat_transcript_datetime`
2022-03-14 15:12:54 +01:00
Penar Musaraj 0400d10907
FIX: J/K post stream navigation inconsistencies (#16171) 2022-03-14 15:09:19 +01:00
David Taylor 839639326c
DEV: Install the `@ember/jquery` package to remove warning (#16165)
Eventually we want to remove JQuery, but that's a long way off. Installing this package will stop ember-cli printing the deprecation warning on every boot

```
DEPRECATION: The integration of jQuery into Ember has been deprecated and will be removed with Ember 4.0. You can either opt-out of using jQuery, or install the `@ember/jquery` addon to provide the jQuery integration. Please consult the deprecation guide for further details: https://emberjs.com/deprecations/v3.x#toc_jquery-apis
```
2022-03-14 10:25:52 +00:00
Jarek Radosz 44f7a61c2c
UX: Tweak the "new" badge size, position, color (#16168) 2022-03-13 12:50:06 +01:00
Jarek Radosz 4dc5500fa6
UX: Allow d-editor to be shrunk (#16164)
…e.g. when resizing the composer. Previously it wouldn't go below a certain size and would overlap the element below it.
2022-03-11 18:18:27 +01:00
Bianca Nenciu 7a416257df
FIX: Invalidate site settings cache in all instances (#16155)
Previous cache implementation did not support multisite instances and
the cache was invalidated only in the instance where the change took
place.
2022-03-11 17:16:56 +02:00
Penar Musaraj 94750c81fa
FIX: Update group inbox notifications on archive/unarchive (#16152) 2022-03-11 11:57:47 +01:00
Osama Sayegh b0656f3ed0
FIX: Apply onebox blocked domain checks on every redirect (#16150)
The `blocked onebox domains` setting lets site owners change what sites
are allowed to be oneboxed. When a link is entered into a post,
Discourse checks the domain of the link against that setting and blocks
the onebox if the domain is blocked. But if there's a chain of
redirects, then only the final destination website is checked against
the site setting.

This commit amends that behavior so that every website in the redirect
chain is checked against the site setting, and if anything is blocked
the original link doesn't onebox at all in the post. The
`Discourse-No-Onebox` header is also checked in every response and the
onebox is blocked if the header is set to "1".

Additionally, Discourse will now include the `Discourse-No-Onebox`
header with every response if the site requires login to access content.
This is done to signal to a Discourse instance that it shouldn't attempt
to onebox other Discourse instances if they're login-only. Non-Discourse
websites can also use include that header if they don't wish to have
Discourse onebox their content.

Internal ticket: t59305.
2022-03-11 09:18:12 +03:00
Penar Musaraj 3a817d2377
FIX: Buggy jump-to-post on Firefox (#16153) 2022-03-10 20:39:39 +01:00
Osama Sayegh 8d96761a4f
FIX: Include engine mount path for API scopes added by plugins (#16154)
In the API keys page where admins can create API keys with restricted scopes, each scope shows a list of URLs that it allows. But currently, this list of allowed URLs shows incomplete URLs for scopes that are added by plugins. For example, the allowed URL for the "run queries" scope of the data-explorer plugin is shown as `/queries/:id/run` when the correct URL for this scope is `/admin/plugins/explorer/queries/:id/run`. The first 3 segments of the path are the mount path of the plugin's engine and it's missing because the routes set of the engine doesn't include the mount path. To fix this, this commit gets the mount path and prepends it to the URL so the complete URL is shown to the user.

It's not possible to write tests for this change because plugins are not loaded in the test environment by default when core's tests suite is running.
2022-03-10 22:01:22 +03:00
Jarek Radosz 99b2cfe26e
DEV: Disallow `Ember` global usage (#16147)
…and sprinkle `// eslint-disable-next-line no-undef` throughout the code where is unavoidable for now
2022-03-09 17:54:07 +01:00
Jarek Radosz 2ba602708a
DEV: A manual test waiter might not be needed (#16142) 2022-03-09 15:38:10 +01:00
Jarek Radosz fbef828ab2
DEV: Remove "empty" template code (#16140)
Its only use seems to have been removed back in 2016 in a9ed15e11a.
2022-03-09 13:57:39 +01:00
Sam 43da88db6c
PERF: avoid following links in topic RSS feeds (#16145)
Topic RSS feeds contain many non canonical links such as:

- https://site.com/t/a-b-c/111/1
- https://site.com/t/a-b-c/111/2
- https://site.com/t/a-b-c/111/3
- https://site.com/t/a-b-c/111/4
- https://site.com/t/a-b-c/111/5
- https://site.com/t/a-b-c/111/6

Previously we were not indexing RSS feeds yet still following these
links.


This change means we totally ignore links in the RSS feeds which
avoids expensive work scanning them just to find we should not
include them.
2022-03-09 18:25:20 +11:00
Ayke Halder 28bb9e11f4
FEATURE: add nofollow to RSS alternate link in topics and categories (#16013)
* FEATURE: add nofollow to RSS alternate link in topics and categories

* Rspec tests for category and topic view: add nofollow to RSS alternate link
2022-03-09 16:34:02 +11:00
Martin Brennan ca93e5e68b
FIX: Allow admins to change user ignore list (#16129)
Previously, if an admin user tried to add/remove
users to another user's ignored list, it would
be added to their own ignore list because the
controller used current_user. Now for admins only
a source_user_id parameter can be passed through,
which will be used to ignore the target user for
that source user.
2022-03-09 14:51:30 +10:00
David Taylor 3ad9c2cdb6
FEATURE: Add mobile support for subcategories-with-featured-topics (#16118)
Follow-up to eb2e3b510d
2022-03-08 22:06:27 +00:00
Jarek Radosz bf252752e7
FIX: Make reply-ids public by fixing a typo (#16137)
…and spec the endpoint
2022-03-08 21:08:15 +01:00
Bianca Nenciu 6d422a8033
FEATURE: Highlight expired bookmark reminders (#15317)
The user can select what happens with a bookamrk after it expires. New
option allow bookmark's reminder to be kept even after it has expired.
After a bookmark's reminder notification is created, the reminder date
will be highlighted in red until the user resets the reminder date.
User can do that using the new Clear Reminder button from the dropdown.
2022-03-08 19:44:18 +02:00
Bianca Nenciu f5422f91aa
FEATURE: Add link to original image in lightbox (#15640)
Adds a link to the original image next to the download link. It can be
used to view full resolution image in the browser.
2022-03-08 19:39:46 +02:00
Jarek Radosz 14109ea92c
FIX: Show 404 html on /posts/:id/raw and /p/:id (#16131)
It returned a blank page before.
2022-03-08 17:42:07 +01:00
Jarek Radosz 768c80c2a4
DEV: Make `find_post_using` raise only `Discourse::NotFound` (#16133) 2022-03-08 17:39:52 +01:00
Jarek Radosz c212af665c
DEV: Remove unused scss (#16134)
`.report-container` doesn't seem to be used anywhere
2022-03-08 17:39:40 +01:00
Joffrey JAFFEUX 690036225f
DEV: using send can be harmful, public_send is less risky (#16135)
I can't see any harmful use case here, especially because only one param can be used ATM.
2022-03-08 17:13:26 +01:00
Kris 28842d24d6
UX: print view always shows 0 votes, hide it (#15901) 2022-03-08 15:35:31 +01:00
Bianca Nenciu 4fe99e39c3
FEATURE: Add new site setting list type with name and values (#16045)
These changes include a bug fix because allow_any attribute of site
settings was completely ignored before.
2022-03-08 13:18:43 +02:00
Bianca Nenciu 34b4b53bac
FEATURE: Use Postgres unaccent to ignore accents (#16100)
The search_ignore_accents site setting can be used to make the search
indexer remove the accents before indexing the content. The unaccent
function from PostgreSQL is better than Ruby's unicode_normalize(:nfkd).
2022-03-07 23:03:10 +02:00
Jarek Radosz c528de3288
DEV: Make `settled()` work in the legacy env (#16122)
(and await for `focusComposer`)
2022-03-07 20:00:09 +01:00
Jordan Vidrine af20d435ea
UX: Fix misaligned avatar (#16120) 2022-03-07 11:08:00 -06:00
Joffrey JAFFEUX 36e7163d16
FIX: prevents self-reference to discoveryTopics from discoveryTopics (#16114) 2022-03-07 09:27:19 +01:00
Martin Brennan 7af01d88d2
FIX: Better 0 file size detection and logging (#16116)
When creating files with create-multipart, if the file
size was somehow zero we were showing a very unhelpful
error message to the user. Now we show a nicer message,
and proactively don't call the API if we know the file
size is 0 bytes in JS, along with extra console logging
to help with debugging.
2022-03-07 12:39:33 +10:00
Jarek Radosz 3db4b3bc5e
DEV: Drop lodash (#16110) 2022-03-06 18:15:25 +01:00
Jarek Radosz d5be02dac5
DEV: Bump eslint-config-discourse (#16109) 2022-03-06 18:15:15 +01:00
Jarek Radosz b9c90d6a06
DEV: Use `Map()` to store emoji groups (#16065) 2022-03-05 18:58:49 +01:00