Commit Graph

228 Commits

Author SHA1 Message Date
Guo Xiang Tan 5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Neil Lalonde 24cb950432 FEATURE: Watched Words: when posts contain words, do one of flag, require approval, censor, or block 2017-07-26 11:01:09 -04:00
Sam Saffron 045a2abcec FEATURE: remove the timecop gem
We should only have one way of mocking time, misuse of timecop
was causing build stability issues
2017-07-24 12:11:10 -04:00
Guo Xiang Tan fa09a02201 Fix specs. 2017-07-24 15:56:08 +09:00
Arpit Jalan 76981605fa FIX: don't raise error when inviting existing user to private topic via email
https://meta.discourse.org/t/inviting-existing-user-to-a-private-topic-message-via-email-shows-error-message/65994
2017-07-12 21:51:21 +05:30
Guo Xiang Tan 13f3de4bf6 Nuke all `SiteSetting.stubs` from our codebase. 2017-07-07 15:09:14 +09:00
Neil Lalonde fcb2f68565 FIX: duplicate topics and posts in summary email because user has muted tags and topics contain multiple tags 2017-07-04 16:12:10 -04:00
Neil Lalonde 3964929c75 FIX: summary email excludes all untagged topics if user has muted some tags 2017-07-04 12:52:25 -04:00
Robin Ward b93edc9945 FIX: Make sure censored words are on boundaries in topic titles 2017-06-28 13:13:40 -04:00
Guo Xiang Tan 4c98bd9d5f FIX: Can't update status_type of topic timers.
https://meta.discourse.org/t/topic-timers-internal-error-500/64805
2017-06-21 15:31:15 +09:00
Guo Xiang Tan 2fdf9068eb FIX: Create notification for group users when group has been invited.
https://meta.discourse.org/t/inviting-a-group-to-a-message-does-not-trigger-a-notification-mail/50509
2017-06-14 14:53:49 +09:00
Guo Xiang Tan b0dd05fdc6 FIX: Inherit topic auto close when changing topic's category. 2017-05-31 17:40:21 +09:00
Guo Xiang Tan 08c36fa968 REFACTOR: Clean up some code associated with topic timers. 2017-05-22 18:10:29 +08:00
Neil Lalonde 7821400141 FEATURE: staff can set a timer to remind them about a topic 2017-05-16 14:49:50 -04:00
Sam 44d7fe89ed FIX: unescape emoji in pretty title
This makes emoji in title consistent, it is later escaped back when needed
2017-05-15 10:28:05 -04:00
Neil Lalonde 55b61e9bea rename topic_status_update to topic_timer 2017-05-11 18:27:53 -04:00
Arpit Jalan 77a8cae094 FIX: rescue specific errors on invite failure 2017-05-02 15:13:33 +05:30
Guo Xiang Tan 59b906ab0d FEATURE: Disable minimum post length check when in PM with non human users.
https://meta.discourse.org/t/discourse-narrative-bot-beta-feedback/58621/65?u=tgxworld
2017-04-27 16:00:22 +08:00
Arpit Jalan aeead60036 FIX: make TopicEmbed trashable 2017-04-25 18:40:39 +05:30
Robin Ward e2ff06ce02 FIX: rounding error in spec 2017-04-07 17:44:02 -04:00
Robin Ward 40cee37bcc FIX: Don't insert topic status messages unless the status changes 2017-04-07 17:10:43 -04:00
Guo Xiang Tan ad44d2a400 Merge pull request #4790 from tgxworld/add_publish_to_topic_status_update
FEATURE: Allow admins to schedule a topic to be published in the future.
2017-04-04 11:18:53 +08:00
Guo Xiang Tan f4758a4c4d FEATURE: Allow admins to schedule a topic to be published in the future. 2017-04-04 11:16:05 +08:00
Arpit Jalan 5ff29ce321 add test case for topic status update based on last post 2017-04-03 22:35:56 +05:30
Guo Xiang Tan 34b7bee568 FEATURE: Allow admin to auto reopen at topic.
* This commit also introduces a `TopicStatusUpdate`
  model to support other forms of deferred topic
  status update in the future.
2017-03-31 11:14:18 +08:00
Arpit Jalan 295cf8839e FIX: better error message when invited user already exists 2017-03-22 13:55:28 +05:30
Sam 2c59ffeb2c FIX: token rotation not accounting for overlapping tokens correctly
also... freeze_time has no block form, correct all usages and specs
2017-02-15 10:58:18 -05:00
Robin Ward b251d11518 FIX: If you make a new banner, clear the old dismissed values 2017-02-03 15:07:38 -05:00
Arpit Jalan 6b8691ecea Merge pull request #4685 from techAPJ/approve-users-invite-fix
FIX: allow existing users to be invited to topic/message when must_approve_users is enabled
2017-02-03 13:22:18 +05:30
Arpit Jalan dc2171960b FIX: allow existing users to be invited to topic/message when must_approve_users is enabled 2017-02-03 13:01:23 +05:30
Neil Lalonde b91cb92af0 FIX: reports for time to first reply and topics without replies were counting whispers and moderator actions 2017-02-02 17:27:41 -05:00
Rimian Perkins 25516874b5 FIX: Escape regexp chars in `SiteSetting.censored_words`. 2017-01-31 10:14:51 +08:00
Guo Xiang Tan 0e5d490b05 No need for special helper to reset SiteSetting state.
* SiteSetting in tests uses a local provider that resets it.
2017-01-28 10:55:49 +08:00
Neil Lalonde 7ead3e1f18 fix failing specs 2017-01-27 16:17:10 -05:00
Guo Xiang Tan ce07da1d8b UX: Only display the words that fails censored words validations. 2017-01-24 13:11:05 +08:00
Guo Xiang Tan 3d21ccd4a5 FIX: Add validation to disallow censored words in topic title. 2017-01-09 16:55:41 +08:00
Sam c531f4ded5 remove rails-observers
Rails yanked out observers many many years ago, instead the functionality
was yanked out to a gem that is very lightly maintained.

For example: if we want to upgrade to rails 5 there is no published gem

Internally the usage of observers had quite a few problem.

