Commit Graph

21428 Commits

Author SHA1 Message Date
542e62ccf0 FIX: tag info misleading message saying it's not restricted
When a tag is restricted to a secured category that the user can't see,
the message was saying that it wasn't restricted to any categories.
Now it will say it's restricted to categories you can't access.
2020-02-05 15:23:39 -05:00
6f52bbefb8 DEV: Use scheduleOnce correctly (#8865)
* DEV: Use scheduleOnce correctly

* remove jquery usage here
2020-02-05 21:21:00 +03:00
926d5f1c0a REFACTOR: Edit title respects min trust to edit post
Follow up to: 241d8f6452d202cbdcef44032ea725c2e76492ca
2020-02-05 10:36:24 -07:00
49c750ca78 FIX: Opening new topic draft never creates post (#8828) 2020-02-05 11:17:58 -06:00
6bee972a5c FIX: corrects min/max logic for mini-tag-chooser (#8871) 2020-02-05 17:47:20 +01:00
6253ddc74e DEV: Do not trigger missing icon warning in icon picker 2020-02-05 11:39:46 -05:00
499b57a9ed DEV: Ember linting - disallow Ember.* variable usage (#8782) 2020-02-05 10:14:42 -06:00
98303ee645 FIX: simplify maximum/minimum logic in sk2 to avoid chicken/egg (#8868) 2020-02-05 16:01:58 +01:00
be42b87338 FIX: Allow submitting various forms via keyboard (#8866) 2020-02-05 15:23:35 +01:00
53529a3427 DEV: Upgrade Ember to version 3.12.2 (#8753)
* DEV: Use Ember 3.12.2
* Add Ember version to ThemeField's DEPENDENT_CONSTANTS
* DEV: Use `id` instead of `elementId` (See: https://github.com/emberjs/ember.js/issues/18147)
* FIX: Don't leak event listeners (bug introduced in 999e2ff)
2020-02-05 14:51:00 +01:00
d7dffbb13c UX: caches icon picker full icon's list (#8862) 2020-02-05 09:22:11 +01:00
a9f1652131 REFACTOR: querySelector instead of querySelectorAll to get first node (#8861) 2020-02-05 08:49:02 +01:00
a6da0bb1ef UX: Remove subtle render delay with timeline notification button (#8860) 2020-02-05 18:35:47 +11:00
0d6839e8a8 UX: adjust algorithm for picking notification count
Our current algorithm for picking the number of notifications to display
when expanding the notifications relies on magic numbers.

Previously we only allowed for header and an estimate of maximum height of
notification container, this is not ideal as there is padding at the bottom
and top of the notification container

This adds a special number for padding.

The longer term fix though is to render the notification panel off screen
then grab the correct count, finally adding it back into view with.

This would allow for large fonts, small fonts, custom themes and much more.
2020-02-05 16:03:44 +11:00
15b27f28aa UX: Topic progress bar should not flash on desktop
Followup on 78725f50

This makes the change a bit safer in case .d-header is not to be found due
to a customization.
2020-02-05 15:36:39 +11:00
78725f5081 Revert "FIX: Topic progress bar shouldn't show up on desktop (#8854)"
This reverts commit 7133fd8c8936493aec809a66401ff14e9b6ce92b.

Unfortunately performCheckSize may have certain situations in topic
navigation where it is unsafe to call.

We need to add som more safety here prior to merging.
2020-02-05 15:22:44 +11:00
7133fd8c89 FIX: Topic progress bar shouldn't show up on desktop (#8854) 2020-02-05 15:19:20 +11:00
f0fe2ba9ac UX: introduces icon-picker component for badges (#8844) 2020-02-05 00:41:10 +01:00
241d8f6452 FIX: Edit title respects min trust to edit post
This fix ensures that the site setting `post_edit_time_limit` does not
bypass the limit of the site setting `min_trust_to_edit_post`. This
prevents a bug where users that did not meet the minimum trust level to
edit could edit the title of topics.
2020-02-04 16:31:16 -07:00
666a4be888 UX: prevents mini tag chooser header to wrap (#8858) 2020-02-04 23:55:50 +01:00
7fd5a8db72 UX: adds arrow navigation support to mini-tag-chooser (#8857) 2020-02-04 23:54:59 +01:00
9252bbbd7d FIX: prevents firefox to generate a click event on space (#8856) 2020-02-04 23:41:40 +01:00
7ac81a6019 UX: Center titles in docked header when there aren't two rows 2020-02-04 13:40:28 -05:00
2c2ab474a4 FIX: ensures tags-admin-dropdown is working correctly with sk2 (#8852) 2020-02-04 19:23:44 +01:00
35a1912e2d FIX: Links in category box descriptions should be clickable 2020-02-04 13:02:55 -05:00
5ead60677a FEATURE: Ensure we always fill the short_name in the web manifest 2020-02-04 14:16:00 -03:00
fec1c0f097 DEV: Handle null notification level when generating data attribute (#8851)
This happens in tests, but handling it properly will make the production code more robust. Followup to ebdebf152dd7fb259c0ecf06ce2356c5b0143c08
2020-02-04 17:05:49 +00:00
095e3d8946 DEV: Autofilter combo boxes on 10+ dropdown items by default 2020-02-04 11:23:15 -05:00
ebdebf152d DEV: Use a string for category data-notification-level, not an integer
This makes writing CSS to target specific notification levels more intuitive. Follow-up to 76409145523ac33f3f77bb9e8b7104c01aa35735
2020-02-04 16:05:45 +00:00
dabba87954 DEV: introduce diffLocalChangesUrl attribute to theme model. 2020-02-04 21:33:19 +05:30
c8a02161dd FIX: Warn users of overwriting new topic draft (#8841) 2020-02-04 09:59:56 -06:00
91b70f8ffc FIX: Featured topic title on profile HTML parsed (#8850) 2020-02-04 09:33:46 -06:00
14126e9a38 UX: do not display pinned option description on mobile (#8846) 2020-02-04 15:34:56 +01:00
ca63502ce6 UX: ensures pinned options icon is not on a new line (#8845) 2020-02-04 15:34:37 +01:00
1d54e78311 FIX: prevents exception on /admin/badges page when model is not set (#8849)
Exception:

TypeError: Cannot read property 'badge_type_id' of null
2020-02-04 15:34:19 +01:00
5d31f353f4 remove duplicated }} (#8848) 2020-02-04 15:02:40 +01:00
71849242fa PERF: Speed up moving posts on large databases
Old exection plan:
```
Delete on post_replies pr  (cost=6.59..20462.62 rows=2254 width=24) (actual time=2.580..2.580 rows=0 loops=1)
  ->  Nested Loop  (cost=6.59..20462.62 rows=2254 width=24) (actual time=0.086..2.557 rows=4 loops=1)
        Join Filter: (p.topic_id <> r.topic_id)
        Rows Removed by Join Filter: 328
        ->  Nested Loop  (cost=6.16..16845.77 rows=2254 width=26) (actual time=0.020..1.886 rows=332 loops=1)
              ->  Nested Loop  (cost=5.74..13257.09 rows=2254 width=20) (actual time=0.016..1.361 rows=332 loops=1)
                    ->  Seq Scan on moved_posts mp  (cost=0.00..19.70 rows=970 width=10) (actual time=0.002..0.028 rows=263 loops=1)
                    ->  Bitmap Heap Scan on post_replies pr  (cost=5.74..13.63 rows=2 width=14) (actual time=0.004..0.005 rows=1 loops=263)
                          Recheck Cond: ((reply_post_id = mp.old_post_id) OR (post_id = mp.old_post_id))
                          Heap Blocks: exact=278
                          ->  BitmapOr  (cost=5.74..5.74 rows=2 width=0) (actual time=0.004..0.004 rows=0 loops=263)
                                ->  Bitmap Index Scan on index_post_replies_on_reply_post_id  (cost=0.00..2.87 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=263)
                                      Index Cond: (reply_post_id = mp.old_post_id)
                                ->  Bitmap Index Scan on index_post_replies_on_post_id_and_reply_post_id  (cost=0.00..2.87 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=263)
                                      Index Cond: (post_id = mp.old_post_id)
              ->  Index Scan using posts_pkey on posts p  (cost=0.42..1.59 rows=1 width=14) (actual time=0.001..0.001 rows=1 loops=332)
                    Index Cond: (id = pr.post_id)
        ->  Index Scan using posts_pkey on posts r  (cost=0.42..1.59 rows=1 width=14) (actual time=0.001..0.002 rows=1 loops=332)
              Index Cond: (id = pr.reply_post_id)
Planning Time: 0.305 ms
Execution Time: 2.600 ms
```

New execution plan:
```
Delete on post_replies pr  (cost=15.34..6538275.37 rows=364157 width=12) (actual time=1.961..1.961 rows=0 loops=1)
  ->  Nested Loop  (cost=15.34..6538275.37 rows=364157 width=12) (actual time=0.048..1.827 rows=187 loops=1)
        ->  Seq Scan on moved_posts mp  (cost=0.00..19.70 rows=970 width=10) (actual time=0.004..0.029 rows=188 loops=1)
        ->  Bitmap Heap Scan on post_replies pr  (cost=15.34..6736.72 rows=375 width=14) (actual time=0.009..0.009 rows=1 loops=188)
              Recheck Cond: ((reply_post_id = mp.old_post_id) OR (post_id = mp.old_post_id))
              Filter: ((SubPlan 1) <> (SubPlan 2))
              Heap Blocks: exact=187
              ->  BitmapOr  (cost=15.34..15.34 rows=377 width=0) (actual time=0.003..0.003 rows=0 loops=188)
                    ->  Bitmap Index Scan on index_post_replies_on_reply_post_id  (cost=0.00..4.33 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=188)
                          Index Cond: (reply_post_id = mp.old_post_id)
                    ->  Bitmap Index Scan on index_post_replies_on_post_id_and_reply_post_id  (cost=0.00..10.82 rows=376 width=0) (actual time=0.001..0.001 rows=0 loops=188)
                          Index Cond: (post_id = mp.old_post_id)
              SubPlan 1
                ->  Index Scan using posts_pkey on posts p  (cost=0.43..8.45 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=187)
                      Index Cond: (id = pr.post_id)
              SubPlan 2
                ->  Index Scan using posts_pkey on posts r  (cost=0.43..8.45 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=187)
                      Index Cond: (id = pr.reply_post_id)
Planning Time: 0.136 ms
Execution Time: 1.990 ms
```
2020-02-04 12:30:43 +01:00
67d5ce8ed1 FIX: Sort out the route navigation in admin/email-style (#8837)
Previously it would go to the "html" page when refreshing on the "css" page, and would open an invalid empty-state page when trying to go to the "email style" tab when already on it.
2020-02-04 11:42:43 +01:00
4ab696dd2f DEV: Add the @action decorator (#8836)
This also enables`@action` use in plugin connectors.

Setting `actions` earlier allows `setupComponents` to use them, for example, when setting up event listeners.
2020-02-04 11:42:25 +01:00
9a52a44d09 DEV: Add outlet args to editor-preview outlet (#8835)
Those are the same arguments that are passed into `after-d-editor` outlet. This will enable plugins that attach to editor preview to be conditionally enabled, usually only for the composer.
Plugins that will use this: discourse-canned-responses, discourse-zoom.
2020-02-04 11:41:45 +01:00
e4f3244141 DEV: introduce updateUrl attribute to theme-setting-editor component. 2020-02-04 15:19:17 +05:30
ee17138c0f FIX: Better error messages when name is too long
Previously you'd get a server side generic error due to a password check
failing. Now the input element has a maxlength attribute and the server
side will respond with a nicer error message if the value is too long.
2020-02-03 14:14:32 -05:00
375f4c09ce FIX: Restore up/down icons in period-chooser 2020-02-03 13:56:58 -05:00
37888d9818 FIX: Never return the same reply more than once via reply_ids
If our reply tree somehow ends up with cycles or other odd
structures, we only want to consider a reply once, at the first
level in the tree that it appears.
2020-02-03 13:41:18 -05:00
7640914552 UX: Include muted categories on the category page by default (#8842)
* DEV: Add data-notification-level attribute to category UI

* Show muted categories on the category page by default

This reverts commit ed9c21e42c3e34955013fe34ba8443841bafbedd.

* Remove redundant spec - muted categories are now visible by default
2020-02-03 10:40:02 -08:00
6301477b4c FIX: Make dropdown custom user fields compatible with select-kit 2 2020-02-03 13:19:38 -05:00
f83362b05b FIX: Don't return post replies from other topics
It seems in some situations replies have been moved to other topics but
the `PostReply` table has not been updated. I will try and fix this in a
follow up PR, but for now this fix ensures that every time we ask a post
for its replies that we restrict it to the same topic.
2020-02-03 13:12:27 -05:00
ad2aa7b52c FEATURE: Add logout functionality to SSO Provider protocol (#8816)
This commit adds support for an optional "logout" parameter in the
payload of the /session/sso_provider endpoint.  If an SSO Consumer
adds a "logout=true" parameter to the encoded/signed "sso" payload,
then Discourse will treat the request as a logout request instead
of an authentication request.  The logout flow works something like
this:

 * User requests logout at SSO-Consumer site (e.g., clicks "Log me out!"
   on web browser).
 * SSO-Consumer site does whatever it does to destroy User's session on
   the SSO-Consumer site.
 * SSO-Consumer then redirects browser to the Discourse sso_provider
   endpoint, with a signed request bearing "logout=true" in addition
   to the usual nonce and the "return_sso_url".
 * Discourse destroys User's discourse session and redirects browser back
   to the "return_sso_url".
 * SSO-Consumer site does whatever it does --- notably, it cannot request
   SSO credentials from Discourse without the User being prompted to login
   again.
2020-02-03 12:53:14 -05:00
98e9302c26 Log error when optimized image file fails to store. (#8840) 2020-02-03 12:28:45 -05:00
231617ff70 DEV: Rename deprecated "warning" icon to "exclamation-triangle" 2020-02-03 10:43:05 -05:00