Revert "ES6: Half a dozen more controllers converted"
This reverts commit bc2d87e5c1
.
This commit is contained in:
parent
b17cd2f251
commit
389c50eb1e
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
export default Em.Controller.extend({
|
||||
Discourse.BulkNotificationLevelController = Em.Controller.extend({
|
||||
needs: ['topicBulkActions'],
|
||||
|
||||
notificationLevelId: null,
|
|
@ -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'),
|
|
@ -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),
|
|
@ -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
|
||||
|
@ -98,4 +98,4 @@ export default Ember.ArrayController.extend({
|
|||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
|
@ -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,
|
|
@ -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;
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue