8 Commits

Author SHA1 Message Date
Linca
12a3fdc246
FIX: Don't add only: nil serializing options of data explorer results (#381)
`only: nil` will cause ArraySerializer to overwrite the default Serializer
settings, which will cause Topic, Post, etc. to be serialized as empty
`{}`. We need to exclude the configuration without only.

The current test case only ensures that no error is raised, but does not
guarantee the accuracy of the result, which indirectly introduces this
bug. Additional tests are added to ensure consistent results.
2025-07-07 08:46:49 +08:00
Linca
12a26cc821
FEATURE: Add tag group entity support to query results (#380)
The data explorer has special logic (“Automatic Entity Resolution”) to
show links to various objects whenever a column name is `user_id`,
`group_id`, `topic_id`, `category_id` or `badge_id`.

This commit adds the support for `tag_group_id`
2025-07-03 11:32:46 +08:00
Natalie Tay
a0a7f8d999
FIX: Add new attribute that is required when using the basic topic serializer (#375)
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.
2025-05-20 18:54:58 +08:00
Gary Pendergast
d726c4889e
DEV: Split the Query Listing and Query Editing code (#356)
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.
2025-02-10 14:54:01 +11:00
Jarek Radosz
ba9ead855e
DEV: Fix autoloading (#322)
A follow-up to e23c31195b097223f030800614b55d09bf54d086

Fixes errors like:
```
NameError:
       uninitialized constant DiscourseDataExplorer::ValidationError
     # ./plugins/discourse-data-explorer/spec/lib/parameter_spec.rb:15:in `block (3 levels) in <main>'
```
2024-08-28 10:11:08 +02:00
Loïc Guitaut
c19fca4060
DEV: Update rubocop-discourse to version 3.8.0 (#292) 2024-05-28 11:16:14 +02:00
Martin Brennan
5776aa7fc9
FEATURE: Add JSON result type component (#260)
If a column is payload or contains _payload it will be assumed
it has JSON data in it, then we will show the truncated JSON in the
result column with a button to show the full-screen formatted
JSON using our full-screen code viewer. We also do the same if
the column is the `json` postgres data type.
2023-11-02 09:50:05 +10:00
Bianca Nenciu
206d937a78
DEV: Update plugin to match latest guidelines (#229)
This commit updates the plugin to the latest guidelines, as shown in
discourse-plugin-skeleton, which involves moving a lot of the code to
dedicated files, use proper namespaces, use the autoloader as much as
possible, etc.
2023-03-22 23:29:08 +02:00