Commit Graph

271 Commits

Author SHA1 Message Date
Martin Brennan 8d19a33250
FIX: Optionally linkify URL columns server-side (#330)
Followup da1c99ec2d

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.
2024-10-14 16:33:13 +10:00
Linca 8a982beae9
UX: Automatically convert to lowercase in explorer-schema (#325)
* UX: Automatically convert to lowercase in explorer-schema

In the past, ExplorerSchema searches were case-sensitive, so if the
user's input method capitalized the first letter, it was likely that no
results would be found.

The new change allows you to enter uppercase letters, which will
automatically be converted to lowercase when searching.

meta topic: https://meta.discourse.org/t/can-the-data-explorer-search-input-be-converted-to-lower-case/323435
2024-09-02 12:02:36 +08:00
Jarek Radosz f62d8cc8a2
DEV: Update tests (#323)
new imports, resolved deprecations, qunit-dom, strict assertions, fixed flakes, migrated the legacy component test, typos, gjs
2024-08-28 13:51:37 +02:00
Jarek Radosz d31d89942e
DEV: Update ace-editor usage (#319)
AceEditor is now a glimmer component (see: https://github.com/discourse/discourse/pull/28492) and it follows the "data down, actions up" pattern.
2024-08-27 13:42:25 +02:00
锦心 68760cd3a5
UX: Rewrite date/time param-input using FormKit (#316)
This commit changes the date/time input (including `date`, `time`, and
`datetime` types) to the date/time input provided by FormKit.
2024-08-22 23:24:12 +08:00
锦心 24bd4ba099
UX: Use GroupChooser in `group_id` param input (#315)
This commit uses GroupChooser as the input for param input of type
group_id. Meanwhile, it improves invalid group validation and semantic
error prompts.
2024-08-22 17:46:12 +08:00
锦心 b47ba7ea60
DEV: Use Category's async method in param-input (#310)
This commit refactors the category id normalization of param-input to
use `Category.asyncFindBySlugPath`.

Now, the category id input will use an async query when the
default/initial value is category slug.

Co-authored-by: Natalie <1555215+nattsw@users.noreply.github.com>
2024-08-21 15:41:02 +08:00
锦心 6d179745ec
FIX: Empty param-inout form should reject submit (#309)
The `onSubmit` hook will only be triggered when the form is valid, so we
need to clear the contents of `serializedData` in advance in `submit`.
Otherwise, it may not throw a validation error.
2024-08-20 10:09:48 +08:00
锦心 5080ce9b1f
UX: Rewrite param-input using FormKit (#307)
What does this PR do?
=====================

This PR refactors param-input to use FormKit. FormKit is a structured
form tool in the core. After the rewrite, we will be able to get semantic 
parameter error prompts, etc.

meta link: https://meta.discourse.org/t/wishlist-param-dropdown-for-data-explorer-query/253883/28?u=lhc_fl
2024-08-20 09:42:50 +08:00
锦心 902b8c7913
UX: Using CategoryChooser for param param_input (#306)
This change changes the category selector to use CategoryChooser instead
of a bare text input to improve the user experience.

Related meta link: https://meta.discourse.org/t/wishlist-param-dropdown-for-data-explorer-query/253883/28
2024-08-13 16:03:26 +08:00
锦心 41dfa217ca
FIX: Wrong type in category_id param input (#304)
* FIX: Wrong type in category_id param input

We will dasherize category_id. The dasherize function accepts a string,
but we don't type-check it, so the default null may be passed in. This
will cause a type error and crash the front-end.
2024-08-05 20:11:16 +08:00
锦心 e0bfa66f5f
FIX: Create parameter input boxes after save (#303)
What does this fix?
===================

When creating a data explorer query that includes parameters, the
parameter input boxes don’t display until the page is refreshed.

After this commit, when the query is saved, the input boxes will appear.

ref: t/113297
2024-08-05 15:58:51 +08:00
锦心 6db96d6687
FEATURE: Add shortcut keys for save and execute for query editor (#299)
This is a very simple change that adds two shortcuts to the query editor
in Data Explorer: `ctrl+s` to save, and `ctrl+enter` to save and run the
query.

Related meta topic: https://meta.discourse.org/t/wishlist-ctrl-enter-to-run-the-data-explorer-query-im-editing/280564
2024-07-22 16:14:22 +08:00
锦心 6d975d7e90
FEATURE: Add Data Explorer Params to the URL for group queries (#298)
We have introduced a URL param mechanism for data explorer queries for administrators
in https://github.com/discourse/discourse-data-explorer/pull/128/
However, for data explorer queries in group page, URL params are not yet introduced.

This PR introduces this missing piece.

Related meta topic: https://meta.discourse.org/t/populate-data-explorer-params-with-url-params/169404/8
2024-07-05 17:49:18 +08:00
Osama Sayegh 7d99c621a9
FIX: Use correct label for column header (#297)
This commit changes the header for the first column of the queries table to have the correct label. Currently it says "Created by", but it should be "Query".
2024-07-02 00:13:04 +03:00
Martin Brennan 87d7958db8
FIX: Bookmarking group reports (#291)
Since 67a8080e33
in core, the functionality to bookmark a report from the group
Reports tab has been broken. This commit fixes the issue and adds
system spec coverage to prevent regression.
2024-05-22 09:18:09 +10:00
Jarek Radosz 9103fee7ab
DEV: Update htmlSafe import (#288) 2024-04-27 12:00:41 +02:00
Bianca Nenciu d8d7bbb778
DEV: Prefer Category.findById over categoryById (#285)
Category.findById should be used over site.categoryById map because
that is an implementation detail that might be removed in the future.
2024-03-27 18:44:02 +02:00
Penar Musaraj 2f1044820c
FEATURE: Add group_list parameter type (#283)
This allows admins to select multiple groups from a dropdown list and
filter results using that parameter.
2024-03-12 12:06:01 -04:00
Martin Brennan 48a4038809
FEATURE: Allow topic URL without post number for post_id param (#275)
This commit allows base topic URLs (e.g. https://meta.discourse.org/t/hide-text-in-text-select-popup-menu-feedback/287656)
to be used by the post_id parameter type. We just assume in this case
that the post_id for the param is 1.
2024-01-16 15:09:05 +10:00
Jarek Radosz 31ebf69d81
DEV: Update linting (#276) 2024-01-15 11:17:19 +00:00
Isaac Janzen 70458df7cc
DEV: Convert ajax functions to async (#273) 2024-01-02 12:38:22 -07:00
Isaac Janzen 3dd5ad0f9c
DEV: Update modal to component API (#269)
<img width="622" alt="Screenshot 2023-12-06 at 12 10 09 PM" src="https://github.com/discourse/discourse-data-explorer/assets/50783505/5a6fb0b2-829c-4af3-93c9-91676b78ab59">
2023-12-07 11:49:35 -07:00
Natalie Tay ac7df5e3d0
DEV: Use plugin name appropriately in warning (#270)
Use plugin name appropriately in warning
2023-12-07 16:09:06 +08:00
David Taylor a6341627d0
DEV: Resolve transitionTo deprecation (#268) 2023-12-01 16:02:52 +00:00
Jarek Radosz e067df0b43
DEV: Update linting (#267) 2023-12-01 16:47:54 +01: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
Martin Brennan b8b66ded0e
DEV: Use new bookmark modal (#252)
The new glimmer bookmark modal using d-modal is introduced
in:

https://github.com/discourse/discourse/pull/22532
2023-07-17 10:28:00 +10:00
Jordan Vidrine b56065f989
FIX: Increase z-index of th element (#253) 2023-07-12 15:51:56 -05:00
Kris 6b9bb24880
DEV: update box-shadow definition (#248) 2023-06-15 10:17:45 -04:00
Isaac Janzen c31d33a50c
DEV: Use angle bracket syntax (#246) 2023-05-26 14:27:40 -05:00
Canapin 6e8aeff437
UX: fix parameters inputs spacing (#245)
* UX: fix parameters inputs spacing

* trying to fix the linting errror 😬
2023-05-25 22:59:59 +02:00
Jan Cernik 2144e7b3ba
FIX: Show "false" and "0" in query result (#244) 2023-05-04 19:45:43 -03:00
Penar Musaraj 3907c49263
FIX: Reduce issues when debouncing schema search (#241)
Previously the debounced value was both setting the filter value and
updating the input's text value. This causes visible UI issues, because
the debounce updating the input's text value would sometimes reset it,
especially if/when typing quickly.

This PR also uses sticky positioning for the search form, so that it
stays visible even when scrolling the list of schema tables.
2023-04-18 10:33:25 -04:00
Joffrey JAFFEUX 97d60de92a
FIX: ensures explorer is using default values when provided (#240) 2023-04-17 09:06:27 -05:00
Isaac Janzen a208c1b054
FIX: Reset results on query redirect (#236)
# Problem

When switching group reports it was possible to have the `results` from a previous run (of a query) pass over to the rendering of a different query.

# Fix

Set the controllers `results` to `null` when first rendering the query

https://user-images.githubusercontent.com/50783505/228050384-5231f004-1dc2-4867-8d57-9db7706bb65f.mov
2023-03-28 11:01:47 -05: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
Isaac Janzen 075a508e52
FIX: Special attributes not working (#232)
# Context
Data explorer gives you the ability to use special attributes such as 👇 

> SELECT TIMESTAMP 'yesterday' as reltime$time

# Problem
During the upgrade to ember octane these were neglected and did not work. This PR updates them to working condition.

# Additional
- Drop unused action of `saveDefaults`
2023-03-10 11:41:59 -06:00
Krzysztof Kotlarek 466d4bb00c
FIX: clear state when reports are changed (#226)
When show report page is left, results should be cleared to not interfere with next report.
2023-02-22 16:25:33 +11:00
Isaac Janzen 556d12ac50
FIX: Maintain editing state after saving query changes (#223)
In the widget version of the data-explorer we would maintain the `editing` state after saving query changes. This was lost in upgrade to glimmer. 

# Current State
https://user-images.githubusercontent.com/50783505/217622464-79adaab6-84ed-4b64-93ae-c889aa8fb1bd.mp4

# Updated State
https://user-images.githubusercontent.com/50783505/217623475-1998fab6-0b70-42d2-923d-574efb9d5601.mov

# Other Changes
- `createProperties` was added back to the `query` model as it is being utilized in the creation of a new data explorer query. This was accidentally removed and was causing errors when trying to create a new query.
- Add new-query test
2023-02-08 13:40:53 -06:00
Isaac Janzen 04b2177749
DEV: Upgrade `query` model to Octane (#221)
- Upgrade `query` model to Octane
- Update `assets/javascripts/discourse/templates/admin/plugins-explorer.hbs` to access values via `this.`
2023-02-07 12:44:38 -06:00
Isaac Janzen 29cfa6383c
DEV: Convert raw-hbs to view only components (#222)
- Convert raw.hbs files to co-located view only components
2023-02-07 12:26:47 -06:00
Isaac Janzen 332ae394e8
DEV: Upgrade `group-reports` to Octane (#218) 2023-02-06 11:20:03 -06:00
Canapin d6b94706a0
UX: Reduce the table height (#220)
Prevent the table to have a fixed 1000px height with the horizontal scrollbar at the bottom of a mostly blank section when we have only a few results.
This change doesn't interfere with the sticky header.
2023-02-06 18:05:17 +01:00
Isaac Janzen 5a65c15463
DEV: Upgrade admin-plugins-explorer to Octane (#219) 2023-02-06 10:21:58 -06:00
Isaac Janzen 910b95bef8
FIX: Opening and closing of schema columns (#215)
Per: https://meta.discourse.org/t/cant-select-a-column-name-as-releasing-the-mouse-click-will-close-the-current-table-dropdown/250715/3

Fixed column toggling where columns should open and close when clicking column name, and not when clicking the column body.
2023-01-10 14:03:15 -06:00
Isaac Janzen 4d26cf78f0
DEV: Upgrade `admin-plugins-explorer` to Octane (#209)
- Drop `explorer-container` and move its logic to `admin-plugin-explorer` container
- Convert resizing of the query edit pane from jquery -> draggable modifier
2023-01-05 09:27:10 -06:00
David Taylor b1df914549
DEV: Update eslint-config-discourse, use prettier for hbs (#212) 2023-01-04 13:36:14 +01:00
Isaac Janzen 27b30b5efb
FIX: Group reports downloads (#213)
We were not passing the correct arguments through in the group reports template causing the download url to default to an admin route. This made downloads unavailable to non-admin users. Fixed by passing the correct values through.
2022-12-30 10:26:14 -06:00
Isaac Janzen f5cd03a451
FIX: Downloading query results (#211)
We were not passing the correct value from the `query-results-wrapper` to the `query-result` component causing downloads to fail.
2022-12-29 14:47:18 -06:00