Commit Graph

22015 Commits

Author SHA1 Message Date
Martin Brennan 452d0c868f
FIX: Ensure first post is loaded before trying to bookmark topic (#9382)
Load first post if not loaded when trying to bookmark topic

* if the first post was not loaded we could not bookmark it because
  now we call the toggleBookmarkReminder function on an actual post
  to open the modal window
* add a firstPost function to the topic model to get the first post
  from the stream if it is loaded and if not do a GET request to load
  it
* use the firstPost promise when bookmarking topic
2020-04-09 09:42:03 +10:00
Kane York 138d4aebde FEATURE: Webhooks and Event for user being granted a badge
Adding a webhook for badge revocation is left for future work as it's relatively rare.
2020-04-08 14:38:30 -07:00
Kris 14467757df UX: Adjust noscript footer nav 2020-04-08 17:29:13 -04:00
Penar Musaraj c3593dd9e2
DEV: Replace jquery.putCursorAtEnd (#9390) 2020-04-08 16:13:02 -04:00
Kane York 3b7ba8ec99 FIX: WCAG-AA compliant topic list heatmap colors
Color #ec7213: 3.0, Bold - AA Large Pass
Color #b06318: 4.50, Normal - AA Pass
Color #93704a: 4.51, Normal - AA Pass

Used the Chrome Inspector color picker curves to preserve the hue and make minimally invasive changes to the coloring.
2020-04-08 11:58:44 -07:00
Kane York abdc10ae70 FIX: Labels for modal close and dismiss-error buttons 2020-04-08 11:56:29 -07:00
Dan Ungureanu 73d71e3fee
FEATURE: Show noscript view to unsupported browsers (#9373) 2020-04-08 20:24:18 +03:00
Robin Ward e1f8014acd
FEATURE: Support for publishing topics as pages (#9364)
If the feature is enabled, staff members can construct a URL and publish a
topic for others to browse without the regular Discourse chrome.

This is useful if you want to use Discourse like a CMS and publish
topics as articles, which can then be embedded into other systems.
2020-04-08 12:52:36 -04:00
Dan Ungureanu b64b590cfb
FIX: Add index on user_api_keys.key_hash (#9387) 2020-04-08 19:49:18 +03:00
Penar Musaraj 84f344c5d1 FIX: ensure .gap width does not exceed window width
Fixes an issue where the viewport was horizontally scrollable on iPad.
2020-04-08 11:38:25 -04:00
Jarek Radosz ae1a391377
FIX: Quoting posts (#9378)
Fixes to the quote feature. Most important changes listed below:

* FIX: Correctly attribute quotes when using Reply button
* FIX: Correctly attribute quotes when using replyAsNewTopic
* FIX: Allow quoting a quote
* FIX: Correctly mark quotes as "full"
* FIX: Don't try to create a quote if it's empty
* DEV: Remove an obsolete method `loadQuote`
  It isn't used in core anymore, the only use in core has been removed over 4 years ago in 3251bcb. It's not used in any plugins in all-the-plugins and all references to it on GitHub are from outdated forks (https://github.com/search?q=%22Post.loadQuote%22&type=Code)
2020-04-08 16:28:23 +02:00
Roman Rizzi 8e1bdc9458
FIX: Prevent low score flags from auto-closing a topic if the reviewable default visibility is higher than low (#9375) 2020-04-08 10:44:31 -03:00
Sam Saffron b824898f61
FIX: respect automatic group membership when sso changes email
Previously we were only updating group membership when a user record was
first created in an SSO setting.

This corrects it so we also update it if SSO changes the email
2020-04-08 16:33:50 +10:00
Sam Saffron 0375a5ac0b
DEV: reduce logging when no external id is specified
Previously we were returning an unknown sso error and logging a message
when external id was blank. This noise is not needed.
2020-04-08 12:42:28 +10:00
Arpit Jalan 236833ed5d FIX: redirect `/my/*path` to `/login-preferences` on client side 2020-04-08 07:10:58 +05:30
Jordan Vidrine 0991c4ae7e
FIX: Widen modal on desktop 2020-04-07 17:44:57 -05:00
Kane York ed95a6005b FEATURE: screenreader landmarks for main, suggested topics
In order to avoid a boatload of attributeBindings, I moved the root
element of the suggested-topics component into the template. Also,
autoformat their hbs files.

Testing info: https://www.scottohara.me/blog/2018/03/03/landmarks.html#using-screen-readers-to-navigate-landmarks

Additionally, flag modals with aria-modal=true to avoid the screenreader
accidentally escaping the modal. There's no need to ever toggle the
attribute to false, because we display:none the modal root when it's
closed.
2020-04-07 15:42:03 -07:00
Neil Lalonde c45574c9e7
FIX: exclude private messages from TL3 requirements
It wasn't intended that people should be able to earn trust level
3 without participating in public topics. When counting topic
views and likes given/received, don't count private topics.
2020-04-07 17:36:07 -04:00
Krzysztof Kotlarek a811976023
FIX: reset gravatar cache by adding random param to URL (#9370)
Users noticed that sometimes, avatar from Gravatar is not correctly updated - https://meta.discourse.org/t/updated-image-on-gravatar-not-seeing-it-update-on-site/54357

A potential reason for that is that even if you update your avatar in Gravatar, URL stays the same and if the cache is involved, service is still receiving the old photo.

For example. In my case, when I click the button to refresh avatar the
new Upload record is created with `origin` URL to new avatar, and `url` to
old one

I made some tests in the rails console and adding random param to Gravatar URL is deceiving cache and correct, the newest avatar is downloaded
2020-04-08 07:35:42 +10:00
Jordan Vidrine 3f49b13e5f
FIX: Fix untitled/long links extending out box 2020-04-07 13:46:40 -05:00
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
Sam Saffron 25f1f23288
FEATURE: Stricter rules for user presence
Previously we would consider a user "present" and "last seen" if the
browser window was visible.

This has many edge cases, you could be considered present and around for
days just by having a window open and no screensaver on.

Instead we now also check that you either clicked, transitioned around app
or scrolled the page in the last minute in combination with window
visibility

This will lead to more reliable notifications via email and reduce load of
message bus for cases where a user walks away from the terminal
2020-03-26 17:36:52 +11:00
Sam Saffron ecbccab159
FEATURE: invite_code is case-insensitive
Previously we required exact casing for invite code, this can cause a lot
of confusion. Relax the requirement.
2020-03-26 13:44:02 +11:00
Kris b2aa203e67
Add additional classes to topic-map stats 2020-03-25 21:40:51 -04:00
Martin Brennan 097851c135
FIX: Change secure media to encompass attachments as well (#9271)
If the “secure media” site setting is enabled then ALL files uploaded to Discourse (images, video, audio, pdf, txt, zip etc. etc.) will follow the secure media rules. The “prevent anons from downloading files” setting will no longer have any bearing on upload security. Basically, the feature will more appropriately be called “secure uploads” instead of “secure media”.

This is being done because there are communities out there that would like all attachments and media to be secure based on category rules but still allow anonymous users to download attachments in public places, which is not possible in the current arrangement.
2020-03-26 07:16:02 +10:00
Robin Ward a12c7fcb2f Revert "FIX: Allow JS transpilation"
This reverts commit 6d1263812f.
2020-03-25 16:13:01 -04:00
Robin Ward 6d1263812f FIX: Allow JS transpilation 2020-03-25 16:05:16 -04:00
Kane York 6a1fe9ff87
FIX: Use 1 column instead of 4 for permalink destination (#9260) 2020-03-25 11:30:39 -07:00
Vinoth Kannan b09f79366e UX: disallow tag creation in "default tags" site setting choosers. 2020-03-25 23:37:46 +05:30
Joffrey JAFFEUX 6acbd1bedf
DEV: allows time-input to be clearable (#9277) 2020-03-25 19:05:11 +01:00
Vinoth Kannan dbc323e12a Fix the typo. 2020-03-25 23:32:32 +05:30
Joffrey JAFFEUX 105cc5505c
FIX: ensures we have a date object in date-time-input (#9276) 2020-03-25 17:57:43 +01:00
Robin Ward f2f8ede22c Last ES6 files in our app/assets/javascripts 2020-03-25 12:30:20 -04:00
romanrizzi 55b8620b43 FIX: TopicEmbed#absolutize_urls was trying to modify a frozen string 2020-03-25 12:57:54 -03:00
Dan Ungureanu 3ae26c6c59
FEATURE: List search menu shortcuts in instructions modal (#9273) 2020-03-25 17:11:33 +02:00
Joffrey JAFFEUX 7d7c5641b4
DEV: allows to use routeAction from components/widgets (#9267)
ATM this is only usable as a helper in templates.
2020-03-25 15:51:30 +01:00
David Taylor d62d258fe5
Revert "FIX: word boundary regex (\b) not working in Unicode languages. (#9163)"
Lookbehind regex is not supported in Firefox or IE11

This reverts commit 572bb5988f.
2020-03-25 14:34:45 +00:00
Jordan Vidrine 9521a88984 UI: Fix 'lock' icon spacing in category dropdown 2020-03-25 08:59:00 -05:00
Vinoth Kannan 572bb5988f
FIX: word boundary regex (\b) not working in Unicode languages. (#9163) 2020-03-25 18:39:19 +05:30
Joffrey JAFFEUX cff9d4726c
FIX: ensures search-menu is not briefly showing previous results (#9272) 2020-03-25 10:00:48 +01:00
Dan Ungureanu 70012f2027
FEATURE: Navigate through search results using J/K (#9264) 2020-03-25 15:45:35 +11:00
Jeff Wong 7282435e17 FEATURE: Unassign the review queue topic when a flag is handled 2020-03-24 14:57:44 -07:00
Joffrey JAFFEUX 2501c0cd0f
FIX: user-selector was not excluding currentUser (#9266)
concat doesn't mutate the variable so it has to be assigned.
2020-03-24 22:17:26 +01:00
Robin Ward a11938d58d Rename more es6 files to js 2020-03-24 16:32:56 -04:00
Robin Ward 4876884fd1 More JS files 2020-03-24 16:18:56 -04:00
Robin Ward 0fd0a04019 This should be js 2020-03-24 16:13:30 -04:00
Robin Ward 4d190c93b6 Migrate ember-addons from ES6 -> JS 2020-03-24 16:11:56 -04:00
Jordan Vidrine 9659da1044
UI: Update margin select kit category name 2020-03-24 12:40:11 -05:00
David Taylor c939001876
DEV: Bump theme compiler version for CSP change
We need to regenerate cached themes, so that the JS paths are updated to include the subfolder prefix

Followup to 8e98f39d9f
2020-03-24 15:52:14 +00:00
Joffrey JAFFEUX 58ced428ee
FIX: race conditions in search menu (#9262)
Race conditions could lead the previous query search term to be used in the next query. This commit also attempts to simplify code.
2020-03-24 15:16:42 +01:00
Bianca Nenciu 61c1af0124 SECURITY: Ensure user can see group and group members 2020-03-24 11:59:41 +02:00
Bianca Nenciu d8640fd042
DEV: Move requested_group_id custom field from post to topic (#9127)
Follow-up-to accbbded15
2020-03-24 11:12:52 +02:00
Sam Saffron 46a9622246
FIX: prevent scheduled publishing to deleted category
We missed a dependency which left timers firing on missing categories.

Co-authored-by: tshenry
2020-03-24 16:59:42 +11:00
Martin Brennan b8b29e79ad
FIX: Improve user timezone saving (#9230)
Based on issues identified in https://meta.discourse.org/t/improved-bookmarks-with-reminders/144542/20

* Implement the resolvedTimezone() function on the user model where we return the user's timezone if it has been set, or we guess it using moment and save it to the user using an update call if it has not yet been set. This covers the cases of users who do not log out/in often who will not get their timezone set via login. This also makes sure the guess + save is done in a non-obtrusive way not on every page -- only when it is needed.

* Before if a user's timezone was blank when they visited their profile page we were autofilling the dropdown with the guessed timezone from moment. However this was confusing as it would appear you have that timezone saved in the DB when you really didn't. Now we do not autofill the dropdown and added a button to automatically guess the current timezone to make everything more explicit.
2020-03-24 11:39:09 +10:00
Kane York 4b8acce92b FIX: Check for permalinks before showing the 404 page
Limitations: the user profile "open external links in new tab setting" is
slightly broken for "External URL" permalinks.

Remove the copy from the admin permalinks page stating that this doesn't work.
2020-03-23 16:31:07 -07:00
Vinoth Kannan dc1836573d
UX: display avatar flair in categories route topic list items (#9197) 2020-03-24 01:13:25 +05:30
Robin Ward 27641f21e4 Migrate `discourse-common` from es6 -> js 2020-03-23 15:05:58 -04:00
Robin Ward 7f3bb06ac7 FIX: Wizard tests were missing 2020-03-23 14:25:25 -04:00
Robin Ward 1ac0242201 Convert wizard es6 files to js 2020-03-23 14:15:16 -04:00
Kris 39dde33cbb UX: Larger tap areas for profile panel in user menu on mobile devices 2020-03-23 13:25:33 -04:00
Joffrey JAFFEUX 48c1de4836
DEV: adds afterCreate/beforeUpdate hooks to rest models (#9253)
We already have beforeCreate and afterUpdate and it seems these hooks can be useful and it's also unexpected to not have parity on this.
2020-03-23 16:58:40 +01:00
Arpit Jalan e58f0adfcc FIX: respect `prioritize_username_in_ux` setting on /about page 2020-03-23 20:28:01 +05:30
Dan Ungureanu 5715f0ad01
UX: Hotkey K can select partial posts
When no post is selected, K selects first partial post and J selects
first full post.
2020-03-23 14:05:29 +02:00
David Taylor 5db41cd578
SECURITY: Respect topic permissions when loading bookmark metadata
Co-authored-by: Martin Brennan <martin@discourse.org>
Co-authored-by: Sam Saffron <sam.saffron@gmail.com>
2020-03-23 11:30:48 +00:00
David Taylor 5ff505cea6
SECURITY: Respect topic permissions when loading draft metadata
Co-authored-by: Sam Saffron <sam.saffron@gmail.com>
2020-03-23 11:30:40 +00:00
Joffrey JAFFEUX 3f9b922d20
FIX: middle click was reading every notifications (#9252) 2020-03-23 13:28:16 +02:00
Roman Rizzi c4bc734b11
FIX: Backfill topic timer duration (#9249) 2020-03-23 09:38:18 +05:30
Jeff Wong 3189dab622 FIX: correctly remove authentication_data cookie on oauth login flow
Additionally correctly handle cookie path for authentication_data

There were two bugs that exposed an interesting case where two discourse
instances hosted across two subfolder installs in the same domain
with oauth may clash and cause strange redirection on first login:

Log in to example.com/forum1. authentication_data cookie is set with path /
On the first redirection, the current authentication_data cookie is not unset.
Log in to example.com/forum2. In this case, the authentication_data cookie
is already set from forum1 - the initial page load will incorrectly redirect
the user to the redirect URL from the already-stored cookie, to /forum1.

This removes this issue by:

* Setting the cookie for the correct path, and not having it on root
* Correctly removing the cookie on first login
2020-03-21 14:34:25 -07:00
Blake Erickson c97244ca11 FIX: post edited webhook does not reflect updated topic title
This fix ensures that when a topic title is edited the new title shows
up in the post webhook instead of the old title.

Rather than passing in the old topic object to the PostRevisor the
PostRevisor initializer will load the updated topic object inside of the
initializer if you don't pass it in. This will allow the post_edited
webhook to have the correct topic values.

Original bug reported at:

https://meta.discourse.org/t/post-edited-webhook-does-not-reflect-updated-topic-title/144722
2020-03-21 07:43:11 -06:00
David Taylor 3215f2b6ee
FIX: Permalinks should redirect to category URL including the ID
This is a temporary fix. Urls for third-level categories should function without the id. Once that is fixed, this change can be reverted
2020-03-20 22:06:20 +00:00
Jeff Wong 4ecc0a25ae Revert "FIX: correctly remove authentication_data cookie on oauth login flow (#9238) (#9251)"
This reverts commit beaeb0c4b2.
2020-03-20 14:37:55 -07:00
Jeff Wong beaeb0c4b2
FIX: correctly remove authentication_data cookie on oauth login flow (#9238) (#9251)
Attempt 2, with more test.

Additionally correctly handle cookie path for authentication_data

There were two bugs that exposed an interesting case where two discourse
instances hosted across two subfolder installs in the same domain
with oauth may clash and cause strange redirection on first login:

Log in to example.com/forum1. authentication_data cookie is set with path /
On the first redirection, the current authentication_data cookie is not unset.
Log in to example.com/forum2. In this case, the authentication_data cookie
is already set from forum1 - the initial page load will incorrectly redirect
the user to the redirect URL from the already-stored cookie, to /forum1.

This removes this issue by:

Setting the cookie for the correct path, and not having it on root
Correctly removing the cookie on first login
2020-03-20 14:03:38 -07:00
Robin Ward 0d3386d255 Revert "FIX: correctly remove authentication_data cookie on oauth login flow (#9238)"
This reverts commit a1f9b1a7fc.

This might have caused a problem with social logins. We are confirming
via this revert and will follow up.
2020-03-20 15:25:10 -04:00
Robin Ward 07813c4a91
Convert select-kit from es6 to js (#9246)
* Convert select-kit from es6 to js

* Hide more git blames
2020-03-20 12:40:32 -04:00
Kris 69df19a663 UX: Disable highlight animation on deleted posts 2020-03-20 12:15:58 -04:00
romanrizzi cfec10a568 FIX: Moderators should be able to review flagged PMs since this has always been like this 2020-03-20 12:28:36 -03:00
Robin Ward c150566506
Migrate pretty-text to `.js` extensions (#9243) 2020-03-20 09:55:42 -04:00
Daniel Waterworth 1b24a7b993 FIX: Include entire slug path in permalinks
This is a temporary fix since these URLs should contain the id as well.
2020-03-20 10:43:13 +00:00
Vinoth Kannan f3ddc36ac6 FIX: update `email_digests` user option when `default_email_digest_frequency` updated. 2020-03-20 00:55:47 +05:30
Roman Rizzi 080960a15e
FIX: Show the envelope icon when the flagged post is a PM. Flagged PM must be exclusively reviewed by admins (#9232) 2020-03-19 15:12:42 -03:00
Rafael dos Santos Silva 226d81fcc5 FIX: Fix a PostgreSQL error when a draft was concurrently created
Moves the new draft creation concurrency handling to PostgreSQL
so the database doesn't error out when the draft is being created
by multiple backends.

Also removes `retry_not_unique` parameter from Draft#set` which is
not called anywhere.

Also fixes a draft update not bumping the `updated_at` column.
2020-03-19 13:31:11 -03:00
Vinoth Kannan f6d6f1701f FIX: use the new duration attribute in `set_or_create_timer` method.
New `duration` attribute is introduced for the `set_or_create_timer` method in the commit aad12822b7 for "based on last post" and "auto delete replies" topic timers.
2020-03-19 21:45:05 +05:30
David Taylor 22d5ba0f77
DEV: Load plugin stylesheets before theme stylesheets (#9240)
This is a more logical order, since themes are more lightweight than plugins, and are often used to augment plugin styles
2020-03-19 16:02:12 +00:00
Jeff Wong a1f9b1a7fc
FIX: correctly remove authentication_data cookie on oauth login flow (#9238)
Additionally correctly handle cookie path for authentication_data

There were two bugs that exposed an interesting case where two discourse
instances hosted across two subfolder installs in the same domain
with oauth may clash and cause strange redirection on first login:

Log in to example.com/forum1. authentication_data cookie is set with path /
On the first redirection, the current authentication_data cookie is not unset.
Log in to example.com/forum2. In this case, the authentication_data cookie
is already set from forum1 - the initial page load will incorrectly redirect
the user to the redirect URL from the already-stored cookie, to /forum1.

This removes this issue by:
* Setting the cookie for the correct path, and not having it on root
* Correctly removing the cookie on first login
2020-03-19 09:00:46 -07:00
Vinoth Kannan aad12822b7
FEATURE: automatically delete replies on a topic after N days. (#9209) 2020-03-19 21:06:31 +05:30
Martin Brennan 8769ca08bb SECURITY: Prevent access to other user's bookmark lists 2020-03-19 10:59:32 +10:00
Rafael dos Santos Silva 8ae472bc41 FEATURE: Google Calendar doesn't support URL in iCalendar, add fallback description 2020-03-18 17:51:16 -03:00
Rafael dos Santos Silva d6838608ff FEATURE: iCalendar feed for Bookmark reminders 2020-03-18 17:51:16 -03:00
Blake Erickson 1c7680c568 FIX: Use id instead of elementId in hbs file
I think this issue is caused by a current regression in ember

https://github.com/emberjs/ember.js/issues/18147

but using `id` works just fine in templates. This also appears to be the
only template file we are using `elementId` directly in the template.
2020-03-18 13:44:35 -06:00
Martin Brennan 9b4b690bba FIX: Prevent mobile bookmark modal cutoff 2020-03-18 15:54:50 +10:00
Kane York ccc9b64a99 FIX: theme-javascripts using incorrect subfolder setting 2020-03-17 19:09:06 -07:00
Martin Brennan e2ce12d414
FIX: Broken computing of userHasTimezone in bookmark modal and missing tap-tile templates for regular users (#9229)
Based on reports here https://meta.discourse.org/t/improved-bookmarks-with-reminders/144542

* Because the `userHasTimezone` property was computed and we were checking on an (essentially) global object, ember was not aware that the user timezone had changed because it changed in a different place. instead set the timezone as internal state for the modal on show and base the computed property off of that so it mutates correctly
* The tap-tile components were in the admin folder completely unnecessarily, move them out into the main discourse folder otherwise noone else can use the new bookmarks (icon + text is missing)
2020-03-18 11:12:23 +10:00
Vinoth Kannan 48d690ae01 FIX: Remote themes Github link should go to custom branch #9184 2020-03-18 03:57:54 +05:30
Justin DiRose 9101227266
FEATURE: Demote muted categories on category list (#9226) 2020-03-17 15:33:15 -05:00
David Taylor 92e9fa70c7
DEV: Add class to backup restore buttons, for easier targeting 2020-03-17 18:46:17 +00:00
Jeff Wong 8e6be1c353 FIX: consistency to show mute/ignore menu in user profile
Show the mute/ignore menu for another user even when the current user
cannot message them.
2020-03-17 11:22:34 -07:00
Blake Erickson 919e405c48
FIX: Don't display webhooks for inactive plugins (#9206)
* FIX: Don't display webhooks for inactive plugins

This commit ensures that we don't show webhooks for plugins that are not
installed or that are disabled.

Bug report:

https://meta.discourse.org/t/webhookeventtype-and-the-solved-and-assign-plugins/144180

* rename to just 'active', it's cleaner
2020-03-17 10:39:24 -06:00
Jarek Radosz e950471c0f
DEV: Replace User.unstage and User#unstage API with User#unstage! (#8906)
* DEV: Replace User.unstage and User#unstage API with User#unstage!

Quoting @SamSaffron:

> User.unstage mixes concerns of both unstaging users and updating params which is fragile/surprising.
> u.unstage destroys notifications and raises a user_unstaged event prior to the user becoming unstaged and the user object being saved.

User#unstage! no longer updates user attributes and saves the object before triggering the `user_unstaged` event.

* Update one more spec

* Assign attributes after unstaging
2020-03-17 16:48:24 +01:00
Bianca Nenciu 43b38dbbc2
FIX: Dismiss notifications on middle click (#9098) 2020-03-17 17:48:12 +02:00
David Taylor e72c0544b0
UX: Refresh group membership list when removing users or changing owners 2020-03-17 11:06:17 +00:00
Martin Brennan 949bb74add FIX: Add basePath to link for "no timezone" in bookmark modal 2020-03-17 16:53:12 +10:00