The `category_id` parameter now includes the *(no category)* option, which allows clearing a previously selected category.
The *(no category)* option is selected by default.
---------
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
In discourse/discourse#32618 we added the dependency on locales to the basic topic serializer gated behind SiteSetting.experimental_content_localization. This is so that fancy_titles can be rendered in the language of the user.
Error: `ActiveModel::MissingAttributeError (missing attribute 'locale' for Topic)`
This commit adds that dependency to extra_data_pluck_fields which lists fields required from the serializer.
This change updates the report generator script to handle groups first, that way when the option users_from_group: true is used we can determine query access based on the user rather than the whole group.
This change adds an option to the Schedule a PM with Data Explorer results script, which when selected will send individual PMs to each group member selected in the Send to User, Group or Email field.
When this field is not checked, the functionality for groups will work as it did before (ie. send a single PM to the group).
When passing date values for reports as URL parameters, they were being parsed by the standard JavaScript Date object, which due to legacy reasons parses date-only strings in UTC, all other date formats are assumed to be in the browser's local timezone.
This change switches to using moment's parser, which assumes that all strings passed to it are in the browser's local timezone.
When setting up an automation to create a DM or a post with a report on a recurring basis, and using a Data Explorer query that has parameters, we encounter an error.
The `.params_to_hash` method currently expects an array of arrays for the parameters, but in reality they seem to be arrays of hashes.
This change makes `.params_to_hash` work with arrays of hashes. It also preserves the ability to work with nested arrays in case this is used somewhere else.
This is a follow-up to d726c4889e5c5d7726ed1035c37d0cd60a3bb3d6.
The previous change missed changing the name of the query object when passing it to QueryResultsWrapper, which resulted in the download links not working properly after a query was run.
This change fixes that bug, and includes an acceptance test to ensure it stays fixed during future work on this plugin.
The code for listing all of the defined queries is mixed together with the code for editing a single query. Notably, this results in large amounts of unnecessary data being loaded for the list view, which causes substantial rendering slowdowns.
To address this issue, we now only load the necessary data for the list view, and load the full data when it's actually needed (any endpoint that returns a single query). The primary changes that achieve this are:
- Create a new `QueryDetailsSerializer` serialiser, which includes all of the query info, and change the existing `QuerySerializer` serialiser to only include the necessary attributes of each query for generating a list of them all.
- Split the monolith `/plugins/explorer` route into `/plugins/explorer` for showing just the list of queries, and `/plugins/explorer/queries/:query_id`, for showing/editing/running a specific query.
When reading an existing state from the params defaults or from URL params, the input elements weren't representing the right state for booleans and "3-state/null booleans".
internal /t/-/118495
When checking `attach_csv` in the `Schedule a PM with Data Explorer results`
automation script, `csv` has to be added to the list of authorized extensions in the site settings. This will now raise an error if it's not the case.
Another private plugin is extending this plugin and the current_user check here is a problem -- adding safe navigation does not break any existing functionality but allows for future changes.
Followup da1c99ec2d272a4eac8586a8b61794e8b755619b
We already had the functionality to convert results like
this:
```
|blah_url|
|--------|
|3,https://test.com|
```
To a link clientside, so in the UI it looks like this:
```
<a href="https://test.com">3</a>
```
With the addition of the recurring report to post automation,
and the existing report to PM automation, we also need to be
able to do this server-side, so reports don't come out malformed
if they have these type of count + URL columns.
The primary key is usually a bigint column, but the foreign key columns
are usually of integer type. This can lead to issues when joining these
columns due to mismatched types and different value ranges.
This script is similar to the existing one that schedules
report results to to be sent to a PM on a regular basis,
but instead takes a topic ID and posts to that. This way
people can have report results sent to a public topic regularly
too and not have to deal with PM recipients and so on.