Commit Graph

11521 Commits

Author SHA1 Message Date
Mark VanLandingham 94e8fd68bf
FIX: Remove uneeded from discourse loader (#8390) 2019-11-21 11:46:27 -06:00
Mark VanLandingham 5ba63f8a98
FIX: Aliases for require functioning (#8387) 2019-11-21 11:39:50 -06:00
Daniel Waterworth ffba242de1 DEV: Prevent setting filterMode where it can be already be computed
The plan is to switch over all cases where filterMode is set, but, to
prevent breaking plugins and themes, the category and noSubcategories
need to be inferred from any given filterMode before that can happen.
2019-11-21 14:07:10 +00:00
Daniel Waterworth 3344312fb5 FIX: Replace this.get("foo") with this.foo to fix linting checks 2019-11-21 11:29:50 +00:00
Daniel Waterworth 5762498391 DEV: Use new filterType property where possible 2019-11-21 11:01:28 +00:00
Daniel Waterworth 585a229d3f DEV: Add new style filterType property to NavItem model 2019-11-21 10:59:30 +00:00
Daniel Waterworth 556b29952c FIX: followup to a8d58c3b
It helps to include the files you intend to add
2019-11-21 10:52:50 +00:00
Daniel Waterworth a8d58c3b21 DEV: Make filterModes obsolete
This mixin handles the translation between old filterModes and new
filterTypes. filterModes have context information, filterTypes do not.
2019-11-21 10:51:18 +00:00
Daniel Waterworth 026832fb80 FIX: Mobile top topic list with a period and a category or tag 2019-11-21 10:17:24 +00:00
Robin Ward 947416004f FIX: EventTarget error 2019-11-20 15:51:42 -05:00
Robin Ward d7ae052efe DEV: Don't allow `Promise` unless imported from `"rsvp"`
We want to make sure we are using the correct promise implementation so
let's lint out the browser version.
2019-11-20 15:24:59 -05:00
Penar Musaraj 797045f5a9
DEV: Move some autocomplete input styling to SCSS (#8381) 2019-11-20 12:32:00 -05:00
Daniel Waterworth 3b5c214ac3 DEV: fix linting 2019-11-20 14:03:45 +00:00
Daniel Waterworth d541183906 DEV: Make it possible to deprecate plugin outlet properties 2019-11-20 13:56:26 +00:00
Robin Ward 9b60900b8d FIX: More `Promise` uses that were not imported 2019-11-19 15:58:40 -05:00
David Taylor 6f9afde9a8 UX: Allow enter key to submit test email in admin panel 2019-11-18 15:36:06 +00:00
David Taylor 172832f353
DEV: Submit forms via `type=submit` button, not explicit form action (#8368) 2019-11-18 13:26:26 +00:00
Dan Ungureanu 3650c64bca
FIX: Ensure load-more considers current position (#8357)
The loadMore action was not called if user was already at the bottom
of the page.
2019-11-18 15:09:47 +02:00
Dan Ungureanu 352d43b101
FIX: Better handling of Group model state (#8356)
The group card and group members page were affecting each other and were
leaking members list and the query parameters which led to bad UX
experience and sub-optimal performance (client made more queries because
it was loading fewer members).

This commit refactors the group model to make it more consistent, remove
dead code, move error handling outside of model.
2019-11-18 14:59:28 +02:00
David Taylor 1c1c3cae85 FIX: Enter key should submit password reset form, not refresh the page 2019-11-18 11:54:41 +00:00
Joe 84107c61a7
FIX: PM glyph in user-menu should always be shown to staff 2019-11-18 17:25:07 +08:00
Vinoth Kannan 3bb7ad4be1
FEATURE: remove support for 'suppress_from_latest' category setting. (#8308) 2019-11-18 12:28:35 +05:30
Sam Saffron 79b8c08d45 DEV: give categories-separator class to HR after cateogries
This allows for better styling of the hamburger menu
2019-11-18 17:31:01 +11:00
Dan Ungureanu a9704da34c FIX: A pmOnly tag should link to messages (#8361)
isPrivateMessages represents that the tag list is shown in the context
of private messages and pmOnly represents that the tag is used only in
private messages.
2019-11-18 16:44:08 +11:00
Penar Musaraj 102909edb3 FEATURE: Add support for secure media (#7888)
This PR introduces a new secure media setting. When enabled, it prevent unathorized access to media uploads (files of type image, video and audio). When the `login_required` setting is enabled, then all media uploads will be protected from unauthorized (anonymous) access. When `login_required`is disabled, only media in private messages will be protected from unauthorized access. 

A few notes: 

- the `prevent_anons_from_downloading_files` setting no longer applies to audio and video uploads
- the `secure_media` setting can only be enabled if S3 uploads are already enabled and configured
- upload records have a new column, `secure`, which is a boolean `true/false` of the upload's secure status
- when creating a public post with an upload that has already been uploaded and is marked as secure, the post creator will raise an error
- when enabling or disabling the setting on a site with existing uploads, the rake task `uploads:ensure_correct_acl` should be used to update all uploads' secure status and their ACL on S3
2019-11-18 11:25:42 +10:00
Vinoth Kannan 56b19ba740 UX: instead of total user count display only the count of users going to be affected.
edec922803
2019-11-18 00:09:38 +05:30
Roman Rizzi 4cf3c9cccb
FEATURE: Filter reviewables by date range (#8354) 2019-11-15 15:29:59 -03:00
Penar Musaraj 6e74350f18 Fix Prettier again
Not sure how I missed a few files in the last commit
2019-11-15 10:52:06 -05:00
Penar Musaraj cc8baa1a7c Fix Prettier using correct version (1.19.1) 2019-11-15 10:34:26 -05:00
Daniel Waterworth 676a1c8749 FIX: Use this.content.category instead of this.category on navigation-item
this.category isn't always available.
2019-11-15 13:47:55 +00:00
Daniel Waterworth 337fdccfeb DEV: Make context available to ExtraNavItems
This context is available to other NavItems so this makes things more
consistent.
2019-11-15 13:46:49 +00:00
Penar Musaraj 59ee89f0b7
UX: Adds +n indicator in PM topic list (#8353)
Shows the number of additional PM recipients in list when there are more than 5.
2019-11-14 14:14:23 -05:00
Robin Ward d4b7c028fa REFACTOR: Move upload utilities to their own file 2019-11-14 12:51:08 -05:00
Penar Musaraj f175afa0d9 FIX: Revert mobile jump to last post behaviour
Disables jumping to bottom of the page (added in 87f0b56) for mobile devices.

Fixes a regression with the mobile jump tool, and avoids users having to scroll up lots on mobile, since suggested topics and site footers can be lengthy.
2019-11-14 11:15:11 -05:00
Daniel Waterworth 0bb6b64747 DEV: Run prettier 2019-11-14 11:01:22 +00:00
Daniel Waterworth 7b63c92f47 DEV: Remove path building indirection
Tags are now handled just like other context information.
2019-11-14 10:47:14 +00:00
Daniel Waterworth 126b9bd16d FIX: Tag topic lists should pass on noSubcategories when building the top menu 2019-11-14 10:40:14 +00:00
Daniel Waterworth a1cf0b88a8 DEV: Make NavItem.fromText take a filterType instead of a URL
This is step one of removing filterMode URLs entirely.
2019-11-14 09:43:15 +00:00
Sam Saffron 03efbad932 DEV: lint files 2019-11-14 11:52:29 +11:00
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
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
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
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
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
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
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
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
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
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
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
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
David Taylor f611aa6ada FIX: Correct translation key for api key revoke button 2019-11-06 16:13:12 +00:00
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
David Taylor 52c5cf33f8
FEATURE: Overhaul of admin API key system (#8284)
- Allow revoking keys without deleting them
- Auto-revoke keys after a period of no use (default 6 months)
- Allow multiple keys per user
- Allow attaching a description to each key, for easier auditing
- Log changes to keys in the staff action log
- Move all key management to one place, and improve the UI
2019-11-05 14:10:23 +00:00
Daniel Waterworth c008443f2d FIX: filterQueryParams mutates state that is essentially global
Let's prevent it from doing this by duplicating the input first.
2019-11-05 11:47:29 +00:00
Joe 8e419a772f
FIX: improve regex used for image sizing controls (#8291) 2019-11-05 18:40:02 +08:00
Sam Saffron 5502128105 DEV: Remove uneeded comment
followup to 4b43816b
2019-11-05 16:26:32 +11:00
Sam Saffron 2b3e248927 FIX: on mobile setting active on navItem would not work
navigation bar would not have the current nav item selected when it overrode
2019-11-05 16:15:43 +11:00
Penar Musaraj 4b43816bb6 FIX: Skip composer blur event when switching apps in iOS 2019-11-04 22:16:31 -05:00
Mark VanLandingham fa56ba89a5 Import getProperties from @ember/object 2019-11-04 14:24:30 -05:00
Jarek Radosz d43e7354ec
DEV: Convert <button> tags to {{d-button}} components (#8224)
* DEV: Convert <button> tags to {{d-button}}

* Fixes
2019-11-04 11:23:54 +01:00
Sam Saffron f66e5d38d3 FEATURE: add an "init" method for extra nav items
This allows us to trigger special initialization code prior to adding an
extra nav item to the navigation menu.
2019-11-04 19:07:31 +11:00
Joffrey JAFFEUX 8d69944b4e FIX: update action should be in setting-component mixin (#8287)
This was causing an exception on some component (eg: value-list in a theme-component setting) which couldn't find an action named update.
2019-11-02 18:24:41 +05:30
Jeff Wong 29ee467a04 FIX: do not add personal message link in user menu if they are disabled 2019-11-01 22:40:41 -07:00
Robin Ward 0e2261c414 FIX: Linting 2019-11-01 13:57:22 -04:00
Robin Ward dceb72bc69 FIX: Move `makeArray` to discourse-common 2019-11-01 13:50:15 -04:00
Robin Ward 6300ac699a FIX: Missing `run` import 2019-11-01 13:50:15 -04:00
Robin Ward 75b751c108 REFACTOR: An ember.get we missed 2019-11-01 13:50:15 -04:00
Robin Ward 785ebb674d REFACTOR: Split off raw handlebars helpers from compiler
This allows us to compile without Ember being present
2019-11-01 13:50:15 -04:00
Robin Ward 640a05c4ee REFACTOR: Remove `Ember.get` 2019-11-01 13:50:15 -04:00
Robin Ward 89f602f66b REFACTOR: `Ember.makeArray` was removed from the public API 2019-11-01 13:50:15 -04:00
Robin Ward 90f934a660 REFACTOR: Use a module for `Ember.isEmpty` 2019-11-01 13:50:15 -04:00
Vinoth Kannan 72aa26c8c5
FEATURE: New site settings for default tags in user preferences. (#8283) 2019-11-01 12:40:13 +05:30
Sam Saffron 9fb09d147d DEV: allow positioning of nav items and allow selection
Previously we could not place extra nav items in a particular order.

This change introduces a new `before` attribute to addNavigationBarItem
with this attribute we can place a nav item before "top" or any other place.


Additionally this allows navigation items to force active state. In some
cases we may want an items that is simply a "filter" on latest using `?query_params`
when we do that we can "force" the filter active.

A concrete example is the assign plugin that adds a nav item for

Unassigned => `/c/cat-slug/l/latest?assigned=nobody&status=open`

If we did not force then latest would be selected even though the filter
is clicked.
2019-11-01 13:52:25 +11:00
Krzysztof Kotlarek b93f253486
FIX: Hide muted subcategories for mobile (#8273)
That bug was mentioned in [meta](https://meta.discourse.org/t/muting-categories-hides-them-muting-subcategories-should-too/131316)

Fix was done in that PR https://github.com/discourse/discourse/pull/8239
however I forgot about mobile template
2019-11-01 08:22:21 +11:00
Mark VanLandingham 5a0d30105f
FIX: Enter key on forms submits rather than refresh (#8274)
Both for forgot password form, and confirm password for second factor
2019-10-31 15:44:20 -05:00
Neil Lalonde d777844ed6 FEATURE: categories can require topics have a tag from a tag group
In a category's settings, the Tags tab has two new fields to
specify the number of tags that must be added to a topic
from a tag group. When creating a new topic, an error will be
shown to the user if the requirement isn't met.
2019-10-31 16:10:19 -04:00
Penar Musaraj e1679d744c DEV: Add plugin outlets to advanced search options
Also adds classes for the filter containers, allowing for more granular styling.
2019-10-31 16:06:39 -04:00
Leo McArdle 5efa95b5f8 FIX: make notification consent banner usable via keyboard and screenreader (#8255)
* update d-button to support btn-link class

* add display attribute to d-button rather than computing on class
2019-10-31 15:36:24 -04:00
Mark VanLandingham 11f50eee3b
DEV: Remove pretty_text import hack & still work server-side (#8266)
* FIX: move attachment_css_class constant out of upload-short-url for discourse-markdown-it

* Use setTimeout instead of ember later

* WIP. Not sure if this worked.

* oneboxer cache in separate file

* Reset onebox cache still

* set functions for oneboxers cache
2019-10-31 11:54:46 -05:00
Sam Saffron c5e67726fd FIX: under some conditions draft would say it was saving when not
This is a major change to draft internals. Previously there were quite a
few cases where the draft system would say "draft saved", when in fact
we just skipped saving.

This commit ensures the draft system deals with draft ownership handover in
a predictable way.

For example:

- Window 1 editing draft
- Window 2 editing same draft at the same time

Previously we would allow window 1 and 2 to just fight on the same draft
each window overwriting the same draft over an over.

This commit introduces an ownership concept where either window 1 or 2 win
and user is prompted on the loser window to reload screen to correct the issue

This also corrects edge cases where a user could have multiple browser windows
open and posts in 1 window, later to post in the second window. Previously
drafts would break in the second window, this corrects it.
2019-10-31 17:15:58 +11:00
Vinoth Kannan d355506123 FEATURE: Option to update user preferences of all users when default site setting changed. 2019-10-31 06:48:03 +05:30
Vinoth Kannan 7a264217f2 FIX: default user preferenced categories are not updating in admin site setting UI. 2019-10-31 05:45:57 +05:30
Sam Saffron 13cca3eaa0 DEV: run files through prettier
2ae21e9 was prettiered using an old version of prettier.

This re-applies it using latest.
2019-10-31 10:18:29 +11:00
Mark VanLandingham 02a886ce13
DEV: Import `Ember.on` from @ember/object/evented (#8268)
* DEV: Import `Ember.on` from @ember/object/evented

* Dont import "on" outsie of the js or admin app

* Fixed error when resolving merge conflicts
2019-10-30 17:05:27 -05:00
Mark VanLandingham 2ae21e9c35
DEV: Import every instance of Ember.computed function (#8267)
* DEV: Import every instance of Ember.computed function

* export default for Ember.computed
2019-10-30 15:28:29 -05:00
Penar Musaraj 790a7e2095 Ensure page is scrolled up on new query in full page search 2019-10-30 16:18:43 -04:00
Mark VanLandingham ced3807b23
FIX: Prettier on importing mixin (#8270) 2019-10-30 15:13:48 -05:00
Mark VanLandingham ba4b557114 DEV: Remove Ember.Mixin to import @ember/object/mixin (#8269) 2019-10-30 15:03:08 -04:00
Kris e7eeb7c47f Update log banner close from div to button 2019-10-30 14:36:45 -04:00
Régis Hanol 1772682b0a FIX: ensure there's an excerpt before showing the bio 2019-10-30 19:09:25 +01:00
Jarek Radosz 080e899b8c
DEV: Tag group improvements (#8252)
* DEV: Add the actual "tag_groups/new" route

Allows refreshing the "new" page without an error.

* DEV: Prevent attempts to create group tags if tagging is disabled

* DEV: Refactor the tag-groups controller

Gets rid of `selectedItem`, `selected`, and `selectTagGroup` action.

* DEV: Rename tag-groups-show to tag-groups-edit

* DEV: Refactor tag-groups form

* Extracted the tag-groups-form that's used by tag-groups-new and tag-groups-edit
* The model is now a buffered property
* Serialization relies more heavily on RestAdapter now
* Data is sent as JSON
* Payload is now namespaced ("tag_group")

* Update app/assets/javascripts/discourse/controllers/tag-groups-new.js.es6

Co-Authored-By: Joffrey JAFFEUX <j.jaffeux@gmail.com>

* Update app/assets/javascripts/discourse/components/tag-groups-form.js.es6

Co-Authored-By: Joffrey JAFFEUX <j.jaffeux@gmail.com>

* Update app/assets/javascripts/discourse/controllers/tag-groups-edit.js.es6

Co-Authored-By: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2019-10-30 16:57:13 +01:00
David Taylor 7191835989
DEV: Support custom server-side names in rest models (#8265) 2019-10-30 15:25:42 +00:00
Robin Ward 8d34f4bbd9 Revert "Revert Ember.run refactors"
This reverts commit fcb1ca52f9.
2019-10-30 09:48:24 -04:00
Robin Ward fcb1ca52f9 Revert Ember.run refactors
This reverts commit 5ca60fcb6b.
2019-10-29 17:10:47 -04:00
Robin Ward cfa5d123a3 Temporary fix: Don't use ember imports in pretty text 2019-10-29 16:45:05 -04:00
Robin Ward 249dff85c7 FIX: Use modules for `Ember.run.debounce` hack in testing 2019-10-29 16:25:37 -04:00
Robin Ward e5525d03b8 FIX: Yet more linting fixes 2019-10-29 16:14:46 -04:00
Robin Ward 5ca60fcb6b REFACTOR: Use imports for `Ember.run` 2019-10-29 15:31:56 -04:00
Mark VanLandingham c7475ee03b
DEV: Import EmberObject rather than global variable (#8256)
* DEV: Import ember/object rather than Ember.Object globally

* fixed broken object proxy import

* prettier on js

* added @ember/object/proxy to loader

* added unstaged file

* Fixed objet proxy reference is loader

* Linting!
2019-10-29 14:23:50 -05:00
Robin Ward 356e2a4b4a FIX: Linting 2019-10-29 13:31:44 -04:00
Robin Ward 230541c975 REFACTOR: Use Ember modules for `@ember/service` 2019-10-29 13:29:08 -04:00
Robin Ward a99c705c21 REFACTOR: Replace `Ember.controller.inject` with import
Puts it more in line with updated ember code
2019-10-29 13:17:38 -04:00
Mark VanLandingham 0a499966e9
DEV: Refactor setting component save callback (#8261)
* DEV: Refactor setting component save callback

* refactor site-setting component around new callback

* add callback to theme-translation component

* remove the save callback altogether
2019-10-29 12:01:45 -05:00
Bianca Nenciu ff9345fbb0
DEV: simplify logic (#8249)
Anonymous users are only possible if allow_anonymous_posting is true,
which means that 'user.is_anonymous' check implies that
allow_anonymous_posting is true.
2019-10-29 12:10:27 +02:00
Sam Saffron 492742837e PERF: stop destroying drafts on client when posting replies
The server already ensures it advances draft keys when a post is created
this means this code that used to delete drafts is simply introducing
composer delays with no benefit.
2019-10-29 17:07:33 +11:00
Sam Saffron 001c593155 FIX: place image scale buttons unconditionally
Defer placing scale buttons causes "scale image" buttons to be missing if
you manage to scroll mouse to the area where the image is prior to image
rendering.

This fix ensures scale buttons are always rendered leaving all the hiding
and styling entirely to CSS.

This also corrects a bug where scaling toolbar was missing on mobile
2019-10-29 15:52:17 +11:00
Neil Lalonde f686ab988f FIX: close modals on ESC key and clicking outside 2019-10-28 17:23:30 -04:00
Kris bacc114462 UX: Convert alert & modal close to buttons for improved accessibility 2019-10-28 16:04:29 -04:00
Oliver Walker 3b72a36c5d create plugin outlet and pass model to above-review-filters (#8257) 2019-10-28 15:44:13 -04:00
David Taylor 071a82efe3 FIX: Correct error when sending PM to email address 2019-10-28 18:32:43 +00:00
Mark VanLandingham 4eb54f08b2
FEATURE: Site setting/UI to allow users to set their primary group (#8244)
* FEATURE: Site setting/ui to allow users to set their primary group

* prettier and remove logic from account template

* added 1 to 43 to make web_hook_user_serializer_spec pass
2019-10-28 12:46:27 -05:00
Jarek Radosz 5776251cdd
DEV: Remove an obsolete "preferences/about-me" route (#8251)
User's title and bio can be changed on the "preferences/account" page.
2019-10-28 17:29:14 +01:00
Joffrey JAFFEUX 88df84bf2b
FIX: theme component setting was not getting updated in the UI (#8247) 2019-10-28 10:33:31 +01:00
Krzysztof Kotlarek ae108b363f
FIX: Hide muted subcategories (#8239)
That bug was mentioned in [meta](https://meta.discourse.org/t/muting-categories-hides-them-muting-subcategories-should-too/131316)

Problem is that subcategories are always visible in `/categories` path even if muted.

Categories/subcategories are loaded in at least two places
https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/models/site.js.es6#L146
https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/routes/discovery-categories.js.es6#L46

I discussed that with @jjaffeux and we thought that maybe it would be a good idea to filter that on frontend level
2019-10-25 10:08:13 +11:00
Robin Ward 7b04bb7290 Add event for when a post is flagged
This allows plugins to track events such as analytics.
2019-10-24 16:48:18 -04:00
Mark VanLandingham 9592ab57e0
FIX: failing build with prettier (#8241) 2019-10-24 10:16:12 -05:00
Mark VanLandingham da5e9af10a
FEATURE: Add remembering topic list for group pms (#8235)
* FEATURE: Add remembering topic list for group pms

* added findOrResetCachedBy helper in topic-list

* Created cached-topic-list.js

* Update app/assets/javascripts/discourse/routes/build-private-messages-route.js.es6

Co-Authored-By: Robin Ward <robin.ward@gmail.com>
2019-10-24 09:27:03 -05:00
Bianca Nenciu 690db4fd36
FIX: Show poll voters in Oneboxed posts. (#7768) 2019-10-24 14:00:25 +03:00
Vinoth Kannan 40254bae1b FIX: Do not load group members when user can't see it. 2019-10-24 01:57:29 +05:30
Neil Lalonde f061aee818 FEATURE: support SCSS in custom email style
In the CSS tab of Admin > Customize > Email Style, SCSS can now be used.
2019-10-23 15:42:37 -04:00
Vinoth Kannan 0dcb4bef20 FIX: should not disable topic inputs while creating new topic.
31577b2131
2019-10-24 01:04:37 +05:30
Vinoth Kannan 726bf37a12 FEATURE: wiki editors are allowed edit tags for wiki topics.
If a wiki editor's TL is greater than 'min trust level to tag topics' site setting then they can edit the tags for any wiki topic.
2019-10-23 23:50:10 +05:30
Vinoth Kannan 31577b2131 FEATURE: wiki editors are allowed edit tags for wiki topics.
If a wiki editor's TL is greater than 'min trust level to tag topics' site setting then they can edit the tags for any wiki topic.
2019-10-23 23:35:38 +05:30
Robin Ward 9347108f02 Support for importing jQuery
Also remove Ember.Qunit error about Ember.$ for now
2019-10-23 13:25:25 -04:00
Robin Ward 39159ad5e4 FIX: Wizard tests were broken with new loader 2019-10-23 13:15:28 -04:00
Robin Ward 391db25665 FIX: Sortable controller var conflict 2019-10-23 13:08:41 -04:00
Robin Ward 6287eccb35 REFACTOR: Remove `Ember.Controller` in favor of import 2019-10-23 13:06:54 -04:00
Robin Ward e18af18fec Support and examples for `Ember.Object` and `Ember.Controller` imports
We should stop using global variables and instead import these as
needed.
2019-10-23 12:55:11 -04:00
Robin Ward 0b37a3c235 Additioning Linting fixes 2019-10-23 12:41:58 -04:00
Robin Ward dd3ace5c77 REFACTOR: Replace `Ember.Route` with proper import 2019-10-23 12:39:32 -04:00
Robin Ward a8a76198b1 REFACTOR: Remove `Ember.Component` global variable
Use imports instead.
2019-10-23 12:30:52 -04:00
Penar Musaraj 4fa1ef0945 UX: Improve quoting on iOS
Fixes quote usability on iOS when the button is near the right edge of the screen.
2019-10-23 10:44:47 -04:00
Penar Musaraj ab6a540fc4 UX: fixes regression with iOS composer
Fixes a bug introduced in e83c2488a2 where dismissing the keyboard in iOS would not minimize the composer.
2019-10-22 23:10:18 -04:00
Penar Musaraj 2ab6a68629 UX: Standardize tag display in search menu results
This allows theme components (like discourse-tag-icons) to apply to tag results in search menu.
2019-10-22 14:19:24 -04:00
Robin Ward 283a0add80
Support for importing `@ember/component` and `@ember/routing/route` (#8214)
This will allow us to take the first step in updating our modules
to be consistent with example Ember code and to align with Ember CLI.
2019-10-22 09:47:27 -04:00
Mark VanLandingham e5311ab645 DEV: Import DiscourseRoute rather than Discourse.Route (#8225)
* DEV: Discourse.Route -> DiscourseRoute with import

* ran prettier on all routes

* prettiered one more file
2019-10-22 09:46:10 -04:00
Kris b41b12ad71
Add unique class to custom field wrappers (#8193) 2019-10-21 12:22:55 -04:00
Kris 56862f61c0
Add group name classes to tag page so groups can be hidden with CSS (#8118) 2019-10-21 12:22:19 -04:00
Robin Ward 3085b923f6 Removed `MOVED_MODULES` which is 3 years old 2019-10-21 11:59:13 -04:00
Robin Ward 9dcdbcfd5b Run prettier on the loader 2019-10-21 11:56:15 -04:00
David Taylor cc56f226b8 FIX: Correct mention autocomplete in new topics in unsecured categories
When autocompleting mentions in secure categories, we immediately populate the list with users which have permission to view the category. This logic is applied to unsecured categories as well, but the server returns an empty list of users. This commit teaches the autocomplete to understand empty lists of users without terminating the autocomplete dropdown.
2019-10-21 14:52:54 +01:00
Joffrey JAFFEUX 72822aa93f
FIX: d-button should default type to button (#8217)
This will prevent unexpected behaviour of  d-button being considered as a submit button.
2019-10-21 09:42:19 +02:00
Sam Saffron 98d6cee7c7 FIX: various fixes to draft system
- destroyDraft which is called when we cancel a draft is now async,
  removing race conditions when you click "reply" to a post and are
  already editing. We used to trigger double dialogs for cancelling
  drafts which was confusing.

- Remove reply as new topic / reply as pm keys, they are no longer
  used and only caused confustion. For example we used to pop up a
  warning when you are composing a reply and flick to reply as
  new topic

- Remove createTopic key, this was a bug that proliferated. Whenever
  creating a topic via the C shortcut or clicking on new topic on full
  screen search the correct new topic draft key will be used
  consistently

- When abandoning an edit we now say "Are you sure you want to discard
  your changes" (instead of abandon your post which is confusing)
2019-10-21 17:24:06 +11:00
Mark VanLandingham 054fbd7846
FEATURE: Remember scroll position in private message lists (#8212)
* FEATURE: remember position in private message lists

* Unified saving scroll position between topic lists

* added discovery-topics-list template

* ran prettier

* removed dynamic scroll key

* JS cleanup
2019-10-18 13:16:52 -05:00
Joffrey JAFFEUX 2fa3808928
FIX: polyfills forEach support on NodeList for IE11 (#8213) 2019-10-18 12:27:51 +02:00
Jarek Radosz ac06c87b43
DEV: Remove badge-select-controller (#8207)
* DEV: Remove badge-select-controller

1. The `selectableUserBadges` computed property of `badge-title` was being incorrectly overwritten, which triggered computed-property.override deprecation.

2. The `badge-select-controller` mixin contained properties that were used either by `badge-title` component or `badges/show` controller, but none were being used by both. This change moves properties where they belong, and removes the mixin.

* Update app/assets/javascripts/discourse/controllers/badges/show.js.es6

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

* Improve code brevity
2019-10-18 02:17:05 +02:00
Jarek Radosz 7de3e7b322
DEV: Fix the `Function.prototype.on` deprecation (#8205)
https://deprecations.emberjs.com/v3.x/#toc_function-prototype-extensions-on
2019-10-18 01:49:41 +02:00
Rafael dos Santos Silva 42c2068ada DEV: fix prettier offense 2019-10-17 17:39:44 -03:00
Rafael dos Santos Silva f97b6e85da FIX: Handle encoded slugs for subcategories 2019-10-17 17:02:17 -03:00
Neil Lalonde 85140aa09a UX: dashboard links to git commits list instead of git comparison
Previously the link went to a comparison of the installed commit with
the tests-passed branch. This change will show the list of installed
commits.
2019-10-17 15:08:43 -04:00
David Taylor d1b86352d4
UX: Make group membership UI clearer (#8210)
The 'automatically set primary group' checkbox looked like it was associated with the email membership. In fact, it applies to all members who join the group. This commit moves it next to the 'automatic trust level' setting, and puts them both under an 'Effects' heading
2019-10-17 18:05:42 +01:00
Vinoth Kannan 3cdcd093ee
REFACTOR: improve the code readability. (#8211)
b2f682f35e
2019-10-17 22:05:44 +05:30
Mark VanLandingham bd969332e0 FIX: Display site text overrides for non '_MF' keys (#8189)
FIX: Transform pluralized keys to `.other`, to check valid interpolation
2019-10-17 18:34:07 +02:00
Sam Saffron c3d06ef01a DEV: avoid making direct HTML changes in controllers
Followup on d5d8db7f, we prefer not to amend DOM directly from controllers.
2019-10-17 08:43:30 +11:00
Rafael dos Santos Silva 6e9c8fe854
FIX: More encoded slug fixes (#8191)
* FIX: Do not encode the URL twice

Now that we encode slugs in the server we don't need this anymore.

Reverts fe5na33

* FIX: More places do deal with encoded slugs

* the param is a string now, not a hash

* FIX: Handle the nil slug on /categories

* DEV: Add seeded? method to identity default categories

* DEV: Use SiteSetting to keep track of seeded categories
2019-10-16 17:08:43 -03:00
Penar Musaraj baf8ae604a FIX: Correct topic timeline position calculation
Fixes calculation for themes with tall custom headers.
2019-10-16 15:01:01 -04:00
Penar Musaraj c6e255f4e0 UX: Include metadata in composer link modal search results
Metadata includes topic status (closed, pinned, solved, etc.) as well as category and tags.
2019-10-16 10:17:27 -04:00
Joffrey JAFFEUX 02250bd91f
DEV: removes one deprecation with app-events:main 2019-10-16 10:50:43 +02:00
Joffrey JAFFEUX 5a543f8abd
FIX: prevents trash button to get focus when submiting input on profile (#8198)
This is a default behavior for browsers to submit using first button which doesn't have `type="button"` in a form when pressing enter inside an input.
2019-10-16 10:05:46 +02:00
Sam Saffron d5d8db7fa8 FEATURE: improve honeypot and challenge logic
This feature amends it so instead of using one challenge and honeypot
statically per site we have a rotating honeypot and challenge value which
changes every hour.

This means you must grab a fresh copy of honeypot and challenge value once
an hour or account registration will be rejected.

We also now cycle the value of the challenge when after successful account
registration forcing an extra call to hp.json between account registrations

Client has been made aware of these changes.

Additionally this contains a JavaScript workaround for:
https://bugs.chromium.org/p/chromium/issues/detail?id=987293

This is client side code that is specific to Chrome user agent and swaps
a PASSWORD type honeypot with a TEXT type honeypot.
2019-10-16 16:53:44 +11:00
David Taylor 7332649f1a DEV: Add plugin outlet to category security tab 2019-10-15 22:37:41 +01:00
Penar Musaraj e83c2488a2 FIX: do not unpin reply box in iOS when selecting Emoji 2019-10-15 10:51:53 -04:00
Vinoth Kannan b2f682f35e
FEATURE: Option to update category preferences of all users when site setting changed (#8180) 2019-10-15 18:41:27 +05:30
romanrizzi 9845963105 FEATURE: Use the 'ugc' rel attribute alongside 'nofollow' 2019-10-14 15:21:48 -03:00
David Taylor 392f6cdf33 DEV: Stop overriding computed property on `models/category.js.es6`
This causes an Ember deprecation notice, and is a confusing pattern. We never used the default values, so there is no benefit to including them.
2019-10-14 16:26:48 +01:00
Arpit Jalan 815edf6f4d FEATURE: add short site description on login page title 2019-10-14 11:40:09 +05:30
Jeff Wong 2b74dc5885 FIX: allow change password with TOTP 2019-10-13 00:53:57 -07:00
Robin Ward c5d03c30ca DEV: Add a plugin API for registering a "beforeSave" on the composer
This allows plugins to perform operations before saves occur, and
perhaps reject the post.
2019-10-11 14:55:27 -04:00
Robin Ward ee4369f972 Hook that allows custom logic before saving the composer 2019-10-11 14:55:09 -04:00
Faizaan Gagan 4d67f2a8ed bumped plugin api version to 0.8.33 (#8185) 2019-10-11 13:56:04 -04:00
Penar Musaraj 3a469a79cf
FEATURE: search topics when adding a link in composer (#8178) 2019-10-11 11:37:44 -04:00
Faizaan Gagan 3bcfa158a7 fixed wrong method name while calling (#8182) 2019-10-11 03:51:18 -04:00
Faizaan Gagan 8fc0cc9aaa Serialize draft (#8175)
* DEV: allow serializing data for drafts

* Various fixes

* added an alias method for 'serializeToDraft' to plugin-api

* fixed linting issues

* changed single quotes to double quotes to fix linting issue

* fixed linting issues

* fixed composer model file via prettier

* fixed composer controller file via prettier

* fixed plugin-api file via prettier
2019-10-10 13:02:35 -04:00
Arpit Jalan 1be8c737e6 UX: add glyph to "Help" button on Password Reset modal 2019-10-10 10:15:43 +05:30
Penar Musaraj 04452e748d DEV: remove old code, refactor jQuery call 2019-10-09 14:40:48 -04:00
Penar Musaraj a91ad81ed1 UX: Trigger primary action in modals using Enter
A modal's primary action (blue button in the default theme) can now be invoked
by hitting Enter on the keyboard. This applies to all modals that aren't strict
forms as long as the focus is not on a textarea element.
2019-10-09 13:28:07 -04:00
David Taylor 445a3851d6 FEATURE: Display created and last_used dates for API keys 2019-10-09 14:24:41 +01:00
Roman Rizzi 10478cb395
DEV: Bump uglifyjs (#7834)
* Rewrite uglifyjs command to work with 3.x

* Use ES5 syntax in plain JS files

* Use the older command if uglifyJS V2.x is installed
2019-10-09 10:02:49 -03:00
Joffrey JAFFEUX 49a4b0dd9c
DEV: adds teardownComponent hook to connector class (#8171)
This is the counterpart to setupComponent and allows you to clean any observers or state when the component is destroyed.
2019-10-09 00:26:33 +02:00
Penar Musaraj 30cda1761d
UX: Better composer hyperlink modal (#8160) 2019-10-08 16:19:07 -04:00
Penar Musaraj 1ee633cea4 FIX: Topic timeline placement on iPad 2019-10-08 16:10:09 -04:00
Penar Musaraj b20b6c52e1 FIX: Do not reset original scroll position in iOS to zero
This avoids scrolling to the top of a post when toggling focus to the composer textarea
2019-10-08 11:59:53 -04:00
Penar Musaraj c3a5a8e095 UX: Refactor iOS composer layout
This addresses the following issues:
- on iPad, with keyboard attached, the composer is no longer forced to full screen
- on iPad, with keyboard attached, the topic no longer scrolls when starting a
  reply and then cancelling it
- switching between inputs and buttons (formatting, emojis, categories/tags, etc.) no longer
  causes layout to bounce around
2019-10-08 11:16:41 -04:00
Robin Ward d527f3a723 Log an event for `topic:created`
You can distinguish between `post:created` and `topic:created` now.
2019-10-08 10:39:03 -04:00
Robin Ward 50fae909d6 Add an appEvent for when a post is created
List for `post:created` and you'll be passed the new post when it is
created.
2019-10-08 10:12:38 -04:00
Dan Ungureanu fdb1d3404c
FEATURE: Add site setting to show more detailed 404 errors. (#8014)
If the setting is turned on, then the user will receive information
about the subject: if it was deleted or requires some special access to
a group (only if the group is public). Otherwise, the user will receive
a generic #404 error message. For now, this change affects only the
topics and categories controller.

This commit also tries to refactor some of the code related to error
handling. To make error pages more consistent (design-wise), the actual
error page will be rendered server-side.
2019-10-08 14:15:08 +03:00