This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts
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 FEATURE: Badge query validation, preview results, and EXPLAIN 2014-08-31 11:25:44 -07:00
defer FIX: remove invalid hack, correct whitelist to use value returned from callback 2014-07-25 12:16:00 +10:00
discourse FEATURE: Badge query validation, preview results, and EXPLAIN 2014-08-31 11:25:44 -07:00
docs Ember Upgrade: 1.0 2013-10-01 11:16:27 -04:00
locales FEATURE: Allow localization sessions 2014-08-27 17:50:29 +10:00
admin.js.erb allow apps to give custom admin javascripts 2014-03-17 13:19:08 +01:00
application.js.erb FEATURE: allow plugins to overwrite handlebars templates 2013-12-31 16:43:29 +01:00
discourse.js FEATURE: logout redirect support 2014-08-15 12:57:29 +10:00
ember_include.js.erb fix build? 2013-12-23 17:53:33 +11:00
env.js Use query params for sortable table headings 2014-04-17 10:52:57 -04:00
jquery_include.js.erb Bump hashes on various files 2014-05-15 15:52:09 +10:00
main_include_admin.js ES6: Patch up a few issues with the admin controllers conversion 2014-07-25 14:17:58 -04:00
main_include.js UX: Add drop down for top lists, big refactor of repeated code. 2014-08-21 16:08:47 -04:00
pagedown_custom.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
preload_store.js TESTS: Reset the preload store for testing 2014-07-31 13:25:40 -04:00
vendor.js Merge pull request #2333 from rhacker/select2 2014-05-28 11:42:40 -04:00