Commit Graph

498 Commits

Author SHA1 Message Date
6e161d3e75 DEV: Allow fab! without block (#24314)
The most common thing that we do with fab! is:

    fab!(:thing) { Fabricate(:thing) }

This commit adds a shorthand for this which is just simply:

    fab!(:thing)

i.e. If you omit the block, then, by default, you'll get a `Fabricate`d object using the fabricator of the same name.
2023-11-09 16:47:59 -06:00
9db4eaa870 DEV: Change anonymous_posting_min_trust_level to a group-based setting (#24072)
No plugins or themes rely on anonymous_posting_min_trust_level so we
can just switch straight over to anonymous_posting_allowed_groups

This also adds an AUTO_GROUPS const which can be imported in JS
tests which is analogous to the one defined in group.rb. This can be used
to set the current user's groups where JS tests call for checking these groups
against site settings.

Finally a AtLeastOneGroupValidator validator is added for group_list site
settings which ensures that at least one group is always selected, since if
you want to allow all users to use a feature in this way you can just use
the everyone group.
2023-10-25 11:45:10 +10:00
97a812f022 FIX: Hide core plugins from the admin Plugins list (#23328)
Most of the core plugins were already hidden, this hides
chat, styleguide, and checklist to avoid potential confusion
for end users.

Also removes respond_to? :hide_plugin, since that API has been
in place for a while now.
2023-08-31 10:01:01 +10:00
9db047a76c Update translations (#23309) 2023-08-29 15:50:52 +02:00
23222aa2d4 Update translations (#23099) 2023-08-15 21:24:57 +02:00
5b6493ff4b Update translations (#23013) 2023-08-08 15:42:28 +02:00
09223e5ae7 DEV: Remove enable_experimental_hashtag_autocomplete logic (#22820)
This commit removes any logic in the app and in specs around
enable_experimental_hashtag_autocomplete and deletes some
old category hashtag code that is no longer necessary.

It also adds a `slug_ref` category instance method, which
will generate a reference like `parent:child` for a category,
with an optional depth, which hashtags use. Also refactors
PostRevisor which was using CategoryHashtagDataSource directly
which is a no-no.

Deletes the old hashtag markdown rule as well.
2023-08-08 11:18:55 +10:00
d5f4b8e02c Update translations (#22904) 2023-08-01 16:05:44 +02:00
76649550c2 Fix typo in not_enough_dice
From https://www.collinsdictionary.com/dictionary/english/dice:
> In old-fashioned English, 'dice' was used only as a plural form, and the singular was die, but now 'dice' is used as both the singular and the plural form.
2023-07-31 13:28:42 +02:00
ad9ad55870 Update translations (#22664) 2023-07-25 17:57:48 +02:00
3da29a06fd Update translations (#22081) 2023-06-13 15:18:44 +02:00
10ee92656c FIX: Send TL2 promotion message to correct user (#21978)
Usually, when a user is promoted to TL2 two messages are sent. The
first one is a system message 'tl2_promotion_message' which triggers a
'system_message_sent' Discourse event.

When the event is fired and if Discourse Narrative Bot is enabled, then
a second message is sent to the recipient of the first message. The
recipients was determined by looking at the list of users that can
access that topic and pick the last one. This method does not work if
'site_contact_group_name' site setting is set because it adds the group
in the list of recipients.

A solution to this problem would have been to select the last user in
the list of 'topic_allowed_users', but an even better solution is to
pass the name of the recipients when the 'system_message_sent'
Discourse event is fired.
2023-06-07 22:51:24 +03:00
4e99ef3952 Update translations (#21827) 2023-05-31 09:15:16 +02:00
0d7a742bb9 Update translations (#21702) 2023-05-23 21:23:44 +02:00
791630f08b Update translations (#21583) 2023-05-16 19:40:01 +02:00
76176eda9d Update translations (#21145) 2023-04-25 17:23:21 +02:00
430d6308a8 FIX: Render links with subfolders properly in Discobot
Currently, some links aren’t properly built in Discobot when Discourse
is hosted in a subfolder. This is because we’re providing
`Discourse.base_url` to the Rails helpers which contains the base URL
*with* the prefix. But Rails helpers already handle this prefix so the
resulting link gets the prefix twice.

The fix is quite simple: use `Discourse.base_url_no_prefix` instead of
`Discourse.base_url`.
2023-04-17 16:53:00 +02:00
9a562f54d7 Update translations (#21055) 2023-04-11 15:45:03 +02:00
171e8b679d Update translations (#20861) 2023-04-05 09:12:48 +02:00
4cf065c480 Update translations (#20671) 2023-03-14 15:04:54 +01:00
e52bbc1230 UX/DEV: Review queue redesign fixes (#20239)
* UX: add type tag and design update

* UX: clarify status copy in reviewQ

* DEV: switch to selectKit

* UX: color approve/reject buttons in RQ

* DEV: regroup actions

* UX: add type tag and design update

* UX: clarify status copy in reviewQ

* Join questions for flagged post with "or" with new I18n function
* Move ReviewableScores component out of context
* Add CSS classes to reviewable-item based on human type

* UX: add table header for scoring

* UX: don't display % score

* UX: prefix modifier class with dash

* UX: reviewQ flag table styling

* UX: consistent use of ignore icon

* DEV: only show context question on pending status

* UX: only show table headers on pending status

* DEV: reviewQ regroup actions for hidden posts

* UX: reviewQ > approve/reject buttons

* UX: reviewQ add fadeout

* UX: reviewQ styling

* DEV: move scores back into component

* UX: reviewQ mobile styling

* UX: score table on mobile

* UX: reviewQ > move meta info outside table

* UX: reviewQ > score layout fixes

* DEV: readd `agree_and_keep` and fix the spec tests.

* Fix the spec tests

* fix the quint test

* DEV: readd deleting replies

* UX: reviewQ copy tweaks

* DEV: readd test for ignore + delete replies

* Remove old

* FIX: Add perform_ignore back in for backwards compat

* DEV: add an action alias `ignore` for `ignore_and_do_nothing`.

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
Co-authored-by: Vinoth Kannan <svkn.87@gmail.com>
2023-03-02 16:40:53 +01:00
4855a2879c UX: Update badge icons (#20462) 2023-02-28 10:42:05 +08:00
76260a4d79 Update translations (#20389) 2023-02-21 17:12:10 +01:00
f7c57fbc19 DEV: Enable unless cops
We discussed the use of `unless` internally and decided to enforce
available rules from rubocop to restrict its most problematic uses.
2023-02-21 10:30:48 +01:00
43800eeb73 Update translations (#20370) 2023-02-20 11:01:01 +01:00
8b4d571b9b Update translations (#20183) 2023-02-06 16:49:27 +01:00
a5c2146dc0 Update translations (#20101) 2023-01-31 15:21:00 +01:00
79bea9464c PERF: Move user-tips and narrative to per-user messagebus channels (#19773)
Using a shared channel with per-message permissions means that every client is updated with the channel's 'last_id', even if there are no messages available to them. Per-user channel names avoid this problem - the last_id will only be incremented when there is a message for the given user.
2023-01-30 11:48:09 +00:00
8bec4e1db9 FIX: remove link to site with inappropriate content
As reported on https://meta.discourse.org/t/253028, the linked site includes
language which we do not support.
2023-01-26 16:34:23 -05:00
8b72f489e1 Update translations (#19974) 2023-01-24 16:32:34 +01:00
4ac37bbe0f Update translations (#19897) 2023-01-18 11:42:54 +01:00
14983c5b8e FIX: New hashtag support for narrative bot advanced narrative (#19875)
The discobot advanced tutorial was failing when the new hashtags
were enabled with enable_experimental_hashtag_autocomplete set
to true, since the CSS selector is different. This commit fixes
the issue and also changes the instructions if this is enabled since
we no longer require the hashtag to not be at the start of the line.

c.f. https://meta.discourse.org/t/it-is-impossible-to-complete-the-hashtag-section-of-the-discobot-advanced-tutorial/251494
2023-01-17 10:16:28 +10:00
7c97548159 FIX: Fix incorrect hashtag setting migration (#19857)
Added in c2013865d78d353280ae68135b4c218e21ffb566,
this migration was supposed to only turn off the hashtag
setting for existing sites (since that was the old default)
but its doing it for new ones too because we run all migrations
on new sites.

Instead, we should only run this if the first migration was
only just created, meaning its a new site.
2023-01-16 10:53:00 +10:00
055310cea4 DEV: Apply syntax_tree formatting to plugins/* 2023-01-07 11:11:37 +00:00
ebe8b868bf Update translations (#19633) 2022-12-28 13:32:29 +01:00
19214aff18 DEV: Clean up all message bus subscriptions (#19268)
1. "What Goes Up Must Come Down" – if you subscribe to message bus, make sure you also unsubscribe
2. When you unsubscribe - remove only your subscription, not **all** subscriptions on given channel

Attempt #2. The first attempt tried to extend a core `@bound` method in new-user-narrative plugin which did not work. I reworked that plugin in the meantime. This new PR also cleans up message bus subscriptions in now core-merged chat plugin.
2022-12-12 16:32:25 +01:00
58ffa06d4a Update translations (#19340) 2022-12-06 16:22:23 +01:00
5c9bb73ffe DEV: Remove discobot pm scrolling code (#19300)
1. Originally the feature did "Scroll to new posts when user is near bottom of PM" (74e188992483e8d55376a98b33a440c022c098de)
2. Then that feature was limited to "Only scroll to posts that are not your own in PMs." (4a2656192733ca84de8a702cbaf2c36651bf2368)
3. It was limited further to "Only scroll PMs on new message" (eaf7746ec9c73ea41cbf94775a9a6f842076cad7)
4. And later to "only scroll to bottom for discobot" (267d129f38d6d45d0863014bf93ad1bf932c70b3)
5. And the code was relegated to new-user-narrative plugin (48b7696dbc96e2d49a1d7ee84b68c1754bfaa0ea)

I don't think it's worth it to keep this scrolling code just for this very small specific case.

This did potentially confict with other post scrolling code, and also using `modifyClass` is something we'd like to avoid.
2022-12-03 18:35:54 +01:00
ef31c7df63 DEV: Remove unused new-user-narrative code (#19299)
This method override was misnamed from the beginning and nobody noticed that this special bookmark handling was missing so…
2022-12-02 17:46:49 +01:00
49e0fc04f7 Revert "DEV: Clean up all message bus subscriptions (#18675)" (#19267)
This reverts commit b0839ccf27217d9a2be6866a6ac7e824d5104474.
2022-11-30 16:29:10 +00:00
b0839ccf27 DEV: Clean up all message bus subscriptions (#18675)
1. "What Goes Up Must Come Down" – if you subscribe to message bus, make sure you also unsubscribe
2. When you unsubscribe - remove only your subscription, not **all** subscriptions on given channel
2022-11-30 16:49:51 +01:00
2eee6fb644 Update translations (#19150) 2022-11-22 15:01:19 +01:00
33f601c8ad Update translations (#19033) 2022-11-16 11:39:47 +01:00
d7844a797f Update translations (#18948) 2022-11-09 00:00:28 +01:00
82425b23ee Update translations (#18813) 2022-11-02 15:13:47 +01:00
5f02f11acc Update translations (#18740) 2022-10-25 17:00:49 +02:00
8304f40f84 FIX: Correctly debounce various functions (#18673)
Debouncing inline anonymous functions does not work.

This fixes all instances of that error by extracting the function or using the new `@debounce(delay)` decorator
2022-10-20 13:28:09 +02:00
0af2837b73 Update translations (#18642) 2022-10-19 15:19:28 +02:00
d00cd3295e Update translations (#18183) 2022-09-13 16:04:18 +02:00
fa58eea64e DEV: Minor code cleanup (#18225)
Various small changes made while debugging MessageBus-related tests.
2022-09-12 14:05:21 +02:00