discourse/app/assets/javascripts/admin/views
riking 1833b43ae2 FEATURE: Badge query validation, preview results, and EXPLAIN
Upon saving a badge or requesting a badge result preview,
BadgeGranter.contract_checks! will examine the provided badge SQL for
some contractual obligations - namely, the returned columns and use of
trigger parameters.

Saving the badge is wrapped in a transaction to make this easier, by
raising ActiveRecord::Rollback on a detected violation.

On the client, a modal view is added for the badge query sample run
results, named admin-badge-preview.
The preview action is moved up to the route.
The save action, on failure, triggers a 'saveError' action (also in the
route).

The preview action gains a new parameter, 'explain', which will give the
output of an EXPLAIN query for the badge sql, which can be used by forum
admins to estimate the cost of their badge queries.
The preview link is replaced by two links, one which omits (false) and
includes (true) the EXPLAIN query.

The Badge.save() method is amended to propogate errors.

Badge::Trigger gets some utility methods for use in the
BadgeGranter.contract_checks! method.

Additionally, extra checks outside of BadgeGranter.contract_checks! are
added in the preview() method, to cover cases of null granted_at
columns.

An uninitialized variable path is removed in the backfill() method.

TODO - it would be nice to be able to get the actual names of all
columns the provided query returns, so we could give more errors
2014-08-31 11:25:44 -07:00
..
logs Add screening by IP address. When deleting a user as a spammer, block all signups from the same IP address. 2013-10-21 14:50:18 -04:00
modals FEATURE: Badge query validation, preview results, and EXPLAIN 2014-08-31 11:25:44 -07:00
report ES6: Migrated and deprecated a bunch of views 2014-06-10 11:54:38 -04:00
ace_editor_view.js Enable JSHINT's `unused` option. It caught a bunch of suspicious stuff which is fixed in this commit. 2013-12-30 13:30:22 -05:00
admin_api_view.js basic api support 2013-03-25 18:04:46 -07:00
admin_backups_logs_view.js backup & restore client-side code 2014-02-13 13:31:13 -08:00
admin_backups_view.js backup & restore client-side code 2014-02-13 13:31:13 -08:00
admin_customize_colors_view.js Theming: color scheme editing. Unfinished! Doesn't have any effect on css files yet. 2014-04-24 16:49:12 -04:00
admin_customize_view.js Theming: color scheme editing. Unfinished! Doesn't have any effect on css files yet. 2014-04-24 16:49:12 -04:00
admin_dashboard_view.js Remove unusued site_settings, show checkbox in UI for boolean values, remove restrict_access 2013-03-01 14:27:41 -05:00
admin_flags_view.js FEATURE: flag dispositions normalization 2014-07-28 19:28:07 +02:00
admin_ip_locator_view.js ip locator on ipinfo.io basis added to admin 2014-06-18 09:22:44 +02:00
admin_site_settings_category_view.js Add site setting category support 2013-11-14 16:02:13 -05:00
admin_user_view.js FEATURE: Admin selector to choose a primary group for a user, display it 2014-02-10 17:00:15 -05:00
site_setting_view.js FIX: handle enter key with a better way on site setting string inputs 2014-07-15 17:32:45 -04:00