Commit Graph

21895 Commits

Author SHA1 Message Date
Robin Ward ce663d67e1 FIX: CSV Exports were throwing errors with invalid dates
This fix will consider any invalid dates to be non-existant.
2020-04-07 14:05:27 -04:00
Neil Lalonde e8fad7a69e
DEV: changes so plugins can customize invites UI (#9365)
* DEV: changes so plugins can customize invites UI

Co-Authored-By: Robin Ward <robin.ward@gmail.com>
2020-04-07 11:58:49 -04:00
Robin Ward 4f42bb1fd2
DEV: Support for `onChange` on `{{text-field}}` (#9362)
* DEV: Support for `onChange` on `{{text-field}}`

This will automatically be debounced and only fired when the value
changes.

There is also `onChangeImmediate` which is not debounced in case you
need that, but in almost all cases when observing text in an element you
should debounce.

* Add cancel for timer
2020-04-07 11:41:21 -04:00
Roman Rizzi e52e7f6e75
FIX: Include pending queued users regardless of their score (#9372) 2020-04-07 11:42:12 -03:00
Dan Ungureanu 0653750fbf
FEATURE: Hash user API keys in the database (#9344)
The 'key' column will be dropped in a future commit.
2020-04-07 16:42:52 +03:00
Martin Brennan 34df9f7908 Revert DEFAULT_SHORTCUTS plugin API-breaking change
* this was done in previous commit
93c38cc175,
  unaware that addKeyboardShortcut in plugin-api.js imports
  bindings from KeyboardShortcuts
2020-04-07 16:27:13 +10:00
Martin Brennan 42c2678d8f
FIX: Show topic level bookmark with reminder modal (#9336)
* When using the topic-level bookmark button or shortcut, we now show the bookmark with reminder modal for consistency.
* When hovering on a bookmark reminder notification where the bookmark has a name, show the name of the bookmark on hover.
2020-04-07 15:43:00 +10:00
Martin Brennan 7e42963590
DEV: Define keyboard shortcuts help onShow, and un-define onClose (#9355)
This is so we don't have a big hash just sitting in the controller definition, it is only created when it is needed. From comment here #9318 (comment)
2020-04-07 14:40:03 +10:00
Martin Brennan 93c38cc175
FEATURE: Bookmark keyboard shortcuts (#9318)
Adds keyboard bindings and associated help menu for selecting reminder type in bookmark modal, and pressing Enter to save.

Introduce the following APIs for `KeyboardShortcuts`:

* `pause` - Uses the provided array of combinations and unbinds them using `Mousetrap`.
* `unpause` - Uses the provided combinations and rebinds them to their default shortcuts listed in `KeyboardShortcuts`.
* `addBindings` - Adds the array of keyboard shortcut bindings and calls the provided callback when a binding is fired with Mousetrap.
* `unbind` - Takes an object literal of a binding map and unbinds all of them e.g. `{ enter: { handler: saveAndClose" } };`
2020-04-07 14:03:15 +10:00
Mark VanLandingham 58bec3b200
DEV: Option for adding an icon in wizard-field-checkboxes component (#9363) 2020-04-06 14:00:55 -05:00
Joffrey JAFFEUX 028915e4b9
FIX: revert inadvertently removed css class (#9360) 2020-04-06 19:22:29 +02:00
Jordan Vidrine 30983021e2
No category styles (#9359)
* UI: "No category styles" apply to category boxes
2020-04-06 12:02:33 -05:00
David Taylor 3814ca06a8
DEV: Allow using .js extension for javascript modules in themes (#9358) 2020-04-06 17:24:59 +01:00
Vinoth Kannan fd39c85c1a FIX: add category hashtags support for sub-sub categories.
Hashtags will include last two levels only (ex: "parent:child").
2020-04-06 20:43:38 +05:30
Joffrey JAFFEUX a947b7b839
FIX: prevents registering multiple `topic-notifications-button:changed` (#9356)
A large topic page will always have the bottom tracking button, and will also have the timeline, meaning we already had 2 tracking events.

But it gets even worse when you know that the timeline button is a component connector which will trigger `didInsertElement` very frequently, meaning we were constantly adding more and more appEvents handlers.
2020-04-06 15:06:26 +02:00
Sam Saffron 81c912bb00
FIX: when loading drafts set the topic
the behavior of loadDraft regressed and it no longer correctly set the topic
model leading to "undefined" when attempting to reply
2020-04-06 16:29:14 +10:00
Dan Ungureanu f8ec5f309a
FIX: Ensure category_id is an integer 2020-04-04 14:20:01 +03:00
Dan Ungureanu b9d411a4eb
FIX: Topic.time_to_first_response should include sub-sub-categories (#9349) 2020-04-04 13:31:34 +03:00
Kris a8002baaed UX: Restyle bookmark reminder modal 2020-04-03 20:49:09 -04:00
Jordan Vidrine 751f229665
UX: removes color on categories if no style chosen (#9346)
* UX: removes color on categories if no style chosen

* Update app/assets/javascripts/discourse/templates/components/categories-only.hbs

* Update messages.hbs

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2020-04-03 15:09:01 -05:00
David Taylor 3cfe086a94
FIX: Limit personal message participants when converting from topic (#9343)
Previously all topic posters would be added which could lead to major performance issues. Now if there are too many posters, only the acting user will be added as a participant.
2020-04-03 16:42:01 +01:00
David Taylor 91fff746a4
FIX: Check active themes for all requests
Previously, the list of active themes was only used in html views. Now we have theme modifiers, themes can affect .json routes.
2020-04-03 15:50:13 +01:00
Joffrey JAFFEUX 883901e4c0
FIX: do not attempt to deselect tags if filter is not empty (#9345) 2020-04-03 16:27:56 +02:00
Daniel Waterworth 76bb01c31c DEV: Increase process_post lock timeout
The process_post job uses CookedPostProcessor which also uses a
DistributedMutex. There's no good reason for the timeout of the outer
lock to be smaller than the timeout of the inner lock.
2020-04-03 13:34:44 +01:00
Vinoth Kannan 82201fa466 FIX: jobs/delete_replies: Add Time+Duration, not Time+Time #9314
Co-authored-by: Kane York <kanepyork@gmail.com>
2020-04-03 09:23:40 +05:30
Sam Saffron 20d8b49add
DEV: remove targetUsernames deprecation
Stable already has this rename, no need to carry the deprecation anymore.
2020-04-03 14:35:30 +11:00
Sam Saffron 83f5f9176b
DEV: only load staff logs when page is visited
Previously we would load admin staff action logs unconditionally as soon
as the controller was instantiated, this is not desirable we only want to
run the query when you visit the route.
2020-04-03 14:13:01 +11:00
Vinoth Kannan 2f9879a9a1 FIX: move total rows count & load more URL inside meta.
We're fetching "total rows count" from root attributes only if meta object not found. 2b78bd01ab/app/assets/javascripts/discourse/models/store.js (L236)
2020-04-03 07:32:50 +05:30
Joffrey JAFFEUX 9c43963ff3
FIX: allows color-input to set hex and color names through input (#9339) 2020-04-02 21:19:31 +02:00
Vinoth Kannan e7e931b70b FIX: track links in onebox body if it's same as header link. 2020-04-03 00:08:29 +05:30
Penar Musaraj 724d2e99de
DEV: Only include "report-sample" CSP directive when reporting is enabled (#9337) 2020-04-02 11:16:38 -04:00
Arpit Jalan ef7753953d FIX: show today's date on /top page period chooser 2020-04-02 20:36:08 +05:30
Zdravko Curic 41510d5b84
FIX: jQuery deprecation warning (#9331) 2020-04-02 09:54:51 -04:00
Vinoth Kannan 37bf38f801 FIX: removing a timer with `duration` doesn't work. 2020-04-02 05:59:35 +05:30
Martin Brennan d261a809e2
FEATURE: Bookmark reminder type changes and bugfixes (#9329)
New Reminder Types
-------------------------------------

* Add a "later this week" reminder which is today + 2 days, will not show if we are on the days Thu-Sun
* Add a "start of next business week" reminder which is 8am Monday

Bugfixes and Tweaks
--------------------------------------

* Move dates out of translation for reminder types and yield HTML for tap-tile for more customizable content and styling
* Make sure double clicking the bookmark icon in quick access takes users to the new bookmarks-with-reminders page
* Sane default to 8am (start of day) for custom reminder with no time
2020-04-02 09:57:48 +10:00
Sam Saffron cade4957ae
DEV: don't use _ cause property is observed
Followup on fcc5ef96
2020-04-02 10:22:13 +11:00
Kane York cdaa60b56b FEATURE: Allow admins to disable self-service account deletion
https://meta.discourse.org/t/-/146276
2020-04-01 15:16:07 -07:00
Penar Musaraj b82f6098ce
UX: Remove share as link fallback on touch devices (#9332) 2020-04-01 15:18:30 -04:00
Mark VanLandingham 65d9a9c1ce
DEV: Create wizard-field-checkboxes component (#9333) 2020-04-01 13:30:38 -05:00
tshenry 32e14045c4
UX: use color variable for background of shortcut keys 2020-04-01 09:27:14 -07:00
Mark VanLandingham 689c61b462
DEV: Allow plugins to add wizard steps after specific steps (#9315) 2020-04-01 08:36:50 -05:00
Roman Rizzi b2f30aa0b5
FIX: FlagSockpuppets should not flag a post if a post of that user was already rejected by staff (#9328)
* FIX: FlagSockpuppets should not flag a post if a post of that user was already rejected by staff

* Update spec/services/flag_sockpuppets_spec.rb

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

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2020-04-01 09:20:45 -03:00
Sam Saffron a098464af3
FIX: ninja edit for replies not working
There is an edge case, in some cases when pulling a post from the store
there is no topic, this ensures it is loaded correctly.
2020-04-01 16:40:55 +11:00
Martin Brennan debed81022 Get rid of named param double reference in UserBookmarkList 2020-04-01 15:04:04 +10:00
Martin Brennan c07dd0d22a
FEATURE: Add lazy loading to user bookmarks list (#9317)
This is so users with huge amount of bookmarks do not have to wait a long time to see results.

* Add a bookmark list and list serializer to server-side to be able to handle paging and load more URL
* Use load-more component to load more bookmark items, 20 at a time in user activity
* Change the way current user is loaded for bookmark ember models because it was breaking/losing resolvedTimezone when loading more items
2020-04-01 14:09:07 +10:00
Sam Saffron b8d2261db9
FIX: correctly load drafts based of id
Previously we relied on race conditions to correctly open a draft, so this
broke.

New code is deliberate.

Also corrects missing observers on composer action
2020-04-01 14:23:26 +11:00
Blake Erickson 04b431b6a4 FIX: Staged users getting user_linked and user_quoted emails
This fix ensures that if a staged user is linked to or quoted they won't
be emailed about it.

A staged user could email into a category, and another user could quote
them inside of a completely different category and we don't want a
staged user to receive an email for this.

Bug report:

https://meta.discourse.org/t/-/145202/9
2020-03-31 20:17:56 -06:00
Kris 8bd693891a Follow-up to 8a52756 for safari 2020-03-31 21:57:09 -04:00
Martin Brennan 771dec9a44 Fix currentUser not being loaded correctly in bookmark.js
* this caused errors because resolvedTimezone was no longer
  accessible
2020-04-01 11:13:53 +10:00
Kris 8a527567d3 UX: Break very long words in titles within menus 2020-03-31 20:55:11 -04:00
Martin Brennan b79ea986ac
FEATURE: High priority bookmark reminder notifications (#9290)
Introduce the concept of "high priority notifications" which include PM and bookmark reminder notifications. Now bookmark reminder notifications act in the same way as PM notifications (float to top of recent list, show in the green bubble) and most instances of unread_private_messages in the UI have been replaced with unread_high_priority_notifications.

The user email digest is changed to just have a section about unread high priority notifications, the unread PM section has been removed.

A high_priority boolean column has been added to the Notification table and relevant indices added to account for it.

unread_private_messages has been kept on the User model purely for backwards compat, but now just returns unread_high_priority_notifications count so this may cause some inconsistencies in the UI.
2020-04-01 09:09:20 +10:00
Arpit Jalan b2a0d34bb7
FEATURE: add setting `auto_approve_email_domains` to auto approve users (#9323)
* FEATURE: add setting `auto_approve_email_domains` to auto approve users

This commit adds a new site setting `auto_approve_email_domains` to
auto approve users based on their email address domain.

Note that if a domain already exists in `email_domains_whitelist` then
`auto_approve_email_domains` needs to be duplicated there as well,
since users won’t be able to register with email address that is
not allowed in `email_domains_whitelist`.

* Update config/locales/server.en.yml

Co-Authored-By: Robin Ward <robin.ward@gmail.com>
2020-03-31 23:59:15 +05:30
David Taylor 0e3fa4072f FIX: Bypass serviceworker cache for auth routes
This avoids samesite cookie-related issues in iOS PWAs during the authentication flow
2020-03-31 14:24:02 -03:00
Joffrey JAFFEUX 5112648796
fix documentation (#9327) 2020-03-31 17:19:47 +02:00
Joffrey JAFFEUX f724cf1cfe
UX: minor tweaks to users directory last updated at styling (#9322) 2020-03-31 10:12:52 +02:00
Joffrey JAFFEUX acc0a9673e
FIX: the correct action for group-member-dropdown is now actOnGroup (#9320) 2020-03-31 09:21:59 +02:00
Joffrey JAFFEUX 4f6d722e45
DEV: adds a new dropdown widget usable in any widget (#9297) 2020-03-31 09:13:16 +02:00
Joffrey JAFFEUX 9bbaaea1e8
UX: better customize emoji layout on mobile (#9319) 2020-03-31 08:55:47 +02:00
Krzysztof Kotlarek a0f59a55cc
FIX: when a post is moved copy notifications level (#9311)
This is a revert of 2c011252f1

More information on meta: https://meta.discourse.org/t/when-a-reply-is-moved-to-a-new-topic-the-followers-of-the-previous-topic-are-automatically-follower-of-the-new-topic-as-well/130025
2020-03-31 16:19:47 +11:00
Sam Saffron fcc5ef9625
FIX: when switching reply type update options
Previously we were not correctly updating reply types leading to inconsistent
behavior when using drop down in composer (for reply type)
2020-03-31 14:40:57 +11:00
Kris d282233d31 UX: Add flair styles to latest topic list 2020-03-30 21:40:11 -04:00
Sam Saffron a34711c23a
FIX: do not save draft while it is loading
When editing a post we were incorrectly saving a draft prior to user typing

This caused a bloat in the amount of drafts saved per user and inconsistency
around behavior of "escape" button.

It also lead to lots of warnings about draft conflicts when copying stuff
between posts.

The code is improved to use promises more appropriately, however further
changes are needed to clean up internals so methods consistently return
promises.

Too many methods in the controller sometimes return a promise and sometimes
an object. Long term the methods will become async and all of this will be
corrected.
2020-03-31 11:49:10 +11:00
Joffrey JAFFEUX 5b6cdd6fb5
DEV: adds a loading property to d-button (#9072)
Usage:

```
{{d-button icon="times" label="foo.bar" isLoading=true}}
```

Note that  a button loading without an icon will shrink text size to prevent button to jump in size.

A button while loading is disabled.
2020-03-30 23:17:00 +02:00
Kane York 2a2555e598 DEV: Partial 'block-indentation' linting fixes 2020-03-30 14:13:33 -07:00
Kane York 2afb95fe3e DEV: Enable and fix the 'no-multiple-empty-lines' lint 2020-03-30 14:13:33 -07:00
Kane York f900efaa4a DEV: composer.hbs: fix indentation 2020-03-30 14:13:33 -07:00
Kane York 1703270055 DEV: Enable and fix no-trailing-spaces lint 2020-03-30 14:13:33 -07:00
Neil Lalonde 29e733832d
FIX: error when changing a topic's category and creating a tag 2020-03-30 16:43:01 -04:00
Joffrey JAFFEUX 339ddb8701
FIX: makes clicking and displaying date picker more reliable (#9302) 2020-03-30 22:02:24 +02:00
Robin Ward db35baba26 FEATURE: Display "Last Updated At" on user directory 2020-03-30 14:34:48 -04:00
Joffrey JAFFEUX 0996c3b7b3
FEATURE: allows multiple custom emoji groups (#9308)
Note: DBHelper would fail with a sql syntax error on columns like "group".

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2020-03-30 20:16:10 +02:00
Joffrey JAFFEUX fa5ba6beb8
FIX: ensures mini-tag-chooser display min tags req if no selection (#9303) 2020-03-30 19:34:53 +02:00
Joffrey JAFFEUX a3345057f2
FIX: prevents rendering empty timeline-controls (#9304)
The streamlength/height code when true would return just after we had inserted the timeline-controls, resulting, on topic-progress event to display an empty timeline-controls when clicked.

I think this code in unecessary and we should only rely on the code in `hideProgress` which will currenly hide the progress is the stream has only one post displayed on desktop (always shown on mobile).
2020-03-30 19:17:08 +02:00
Joffrey JAFFEUX aeaea3c154
FIX: correctly take category/group filters into csv export (#9300) 2020-03-30 19:08:47 +02:00
Joffrey JAFFEUX f8cb46c0e1
FIX: prevents exception when clicking component title above ace editor (#9309) 2020-03-30 18:55:15 +02:00
Joffrey JAFFEUX 96e841a635
DEV: trigger :username_changed when a user is renamed (#9301) 2020-03-30 18:02:34 +02:00
Zdravko Curic d0d5f0c912
DEV: Add Ember.PromiseProxyMixin to ember modules (#9312) 2020-03-30 11:37:14 -04:00
Joffrey JAFFEUX 2b78bd01ab
FIX: allows adapters to define a custom primaryKey (#9254) 2020-03-30 15:23:59 +02:00
Penar Musaraj 92e81d2ae5 UX: Fix composer position on iPads with a hardware keyboard
Adds padding to the composer when the keyboard accessory bar is shown (i.e. submit button no longer hides behind said bar)
2020-03-30 09:23:00 -04:00
Arpit Jalan 435fe8ac6e FIX: allow invite email field to be blank for invite tokens 2020-03-30 10:35:49 +05:30
Vinoth Kannan 7a32a99595 FIX: Quoting a nested quote should preserve original post info. 2020-03-28 22:24:43 +05:30
Penar Musaraj a3d47f1aad UX: Better spacing for icons in select-kit labels
Followup to c14e3adac5
2020-03-27 16:06:40 -04:00
Michael Brown 9026c55fe4
FIX: custom SQL with a trailing comment might break BadgeGranter SQL (#9285)
For example given a custom badge with SQL:
```
SELECT 1
-- I am a comment
```

You end up with

```
FROM (SELECT 1
-- I am a comment) q
```

This fix adds newlines so you end up with the now-valid:

```
FROM (
  SELECT 1
-- I am a comment
) q
```
2020-03-27 14:16:14 -04:00
Arpit Jalan 702879cbda FIX: check for presence of name before normalizing 2020-03-27 23:01:48 +05:30
Joffrey JAFFEUX 38e347aee6
DEV: allows to decorate topic list item (#9294)
Co-authored-by: David Taylor <david@taylorhq.com>
2020-03-27 16:50:31 +01:00
Mark VanLandingham c721bdb300
DEV: Add build_plugin_html to wizard head (#9293) 2020-03-27 10:02:48 -05:00
Joffrey JAFFEUX eda8f319a2
FIX: keep date object (#9292) 2020-03-27 14:15:14 +01:00
Joffrey JAFFEUX 1b09a0cd17
UX: improves date-time-input on mobile (#9291) 2020-03-27 13:29:58 +01:00
David Taylor e6e6d20912
Revert "DEV: Enable and fix link-href-attributes lint"
Introducing an href attribute on the upload button caused the page to reload when clicked

This reverts commit a17fa222af.
2020-03-27 11:43:00 +00:00
Kris 33350c31c0
UX: Align bulk select menu toggle relative to main wrapper when possible 2020-03-26 19:15:33 -04:00
Sam Saffron bed3f7f69a
DEV: long poll for 20 extra minutes when user stops interacting
We have no way of detecting if a browser window is behind another window
or off screen on a virtual desktop.

In some cases we may want events to be delivered quicker to the browser.
Specifically a user may still have a window in view but is not interacting.

This gives users 20 minutes of extra "long polling time" prior to shifting
to short polling.
2020-03-27 10:14:13 +11:00
Vinoth Kannan 257f59f366 FEATURE: option to update child theme components via theme CLI.
423ce44112
2020-03-27 03:41:56 +05:30
Jarek Radosz 67b34600d5
DEV: Use `type` instead of `method` in ajax calls (#8974)
Even though `type` is an alias for `method`, we have custom logic in `/discourse/lib/ajax` that checks only `type`, and ~200 other ajax calls in the codebase already use `type` param.
2020-03-26 21:00:10 +01:00
Kane York 17211b940f DEV: Enable and fix the 'no-duplicate-attributes' lint 2020-03-26 12:31:34 -07:00
Kane York 07dc8d20c4 DEV: Enable and fix the 'require-iframe-title' lint 2020-03-26 12:31:34 -07:00
Kane York a17fa222af DEV: Enable and fix link-href-attributes lint 2020-03-26 12:31:34 -07:00
Joffrey JAFFEUX ef3d6d6580
FIX: groups filtering input was causing a full page reload (#9282) 2020-03-26 15:46:31 +01:00
Bianca Nenciu 7952cbb9a2
FIX: Perform crop using user-specified image sizes (#9224)
* FIX: Perform crop using user-specified image sizes

It used to resize the images to max width and height first and then
perform the crop operation. This is wrong because it ignored the user
specified image sizes from the Markdown.

* DEV: Use real images in test
2020-03-26 16:40:00 +02:00
Roman Rizzi 6bceb1d15a
FIX: Display small post actions when embedding a topic (#9278) 2020-03-26 09:07:41 -03:00
Sam Saffron e62071830d
DEV: prefer Date.now() over new Date().getTime()
`New Date().getTime()` is both uglier and slower than `Date.now()`

`Date.now()` is available on all the browsers we support.
2020-03-26 17:36:53 +11:00