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.
The reverted commit pinned the plugin version on stable because the changes in that commit aren't compatible with stable. However, the version that we pinned the plugin to has a bug on stable and 50e62d84e8 fixes that bug. So we need to temporarily revert 5e24556b24 to unpin the plugin and I'll create another PR to undo this revert and re-pin the plugin version to this commit for sites on stable.
Meta topic: https://meta.discourse.org/t/data-explorer-editing-broken-on-stable/181274/11?u=osama.
We recently merged a Discourse core's PR to replace usages of Ember's debounce and discourseDebounce with a new debounce wrapper. The new wrapper works exactly like Ember's debounce but internally calls "run" when called in test mode.
This PR replaces all usages of other debounce functions with the new wrapper and fallbacks to Ember's debounce for backward-compatibility.
By removing the catch and letting the error propagate to the top-level error handler, we can receive more detailed error reports including exactly which request failed.
The assumption that any request failure is a permissions error is replaced by an explicit client-side check before making any requests.
The toString() that was introduced in 80ffc45 was preventing any actively permitted groups from displaying in the group picker when entering a query page.
This rake task is responsible for fixing broken ids - move them back to the original values - ones before migration to a separate table.
Rake task can only fix queries with unique names.
In the test, we are creating duplicated queries and using `original_id` 4. Spec is ensuring that after rake tasks valuation, queries id is different than `4`
However, spec run in random order may create a query with id 4 and in that case, the spec would fail.
Therefore, when we create queries for test purpose, we should control what ids they are given to avoid conflict.
Reintroduces the migration removed in `cdfc5d4`, and fixes it to work with `query_groups`. Since the code is fairly complex, I moved into a rake task so it can be tested and make sure it works.