Commit Graph

22291 Commits

Author SHA1 Message Date
Joffrey JAFFEUX a8308e73e7
FIX: improves tag-list setting (#9574)
- Prevents setting to display an empty tag
- Updates dropdown when selecting/removing tag
2020-04-28 20:05:30 +02:00
Joffrey JAFFEUX a6f986b50f
FEATURE: allows to to style published page with themes/plugins (#9570) 2020-04-28 18:24:24 +02:00
Penar Musaraj b19dcac272
FIX: Include default notification level in category serializer (#9572)
Fixes an issue where the notification level state goes missing when user edits a category in the UI.
2020-04-28 12:05:53 -04:00
Joffrey JAFFEUX 4b57eb7049
FIX: published pages couldn't be routed from inside discourse (#9569)
This will allow to post a link to published page in a post. Before this, users clicking this link would have seen a 404.

ATM /pub is server sider only.
2020-04-28 16:37:56 +02:00
Robin Ward c1cc2f2a05
DEV: Remove ember-addons (#9559)
We weren't using this very much and introduces a dependency between
discourse-common and discourse which makes moving to yarn workspaces
more difficult.

In the future we might user ember-addons properly but for now it's
easier to move the code into discourse-common.

Note the old folder is still there because at least one plugin was still
requiring the old files. It will be removed in the future.
2020-04-28 10:14:49 -04:00
Arpit Jalan 198856f78d DEV: annotate models 2020-04-28 15:59:39 +05:30
mentalstring 67f3fe14aa
FEATURE: support SSO website and location overrides
Add location and website + the ability to override using SSO using the `sso_overrides_location` and `sso_overrides_website` site settings.
2020-04-28 16:06:35 +10:00
Joffrey JAFFEUX 23ff071ebd
FIX: currentUser might be undefined (#9555) 2020-04-28 15:55:06 +10:00
Kris 82c5d85e99 add btn-default class to show-tag-info button 2020-04-27 23:29:28 -04:00
Martin Brennan 66b5b8cf29
FIX: Local time not updating between user cards (#9564)
The local time was not updating between user cards because the computed property was not used correctly.

There's an old saying in Tennessee — I know it's in Texas, probably in Tennessee — that says, fool me once computed properties, shame on — shame on you. Fool me — you can't get fooled again.
2020-04-28 13:23:43 +10:00
Kris f9a44488e9 UX: Right align notification item time, adjust mobile space, consolodate 2020-04-27 23:19:15 -04:00
Kris dcb40a92c7 Add discovery-below outlet to tag pages too 2020-04-27 22:49:11 -04:00
Kris c679c8008c Remove additional wrapper, follow-up to d516a88 2020-04-27 22:13:31 -04:00
Penar Musaraj a70ca3a72a UX: Better spacing for composer toggle buttons on mobile 2020-04-27 22:04:29 -04:00
Penar Musaraj b1d30d7f05 FIX: keep scroll position when minimizing composer in iOS 2020-04-27 22:03:56 -04:00
Joffrey JAFFEUX ad978b93ab
FIX: Correctly shows no bookmark message (#9548) 2020-04-28 11:19:35 +10:00
Joffrey JAFFEUX 2c6d6dfd05
FIX: Improves bookmark shortcut reliability and other minor issues (#9547)
This commit reworks slightly the `toggleBookmark` and `toggleBookmarkTopic` functions.

- Pressing [f] (toggleBookmarkTopic)
  - a topic list item is selected, we attempt to toggle the related topic
  - a post is selected, we bookmark the current topic
  - nothing is selected, if there's a currentTopic we bookmark it

- Pressing [b] (toggleBookmark)
  - a post is selected, we bookmark it
  - a topic list item is selected, we attempt to toggle the related topic
  - nothing is selected, if there's a currentTopic we bookmark it

Note this, commit also reduces jquery usage, a bug where the [f] shortcut was propagated to the modal input, and fixes bug when bookmarking a topic list item on the front page and the firstPost couldn't be found.
2020-04-28 10:32:59 +10:00
Martin Brennan bb4e965a66
FEATURE: Optionally show local time for user in card (#9527)
This adds a site setting (default off) to optionally show a user's local time and timezone in their user card. For example, I live in Brisbane, and if at 3:30PM my time I were to open a user who lives in California's card I would see 22:30 (PST).
2020-04-28 10:13:59 +10:00
Mark VanLandingham 051e6be7b8
DEV: Trigger 'user_added_to_group' when accepting invite with groups (#9561) 2020-04-27 15:13:34 -05:00
Roman Rizzi 394babcae3
FIX: Only show the review page to users that can see it. Do not publish the reviewable count update message to everyone. (#9556) 2020-04-27 14:51:25 -03:00
Mark VanLandingham d8c884a856
DEV: Add has_many category_tag_stats in tag.rb (#9558) 2020-04-27 12:42:13 -05:00
Robin Ward 056327c0c9
DEV: Move `discourse.js` to `app/app.js` (#9545)
This is another thing to get our application in line with what Ember CLI
expects.
2020-04-27 13:28:10 -04:00
Guo Xiang Tan 16f0d1c503
PERF: Remove database query when publishing to staff users. 2020-04-27 11:50:21 +08:00
Jarek Radosz e0aec23844 DEV: Don't warn about valid data 2020-04-26 22:18:44 +02:00
Dan Ungureanu 0ae504aece
FIX: Raise a 4xx error instead of a 5xx if draft data is invalid 2020-04-25 11:47:22 +03:00
Sam Saffron 1f6eaf26a1
Revert "UX: replace closed topic icon with discourse-no-entry"
This reverts commit 040b8c00a4.

We decided to keep status quo for now
2020-04-25 13:12:56 +10:00
Kris d516a88b4c DEV: add tag name class to body of tag pages 2020-04-24 22:27:25 -04:00
Kris 67429335d5 Remove SASS spacing function 2020-04-24 19:32:02 -04:00
Kris 040b8c00a4 UX: replace closed topic icon with discourse-no-entry 2020-04-24 17:31:34 -04:00
Jeff Wong e638d43f0a
FEATURE: dismiss first notification on click anywhere (#9525)
FEATURE: dismiss first notification on click anywhere

Quicker jumpstart for those already familiar with the platform:

Allow dismissal of first notification mask from any click.
On the dismissal click, we also need to send a "yes I saw it" confirmation
by grabbing a batch of notifications. This prevents the dialog from appearing
again on refresh, or other browsers and ensures we only see it once.
2020-04-24 13:27:54 -07:00
Penar Musaraj 5a3350cd76 FIX: Do not override all title elements with page title
This is redudant too, setting document.title is sufficient.
2020-04-24 10:16:05 -04:00
Penar Musaraj b45142ef79
FIX: reenable draft check modal and fix focus on iOS for PMs 2020-04-24 09:35:19 -04:00
Joffrey JAFFEUX d83f39be73
DEV: replaces jquery scrollTop by vanilla js code (#9543) 2020-04-24 12:45:47 +02:00
David Taylor 0616826841
DEV: Add jquery-free `decorateCookedElement` function to plugin api (#9534)
This is a replacement for `decorateCooked` which will work without jquery.

A backwards compatibility layer is provided for existing plugins/themes which are currently using `decorateCooked`
2020-04-24 09:47:33 +01:00
David Taylor 8a112b7464
DEV: Automatically extend CSP when themes link to external scripts (#9531) 2020-04-24 09:47:01 +01:00
Joffrey JAFFEUX 90d6816d19
FIX: removes inheriting as it's too random and can be very hard to track (#9542) 2020-04-24 10:08:22 +02:00
Sam Saffron cbceadf48b
FEATURE: when blocking emails prefer blocking canonical
Previously we relied entirely on levenshtein_distance_spammer_emails site
setting to handle "similar looking" emails.

This commit improves the situation by always preferring to block (and check)
canonical emails.

This means that if:

`samevil+test@domain.com` is blocked the system will block `samevil@domain.com`

This means that `samevil+2@domain.com` (ad infinitum) will be blocked
2020-04-24 14:09:51 +10:00
Sam Saffron 6a18c9aa0b
Revert "FEATURE: enforce_canonical_emails site setting"
This reverts commit 6f9177e2ed.

We decided on a completely different approach to the problem.

Instead we will let blocked emails be treated as canonical.
2020-04-24 13:52:06 +10:00
Martin Brennan cd1c7d7560
FIX: Copying image markdown for secure media loading full image (#9488)
* When copying the markdown for an image between posts, we were not adding the srcset and data-small-image attributes which are done by calling optimize_image! in cooked post processor
* Refactored the code which was confusing in its current state (the consider_for_reuse method was super confusing) and fixed the issue
2020-04-24 10:29:02 +10:00
Blake Erickson bd3425b389 REFACTOR: Use rescue inside do/end block
Follow up to 9cbbaf4237
2020-04-23 16:26:29 -06:00
Kris 9f52997be1 UX: Let's try X for the closed topic icon instead of a \ 2020-04-23 17:23:25 -04:00
Joffrey JAFFEUX b19d50f355
FIX: site settings dropdown can be 440px width (#9539) 2020-04-23 23:12:58 +02:00
Joffrey JAFFEUX b871e79c5b
FIX: removes rounding correction as it can be in either direction (#9538) 2020-04-23 23:10:40 +02:00
Penar Musaraj 7cd006fe3a Revert "DEV: Draft check async when starting new PM"
This reverts commit e49212d0bc.

This requires some more work.
2020-04-23 15:51:54 -04:00
Blake Erickson 5b98161f2f
DEV: ember-cli refactor for TextField and TextArea imports (#9480)
In order to be able to use ember-cli we need to fix the import
statements for `TextField` and `TextArea` in the code base.

The only change I don't fully understand is the one in
`discourse-loader.js`, but adding the components to that file make it
all work.
2020-04-23 12:36:05 -06:00
Penar Musaraj e49212d0bc DEV: Draft check async when starting new PM
When the sequence is missng, the draft check is done synchronously and it results in  iOS devices not launching the keyboard.
2020-04-23 14:17:15 -04:00
Mark VanLandingham 3e543dfa18
FIX: Do not set title attribute on header-topic-info widget (#9533) 2020-04-23 12:44:20 -05:00
Joffrey JAFFEUX 82b43451b3
FIX: Inner content of a row could have no max-width and be very large (#9532) 2020-04-23 19:18:01 +02:00
Joffrey JAFFEUX be1b7f7468
FIX: fails gracefully if :scope is not handled by a browser (#9529) 2020-04-23 16:50:30 +02:00
Roman Rizzi 7a2e8d3ead
DEV: Add the missing `app` subdirectory (#9499)
* DEV: Add missing  directory to the Discourse ember app

* DEV: Resolve imports correctly
2020-04-23 10:07:54 -03:00
David Taylor 8e28ccb2ea
PERF: Refactor decorateCooked to run in a detached DOM (#9517)
This means that decorateCooked can be used to modify HTML without triggering the download of remote resources (e.g. images)

In some rare cases (e.g. IntersectionObservers in Chromium), decorating needs to happen in the real DOM. For this, pass `afterAdopt: true` to `decorateCooked`
2020-04-23 11:03:46 +01:00
Sam Saffron 8dccf0521c
Revert "PERF: stop firing superfluous onSelectionChange"
This reverts commit fa96054acf.

Sadly this fails a test case, we may have to hunt up all the
parentElements to check for the cooked class to perform the
bypass
2020-04-23 18:16:13 +10:00
Sam Saffron fa96054acf
PERF: stop firing superfluous onSelectionChange
onSelectionChanged fires a debounced event that calls window.getSelection()

window.getSelection() is reasonably expensive. There is no reason to do any
of this work if we have an input field focused, that is not how quote works
2020-04-23 17:51:23 +10:00
Joffrey JAFFEUX 7132c50f3b
FIX: prevents constant composer reloading (#9528) 2020-04-23 07:54:29 +02:00
Sam Saffron d69ec186b9
Revert "DEV: DiscourseEvents fired when users are added/removed from groups (#9522)"
This reverts commit 54ec9f7009.

The commit clashes with a previous implementation of the same event
2020-04-23 15:06:55 +10:00
Krzysztof Kotlarek 52c1d7337e
FEATURE: don't display new/unread notification for muted topics (#9482)
* FEATURE: don't display new/unread notification for muted topics

Currently, even if user mute topic, when a new reply to that topic arrives, the user will get "See 1 new or updated topic" message. After clicking on that link, nothing is visible (because the topic is muted)

To solve that problem, we will send background message to all users who recently muted that topic that update is coming and they can ignore the next message about that topic.
2020-04-23 14:57:35 +10:00
Mark VanLandingham 54ec9f7009
DEV: DiscourseEvents fired when users are added/removed from groups (#9522) 2020-04-23 14:53:31 +10:00
Joffrey JAFFEUX 3bbd8b1258
UX: rework date time input range (#9524) 2020-04-22 22:17:53 +02:00
Blake Erickson 9cbbaf4237 FIX: Don't throw 500 for invalid website url input
It's possible to cause a 500 error by putting in weird characters in the
input field for updating a users website on their profile.

Normal invalid input like not including the domain extension is already
handled by the user_profile model validation. This fix ensures a server
error doesn't occur for weird input characters.
2020-04-22 13:57:56 -06:00
Joffrey JAFFEUX 00f632fb0d
REFACTOR: s/translatedfilterPlaceholder/translatedFilterPlaceholder (#9521) 2020-04-22 20:39:55 +02:00
Joffrey JAFFEUX 4c248fc5c4
UX: do not attempt to full width sk on mobile (#9520) 2020-04-22 20:39:45 +02:00
Robin Ward e4a0e0bead FIX: Ignore removed column 2020-04-22 14:27:01 -04:00
Vinoth Kannan df0c386f8a
UX: drop the `automatic_membership_retroactive` column from groups model. (#9430) 2020-04-22 22:07:39 +05:30
Kris bf0c055a9a UX: add comment-plus icon for reopening topics 2020-04-22 12:29:27 -04:00
Krzysztof Kotlarek 81c216e04c
FIX: composer problem on the categories page (#9508) 2020-04-22 09:24:54 -07:00
Mark VanLandingham 04fb37c7a4
DEV: Export openNewCategoryModal from discovery-categories (#9501) 2020-04-22 11:03:28 -05:00
Eric Mueller 45f3517ef6
FEATURE: add class to <aside> quote block when quoting an ignored user (#9511)
* add class to <aside> quote block when quoted an ignored user

* Changed from single to double quotes
2020-04-22 12:00:44 -04:00
Robin Ward 13f2723dcb FIX: Don't log an error to logster if a topic could not be updated.
If for some reason an update did not go through (for example,
concurrently updating the same topic twice), we were logging something
like:

```
create_errors_json called with unrecognized type: #<Topic
```

This happened because we knew an error occurred but the active record
object had no errors attached.

This patch fixes the issue by attaching a proper error message in the
event that this happens.
2020-04-22 11:56:04 -04:00
Justin DiRose b7dea0d5c1
FIX: Copy button was displayed on quoted codeblock (#9514) 2020-04-22 15:57:25 +02:00
Vinoth Kannan e5c44f6dcf UX: display 'merge' button in all non-staff user profiles. 2020-04-22 17:42:09 +05:30
Daniel Waterworth c8fed90e4e FIX: Handle sub-sub-category paths without an id 2020-04-22 12:19:54 +01:00
Vinoth Kannan ceee855d00 minor code improvement
a511bea4cc
2020-04-22 16:40:59 +05:30
Joffrey JAFFEUX 5fb5807098
FIX: caret icon should inherit its color (#9513) 2020-04-22 13:10:02 +02:00
Joffrey JAFFEUX 4889dbde49
FIX: differentiate sk outline handling on single/multi (#9512) 2020-04-22 13:02:20 +02:00
Dan Ungureanu 4e5f9d4cd1
DEV: Drop 'key' column from user_api_keys (#9388) 2020-04-22 12:13:19 +03:00
Joffrey JAFFEUX 5c45363e67
UX: better outline support in sk components (#9510) 2020-04-22 10:54:02 +02:00
Dan Ungureanu e733701887
FEATURE: Make report filters reusable (#9444)
This commit also adds 'include subcategories' report filter
2020-04-22 11:52:50 +03:00
Vinoth Kannan a511bea4cc
FEATURE: admin UI to merge two users. (#9509) 2020-04-22 14:07:51 +05:30
Arpit Jalan ee63c35c35 DEV: use array for matching multiple values 2020-04-22 12:25:59 +05:30
Arpit Jalan c028e1aca7 FIX: use absolute url for `/user_avatar/` links 2020-04-22 12:08:59 +05:30
Martin Brennan 628ba9d1e2
FEATURE: Promote bookmarks with reminders to core functionality (#9369)
The main thrust of this PR is to take all the conditional checks based on the `enable_bookmarks_with_reminders` away and only keep the code from the `true` path, making bookmarks with reminders the core bookmarks feature. There is also a migration to create `Bookmark` records out of `PostAction` bookmarks for a site.

### Summary

* Remove logic based on whether enable_bookmarks_with_reminders is true. This site setting is now obsolete, the old bookmark functionality is being removed. Retain the setting and set the value to `true` in a migration.
* Use the code from the rake task to create a database migration that creates bookmarks from post actions.
* Change the bookmark report to read from the new table.
* Get rid of old endpoints for bookmarks
* Link to the new bookmarks list from the user summary page
2020-04-22 13:44:19 +10:00
Kris b6489d2690 UX: Replaced locked topic "lock" icon with "comment-slash" icon 2020-04-21 17:34:59 -04:00
David Taylor f51b48b421
PERF: Improve lazy-load performance in Safari
Safari starts loading images as soon as attributes are modified. Modern browsers all prefer the srcset attribute over src, so we should remove srcset last, and add it first.
2020-04-21 19:05:33 +01:00
Mark VanLandingham 036236d6d6
FIX: properly add 'two-rows' class to header-topic-info container (#9497) 2020-04-21 13:01:57 -05:00
David Taylor a97cb2444c
UX: Fix broken image placeholder styling 2020-04-21 19:00:47 +01:00
Robin Ward 63811707e8 DEV: Remove `setupTopicController` event 2020-04-21 13:48:33 -04:00
Jeff Wong c4cc19a2ba Revert "DEV: allow nav items to override computed property values"
This reverts commit 74e4102093.
2020-04-21 09:58:46 -07:00
Joffrey JAFFEUX 1eb9bc4cec
DEV: encapsulates _events and clearing it at app-events module level (#9489) 2020-04-21 17:27:17 +02:00
Justin DiRose c9cdd12e97
FIX: Improve selector for copy codeblock button (#9493)
Previous selector implementation was not accounting for codeblocks in
nested elements, like lists.
2020-04-21 10:12:56 -05:00
Joffrey JAFFEUX 62459c845f
DEV: allows a sk component to stop click propagation (#9495) 2020-04-21 17:11:40 +02:00
Joffrey JAFFEUX 79058a6d99
DEV: makes sk scroll to current selection (#9492) 2020-04-21 16:48:49 +02:00
Joffrey JAFFEUX 4f834f0008
DEV: allows click to propagate outside of header but not outside of sk (#9491) 2020-04-21 16:20:05 +02:00
Justin DiRose 6559ad0d80
FEATURE: Add copy button to codeblocks (#9451) 2020-04-21 08:02:13 -05:00
Martin Brennan d123138d3a
FIX: Only confirm bookmark delete if a reminder has been set (#9484)
We do not need a secondary bootbox confirm if the bookmark has no reminder, because nothing really will be lost in that case.
2020-04-21 14:29:12 +10:00
Jarek Radosz a781ef7662
FIX: Reject invalid Category slugs (#9473)
Previously it would sanitize given slug and then save the resulting empty slug.
2020-04-21 03:50:50 +02:00
Jarek Radosz 17cf300b71
DEV: Use more specific error responses (#9472)
* DEV: Use `render_json_error` (Adds specs for Admin::GroupsController)
* DEV: Use a specific error on blank category slug (Fixes a `render_json_error` warning)
* DEV: Use a specific error on reviewable claim conflict (Fixes a `render_json_error` warning)
* DEV: Use specific errors in Admin::UsersController (Fixes `render_json_error` warnings)
* FIX: PublishedPages error responses
* FIX: TopicsController error responses (There was an issue of two separate `Topic` instances for the same record. This makes sure there's only one up-to-date instance.)
2020-04-21 03:50:20 +02:00
Jarek Radosz 5a81e3999c
DEV: Remove `bypass_bump` from CookedPostProcessor (#9468)
It was only passing it along to `PullHotlinkedImages` and that class have not used that arg since April 2014 (c52ee665b4)
2020-04-21 03:48:19 +02:00
Jarek Radosz 9a6e4b1fa1
FIX: Make InlineUploads handle more URL formats (#9467)
It previously failed to match URLs with characters other than `[a-zA-z0-9\.\/:-]`. This meant that `PullHotlinkedImages` would sometimes download an external image and then never use it in any posts.
2020-04-21 03:47:48 +02:00
Krzysztof Kotlarek e9f7262813
FIX: when category or tag is muted, update user (#9456)
Currently, when category or tag is muted, only after hard refresh, these new muted categories are really muted. Without a hard refresh, you will still receive "new topic" messages.

Therefore, when tag or category is muted, we should update the user object right away.
2020-04-21 08:33:55 +10:00
Jeff Wong 74e4102093 DEV: allow nav items to override computed property values
Plugins need to override extra nav-items. Make sure these properties are
override-able.

See:
https://deprecations.emberjs.com/v3.x/#toc_computed-property-override
2020-04-20 15:21:58 -07:00
Robin Ward ce9c59309c FIX: Temporarily compatibility for Evented on a Topic Route 2020-04-20 17:14:51 -04:00
Robin Ward 5d9f5dd11f REVERT: Fix to app-events to make events not global 2020-04-20 16:57:46 -04:00
Robin Ward 091d6dc9fc DEV: Triggering "saw" on every element seems pointless
We don't seem to wire this up to any listeners, so why waste time doing
all this work?
2020-04-20 16:51:36 -04:00
Robin Ward 28e9f54e2f DEV: `sawTop` never seems used in our codebase or any plugins 2020-04-20 16:48:51 -04:00
Robin Ward 96d026a329 DEV: Remove EventTarget. Future versions of Ember don't export this.
It was removed altogether from ApplicationRoute, which only triggered
an `activate` event which never seems to be used.

We can replace it with Evented which is still present.
2020-04-20 16:45:01 -04:00
Mark VanLandingham 06796bec8b
FIX: Set category description to first posts cooked value (#9478) 2020-04-20 14:51:49 -05:00
Robin Ward 25bed4f643 FIX: Concurrency issues with making topic embedded posts visible 2020-04-20 15:11:59 -04:00
Robin Ward 98729c8e6e FIX: Allow embed updates of just the title 2020-04-20 14:31:24 -04:00
Robin Ward 56a23c68f1 FIX: Embedded topics couldn't update their titles 2020-04-20 14:27:43 -04:00
Kane York ea8b40a53b
FEATURE: Add created_at column to user_badges (#9463)
* FEATURE: Add created_at column to user_badges

This makes scraping for newly granted badges easier.

Patch from @eviltrout applied.

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2020-04-20 10:03:25 -07:00
Mark VanLandingham e5233f5ce6
DEV: Add class to header-topic-info widget (#9475) 2020-04-20 10:34:05 -05:00
Sam Saffron ee36382640
FEATURE: improve rendering of RSS feeds
- Eliminate superfluous "author wrote" block
- Eliminate block-quote for all posts
- Move participant count and reply count to 1 line
- Prioritize name over username if forum requests
- Use fabrication in list controller spec to speed up spec
2020-04-20 16:08:24 +10:00
Martin Brennan 344ef5226c
FEATURE: Edit bookmark reminders from post and explicit delete button (#9455)
There is now an explicit "Delete Bookmark" button in the edit modal. A confirmation is shown before deleting.

Along with this, when the bookmarked post icon is clicked the modal is now shown instead of just deleting the bookmark. Also, the "Delete Bookmark" button from the user bookmark list now confirms the action.

Add a `d d` shortcut in the modal to delete the bookmark.
2020-04-20 13:30:04 +10:00
Joffrey JAFFEUX cfe510cbcf
FIX: prevents custom emoji to show double colons and set background img (#9471) 2020-04-19 18:54:10 +02:00
Mark VanLandingham 0e74dd7d7c
FIX: Set user timezone on password reset login (#9461) 2020-04-17 13:39:04 -05:00
Roman Rizzi dce46086f4
FIX: Do not raise an error if the post action type is nil (#9458) 2020-04-17 14:23:33 -03:00
David Taylor 4eebbd2212
Revert "FIX: Detect more unsupported browsers"
This change broke IE11 support, even with the polyfills enabled. We may need to add a WeakSet polyfill, but reverting this change for now.

This reverts commit 1cd8c6ce4c.
2020-04-17 16:41:47 +01:00
Roman Rizzi 35f51100e1
FEATURE: Users can be ignored for six months. (#9446) 2020-04-17 10:27:11 -03:00
David Taylor 576872a2d9
PERF: Enable new user card route by default (#9442)
https://meta.discourse.org/t/changes-to-the-user-card-data-source/139951
2020-04-17 09:42:57 +01:00
Joffrey JAFFEUX 17c0c9652d
FIX: stops bookmark keybaod event to be propagated into modal (#9457) 2020-04-17 10:05:51 +02:00
Martin Brennan 8f0544137a
FEATURE: Allow editing bookmark reminders (#9437)
Users can now edit the bookmark name and reminder time from their list of bookmarks.

We use "Custom" for the date and time in the modal because if the user set a reminder for "tomorrow" then edit the reminder "tomorrow", the definition of what "tomorrow" is has changed.
2020-04-17 11:08:07 +10:00
Penar Musaraj 6fad04635b
UX: Set focus when launching composer on iOS (#9443) 2020-04-16 20:19:23 -04:00
Krzysztof Kotlarek 5a60a4233e
FIX: topic title in search contains data-topic-id (#9435)
Data topic id is required by the discourse-encrypt plugin.

Related to https://github.com/discourse/discourse-encrypt/pull/12
2020-04-17 09:35:26 +10:00
Jordan Vidrine e96e57c629
UX: Wizard Font Size (#9448)
Define font-size in wizard
2020-04-16 16:31:24 -05:00
Joffrey JAFFEUX 98039e6cc5
FIX: template-lint uses strict rel-noopener rule which requires noreferrer (#9449) 2020-04-16 22:38:10 +02:00
David Taylor b6c19cba20
FIX: Abort emit_web_hook_event job cleanly if web hook was deleted (#9445)
Raising an error causes the job to be retried, and causes a lot of noise in the logs
2020-04-16 21:24:09 +01:00
Joffrey JAFFEUX 28906fdbc7
linting (#9447) 2020-04-16 22:14:46 +02:00
Joffrey JAFFEUX 0a9f283e7e
REFACTOR: various refactoring applied to group pages (#9440) 2020-04-16 22:12:37 +02:00
Robin Ward b37b238382 FIX: Reviewable score JS was in the wrong folder 2020-04-16 15:09:08 -04:00
Kane York 0fccea3762
FIX: Keyboard navigation fixes in setup wizard (#9413)
- Delete a positive tabindex from a reused component
 - Copy :hover styles to :focus
 - Replace an 'outline: 0' rule with a TODO for a custom :focus style

Discovered while fixing the no-positive-tabindex lint.
2020-04-16 12:01:11 -07:00
Jeff Atwood 6e1a33b744
revert heatmap color changes in favor of accessible theme 2020-04-16 11:14:25 -07:00
Kane York 424a76145d DEV: Fix no-implicit-this for all user-* components 2020-04-16 10:12:43 -07:00
Neil Lalonde 074509fd95
FIX: don't demote users to TL2 when default trust level is 3
Within 24 hours of signing up, new users were losing their
default trust level of 3. With this fix, demotions from
trust level 3 won't happen when the "default trust level"
setting is 3 or 4.
2020-04-16 12:28:16 -04:00
Joffrey JAFFEUX 1168d5c70a
FIX: ensures keyboard event is not propagated when using c shortcut (#9441) 2020-04-16 15:45:18 +02:00
Joffrey JAFFEUX 5e24436454
DEV: attempts to fix various leaks (#9428)
* DEV: attempts to fix various leaks

* scheduleOnce doesnt work with anon function

* removes the I18n change
2020-04-16 07:58:04 +02:00
Joffrey JAFFEUX ca06991ee5
FIX: makes topic-list-item decorator work on mobile (#9433) 2020-04-16 07:57:32 +02:00
Martin Brennan 51672b9121
FIX: Minor bookmark with reminder issue cleanup (#9436)
* Count user summary bookmarks from new Bookmark table if bookmarks with reminders enabled
* Update topic user bookmarked column when new topic bookmark changed
* Make in:bookmarks search work with new bookmarks
* Fix batch inserts for bookmark rake task (and thus migration). We were only inserting one bookmark at a time, completely defeating the purpose of batching!
2020-04-16 11:32:21 +10:00
Martin Brennan d7f744490a
FEATURE: Decorate topic-level bookmark button with reminder time (#9426)
* Show the correct bookmark with clock icon when topic-level bookmark reminder time is set and show the time of the reminder in the title on hover.
* Add a new bookmark lib and reminder time formatting function to show time with today/tomorrow shorthand for readability. E.g. tomorrow at 8:00am instead of Apr 16 2020 at 8:00am. This only applies to today + tomorrow, future dates are still treated the same.
2020-04-16 09:20:44 +10:00
Joffrey JAFFEUX 5a8a844e4e
FIX: attempts to listen more reliably to scopedCategoryId changes (#9431) 2020-04-15 19:59:27 +02:00
Vinoth Kannan 884eea7a83 FEATURE: add support for `upload` format in theme settings. 2020-04-15 18:34:02 +05:30
Joffrey JAFFEUX 8c58319992
DEV: allows to decorate topic header class (#9427) 2020-04-15 12:41:01 +02:00
Kane York f1b844ba88
FIX: Only apply bold font on topic lists (#9396) 2020-04-15 16:14:53 +10:00
Vinoth Kannan 4a2c4232c5
FIX: remove word boundary regex (\b) for search result highlights. (#9338) 2020-04-15 11:11:00 +05:30
Kane York c670a34013 DEV: Fix and enable the 'require-button-type' lint 2020-04-14 18:32:16 -07:00
Kane York 5a5685766a DEV: Fix all 'require-valid-alt-text' lints except in reused compoments
Three violations require parameters from the caller to generate valid alt text.
2020-04-14 17:21:20 -07:00
Krzysztof Kotlarek c21df2286c
FIX: add short_path to upload_serializer (#9417)
What problem I am trying to solve?

When an encrypted message is crafted and the image is added - discourse needs a hard refresh to display that image.

What is happening?

Everything starts here - when the upload is finished we add serialized object to the cache https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/components/composer-editor.js#L748:L757

Then, `discourse-encrypt` is trying to get an image from the cache and use `short_path` property
https://github.com/discourse/discourse-encrypt/blob/master/assets/javascripts/discourse/initializers/hook-decrypt-post.js.es6#L142:L143

Why is it working after a hard refresh?

After refresh, we populate cache once again using that function: https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/upload-short-url.js#L11:L17

And lookup_urls method from backend is returning `short_path`
https://github.com/discourse/discourse/blob/master/app/controllers/uploads_controller.rb#L55:L64

TL;DR We should expose short path in upload serializer. I ensured that this serializer is used only when attachments are uploaded so it should not affect performance.
2020-04-15 09:19:59 +10:00
Blake Erickson fec68d3d25 DEV: Confirm email when creating users via the API
This commit is for a frequently requested task on meta so that only 1
API call is needed instead of 3!

In order to create a user via the api and not have them receive an
activation email you can pass in the `active=true` flag. This prevents
sending an email, but it is only half of the solution and puts the db in
a weird state where it has an active user with an unconfirmed email.

This commit fixes that and ensures that if the `active=true` flag is set
the user's email is also marked as confirmed.

This change only applies to admins using the API.

Related topics on meta:

 - https://meta.discourse.org/t/-/68663
 - https://meta.discourse.org/t/-/33133
 - https://meta.discourse.org/t/-/36133
2020-04-14 14:56:32 -06:00
Mark VanLandingham 40531fc85e
DEV: themes_install_task find existing themes consistently (#9424) 2020-04-14 14:20:21 -05:00
Joffrey JAFFEUX 6023ea1979
DEV: pass widget back when cleaning up stream (#9422) 2020-04-14 18:45:40 +02:00
Joffrey JAFFEUX d9db0e6691
FIX: allows custom groups updates to be reflected without recompilation (#9421) 2020-04-14 16:43:57 +02:00
Mark VanLandingham f07c4a781c
DEV: Add options to theme install rake task - more options (#9394) 2020-04-14 09:17:00 -05:00
Martin Brennan 2aaf5cb2b8
FEATURE: Extend bookmark cutoff time for "Later Today" to 5pm (#9419)
* Extend cutoff time for "Later Today" to 5pm

* users can now use the Later Today option up until 5PM
* the time for later today maxes out at 6pm, so any time
  it is used after 3pm it is maxed to 6pm
* round to hour instead of half-hour for Later Today as well

* Rounding time bugfix
2020-04-14 17:28:51 +10:00
Joffrey JAFFEUX c4644c61d9
DEV: enforces double quotes ember-template-lint (#9416) 2020-04-14 08:18:49 +02:00
Martin Brennan 2d122f0393
FIX: Toggle bookmark for topic was not working after cancelling the modal (#9418)
* When bookmarking the topic, if the user cancelled the bookmark modal the bookmark topic button no longer worked because we did not reset the "bookmarked" property
* Prefill the custom reminder time to 8:00am
2020-04-14 15:17:24 +10:00
Sam Saffron 6f9177e2ed
FEATURE: enforce_canonical_emails site setting
The new `enforce_canonical_emails` site setting ensures that emails in the
canonical form are unique.

This mean that if `s.a.m+1@gmail.com` is registered `sam@gmail.com` will
not be allowed.

The commit contains a blanket "tag strip" (stripping everything after +)
it also contains special handling of a "dot strip" for googlemail and gmail.

The setting only impacts new registrations after `enforce_canonical_emails`

The setting is default false so it will not impact any existing installs.
2020-04-14 14:16:30 +10:00
Kris 10c2087a02 UX: Prevent category dropdown from wrapping count, limit mobile width 2020-04-13 17:23:37 -04:00
Robin Ward b6b92a562c
FEATURE: New site setting `embed_unlisted` (#9391)
If enabled, posts imported to discourse via embeddings will default to
unlisted until they receive a reply.
2020-04-13 15:17:02 -04:00
Dan Ungureanu 799ddeea3c
FIX: Include subcategories in 'posts' report (#9410) 2020-04-13 18:57:52 +03:00
tshenry a10c36994b
UX: Improve published page avatar resolution (#9405) 2020-04-13 08:57:27 -07:00
Joffrey JAFFEUX b66b277dc4
DEV: enforces block-indentation of ember-template-lint rules (#9408) 2020-04-13 17:17:20 +02:00
Joffrey JAFFEUX a863d8eecb
UX: applies default background color to onebox (#9407) 2020-04-12 21:21:21 +02:00
Joffrey JAFFEUX 0f14bce799
FIX: remove invalid background (#9406) 2020-04-12 21:14:58 +02:00
Vinoth Kannan 0cef409d49 UX: strip base64 image URLs when converting HTML to markdown. 2020-04-12 21:05:23 +05:30
Arpit Jalan 600cb2130d FIX: show today's date on /users page period chooser 2020-04-11 06:34:13 +05:30
Joffrey JAFFEUX d984848aa9
FIX: ensures toolbar is updated on composer action change (#9402) 2020-04-10 22:39:19 +02:00
Justin DiRose 5471c065cd
FIX: Missing timezone guess on email session login (#9404)
Timezone is guessed by moment.js if unset upon a normal login, but was not when
logging in via an email link. This adds logic to update a guessed
timezone upon email login so timezones don't end up blank.
2020-04-10 13:19:39 -05:00
Joffrey JAFFEUX 058506bb77
DEV: prevents toolbar callbacks to leak between tests (#9403) 2020-04-10 16:47:27 +02:00
Vinoth Kannan b57d4586d7 FIX: use correct command line attribute for `gifsicle` while scale down the gif. 2020-04-10 18:16:47 +05:30
Joffrey JAFFEUX 3e10d4133d
FIX: adds values/entries/NodeList.forEach/before polyfills for iOS 9.3 (#9401) 2020-04-10 13:52:33 +02:00
Joffrey JAFFEUX 3cac60f07c
DEV: enforce no-quoteless-attributes ember-template-lint (#9400) 2020-04-09 22:00:44 +02:00
Joffrey JAFFEUX d891665ac5
DEV: allows groups-selector to have an onChangeCallback (#9399) 2020-04-09 21:57:06 +02:00
Jeff Wong 5ccbc5f3ee
FEATURE: add after-reviewable-post-user plugin outlet (#9397)
FEATURE: add after-reviewable-post-user plugin outlet

Add a plugin outlet after reviewable post user

Add a basic user serializer that includes custom fields.
Allows review queue serializer to include custom fields for its users
2020-04-09 11:32:39 -07:00
Roman Rizzi 64ec771dc6
REFACTOR: Resize controls (#9393) 2020-04-09 12:13:15 -03:00
Dan Ungureanu 3d9c320aab
PERF: Cache Category.subcategory_ids (#9350)
Also reset category cache after backup restore.
2020-04-09 15:42:24 +03:00
Dan Ungureanu 1cd8c6ce4c
FIX: Detect more unsupported browsers 2020-04-09 11:47:59 +03:00
Martin Brennan befaf39aca
DEV: Refactor and test plugin addKeyboardShortcut (#9381)
Refactor plugin-api `addKeyboardShortcut` to point to `KeyboardShortcuts`.
* Do not add shortcuts to the default object directly.
* Create an addShortcut function in keyboard-shortcuts to add shortcuts safely and call to bindKey to be able to use opts.
* Refactor controllers/bookmark.js to use new addShortcut func and emove unnecessary addBindings.
* No longer export keyboard shortcut bindings, rename to DEFAULT_BINDINGS and remove export, these do not need to be accessed by anything else.
2020-04-09 10:30:26 +10:00
Martin Brennan 452d0c868f
FIX: Ensure first post is loaded before trying to bookmark topic (#9382)
Load first post if not loaded when trying to bookmark topic

* if the first post was not loaded we could not bookmark it because
  now we call the toggleBookmarkReminder function on an actual post
  to open the modal window
* add a firstPost function to the topic model to get the first post
  from the stream if it is loaded and if not do a GET request to load
  it
* use the firstPost promise when bookmarking topic
2020-04-09 09:42:03 +10:00
Kane York 138d4aebde FEATURE: Webhooks and Event for user being granted a badge
Adding a webhook for badge revocation is left for future work as it's relatively rare.
2020-04-08 14:38:30 -07:00
Kris 14467757df UX: Adjust noscript footer nav 2020-04-08 17:29:13 -04:00
Penar Musaraj c3593dd9e2
DEV: Replace jquery.putCursorAtEnd (#9390) 2020-04-08 16:13:02 -04:00
Kane York 3b7ba8ec99 FIX: WCAG-AA compliant topic list heatmap colors
Color #ec7213: 3.0, Bold - AA Large Pass
Color #b06318: 4.50, Normal - AA Pass
Color #93704a: 4.51, Normal - AA Pass

Used the Chrome Inspector color picker curves to preserve the hue and make minimally invasive changes to the coloring.
2020-04-08 11:58:44 -07:00
Kane York abdc10ae70 FIX: Labels for modal close and dismiss-error buttons 2020-04-08 11:56:29 -07:00
Dan Ungureanu 73d71e3fee
FEATURE: Show noscript view to unsupported browsers (#9373) 2020-04-08 20:24:18 +03:00
Robin Ward e1f8014acd
FEATURE: Support for publishing topics as pages (#9364)
If the feature is enabled, staff members can construct a URL and publish a
topic for others to browse without the regular Discourse chrome.

This is useful if you want to use Discourse like a CMS and publish
topics as articles, which can then be embedded into other systems.
2020-04-08 12:52:36 -04:00
Dan Ungureanu b64b590cfb
FIX: Add index on user_api_keys.key_hash (#9387) 2020-04-08 19:49:18 +03:00
Penar Musaraj 84f344c5d1 FIX: ensure .gap width does not exceed window width
Fixes an issue where the viewport was horizontally scrollable on iPad.
2020-04-08 11:38:25 -04:00
Jarek Radosz ae1a391377
FIX: Quoting posts (#9378)
Fixes to the quote feature. Most important changes listed below:

* FIX: Correctly attribute quotes when using Reply button
* FIX: Correctly attribute quotes when using replyAsNewTopic
* FIX: Allow quoting a quote
* FIX: Correctly mark quotes as "full"
* FIX: Don't try to create a quote if it's empty
* DEV: Remove an obsolete method `loadQuote`
  It isn't used in core anymore, the only use in core has been removed over 4 years ago in 3251bcb. It's not used in any plugins in all-the-plugins and all references to it on GitHub are from outdated forks (https://github.com/search?q=%22Post.loadQuote%22&type=Code)
2020-04-08 16:28:23 +02:00
Roman Rizzi 8e1bdc9458
FIX: Prevent low score flags from auto-closing a topic if the reviewable default visibility is higher than low (#9375) 2020-04-08 10:44:31 -03:00
Sam Saffron b824898f61
FIX: respect automatic group membership when sso changes email
Previously we were only updating group membership when a user record was
first created in an SSO setting.

This corrects it so we also update it if SSO changes the email
2020-04-08 16:33:50 +10:00
Sam Saffron 0375a5ac0b
DEV: reduce logging when no external id is specified
Previously we were returning an unknown sso error and logging a message
when external id was blank. This noise is not needed.
2020-04-08 12:42:28 +10:00
Arpit Jalan 236833ed5d FIX: redirect `/my/*path` to `/login-preferences` on client side 2020-04-08 07:10:58 +05:30
Jordan Vidrine 0991c4ae7e
FIX: Widen modal on desktop 2020-04-07 17:44:57 -05:00
Kane York ed95a6005b FEATURE: screenreader landmarks for main, suggested topics
In order to avoid a boatload of attributeBindings, I moved the root
element of the suggested-topics component into the template. Also,
autoformat their hbs files.

Testing info: https://www.scottohara.me/blog/2018/03/03/landmarks.html#using-screen-readers-to-navigate-landmarks

Additionally, flag modals with aria-modal=true to avoid the screenreader
accidentally escaping the modal. There's no need to ever toggle the
attribute to false, because we display:none the modal root when it's
closed.
2020-04-07 15:42:03 -07:00
Neil Lalonde c45574c9e7
FIX: exclude private messages from TL3 requirements
It wasn't intended that people should be able to earn trust level
3 without participating in public topics. When counting topic
views and likes given/received, don't count private topics.
2020-04-07 17:36:07 -04:00
Krzysztof Kotlarek a811976023
FIX: reset gravatar cache by adding random param to URL (#9370)
Users noticed that sometimes, avatar from Gravatar is not correctly updated - https://meta.discourse.org/t/updated-image-on-gravatar-not-seeing-it-update-on-site/54357

A potential reason for that is that even if you update your avatar in Gravatar, URL stays the same and if the cache is involved, service is still receiving the old photo.

For example. In my case, when I click the button to refresh avatar the
new Upload record is created with `origin` URL to new avatar, and `url` to
old one

I made some tests in the rails console and adding random param to Gravatar URL is deceiving cache and correct, the newest avatar is downloaded
2020-04-08 07:35:42 +10:00
Jordan Vidrine 3f49b13e5f
FIX: Fix untitled/long links extending out box 2020-04-07 13:46:40 -05:00
Robin Ward ce663d67e1 FIX: CSV Exports were throwing errors with invalid dates
This fix will consider any invalid dates to be non-existant.
2020-04-07 14:05:27 -04:00
Neil Lalonde e8fad7a69e
DEV: changes so plugins can customize invites UI (#9365)
* DEV: changes so plugins can customize invites UI

Co-Authored-By: Robin Ward <robin.ward@gmail.com>
2020-04-07 11:58:49 -04:00
Robin Ward 4f42bb1fd2
DEV: Support for `onChange` on `{{text-field}}` (#9362)
* DEV: Support for `onChange` on `{{text-field}}`

This will automatically be debounced and only fired when the value
changes.

There is also `onChangeImmediate` which is not debounced in case you
need that, but in almost all cases when observing text in an element you
should debounce.

* Add cancel for timer
2020-04-07 11:41:21 -04:00
Roman Rizzi e52e7f6e75
FIX: Include pending queued users regardless of their score (#9372) 2020-04-07 11:42:12 -03:00
Dan Ungureanu 0653750fbf
FEATURE: Hash user API keys in the database (#9344)
The 'key' column will be dropped in a future commit.
2020-04-07 16:42:52 +03:00
Martin Brennan 34df9f7908 Revert DEFAULT_SHORTCUTS plugin API-breaking change
* this was done in previous commit
93c38cc175,
  unaware that addKeyboardShortcut in plugin-api.js imports
  bindings from KeyboardShortcuts
2020-04-07 16:27:13 +10:00
Martin Brennan 42c2678d8f
FIX: Show topic level bookmark with reminder modal (#9336)
* When using the topic-level bookmark button or shortcut, we now show the bookmark with reminder modal for consistency.
* When hovering on a bookmark reminder notification where the bookmark has a name, show the name of the bookmark on hover.
2020-04-07 15:43:00 +10:00
Martin Brennan 7e42963590
DEV: Define keyboard shortcuts help onShow, and un-define onClose (#9355)
This is so we don't have a big hash just sitting in the controller definition, it is only created when it is needed. From comment here #9318 (comment)
2020-04-07 14:40:03 +10:00
Martin Brennan 93c38cc175
FEATURE: Bookmark keyboard shortcuts (#9318)
Adds keyboard bindings and associated help menu for selecting reminder type in bookmark modal, and pressing Enter to save.

Introduce the following APIs for `KeyboardShortcuts`:

* `pause` - Uses the provided array of combinations and unbinds them using `Mousetrap`.
* `unpause` - Uses the provided combinations and rebinds them to their default shortcuts listed in `KeyboardShortcuts`.
* `addBindings` - Adds the array of keyboard shortcut bindings and calls the provided callback when a binding is fired with Mousetrap.
* `unbind` - Takes an object literal of a binding map and unbinds all of them e.g. `{ enter: { handler: saveAndClose" } };`
2020-04-07 14:03:15 +10:00
Mark VanLandingham 58bec3b200
DEV: Option for adding an icon in wizard-field-checkboxes component (#9363) 2020-04-06 14:00:55 -05:00
Joffrey JAFFEUX 028915e4b9
FIX: revert inadvertently removed css class (#9360) 2020-04-06 19:22:29 +02:00
Jordan Vidrine 30983021e2
No category styles (#9359)
* UI: "No category styles" apply to category boxes
2020-04-06 12:02:33 -05:00
David Taylor 3814ca06a8
DEV: Allow using .js extension for javascript modules in themes (#9358) 2020-04-06 17:24:59 +01:00
Vinoth Kannan fd39c85c1a FIX: add category hashtags support for sub-sub categories.
Hashtags will include last two levels only (ex: "parent:child").
2020-04-06 20:43:38 +05:30
Joffrey JAFFEUX a947b7b839
FIX: prevents registering multiple `topic-notifications-button:changed` (#9356)
A large topic page will always have the bottom tracking button, and will also have the timeline, meaning we already had 2 tracking events.

But it gets even worse when you know that the timeline button is a component connector which will trigger `didInsertElement` very frequently, meaning we were constantly adding more and more appEvents handlers.
2020-04-06 15:06:26 +02:00
Sam Saffron 81c912bb00
FIX: when loading drafts set the topic
the behavior of loadDraft regressed and it no longer correctly set the topic
model leading to "undefined" when attempting to reply
2020-04-06 16:29:14 +10:00
Dan Ungureanu f8ec5f309a
FIX: Ensure category_id is an integer 2020-04-04 14:20:01 +03:00
Dan Ungureanu b9d411a4eb
FIX: Topic.time_to_first_response should include sub-sub-categories (#9349) 2020-04-04 13:31:34 +03:00
Kris a8002baaed UX: Restyle bookmark reminder modal 2020-04-03 20:49:09 -04:00
Jordan Vidrine 751f229665
UX: removes color on categories if no style chosen (#9346)
* UX: removes color on categories if no style chosen

* Update app/assets/javascripts/discourse/templates/components/categories-only.hbs

* Update messages.hbs

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2020-04-03 15:09:01 -05:00
David Taylor 3cfe086a94
FIX: Limit personal message participants when converting from topic (#9343)
Previously all topic posters would be added which could lead to major performance issues. Now if there are too many posters, only the acting user will be added as a participant.
2020-04-03 16:42:01 +01:00
David Taylor 91fff746a4
FIX: Check active themes for all requests
Previously, the list of active themes was only used in html views. Now we have theme modifiers, themes can affect .json routes.
2020-04-03 15:50:13 +01:00
Joffrey JAFFEUX 883901e4c0
FIX: do not attempt to deselect tags if filter is not empty (#9345) 2020-04-03 16:27:56 +02:00
Daniel Waterworth 76bb01c31c DEV: Increase process_post lock timeout
The process_post job uses CookedPostProcessor which also uses a
DistributedMutex. There's no good reason for the timeout of the outer
lock to be smaller than the timeout of the inner lock.
2020-04-03 13:34:44 +01:00
Vinoth Kannan 82201fa466 FIX: jobs/delete_replies: Add Time+Duration, not Time+Time #9314
Co-authored-by: Kane York <kanepyork@gmail.com>
2020-04-03 09:23:40 +05:30
Sam Saffron 20d8b49add
DEV: remove targetUsernames deprecation
Stable already has this rename, no need to carry the deprecation anymore.
2020-04-03 14:35:30 +11:00
Sam Saffron 83f5f9176b
DEV: only load staff logs when page is visited
Previously we would load admin staff action logs unconditionally as soon
as the controller was instantiated, this is not desirable we only want to
run the query when you visit the route.
2020-04-03 14:13:01 +11:00
Vinoth Kannan 2f9879a9a1 FIX: move total rows count & load more URL inside meta.
We're fetching "total rows count" from root attributes only if meta object not found. 2b78bd01ab/app/assets/javascripts/discourse/models/store.js (L236)
2020-04-03 07:32:50 +05:30
Joffrey JAFFEUX 9c43963ff3
FIX: allows color-input to set hex and color names through input (#9339) 2020-04-02 21:19:31 +02:00
Vinoth Kannan e7e931b70b FIX: track links in onebox body if it's same as header link. 2020-04-03 00:08:29 +05:30
Penar Musaraj 724d2e99de
DEV: Only include "report-sample" CSP directive when reporting is enabled (#9337) 2020-04-02 11:16:38 -04:00
Arpit Jalan ef7753953d FIX: show today's date on /top page period chooser 2020-04-02 20:36:08 +05:30
Zdravko Curic 41510d5b84
FIX: jQuery deprecation warning (#9331) 2020-04-02 09:54:51 -04:00
Vinoth Kannan 37bf38f801 FIX: removing a timer with `duration` doesn't work. 2020-04-02 05:59:35 +05:30
Martin Brennan d261a809e2
FEATURE: Bookmark reminder type changes and bugfixes (#9329)
New Reminder Types
-------------------------------------

* Add a "later this week" reminder which is today + 2 days, will not show if we are on the days Thu-Sun
* Add a "start of next business week" reminder which is 8am Monday

Bugfixes and Tweaks
--------------------------------------

* Move dates out of translation for reminder types and yield HTML for tap-tile for more customizable content and styling
* Make sure double clicking the bookmark icon in quick access takes users to the new bookmarks-with-reminders page
* Sane default to 8am (start of day) for custom reminder with no time
2020-04-02 09:57:48 +10:00
Sam Saffron cade4957ae
DEV: don't use _ cause property is observed
Followup on fcc5ef96
2020-04-02 10:22:13 +11:00
Kane York cdaa60b56b FEATURE: Allow admins to disable self-service account deletion
https://meta.discourse.org/t/-/146276
2020-04-01 15:16:07 -07:00
Penar Musaraj b82f6098ce
UX: Remove share as link fallback on touch devices (#9332) 2020-04-01 15:18:30 -04:00
Mark VanLandingham 65d9a9c1ce
DEV: Create wizard-field-checkboxes component (#9333) 2020-04-01 13:30:38 -05:00
tshenry 32e14045c4
UX: use color variable for background of shortcut keys 2020-04-01 09:27:14 -07:00
Mark VanLandingham 689c61b462
DEV: Allow plugins to add wizard steps after specific steps (#9315) 2020-04-01 08:36:50 -05:00
Roman Rizzi b2f30aa0b5
FIX: FlagSockpuppets should not flag a post if a post of that user was already rejected by staff (#9328)
* FIX: FlagSockpuppets should not flag a post if a post of that user was already rejected by staff

* Update spec/services/flag_sockpuppets_spec.rb

Co-Authored-By: Robin Ward <robin.ward@gmail.com>

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2020-04-01 09:20:45 -03:00
Sam Saffron a098464af3
FIX: ninja edit for replies not working
There is an edge case, in some cases when pulling a post from the store
there is no topic, this ensures it is loaded correctly.
2020-04-01 16:40:55 +11:00
Martin Brennan debed81022 Get rid of named param double reference in UserBookmarkList 2020-04-01 15:04:04 +10:00
Martin Brennan c07dd0d22a
FEATURE: Add lazy loading to user bookmarks list (#9317)
This is so users with huge amount of bookmarks do not have to wait a long time to see results.

* Add a bookmark list and list serializer to server-side to be able to handle paging and load more URL
* Use load-more component to load more bookmark items, 20 at a time in user activity
* Change the way current user is loaded for bookmark ember models because it was breaking/losing resolvedTimezone when loading more items
2020-04-01 14:09:07 +10:00
Sam Saffron b8d2261db9
FIX: correctly load drafts based of id
Previously we relied on race conditions to correctly open a draft, so this
broke.

New code is deliberate.

Also corrects missing observers on composer action
2020-04-01 14:23:26 +11:00
Blake Erickson 04b431b6a4 FIX: Staged users getting user_linked and user_quoted emails
This fix ensures that if a staged user is linked to or quoted they won't
be emailed about it.

A staged user could email into a category, and another user could quote
them inside of a completely different category and we don't want a
staged user to receive an email for this.

Bug report:

https://meta.discourse.org/t/-/145202/9
2020-03-31 20:17:56 -06:00
Kris 8bd693891a Follow-up to 8a52756 for safari 2020-03-31 21:57:09 -04:00
Martin Brennan 771dec9a44 Fix currentUser not being loaded correctly in bookmark.js
* this caused errors because resolvedTimezone was no longer
  accessible
2020-04-01 11:13:53 +10:00
Kris 8a527567d3 UX: Break very long words in titles within menus 2020-03-31 20:55:11 -04:00
Martin Brennan b79ea986ac
FEATURE: High priority bookmark reminder notifications (#9290)
Introduce the concept of "high priority notifications" which include PM and bookmark reminder notifications. Now bookmark reminder notifications act in the same way as PM notifications (float to top of recent list, show in the green bubble) and most instances of unread_private_messages in the UI have been replaced with unread_high_priority_notifications.

The user email digest is changed to just have a section about unread high priority notifications, the unread PM section has been removed.

A high_priority boolean column has been added to the Notification table and relevant indices added to account for it.

unread_private_messages has been kept on the User model purely for backwards compat, but now just returns unread_high_priority_notifications count so this may cause some inconsistencies in the UI.
2020-04-01 09:09:20 +10:00
Arpit Jalan b2a0d34bb7
FEATURE: add setting `auto_approve_email_domains` to auto approve users (#9323)
* FEATURE: add setting `auto_approve_email_domains` to auto approve users

This commit adds a new site setting `auto_approve_email_domains` to
auto approve users based on their email address domain.

Note that if a domain already exists in `email_domains_whitelist` then
`auto_approve_email_domains` needs to be duplicated there as well,
since users won’t be able to register with email address that is
not allowed in `email_domains_whitelist`.

* Update config/locales/server.en.yml

Co-Authored-By: Robin Ward <robin.ward@gmail.com>
2020-03-31 23:59:15 +05:30
David Taylor 0e3fa4072f FIX: Bypass serviceworker cache for auth routes
This avoids samesite cookie-related issues in iOS PWAs during the authentication flow
2020-03-31 14:24:02 -03:00
Joffrey JAFFEUX 5112648796
fix documentation (#9327) 2020-03-31 17:19:47 +02:00
Joffrey JAFFEUX f724cf1cfe
UX: minor tweaks to users directory last updated at styling (#9322) 2020-03-31 10:12:52 +02:00
Joffrey JAFFEUX acc0a9673e
FIX: the correct action for group-member-dropdown is now actOnGroup (#9320) 2020-03-31 09:21:59 +02:00
Joffrey JAFFEUX 4f6d722e45
DEV: adds a new dropdown widget usable in any widget (#9297) 2020-03-31 09:13:16 +02:00
Joffrey JAFFEUX 9bbaaea1e8
UX: better customize emoji layout on mobile (#9319) 2020-03-31 08:55:47 +02:00
Krzysztof Kotlarek a0f59a55cc
FIX: when a post is moved copy notifications level (#9311)
This is a revert of 2c011252f1

More information on meta: https://meta.discourse.org/t/when-a-reply-is-moved-to-a-new-topic-the-followers-of-the-previous-topic-are-automatically-follower-of-the-new-topic-as-well/130025
2020-03-31 16:19:47 +11:00
Sam Saffron fcc5ef9625
FIX: when switching reply type update options
Previously we were not correctly updating reply types leading to inconsistent
behavior when using drop down in composer (for reply type)
2020-03-31 14:40:57 +11:00
Kris d282233d31 UX: Add flair styles to latest topic list 2020-03-30 21:40:11 -04:00
Sam Saffron a34711c23a
FIX: do not save draft while it is loading
When editing a post we were incorrectly saving a draft prior to user typing

This caused a bloat in the amount of drafts saved per user and inconsistency
around behavior of "escape" button.

It also lead to lots of warnings about draft conflicts when copying stuff
between posts.

The code is improved to use promises more appropriately, however further
changes are needed to clean up internals so methods consistently return
promises.

Too many methods in the controller sometimes return a promise and sometimes
an object. Long term the methods will become async and all of this will be
corrected.
2020-03-31 11:49:10 +11:00
Joffrey JAFFEUX 5b6cdd6fb5
DEV: adds a loading property to d-button (#9072)
Usage:

```
{{d-button icon="times" label="foo.bar" isLoading=true}}
```

Note that  a button loading without an icon will shrink text size to prevent button to jump in size.

A button while loading is disabled.
2020-03-30 23:17:00 +02:00
Kane York 2a2555e598 DEV: Partial 'block-indentation' linting fixes 2020-03-30 14:13:33 -07:00
Kane York 2afb95fe3e DEV: Enable and fix the 'no-multiple-empty-lines' lint 2020-03-30 14:13:33 -07:00
Kane York f900efaa4a DEV: composer.hbs: fix indentation 2020-03-30 14:13:33 -07:00
Kane York 1703270055 DEV: Enable and fix no-trailing-spaces lint 2020-03-30 14:13:33 -07:00
Neil Lalonde 29e733832d
FIX: error when changing a topic's category and creating a tag 2020-03-30 16:43:01 -04:00
Joffrey JAFFEUX 339ddb8701
FIX: makes clicking and displaying date picker more reliable (#9302) 2020-03-30 22:02:24 +02:00
Robin Ward db35baba26 FEATURE: Display "Last Updated At" on user directory 2020-03-30 14:34:48 -04:00
Joffrey JAFFEUX 0996c3b7b3
FEATURE: allows multiple custom emoji groups (#9308)
Note: DBHelper would fail with a sql syntax error on columns like "group".

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2020-03-30 20:16:10 +02:00
Joffrey JAFFEUX fa5ba6beb8
FIX: ensures mini-tag-chooser display min tags req if no selection (#9303) 2020-03-30 19:34:53 +02:00
Joffrey JAFFEUX a3345057f2
FIX: prevents rendering empty timeline-controls (#9304)
The streamlength/height code when true would return just after we had inserted the timeline-controls, resulting, on topic-progress event to display an empty timeline-controls when clicked.

I think this code in unecessary and we should only rely on the code in `hideProgress` which will currenly hide the progress is the stream has only one post displayed on desktop (always shown on mobile).
2020-03-30 19:17:08 +02:00
Joffrey JAFFEUX aeaea3c154
FIX: correctly take category/group filters into csv export (#9300) 2020-03-30 19:08:47 +02:00
Joffrey JAFFEUX f8cb46c0e1
FIX: prevents exception when clicking component title above ace editor (#9309) 2020-03-30 18:55:15 +02:00
Joffrey JAFFEUX 96e841a635
DEV: trigger :username_changed when a user is renamed (#9301) 2020-03-30 18:02:34 +02:00
Zdravko Curic d0d5f0c912
DEV: Add Ember.PromiseProxyMixin to ember modules (#9312) 2020-03-30 11:37:14 -04:00
Joffrey JAFFEUX 2b78bd01ab
FIX: allows adapters to define a custom primaryKey (#9254) 2020-03-30 15:23:59 +02:00
Penar Musaraj 92e81d2ae5 UX: Fix composer position on iPads with a hardware keyboard
Adds padding to the composer when the keyboard accessory bar is shown (i.e. submit button no longer hides behind said bar)
2020-03-30 09:23:00 -04:00
Arpit Jalan 435fe8ac6e FIX: allow invite email field to be blank for invite tokens 2020-03-30 10:35:49 +05:30
Vinoth Kannan 7a32a99595 FIX: Quoting a nested quote should preserve original post info. 2020-03-28 22:24:43 +05:30
Penar Musaraj a3d47f1aad UX: Better spacing for icons in select-kit labels
Followup to c14e3adac5
2020-03-27 16:06:40 -04:00
Michael Brown 9026c55fe4
FIX: custom SQL with a trailing comment might break BadgeGranter SQL (#9285)
For example given a custom badge with SQL:
```
SELECT 1
-- I am a comment
```

You end up with

```
FROM (SELECT 1
-- I am a comment) q
```

This fix adds newlines so you end up with the now-valid:

```
FROM (
  SELECT 1
-- I am a comment
) q
```
2020-03-27 14:16:14 -04:00
Arpit Jalan 702879cbda FIX: check for presence of name before normalizing 2020-03-27 23:01:48 +05:30
Joffrey JAFFEUX 38e347aee6
DEV: allows to decorate topic list item (#9294)
Co-authored-by: David Taylor <david@taylorhq.com>
2020-03-27 16:50:31 +01:00
Mark VanLandingham c721bdb300
DEV: Add build_plugin_html to wizard head (#9293) 2020-03-27 10:02:48 -05:00
Joffrey JAFFEUX eda8f319a2
FIX: keep date object (#9292) 2020-03-27 14:15:14 +01:00
Joffrey JAFFEUX 1b09a0cd17
UX: improves date-time-input on mobile (#9291) 2020-03-27 13:29:58 +01:00
David Taylor e6e6d20912
Revert "DEV: Enable and fix link-href-attributes lint"
Introducing an href attribute on the upload button caused the page to reload when clicked

This reverts commit a17fa222af.
2020-03-27 11:43:00 +00:00
Kris 33350c31c0
UX: Align bulk select menu toggle relative to main wrapper when possible 2020-03-26 19:15:33 -04:00
Sam Saffron bed3f7f69a
DEV: long poll for 20 extra minutes when user stops interacting
We have no way of detecting if a browser window is behind another window
or off screen on a virtual desktop.

In some cases we may want events to be delivered quicker to the browser.
Specifically a user may still have a window in view but is not interacting.

This gives users 20 minutes of extra "long polling time" prior to shifting
to short polling.
2020-03-27 10:14:13 +11:00
Vinoth Kannan 257f59f366 FEATURE: option to update child theme components via theme CLI.
423ce44112
2020-03-27 03:41:56 +05:30
Jarek Radosz 67b34600d5
DEV: Use `type` instead of `method` in ajax calls (#8974)
Even though `type` is an alias for `method`, we have custom logic in `/discourse/lib/ajax` that checks only `type`, and ~200 other ajax calls in the codebase already use `type` param.
2020-03-26 21:00:10 +01:00
Kane York 17211b940f DEV: Enable and fix the 'no-duplicate-attributes' lint 2020-03-26 12:31:34 -07:00
Kane York 07dc8d20c4 DEV: Enable and fix the 'require-iframe-title' lint 2020-03-26 12:31:34 -07:00
Kane York a17fa222af DEV: Enable and fix link-href-attributes lint 2020-03-26 12:31:34 -07:00
Joffrey JAFFEUX ef3d6d6580
FIX: groups filtering input was causing a full page reload (#9282) 2020-03-26 15:46:31 +01:00
Bianca Nenciu 7952cbb9a2
FIX: Perform crop using user-specified image sizes (#9224)
* FIX: Perform crop using user-specified image sizes

It used to resize the images to max width and height first and then
perform the crop operation. This is wrong because it ignored the user
specified image sizes from the Markdown.

* DEV: Use real images in test
2020-03-26 16:40:00 +02:00
Roman Rizzi 6bceb1d15a
FIX: Display small post actions when embedding a topic (#9278) 2020-03-26 09:07:41 -03:00
Sam Saffron e62071830d
DEV: prefer Date.now() over new Date().getTime()
`New Date().getTime()` is both uglier and slower than `Date.now()`

`Date.now()` is available on all the browsers we support.
2020-03-26 17:36:53 +11:00
Sam Saffron 25f1f23288
FEATURE: Stricter rules for user presence
Previously we would consider a user "present" and "last seen" if the
browser window was visible.

This has many edge cases, you could be considered present and around for
days just by having a window open and no screensaver on.

Instead we now also check that you either clicked, transitioned around app
or scrolled the page in the last minute in combination with window
visibility

This will lead to more reliable notifications via email and reduce load of
message bus for cases where a user walks away from the terminal
2020-03-26 17:36:52 +11:00
Sam Saffron ecbccab159
FEATURE: invite_code is case-insensitive
Previously we required exact casing for invite code, this can cause a lot
of confusion. Relax the requirement.
2020-03-26 13:44:02 +11:00
Kris b2aa203e67
Add additional classes to topic-map stats 2020-03-25 21:40:51 -04:00
Martin Brennan 097851c135
FIX: Change secure media to encompass attachments as well (#9271)
If the “secure media” site setting is enabled then ALL files uploaded to Discourse (images, video, audio, pdf, txt, zip etc. etc.) will follow the secure media rules. The “prevent anons from downloading files” setting will no longer have any bearing on upload security. Basically, the feature will more appropriately be called “secure uploads” instead of “secure media”.

This is being done because there are communities out there that would like all attachments and media to be secure based on category rules but still allow anonymous users to download attachments in public places, which is not possible in the current arrangement.
2020-03-26 07:16:02 +10:00