Commit Graph

24778 Commits

Author SHA1 Message Date
Joffrey JAFFEUX 8be0191ffc
UI: minor tweaks to insert-hyplink modal (#12871)
- ensures footer buttons are aligned
- prevents focus on close button to be much larger than it should be, note that this fix could impact other modals but the current solution is not working, so better fix it differently if needed
2021-04-28 17:21:23 +02:00
Penar Musaraj 548c044809
FIX: Improvements to animated image pausing (#12839) 2021-04-28 10:48:00 -04:00
Joffrey JAFFEUX aa9a8d1041
UI: ensures toolbar gear button has identic color and height (#12872) 2021-04-28 16:22:30 +02:00
Joffrey JAFFEUX 71fd01c8ec
FIX: ensures successive topic hydrates doesn't override category (#12865)
This bug has first been seen when loading similar topics, minimum repro:

- Have a topic named "Something Foo Bar" with a category.

- Call this in console:
```
Discourse.currentUser.store.find("similar-topic", { title: "Something foo bar", raw: "" })
```

- Navigate to latest (no full refresh)

- The category from the topic should have disappeared
2021-04-28 16:12:11 +02:00
Martin Brennan 6d53005e8b
Revert "DEV: Improving topic tracking state code (#12555)" (#12864)
This reverts commit 45df579db0.

This was causing huge browser freezes and crashes.
2021-04-28 11:29:54 +10:00
Martin Brennan 45df579db0
DEV: Improving topic tracking state code (#12555)
The aim of this PR is to improve the topic tracking state JavaScript code and test coverage so further modifications can be made in plugins and in core. This is focused on making topic tracking state changes easier to respond to with callbacks, and changing it so all state modifications go through a single method instead of modifying `this.state` all over the place. I have also tried to improve documentation, make the code clearer and easier to follow, and make it clear what are public and private methods.

The changes I have made here should not break backwards compatibility, though there is no way to tell for sure if other plugin/theme authors are using tracking state methods that are essentially private methods. Any name changes made in the tracking-state.js code have been reflected in core.

----

We now have a `_trackedTopicLimit` in the tracking state. Previously, if a topic was neither new nor unread it was removed from the tracking state; now it is only removed if we are tracking more than `_trackedTopicLimit` topics (which is set to 4000). This is so plugins/themes adding topics with `TopicTrackingState.register_refine_method` can add topics to track that aren't necessarily new or unread, e.g. for totals counts.

Anywhere where we were doing `tracker.states["t" + data.topic_id] = newObject` has now been changed to flow through central `modifyState` and `modifyStateProp` methods. This is so state objects are not modified until they need to be (e.g. sometimes properties are set based on certain conditions) and also so we can run callback functions when the state is modified.

I added `onStateChange` and `onMessageIncrement` methods to register callbacks that are called when the state is changed and when the message count is incremented, respectively. This was done so we no longer need to do things like `@observes("trackingState.states")` in other Ember classes.

I split up giant functions like `sync` and `establishChannels` into smaller functions for readability and testability, and renamed many small functions to _functionName to designate them as private functions which not be called by consumers of `topicTrackingState`. Public functions are now all documented (well...at least ones that are not immediately obvious).

----

On the backend side, I have changed the MessageBus publish events for TopicTrackingState to send back tags and tag IDs for more channels, and done some extra code cleanup and refactoring. Plugins may override `TopicTrackingState.report` so I have made its footprint as small as possible and externalised the main parts of it into other methods.
2021-04-28 09:54:45 +10:00
Roman Rizzi cdbdb04909
UX: The Site's logo is the selected option when changing the system's user avatar. (#12861)
If the "use_site_small_logo_as_system_avatar" setting is enabled, the site's small logo is displayed as the selected option by the avatar-selector. Choosing a different avatar disables the setting.
2021-04-27 17:28:15 -03:00
Andrei Prigorshnev d3c0b6bfe1
FEATURE: include avatar flair on the avatars listed in a user summary’s “Most…” sections (#12858) 2021-04-27 23:09:32 +04:00
Robin Ward 42251e2fe6
FIX: Recent regression meant we were proxying qunit when we shouldn't (#12860) 2021-04-27 14:40:17 -04:00
Kris b6aacc4c2d
UX: fix positioning of back button on progress bar (#12847) 2021-04-27 14:24:04 -04:00
Andrei Prigorshnev 2c4fd7f7c7
FIX: No JIT when quoting a mention (#12835) 2021-04-27 19:36:17 +04:00
David Taylor 1fd8f6df5f
PERF: Improve theme stylesheet compilation performance (#12850)
When building the `scss_load_paths`, we were creating a full export of the theme (including uploads), and not cleaning it up. With many uploads, this can be extremely slow (because it downloads every upload from S3), and the lack of cleanup could cause a disk to fill up over time.

This commit updates the ZipExporter to provide a `with_export_dir` API, which takes care of cleanup. It also adds a kwarg which allows exporting only extra_scss fields. This should make things much faster for themes with many uploads.
2021-04-27 14:33:43 +01:00
David Taylor 657dff3544
PERF: Remove N+1s from ThemeController#update and #show (#12842)
These endpoints only return one `Theme` row, but the one-many relations were not being preloaded efficiently. This commit moves the `includes` statement to a scope, and makes use of it in `#index`, `#show`, and `#update`.
2021-04-27 12:30:29 +01:00
Krzysztof Kotlarek e29605b79f
FEATURE: the ability to search users by custom fields (#12762)
When the admin creates a new custom field they can specify if that field should be searchable or not.

That setting is taken into consideration for quick search results.
2021-04-27 15:52:45 +10:00
Jeff Wong fa393b2956
FEATURE: add reviewable score updated webhook (#12846)
Adds a webhook to notify when a reviewable score is updated.

This is different from created or status changed as additional flags can
roll in and update the score without updating status. Useful for applications
looking to integrate in with Discourse's scores
2021-04-26 17:40:32 -07:00
Kris 22d23c4af1
UX: consistent topic timer message button order (#12826) 2021-04-26 18:56:01 -04:00
Kris b3cf483813
UX: Mobile consistency for topic status messages (#12828) 2021-04-26 18:55:50 -04:00
Kris c0bd7db799
UX: Improve alignment and spacing of category headers (#12829) 2021-04-26 18:55:18 -04:00
Kris ed373b2e7b
A11Y: Category logos are decorative, set empty alt (#12830) 2021-04-26 18:54:56 -04:00
Rafael dos Santos Silva a74783d157
FEATURE: Allow using 'top' view for topic list embed (#12825) 2021-04-26 18:10:04 -03:00
Blake Erickson 0f3b5387ea
DEV: Add select-kit helper isDisabled (#12827)
In a qunit test for a plugin I need to be able to check if a select-kit
element is disabled or not. Adding this helper in core allows me to do that.
2021-04-26 14:39:41 -06:00
Osama Sayegh a169dc6832
Revert "FEATURE: Allow theme tests to be run in production (#12815)" (#12840)
This reverts commit 7217dcb67a.

https://meta.discourse.org/t/failed-to-bootstrap-due-to-out-of-memory-killer/188141/18?u=osama

Precompiling test_helper.js is so expensive that it can make bootstrap
fail on servers with limited resources (2GB RAM). We will find another
way that doesn't require much resources.
2021-04-26 23:05:58 +03:00
Dan Ungureanu b32c7df0e9
FEATURE: Share Topic modal improvements (#12834)
This PR includes few commits that improve the new "Share Topic" modal: same
icon for notify button as the notification, advanced options are only showed
for staff, but the topic name should be visible to everyone.
2021-04-26 19:08:59 +03:00
Bianca Nenciu 2c417338ed
FIX: Make diffHTML handle external changes (#12821)
Changing the contents of the preview element between two uses of
diff.innerHTML did not apply the diff correctly.
2021-04-26 14:28:08 +03:00
Osama Sayegh 7217dcb67a
FEATURE: Allow theme tests to be run in production (#12815)
This commit allows site admins to run theme tests in production via a new `/theme-qunit` route. When you visit `/theme-qunit`, you'll see a list of the themes/components installed on your site that have tests, and from there you can select a theme or component that you run its tests.

We also have a new rake task `themes:install_and_test` that can be used to install a list of themes/components on a temporary database and run the tests of the themes/components that are installed. This rake task can be useful when upgrading/deploying a Discourse instance to make sure that the installed themes/components are compatible with the new Discourse version being deployed, and if the tests fail you can abort the build/deploy process so you don't end up with a broken site.
2021-04-26 12:56:45 +03:00
Bianca Nenciu 7c3268e0c5
FIX: Show staff bulk actions only to staff (#12823)
The bulk button is normally shown only to staff, which is why we did not
do any explicit permissions check. Now we do display it on the messages
page too, where it is accessible to everyone.
2021-04-26 12:40:52 +03:00
Andrei Prigorshnev f7aeb257ee
FIX: Skip notifications about beginner badges (#12819) 2021-04-26 11:41:51 +04:00
Penar Musaraj 886f4b589e
FIX: Bug when scrolling in iOS Safari with composer open (#12831)
Regression was introduced in c54609.

This ensures the full height composer styling only applies when (window
height - viewport height > 0). Previously it was being wrongly triggered
when that calculation returned a negative number.
2021-04-25 22:14:13 -04:00
Roman Rizzi 60059a7190
FEATURE: A low priority filter for the review queue. (#12822)
This filter hides reviewables with a score lower than the "reviewable_low_priority_threshold" setting. We only use reviewables that already met this threshold to calculate the Medium and High priority filters.
2021-04-23 15:34:24 -03:00
Robin Ward 4ccbecf480
FIX: Forward all the HTTP headers through when we bootstrap Ember CLI (#12824) 2021-04-23 14:33:58 -04:00
Mark VanLandingham 1f863d2a30
UX: Improve copy when no results in bookmarks and notifications quick access panel (#12820) 2021-04-23 12:17:42 -05:00
Jeff Wong 04291c79dd
DEV: add group-post-additional-member-info plugin outlet (#12810) 2021-04-23 09:58:29 -07:00
Penar Musaraj dd3e16c1e4
DEV: Add group join/leave events (#12817) 2021-04-23 12:47:18 -04:00
Dan Ungureanu cfee2728ce
FEATURE: New share topic modal (#12804)
The old share modal used to host both share and invite functionality,
under two tabs. The new "Share Topic" modal can be used only for
sharing, but has a link to the invite modal.

Among the sharing methods, there is also "Notify" which points out
that existing users will simply be notified (this was not clear
before). Staff members can notify as many users as they want, but
regular users are restricted to one at a time, no more than
max_topic_invitations_per_day. The user will not receive another
notification if they have been notified of the same topic in past hour.

The "Create Invite" modal also suffered some changes: the two radio
boxes for selecting the type (invite or email) have been replaced by a
single checkbox (is email?) and then the two labels about emails have
been replaced by a single one, some fields were reordered and the
advanced options toggle was moved to the bottom right of the modal.
2021-04-23 19:18:23 +03:00
Robin Ward e3b1d1a718
DEV: Improve Ember CLI's bootstrap logic (#12792)
* DEV: Give a nicer error when `--proxy` argument is missing

* DEV: Improve Ember CLI's bootstrap logic

Instead of having Ember CLI know which URLs to proxy or not, have it try
the URL with a special header `HTTP_X_DISCOURSE_EMBER_CLI`. If present,
and Discourse thinks we should bootstrap the application, it will
instead stop rendering and return a HTTP HEAD with a response header
telling Ember CLI to bootstrap.

In other words, any time Rails would otherwise serve up the HTML for the
Ember app, it stops and says "no, you do it."

* DEV: Support asset filters by path using a new options object

Without this, Ember CLI's bootstrap would not get the assets it wants
because the path it was requesting was different than the browser path.
This adds an optional request header to fix it.

So far this is only used by the styleguide.
2021-04-23 10:24:42 -04:00
Joffrey JAFFEUX 6b10ada752
FIX: ensures successive tags can be renamed (#12818)
Original bug report: https://meta.discourse.org/t/rename-tag-not-working-as-expected/184950

This bug was caused by the use of `oneWay` which can be very dangerous in this case, from the documentation:

> computed.oneWay only provides an aliased get. The set will not mutate the upstream property, rather causes the current property to become the value set. **This causes the downstream property to permanently diverge from the upstream property.**
2021-04-23 16:18:23 +02:00
Bianca Nenciu ce4017ab33
FEATURE: Show a notice if video cannot be rendered (#12718)
Not all videos can be rendered everywhere because some browser may be
missing some codecs. This commit adds a notice on top of video to let
the user know about it.
2021-04-23 16:56:13 +03:00
Bianca Nenciu 8c4a11c006
DEV: Move autotag to topic creator (#12790)
This move was necessary to automatically tag the topic with the right
tags from creation time. The process post job may be delayed for a
short time.
2021-04-23 16:55:34 +03:00
Arpit Jalan e53b474557
FIX: allow moderators to access /admin/customize/watched_words (#12816)
Moderators were unable to access `/admin/customize/watched_words`
feature. This was regressed in 61860098d9
2021-04-23 18:51:45 +05:30
Kris abbb3a6be5
DEV: add tag-navigation plugin outlet (#12814)
Adds a plugin outlet to the tag template to match the `category-navigation` outlet on category pages (using this for a customer theme component).
2021-04-23 10:38:07 +02:00
Jeff Wong 4b8d23c0d4
DEV: Add primary group class to user summary page (#12809) 2021-04-22 16:11:15 -07:00
Jeff Wong e01d5f80b4
Add primary group classes (#12807)
* DEV: expose primary group as classes in more areas.

Add group classes in the group posts pages

Add primary group name as a class on the user card
2021-04-22 15:00:23 -07:00
David Taylor 890b06b10f
FIX: Ensure tag topic lists are not scrolled to an incorrect position (#12805)
When navigating from a 'discovery' topic list to a 'tags' topic list, the scroll position from the 'discovery' list was being used by the tag list. That meant the user would be taken to a random point in the list, and not scrolled to the top.

Non-tag topic lists were working fine because we only apply the 'cached' logic (and by extension, the saved scroll location) when the user clicks 'back' in the browser. In the code, this is referred to as `isPoppedState`.

This commit takes the `isPoppedState` logic from the regular topic lists, and applies it to the tag topic lists.
2021-04-22 16:09:20 -05:00
Kris 984d87f30c
UX: stop presence indicator hop, space consistency (#12797) 2021-04-22 16:11:47 -04:00
Bianca Nenciu 6c5d6dd356
Improve validation for polls and improve builder (#12745)
* FIX: Show date picker over modal

Previously, scrolling was necessary to see the whole picker.

* FEATURE: Improve validation for polls

Adds new error messages for each of the edge cases. Previously, it
failed with a simple error saying that the minimum value must be less
than the maximum value.

* UX: Copy edit
2021-04-22 21:36:32 +03:00
Penar Musaraj 139ba69117
FIX: Do not add CSS transition effect to animated images (#12803)
Followup to c11d75da87, the transition
delays the pause/play action.
2021-04-22 14:05:48 -04:00
Dan Ungureanu 31d3990986
FIX: Send a different message if export fails (#12799)
It used to check if an upload record exists, which is wrong because an
invalid upload record exists even if the upload was not created.

The other improvement is a better log message.
2021-04-22 20:21:31 +03:00
Penar Musaraj c11d75da87
FEATURE: Allow pausing animated images in posts (#12795)
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-04-22 11:28:35 -04:00
Arpit Jalan 1e9301d4d8
UX: do not pre-select blank tag on append tags bulk action (#12801)
UX: show progress screen only when more than 20 topics are selected
2021-04-22 20:32:15 +05:30
Penar Musaraj fd6f0db788
DEV: Fix flaky Ember test (#12802) 2021-04-22 10:25:20 -04:00
Ahmed Gagan 3867b8998c
DEV: allows reports to display an html title (#12687)
eg: display an emoji in title
2021-04-22 13:38:10 +02:00
Arpit Jalan 271a372e3d
FIX: when a flag is handled archive message for moderator group (#12798)
When a user flags a post with the “Something Else” option, a PM between
the user and the moderators group is created. If no moderators reply to
the PM, when the flag is handled at /review, an auto-reply is created
for the PM. However, the PM is not archived, it stays in the inbox.

This commit ensures that the PM is archived for moderator group when no
moderator has replied to that PM.
2021-04-22 15:53:44 +05:30
Joffrey JAFFEUX e2e936715e
UX: uses native date picker when possible (eg: not safari) (#12668)
Note that this is only applied on date-input and not the old date-picker for now.

This commit is also slightly modifying admin report dates form to ensure the native picker is correctly used, as a result: it doesn’t auto refresh on date change and fixes a border bug.
2021-04-22 10:34:23 +02:00
Joffrey JAFFEUX 0eeedf307a
DEV: replaces huge generated emoji list by a simpler regex (#11053)
Note that this commit is also fixing various mistakes in emojis.

Some of them have been fixed manually in db.json/data.js/groups.json and will need to be fixed in emoji-db gem.
2021-04-22 08:43:06 +02:00
Kris e0d17c8d19
UX: Prevent topic progress bar from overlapping (#12780) 2021-04-21 22:53:23 -04:00
Penar Musaraj 95223938a5
FIX: Exclude emoji images from JS sizing (#12796)
Should remove jumpiness when using the experimental
`disable_image_size_calculations` site setting.
2021-04-21 20:51:44 -04:00
Martin Brennan 206d8db433
FIX: Invalid Date on "last" shortcut for timer + bookmarks (#12783)
The "last custom date and time" shortcut for the topic timer and
bookmarks could get into a state where it had an Invalid Date if
the user opened the topic timer modal, clicked Custom Date and then
closed the modal without making changes. This has been fixed, the
last custom date + time will no longer be set in this case and if
somehow the last custom date + time is invalid that option will not
show.

Also improve the wording from just "Last" to "Last custom datetime"
2021-04-22 09:26:31 +10:00
Jarek Radosz 2dfa1a267e
FIX: `TagDrop` uses `currentCategory` now (#12786) 2021-04-21 21:46:52 +02:00
Kris b9b4d2485b
UX: fix layout of group header buttons on mobile (#12781) 2021-04-21 15:45:45 -04:00
Jarek Radosz ad406b6e11
FEATURE: Make `category-navigation` outlet tagless (#12788) 2021-04-21 15:45:09 -04:00
Neil Lalonde f186ff99c8
FIX: blank avatar on user card if flair url is undefined (#12791)
If creating a group avatar flair with no icon or image, the user card
was showing a blank circle.
2021-04-21 15:43:50 -04:00
Jeff Wong 27771ad189
Group posts adhere to prioritize name in UX option (#12789)
Displays either username or name on the group activity page.
Removes hardcoded comma, and adds classes to share padding styling
2021-04-21 10:30:25 -07:00
Jarek Radosz a172a6cd9c
FIX: Allow finding non-lowercase tag groups (#12787) 2021-04-21 19:15:53 +02:00
Penar Musaraj 24715115f5
DEV: Experiment with relative image sizes and native image lazy loading (#12759) 2021-04-21 12:41:45 -04:00
Sam e4f1760bab
FEATURE: watch title for automatic tagging (#12782)
Previously watched words ignored topic titles when applying auto tagging rules.

Also copy has been improved to reflect how the system behaves.

The text hints that we are only watching first post now
2021-04-21 18:16:25 +03:00
Roman Rizzi 6b613e3076
FEATURE: Review every post using the review queue. (#12734)
* FEATURE: Review every post using the review queue.

If the `review_every_post` setting is enabled, posts created and edited by regular uses are sent to the review queue so staff can review them. We'll skip PMs and posts created or edited by TL4 or staff users.

Staff can choose  to:

- Approve the post (nothing happens)
- Approve and restore the post (if deleted)
- Approve and unhide the post (if hidden)
- Reject and delete it
- Reject and keep deleted (if deleted)
- Reject and suspend the user
- Reject and silence the user

* Update config/locales/server.en.yml

Co-authored-by: Robin Ward <robin.ward@gmail.com>

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2021-04-21 08:41:36 -03:00
Osama Sayegh 45ccadeeeb
DEV: Upgrade Rails to 6.1.3.1 (#12688)
Rails 6.1.3.1 deprecates a few API and has some internal changes that break our tests suite, so this commit fixes all the deprecations and errors and now Discourse should be fully compatible with Rails 6.1.3.1. We also have a new release of the rails_failover gem that's compatible with Rails 6.1.3.1.
2021-04-21 12:36:32 +03:00
Kris 62e882ad11
UX: Fix focus style for post edit history button (#12757) 2021-04-20 21:03:47 -04:00
Sam 5c49009c6c
PERF: properly preload emails to speed up user exports (#12778)
scopes are incredibly annoying to preload, simply adding :user_emails is not
enough.

Instead of relying on scopes simply iterate through user_emails which is
properly preloaded.

This removes 2 * N+1 when generating user reports.
2021-04-21 10:42:07 +10:00
Kris 3c0164f369
UX: Update positioning of mobile post controls (#12760) 2021-04-21 09:43:26 +10:00
Penar Musaraj c47e6a2004
FIX: Use CDN urls for theme settings of type upload (#12773) 2021-04-20 18:42:02 -04:00
Jordan Vidrine d51a226da4
FIX: Revert color of post-map (#12774)
* FIX: Revert color of post-map

This commit changes post-map colors back to original after a11y changes.
2021-04-20 17:38:13 -05:00
Kris 5e97946f9f
UX: improve user card control layout for long text (#12770) 2021-04-20 18:34:33 -04:00
Jordan Vidrine f33b7c8f65
UX: Wider drop down for top page select kit (#12766) 2021-04-20 15:53:30 -05:00
Robin Ward 8f244cd1b9
FIX: If we want a `.json` path, don't bootstrap (#12772) 2021-04-20 14:26:15 -04:00
Penar Musaraj d44deb45f3
FIX: Use CDN urls for theme uploads (#12769) 2021-04-20 13:25:35 -04:00
Kris c7653d2e78
UX: Update signup cta styles (#12761) 2021-04-20 13:00:39 -04:00
Arpit Jalan e54b5dadab
UX: show error message instead of disabling save button on tag groups page (#12767)
https://meta.discourse.org/t/unable-to-rename-tag-groups-title-save-button-stays-grayed-out/172293/
2021-04-20 21:40:02 +05:30
Joffrey JAFFEUX 69f8c3b305
UX: displays a descriptive error when theme is not allowed (#12763) 2021-04-20 13:28:59 +02:00
Arpit Jalan af6d0342b6
FIX: user group message route should not be case-sensitive (#12753) 2021-04-20 10:25:31 +05:30
Martin Brennan cc7e352f30
FIX: Clientside validate min tags for required tag group (#12758)
When the user has not selected any tags and minimum_required_tags
is specified for a category, they get a clientside validation error
to tell them this. We were not doing the same thing when
min_tags_from_required_group and required_tag_groups was specified.
2021-04-20 10:39:13 +10:00
Jordan Vidrine 19cb05661d
FEATURE: Topic count in category boxes (#12756)
* FEARTURE: Also add outlet to featured topic category boxes
2021-04-19 16:24:17 -05:00
Jordan Vidrine f74d9ca399
FEATURE: Add plugin outlet for category-box-below-each-category (#12755) 2021-04-19 13:19:06 -05:00
Kris 28d5a3f21f
UX: smoother timeline footer animation, padding fix (#12743) 2021-04-19 13:00:12 -04:00
webdirektindia 42f8f6b4a2
Adding after-groups-index-container plugin-outlet (#12750) 2021-04-19 16:17:39 +02:00
Penar Musaraj ff601504f7
DEV: Fix linting (#12754) 2021-04-19 09:28:07 -04:00
Penar Musaraj f0000f5017
UX: Mobile styling for discard draft modal buttons (#12735)
Co-authored-by: Kris  <kris.aubuchon@discourse.org>
2021-04-19 09:23:41 -04:00
Joffrey JAFFEUX 191fac5c7c
DEV: makes transformComplete async (#12752)
This is used to apply multiple transformations following user input.
2021-04-19 11:40:23 +02:00
Joffrey JAFFEUX 99aae959a6
DEV: adds an experimental `preserveKey` bool option to autocomplete (#12751)
Usage:

```
$(input).autocomplete({
  preserveKey: false
});
```

Defaults to true.
2021-04-19 11:40:05 +02:00
Gerhard Schlager 92e222d246
FIX: POP3 polling shouldn't stop after exception or old email (#12742) 2021-04-19 10:27:29 +02:00
Martin Brennan e3b1f5721b
FIX: Enforce tag group count validation before sending to review queue (#12728)
There is a category setting that enforces 1 or more tags must be added to a topic from a specific tag group before creating it. This validation was not being run before the topic was being sent to a review queue for categories that have that setting enabled.

There was an existing validation in `TopicCreator` but it was not correct; it was only validating when the tags did _not_ exist and also only happened on `create`. I now run the validation in `TopicCreator.valid?`

I also improved the error message shown to the user when they have not added the tags required (showing the tag names from the tag group), and changed the composer tag selector to not show "optional" if there are N tags required from a certain group.
2021-04-19 09:43:50 +10:00
Andrei Prigorshnev 8c6ea967ae
FEATURE: Show the slow mode indicator in composer (#12720) 2021-04-17 23:40:09 +04:00
Jeff Wong 75abe8d295
DEV: make font sizing and ratios default (#12741)
Make it easier for themes/plugins to use Discourse's built in font sizing
and override font ratios
2021-04-16 12:58:16 -07:00
Penar Musaraj 9581d71372
FIX: Allow CodeCommit-style theme .git url format (#12739) 2021-04-16 12:46:34 -04:00
Gerhard Schlager c60ccfed98
DEV: Add app event "topic:timings-sent" (#12737) 2021-04-16 18:34:49 +02:00
Gerhard Schlager 74e84a1953
DEV: Export regex for parsing topic URL (#12740) 2021-04-16 18:34:39 +02:00
Penar Musaraj 35f977f8a5
UX: Prevent some composer buttons from receiving focus (#12719) 2021-04-16 11:10:02 -04:00
Roman Rizzi fd8441d6d5
DEV: Pass a list of tag group names when using the search endpoint. (#12721)
Accepting a list of names instead of ids is more convenient when searching for tag groups using data from the `category.allowed_tag_groups` method.
2021-04-16 08:41:10 -03:00
Régis Hanol 2aed82e646
FIX: whitespaces when copying code blocks (#12730)
This ensures the copied text always has proper white space characters.
2021-04-16 10:28:47 +02:00
Bianca Nenciu 96a16123d8
FIX: Generate unique HTML heading names (#12705)
Headings with the exact same name generated exactly the same heading
names, which was invalid. This replaces the old code for generating
names for non-English headings which were using URI encode and resulted
in unreadable headings.
2021-04-16 10:54:19 +03:00
Robin Ward 42f6c9b6b9
FIX: Docking mixin was not cleaning up timers (#12638)
I noticed this while trying to debug slow performing ember tests.
Our docking mixin sometimes sets timers but never cancels them when
removed. I'm not sure of any errors this causes but we should be tidying
up whenever the component is removed.
2021-04-16 11:33:19 +10:00
Kris d89e9fcfa3
FIX: remove old usercard styles, fix bg img class (#12712) 2021-04-15 16:34:47 -04:00
Andrei Prigorshnev eb99ecf1d2
FEATURE: In the slow mode dialog make "Enabled Until" mandatory (#12701) 2021-04-15 19:16:01 +04:00
Penar Musaraj c54609bfcd
UX: Full height composer on mobile Android (#12709) 2021-04-15 09:02:24 -04:00
Dan Ungureanu bfa301bd7b
FIX: Show invite validation errors to users (#12717)
The server used to respond with a generic 'error, contact admin' message
which did not offer any hint what the error was. This happened even when
the error could be easily corrected by the user (for example, if they
chose a very common password).
2021-04-15 15:23:49 +03:00
Dan Ungureanu 4d87360f84
UX: Minor styling improvements to invites (#12715)
Reduce the width of the modal to make it consistent with other modals
and use the full width for inputs with a button on the right side.
2021-04-15 14:46:49 +03:00
Dan Ungureanu 85d4b60a45
FIX: Improve error messages for invites (#12714)
The error messages used to include an unnecessary 'Validation failed:
Email' prefix which was removed.
2021-04-15 14:46:32 +03:00
David Taylor c60668a052
FIX: Ensure the top 6 categories are shown in the user summary (#12691)
Previously it would pluck 6 categories which the user had posted in, **then** order them. To select the **top 6** categories, we need to perform the ordering in the SQL query before the LIMIT
2021-04-15 11:05:03 +01:00
Andrei Prigorshnev 3326d1ff73
FEATURE: Tweak slow mode messages and intervals (#12704) 2021-04-15 13:56:10 +04:00
Joffrey JAFFEUX 81498bd131
DEV: updates to onebox 2.2.14 (#12713)
This commit also updates github’s body onebox styles in Discourse core:
- full width
- prevents show-more btn to trigger vertical scrolling
- makes text standout less and slightly bigger
2021-04-15 10:58:39 +02:00
Joffrey JAFFEUX ae27717b61
UX: moves from summary/details to a button to expand github body (#12698) 2021-04-15 08:52:04 +02:00
Rafael dos Santos Silva b5fba751a0
DEV: Do not install service workers in development (#12708) 2021-04-14 18:21:28 -03:00
Robin Ward 32689573fa
FIX: Already sent headers error in Ember CLI (#12706)
If we are sending a custom template, we shouldn't do a `next()`,
we should halt middleware.
2021-04-14 15:25:49 -04:00
Robin Ward e459937ffa
FIX: `this.loading` is undefined, it should be `state.loading` (#12707)
This might prevent issues with double requests on the user notifications panel.
2021-04-14 15:21:54 -04:00
Régis Hanol c1fc2a1e9b
FIX: handle permalinks with query parameters (#12700) 2021-04-14 20:03:25 +02:00
Robin Ward 6a7a8f32f1
FIX: `ember build` was not adding digests to additional bundles (#12703)
* FIX: `ember build` was not adding digests to additional bundles

* Update app/assets/javascripts/discourse/ember-cli-build.js

Co-authored-by: Jarek Radosz <jradosz@gmail.com>

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-04-14 13:37:22 -04:00
Michael Brown dda1cd6a38 FEATURE: allow setting postgres connection variables via environment 2021-04-14 13:31:32 -04:00
Dan Ungureanu 99dadb2129
PERF: Async notify users after inviting group (#12697)
Inviting a group generates a notification for each member. If this
happens synchronously it may take a while, leading to a poor user
experience.
2021-04-14 19:30:51 +03:00
Dan Ungureanu 8c24a848e0
FEATURE: Reduce invite key length (#12692)
We used to generate invite keys that were 32-characters long which were
not very friendly and lead to very long links. This commit changes the
generation method to use almost all alphanumeric characters to produce
a 10-character long invite key.

This commit also introduces a rate limit for redeeming invites because
the probability of guessing an invite key has increased.
2021-04-14 19:22:16 +03:00
Robin Ward 0afcf9e12e
DEV: Support Node 15 with Ember CLI (#12679)
* DEV: Support Node 15 with Ember CLI

* FIX: Broken tests that needed to be updated in newer Ember CLI
2021-04-14 10:16:39 -04:00
Dan Ungureanu 528cfea079
FEATURE: Auto-activate users invited by email (#12675)
When invited by email, users will receive an invite URL which contains
a token. If that token is present when the invite is redeemed, their
account will be automatically activated.
2021-04-14 12:15:56 +03:00
Bianca Nenciu e4e2c7c66f
FIX: Improve anchor links (#12683)
* FIX: Use theme color for anchor icon

* FIX: Do not count anchor links

* FIX: Do not count hashtags links either

* DEV: Add tests for link_count

* FIX: Disable anchors in quotes and preview

* FIX: Try building some anchor slugs for unicode

* DEV: Fix tests
2021-04-14 10:27:07 +03:00
Martin Brennan eeaecd4fd2
FEATURE: Category setting to allow unlimited first post edits by the owner of the topic (#12690)
This PR adds a new category setting which is a column in the `categories` table, `allow_unlimited_owner_edits_on_first_post`.

What this does is:

* Inside the `can_edit_post?` method of `PostGuardian`, if the current user editing a post is the owner of the post, it is the first post, and the topic's category has `allow_unlimited_owner_edits_on_first_post`, then we bypass the check for `LimitedEdit#edit_time_limit_expired?` on that post.
* Also, similar to wiki topics, in `PostActionNotifier#after_create_post_revision` we send a notification to all users watching a topic when the OP is edited in a topic with the category setting `allow_unlimited_owner_edits_on_first_post` enabled.

This is useful for forums where there is a Marketplace or similar category, where topics are created and then updated indefinitely by the OP rather than the OP making new topics or additional replies. In a way this acts similar to a wiki that only one person can edit.
2021-04-14 15:54:09 +10:00
Martin Brennan c07a6eeb6d
FIX: Software update prompt fixes and improvements (#12648)
* Fixes the z-index of the prompt so it is behind the quick access panels
* Adds a dismiss `X` button (made sure the click target of this was quite big)
* Change structure of HTML to address template lint issues
* Fix aria-hidden not returning true/false
* Reload current page instead of navigating to / when clicking on the prompt message
2021-04-14 10:26:23 +10:00
Martin Brennan 66d17fdd6b
FIX: Topic user bookmarked column is out of sync after post moves (#12612)
When posts are moved from one topic to another, the `topic_user.bookmarked` column for all users in the new and the old topic needs to be resynced, for example because a user bookmarks post 12 in topic 1, then it is moved to topic 2, the topic_user record for topic 1 should no longer be bookmarked. A background job has been added to sync the column for a specified topic, or for no topic at all, which does it for all topics like the migration.

Also includes a migration that we have run in the past to fix bad data.

----

This has been addressed in other places in the past:

https://github.com/discourse/discourse/pull/10211
https://github.com/discourse/discourse/pull/10188
2021-04-14 09:10:53 +10:00
David Taylor da6edc117c
FIX: Allow raw-view classes to be resolved from themes/plugins (#12685)
Since cd24eff5d9, theme modules are now prefixed with the theme id. Therefore themes which defined raw-view classes will be broken

This commit updates the `raw` helper to use the resolver for looking up the view class. This automatically takes care of trying theme/plugin paths in addition to core paths.
2021-04-13 15:05:46 +01:00
Faizaan Gagan c45dbe4159
enable eol-last for eslint and ember-template-lint (#12678)
enable eol-last for eslint and ember-template-lint

Fixed a handlful of .hbs files where newlines weren't present
2021-04-12 17:22:00 -07:00
Robin Ward abe588c2c8
Update `caniuse-lite` to the latest version (#12677) 2021-04-12 14:06:17 -04:00
Ryan Mulligan d837ad8386
DEV: user suspension use .present? (#12676)
As suggested by eviltrout in

https://github.com/discourse/discourse/pull/12666
2021-04-12 12:53:40 -04:00
Jarek Radosz 7d1cef71ff
DEV: Remove ScrollTop mixin (#12673)
It was deprecated (incorrectly! see the import 😅) 5 years ago. No references found anymore in core and all-the-plugins.
2021-04-12 17:52:53 +02:00
Roman Rizzi 958fbfb719
FEATURE: Send an email notification when a post is approved. (#12665)
We now send an email when a queued post is approved, and we create a notification.
2021-04-12 12:08:23 -03:00
Ryan Mulligan 045adb76f2
FIX: only send user suspension emails if email message provided (#12666)
This makes behavior consistent with documentation:

API:

> Will send an email with this message when present

Web UI:

> Optionally, provide more information about the suspension and it will be emailed to the user
2021-04-12 11:03:10 -04:00
Osama Sayegh cd24eff5d9
FEATURE: Introduce theme/component QUnit tests (take 2) (#12661)
This commit allows themes and theme components to have QUnit tests. To add tests to your theme/component, create a top-level directory in your theme and name it `test`, and Discourse will save all the files in that directory (and its sub-directories) as "tests files" in the database. While tests files/directories are not required to be organized in a specific way, we recommend that you follow Discourse core's tests [structure](https://github.com/discourse/discourse/tree/master/app/assets/javascripts/discourse/tests).

Writing theme tests should be identical to writing plugins or core tests; all the `import` statements and APIs that you see in core (or plugins) to define/setup tests should just work in themes.

You do need a working Discourse install to run theme tests, and you have 2 ways to run theme tests:

* In the browser at the `/qunit` route. `/qunit` will run tests of all active themes/components as well as core and plugins. The `/qunit` now accepts a `theme_name` or `theme_url` params that you can use to run tests of a specific theme/component like so: `/qunit?theme_name=<your_theme_name>`.

* In the command line using the `themes:qunit` rake task. This take is meant to run tests of a single theme/component so you need to provide it with a theme name or URL like so: `bundle exec rake themes:qunit[name=<theme_name>]` or `bundle exec rake themes:qunit[url=<theme_url>]`.

There are some refactors to how Discourse processes JavaScript that comes with themes/components, and these refactors may break your JS customizations; see https://meta.discourse.org/t/upcoming-core-changes-that-may-break-some-themes-components-april-12/186252?u=osama for details on how you can check if your themes/components are affected and what you need to do to fix them.

This commit also improves theme error handling in Discourse. We will now be able to catch errors that occur when theme initializers are run and prevent them from breaking the site and other themes/components.
2021-04-12 15:02:58 +03:00
Joffrey JAFFEUX 18777d9108
DEV: implements some of ember-truth-helpers (#12667)
The implemented helpers, are helper which might be in Ember core in the future:

- and
- or
- not
- eq
- not-eq
- lt
- lte
- gt
- gte

They follow the implementation of ember-truth-helpers: https://github.com/jmurphyau/ember-truth-helpers

Note 1: Ember rfcs are still debating going with {{not-eq}} or {{neq}}, should be easy to support in the future whatever is finally chosen.

Note 2: this commit also moves it to its own addon, and removes the {{not}} test, to simplify further updates.
2021-04-12 11:40:00 +02:00
Joffrey JAFFEUX 2dc8bfd1ba
UI: adds styling for new github PR body details/summary (#12669)
https://github.com/discourse/onebox/pull/466
2021-04-12 10:45:16 +02:00
Penar Musaraj abb0a4bae2
DEV: Add SCSS helper to replace `asset-uri` and `image-uri` (#12664) 2021-04-12 13:57:39 +10:00
Sam 5deda5ef3e
FIX: automatically timeout long running image magick commands (#12670)
Previously certain images may lead to convert / identify to run for unreasonable
amounts of time

This adds a maximum amount of time these commands can run prior to forcing
them to stop
2021-04-12 13:55:54 +10:00
Joffrey JAFFEUX b6337b72f1
FEATURE: adds last day to about page stats (#12663)
* FEATURE: adds last day to about page stats

* make it clear it's last 24 hours

* applies same copy fix to days
2021-04-12 12:50:33 +10:00
wilson29thid d5b30b9b7b
FEATURE: Add user_confirmed_email to user event webhook (#12539) 2021-04-12 12:48:42 +10:00
Martin Brennan 1ba5ccd8af
FIX: When user has already hit bookmark limit, do not error for clear_reminder! or other updates (#12658)
We introduced a cap on the number of bookmarks the user can add in be145ccf2f. However this has caused unintended side effects; when the `jobs/scheduled/bookmark_reminder_notifications.rb` runs we get this error for users who already had more bookmarks than the limit:

> Job exception: Validation failed: Sorry, you have too many bookmarks, visit #{url}/my/activity/bookmarks to remove some.

This is because the `clear_reminder!` call was triggering a bookmark validation, which raised an error because the user already had to many, holding up other reminders.

This PR also adds `max_bookmarks_per_user` hidden site setting (default 2000). This replaces the BOOKMARK_LIMIT const so we can raise it for certain sites.
2021-04-09 13:06:35 +10:00
Roman Rizzi 8339b8f412
FEATURE: Make the tag_groups#search endpoint public. (#12643)
The method uses the "TagGroup#visible" method to respect the tag group visibility settings.
2021-04-08 14:23:13 -03:00
Vinoth Kannan 26d7eedf4c
FEATURE: trigger webhook when a user added/removed in a group. (#12653)
Whenever a group is added or removed from a group a webhook event will get triggered if it's active.
2021-04-08 21:16:34 +05:30
David Taylor 38e7fe2770
FIX: Ensure group flair upload is present when deciding type (#12650)
Previously, if the upload_id was present, but the upload was missing, the entire site would give a server error.

We have no foreign keys on this relation, so we have to be able to cope with the situation where the upload_id is present, but the actual upload has been deleted.

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-04-08 15:54:09 +01:00
Penar Musaraj eb7ff576e5
FEATURE: Use SVG icons for some oneboxes (#12654) 2021-04-08 09:58:12 -04:00
Joffrey JAFFEUX 081ada090c
UX: shows a hint when there are more tags than displayed (#12649) 2021-04-08 15:51:31 +02:00
Robin Ward 7e2b7bdd78
DEV: Adds new plugin API support to always show the topic map (#12642)
You can enable this by using the `includePostAttributes` API call with
the value of `topicMap`. This will always show the topic map at the top
of a topic regardless of how many posts there are.
2021-04-08 08:19:25 -04:00
Joffrey JAFFEUX 6081f8e5e9
UX: always display remove emoji btn from emoji-value-list (#12652)
Although if emoji is not editable it should be disabled.
2021-04-08 13:34:26 +02:00
Joffrey JAFFEUX e463f5ce08
DEV: introduces {{not}} helper (#12651)
Code is coming from https://github.com/jmurphyau/ember-truth-helpers, for now I only ported {{not}} which would have tons of use cases in our code base.

We might want to use more helpers in the future, also Ember should have this kind of helpers natively in the future:

- https://github.com/cibernox/rfcs/blob/add-logical-operators-to-templates/text/0000-add-logical-operators.md
- https://github.com/cibernox/rfcs/blob/add-equality-operators-to-templates/text/0000-add-equality-operators.md
- https://github.com/cibernox/rfcs/blob/add-numeric-comparison-operators-to-templates/text/0561-add-numeric-comparison-operators.md
2021-04-08 13:25:16 +02:00
Krzysztof Kotlarek 8b735e6f9e
FIX: dismiss new button for tags on top (#12628)
Currently, new topics for specific tags can be dismissed with the button at the bottom of the page.

When there is more than 15 new topics, we should display the same button at the top as well. It already works in the same manner for categories.
2021-04-08 10:46:08 +10:00
Kris d12707c18e
FIX: mobile topic list number alignment (#12641) 2021-04-07 18:14:12 -04:00
Kris ea2105f3e8
REFACTOR: Consistency, A11Y, and less text for composer toggles (#12627) 2021-04-07 16:15:07 -04:00
David Taylor 9c78bb26d7
FIX: Ensure software-update banner is only shown after 24 hours (#12634)
`isTesting` is a function, so `if(isTesting)` was only checking for the presence of the function. We need to actually evaluate it. Followup to 68a032a734
2021-04-07 17:00:23 +01:00
Roman Rizzi 5e4c0e2caa
FEATURE: Treat site settings as plain text and add a new HTML type. (#12618)
To add an extra layer of security, we sanitize settings before shipping them to the client. We don't sanitize those that have the "html" type.

The CookedPostProcessor already uses Loofah for sanitization, so I chose to also use it for this. I added it to our gemfile since we installed it as a transitive dependency.
2021-04-07 12:51:19 -03:00
Osama Sayegh 2b9ab3a0d9
Revert "FEATURE: Introduce theme/component QUnit tests (#12517)" (#12632)
This reverts commit a53d8d3e61 and 105634435f.

Reverted because the change broke some components. Will be added back in a few days.
2021-04-07 17:45:49 +03:00
Joffrey JAFFEUX 68a032a734
DEV: prevents test timeout (#12631)
Clock manipulation seems not reliable in component tests. This blog post does a great job of explaining it: https://dockyard.com/blog/2018/04/18/bending-time-in-ember-tests

Sadly, we don't have all the "recent" ember test helpers and can't use things like `getSettledState()`.

For now this pattern seems the most reliable and easy to apply, albeit not great.

Note if you wish to reproduce the current timeout, the following command should do it: `QUNIT_SEED=215263717493121190480103670124734840282 rake qunit:test`
2021-04-07 15:50:06 +02:00
Ahmed Gagan 2308a58113
DEV: Added support for custom site setting 'emoji_list' (#12414)
Example usage:

```
best_emojis:
    type: emoji_list
    default: laughing|open_mouth|cry|angry|hugs
    client: true
```
2021-04-07 15:32:05 +02:00
Osama Sayegh 105634435f
FIX: Prevent double slashes in Ember templates paths (#12630)
Follow-up to https://github.com/discourse/discourse/pull/12517
2021-04-07 14:08:29 +03:00
Osama Sayegh a53d8d3e61
FEATURE: Introduce theme/component QUnit tests (#12517)
This commit allows themes and theme components to have QUnit tests. To add tests to your theme/component, create a top-level directory in your theme and name it `test`, and Discourse will save all the files in that directory (and its sub-directories) as "tests files" in the database. While tests files/directories are not required to be organized in a specific way, we recommend that you follow Discourse core's tests [structure](https://github.com/discourse/discourse/tree/master/app/assets/javascripts/discourse/tests).

Writing theme tests should be identical to writing plugins or core tests; all the `import` statements and APIs that you see in core (or plugins) to define/setup tests should just work in themes.

You do need a working Discourse install to run theme tests, and you have 2 ways to run theme tests:

* In the browser at the `/qunit` route. `/qunit` will run tests of all active themes/components as well as core and plugins. The `/qunit` now accepts a `theme_name` or `theme_url` params that you can use to run tests of a specific theme/component like so: `/qunit?theme_name=<your_theme_name>`.

* In the command line using the `themes:qunit` rake task. This take is meant to run tests of a single theme/component so you need to provide it with a theme name or URL like so: `bundle exec rake themes:qunit[name=<theme_name>]` or `bundle exec rake themes:qunit[url=<theme_url>]`.

There are some refactors to internal code that's responsible for processing themes/components in Discourse, most notably:

* `<script type="text/discourse-plugin">` tags are automatically converted to modules.

* The `theme-settings` service is removed in favor of a simple `lib` file responsible for managing theme settings. This was done to allow us to register/lookup theme settings very early in our Ember app lifecycle and because there was no reason for it to be an Ember service.

These refactors should 100% backward compatible and invisible to theme developers.
2021-04-07 10:39:57 +03:00
Bianca Nenciu c10df4b58d
FIX: Make HTML scrubber work with deep HTML (#12619)
SearchIndexer and ReindexSearch used to explode for posts with very
deep or invalid HTML content.
2021-04-07 17:02:00 +10:00
Kris cdd5b60447
UX: icon instead of text for hiding mobile preview (#12625) 2021-04-06 22:22:40 -04:00
Arpit Jalan 21664d8a1c
DEV: add JS test for topic bulk action modal (#12621) 2021-04-07 06:34:36 +05:30
Tobias Eigen 2e17e6269c
FIX: Small tweaks to "no messages" education (#12588)
* Remove "Message" button in quick access menu no messages education
* Reword education prompt
* Remove background colour
2021-04-07 09:28:10 +10:00
Martin Brennan 432b839997
FEATURE: Move site updated modal into a less obtrusive prompt (#12577)
This moves the "This site was just updated" modal asking the user if they want to refresh into a subtle prompt that slides down from the header.

Also in this PR I've added a helper to publish message bus messages in JS tests. So instead of this:

```javascript
// Mimic a messagebus message
MessageBus.callbacks
  .filterBy("channel", "/global/asset-version")
  .map((c) => c.func("somenewversion"));
```

We can have:

```javascript
publishToMessageBus("/global/asset-version", "somenewversion");
```
2021-04-07 08:56:48 +10:00
Bianca Nenciu 1682827f67
FIX: Include watched topics from muted categories in digests (#12602)
Topic that are muted or from muted categories are not included in
digests, but non-muted topics from muted categories should be included.
2021-04-07 00:01:15 +03:00
Penar Musaraj 34596beb52
FIX: Keep current filter while navigating posts in a topic (#12620) 2021-04-06 15:00:25 -04:00
Robin Ward 75a0d9aa01
DEV: Add a new plugin outlet to composer bottom for mobile buttons (#12622) 2021-04-06 14:27:34 -04:00
Penar Musaraj cdb99f012b
FIX: Retain tags when loading a topic draft in composer (#12616) 2021-04-06 11:49:06 -04:00
Penar Musaraj 769b3ba8ae
DEV: Add colors/styling to Ember CLI and qunit tests (#12617) 2021-04-06 11:48:44 -04:00
Neil Lalonde e8a9917db1
FEATURE: Allow setting avatar flair for automatic groups (#12586) 2021-04-06 11:13:06 -04:00
Jessica Hamilton 0052fcf7c4
FEATURE: Retrieve an existing link only invite (#12575)
In Improve invite system, a newly created link only invite cannot
be retrieved via API with the invitee's email once created. A new
route, /invites/retrieve, is introduced to fetch an already
created invite by email address.
2021-04-06 11:01:07 -04:00
Kris 1ebb40a713
FIX: show sign up modal when local logins are disabled (#12611) 2021-04-06 10:31:51 -04:00
Penar Musaraj 98ae4e2829
FIX: Clear state after creating new topic (#12615) 2021-04-06 10:17:14 -04:00
Penar Musaraj f56a22bd2e
FIX: New Topic button regression in tag page (#12613) 2021-04-06 09:31:49 -04:00
Joffrey JAFFEUX f14e898f6f
A11Y: makes replies count a button and not a link (#12570) 2021-04-06 08:27:43 +02:00
Kris 80be6e6949
Overflow on user controls breaks select-kit (#12592) 2021-04-05 23:42:44 -04:00
Kris 6f79c452c2
FIX: bulk select on full-page search (#12593) 2021-04-05 23:11:57 -04:00
Kris f8e5df393d
UX: better position for search bulk select button (#12594) 2021-04-05 23:11:43 -04:00
Joffrey JAFFEUX 89f1bb7d2a
FIX: with vanilla js .href and getAttribute("href") are not equal (#12609)
With a link having an empty href: `<a href>foo</a>` doing
`element.href` will give you the URL of the document, to get the same behavior than `$(element).attr("href")` and get "" you need to do `element.getAttribute("href")`
2021-04-06 00:36:28 +02:00
Jeff Wong 1ceefc22d5
FIX: rake themes:install error if theme cannot be updated (#12605)
Count errors on updating themes in the error bucket. Otherwise,
there was a chance that this could hide errors eg, if a deploy key to a
private repo were to be deleted. Admins probably would like to know about this.
2021-04-05 14:52:50 -07:00
Kris 3a18dd5681
Revert "A11Y: Do not use positive tabindex in composer (#12563)" (#12603)
This reverts commit af879b7851.
2021-04-05 14:36:43 -04:00
Joffrey JAFFEUX 8a36b91c2c
DEV: removes jquery usage from intercept-click (#12600) 2021-04-05 11:59:58 +02:00
Arpit Jalan b230c30249
FIX: downloading watched words was broken (#12578) 2021-04-02 23:04:35 +05:30
Dan Ungureanu bfd0c00944
FEATURE: Copying invite link triggers a save (#12581)
Changing the invite type from link to email and then copying it was
confusing because it gave user the impression that the invite was
updated and the invite link will reflect the latest changes, but it
did not.
2021-04-02 11:19:30 +03:00
Dan Ungureanu 81e5352e01
FIX: Better error message for redeemed invite (#12580)
This commit improves the error message when a user tries to redeem a
completely redeemed invite link.
2021-04-02 11:11:07 +03:00
Kris 42fb806f43
A11Y: make th keyboard accessible + aria attribs (#11895) 2021-04-01 14:19:59 -04:00
Mark VanLandingham 1d2ddbfebf
DEV: Pass editFirstPost action to plugin outlet in topic.hbs (#12582) 2021-04-01 12:20:10 -05:00
Kane York 5d2cd15548
FEATURE: Use appEvents instead of jQuery for composer resizing progress (#12574)
Additionally, add a composer:resize-started event to complement composer:resize-ended.
2021-04-01 13:00:57 -04:00
Arpit Jalan 3db08c073b
FIX: "confirm new email" emails were failing for EmailChangeRequest records with blank requested_by_user_id field (#12579) 2021-04-01 16:39:28 +05:30
Arpit Jalan 61860098d9
UX: move logs/watched_words to customize/watched_words in admin section (#12571)
https://meta.discourse.org/t/where-is-auto-tag-and-auto-replace/184261
2021-04-01 11:44:17 +05:30
Arpit Jalan c478ffc662
FIX: post merging was failing silently (#12566)
https://meta.discourse.org/t/merging-very-long-posts-removes-them/183597
2021-04-01 06:46:18 +05:30
Martin Brennan 28d67b4583
FEATURE: Show an educational message in the quick access menu for personal messages when there are none (#12564)
If the user has not been sent any messages, show a message in the quick access menu with an educational message. If the user can send private messages, also show a link to open the "new message" composer:

This also adds a general improvement to the quick-access-panel, to be able to show an `emptyStateWidget` instead of just a message if there is nothing to show in the panel, as well as initial general styles for empty state.
2021-04-01 10:22:40 +10:00
Krzysztof Kotlarek b317962fe2
FIX: title when YouTube is pasted as the title to composer (#12565)
When the YouTube link is passed to the composer, it should extract the title.

https://meta.discourse.org/t/youtube-link-not-generate-title/183776
2021-04-01 10:16:14 +11:00
Kris af879b7851
A11Y: Do not use positive tabindex in composer (#12563) 2021-03-31 17:33:14 -04:00
Dan Ungureanu e704f0a541
FIX: Autocorrect values for dropdown imported user fields (#12572)
When bulk inviting, the uploaded CSV file may contain wrong values for
the user fields. This tries to automatically correct them by finding
the most similar option (by ignoring the case).
2021-03-31 19:19:57 +03:00
Bianca Nenciu 27b297472a
FIX: Reload messages after a bulk operation (#12569)
It did not show the updated state of the topic until user refreshed the
page.
2021-03-31 16:08:12 +03:00
David Taylor 198c960b52
FIX: Handle staged users as unregistered users for external auth (#12567)
For 'local logins', the UX for staged users is designed to be identical to unregistered users. However, staged users logging in via external auth were being automatically unstaged, and skipping the registration/invite flow. In the past this made sense because the registration/invite flows didn't work perfectly with external auth. Now, both registration and invites work well with external auth, so it's best to leave the 'unstage' logic to those endpoints.

This problem was particularly noticeable when using the 'bulk invite' feature to invite users with pre-configured User Fields. In that situation, staged user accounts are used to preserve the user field data.
2021-03-31 13:40:58 +01:00
Dan Ungureanu e8c576cca9
FIX: User fields are case insensitive in bulk CSV (#12559)
The CSV column title had to be case sensitive match with the name of
the user field which was unnecessary complex.
2021-03-31 13:42:53 +03:00
Dan Ungureanu dce48d8aa7
FIX: Redirect to provided origin after auth (#12558)
It used to redirect to the destination_url cookie which sometimes is set
incorrectly.
2021-03-31 10:23:12 +01:00
Régis Hanol c847f5e8a1
DEV: small refactor of the category_moderators method (#12550)
* DEV: small refactor of the category_moderators method

Used `index_by(&:id)` instead of `map { |u| [u.id, u] }.to_h` thanks to @cvx's recommendation.

Also renamed the `moderators` variable to not clash with method of the same name.
2021-03-30 23:12:53 +02:00
Kris 44587cc4b4
UX: more consistent user control button width (#12553) 2021-03-30 14:18:38 -04:00