The series of refactors renamed a bunch of classes to give us more clarity
and removed some magic.
2016-12-22 16:46:53 +11:00
Sam 2f6a4cc6de remove UserActionObserver, replace with after_save and service
interestingly there was some left over dead code from when stars
existed in the topic_users table
2016-12-22 16:46:53 +11:00
Sam 0a78ae739d Remove SearchObserver, aim is to remove all observers
rails-observers gem is mostly unmaintained and is a pain to carry forward
new implementation contains significantly less magic as a bonus
2016-12-22 13:13:14 +11:00
Neil Lalonde 74956694e5 If summary email finds no topics, show topics more than 1 day old from new users 2016-12-19 14:54:08 -05:00
Neil Lalonde 923cf73c6e Topic Featured Links: move data from custom fields to topics and categories tables. Invert behaviour of topic_featured_link_allowed checkbox. Fix a bug with invalid topic records due to changing that category checkbox. 2016-12-19 14:54:07 -05:00
Erick Guan 52763f5115
FEATURE: Allow posting a link with topics 2016-12-05 17:20:54 +01:00
Sam c04d4171ff FIX: whisper no longer experimental
- Regular users are not notified of whispers
- Regular users no longer have "stuck" topics in unread
- Additional tracking for staff highest post number
- Remove a bunch of unused columns in topics table
2016-12-02 17:03:31 +11:00
Neil Lalonde 7195a103ab FEATURE: digests choose topics you're watching or tracking first 2016-08-18 17:16:52 -04:00
Neil Lalonde 5849c345cc FEATURE: digest emails will try to choose topics from your tracked and watched categories first 2016-08-15 16:16:04 -04:00
Neil Lalonde 17b51bb465 FIX: topics tagged with muted tags should not be included in digest emails 2016-08-08 15:14:25 -04:00
Neil Lalonde 487c20959c FEATURE: max topics/replies per day for new users now starts counting from the first post, not signup date 2016-06-20 16:55:11 -04:00
Guo Xiang Tan b3a8f7d369 Merge pull request #4277 from tgxworld/fix_bug_when_post_creator_returns_nil
Fix bug when post creator returns nil
2016-06-20 18:15:52 +08:00
Guo Xiang Tan 9a0797204a
FIX: Add check to ensure post has been created. 2016-06-20 15:51:26 +08:00
Sam 8866169879 FEATURE: can invite/revoke groups on private messages 2016-06-20 16:29:27 +10:00
Guo Xiang Tan cb5be1fe8f
Upgrade rspec to 3.4.0. 2016-05-30 11:38:38 +08:00
shaktikatare1989 d1f61015c0 Fix: Editing a topic with an invalid title will still push it to the top (#4185)
* fix: Editing a topic with an invalid title will still push it to the top
* add specs to check topic not bumped with invalid title
2016-04-25 10:33:38 +02:00
Arpit Jalan 50fce0998f FEATURE: allow moderators to see offical warnings 2016-04-11 18:44:19 +05:30
Arpit Jalan 64feffbb60 FEATURE: site setting for suppressing categories from digest email 2016-03-26 01:06:03 +05:30
Neil Lalonde 213950e4cf FEATURE: add option to include topics from trust level 0 users in digest emails 2016-03-17 17:35:23 -04:00
Joe Buhlig 186a9630b7 Added spec for topic status update event 2016-03-07 10:40:06 -06:00
Sam 665fc44741 FIX: message_archived? not set correctly for groups 2016-01-19 18:35:46 +11:00
Régis Hanol 98c0fac461 FEATURE: add small action post when adding/removing users in messages 2016-01-11 12:42:06 +01:00
Andy Waite 3e50313fdc Prepare for separation of RSpec helper files
Since rspec-rails 3, the default installation creates two helper files:
* `spec_helper.rb`
* `rails_helper.rb`

`spec_helper.rb` is intended as a way of running specs that do not
require Rails, whereas `rails_helper.rb` loads Rails (as Discourse's
current `spec_helper.rb` does).

For more information:

https://www.relishapp.com/rspec/rspec-rails/docs/upgrade#default-helper-files

In this commit, I've simply replaced all instances of `spec_helper` with
`rails_helper`, and renamed the original `spec_helper.rb`.

This brings the Discourse project closer to the standard usage of RSpec
in a Rails app.

At present, every spec relies on loading Rails, but there are likely
many that don't need to. In a future pull request, I hope to introduce a
separate, minimal `spec_helper.rb` which can be used in tests which
don't rely on Rails.
2015-12-01 20:39:42 +00:00
Robin Ward d65ec1af2e Rename `ninja_edit_window` to `editing_grace_period` :'( 2015-11-24 14:28:42 -05:00
Sam Saffron 6dd4bc7d57 FEATURE: support group owner, capable of controlling group membership
Group owners are regular users that can add or remove users to a group
The Admin UX allows admins to appoint group owners
The public group UX will display group owners first and unlock UI to
add and remove members

Group owners can only be appointed on non automatic groups
Group owners may not appoint another group owner
2015-11-10 00:56:57 +11:00
James Kiesel 2fc52e26a6 Optimize all_allowed_users query 2015-10-29 19:39:30 +02:00
Sam ffb8cb8cac FEATURE: remove dependency of Redcarpet
PERF: cache fancy_title in topics table

New pure ruby implementation is far more flexible and easier to amend.
2015-09-24 13:37:53 +10:00
Régis Hanol 4f7140fb32 FIX: properly filter whispers in user stream 2015-09-22 00:50:52 +02:00
Robin Ward 5af0f5f80e FEATURE: Whisper posts 2015-09-11 14:05:21 -04:00
Robin Ward d1c69189f3 FEATURE: Can edit category/host relationships for embedding 2015-08-20 15:56:04 -04:00
Robin Ward 7b6d6b76eb FEATURE: Multiple embeddable hosts
- Also refactors two site settings components into one, with tests
2015-06-09 13:25:43 -04:00
Neil Lalonde ea8cf1a208 FIX: topic auto-close uses the client's time zone 2015-05-27 18:01:46 -04:00
Arpit Jalan 4324a157e0 FIX: rate limit topic invitations 2015-05-13 14:44:37 +05:30
Erick Guan a48dd1cc28 store the slug as the title is, only sanitize the slug
and prettify code
2015-05-05 18:33:16 +08:00
Erick Guan b772ff6e13 FEATURE: add slug geneartion options 2015-05-05 18:08:30 +08:00
Sam 803feefd54 MessageBus handles readonly redis now, no need to wrap it 2015-05-04 12:21:00 +10:00
Robin Ward 5b3f99aa50 Don't blow up if Redis switches to READONLY 2015-04-24 14:37:16 -04:00
Jason W. May 0f36774246 group manager can invite members into the group from any restricted topic 2015-03-03 12:18:42 -08:00
Régis Hanol bdb0b45834 Merge pull request #3148 from techAPJ/patch-1
Do not allow TL0 users topics in email digest
2015-01-29 17:50:21 +01:00
Robin Ward 6e862e0e59 FIX: Should flush rate limit keys before testing it 2015-01-29 11:45:12 -05:00
Arpit Jalan 21e94859a9 Do not allow TL0 users topics in email digest 2015-01-29 21:10:26 +05:30
Sam efc717c14a FEATURE: remove star concept from Discourse 2015-01-07 13:43:27 +11:00
Luciano Sousa b52f12948a models with rspec3 syntax 2015-01-05 13:04:23 -03:00
Erick Guan 97b3914b70 FIX: use utc time when generate reports; set boundary 2014-12-30 22:43:03 +08:00
Régis Hanol 10b5032188 FIX: auto-closing attribution when a TL4 user auto-closes a topic 2014-11-26 19:51:07 +01:00
Sam 8240a00829 correct spec 2014-11-14 18:10:52 +11:00
Erick Guan 667758ff40 Add stringex for Chinese slug generation 2014-11-11 21:12:07 +08:00
Régis Hanol fd5677808c SPEC: make sure digest doesn't pick any topics in categories that are muted 2014-11-03 16:57:50 +01:00
Régis Hanol e7f251c105 LOTS of changes to properly handle post/topic revisions
FIX: history revision can now properly be hidden
FIX: PostRevision serializer is now entirely dynamic to properly handle
hidden revisions
FIX: default history modal to "side by side" view on mobile
FIX: properly hiden which revision has been hidden
UX: inline category/user/wiki/post_type changes with the revision
details
FEATURE: new '/posts/:post_id/revisions/latest' endpoint to retrieve
latest revision
UX: do not show the hide/show revision button on mobile (no room for
them)
UX: remove CSS transitions on the buttons in the history modal
FIX: PostRevisor now handles all the changes that might create new
revisions
FIX: PostRevision.ensure_consistency! was wrong due to off by 1
mistake...
refactored topic's callbacks for better readability
extracted 'PostRevisionGuardian'
2014-10-27 22:06:43 +01:00
Régis Hanol 5754e8dd0f FEATURE: auto-close topics based on last post 2014-10-10 18:21:44 +02:00
Régis Hanol de76b512c1 fix most deprecations in the specs (still some left) 2014-09-25 17:44:48 +02:00
Sam 0f585bcdbe FIX: PM should never be allowed to have a category
FIX: TL3 should not be allowed to muck with PM titles
2014-09-11 17:39:34 +10:00
Sam 16b7004767 PERF: optimise and improve topic similarity search
FIX: shows up similarity search with blank results
2014-08-08 12:12:53 +10:00
Neil Lalonde b368667703 FIX: don't validate topic title if it isn't changing. topic stats were failing to update, causing necro topic warnings and other problems. 2014-08-01 17:30:07 -04:00
Régis Hanol bddffa7f9a FEATURE: flag dispositions normalization
All flags should end up in one of the three dispositions
  - Agree
  - Disagree
  - Defer

In the administration area, the *active* flags section displays 4 buttons
  - Agree (hide post + send PM)
  - Disagree
  - Defer
  - Delete

Clicking "Delete" will open a modal that offer to
  - Delete Post & Defer Flags
  - Delete Post & Agree with Flags
  - Delete Spammer (if available)

When the flag has a list associated, the list will now display 1
response and 1 reply and a "show more..." link if there are more in the
conversation. Replying to the conversation will NOT give a disposition.
Moderators must click the buttons that does that.

If someone clicks one buttons, this will add a default moderator message
from that moderator saying what happened.

The *old* flags section now displays the proper dispositions and is
super duper fast (no more N+9999 queries).

FIX: the old list includes deleted topics
FIX: the lists now properly display the topic states (deleted, closed,
archived, hidden, PM)
FIX: flagging a topic that you've already flagged the first post
2014-07-28 19:28:07 +02:00
Robin Ward fb8dda7f42 FIX: We should use `category_id` instead of `category_name` to perform
operations, now that the subcategory names are not unique.
2014-07-16 15:40:35 -04:00
Jeff Atwood 49dbded250 remove title_sanitize setting 2014-07-14 00:18:02 -07:00
Régis Hanol 00117c18c3 FEATURE: dismissable banner topic 2014-06-18 20:05:19 +02:00
Régis Hanol 30611c343c ensures only one banner topic at all time 2014-06-18 20:05:18 +02:00
Sam 3f07c1d0a1 Backend support for group invites 2014-05-09 18:22:35 +10:00
Louis Rose 1574485443 Perform the where(...).first to find_by(...) refactoring.
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
2014-05-06 14:41:59 +01:00
Benjamin Kampmann e502122c51 Add Custom Fields on Topics 2014-04-29 19:26:42 +02:00
Régis Hanol 454f11e597 FEATURE: new title_sanitize site setting 2014-04-18 21:01:21 +02:00
Régis Hanol b014d66b65 Merge pull request #2277 from vikhyat/fix-title-html
Fix HTML tags in topic titles
2014-04-18 11:37:33 +02:00