Commit Graph

25666 Commits

Author SHA1 Message Date
Martin Brennan
0f03884375
DEV: Refactor bookmark modal code (#14654)
We had code to open the bookmark modal in two places -- the bookmark
list and also from within a topic. This caused the two code paths to
drift, as in the bookmark list we were not passing in the forTopic or
autoDeletePreferences data into the modal, and we were also not refreshing
the bookmark list when the bookmark was deleted from within the modal.

This commit moves the modal opening code into an importable
function from the controllers/bookmark module, and all callers
have to do is pass it an instance of Bookmark and also options
for what to do for the following:

* onAfterSave
* onAfterDelete
* onCloseWithoutSaving
2021-10-21 09:02:35 +10:00
David Taylor
010309d108
SECURITY: Improve validation of SNS subscription confirm (#14671)
An upstream validation bug in the aws-sdk-sns library could enable RCE under certain circumstances. This commit updates the upstream gem, and adds additional validation to provide defense-in-depth.
2021-10-20 22:20:52 +01:00
Osama Sayegh
8fb823c30f
FIX: Make the verbose_auth_token_logging setting off by default (#14664)
The `generate`, `rotate` and `suspicious`  auth token logs are now always logged regardless of the `verbose_auth_token_logging` setting because we rely no these to detect suspicious logins.
2021-10-20 17:20:39 +03:00
Penar Musaraj
1f8939c0f1
FIX: Show search context only in topic routes (#14650) 2021-10-20 09:48:26 -04:00
Penar Musaraj
3e86ec3e4e
FIX: Broken quick search on iPadOS (#14663)
This also reverts back to selecting the search input text when reopening
the search panel.
2021-10-20 09:31:53 -04:00
Joffrey JAFFEUX
c2d4638ee1
DEV: drops jquery usage from wizard-canvas (#14662) 2021-10-20 14:42:06 +02:00
Joffrey JAFFEUX
adb302f801
DEV: drops jquery usage un admin-report-chart (#14661) 2021-10-20 14:28:49 +02:00
Arpit Jalan
1b8feae0bc
FIX: reset sso email and payload when user navigates away (#14658) 2021-10-20 17:21:32 +05:30
Joffrey JAFFEUX
d18e3a45b9
FIX: none row doesn’t have a value, use class to target it (#14659) 2021-10-20 13:07:58 +02:00
Alan Guo Xiang Tan
e74e3fa043
FIX: Topic timeline not updating in megatopics. (#14645)
Before this fix, jumping to posts using the topic timeline scrollbar
will not update the counts since the topic scrollarea is not rerendered.

Follow-up to db337b10ee
2021-10-20 11:42:22 +08:00
Martin Brennan
ecee9d000b
FEATURE: Allow recovery of deleted small action posts (#14643)
Previously when clicking the Delete button for small action posts
there was no way to recover this post if the action was accidental.
Now if canRecover is true on the post, which it is just after it
is deleted and the post is fetched from the server again, we show
an undo button which calls the recover endpoint for the post.

We also now disallow the editing of the post if it is deleted, and
show the proper deleted red CSS on the small action post when deleted.
2021-10-20 08:13:27 +10:00
Penar Musaraj
a1daf9fe53
FIX: Do not query backend when searching "in this topic" (#14649) 2021-10-19 13:01:42 -04:00
Andrei Prigorshnev
b9164d22ee
FEATURE: add a hidden setting that enables using email as a source for username suggestions (#14623)
This is a follow-up to https://github.com/discourse/discourse/pull/14541. This adds a hidden setting for restoring the old behavior for those users who rely on it. We'll likely deprecate this setting at some point in the future.
2021-10-19 14:37:39 +04:00
Joffrey JAFFEUX
a5eba43a65
FIX: only replaces double quotes and uses unicode (#14644)
`’` is actually not converted and doesn’t need to be normalised to `'`
2021-10-19 11:01:46 +02:00
Martin Brennan
d3678f6930
FIX: Do not show recipient user in email participants list (#14642)
This commit removes the recipient's username from the
respond to / participants list that is shown at the bottom
of user notification emails. For example if the recipient's
username was jsmith, and there were participants ljones and
bmiller, we currently show this:

> "reply to this email to respond to jsmith, ljones, bmiller"

or

> "Participants: jsmith, ljones, bmiller"

However this is a bit redundant, as you are not replying to
yourself here if you are the recipient user. So we omit the
recipient user's username from this list, which is only used
in the text of the email and not elsewhere.
2021-10-19 15:26:22 +10:00
Martin Brennan
2364626ded
FEATURE: Change all core to use uppy-image-uploader (#14428)
Instead of using image-uploader, which relies on the old
UploadMixin, we can now use the uppy-image-uploader which
uses the new UppyUploadMixin which is stable enough and
supports both regular XHR uploads and direct S3 uploads,
controlled by a site setting (default to XHR).

At some point it may make sense to rename uppy-image-uploader
back to image-uploader, once we have gone through plugins
etc. and given a bit of deprecation time period.

This commit also fixes `for_private_message`, `for_site_setting`,
and `pasted` flags not being sent via uppy uploads onto the
UploadCreator, both via regular XHR uploads and also through
external/multipart uploads.

The uploaders changed are:

* site setting images
* badge images
* category logo
* category background
* group flair
* profile background
* profile card background
2021-10-19 13:25:42 +10:00
Martin Brennan
1d131fcaff
FIX: Clarify None Needed option when editing bookmarks (#14633)
This commit makes the following change to the Edit Bookmark
modal window for clarity:

* If the user is editing an existing bookmark without a reminder set,
hide the "none needed" option. This will draw more attention to the
delete button.
* If the user is editing an existing bookmark with a reminder set for the
future, change the "none needed" option to say "remove reminder, keep bookmark"

To do this, I needed to provide an option to override the labels
for time shortcuts in certain cases, so I could keep the NONE shortcut
but have the different wording.
2021-10-19 10:32:20 +10:00
Penar Musaraj
560216b6a1
UX: Adjust quick search input width (#14640)
Ensures input takes up all available space (without contents overlapping icons).
2021-10-18 17:01:08 -07:00
Penar Musaraj
919a9a902a
FIX: Hide full screen toggle button when textarea is disabled (#14638) 2021-10-18 16:00:22 -04:00
Penar Musaraj
073e5ccd83
UX: Better topic search experience (#14625) 2021-10-18 13:17:27 -04:00
Penar Musaraj
7a4a1744a2
UX: Show fewer toolbar icons in mobile composer (#14621) 2021-10-18 10:16:10 -04:00
Jarek Radosz
70634198a4
UX: Display full-page user search in a grid (#14636)
Two reasons for this change:
1. Better utilization of the screen space (i.e. displaying more than 5 entries on a 13" display)
2. Making user link elements smaller fixes user-card positioning (it no longer displays far to the right, away from the user name/avatar)
2021-10-18 15:36:30 +02:00
Jean
6275658e3d
FEATURE: Add setting to disable notifications for topic category edits (#14632) 2021-10-18 09:04:01 -04:00
Alan Guo Xiang Tan
fb5a062b1f
DEV: Remove TopicView#first_post_id. (#14631)
The method was only used for mega topics but it was redundant as the
first post can be determined from using the condition where
`Post#post_number` equal to one.
2021-10-18 14:47:47 +08:00
Martin Brennan
ca7fd77a94
DEV: Bump uppy module versions for retryable prepareUploadParts (#14629)
This commit bumps the following uppy modules:

* @uppy/aws-s3
* @uppy/aws-s3-multipart
* @uppy/core
* @uppy/drop-target
* @uppy/xhr-upload

This is done so we can use the new functionality for retrying
failed prepareUploadParts calls, introduced in
e435f4a917.

I also needed to make some changes to composer-upload-uppy to
support this retrying, while at the same time being able to
throw a bootbox with the error message if the number of retries
are exceeded.
2021-10-18 15:28:27 +10:00
Qursch
11763a5e8d
FEATURE: Add reversed and type to allowed attributes (#14626) 2021-10-18 12:11:13 +11:00
Penar Musaraj
7c7dd2335b
FIX: Category and tag picker alignment on mobile (#14622) 2021-10-15 10:25:11 -04:00
Mark VanLandingham
69381663eb
REVERT: "DEV: APIs to disable PWA badging and unsubscribe from user notifications (#14595)" (#14620)
This reverts commit e1d3175668.
2021-10-15 08:45:55 -05:00
Krzysztof Kotlarek
7c7e03e54b
FIX: correct api version after minor bump (#14615) 2021-10-15 09:21:51 +08:00
Krzysztof Kotlarek
2e09dc8885
FEATURE: add downloadCalendar to plugin api (#14603)
New download calendar feature should be exposed via api
2021-10-15 09:14:35 +11:00
Penar Musaraj
2a7280ac48
FIX: Improve quick search speed and result highlights (#14610) 2021-10-14 15:24:11 -04:00
Mark VanLandingham
9b835e1003
DEV: Allow register options to be passed to registerServiceWorker (#14609) 2021-10-14 10:41:28 -05:00
Joffrey JAFFEUX
d76d418e5d
FIX: also track textContent mutations (#14607)
Tracking innerHTML was not enough to catch every mutations.
2021-10-14 12:14:48 +02:00
Osama Sayegh
7f3468e7d5
FIX: Decorate posts that are loaded after the initial render in post stream (#14600)
To clarify, this problem is not about the topic posts stream, it's about posts streams like the user Activity one in the profile page (or in technical terms anything using the `{{user-stream}}` component).

Post decorations are currently applied inside a `didInsertElement` hook of the `{{user-stream}}` component. However, when the user scrolls the component will load more posts but these will be missing decorations because the `didInsertElement` is only fired once at the beginning of the component lifecycle.

This PR makes the component keep track of the last decorated post/DOM node, and when new posts are loaded the component fire an event for each new post and pass the post's DOM node with the event. Our plugin API 

(I noticed this problem when I was working on https://github.com/discourse/discourse-follow/pull/37)

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2021-10-14 08:10:13 +03:00
Krzysztof Kotlarek
9062fd9b7a
FIX: improvements for download local dates (#14588)
* FIX: do not display add to calendar for past dates

There is no value in saving past dates into calendar

* FIX: remove postId and move ICS to frontend

PostId is not necessary and will make the solution more generic for dates which doesn't belong to a specific post.

Also, ICS file can be generated in JavaScript to avoid calling backend.
2021-10-14 09:22:44 +11:00
David Taylor
ae0ca39bd1
FIX: Ensure embedded replies/reply-to links open in _blank (#14597)
In most cases, these links are handled in JavaScript, so the `href` and `target` are not used. However, when the `link-to-post` refers to a post which is not currently loaded in the DOM (e.g. it is the OP), then the href is used, and we need to add a `target` to prevent page navigation within the embed iframe.
2021-10-13 21:34:30 +01:00
Penar Musaraj
0616a5ac7c
UX: Better visibility for context search (#14599) 2021-10-13 15:52:17 -04:00
Mark VanLandingham
8b25aaed14
DEV: Export register service worker logic (#14598) 2021-10-13 13:19:20 -05:00
Gerhard Schlager
9ab9eda40e
PERF: Reduce work when external sources are allowed in InlineUploads (#14594)
It also fixes a bug in `match_bbcode_img()` which didn't check `block_given?` for all conditions.
2021-10-13 18:59:05 +02:00
Mark VanLandingham
e1d3175668
DEV: APIs to disable PWA badging and unsubscribe from user notifications (#14595) 2021-10-13 11:47:30 -05:00
David Taylor
bc68da24cd
DEV: Fix presence testing in legacy ember environment (#14596)
The legacy testing environment will remove the User.current() value before disposing of controllers/components. Presence often involves making HTTP calls during disposal of components, so this can cause issues.

Production, and the modern Ember-CLI environment, do not require this hack, so it is behind an `isTesting() && isLegacyEmber()` check.
2021-10-13 17:24:19 +01:00
Penar Musaraj
74706bab10
UX: Add Enter hint to search dropdown (#14587) 2021-10-13 12:09:28 -04:00
Penar Musaraj
a3fde50b62
A11Y: Don't output aria label identical to title (#14586) 2021-10-13 11:19:38 -04:00
Joffrey JAFFEUX
11bd3438c4
FIX: groups using users icon were lacking margin in search (#14591) 2021-10-13 12:38:35 +02:00
Bianca Nenciu
c4843fc1c1
FEATURE: Allow admins to permanently delete posts and topics (#14406)
Sometimes administrators want to permanently delete posts and topics
from the database. To make sure that this is done for a good reasons,
administrators can do this only after one minute has passed since the
post was deleted or immediately if another administrator does it.
2021-10-13 12:53:23 +03:00
Gerhard Schlager
76c9de2d04
UX: Add missing translation (#14592) 2021-10-13 11:23:53 +02:00
Joffrey JAFFEUX
b59c419253
FIX: attempts to observe preview mutation asap (#14590) 2021-10-13 09:28:55 +02:00
Joffrey JAFFEUX
00e8baffa2
FIX: attempts to enforce caret position in filter (#14589) 2021-10-13 08:19:34 +02:00
Penar Musaraj
308823a253
FIX: Use absolute URLs in search shortcut (#14585) 2021-10-13 10:14:45 +05:30
Vinoth Kannan
1b99f99ff7
UX: remove aria-label for buttons when title attribute exists. (#14529)
Both `aria-label` and `title` have the same value and NVDA reading both the texts while navigating between buttons. NVDA already has an open issue https://github.com/nvaccess/nvda/issues/7841. We're removing `aria-label` until they fix it.
2021-10-12 23:55:59 +05:30