Commit Graph

20911 Commits

Author SHA1 Message Date
Martin Brennan e7226a8c84
FEATURE: Allow scoping search to tag (#8345)
* When viewing a tag, the search widget will now show a checkbox to scope the search by tag, which will limit search results to that tag on desktop and mobile
2019-11-14 10:40:26 +10:00
Krzysztof Kotlarek 6e1fe22a9d
FEATURE: Dismiss new per category (#8330)
Ability to dismiss new topics per category.
2019-11-14 11:16:13 +11:00
Robin Ward bc2067898e FIX: Missing User objects in Utilities 2019-11-13 15:55:32 -05:00
Robin Ward f5ed0dc2e6 FIX: Failing tests 2019-11-13 15:34:30 -05:00
Mark VanLandingham 4843414de6 WIP - set Discourse.currentUser 2019-11-13 15:34:30 -05:00
Mark VanLandingham 38cc1962e7 WIP - discourse/models/user not defined 2019-11-13 15:34:30 -05:00
Mark VanLandingham f9894aec97 DEV: Remove Discourse.User and import instead 2019-11-13 15:34:30 -05:00
David Taylor 0a14b9b42a FEATURE: Automatically redirect to authenticator when there is only one
This brings the behavior in line with native Discourse SSO. If login is required, and a user tries to visit the forum, they will be directed straight to the external login page without requiring any clicks.
2019-11-13 17:28:12 +00:00
Mark VanLandingham 3c5df82590 DEV: Remove Discourse.Site in favor of import (#8344)
* DEV: Remove Discourse.Site in favor of importing Site

* Ran prettier
2019-11-13 12:13:47 -05:00
Robin Ward d2b3ac1282 FIX: Missing braces 2019-11-13 12:04:40 -05:00
Robin Ward f518065654 FIX: computed is part of `@ember/object` not `@ember/object/computed` 2019-11-13 11:58:09 -05:00
Daniel Waterworth e98d94f17f DEV: Commas in top_menu items are no longer used
According to eviltrout, commas and pipes were the delimiters of a
Discourse specific microformat, but this is no longer the case and
hasn't been for some time.
2019-11-13 16:21:34 +00:00
Joffrey JAFFEUX d2d846a88e
DEV: prevents input/change events to cause a full rerender (#8339)
Code should decide when to do something with the event value, and maybe cause a re-rerender but it shouldn't be automatic. This is currently a gigantic waste of resources.
2019-11-13 15:49:01 +01:00
Daniel Waterworth a7dd31496e DEV: Defer creation of extraNavItems until they are required
This also means that each list view gets a fresh set of ExtraNavItems.
2019-11-13 14:04:37 +00:00
Daniel Waterworth e00ec22582 DEV: Remove extraneous intermediates 2019-11-13 14:03:47 +00:00
Daniel Waterworth 13c5381027 DEV: Don't return navigation item from addNavigationBarItem
No plugin or theme that I could find used the return value. Not
providing this to plugins affords us leeway to change the internals.
2019-11-13 13:07:09 +00:00
Daniel Waterworth 58b5d1434b FIX: Allow forceActive without a customHref 2019-11-13 12:17:57 +00:00
Daniel Waterworth 60e804ad5c DEV: No need to use call to call these callbacks
This is safe because addNavigationBarItem decorates these callbacks,
throwing away the context.
2019-11-13 11:50:40 +00:00
Joffrey JAFFEUX e4df3792f6
DEV: provides a way to hook into createWidget constructor (#8340) 2019-11-13 09:29:12 +01:00
Joffrey JAFFEUX 38a18b7aa0
DEV: call destroy() on widget when glue is cleaned up (#8338) 2019-11-13 09:28:43 +01:00
Jeff Wong 3b36326cb7 Add plugin outlet after flagged post bodies 2019-11-12 17:47:56 -08:00
Roman Rizzi 1c179177e7
REFACTOR: Attach resize controls to images from the markdown pipeline (#8314) 2019-11-12 17:32:37 -03:00
Neil Lalonde 7711df40e6
REFACTOR: redo DiscourseTagging.filter_allowed_tags (#8328)
This method had grown into a monster. Its query had bugs
that I couldn't fix, and new features would be hard to add.
Also I don't understand how it all works anymore...
Replace it with common table expressions that can be queried
to generate the results we need, instead of subtracting
results using lots of "NOT IN" clauses.

Fixed are bugs with tag schemas that use combinations of
tag groups, parent tags, and one-tag-per-topic restrictions.
For example: https://meta.discourse.org/t/130991/6
2019-11-12 14:28:44 -05:00
Robin Ward 4422d9a4bf DEV: Provide a nicer error when JSON is malformed
This is very useful for development. It will give a much nicer error if
the JSON that comes back from the server is missing a required key.
2019-11-12 13:04:52 -05:00
romanrizzi c9bd463e9d DEV: Let is not supported, use var instead 2019-11-12 14:58:16 -03:00
David Taylor 836b3f4d82
FIX: Do not deactivate admin accounts with recent posts or api keys (#8342)
This prevents 'bot' users being deactivated
2019-11-12 16:56:01 +00:00
Mark VanLandingham 213ebc3b32
DEV: Deprecation warning for aliased module usage (#8341) 2019-11-12 10:20:14 -06:00
David Taylor cf4356cd81 UX: Do not add leading/trailing spaces when copying API key in Firefox
If there is any other whitespace in the container, then Firefox will add a leading/trailing space when double clicking the key. This commit wraps the key in a div with no whitespace, to work around the problem.
2019-11-12 16:00:57 +00:00
Robin Ward f49494b0bf REFACTOR: Remove a few `Discourse.Site` globals 2019-11-12 10:53:22 -05:00
Robin Ward afadf361b3 REFACTOR: `idMap` should be a private API 2019-11-12 10:53:22 -05:00
Robin Ward 7f651b9666 REFACTOR: Deprecate `Discourse.Site` and `Discourse.User` 2019-11-12 10:53:22 -05:00
Mark VanLandingham 3dd2f2f701
DEV: Remove RSS feed polling in favor of plugin (#8233) 2019-11-12 09:49:02 -06:00
David Taylor 5f927ceeb3
DEV: Display a warning when themes hard-code optimized image links (#8304) 2019-11-12 14:30:19 +00:00
Dan Ungureanu bbcce08712
FIX: Update quotes after moving posts (#8326) 2019-11-12 15:16:39 +02:00
Daniel Waterworth 241d9a3034 FIX: Topic lists filtered by tag and a specified filter don't work
This was a regression caused by 59241df2
2019-11-12 11:34:52 +00:00
Jarek Radosz 9b841ea83f DEV: Run prettier 2019-11-12 11:49:31 +01:00
Jarek Radosz 5d4b240453
DEV: Provide radix argument to parseInt (#8281)
* DEV: Provide radix 10 argument to parseInt

* DEV: Provide radix 16 argument to parseInt

* DEV: Remove unnecessary parseInt calls

* Fix year formatting

parseInt was used here to convert decimals to ints
2019-11-12 10:47:42 +01:00
Krzysztof Kotlarek 69266f60ed FIX: tag and category watchers regression (#8336)
I made a regression here 17366d3bcc (diff-ddeebb36d131f89ca91be9d04c2baefaR10)

When the tag is added, people watching specific tag are notified but also people watching specific category.

Therefore, `notify_post_users` should accept options who should be notified.

So when `category` is added to the topic, users watching topic and users watching category are notified.

When `tag` is added to the topic, users watching topic and users watching tag are notified

Finally, when a new post is created, everybody is notified, topic watchers, category watchers, tag watchers.
2019-11-12 16:44:46 +11:00
Gerhard Schlager 6ebffaaf6e FIX: Better error handling for invalid locale bundle versions 2019-11-11 22:30:32 +01:00
Robin Ward 34665d3f96 FIX: In case `@ember/object` hasn't been loaded yet 2019-11-11 15:56:58 -05:00
Robin Ward e39d89ecd9 REFACTOR: Remove `InputValidation` which was simply an `Ember.Object` 2019-11-11 15:48:56 -05:00
Daniel Waterworth 211410c3b9 DEV: It doesn't make sense for a filterMode to be weekly, quarterly, etc 2019-11-11 18:46:27 +00:00
Robin Ward da04c602ba REFACTOR: Remove `debounce` to `discourseDebounce`
Otherwise it can be confused with the ember debounce
2019-11-11 13:34:01 -05:00
Robin Ward e8dae447bd REFACTOR: Remove `discourse/lib/throttle` 2019-11-11 13:21:03 -05:00
Daniel Waterworth 4ddb69e9c6 DEV: Removed needless indirection
An artifact of when tagging was a plugin no doubt.
2019-11-11 17:59:26 +00:00
Daniel Waterworth e79cec9fc7 DEV: Remove handling of category top menu items
Support for these kinds of navigation items was dropped in 88f52514, but
the code for handling these menu items was never removed.
2019-11-11 17:36:29 +00:00
Dan Ungureanu 55bdd9e6a2
FIX: Do not skip some emails in user search (#8317)
It used to skip the email addresses containing the plus sign.
2019-11-11 18:42:45 +02:00
Dan Ungureanu 6672dcc985
FIX: Keep emoji images in group bio excerpt (#8329) 2019-11-11 18:42:08 +02:00
Mark VanLandingham 20266325fc combined import definitions in discourse-loader 2019-11-11 10:37:21 -05:00
Mark VanLandingham 1bbb9b30fc DEV: Import isNone for @ember/utils 2019-11-11 10:37:21 -05:00
Robin Ward 0c8ae1e849 FIX: More missing RSVP imports 2019-11-11 09:25:33 -05:00
Robin Ward 2a6713c2ba FIX: Was using a native browser Promise instead of RSVP 2019-11-11 09:23:26 -05:00
Vinoth Kannan 6e3601469c FIX: use correct class variable to get notification levels. 2019-11-11 18:57:14 +05:30
Vinoth Kannan 12bc6ce8c1 FIX: remove magic numbers in notification levels.
ba5b78a348
2019-11-11 18:18:33 +05:30
Blake Erickson 15f6f57cdc DEV: Add update message for an outdated mail-receiver
Previous versions of the mail-receiver used query based api credentials,
if we detect this we will show a message in the admin panel to update
the mail receiver.
2019-11-08 17:32:22 -07:00
Robin Ward 920f8c6d75 REFACTOR: Remove `Discourse.Route` in lieu of importing 2019-11-08 15:18:13 -05:00
Robin Ward c0e105fc8c FIX: Return a deprecation for `Discourse.Session` 2019-11-08 14:55:36 -05:00
Robin Ward bd92fdeb4d FIX: Add deprecation for Discourse.NavItem in case themes are using it 2019-11-08 14:14:51 -05:00
Robin Ward f03edb36be REFACTOR: Remove `Discourse.Model` 2019-11-08 14:13:35 -05:00
Robin Ward 291572a97a REFACTOR: Remove `Discourse.Session` constants 2019-11-08 13:46:50 -05:00
Robin Ward 7ac2a55588 REFACTOR: Remove `Discourse.Category` constants 2019-11-08 13:31:00 -05:00
Mark VanLandingham e51efce356
DEV: Remove all instances of Ember.computed (#8324) 2019-11-08 12:28:11 -06:00
Robin Ward 7e44065bcb REFACTOR: Migrate `Discourse.Post` to imports 2019-11-08 13:13:13 -05:00
Robin Ward 932c169d46 REFACTOR: Remove Discourse.NavItem constants 2019-11-08 12:56:13 -05:00
Robin Ward 779ee3558d REFACTOR: Remove `Discourse.UserAction` from code 2019-11-08 12:52:39 -05:00
Mark VanLandingham 562acb21ca
FIX: Ran prettier to fix build (#8323) 2019-11-08 10:50:03 -06:00
Mark VanLandingham 7f3812b90a
DEV: Removed all Ember.computed. in select-kit (#8322) 2019-11-08 10:32:20 -06:00
Mark VanLandingham 47e3e56905
FIX: Alias modules that are required AND imported (#8315) 2019-11-08 09:48:02 -06:00
Roman Rizzi 5a016b7eb0
DEV: Adds a new plugin outles to add custom icons on the admin users list (#8277) 2019-11-08 10:32:57 -03:00
Dan Ungureanu dfc002d331
FIX: Count current penalty if it started more than 6 months ago (#8313) 2019-11-08 12:23:57 +02:00
Vinoth Kannan edec922803 FIX: use 'about.json' endpoint instead of using ember model to get the data. 2019-11-08 14:17:51 +05:30
Martin Brennan 56d3e29a69
FIX: Badge and user title interaction fixes (#8282)
* Fix user title logic when badge name customized
* Fix an issue where a user's title was not considered a badge granted title when the user used a badge for their title and the badge name was customized. this affected the effectiveness of revoke_ungranted_titles! which only operates on badge_granted_titles.
* When a user's title is set now it is considered a badge_granted_title if the badge name OR the badge custom name from TranslationOverride is the same as the title
* When a user's badge is revoked we now also revoke their title if the user's title matches the badge name OR the badge custom name from TranslationOverride
* Add a user history log when the title is revoked to remove confusion about why titles are revoked
* Add granted_title_badge_id to user_profile, now when we set badge_granted_title on a user profile when updating a user's title based on a badge, we also remember which badge matched the title
* When badge name (or custom text) changes update titles of users in a background job
* When the name of a badge changes, or in the case of system badges when their custom translation text changes, then we need to update the title of all corresponding users who have a badge_granted_title and matching granted_title_badge_id. In the case of system badges we need to first get the proper badge ID based on the translation key e.g. badges.regular.name
* Add migration to backfill all granted_title_badge_ids for both normal badge name titles and titles using custom badge text.
2019-11-08 15:34:24 +10:00
Martin Brennan 64b4a7ba45
FIX: Ensure enforce 2FA for staff satisfied by security keys (#8316)
* If a staff user created only a security key as their single 2FA option. they continued to be prompted to create a 2FA option because we only considered this condition satisfied if a TOTP was added.
* The condition is now satisfied if TOTP OR security keys are enabled.
2019-11-08 15:11:53 +10:00
Vinoth Kannan ba5b78a348
FEATURE: support to mute all categories by default. (#8295)
Instead of enabling `suppress_from_latest` setting on many categories now we can enable `mute_all_categories_by_default` site setting. Then users should opt-in to categories for them to appear in the latest and categories pages.
2019-11-08 08:28:11 +05:30
Sam Saffron deec2cf578 FIX: drafts are unique by draft_key and user_id
Previously our index was non unique, causing situations where a user could
have multiple drafts stored in the table for the same exact entity.

This does not properly reflect reality and needed to change as in certain
cases duplicate drafts could be created causing internal data inconsistency
2019-11-08 11:45:46 +11:00
Blake Erickson 2db2003187 DEV: Add deprecation warning of non-header based API auth
This change adds a message to the admin panel if it detects an api
requests that doesn't use the new header based authentication method.

The message is to warn people to switch to header based auth and links
to the api documention topic on meta for more info.
2019-11-07 17:06:13 -07:00
David Taylor 99b0697bd9 FIX: Correct display of last used date in API key details UI 2019-11-07 23:41:43 +00:00
Mark VanLandingham 6275c05c0d
DEV: Move computed to discourseComputed (#8312) 2019-11-07 15:38:28 -06:00
Robin Ward d74546f50e REFACTOR: Remove `Discourse.Topic` constant 2019-11-07 15:46:58 -05:00
Robin Ward 9d457fa51f REFACTOR: Remove `Discourse.TrustLevel` constant 2019-11-07 15:26:26 -05:00
Mark VanLandingham f8d69253e8
FIX: Prettier to fix build (#8311) 2019-11-07 12:07:08 -06:00
Simon Cossar b3e8fbe7d4
FIX: downcase SSO external email before checking against Discourse email (#8306)
* Downcase single_sign_on_record.external_email before checking against Discourse email

* Use &.downcase
2019-11-07 12:26:28 -05:00
Mark VanLandingham 9ffdbf912f
DEV: Import ember ENV instead of Ember.testing (#8305) 2019-11-07 11:20:35 -06:00
Daniel Waterworth 063a1d4077 Revert "FIX: The internal position on the topic timeline is a scroll position"
This reverts commit 9c1a713c6e.
2019-11-07 11:04:39 +00:00
Daniel Waterworth 9c1a713c6e FIX: The internal position on the topic timeline is a scroll position
... instead of a post index. This is so that updatePosition is called
when switching between the last two scroll positions.
2019-11-07 10:10:17 +00:00
Joffrey JAFFEUX 7d25d65ccb
DEV: adds support for input/change events on widgets (#8309) 2019-11-07 10:15:05 +01:00
Sam Saffron cf0f2c70cd FIX: regression not showing excerpts in mobile timeline
I think this is a result of: 87f0b56191
2019-11-07 16:10:31 +11:00
Krzysztof Kotlarek 17366d3bcc
FEATURE: notify tag watchers when tag was added to post (#8299)
Issue was mentioned in this [meta topic](https://meta.discourse.org/t/send-a-notification-to-watching-users-when-adding-tag/125314)

It is working well when category is changed because NotifyCategoryChange job already got that code:
```
if post&.topic&.visible?
  post_alerter = PostAlerter.new
  post_alerter.notify_post_users(post, User.where(id: args[:notified_user_ids]))
  post_alerter.notify_first_post_watchers(post, post_alerter.category_watchers(post.topic))
end
```

For NotifyTagChange job notify post users were missing so it worked only when your notification was set to `watching first post`
2019-11-07 08:20:15 +11:00
Mark VanLandingham bf778d66b5
FIX: unicode group names encoded for url (#8302) 2019-11-06 14:25:45 -06:00
Kris 6c9af6d81e FIX: Too much blank padding in video oneboxes 2019-11-06 15:07:51 -05:00
Kris 9ef97ff44f fix for 1aa96a5 2019-11-06 14:16:23 -05:00
Kris b066a4128d Adding a text-overflow: ellipsis; mixin and related cleanup 2019-11-06 14:00:29 -05:00
David Taylor f611aa6ada FIX: Correct translation key for api key revoke button 2019-11-06 16:13:12 +00:00
Arpit Jalan b869ef8a76 FIX: add <img> alt attribute for Summary emails 2019-11-06 15:26:46 +05:30
Daniel Waterworth e3b7f07916 DEV: Run prettier 2019-11-05 22:30:23 +00:00
Daniel Waterworth 59241df251 FIX: Display tags topic list correctly when none is selected for subcategories 2019-11-05 20:12:36 +00:00
Mark VanLandingham ca14e3d83c
FIX: Build with prettier for imports (#8298) 2019-11-05 13:32:43 -06:00
Mark VanLandingham edc135d9c5
DEV: Import set, setProperties, helper, and string functions (#8297) 2019-11-05 12:43:49 -06:00
Gerhard Schlager 61b1f9c36b FEATURE: Load translation overrides without JS `eval` 2019-11-05 19:16:38 +01:00
Mark VanLandingham 014f19b6ea
DEV: Import Promise from rsvp (#8296) 2019-11-05 10:37:32 -06:00