Commit Graph

39751 Commits

Author SHA1 Message Date
Kris c5a4907800
Revert "FIX: adjust user card position, follow-up to da5841d (#11036)" (#11074)
This reverts commit 863f86c3a3, I misdiagnosed this issue
2020-11-02 14:25:17 -05:00
Justin DiRose d824a5edd2
DEV: Make discourse-subscriptions official (#11103) 2020-11-02 12:59:30 -06:00
jbrw 9ff7f25106
DEV - handle malformed `page` param (#11093)
* DEV - handle malformed page params
2020-11-02 12:40:54 -05:00
Justin DiRose 03cd5baed9
FIX: Make addNavigationBarItem subfolder compatible (#11101)
@danielwaterworth suggested taking a look at this when reviewing a plugin using this API. 

When declaring a new nav item using `addNavigationBarItem` and including the `href` attribute, we don't currently process that URL to be subfolder compatible. 

Nav bar items coming in via the API are considered `ExtraNavItem` and the `href` value is passed straight through to the `buildItems` method, vs using the computed href method. This PR adds a simple `getURL` call on that href value to ensure it's subfolder-safe.

I also accounted for the `customHref` function in the API to make those URLs subfolder safe as well.

<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in Javascript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
2020-11-02 11:30:23 -06:00
Penar Musaraj 5041ebe612
UX: Fix confusing admin UI for color scheme updates (#11100) 2020-11-02 11:28:04 -05:00
Penar Musaraj f5a726e52b
FIX: Disabled action buttons on newly-created category (#11080)
Ensures the newly created category record gives the current user permission to create a new topic and sets her notification level to the default (regular).
2020-11-02 09:36:27 -05:00
dependabot-preview[bot] 7fa6aca9db
Build(deps): Bump bootsnap from 1.4.9 to 1.5.0 (#11098)
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.4.9 to 1.5.0.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.4.9...v1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-02 11:48:15 +01:00
Robin Ward 88c2cbb6d6
REFACTOR: Remove `window.sinon` and `window.MouseTrap` from tests (#11092)
Also allow us to reset mousetrap in a teardown method.
2020-11-02 11:44:52 +01:00
Gerhard Schlager b73234b75c
FIX: Show an example username in Review Settings (#11097)
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2020-11-02 11:13:30 +01:00
Gerhard Schlager 5c662128d3
DEV: Rake task for creating admin should ask for full name if required (#11096) 2020-11-02 11:12:42 +01:00
Arpit Jalan 1476e17c35
FEATURE: new setting to create a linked topic on autoclosing mega topics (#11001)
This commit adds a site setting `auto_close_topics_create_linked_topic`
which when enabled works in conjunction with `auto_close_topics_post_count`
setting and creates a new linked topic for the topic just closed.

The auto-created new topic contains a link for all the previous topics
and the topic titles are appended with `(Part {n})`.

The setting is enabled by default.
2020-11-02 12:18:48 +05:30
Martin Brennan 3655062c60
FIX: Ensure oneboxed secure images which are optimized and also lightboxed optimized images are embedded in email (#11061)
We had an issue where onebox thumbnail was too large and thus was optimized, and we are using the image URLs in post to redact and re-embed, based on the sha1 in the URL. Optimized image URLs have extra stuff on the end like _99x99 so we were not parsing out the sha1 correctly. Another issue I found was for posts that have giant images, the original was being used to embed in the email and thus would basically never get included because it is huge.

For example the URL 787b17ea61_2_690x335.jpeg was not parsed correctly; we would end up with 787b17ea6140f4f022eb7f1509a692f2873cfe35_2_690x335.jpeg as the sha1 which would not find the image to re-embed that was already attached to the email.

This fix will use the first optimized image of the detected upload when we are redacting and then re-embedding to make sure we are not sending giant things in email. Also, I detect if it is a onebox thumbnail or the site icon and force appropriate sizes and styles.
2020-11-02 09:52:21 +10:00
Arpit Jalan b6aaff74be
UX: update labels to indicate that invite link will be generated (not copied) (#11077) 2020-10-31 07:10:13 +05:30
Justin DiRose 7b312b7bc6
FIX: Category drop shows undefined (#11090)
After 5fc239b535, the category dropdown
was showing "undefined" for the "all-categories" and "no-categories"
messages. This commit introduces a check to run the HTML parser only if
we're dealing with a real category, which fixes the above issue.
2020-10-30 14:20:10 -05:00
Jarek Radosz c777ca4af1
DEV: Skip randomly failing tests (#11089)
😢 Not their time to shine yet.
2020-10-30 18:21:03 +01:00
Jarek Radosz a17d54d0bf
DEV: De-arrowify tests (#11068)
Using arrow functions changes `this` context, which is undesired in tests, e.g. it makes it impossible to setup things like pretender (`this.server`) in `beforeEach` hooks.

Ember guides always use classic functions in examples (e.g. https://guides.emberjs.com/release/testing/test-types/), and that's what it uses in its own test suite, as do various addons and ember apps.

It was also already used in Discourse where `this` was required. Moving forward, it will be needed in more places as we migrate toward ember-cli.

(I might later add a custom rule to eslint-discourse-ember to enforce this)
2020-10-30 17:37:32 +01:00
Penar Musaraj d5fb0b9435
DEV: Ignore VSCode and DirEnv config files (#11083) 2020-10-30 12:32:48 -04:00
Jarek Radosz ac5c457d9e
DEV: Move the failures list to the end of output (#11082)
No more scrolling up each time the tests fail.

(Alternatively, we could just not show the slowest tests list when there are any failures 🤷‍♂️)
2020-10-30 17:29:45 +01:00
dependabot-preview[bot] fa5016ca98 Build(deps-dev): Bump rspec from 3.9.0 to 3.10.0
Bumps [rspec](https://github.com/rspec/rspec) from 3.9.0 to 3.10.0.
- [Release notes](https://github.com/rspec/rspec/releases)
- [Commits](https://github.com/rspec/rspec/compare/v3.9.0...v3.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-30 12:23:57 -04:00
Neil Lalonde 7c95b7ceb5
Version bump to v2.6.0.beta5 (#11084) 2020-10-30 12:20:12 -04:00
Osama Sayegh 84a1f15791
DEV: Track redis calls count in mini profiler (#11088) 2020-10-30 19:11:22 +03:00
dependabot-preview[bot] e7fc7b3f3c Build(deps): Bump rspec-expectations from 3.9.3 to 3.9.4
Bumps [rspec-expectations](https://github.com/rspec/rspec-expectations) from 3.9.3 to 3.9.4.
- [Release notes](https://github.com/rspec/rspec-expectations/releases)
- [Changelog](https://github.com/rspec/rspec-expectations/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-expectations/compare/v3.9.3...v3.9.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-30 11:54:47 -04:00
Discourse Translator Bot 0a74322589
Update translations (#11087) 2020-10-30 16:06:32 +01:00
Roman Rizzi 7912ce4002
UI: Slow mode tweaks. (#11081)
We remove the slow mode composer message and provide better messages when rejecting new posts and edits. The client now validates if the user tries to post again immediately. Finally, we replaced the `hourglass-end` icon with the `hourglass-start` one.
2020-10-30 11:22:56 -03:00
Jarek Radosz 2f4a1ff61b
DEV: Update rubocop-discourse from 2.3.2 to 2.4.0 (#11079)
Also fixes whitespace related issues raised by rubocop.
2020-10-30 15:04:29 +01:00
Vinoth Kannan af4938baf1
Revert "DEV: enable cors to all cdn get requests from workbox. (#10684)" (#11076)
This reverts commit e3de45359f.

We need to improve out strategy by adding a cache breaker with this change ... some assets on CDNs and clients may have incorrect CORS headers which can cause stuff to break.
2020-10-30 16:05:35 +11:00
Vinoth Kannan 347423007a
DEV: remove instagram login site settings and auth classes. (#11073)
Instagram removed the support for login and should use Facebook login instead.
2020-10-30 09:09:56 +05:30
Arpit Jalan 8f7f5204db
UX: inform staff users that new users will be auto-approved on invite (#11062)
When `must_approve_users` is enabled then staff users assume that all
users will have to be approved manually. But in case of invite we
auto-approve users if they are invited by users. This commit adds an
info on the bottom of invite modal informing staff users that new users
will be auto-approved as soon as they accept invite.
2020-10-30 08:41:14 +05:30
Gerhard Schlager cc74c3f9ab
FEATURE: Batch process topic bulk actions (#10980)
Topics are processed in chunks of 30 in order to prevent timeouts.
2020-10-30 12:02:35 +11:00
Rafael dos Santos Silva ec35b353a7
FEATURE: Add a CSS class to the HTML element on background connection error (#10991)
This is a way to detect that Discourse isn't able to receive online updates from
the server, and will be used to trigger an UI warning to the user that the session
is working on offline mode.

Meta request https://meta.discourse.org/t/offline-indicator/123000?u=falco
2020-10-30 11:59:02 +11:00
Kane York 8b24e0f0b7
FIX: Use <> link instead of code for discobot backup image link (#11063)
Due to the new enhanced copy-paste handling, the URL would be included in the user's reply as code, too!
By surrounding the link in angle brackets, we prevent the bot from accidentally including the link itself and spoiling the surprise.

I considered having the bot automatically edit the user's post to remove the backticks. I very quickly ran into a problem with spurious whitespace, and it would also look _super weird_ for the bot to edit your post when that's not what's being taught.
The seemingly bare link not automatically embedding is also weird, but slightly less so.

Fun fact: this doesn't work on localhost, because the onebox engine refuses to issue requests to localhost :)
2020-10-30 11:57:27 +11:00
Vinoth Kannan 2d5bb516a6
FIX: keep tag filter value when changing the category dropdown. (#11065)
Previously, while filtering the topics by tag, selecting a category loses the selected tag value.
2020-10-30 11:56:20 +11:00
dependabot-preview[bot] b2847e3753
DEV: Bump zeitwerk from 2.4.0 to 2.4.1 (#11071)
Bumps [zeitwerk](https://github.com/fxn/zeitwerk) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/fxn/zeitwerk/releases)
- [Changelog](https://github.com/fxn/zeitwerk/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fxn/zeitwerk/compare/v2.4.0...v2.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-30 11:51:06 +11:00
Jeff Atwood 7c1c34d9c1
minor copyedit (#11075) 2020-10-29 16:21:36 -07:00
Robin Ward 5e110a5770 FIX: Search filters text was not able to be overridden
This is because the translations were being applied when the JS files
were parsed, which is before the overrides are loaded.

The solution is to return the filters in a function which is executed
when they are needed.
2020-10-29 16:01:00 -04:00
Robin Ward 435a9913a4 REFACTOR: Replace global `find` with `queryAll`
In newer Embers jQuery is removed. There is a `find` but it only returns
one element and not a jQuery selector. This patch migrates our code to a
new helper `queryAll` which allows us to remove the global.
2020-10-29 14:45:51 -04:00
Mark VanLandingham c750a02f05
DEV: Move reports to concerns for autoloading (#11066) 2020-10-29 11:49:09 -05:00
Neil Lalonde c5eba3f9ee
FIX: support new Google Analytics id format (#11067)
They start with UA- or G- now.
2020-10-29 12:06:20 -04:00
Sam d10b6dc498
FEATURE: Allow admins to opt out of chunked encoding (#11060)
Most proxies out there will work with chunked encoding transfer. However
some proxies buffer, causing large delays which in turn force the message
bus client to disable chunked encoding. This wastes a request to the message
bus causing superfluous load on the server.

Also

- enableLongPolling is already default true in the client, no need to set it
- remove confusing comment about zepto
2020-10-29 16:25:46 +11:00
Krzysztof Kotlarek 8e7c746e56
FEATURE: Ask user to confirm topic deletion when views exceed a certain amount (#11006)
Before deleting a topic that has a high number of views (default of 5000), the user will be prompted with a confirmation popup. This works for all delete buttons on the topic located in: topic-timeline, topic-admin-menu, topic-footer-buttons, and post-menu if the post's ID is 1.

The delete button will be disabled while deletion is in progress, to prevent any unwanted behavior.

A site setting is also available to change the minimum amount of views required to display the confirmation popup.

All kudos are going to @RickyC0626. I only rebased with master and added few qunit tests to ensure that this feature works as expected.

Original PR: #10459
2020-10-29 14:18:43 +11:00
Vinoth Kannan 72810853ea
FIX: strip the trailing slash (/) of cors origins. (#10996)
Strips trailing `/` from global settings
Provides a validation for site settings to ensure a trailing `/` is not added
2020-10-29 13:01:06 +11:00
Robin Ward 79b414d2a1 FIX: The attribute is `discourse-url` not `data-discourse-url` 2020-10-28 17:12:29 -04:00
Roman Rizzi 2f32336081
FIX: Staff can create and edit posts even if a topic is in slow mode. (#11057)
Additionally, ninja edits are no longer restricted.
2020-10-28 16:47:50 -03:00
Vinoth Kannan e3de45359f
DEV: enable cors to all cdn get requests from workbox. (#10685)
Now all external requests from the service worker will be in CORS mode without credentials.
2020-10-28 23:36:19 +05:30
dependabot-preview[bot] f70042860b Build(deps): Bump chunky_png from 1.3.13 to 1.3.14
Bumps [chunky_png](https://github.com/wvanbergen/chunky_png) from 1.3.13 to 1.3.14.
- [Release notes](https://github.com/wvanbergen/chunky_png/releases)
- [Changelog](https://github.com/wvanbergen/chunky_png/blob/master/CHANGELOG.rdoc)
- [Commits](https://github.com/wvanbergen/chunky_png/compare/v1.3.13...v1.3.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-28 11:41:56 -04:00
Robin Ward b302321451 REFACTOR: Test assertions should be imported.
Previously they were global functions.
2020-10-28 11:39:06 -04:00
ti0 f809e6eda7 Add upload-actions plugin outlet 2020-10-28 10:42:04 -04:00
Penar Musaraj ab6894ea36
Add routing for category edit screens (#11027)
Also fixes category editing for instances with slug generation set to "none".
2020-10-28 09:59:38 -04:00
Arpit Jalan 6d4cfbf120
FIX: show 'quote' button when topic is closed but composer is open (#11054) 2020-10-28 19:25:06 +05:30
Krzysztof Kotlarek dbec3792b7
FIX: pretty text allow list (#10977)
Reword whitelist to allowlist in pretty-text.
This library is used by plugins so we need deprecation notice.
2020-10-28 13:22:06 +11:00