Commit Graph

19306 Commits

Author SHA1 Message Date
Joffrey JAFFEUX 9d2e2867cc
s/fa-icon/d-icon (#7337) 2019-04-08 15:51:38 +02:00
Tarek Khalil 0d2a1fce51
REFACTOR: Pass down `currentUser` to `post-cooked` widget (#7333)
* REFACTOR: Pass down `currentUser` to `post-cooked` widget
2019-04-08 14:50:53 +01:00
Vinoth Kannan 2ae87a27fa make rubocop happy 2019-04-08 17:03:26 +05:30
Guo Xiang Tan f0f3deb32b PERF: Simplify query of `UserStat#update_topic_reply_count`.
For a user with alot of posts, we get a 25% speed up.
2019-04-08 17:48:19 +08:00
David Taylor f524f8f811
Remove Yahoo login support from core and deprecate OpenID2.0 (#7310)
- Plugin developers using OpenID2.0 should migrate to OAuth2 or OIDC. OpenID2.0 APIs will be removed in v2.4.0

- For sites requiring Yahoo login, it can be implemented using the OpenID Connect plugin: https://meta.discourse.org/t/103632

For more information, see https://meta.discourse.org/t/113249
2019-04-08 10:38:25 +01:00
Guo Xiang Tan 108c231d1c FIX: Clean up `topic_search_data` of trashed topics.
This keeps the index and table smaller.
2019-04-08 16:53:39 +08:00
Guo Xiang Tan c4997ce85f FIX: Don't try and reindex posts that have been trashed. 2019-04-08 16:38:43 +08:00
Vinoth Kannan ca57e18f42 UX: display signup cta even if 'must_approve_users' setting enabled. 2019-04-08 12:27:56 +05:30
Guo Xiang Tan 33fa249fa5 SECURITY: Remove XSS in composer preview when applying image scale buttons. 2019-04-08 11:22:14 +08:00
Guo Xiang Tan 6525613b89 PERF: Use joins for `Post.for_mailing_list` instead of `NOT IN`.
Joining on the topics table and then filtering the topics against a large set of
ids is so much slower than doing a join on a sub query.
2019-04-06 07:58:55 +08:00
Kris 84eb9bc1c9 UX: Only highlight close icon on hover, not lock 2019-04-05 17:43:14 -04:00
Kris a1c2181232 UX: Better close button positioning in alerts, some cleanup 2019-04-05 16:21:16 -04:00
Robin Ward a6f283da30 UX: Show tags on flags too 2019-04-05 14:22:45 -04:00
Régis Hanol 06e3b25d04
FIX: 'currentUser' is a property of the 'widget' 2019-04-05 18:43:04 +02:00
Robin Ward b005a84530 FIX: `decoratorHelper.widget` is not always present 2019-04-05 12:07:24 -04:00
Kris acce7330a3 Typo fix 2019-04-05 11:23:22 -04:00
Kris 43a905279f FIX: Layout was off in single-page user-preferences 2019-04-05 10:59:52 -04:00
Robin Ward cbc311e4ed UX: Update the reviewable count before the message bus
In certain edge cases, the message bus won't send the message to the
user about the updated review count and it can go out of sync.

This patch synchronizes the review count every time:

1. The user visits the "Needs Review" page

2. Every time the user performs an action
2019-04-05 10:35:38 -04:00
Tarek Khalil 19a1d35f66
fix linting (#7329) 2019-04-05 15:28:41 +01:00
Tarek Khalil 131eba0366 FIX: Hide post replies content for ignored users (#7320) 2019-04-05 16:13:36 +02:00
Maja Komel ca33d091b3 FIX: don't trigger notifications when changing category/tags of unlisted topics (#7323) 2019-04-05 15:06:38 +02:00
Guo Xiang Tan a7a5f90e20 Annotate models. 2019-04-05 17:13:12 +08:00
Joffrey JAFFEUX 0bd480c600
UX: displays exact date on title attribute of topic timer info (#7326) 2019-04-05 09:44:10 +02:00
Saurabh Patel 9b288613ae DEV: remove span from inside <tr> and move meta info to a td (#7324) 2019-04-05 09:32:11 +02:00
Angus McLeod 6f1652bb53 add header cloak after all panels are added (#7325) 2019-04-04 22:54:05 -07:00
Sam Saffron 81a1bafe54 PERF: Speed up home page unread+new query
restructure query so it avoids ORs

It appears postgres is picking suboptimal indexes if too many ORs exist
despite how trivial the condition is.

This bypasses conditional in the query and evals them upfront.

On meta for my user this made a 10x perf difference.

This boils down to either having `OR u.admin` or not having `OR u.admin` in
the query.
2019-04-05 15:25:19 +11:00
Sam Saffron 5b837f620b correct unread resetting to handle nulls
Note, to avoid race conditions we are setting last_unread to 10 minutes ago
if there is nothing unread.

This is safer in case of in progress transactions
we don't want to lose unread for any window of time.
2019-04-05 13:42:41 +11:00
Sam Saffron 5f896ae8f7 PERF: Keep track of when a users first unread is
This optimisation avoids large scans joining the topics table with the
topic_users table.

Previously when a user carried a lot of read state we would have to join
the entire read state with the topics table. This operation would slow down
home page and every topic page. The more read state you accumulated the
larger the impact.

The optimisation helps people who clean up unread, however if you carry
unread from years ago it will only have minimal impact.
2019-04-05 12:44:45 +11:00
Robin Ward c9ddc6ce30 FIX: Make sure the site setting works and fix build 2019-04-04 17:44:10 -04:00
Robin Ward aa4a38b08a FIX: computed is not used 2019-04-04 17:38:27 -04:00
Robin Ward 8af7237092 FIX: Only perform logic on `create` commits 2019-04-04 17:01:47 -04:00
Vinoth Kannan 2c7a50860f DEV: disable missing post uploads check by default. 2019-04-05 02:29:10 +05:30
Neil Lalonde 83996fc8ea FEATURE: ability to restrict some tags to a category while allowing all others
A new checkbox has been added to the Tags tab of the category settings modal
which is used when some tags and/or tag groups are restricted to the category,
and all other unrestricted tags should also be allowed.
Default is the same as the previous behaviour: only allow the specified set of
tags and tag groups in the category.
2019-04-04 16:40:15 -04:00
Kris 9faebfcfe0 UX: Adjust layout, allow additional responsiveness 2019-04-04 16:20:25 -04:00
Robin Ward df48c657fd FIX: Reviewable counts were not updating properly
Sometimes sidekiq is so fast that it starts jobs before transactions
have comitted. This patch moves the message bus stuff until after things
have comitted.
2019-04-04 16:07:34 -04:00
Robin Ward 2055804e95 FIX: The option to delete replies was missing from the new review queue 2019-04-04 15:51:36 -04:00
Robin Ward dd5b8bd85e FIX: Show replies to the post, not the topic
This makes more sense when reviewing. How many people replied to this
objectionable thing?
2019-04-04 15:13:59 -04:00
Robin Ward 9c8cc73c39 UX: Show user fields when reviewing a user 2019-04-04 14:45:40 -04:00
Vinoth Kannan a385f6c48a REFACTOR: create custom field even when missing post uploads not found 2019-04-04 21:49:44 +05:30
Vinoth Kannan 44e87372da FEATURE: Add scheduled job to ensure s3 uploads existence 2019-04-04 20:37:44 +05:30
Robin Ward a5182b0d6c FIX: Rewrite old `/admin/flags` links to use the review queue
Such links might be in present in old PMs. For example, a notification of
outstanding flags.

New PMs should receive the correct link but this prevents 404s in the
other case.
2019-04-04 10:15:23 -04:00
Saurabh Patel 90fc2d15c4 FEATURE: change layout when default page is category to tabular for _… (#7270) 2019-04-04 15:57:18 +02:00
Arpit Jalan f87b35e6f4 FIX: do not raise exception if the file is missing 2019-04-04 15:36:51 +05:30
Bianca Nenciu 63fcd445f4 FIX: Use unfiltered URL when viewing all badges. 2019-04-04 12:35:03 +03:00
Maja Komel b0053f3a1c FEATURE: bump onebox version, add styling for new reddit image onebox 2019-04-04 11:24:30 +02:00
Guo Xiang Tan 6815f777f9 DEV: Remove unused method. 2019-04-04 14:19:39 +08:00
Robin Ward 588f61f717 FIX: Linting 2019-04-03 18:08:07 -04:00
Robin Ward a4ff593506 UX: Slightly improved reviewable user display, plus link to admin if possible 2019-04-03 17:07:48 -04:00
Vinoth Kannan 3b581de3b8 remove unrelated code
already added in a separate job
2019-04-04 02:26:28 +05:30
Vinoth Kannan b3fb0a7039 FEATURE: ensure consistency of post uploads in cooked content 2019-04-04 02:23:28 +05:30
Kris 14952a9cbc UX: Reduce specificity of reviewable item styles 2019-04-03 16:49:57 -04:00
Robin Ward 111a502231 FIX: Deleting Users should work nicely with Reviewable Users
"Rejecting" a user in the queue is equivalent to deleting them, which
would then making it impossible to review rejected users. Now we store
information about the user in the payload so if they are deleted things
still display in the Rejected view.

Secondly, if a user is destroyed outside of the review queue, it will
now automatically "Reject" that queue item.
2019-04-03 16:42:39 -04:00
Kris 88a46981a8 UX: Remove extra border on old mobile post notices 2019-04-03 16:10:54 -04:00
Robin Ward 828cdf3fea FIX: Protected method called, I'll fire myself now 2019-04-03 16:10:36 -04:00
Robin Ward 82bddcbe51 FIX: Don't create two reviewable scores for a user 2019-04-03 16:03:32 -04:00
Robin Ward c1ea63bdc1 FIX: Reviewables should not be created for users until they are active
Conversely, if a user is deactivated the reviewable should automatically
be rejected.

Before this fix, if a user was not active they'd still show in the
review queue but without an "Approve" button which was confusing.
2019-04-03 15:25:00 -04:00
Joffrey JAFFEUX 974007a3cc
FIX: reverts href removal from user/group cards links (#7318) 2019-04-03 19:16:48 +02:00
Robin Ward 1bce97a596 FIX: Allow queued posts from deleted users to be rejected 2019-04-03 11:40:46 -04:00
Bianca Nenciu bb2005d466 FIX: Add more links to bandge cards. 2019-04-03 18:37:11 +03:00
Robin Ward 62956003c3 FEATURE: Allow users to customize bonuses for reviewable types
A new settings section in the review queue allows admins to specify that
certain types of flags should be weighted higher than others.
2019-04-03 11:18:34 -04:00
Saurabh Patel da2f659635 UX: Improve posts layout for crawler (#7286) 2019-04-03 11:58:00 +02:00
Bianca Nenciu 1e1adb1afa FIX: Links in badge summary were not clickable. (#7303) 2019-04-03 11:35:27 +02:00
Maja Komel d32aaf374e UX: add awaiting-approval class to login modal
when local logins are disabled and account is awaiting approval
2019-04-03 11:30:43 +02:00
Arpit Jalan 7b194743d7
FIX: clean up user export csv upload records in scheduled job (#7309) 2019-04-03 13:31:19 +05:30
Guo Xiang Tan d1fa2b71cf FIX: Letters between words incorrectly highlighted within post. 2019-04-03 15:57:51 +08:00
Sam Saffron b2dc65f953 FIX: on rebakes should not recreate quoted_posts records
Previously every rebake would remove and recreate records in this table
This caused created_at and updated_at to keep changing

Yes, I know the SQL is somewhat complex, but this makes quote extraction
more efficient cause we do everything in 2 round trips.

This also removes some concurrency protection we should no longer need
2019-04-03 16:17:15 +11:00
Guo Xiang Tan 52c4711e80 DEV: Fix method that was incorrectly made private. 2019-04-03 12:37:50 +08:00
Guo Xiang Tan 4037a2fd0b FIX: Restrict scope of old scheme upload migration.
Some sites have external URLs that don't even match `%/uploads/%' and
some sites surprise me with URLs that contains the default path when it
is a site in a multisite cluster. We can't do anything about those.
2019-04-03 11:56:41 +08:00
Guo Xiang Tan d151425353
PERF: Delete search data of posts from trashed topics periodically. (#7302)
This keeps both the index and table smaller.
2019-04-03 10:10:41 +08:00
Guo Xiang Tan feb731bffd FIX: Regenerate optimized images instead of migrating from old scheme.
`OptimizedImage.migrate_to_new_scheme` was optimizing optimized images
which we don't need to do. Regnerating the optimized image is way easier.
2019-04-03 09:45:02 +08:00
Kris c3047a903d UX: Reviewable spacing adjustments 2019-04-02 17:22:22 -04:00
Kris 14cbbc5e13 UX: Reviewables fixes 2019-04-02 16:25:53 -04:00
Penar Musaraj 44fe2eec03 Better fix for Safari user card position
Better than a2c6683e3b
2019-04-02 15:36:47 -04:00
Kris ba727b2875 UX: Restructure queued posts to match flags, fix text 2019-04-02 14:54:55 -04:00
Kris 2ab6eb58c5 UX: Reviewable layout improvements 2019-04-02 13:51:03 -04:00
Penar Musaraj 15e27d9e2c Prettier fix 2019-04-02 11:56:21 -04:00
Joffrey JAFFEUX 40e1ba9d9a
FIX: ensures click on emoji in picker doesnt propagate (#7308) 2019-04-02 17:40:13 +02:00
Joffrey JAFFEUX d8dd130477
UX: gives aria-label to topics count in category-row (#7307) 2019-04-02 17:38:21 +02:00
Joffrey JAFFEUX e77b1cf7ff
UX: ensures only <li> are used as top level in breadcrumb (#7306) 2019-04-02 17:37:53 +02:00
venarius c185109380 FIX: Restricted site text better error 2019-04-02 11:16:27 -04:00
Penar Musaraj a2c6683e3b FIX: inconsistent user card position in Safari
User cards triggered in header were incorrectly positioned in Safari desktop.

Using `position()` instead of `offset()` is more consistent, since header is a fixed element in this scenario.
2019-04-02 10:32:50 -04:00
Robin Ward af04318aff FIX: Allow us to serialize reviewables with deleted topics 2019-04-02 09:36:49 -04:00
Joffrey JAFFEUX 02d8931425
UX: more compact local-dates preview (#7305) 2019-04-02 14:39:20 +02:00
Arpit Jalan d68d29f37a FIX: only staff can banner topics 2019-04-02 12:46:55 +05:30
Guo Xiang Tan d85240335b Annotate models. 2019-04-02 13:19:14 +08:00
Tim Lange a9a35d2c19 FIX: Uncategorized pm not allowing edit (#7276) 2019-04-02 12:54:53 +08:00
Guo Xiang Tan 4175de5071 UX: Wrap title on search log term page with a proper div.
Search log filter selector was not floating right as it should.
2019-04-02 11:55:57 +08:00
Guo Xiang Tan 1a9452f24d UX: Pass period params when looking at search logs for a given term. 2019-04-02 11:51:41 +08:00
Kris cdce9c97bb minor margin fix 2019-04-01 23:50:47 -04:00
Penar Musaraj 1c0f885a5b FIX: double render error with delegated authentication
Makes sure delegated authentication is checked before other login redirects

Updates specs to cover login_required = true cases
2019-04-01 22:13:53 -04:00
Kris 254de64df7 UX: Consistent profile image positioning on desktop and mobile 2019-04-01 22:04:11 -04:00
Guo Xiang Tan d8704c11ca PERF: Better use of index when queueing a topci for search reindex.
Also move `Search::INDEX_VERSION` to `SearchIndexer` which is where the
version is actually being used.
2019-04-02 09:53:37 +08:00
Kris 9603c906ec Moving staff counters back to the top of profiles 2019-04-01 21:04:37 -04:00
Guo Xiang Tan aa2311a7b0 FIX: Don't reindex posts belonging to a deleted topic for search.
Posts belonging to a deleted topic can't be index for search so we need
to avoid loading those post ids.
2019-04-02 07:36:53 +08:00
Guo Xiang Tan 3fc5dbb045 FIX: Don't attempt to reindex posts that have an empty raw.
If the post ids keep loading, we might end up in a situations where
we're always loading the same post ids over and over again without
indexing anything new.

Follow up to daeda80ada.
2019-04-02 07:13:33 +08:00
Robin Ward d5a61ab167 FIX: Don't log a second pending action
If two people flagged the same post you'd get a "Pending" history event
logged which looked bad.
2019-04-01 17:07:47 -04:00
Robin Ward 76669bb5a6 FIX: Don't refer to pending review items as flags
They could be queued posts or users, and the notice should reflect that
properly.
2019-04-01 14:46:56 -04:00
Robin Ward 6470c85fda UX: Link directly to the post, not to the topic 2019-04-01 14:29:14 -04:00
Penar Musaraj fdf4145d4b
FEATURE: Delegated authentication via user api keys (#7272) 2019-04-01 13:18:53 -04:00
David Taylor b375dcb14a DEV: Introduce parallel rspec testing
Adds the parallel_tests gem, and redis/postgres configuration for running rspec tests in parallel. To use:

```
rake parallel:rake[db:create]
rake parallel:rake[db:migrate]
rake parallel:spec
```

This brings the test suite from 12m20s to 3m11s on my macOS machine
2019-04-01 11:06:47 -04:00