Commit Graph

23579 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Martin Brennan 632942e697
FIX: Ensure group SMTP and message builder always uses from address for Reply-To when IMAP is enabled (#11037)
There is a site setting reply_by_email_enabled which when combined with reply_by_email_address creates a Reply-To header in emails in the format "test+%{reply_key}@test.com" along with a PostReplyKey record, so when replying Discourse knows where to route the reply.

However this conflicts with the IMAP implementation. Since we are sending the email for a group via SMTP and from their actual email account, we want all replys to go to that email account as well so the IMAP sync job can pick them up and put them in the correct place. So if the group has IMAP enabled and configured, then the reply-to header will be correct.

This PR also makes a further fix to 64b0b50 by using the correct recipient user for the PostReplyKey record. If the post user is used we encounter this error:

if destination.user_id != user.id && !forwarded_reply_key?(destination, user)
  raise ReplyUserNotMatchingError, "post_reply_key.user_id => #{destination.user_id.inspect}, user.id => #{user.id.inspect}"
end
This is because the user above is found from the from_address, but the destination which is the PostReplyKey is made by the post.user, which will be different people.
2020-10-28 07:01:58 +10:00
Penar Musaraj 12724ac6e4
FIX: iPad DiscourseHub app layout issues (#11048)
- fixes height of user dropdown menu
- fixes offset when jumping to a post
- removes landscape-specific CSS padding (following a fix in the app repo)
2020-10-27 15:12:24 -04:00
Arpit Jalan c6bf70c870
DEV: annotate models (#11047) 2020-10-27 23:42:33 +05:30
jbrw 35cfca1f3f
FIX: Hide delete button if user cannot delete and/or flag a post (#11045)
* FIX: Hide delete button if user cannot delete and/or flag a post

* Move canFlag conditional
2020-10-27 13:02:31 -04:00
Mark VanLandingham 554a617b3d
DEV: Better custom field preload error (#11044) 2020-10-27 10:05:07 -05:00
Kane York e35fcd3340
FEATURE: Include rejected queued posts in the user archive export (#10859)
Requested at https://meta.discourse.org/t/where-can-a-user-find-the-post-that-was-rejected-by-the-moderator/165671?u=riking

Field whitelisting is applied to the json field using Hash#slice, which was activesupport until Ruby 2.5.
2020-10-27 07:48:48 -07:00
Robin Ward e634513568 Move `click` and `fillIn` to imports
Previously they were global functions.
2020-10-27 08:55:56 -04:00
Joffrey JAFFEUX 5fc239b535
FIX: converts html to text to use it as title attribute (#11009) 2020-10-27 11:05:10 +01:00
Kris 863f86c3a3
FIX: adjust user card position, follow-up to da5841d (#11036) 2020-10-27 12:35:18 +11:00
Penar Musaraj d9a5d563cf
FIX: iPad app sticky header positioning (#11029) 2020-10-26 13:53:20 -04:00
Robin Ward 1e4c0d1857 Remove more global variables from tests.
* Use `sinon` instead of `sandbox` and require an import.
* You need to import `currentURL` to use it.
2020-10-26 13:32:11 -04:00
Arpit Jalan 5ce006aea1
UX: prioritize "invite by link" option (for staff users) (#11028)
UX: update locale for single/multiple invites tab
2020-10-26 21:59:17 +05:30
Robin Ward f2a17feb3a Use response helper
These tests were using a much more verbose API. `response` is much
simpler.
2020-10-26 12:14:36 -04:00
Dan Ungureanu 43557143fe
FIX: Reset invite when resending it (#11013)
Resending an invite moved the expire date in the future, but did not
invalidate it. For example, if an invite was sent to an email,
invalidated and then resent, it would still be left invalidated.
2020-10-26 12:26:43 +02:00
Arpit Jalan 9aa2723d57
UX: improve error message for already logged in users (#11020) 2020-10-24 21:21:01 +05:30
Robin Ward e246208756 Add new `cloneJSON` method for cloning an object
This is useful in tests where `deepMerge` would retain references to old
objects.
2020-10-23 14:48:05 -04:00
Penar Musaraj 6f5d8cad51
UX: Move category editing/creation to its own page (#10973)
* Move new/edit category modals to its own page

* Fix JS tests

* Minor fixes to new-category UI

* Add mobile toggle

* Use global pretender endpoint so plugins can benefit too

* Alignment fix

* Minor review fixes

* Styling refactor

* Move some SCSS out of the modal
2020-10-23 12:49:02 -04:00
jbrw 2bcca46cc5
FEATURE - ImageMagick jpeg quality (#11004)
* FEATURE - Add SiteSettings to control JPEG image quality

`recompress_original_jpg_quality` - the maximum quality of a newly
uploaded file.

`image_preview_jpg_quality` - the maximum quality of OptimizedImages
2020-10-23 12:38:28 -04:00
Robin Ward 3b8220cb3b FIX: State is leaking between tests, causing flakey failures
It seems `deepMerge` sometimes keeps references around. This code
performs a true copy and fixes the issue.
2020-10-23 10:33:06 -04:00
Roman Rizzi c0848a5cc4
FIX: Only include last_posted_at if there's a topic_user object. (#11011)
Trying to include this attribute when topic_user is nil causes an error when visiting a topic as anon. Additionally, we don't display the slow mode banner for these users.
2020-10-23 11:31:59 -03:00
Jordan Vidrine f85f5eb179
FIX: Add check for youtube thumbnail (#11000)
This commit adds a check for the youtube thumbnail class when enforcing max-image-dimensions.
2020-10-23 08:40:49 -05:00
Robin Ward 919f488358 REFACTOR: All remaining acceptance tests converted to new format
Also contains fixes to leaky state in pretender.
2020-10-23 09:28:13 -04:00
Joffrey JAFFEUX 281bf0b345
FIX: optimizes sk body position in RTL mode (#10997) 2020-10-22 16:08:11 +02:00
David Taylor 85f827ee1c
UX: Remove forgot password button from login-preferences (#10998)
Showing this button is confusing for sites which are using external authentication. Clicking 'log in' already pops up the login modal, which includes a forgot password link when appropriate.
2020-10-22 14:34:10 +01:00
Martin Brennan 0d63eb4124
FEATURE: Add detection of post date to use in bookmark modal (#10981)
This PR introduces a feature that will detect a date inside the post that a user is bookmarking, and offer that date as an option in the bookmark modal.

The logic is that we get the first date/time detected in the post. If it does not have a time, just a date, then we default to 8:00am for the time.
2020-10-22 16:23:46 +10:00
Sam Saffron 906ec87d26 DEV: Add more debugging context to onebox generation
Previously if a onebox timed out we would not present the users in the log
with any information regarding the onebox. This makes it very difficult to
debug.

This adds url/topic/user in the debugging output.
2020-10-22 12:50:22 +08:00
Martin Brennan 64b0b50ac0
FIX: Pass user to Email::Sender to avoid broken reply key for group_smtp email (#10978)
Our Email::Sender class accepts an optional user argument, which is used to create a PostReplyKey record when present. This record is used to sub out the %{reply_key} placeholder in the Reply-To mail header, so if we do not pass in the user we get a broken Reply-To header.

This is especially problematic in the IMAP group SMTP situation, because these emails go to customers that we are replying to, and when they reply to us the email bounces! This fixes the issue by passing user to the Email::Sender when sending a group_smtp email but there is still more to do in another PR.

This Email::Sender optional user is a bit of a footgun IMO, especially because most of the time we use it there is a user we can source. I would like to do another PR for this after this one to make the parameter not optional, so we don't end up with these reply issues down the line again.
2020-10-22 10:49:08 +10:00
David Taylor abb00c3780
FIX: Restore users#topic_tracking_state route to api session_info scope (#10992)
This route was inadvertently removed in 1cec333f, and is required for showing new/unread counts in Discourse mobile apps
2020-10-21 19:44:34 +01:00
Osama Sayegh a04c300495
DEV: Add optional ENV variables for MiniProfiler snapshots transporter (#10985) 2020-10-21 19:37:28 +03:00
Kris 08104e058a
UX: Fix mobile padding-top on mobile, follow up to da5841d (#10982) 2020-10-21 17:52:35 +11:00