Commit Graph

125 Commits

Author SHA1 Message Date
锦心 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
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 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
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
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 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
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 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
Isaac Janzen 3e7605d8a0
DEV: Update params to use previously ran values on reload (#206)
After running a query with a non-default query param (inserting the new param into the url) we want to have the same params available after reloading the page. To do this we need to pass the updated params back up to the parent due to Octane's one direction data stream. I went over this with @pmusaraj and we both agreed this was extremely difficult to test due to needing to reload the page in a test, so we opted to move forward without one. A system test could be helpful in this case... I will investigate in a follow up PR.

- Move param-input tests to a dedicated file
2022-12-27 12:10:29 -06:00
Isaac Janzen 85c88c5d80
DEV: Better handling of no results (#205)
When there were no query results it would throw an error due to `this.resultCount` always passing as it is in the format of

```
"INTEGER - results returned"
```

so we need to grab the first index of the string and check if the integer is great than 0
2022-12-20 16:55:11 -06:00
Isaac Janzen 4c70cfa100
Upgrade `query-result` to Octane (#204)
* Upgrade query-result to Octane
2022-12-20 12:09:37 -06:00
Isaac Janzen cf365f7df2
Upgrade explorer-schema onetable/enum to Octane (#203)
* Upgrade explorer-schema onetable/enum to Octane
2022-12-20 10:30:43 -06:00
Isaac Janzen 147bfec207
Upgrade `data-explorer-bar-chart` to Octane (#201)
* Upgrade `data-explorer-bar-chart` to Octane
2022-12-16 11:52:00 -06:00
Isaac Janzen 7d1a9d487d
Upgrade `explorer-schema` to Octane (#202)
* Upgrade `explorer-schema` to Octane
2022-12-16 11:51:36 -06:00
Isaac Janzen 8028b9f16a
Upgrade `param-input` to Octane (#196)
* Convert `param-input` to glimmer components
2022-12-16 11:41:03 -06:00
Isaac Janzen 9025646dc9
Hotfix category_id lookup (#199)
74dfc39530/assets/javascripts/discourse/components/query-row-content.js (L34-L35)

needed to pass the site object to 'lookup' parent functions and was erroring on category lookup.
2022-12-15 08:26:40 -06:00
Isaac Janzen 74dfc39530
Upgrade query-row-content to Octane (#194)
* Upgrade query-row-content to octane
2022-12-13 09:21:01 -06:00
Isaac Janzen fea231f200
Upgrade share-report to Octane (#195)
* Upgrade share-report to Octane

* add requested changes
2022-12-13 08:49:39 -06:00
Jarek Radosz 07e009e862
DEV: Update linting setup and fix issues (#179) 2022-06-17 15:01:34 +02:00
Isaac Janzen 780232c902
DEV: Remove use of run-loop-and-computed-dot-access (#178)
Context: https://deprecations.emberjs.com/v3.x/#toc_deprecated-run-loop-and-computed-dot-access
2022-06-17 14:18:36 +02:00
Isaac Janzen 92bdea38b2
DEV: Remove 'htmlSafe' string prototype extensions (#176)
Context: https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions
2022-06-01 11:42:50 -05:00
Isaac Janzen 01f52dc5c5
DEV: Remove 'dasherize' string prototype extensions (#173)
Context: https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions
2022-05-13 12:43:37 -05:00
Isaac Janzen d5e11a2c65
DEV: Remove 'capitalize' string prototype extensions (#172)
Context: https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions
2022-05-13 12:33:38 -05:00
Jarek Radosz 86cda5f213
DEV: Lose the es6 suffix (#165) 2022-03-05 17:21:01 +01:00
David Taylor 2a17f49f66 DEV: Bump eslint-config-discourse and correct violations 2022-01-26 14:44:10 +00:00
Bianca Nenciu c6dd79c805
FIX: Do not stringify null parameters (#151)
Sometimes the query page did not load if one of the query was null
because it called null.toString() and raised an exception.
2022-01-17 13:45:40 +02:00
Guhyoun Nam 286b5b5fe7
FEATURE: Add Data Explorer Params to the URL on run (#128)
Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
2021-09-14 10:10:16 -05:00
Andrei Prigorshnev 4a98cc8af8
FEATURE: get rid of the import a query modal (#127)
This is the new version of #126. Now the pick-files-button moved to core. To import a query into Data Explorer, you need to push the button and then deal with the import modal. Instead, we want just to be triggering a system file picker directly. This PR makes it happen.
2021-08-20 14:26:48 +04:00
David Taylor 216dff3ed9
DEV: Improve logic for showing/hiding the reports tab in group screens (#107)
Previously this was adding an extra AJAX request to check if the group had any queries available. Now a boolean is included in the group serializer, so there is no need for the extra request.

Removing this ajax request will also stop other plugin JS integration tests from failing when the data-explorer plugin is installed.

This commit also fixes the HTML markup of the tab, so that it doesn't have a <ul> nested inside the existing <ul>. Also adds an icon for good measure.
2021-04-08 17:47:44 +01:00
Grayden 82cb3ac2fe
Allow admins to see the group reports nav item (#101)
Previously, the report tab would appear only if the user was a member of the group. With this change, admins can see the reports in any group.
2021-04-08 15:50:49 +01:00
Joffrey JAFFEUX 69f1e5d13b
DEV: uses discourse-common/lib/raw-templates (#98) 2021-02-24 19:49:26 +01:00
Roman Rizzi 50e62d84e8
FIX: Use Ember's debounce on stable. (#96)
We need to wrap the new debounce function inside a try block to avoid throwing a "module not found" exception.
2021-02-22 12:55:11 -03:00
Andrew Prigorshnev 4f33c22344
FEATURE: Add a graph report to query results (#93) 2021-02-18 12:06:22 +01:00
Joffrey JAFFEUX 8ab94e334c
DEV: prettier 2.2.1 (#89) 2021-01-27 10:38:56 +01:00