Revert "ES6: Half a dozen more controllers converted"

This reverts commit bc2d87e5c1.
This commit is contained in:
Robin Ward 2014-05-05 13:58:40 -04:00
parent b17cd2f251
commit 389c50eb1e
7 changed files with 9 additions and 11 deletions

View File

@ -6,7 +6,7 @@
@namespace Discourse
@module Discourse
**/
export default Em.Controller.extend({
Discourse.BulkNotificationLevelController = Em.Controller.extend({
needs: ['topicBulkActions'],
notificationLevelId: null,

View File

@ -7,7 +7,7 @@
@uses Discourse.ModalFunctionality
@module Discourse
**/
export default Discourse.ObjectController.extend(Discourse.SelectedPostsCount, Discourse.ModalFunctionality, {
Discourse.ChangeOwnerController = Discourse.ObjectController.extend(Discourse.SelectedPostsCount, Discourse.ModalFunctionality, {
needs: ['topic'],
topicController: Em.computed.alias('controllers.topic'),

View File

@ -6,7 +6,7 @@
@namespace Discourse
@module Discourse
**/
export default Discourse.Controller.extend({
Discourse.ComposerController = Discourse.Controller.extend({
needs: ['modal', 'topic', 'composerMessages'],
replyAsNewTopicDraft: Em.computed.equal('model.draftKey', Discourse.Composer.REPLY_AS_NEW_TOPIC_KEY),

View File

@ -6,7 +6,7 @@
@namespace Discourse
@module Discourse
**/
export default Ember.ArrayController.extend({
Discourse.ComposerMessagesController = Ember.ArrayController.extend({
needs: ['composer'],
// Whether we've checked our messages

View File

@ -7,7 +7,7 @@
@uses Discourse.ModalFunctionality
@module Discourse
**/
export default Discourse.Controller.extend(Discourse.ModalFunctionality, {
Discourse.CreateAccountController = Discourse.Controller.extend(Discourse.ModalFunctionality, {
uniqueUsernameValidation: null,
globalNicknameExists: false,
complete: false,

View File

@ -52,8 +52,6 @@ Discourse.URL = Em.Object.createWithMixins({
**/
routeTo: function(path) {
if (Em.isEmpty(path)) { return; }
if(Discourse.get("requiresRefresh")){
document.location.href = path;
return;

View File

@ -1,8 +1,8 @@
module("controller:create-account");
module("Discourse.CreateAccountController");
test('basicUsernameValidation', function() {
var testInvalidUsername = function(username, expectedReason) {
var controller = controllerFor('create-account');
var controller = testController(Discourse.CreateAccountController, null);
controller.set('accountUsername', username);
equal(controller.get('basicUsernameValidation.failed'), true, 'username should be invalid: ' + username);
equal(controller.get('basicUsernameValidation.reason'), expectedReason, 'username validation reason: ' + username + ', ' + expectedReason);
@ -12,7 +12,7 @@ test('basicUsernameValidation', function() {
testInvalidUsername('x', I18n.t('user.username.too_short'));
testInvalidUsername('1234567890123456', I18n.t('user.username.too_long'));
var controller = controllerFor('create-account');
var controller = testController(Discourse.CreateAccountController, null);
controller.set('accountUsername', 'porkchops');
controller.set('prefilledUsername', 'porkchops');
equal(controller.get('basicUsernameValidation.ok'), true, 'Prefilled username is valid');