discourse/app/assets/javascripts/admin/controllers
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
..
admin-agree-flag.js.es6 FEATURE: backup without uploads 2014-08-20 18:53:58 +02:00
admin-api.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-backups-index.js.es6 Allow restoring from backups in development mode even if the setting is 2014-08-28 17:02:48 -04:00
admin-backups-logs.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-backups.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-badge-preview.js.es6 FEATURE: Badge query validation, preview results, and EXPLAIN 2014-08-31 11:25:44 -07:00
admin-badge.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-badges.js.es6 FEATURE: Badge query validation, preview results, and EXPLAIN 2014-08-31 11:25:44 -07:00
admin-commits.js.es6 ES6: Patch up a few issues with the admin controllers conversion 2014-07-25 14:17:58 -04:00
admin-customize-colors.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-customize-css-html.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-dashboard.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-delete-flag.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-edit-badge-groupings.js.es6 FEATURE: editable badge groups 2014-07-27 18:22:01 +10:00
admin-email-all.js.es6 ES6: Patch up a few issues with the admin controllers conversion 2014-07-25 14:17:58 -04:00
admin-email-index.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-email-preview-digest.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-email-sent.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-email-skipped.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-flags.js.es6 FEATURE: agree all the flags 2014-08-04 22:48:04 +02:00
admin-group.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-groups.js.es6 ES6: Patch up a few issues with the admin controllers conversion 2014-07-25 14:17:58 -04:00
admin-log-screened-ip-address.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-logs-screened-emails.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-logs-screened-ip-addresses.js.es6 ES6: Patch up a few issues with the admin controllers conversion 2014-07-25 14:17:58 -04:00
admin-logs-screened-urls.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-logs-staff-action-logs.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-reports.js.es6 ES6: Patch up a few issues with the admin controllers conversion 2014-07-25 14:17:58 -04:00
admin-site-content-edit.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-site-contents.js.es6 ES6: Patch up a few issues with the admin controllers conversion 2014-07-25 14:17:58 -04:00
admin-site-settings-category.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-site-settings.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-staff-action-log-details.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-start-backup.js.es6 FEATURE: backup without uploads 2014-08-20 18:53:58 +02:00
admin-suspend-user.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-user-badges.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin-user-index.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-user.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
admin-users-list.js.es6 Convert admin section controllers to ES6 modules 2014-07-25 14:17:58 -04:00
admin.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
change-site-customization-details.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
delete-site-customization-details.js.es6 ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00