Commit Graph

6550 Commits

Author SHA1 Message Date
f530048973 Fix broken spec in 405ba00 take 2. 2019-05-08 16:07:14 +08:00
ba6904bb27 Fix broken spec in 405ba00c08a86778a7baf28e93388201162a5347. 2019-05-08 15:45:25 +08:00
405ba00c08 FEATURE: Create notifications on wiki edits for watching users.
* Moves creation of notification into background job.
2019-05-08 15:31:10 +08:00
77f9fff41e DEV: correct flaky test
Hardcoding the number 1 into a test means that the test may fail if topic_id
1 is somehow seeded

This ensures we are always talking about a topic that does not exist
2019-05-08 09:31:47 +10:00
5af7c90bab FEATURE: Hide Reviewable scores, change score filter to Priority
We found score hard to understand. It is still there behind the scenes
for sorting purposes, but it is no longer shown.

You can now filter by minimum priority (low, med, high) instead of
score.
2019-05-07 14:05:23 -04:00
5b5b5a5931 FIX: return an error if a user tries to whisper
This commit fixes a bug where a user creates a whisper post via the api
but is posted as a regular message because they don't have access to
whisper. Now a 403 unauthorized will be returned instead of the whisper
param just being ignored for regular users. Staff users should not be
affected by this change.

