Commit Graph

11759 Commits

Author SHA1 Message Date
Kane York d1cceff0e7 DEV: fix formatting 2020-03-05 12:59:16 -08:00
Kane York 670b855f94 FEATURE: Treat /go/ as a server-side route
Ninja superuser implementation of routable permalinks with no UI or
permission changes yet.
2020-03-05 12:24:56 -08:00
Justin DiRose a46741cbb9
DEV: Clean up selectors on backup modal (#9114) 2020-03-05 12:25:10 -06:00
Kris 3610709b6c Add classes for second-factor preferences 2020-03-04 16:53:32 -05:00
Joffrey JAFFEUX 33f77e51b8
FIX: allows to select the action when agreeing with penalty (#9099)
Note this commit also fixes an issue where the edit post actions was trying to focus the edit textarea, but was using jquery functions on a DOM node.

scrollTo is not available on IE11 but that shouldn't cause much trouble.
2020-03-04 09:32:15 -05:00
Martin Brennan 3e54e0191e
FIX: Use full URL for secure attachments when secure media enabled (#9037)
When secure media is enabled and an attachment is marked as secure we want to use the full url instead of the short-url so we get the same access control post protections as secure media uploads.
2020-03-04 10:11:08 +11:00
Martin Brennan 0df72a51b8
FIX: Stop infinite lookup-urls issue for video/audio on page (#9096)
Meta report: https://meta.discourse.org/t/excessive-requests-to-uploads-lookup-urls-leading-to-429-response/143119

* The data-orig-src attribute was not being removed from cooked
video and audio so the composer was infinitely trying to get the
URLs for them, which would never resolve to anything
* Also the code that retrieved the short URL was unscoped, and was
getting everything on the page. if running from the composer we
now scope to the preview window
* Also fixed a minor issue where the element href for the video
and audio tags was not being set when the short URL was found
2020-03-03 15:44:01 +11:00
Joffrey JAFFEUX 11425f8adc
FEATURE: alows to add a description link to a report (#9065)
This commit adds a description link to users_per_trust_level report linking to our blog  article on the subject https://blog.discourse.org/2018/06/understanding-discourse-trust-levels/
2020-03-02 14:30:51 -05:00
Robin Ward a653737a66
FIX: Add aria-labels to topic list items (#9048)
* FIX: Add aria-labels to topic list items

Before this fix you could navigate the topic list using a screen reader
and a keyboard but some of the items were not as descriptive as they
could be. The newly added labels make it easier to understand what you
are tabbing over.

context:
https://meta.discourse.org/t/accessibility-aria-attributes-are-not-defined-for-links-under-replies-category/142539

* Update app/assets/javascripts/discourse/lib/utilities.js.es6

Co-Authored-By: Régis Hanol <regis@hanol.fr>

* Multiline fix

* Fix more tests

Co-authored-by: Régis Hanol <regis@hanol.fr>
2020-03-02 14:28:54 -05:00
Jarek Radosz fedd8e3e3a
DEV: Remove uses of deprecated `Ember.copy` and `Copyable` (#8978) 2020-03-02 14:24:05 -05:00
Jarek Radosz 76a06dfa03
DEV: Remove the last (defunct) use of Ember.View (#8976)
This codepath has been deprecated 3 years ago in c5687100b0.

Ember.View has been removed in Ember 2.0.
2020-03-02 14:23:46 -05:00
Gerhard Schlager 5c39e21c18
UX: Allow correct pluralization for "too few topics and posts" notices (#8947) 2020-03-02 14:20:37 -05:00
Joffrey JAFFEUX ed85cfe141
FIX: prevents click on sk header to bubble (#9084) 2020-03-02 20:06:02 +01:00
Rafael dos Santos Silva d05142d3f7 FEATURE: Enable service worker on iOS PWA 2020-03-02 15:55:09 -03:00
Rafael dos Santos Silva fd38ed3631
DEV: Fix lint error introduced in 58f16f2 2020-03-02 13:04:52 -03:00
Rafael dos Santos Silva 58f16f2e2b
FIX: Make FooterNav work with PWAs on iPadOS 2020-03-02 12:56:37 -03:00
Joffrey JAFFEUX 2db8ada222
FIX: ensures category url of category drop is built using slug and id (#9069) 2020-02-28 17:58:22 +01:00
Mark VanLandingham f358114361
FIX: Prettier on iframed-html component (#9062) 2020-02-27 11:56:13 -06:00
Mark VanLandingham 337b823ec6
Merge pull request from GHSA-vw39-6w7q-gfx5
Co-authored-by: Robin Ward <robin.ward@gmail.com>
2020-02-27 11:47:15 -06:00
Roman Rizzi 87f15f9ed6
FIX: When appending tags to restricted category posts, we need to pass the category id, or it won't work. (#9020) 2020-02-27 14:10:14 -03:00
Joffrey JAFFEUX 501936f0da
FIX: prevents loading to show during debouncing (#9060)
This will also fix a bug in IE11 where click event would not be triggered on row
2020-02-27 15:20:04 +01:00
adam j hartz 0af2f5db64
UX: Differentiate Between PMs and Topics in Search Results (#8933)
PMs will now display an envelope icon next to the topic title in search results. This is especially useful when searching using `in:all`.

Co-authored-by: adam j hartz <hz@mit.edu>
2020-02-27 13:25:32 +00:00
Joffrey JAFFEUX 56345faf9a
FIX: prevents row click event to be caught by filter input event (#9059)
This was causing some dropdowns to not work under IE11
2020-02-27 14:04:23 +01:00
Dan Ungureanu 3568f296a3
FIX: Another attempt at fixing reviewable claiming
Follow-up to 9314751e5c.
2020-02-26 10:46:10 +02:00
Dan Ungureanu 9314751e5c
FIX: Claim reviewable button did not show up for all topics
Follow-up to 514c22e64b.
2020-02-26 10:36:35 +02:00
David Taylor 96ac4fc072
FIX: Include `.json` suffix for email login route (#9041)
In IE11, the browser returns the cached HTML response, rather than the JSON formatted response. Adding the `.json` suffix ensures that the cache is not shared. Same root cause as b0211772
2020-02-25 18:01:33 +00:00
Dan Ungureanu 514c22e64b
FIX: Make reviewable claiming work with deleted topics (#9040)
This fixes the case when the reviewed topic is deleted (for example, in
discourse-akismet).
2020-02-25 15:49:23 +02:00
Joffrey JAFFEUX bd49368942
FIX: ensures topic count is correctly showing in box category badges (#9034) 2020-02-24 23:41:36 +01:00
Penar Musaraj d6a603cc50
FIX: Translate none-tag and all-tags labels in tag filter (#9030)
* FIX: Translate none-tag and all-tags labels in tag filter
* Add test
2020-02-25 07:57:24 +11:00
Joffrey JAFFEUX f336aeee6f
FIX: ensures scoped search category is searching in all categories (#9031) 2020-02-24 19:19:53 +01:00
Joffrey JAFFEUX 0ea11a9d49
FIX: ensures we don't attempt to create a new PM on an existing topic (#9029)
This fix attempts to both fix it at UI level and server side. A previous attempt related to this behavior has been made in commit: 49c750ca78
2020-02-24 08:55:12 -06:00
Joffrey JAFFEUX 69a2ad626b
FIX: ensures group automatic membership dropdown works (#9022)
This commit also fixes a deprecation warning as the previous  component was overriding a computed property from the group model.

Finally a test has been added as this is the only place where we use list-setting outside of the settings, this was highly subject to regressions.
2020-02-21 22:14:24 +01:00
Joffrey JAFFEUX 0b0290cddb
FIX: muted was not working in topic timeline (#9021) 2020-02-21 21:32:58 +01:00
Dan Ungureanu 533495169e
FEATURE: Publish a message when reviewable claimer changes (#9019)
This commit ensures that all users are kept in sync and no user can claim
a topic that has been claimed already.
2020-02-21 19:11:50 +02:00
Jarek Radosz 6ba326a9f4
DEV: Deprecate `ember` module imports (#9011)
Removes remaining `ember` module imports.
2020-02-21 15:56:49 +01:00
Jarek Radosz c607870f08
DEV: Add more `@ember` imports (#9012) 2020-02-21 14:27:04 +01:00
Joffrey JAFFEUX cb69e89d7c
FIX: correctly shows suggested topics label (#9017) 2020-02-21 12:35:49 +01:00
Joffrey JAFFEUX e807dff6fc
FIX: ensures mini-tag-chooser is respecting max_tags_per_topic (#9018) 2020-02-21 12:16:05 +01:00
Vinoth Kannan 8a031f19dc FIX: use dedicated site attribute in category + tag filtered pages too. 2020-02-21 15:55:17 +05:30
Martin Brennan 3af2670bd5
FIX: Consider webp a supported image format for upload (#9015)
* Also fixes an issue where if webp was a downloaded hotlinked
  image and then secure + sent in an email, it was not being
  redacted because webp was not a supported media format in
  FileHelper
* Webp originally removed as an image format in
  https://github.com/discourse/discourse/pull/6377
  and there was a spec to make sure a .bin webp
  file did not get renamed from its type to webp.

  However we want to support webp images now to make
  sure they are properly redacted if secure media is
  on, so change the example in the spec to use tiff,
  another banned format, instead
2020-02-21 13:08:01 +10:00
David Taylor 19dcc6bb7b
FIX: Restore initState() call within discourse-location for subfolder
d7d4612b2d removed the duplicate call to initState(). However, we are relying on a side effect of the duplicate call for subfolder sites to function correctly when accessed without a trailing slash. To avoid a large refactor before the stable release, this commit restores the old behavior.

Long term we should look at migrating to Ember's built-in location library, rather than maintaining our own (very similar) version

https://github.com/emberjs/ember.js/blob/master/packages/%40ember/-internals/routing/lib/location/history_location.ts
2020-02-20 16:41:50 +00:00
Dan Ungureanu 20b90afad9
FIX: Remove broken error dismiss button 2020-02-19 23:03:52 +02:00
Kris 2a7f53065d FEATURE: Add plugin outlet below login/create, add outlet to mobile 2020-02-19 14:08:35 -05:00
David Taylor 8ec2d8a814
FIX: Disable save button for API key creation when invalid (#9005) 2020-02-19 16:33:09 +00:00
Kris de559f3fe3 FIX: Remove border-box from modal-body to avoid iOS fixed position bug 2020-02-19 11:08:15 -05:00
Robin Ward c954d083df Link website when reviewing users 2020-02-19 10:18:05 -05:00
Joffrey JAFFEUX 74f2d48018
FIX: makes setting-object capable of defining value/name properties itself (#9003) 2020-02-19 10:01:21 +01:00
Joffrey JAFFEUX 30e2867547
FIX: prevents setting default values on setting component to reload page
This would happen when clicking on "add all themes" for example.
2020-02-19 09:04:57 +01:00
jjaffeux 32b3f55ef6 Revert "FIX: enums should be treated as flat arrays (#8995)"
This reverts commit 05be9beefd.
2020-02-19 07:53:29 +01:00
Jarek Radosz 9f8a27a132
DEV: Import `makeArray` from `discourse-common` instead using `Ember` global (#8977) 2020-02-19 00:57:58 +01:00
Joffrey JAFFEUX 25ebfd5998
DEV: allows to import isPresent (#8993) 2020-02-18 23:41:15 +01:00
Joffrey JAFFEUX 05be9beefd
FIX: enums should be treated as flat arrays (#8995) 2020-02-18 23:25:12 +01:00
Joffrey JAFFEUX 67ee79f023
FIX: group members dropdown was broken on mobile (#8994) 2020-02-18 23:23:38 +01:00
Vinoth Kannan 7a054fc142 FIX: remove anchors from banner headings.
Else it will create UX issues when the banner is visible on top of the banner topic.
2020-02-19 02:55:04 +05:30
Robin Ward 041168c9b6 FIX: Group mentions were not being cooked the same was as previewed
If a group mention could be notified on preview it was given an `<a>`
tag with the `.notify` class. When cooked it would display differently.
This patch makes the server side cooking match the client preview.
2020-02-18 15:45:02 -05:00
Joffrey JAFFEUX 99746c2850
FIX: ensures report-filter/category is correctly filtering (#8992) 2020-02-18 17:37:43 +01:00
Vinoth Kannan 2e397c78c4 FIX: use separate site attribute for single category "top tags" list.
And use it only in the single category pages.
38dd184a16
2020-02-17 21:09:27 +05:30
David Taylor f1f9648e88
Revert "FIX: sk body should follow wrapper width (#8984)"
This was causing very narrow dropdowns in the composer and notification level dropdowns.

This reverts commit d33aaa0292.
2020-02-17 13:10:26 +00:00
Joffrey JAFFEUX d33aaa0292
FIX: sk body should follow wrapper width (#8984) 2020-02-17 10:39:20 +01:00
Joffrey JAFFEUX 9feace3388
FIX: prevents error when loading tag groups (#8983) 2020-02-17 10:39:04 +01:00
Joffrey JAFFEUX d827430ea6
FIX: prevents expand post to trigger page routing (#8982) 2020-02-17 10:06:38 +01:00
Kris f81bebf93f UX: Cap staff action detail height 2020-02-14 14:23:31 -05:00
Roman Rizzi 99305511bc
DEV: Remove unused BreakString class (#8942) 2020-02-14 15:32:59 -03:00
Robin Ward d51107e2c9 FIX: If a group is unmentionable, don't render it as mentionable
Now if a group is visible but unmentionable, users can search for it
when composing by typing with `@`, but it will be rendered without the
grey background color.

It will also no longer pop up a JIT warning saying "You are about to
mention X people" because the group will not be mentioned.
2020-02-14 12:29:56 -05:00
Penar Musaraj ea0f20e331 DEV: Concatenate value-list choices array
Followup to 89d9704194
2020-02-14 11:33:17 -05:00
Penar Musaraj 89d9704194 FIX: value-list choices when removing a value
Fixes an issue where choices were broken when removing an item from the value-list component.

Adds test case for this scenario.
2020-02-14 11:21:06 -05:00
Joffrey JAFFEUX 7d94de6439
FIX: brings back castInteger as a safer migration path for sk2 (#8966) 2020-02-14 10:00:39 +01:00
Vinoth Kannan 38dd184a16 FIX: update `Site.top_tags` in "categories" route if topic list available.
Else it is not updating the tags dropdown while navigate between the category pages.
2020-02-14 09:53:41 +05:30
Joffrey JAFFEUX 149196b9ce
FIX: displays selection text when no default_notification_level is set (#8962) 2020-02-13 23:45:03 +01:00
Joffrey JAFFEUX 6405159484
FEATURE: adds a new plugin api to decorate plugin outlets (#8937)
```
api.decoratePluginOutlet(
  "discovery-list-container-top",
  elem => {
    if (elem.classList.contains("foo")) {
      elem.style.backgroundColor = "yellow";
    }
  }
);
```
2020-02-13 23:44:34 +01:00
Gerhard Schlager a7efca1fa9 DEV: Remove unused "search help" 2020-02-13 18:31:21 +01:00
David Taylor 8d50f092b5
DEV: Use classes for styling user and group cards (#8913)
Styling based on element-ids, it is impossible for themes/plugins to display multiple cards on a single page. Using classes is a more flexible approach. The element-ids are maintained for backwards compatibility with existing plugins/themes.
2020-02-13 09:58:17 +00:00
Joffrey JAFFEUX 3875785dcc
FIX: ensures shortcuts work correctly with topic-notifications-button (#8956) 2020-02-13 10:01:28 +01:00
Joffrey JAFFEUX 42bda52486
FIX: ensures select-kit can select a row with 0 as value (#8955) 2020-02-13 09:04:32 +01:00
Martin Brennan e1e74abd4f
FEATURE: Improving bookmarks part 2 -- Topic Bookmarking (#8954)
### UI Changes

If `SiteSetting.enable_bookmarks_with_reminders` is enabled:

* Clicking "Bookmark" on a topic will create a new Bookmark record instead of a post + user action
* Clicking "Clear Bookmarks" on a topic will delete all the new Bookmark records on a topic
* The topic bookmark buttons control the post bookmark flags correctly and vice-versa
Disabled selecting the "reminder type" for bookmarks in the UI because the backend functionality is not done yet (of sending users notifications etc.)

### Other Changes

* Added delete bookmark route (but no UI yet)
* Added a rake task to sync the old PostAction bookmarks to the new Bookmark table, which can be run as many times as we want for a site (it will not create duplicates).
2020-02-13 16:26:02 +10:00
Penar Musaraj efa9ba4975
UX: Prevent category-drop topic count from wrapping to new line (#8943) 2020-02-12 14:34:16 -05:00
Artem Vasiliev c36ae17260
FEATURE: export defaultRenderTag function (#8941)
* FEATURE: export defaultRenderTag function

This can be helpful for plugins e.g. when combined with replaceTagRenderer: a plugin may want to customize rendering for some tags and let others be rendered with default code

* refactor: don't change version

..as per review comment, https://github.com/discourse/discourse/pull/8941#discussion_r378406809
2020-02-12 14:26:04 -05:00
Arpit Jalan 3bcd1485f7 UX: show all parent categories for destination topic 2020-02-13 00:34:02 +05:30
Vinoth Kannan 9c96511ec4 FIX: use plain text if available instead of image upload.
Previously, while pasting from Excel 365 it uploaded a table image instead of markdown table.
2020-02-12 23:13:51 +05:30
Penar Musaraj 52fe5b938c FIX: Regression with wizard canvas elements 2020-02-12 12:31:15 -05:00
Dan Ungureanu 67c9940d72
FIX: Avoid highlight mention to groups that are not public.
Follow-up to 3f50481188.
2020-02-12 13:04:40 +02:00
Dan Ungureanu ec40242b5c
FIX: Make inline oneboxes work with secured topics in secured contexts (#8895) 2020-02-12 12:11:28 +02:00
David Taylor d7d4612b2d
FIX: Subfolder sites rewriting URLs to root domain on initial load (#8932)
The `DiscourseLocation.initState` function was accidently renamed in 0431942f (select-kit-2) to `initOptions`. This means that the ember router does not automatically call the function after the router is initialized.

For a long time, we have been calling the `initState` function in the `init` function of discourse-location, which caused an imperceptible URL change to the the root domain, before switching back to the correct subfolder URL when ember called `initState`. This commit removes that call from the initializer, so `initState` is only called once (by ember).

Relevant ember code: https://github.com/emberjs/ember.js/blob/v3.12.2/packages/@ember/-internals/routing/lib/system/router.ts#L695-L699
2020-02-12 09:36:46 +00:00
Joffrey JAFFEUX 47f255f62c
FIX: date was not mutated when changing it in change-timestamp modal (#8935) 2020-02-12 09:12:36 +01:00
Dan Ungureanu 3f50481188
Improvements to group mentions (#8927)
* FIX: Avoid highlight mention to groups that are not public
* UX: Composer autocomplete will suggest all visible group names
2020-02-12 10:11:10 +02:00
Arpit Jalan 7ef754759e UX: show destination topic status when moving post(s) to an existing topic 2020-02-12 11:32:40 +05:30
Joffrey JAFFEUX adbff5835d
FIX: correctly excludes current user in user-chooser (#8928) 2020-02-11 20:41:18 +01:00
Mark VanLandingham 3e89774908
DEV: Use .hbr for raw template file extension (#8883) 2020-02-11 13:38:12 -06:00
Joffrey JAFFEUX 78a0ca53bf
FIX: makes user-selector use real booleans (#8909) 2020-02-11 20:20:12 +01:00
Penar Musaraj 30b7006ca2 DEV: Eliminate "post bounce" after creating a post
Fix has two parts:
a) skips jumping to post if post is in view
b) debounces layout calculation when composer changes state
2020-02-11 14:04:46 -05:00
Dan Ungureanu ecaf2c2f4e
FIX: Make category slug validation less strict (#8915)
This was changed recently and caused issues saving old categories which
already had digits at the beginning of the slug (for example, '30-days').
2020-02-11 17:01:12 +02:00
Joffrey JAFFEUX 902d0e1e3a
DEV: enforces no-invalid-interactive linting rule (#8907) 2020-02-11 15:55:16 +01:00
Joffrey JAFFEUX 9d50e1b40f
DEV: introducing user-chooser (#8910) 2020-02-11 15:54:56 +01:00
Martin Brennan 7ff58f1787
FIX: Disable preloading audio + video when secure media enabled (#8922)
Meta topic: https://meta.discourse.org/t/secure-media-uploads-expire/140894

This fixes the issue where if secure media was enabled, audio
and video files would do an initial load using the presigned
URL for the media to get metadata information e.g. duration of
track/video. However this started the expiry countdown for the
URL, so when a user pressed play on the media after 15 seconds
the media would be expired and AWS would return a 403 error.

We do not preload media if secure media is enabled. Otherwise
we just set the preload type to "metadata" which is the browser
default anyway.
2020-02-11 11:49:58 +10:00
Kris c60182cdb2 UX: Prevent new badge from being orphaned on mobile 2020-02-10 13:48:47 -05:00
Penar Musaraj 8009d7bda2
FEATURE: Support video caption tags/attributes (#8914) 2020-02-10 13:37:32 -05:00
Joffrey JAFFEUX 0d6578dc4d FIX: makes tag-{info,list} more specific to avoid styling other elements (#8902) 2020-02-10 08:41:38 +01:00
Joffrey JAFFEUX 0d9b99582d DEV: enforces table-groups linting rule (#8903) 2020-02-10 08:14:26 +01:00
Joffrey JAFFEUX 99ad2e408a DEV: enforces style-concatenation linting rule (#8888) 2020-02-10 08:13:50 +01:00
Joffrey JAFFEUX f5f4ce90c1 DEV: adds afterRender decorator (#8864) 2020-02-10 08:13:13 +01:00