Commit Graph

19173 Commits

Author SHA1 Message Date
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
Joffrey JAFFEUX 13a6a04cad
FIX: ensures popover is hidden when changing route (#7300) 2019-04-01 16:23:57 +02:00
Joffrey JAFFEUX 4b1b135ede
FIX: handles boolean with popupMenuOption (#7299)
Handle the case of https://github.com/discourse/DiscoTOC doing this kind of setup:

```
return {
    action: "insertDtoc",
    icon: "align-left",
    label: themePrefix("insert_table_of_contents"),
    condition: !composerController.get("model.canCategorize")
  };
```

In this case there's no function to call, it's already set.
2019-04-01 16:08:14 +02:00
Régis Hanol a6596662dc FIX: don't enqueue TruncateUserFlagStats job when not needed 2019-04-01 15:53:55 +02:00
Joffrey JAFFEUX 6e0e36f790
fix spec (#7298) 2019-04-01 14:35:09 +02:00
Joffrey JAFFEUX e986e96227
DEV: removes old dashboard (#7295) 2019-04-01 12:39:49 +02:00
Guo Xiang Tan 3cba10b9ca DEV: Don't warn when trying to reindex a post with a deleted topic. 2019-04-01 17:04:32 +08:00
Joe 541a15e357 UX: user-card adjustments for users with hidden profiles (#7293)
* adds styles for profile hidden message

* Disable profile links for hidden profiles and add message to indicate the profile is hidden
2019-04-01 10:50:48 +02:00
Guo Xiang Tan 8794d940d3 Revert `update_columns` -> `update!` when rebaking/post-processing post.
`update!` goes through validation which means old posts that doesn't
adhere to the existing validations will raise an error.
2019-04-01 16:29:00 +08:00
Guo Xiang Tan 2a69ab4a4c FIX: Keep `alt` and `title` in lightbox when indexing for search.
Follow up to cfd507822f
2019-04-01 16:20:33 +08:00
Maja Komel 88128f1ced UX: show which groups are missing permissions for parent category (#7252) 2019-04-01 15:34:52 +11:00
Guo Xiang Tan cfd507822f
PERF: Improve quality of `PostSearchData#raw_data`. (#7275)
This commit fixes the follow quality issue with `PostSearchData#raw_data`:

1. URLs are being tokenized and links with similar href and characters
are being duplicated in the raw data.

`Post#cooked`:

```
<p><a href=\"https://meta.discourse.org/some.png\" class=\"onebox\" target=\"_blank\" rel=\"nofollow noopener\">https://meta.discourse.org/some.png</a></p>
```

`PostSearchData#raw_data` Before:

```
This is a test topic 0 Uncategorized https://meta.discourse.org/some.png discourse org/some png https://meta.discourse.org/some.png discourse org/some png
```

`PostSearchData#raw_data` After:

```
This is a test topic 0 Uncategorized https://meta.discourse.org/some.png meta discourse org
```

2. Ligthbox being included in search pollutes the
`PostSearchData#raw_data` unncessarily.

From 28 March 2018 to 28 March 2019, searches for the term `image` on
`meta.discourse.org` had a click through rate of 2.1%. Non-lightboxed images are not included in indexing for search yet we were indexing content within a lightbox. Also, search for terms like `image` was affected we were using `Pasted image` as the filename for
uploads that were pasted.

`Post#cooked`

```
<p>Let me see how I can fix this image<br>\n<div class=\"lightbox-wrapper\"><a class=\"lightbox\" href=\"https://meta.discourse.org/some.png\" title=\"some.png\" rel=\"nofollow noopener\"><img src=\"https://meta.discourse.org/some.png\" width=\"275\" height=\"299\"><div class=\"meta\">\n<svg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"><use xlink:href=\"#far-image\"></use></svg><span class=\"filename\">some.png</span><span class=\"informations\">1750×2000</span><svg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"><use xlink:href=\"#discourse-expand\"></use></svg>\n</div></a></div></p>
```

`PostSearchData#raw_data` Before:

```
This is a test topic 0 Uncategorized Let me see how I can fix this image some.png png https://meta.discourse.org/some.png discourse org/some png some.png png 1750×2000
```

`PostSearchData#raw_data` After:

```
This is a test topic 0 Uncategorized Let me see how I can fix this image
```

In terms of indexing performance, we now have to parse the given HTML
through nokogiri twice. However performance is not a huge worry here since a string length of 194170 takes only 30ms
to scrub plus the indexing takes place in a background job.
2019-04-01 10:14:29 +08:00
Guo Xiang Tan 7ac76fe935 DEV: Remove warning.
Library has already been loaded in application.rb.
2019-04-01 10:11:08 +08:00
Guo Xiang Tan daeda80ada
FIX: Don't index posts with empty `Post#raw` for search. (#7263)
* DEV: Remove unnecessary join in `Jobs::ReindexSearch`.

* FIX: Don't index posts with empty `Post#raw` for search.
2019-04-01 10:06:27 +08:00
Dan Ungureanu d59abff2d8
UX: Always use relative age for post notices. 2019-03-31 18:07:05 +03:00
Joe 8b8d528b88 Hide mobile cards when user scrolls (#7291) 2019-03-31 11:16:52 +02:00
Joe 9510f3d737 card buttons should truncate if there isn't enough space (#7290) 2019-03-31 11:16:40 +02:00
Robin Ward c0780434f8 FIX: Better display if the topic is deleted 2019-03-29 16:59:00 -04:00
Robin Ward a55e7ebe8f UX: Better display for deleted users in the review queue 2019-03-29 16:52:58 -04:00
Robin Ward 86349abfea FIX: Apply `min_score_default_visibility` to reviewable topics list 2019-03-29 15:42:49 -04:00
Kris 4e6d4531e8 UX: Improve ignore button alignment on user profiles 2019-03-29 15:34:48 -04:00
Robin Ward 67454c71c9 FIX: Missing translations for agree/disagree details 2019-03-29 14:14:59 -04:00
Robin Ward 370355d754 FIX: Allow users with posts to be rejected 2019-03-29 13:53:46 -04:00
Kris 814aee343b UX: Minor profile page restructure 2019-03-29 12:52:42 -04:00
Tim Lange 2c4b3c21a9 UX: Unified emoji escape regex 2019-03-29 12:17:11 -04:00
Bianca Nenciu 31053f30de FEATURE: Let users delete their own topics. (#7267) 2019-03-29 17:10:05 +01:00
Maja Komel 4a3daacb1b FIX: reset embedding settings when no embeddable host, log host changes (#7264) 2019-03-29 17:05:51 +01:00
Maja Komel 9b00ca30ed FIX: check if user is already allowed before adding to topic allowed users (#7242) 2019-03-29 17:03:33 +01:00
Tarek Khalil d26d1b387e
FEATURE: Add ignore duration selection for user notifications preferences page (#7269)
* FEATURE: Introducing new UI for tracking User's ignored or muted states
2019-03-29 13:33:08 +00:00
Tarek Khalil b1cb95fc23
FEATURE: Introduce ignore duration selection (#7266)
* FEATURE: Introducing new UI for tracking User's ignored or muted states
2019-03-29 10:14:53 +00:00
Joffrey JAFFEUX 961fb2c70e
DEV: moves each report in its own file (#7277) 2019-03-29 10:54:56 +01:00
Guo Xiang Tan a6d93f6317 FIX: Avoid error on ajax.abort() when client has not opened the request. 2019-03-29 15:38:38 +08:00
Guo Xiang Tan 8cfd887f33 Make eslint happy. 2019-03-29 12:59:40 +08:00
Kris 2064223fbd FIX: Safari needs a max-width to prevent modal overflow 2019-03-29 00:38:44 -04:00