136 Commits

Author SHA1 Message Date
Discourse Translator Bot
37e72e9ad7
Update translations (#31994) 2025-03-25 17:22:59 +01:00
Sam
afd5975041
FIX: looking at wrong period in statsText (#31986) 2025-03-25 17:18:02 +11:00
Sam
ad992d7b2d
FIX: destroy automation not working (#31945)
We had some legacy code due to previous controller based automation

---------

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2025-03-21 15:22:33 +11:00
Sam
8c8bc94ed8
FEATURE: Add automation statistics tracking to Automation (#31921)
introduces comprehensive statistics tracking for the Discourse
Automation plugin, allowing users to monitor the performance and
execution patterns of their automations:

- Add `discourse_automation_stats` table to track execution metrics
including run counts, execution times, and performance data
- Create a new `Stat` model to handle tracking and retrieving automation
statistics
- Update the admin UI to display automation stats (runs today/this
week/month and last run time)
- Modernize the automation list interface using Glimmer components
- Replace the older enable/disable icon with a toggle switch for better
UX
- Add schema annotations to existing models for better code
documentation
- Include extensive test coverage for the new statistics functionality

This helps administrators understand how their automations are
performing and identify potential bottlenecks or optimization
opportunities.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Ted Johansson <ted@discourse.org>
2025-03-21 12:53:26 +11:00
Sam
0e62acd57f
FEATURE: enhance post created edited trigger in automation (#31900)
1. **Multiselect Support for Choice Fields**
   - Added a `multiselect` option to the choices field component
   - Updated Field model to accept arrays as values for choices fields

2. **Post Content Feature Filtering**
   - Added ability to filter posts based on content features:
     - Posts with images
     - Posts with links
     - Posts with code blocks
     - Posts with uploads

3. **Improved Group Filtering**
- Renamed `restricted_user_group` to `restricted_groups` to allow
filtering by multiple groups
- Added `excluded_groups` to replace `ignore_group_members` which was
complex for end users
- Renamed `restricted_groups` to `restricted_inbox_groups` for more
specific PM filtering and clarity.

4. **Public Topics Filter**
- Added a "Public Topics" filter option that excludes all secure
categories
2025-03-20 08:05:06 +11:00
Discourse Translator Bot
464da9a4fb
Update translations (#31875) 2025-03-18 15:08:14 +01:00
Alan Guo Xiang Tan
f09c8f61c8
DEV: Fix flaky automation system test (#31867)
This commit updates `PageObjects::Pages::Automation#update` to check
that the button is not disabled before clicking the button.

### Reviewer notes

Instances of flakiness:
1.
https://github.com/discourse/discourse/actions/runs/13864294630/job/38801362996
2.
https://github.com/discourse/discourse/actions/runs/13392214535/job/37402368070
2025-03-18 15:13:59 +08:00
Discourse Translator Bot
d3c68ef1a7
Update translations (#31747) 2025-03-11 17:47:42 +01:00
Jarek Radosz
25048b5a8d
DEV: Update lint-configs and rubocop-discourse (#31728)
…and autofix issues

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-03-10 19:52:19 +01:00
Sam
50310ea96d
FEATURE: improve post_created_edited automation triggers (#31694)
- Allow deciding if we include or exclude sub categories
- Allow filtering to only look at PMs or Topics
- Allow selection of multiple categories
- Migrations to carry all data into new structure

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-03-08 08:18:30 +11:00
Krzysztof Kotlarek
4bb1e0d113
FIX: loop detection works as expected and does not need logging (#31686)
Logging creates impression that something is not working while
everything is working as expected.
2025-03-07 16:41:29 +11:00
Discourse Translator Bot
b467fe1347
Update translations (#31617) 2025-03-04 16:12:11 +01:00
Joffrey JAFFEUX
699541af75
FEATURE: limits post created edited trigger to a group (#31523)
This commit allows admins to limit the post created/edited trigger
execution to a specific post user group.

It's for example useful if you want to auto tag all the topics created
by member of a specific group.
2025-02-26 10:52:40 +01:00
Discourse Translator Bot
61d8cce569
Update translations (#31501) 2025-02-25 15:11:27 +01:00
David Battersby
44aa0eda27
UX: add automation script description for pm sender (#31478)
Adds a description to highlight the need for sender to have correct
permissions when sending PM. Without the correct permissions the PM is
not sent and a message is added to the site logs.
2025-02-24 15:54:41 +04:00
Discourse Translator Bot
122e1384bc
Update translations (#31470) 2025-02-24 15:11:55 +11:00
Bianca Nenciu
23cfab8f19
FIX: Recover from failing automations (#31413)
If Jobs::DiscourseAutomation::Tracker fails during execution of a
pending automation, then the remaining automation were no longer
executed.

Automation may fail for various reasons: a person has PMs disabled, rate
limit is reached, etc.
2025-02-20 12:45:06 +02:00
Discourse Translator Bot
b37b51d15f
Update translations (#31377) 2025-02-18 14:51:47 +01:00
Discourse Translator Bot
e925f9b7e8
Update translations (#31276) 2025-02-11 16:43:08 +01:00
Gary Pendergast
f439bf14cc
DEV: Refactor the Automation Plugin UI to match admin UI guidelines (#31060)
This change updates the Automation plugin to make use of the `use_new_show_route` plugin flag, as well as generally updating the UI to match current admin UI guidelines. Notable changes include:

- Moving template/router/controller files to make use of the `admin.adminPlugins.show` route.
- Changing the URIs from `/admin/plugins/discourse-automation` to `/admin/plugins/automation`, to match the `PLUGIN_NAME`.
- Adding UI wrappers around the New/Edit forms, and polishing the list of defined automations.
2025-02-05 14:34:15 +11:00
Discourse Translator Bot
8d810f9271
Update translations (#31123) 2025-02-03 16:37:54 +01:00
Discourse Translator Bot
4e2a982e91
Update translations (#31035) 2025-01-31 10:48:44 +01:00
Roman Rizzi
a1bbbbda02
DEV: Promote historic post_deploy migrations for core plugins. (#30987)
This commit promotes all post_deploy migrations which existed in
Discourse v3.3.0 (timestamp <= 20240717053710)
2025-01-24 11:47:03 -03:00
Discourse Translator Bot
f0d6e9758d
Update translations (#30898) 2025-01-21 15:55:30 +01:00
David Taylor
d88ee33eb6
DEV: Introduce stylelint (#29852)
Stylelint is a css linter: https://stylelint.io/

As part of this change we have added two javascript scripts:

```
pnpm lint:css
pnpm lint:css:fix
```

Look at `.vscode/settings.json.sample` and `.vscode/extensions.json` for
configuration in VSCode.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-01-20 15:27:42 +00:00
Discourse Translator Bot
496a739788
Update translations (#30765) 2025-01-14 16:19:49 +01:00
David Taylor
0ed4b09527
DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733)
`discourse-common` was created in the past to share logic between the
'wizard' app and the main 'discourse' app. Since then, the wizard has
been consolidated into the main app, so the separation of
`discourse-common` is no longer useful.

This commit moves `discourse-common/(lib|utils)/*` into
`discourse/lib/*`, adds shims for the imports, and updates existing
uses in core.
2025-01-13 13:02:49 +00:00
Natalie Tay
6dd306be55
DEV: Update a defensive test which case is no longer possible (#30640)
Introduced in https://github.com/discourse/discourse/pull/30263, it is also causing flaky tests.
2025-01-08 21:06:04 +08:00
Discourse Translator Bot
1d7b1e587a Update translations 2025-01-07 21:56:56 +01:00
Gabriel Grubba
0d62863951
FEATURE: Add trigger_on option to topic_tags_changed automation (#30391)
* FEATURE: default value to fields in automation

This PR adds the property `extra.default_value` to the fields in automation. This property is used to set the default value of the field.

Reducing the nil checks we have to do in automation fields.

I've added only testing in the `da-choices-field-test.js` file, but we could add tests to all the fields.

* FEATURE: Add trigger_on option to `topic_tags_changed` automation

This new field will allow users to specify when the trigger should be fired. The options are:
- `tags_added_or_removed`: The trigger will be fired when tags are added or removed from the topic.
- `tags_added`: The trigger will be fired when tags are added to the topic.
- `tags_removed`: The trigger will be fired when tags are removed from the topic.

This PR also brings a migration to set the `trigger_on` field to `tags_added_or_removed` for all existing `topic_tags_changed` automations.

* DEV: reorganize the specs in context blocks

* DEV: migration to add trigger_on field default value to topic_tags_changed_trigger

* DEV: `down` migration for `add_trigger_on_field_default_value_to_topic_tags_changed_trigger` migration

* Update plugins/automation/lib/discourse_automation/triggers/topic_tags_changed.rb

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>

* Update plugins/automation/config/locales/client.en.yml

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>

* DEV: lint files and update topic_tags_changed trigger to use `default_value`

* Revert "FEATURE: default value to fields in automation"

This reverts commit 4d32635c695b1da36dbe3343bb55c223a720106a.

* DEV: remove migration file

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-01-06 11:22:39 -03:00
Jarek Radosz
a4c2653db8
DEV: Update rubocop-discourse (#30552)
…and autofix the issues
2025-01-04 13:48:21 +01:00
Discourse Translator Bot
6c7eaf99af
Update translations (#30434) 2025-01-03 14:01:32 +01:00
Joffrey JAFFEUX
80cda1212e
DEV: do not check for loading state (#30530)
This shouldn't be necessary and is already causing flakyness today.
2025-01-02 11:08:23 +01:00
Martin Brennan
5711bf6f27
DEV: Move admin config pages out of /customize/ sub-route (#30511)
The customize routes add CSS classes that make these admin
config pages look different from the ones under /admin/config.
We want all config routes to be under /admin/config as well.

This commit moves the emoji, user fields, and permalinks pages
out of customize and into config, updating all references and
adding more rails routes as needed.

Also renames admin emojis route to emoji, emoji is singular and plural.
2025-01-02 09:13:11 +10:00
Ella E.
ddca2ca629
UX: Apply admin table to Automation settings page (#30341)
* UX: Apply admin table classes for consistent mobile styling on the automation page

* UX: Remove icon beside the automation page title

* DEV: Add status label to translations

* UX: Reorder the status and name when on mobile

* DEV: Add comment explaining tablet-specific status reorder

* DEV: Apply prettier
2024-12-19 05:07:14 -07:00
Discourse Translator Bot
1631c39391
Update translations (#30319) 2024-12-18 15:19:37 +01:00
Ted Johansson
c1c7ea8959
DEV: Change hide_email_address_taken default to true (#30293)
We're changing the default of hide_email_address_taken to true. This is a trade-off we want to make, as it prevents account enumeration with minimal impact on legitimate users. If you forget you have an account and try to sign up again with the same e-mail you'll receive an e-mail letting you know.
2024-12-17 10:46:04 +08:00
Joffrey JAFFEUX
41df705188
DEV: replaces topic-notifications-options by DMenu (#30298)
This commit introduces <NotificationsTracking /> which is a wrapper component around <DMenu /> which replaces the select-kit component <TopicNotificationsButton />.

Each tracking case has its dedicated component:

- topic -> `<TopicNotificationsTracking />`
- group -> `<GroupNotificationsTracking />`
- tag -> `<TagNotificationsTracking />`
- category -> `<CategoryNotificationsTracking />`
- chat thread -> `<ThreadNotificationsTracking />`
2024-12-16 19:59:18 +01:00
Natalie Tay
537f09912e
DEV: Memoize group find when adding users to groups (#30296) 2024-12-16 17:47:24 +08:00
Natalie Tay
622eb9e51c
FIX: Avoid zipping when adding users to groups (#30263) 2024-12-13 17:24:40 +08:00
moin-Jana
7c00c52c36
UX: Rename private to personal messages in the interface (#29679)
Rename "private messages" to "personal messages" in the interface
2024-12-12 11:44:19 +11:00
Discourse Translator Bot
c65192a7a2
Update translations (#30202) 2024-12-10 20:16:34 +01:00
David Taylor
a52b83333e
DEV: Correctly lint bundled plugins admin directory (#29999) 2024-12-02 16:31:21 +00:00
Gabriel Grubba
43414abf83
FIX: TopicTagsChanged trigger not working with multiple tags (#29961)
* FIX: `TopicTagsChanged` trigger not working with multiple tags

The check for when had multiple tags was being exclusive, you had to have all tags to trigger the automation, now it's inclusive, you can trigger the automation if you have any of the tags.

* DEV: add specs for when having multiple categories

* DEV: changed to use unions and intersections for tags

added more tests to check for multiple tags
2024-11-27 14:16:29 -03:00
Jarek Radosz
5db0eba0a8
DEV: Autofix (w/ manual follow up) various qunit lints (#29950) 2024-11-27 13:02:55 +01:00
Discourse Translator Bot
b9f183e2c3
Update translations (#29934) 2024-11-26 23:14:56 +01:00
Loïc Guitaut
f87333c4e0 DEV: Refactor DiscourseAutomation::DestroyAutomation a bit
Small followup to 932bd6b.
2024-11-22 16:05:31 +01:00
David Taylor
6f7c581a80
DEV: Bump @discourse/lint-configs and autofix (#29847)
In particular, this applies:

- new `discourse/no-implicit-this` template-lint rule
- `init`/`willDestroy` ordering enforcement
- `lines-between-class-members`
2024-11-20 14:15:04 +00:00
Discourse Translator Bot
abfd065ff0
Update translations (#29835) 2024-11-20 00:21:25 +01:00
David Taylor
32665cf9dd
DEV: Consolidate i18n import paths (#29804)
Enables our new eslint rules which enforce consistent i18n imports. For more info, see 0d58b40cd7
2024-11-19 20:45:18 +00:00