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/discourse/models
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
..
_post.js FIX: Moving posts was not updating reply_count and 2014-08-20 14:15:23 -04:00
action_summary.js FIX: disagree flag should unhide hidden post 2014-08-11 10:48:00 +02:00
admin_post.js FEATURE: show the user's flagged/deleted posts 2014-07-16 21:04:55 +02:00
archetype.js Convert Discourse.Site and Discourse.ScreenTrack to use Discourse.Singleton 2013-08-08 12:49:58 -04:00
badge_grouping.js FEATURE: badge grouping UI 2014-07-18 15:46:36 +10:00
badge.js FEATURE: Badge query validation, preview results, and EXPLAIN 2014-08-31 11:25:44 -07:00
category_list.js UX: Remove drag and drop reordering of categories. It was not working 2014-08-12 17:14:02 -04:00
category.js FIX: Show uncategorized with badge/description in the category chooser 2014-08-28 12:42:31 -04:00
composer_message.js ES6: Migrated and deprecated a bunch of views 2014-06-10 11:54:38 -04:00
composer.js FIX: If editing a reply, the quote button should target the post it was 2014-08-08 16:41:58 -04:00
draft.js staff can always upload a file 2013-09-07 10:49:11 +02:00
group.js FEATURE: admins can invite users to groups via the web UI 2014-05-09 18:22:36 +10:00
input_validation.js Some javascript refactoring: Move markdown functions into their own classs, remove extraneous window. calls. 2013-03-05 14:53:55 -05:00
invite.js FEATURE: dynamically load invites 2014-08-05 22:20:23 +05:30
login_method.js Add Google Oauth2 authenticator. The current Google OpenID authentication has been deprecated by Google and will NOT work for any new websites. 2014-05-21 18:35:10 -04:00
model.js FIX: If a topic title edit fails, revert to previous title. 2014-07-21 13:39:23 -04:00
nav_item.js FIX: top_menu with category links like category/Meta are not case sensitive 2014-08-18 11:07:49 -04:00
permission_type.js work in progress, add fidelity to category group permissions (full, create posts, readonly) 2013-07-16 15:46:11 +10:00
post_action_type.js Shows who deleted a post 2013-07-10 16:22:49 -04:00
post_stream.js Fix assignment of post number to progress position 2014-08-14 17:31:34 -07:00
selectable_array.js Moved JSHint into Qunit suite. It's much harder to forget about now! 2013-06-21 14:07:11 -04:00
session.js Add Discourse.Singleton class mixin for creating singletons. 2013-08-08 12:00:58 -04:00
share_link.js Make Discourse.ShareLink easy for plugins 2014-03-13 23:38:57 -07:00
site.js Optimize Category find-by-id by using a hash. 2014-07-22 23:49:49 -04:00
static_page.js ES6: Remove dynamically generated static routes. They were causing lots 2014-07-29 14:24:16 -04:00
top-period.js.es6 UX: Add drop down for top lists, big refactor of repeated code. 2014-08-21 16:08:47 -04:00
topic_details.js BUGFIX: some protection for missing "notification" translations 2014-06-02 13:52:22 +10:00
topic_list.js FIX: Navigating to None was not working 2014-08-29 15:51:28 -04:00
topic_tracking_state.js FIX: Don't show topics as unread when hitting back 2014-08-27 18:01:02 -04:00
topic.js HACK: suppress "1 reply" when directly below for quotes posts 2014-08-26 12:00:16 +10:00
trust_level.js ES6: Migrated and deprecated a bunch of views 2014-06-10 11:54:38 -04:00
user_action_group.js Clean up JS, add YUIDoc support, automatically create IIFE via asset pipeline 2013-02-25 17:16:57 -05:00
user_action_stat.js FEATURE: User Bookmarks Menu 2014-06-12 01:54:54 +05:30
user_action.js PERF: Do far fewer checks and use a lot less memory when loading more 2014-08-27 15:31:06 -04:00
user_badge.js Sort the badges on the user profile page 2014-08-25 12:40:51 -07:00
user_posts_stream.js FEATURE: show the user's flagged/deleted posts 2014-07-16 21:04:55 +02:00
user_stream.js FIX: Stop endless loading at the bottom of a user's stream. 2014-07-21 14:13:17 -04:00
user.js SECURITY: User action route was returning too much data 2014-08-29 13:46:50 -04:00