Commit Graph

11416 Commits

Author SHA1 Message Date
Daniel Waterworth 374534f00e DEV: Use category ids in URLs preferentially 2019-12-02 09:28:15 +00:00
Daniel Waterworth 9251065768 FIX: Generate redirect URL correctly when using a subdirectory
The url property of a category contains the base_uri and so it shouldn't
be concatated into a larger URL unless it is the prefix.
2019-12-02 09:28:15 +00:00
Daniel Waterworth c414db107c FIX: Handle none path correctly with three levels
With a path like "/c/foo/1/none", "none" was being interpreted as an id.
2019-12-02 09:28:15 +00:00
Joffrey JAFFEUX 3cf4ba5069
FIX: ensures censor has always at least an empty string to handle (#8442) 2019-12-02 10:24:07 +01:00
Vinoth Kannan 580b289861 UX: skip leading spaces in selection when adding a link. 2019-11-30 20:14:22 +05:30
Robin Ward 7fee3c61de
Support for custom messages and redirects when creating posts (#8434)
* Support for custom messages and redirects when creating posts

When a post/topic is created Discourse serializes a `NewPostResult`
object. Normally this contains a status like `created_post` or
errors describing why the post could not be created.

There are times when a plugin might want to take the inputted post
and do something in the background. In this case, the plugin
can return a custom `message` and `route_to` attribute in the
`NewPostResult`.

If present, the message will be displayed in an alert, and when "Ok" is
clicked the user will be routed to the new URL.

* Destroy the draft in parallel
2019-11-29 09:30:54 -05:00
Arpit Jalan 8237e0e001
UX: show group full name even when title is same. (#8437) 2019-11-29 13:07:24 +05:30
Daniel Waterworth 11a73b3f15 DEV: Client side routing for routes with tag and category context
This moves also moves some of the logic to Category.
2019-11-28 17:58:04 +00:00
Daniel Waterworth 4eb8d1e717 FIX: fix typo 2019-11-28 17:53:13 +00:00
Daniel Waterworth 6431daaa2e DEV: Rename dynamic segment to snake case to fit with Ember convention 2019-11-28 17:53:11 +00:00
Joffrey JAFFEUX e92e06c3a7
FIX: adds data-topic-id to quick-access-item (#8430)
This fix will allow discourse-encrypt to decrypt messages titles of the quick-access-pannel for PMs
2019-11-28 11:27:36 +01:00
Sam Saffron d10f55c3e9 Revert "FIX: adds data-topic-id to quick-access-item (#8422)"
This reverts commit 700bd280e4.

Oops looks like this breaks tests:

```
Module Failed: widget:quick-access-item
  Test Failed: escapedContent attribute is not escaped
    Assertion Failed: TypeError: Cannot read property 'match' of undefined
      Expected: true, Actual: false
  Test Failed: anonymous
    Assertion Failed: failed, expected argument to be truthy, was: 0
      Expected: true, Actual: 0
    Assertion Failed: Element .enable-anonymous not found.
  Test Failed: anonymous - switch back
    Assertion Failed: failed, expected argument to be truthy, was: 0
      Expected: true, Actual: 0
    Assertion Failed: Element .disable-anonymous not found.
  Test Failed: log out
    Assertion Failed: failed, expected argument to be truthy, was: 0
      Expected: true, Actual: 0
    Assertion Failed: Element .logout not found.
  Test Failed: content attribute is escaped
    Assertion Failed: TypeError: Cannot read property 'match' of undefined
      Expected: true, Actual: false
```
2019-11-28 16:38:26 +11:00
Joffrey JAFFEUX 700bd280e4 FIX: adds data-topic-id to quick-access-item (#8422)
This fix will allow discourse-encrypt to decrypt messages titles of the quick-access-pannel for PMs
2019-11-28 16:29:17 +11:00
Krzysztof Kotlarek b120728999
FEATURE: Ability to add components to all themes (#8404)
* FEATURE: Ability to add components to all themes

This is the first and functional step from that topic https://dev.discourse.org/t/adding-a-theme-component-is-too-much-work/15398/16

The idea here is that when a new component is added, the user can easily assign it to all themes (parents).

To achieve that, I needed to change a site-setting component to accept `setDefaultValues` action and `setDefaultValuesLabel` translated label.
Also, I needed to add `allowAny` option to disable that for theme selector.

I also refactored backend to accept both parent and child ids with one method to avoid duplication (Renamed `add_child_theme!` to more general `add_relative_theme!`)

* FIX: Improvement after code review

* FIX: Improvement after code review2

* FIX: use mapBy and filterBy directly
2019-11-28 16:19:01 +11:00
Blake Erickson 2bb36d72a3 DEV: Fix failing test on CI due to whitespace differences
I could not replicate the failure locally, but it was consistently
failing on CI with:

```
  Assertion Failed: it should escape watched words

      Expected:  <img src="x">, Actual:  <img src="x">
```

This commit removes an extra space that was added originally, but I
don't think it is really needed after double checking how it displays in
the UI. The `x` icon and the word have sufficient spacing between them.
If we need to we can tweak it in css instead.
2019-11-27 17:23:49 -07:00
Blake Erickson 83a521e8c6 DEV: Fix failing test with watched words
Follow up to: bb31e7f5b6

This commit fixes this failing test:

`Assertion Failed: it should escape watched words`

Now that we have a handlebars template we can us it for escaping because
it does that for us.
2019-11-27 16:48:01 -07:00
Vinoth Kannan 0fed417439 DEV: always trigger 'notification_created' event.
And make prettier happy.
2019-11-28 04:31:55 +05:30
Blake Erickson bb31e7f5b6 DEV: Remove buffered rendering from watched words
This is another refactoring in the multi-step process to remove all uses
of our custom Render Buffer.

Previous commit: 2673cad142 in this
series.

This commit affects the display of watched words on the admin watched
word page. It is just a refactor and does not change any functionality.
2019-11-27 15:47:13 -07:00
Vinoth Kannan 481c8314f0 FEATURE: consolidate group membership request notifications. 2019-11-28 04:02:35 +05:30
David Taylor 1a6bbfd10b
FIX: Do not start the login flow when logging out from SSO/Authenticator (#8423)
This affects login_required sites which use SSO or have only one authenticator enabled. Previously, logging out would redirect to the homepage, which would then redirect to the identity provider. Now, users will be redirected to the Discourse login page. This avoids the confusing situation where a user appears to remain logged in after clicking logout.

Sites which have explicitly defined a logout_redirect url are not affected by this change.

For context, see https://meta.discourse.org/t/134138/2
2019-11-27 11:41:07 +00:00
David Taylor 13a0da8c39 DEV: Use shared logout function when revoking all sessions 2019-11-27 11:09:44 +00:00
Dan Ungureanu 2d3113e4da
FIX: Correctly resize lazy loaded images in Oneboxes 2019-11-27 11:49:32 +02:00
Joffrey JAFFEUX 0807751390
REFACTOR: poll-pie-chart widget (#8415)
This commit mostly get rid of the later() call and encapsulate all pie chart display logic inside discourse-poll-pie-canvas widget instead of sharing it between discourse-poll-pie-chart and discourse-poll-pie-canvas
2019-11-27 00:10:43 +01:00
Blake Erickson 2673cad142 DEV: Remove buffered rendering from user directory
This is another refactoring in the multi-step process to remove all uses
of our custom Render Buffer.

Previous commit: e0199e8094 in this
series.

This commit affects the table header sorting on the user directory page.
It is just a refactor and should not change any functionality.
2019-11-26 15:48:43 -07:00
Kris ff34ab6aef UX: Show obvious message when backup restoration is disabled 2019-11-26 12:55:25 -05:00
Daniel Waterworth 8876db874f DEV: Client side category routing changes
This commit corresponds to d84c34ad which applies the same changes to
the server-side. This changes the category routes, except for the routes
that contain tags.
2019-11-26 13:52:14 +00:00
Arpit Jalan 2dd47df6d1 FIX: show updated_at for invite sent date. 2019-11-26 13:22:48 +05:30
Sam Saffron 941162e90e FIX: draft not clearing when replying to new topic
This amends our API so we provide it with the draft key when saving a post
this means post creator can clean up the draft consistently even if we are
doing fancy stuff like replying to a new topic or new pm or whatever.

There will be some followup work to clean it up so client never calls destroy
on draft during normal operation and the #create/#update endpoints takes care of it
every time
2019-11-26 18:23:20 +11:00
Martin Brennan d0246104ee
FIX: oneboxer.js infinitely retrying failed requests (#8414)
* setFailedCache was used like a variable object, when it was in fact a function
2019-11-26 15:49:58 +10:00
Blake Erickson e0199e8094 DEV: Remove buffered rendering from admin-directory toggle
This is another refactoring in the multi-step process to remove all uses
of our custom Render Buffer.

Previous commit: d0ad5ecc6d in this
series.

This commit affects the table header sorting on the admin directory page.
It is just a refactor and should not change any functionality.
2019-11-25 18:09:18 -07:00
Blake Erickson d0ad5ecc6d
DEV: Remove buffered rendering from group-index-toggle (#8399)
* DEV: Remove buffered rendering from group-index-toggle

This is the first step in a refactor to remove all uses of our Buffered
Renderer:

01e2d5a670/app/assets/javascripts/discourse-common/lib/buffered-render.js.es6 (L3)

This commit affects the header sorting on the group member and the group
requests pages. It is a refactor only with no change in functionality.
2019-11-25 13:36:00 -07:00
Daniel Waterworth 720101b3ee FIX: Update site data when we receive a list of categories
When we receive a list of categories, we should store them so that we
are able to query them in the browser without a page refresh.

This removes a previous fix for the same issue that was much less
general.
2019-11-25 16:50:54 +00:00
Dan Ungureanu d2d0937986
DEV: Add test for load-more (#8369)
Follow-up to 3650c64bca.
2019-11-25 14:42:34 +02:00
Dan Ungureanu d5f5d9b867
FIX: Show quoted images correctly. (#8391)
This commit attempts to fix two issues that affect quoted images.

The first issue is observed while loading. The 'position: absolute' CSS
property makes 'width' and 'height' behave differently. Instead of using
the known image size, this makes it use the computed width and height of
the image, which should be the right size, as shown to the user.

The second issue is caused by 'object-fit: cover' property which trimmed
the left and right sides of wide pictures to make them fit inside the
quote.
2019-11-25 14:32:38 +02:00
Martin Brennan f1cd0d6388 Remove unnecessary commented code 2019-11-25 16:40:27 +10:00
Martin Brennan dbfe9540fa FIX: be more tactical with replacing markdown chars
* instead of using encodeURIComponent in imageNameFromFileName,
  we just replace the bad characters that we wanted to get rid
  of in the first place where we introduced encodeURIComponent.
  as per review
2019-11-25 16:38:13 +10:00
Martin Brennan b89e634dd4
FIX: Replace %20 with space in markdown file name for uploads (#8405)
Meta: https://meta.discourse.org/t/image-name-has-20-in-file-name/134136

We were ending up with [file%20name](url) in the markdown preview, which looked weird and
affected the alt text. this is because we were calling encodeURIComponent, which has been left in place because this is a valid thing to do for some cases. (e.g. f674b9e)
2019-11-25 13:54:55 +10:00
Martin Brennan afb5533581
FEATURE: Add timezone to core user_options (#8380)
* Add timezone to user_options table

* Also migrate existing timezone values from UserCustomField,
  which is where the discourse-calendar plugin is storing them

* Allow user to change their core timezone from Profile

* Auto guess & set timezone on login & invite accept & signup

* Serialize user_options.timezone for group members. this is so discourse-group-timezones can access the core user timezone, as it is being removed in discourse-calendar.

* Annotate user_option with timezone

* Validate timezone values
2019-11-25 10:49:27 +10:00
Krzysztof Kotlarek 43ddf60cdf
FIX: When dismissing category inform via MessageBus (#8371)
When category is dismissed, `dismiss_new` message is sent to fronted to clean state.

In addition, I noticed that when old dismiss new button is clicked, no message is sent so I decided to kill two birds with one stone.
2019-11-25 06:17:31 +11:00
romanrizzi 01e2d5a670 UX: Set selected scale to 100% if scale is undefined 2019-11-22 18:19:35 -03:00
Kris f9fa9b45d0 Facebook square icon has been deprciated for Facebook circle 2019-11-22 15:25:20 -05:00
Roman Rizzi c92f0b8775
FEATURE: New API to apply custom filters to the review queue (#8392) 2019-11-22 16:33:10 -03:00
romanrizzi a53b00a858 DEV: Pass query to the icon outlet 2019-11-22 13:44:31 -03:00
Angus McLeod 2c335efd1e FIX: method names incorrect (#8393) 2019-11-22 15:16:14 +01:00
Daniel Waterworth 2e9e557360 DEV: Remove dead code
Given that this is a route, the 'model' attribute is the hook rather
than an object.
2019-11-22 11:19:48 +00:00
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