https://meta.discourse.org/t/a-whisper-is-posted-as-a-message-if-the-user-is-not-staff-moderator-admin-when-using-the-api/116601
2019-05-07 11:42:26 -06:00
1f40258d5c fix spec (#7500) 2019-05-07 19:20:56 +02:00
c7a0baebc5 DEV: Prefabricate more things in topic_spec.rb (#7490)
* Moved let to more appropriate scopes

* Refactored tests

It's confusing when let blocks in a parent context depend on other let
blocks from a child context.

* Moved fabrication to top level

* Removed unnecessary user fabrications

* Added a trust level 2 user at the top level

* Factored out category

* Made test use generic user

* Prefabricate topic

* Cut down redundant users

* Prefabricated more things
2019-05-07 17:05:52 +02:00
98a75906c8 FIX: Close topics deleted by users and ensure topic stubs are destroyed. (#7430) 2019-05-07 16:25:52 +03:00
1b7be1500f Time variable used to be created with users timezone, it has to be UTC in order to pass the test 2019-05-07 08:43:38 -04:00
32e0c4997c Prefabricated posts 2019-05-07 08:39:45 -04:00
d3a59a43a1 Prefabricated anonymous 2019-05-07 08:39:45 -04:00
033d584275 Prefabricated topic 2019-05-07 08:39:45 -04:00
3e2f7d800a Replaced create_topic with Fabricate(:topic) 2019-05-07 08:39:45 -04:00
e79421abb7 Prefabricated users 2019-05-07 08:39:45 -04:00
c9dedd7d72 Removed unnecessary fab! 2019-05-07 08:38:55 -04:00
da31661b80 Prefabricate category 2019-05-07 08:38:55 -04:00
cdf17986aa Removed unnecessary let 2019-05-07 08:38:55 -04:00
b95a5330b7 Moved automatic_group fabrication to top level 2019-05-07 08:38:55 -04:00
5af63def61 Prefabricate group at the top level 2019-05-07 08:38:55 -04:00
df63080bca Prefabricate staff_post at the top level 2019-05-07 08:38:55 -04:00
db64bee0c4 Use prefabricated user 2019-05-07 08:38:55 -04:00
30676e8a56 Brought prefabrication of another_user to the top level 2019-05-07 08:38:55 -04:00
2c7ed7b848 Use prefabricated admin instead of creating new ones 2019-05-07 08:38:55 -04:00
2f706be43a Reuse prefabricated moderator instead of creating new ones 2019-05-07 08:38:55 -04:00
16c7b86c86 Use prefabricated user and moderator 2019-05-07 08:38:55 -04:00
7472f15368 Prefabricate evil_trout 2019-05-07 08:36:29 -04:00
d3769fff95 Prefabricate admin 2019-05-07 08:36:29 -04:00
d0c7e3469d Prefabricated more things 2019-05-07 08:36:29 -04:00
4696be4c19 DEV: Fix failling test. 2019-05-07 11:19:13 +03:00
4ff1195537 FEATURE: Use Beacon API for tracking clicks. (#7483) 2019-05-07 16:37:43 +10:00
e219588142 DEV: Prefabrication (test optimization) (#7414)
* Introduced fab!, a helper that creates database state for a group

It's almost identical to let_it_be, except:

 1. It creates a new object for each test by default,
 2. You can disable it using PREFABRICATION=0
2019-05-07 13:12:20 +10:00
152238b4cf DEV: Prefer public_send over send. 2019-05-07 09:33:21 +08:00
9be70a22cd DEV: introduce new API to look up dynamic site setting
This removes all uses of both `send` and `public_send` from consumers of
SiteSetting and instead introduces a `get` helper for dynamic lookup

This leads to much cleaner and safer code long term as we are always explicit
to test that a site setting is really there before sending an arbitrary
string to the class

It also removes a couple of risky stubs from the auth provider test
2019-05-07 11:00:30 +10:00
18d742d334 FIX: Broken spec 2019-05-06 17:09:08 -04:00
31e100530f FEATURE: Flag count in post menu
This change shows a notification number besides the flag icon in the
post menu if there is reviewable content associated with the post.
Additionally, if there is pending stuff to review, the icon has a red
background.

We have also removed the list of links below a post with the flag
status. A reviewer is meant to click the number beside the flag icon to
view the flags. As a consequence of losing those links, we've removed
the ability to undo or ignore flags below a post.
2019-05-06 16:13:31 -04:00
e6843afa9e FIX: don't send post edit notification when hidden tags are changed 2019-05-06 15:45:06 -04:00
5de750d373 FIX: don't bump topics when hidden tags are added or removed 2019-05-06 14:52:18 -04:00
a40dcbde9b FIX: Do not move hidden post actions. (#7424)
Hidden (staff-only) post actions are whisper posts with no content, that
are later transformed by the client into post actions (discourse-assign
uses this).
2019-05-06 16:21:42 +03:00
bcdf5823a0 DEV: correct frozen string and broken spec
This needs to be properly handled so the correct message is raised

1 item was removed from the serializer (avg_time)
2019-05-06 17:31:35 +10:00
f8eddd40ad PERF: remove avg_time calculations and regular jobs from posts and topics
After careful analysis of large data-sets it became apparent that avg_time
had no impact whatsoever on "best of" topic scoring. Calculating avg_time
was a very costly operation especially on large databases.

We have some longer term plans of introducing other weighting that is read
time based into our scoring for "best of" and "top" topics, but in the
interim to stop a large amount of work that is not achieving any value we
are removing the jobs.

Column removal will follow once we decide on a new replacement metric.
2019-05-06 15:59:01 +10:00
e8fafbc123 List and restore missing post uploads from S3 inventory. 2019-05-04 01:16:20 +05:30
d82da69c2c FIX: Fail gracefully if username parameter is missing when creating user 2019-05-03 17:17:06 +01:00
0644c10bfe FIX: Prioritize VERP key over final_recipient header in bounced email
Per RFC3464 2.3.2, the final_recipient header may not match the address we originally sent the email to.
2019-05-03 12:12:44 +01:00
0d41d58d27 FIX: add ReadOnly hear to /srv/status 2019-05-03 12:21:07 +02:00
1815409a6f DEV: Remove migration tests that have served their purpose. 2019-05-03 14:07:29 +08:00
b948d97c8f FEATURE: Show diff of local changes before updating remote theme (#7443) 2019-05-02 21:43:54 -04:00
d252dad4f0 FIX: Can't remove user profile uploads.
Follow up to 24347ace10ad54f7f3bbc687bc7bc37734f558e4.
2019-05-02 16:54:10 +08:00
24347ace10 FIX: Properly associate user_profiles background urls via upload id.
`Upload#url` is more likely and can change from time to time. When it
does changes, we don't want to have to look through multiple tables to
ensure that the URLs are all up to date. Instead, we simply associate
uploads properly to `UserProfile` so that it does not have to replicate
the URLs in the table.
2019-05-02 14:58:24 +08:00
c9f6beba05 FIX: Incorrect DB query for AddUploadsToCategories migration.
This is a regression as a result of 7896c74c2bd161f85c976fcd8468797721df30d9. Most instances would have ran the migrations and some might have run this migration with the incorrect query. Impact of this is small for now but I'm fixing this for correctness purposes.
2019-05-02 14:58:24 +08:00