From 06254d316315a1ee1e10c6b81f93e3fc94aa3216 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 18 Nov 2016 12:13:21 -0500 Subject: [PATCH] Remove the last of the `ModalBodyView` uses --- app/assets/javascripts/application.js | 1 - .../javascripts/discourse/components/d-modal-body.js.es6 | 4 +--- app/assets/javascripts/discourse/lib/show-modal.js.es6 | 2 +- app/assets/javascripts/discourse/routes/application.js.es6 | 6 +++--- .../discourse/routes/discovery-categories.js.es6 | 4 ++-- .../javascripts/discourse/templates/modal/change-owner.hbs | 5 ++--- .../discourse/templates/modal/change-timestamp.hbs | 4 ++-- .../javascripts/discourse/templates/modal/dismiss-read.hbs | 4 ++-- .../discourse/templates/modal/edit-category.hbs | 4 ++-- .../discourse/templates/modal/feature-topic.hbs | 4 ++-- .../discourse/templates/modal/keyboard-shortcuts-help.hbs | 4 ++-- .../javascripts/discourse/templates/modal/merge-topic.hbs | 4 ++-- .../discourse/templates/modal/not-activated.hbs | 5 +++-- .../discourse/templates/modal/option-boolean.hbs | 6 ------ .../discourse/templates/modal/post-enqueued.hbs | 4 ++-- .../javascripts/discourse/templates/modal/search-help.hbs | 4 ++-- .../discourse/templates/modal/topic-bulk-actions.hbs | 7 ++----- app/assets/javascripts/discourse/views/modal.js.es6 | 4 +++- .../templates/{modals => modal}/poll-ui-builder.hbs | 4 ++-- .../poll/assets/javascripts/views/poll-ui-builder.js.es6 | 6 ------ 20 files changed, 35 insertions(+), 51 deletions(-) delete mode 100644 app/assets/javascripts/discourse/templates/modal/option-boolean.hbs rename plugins/poll/assets/javascripts/discourse/templates/{modals => modal}/poll-ui-builder.hbs (95%) delete mode 100644 plugins/poll/assets/javascripts/views/poll-ui-builder.js.es6 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 852d1d8cd9d..2a4085f785e 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -59,7 +59,6 @@ //= require ./discourse/models/user-badge //= require ./discourse/controllers/discovery-sortable //= require ./discourse/controllers/navigation/default -//= require ./discourse/views/modal-body //= require ./discourse/components/edit-category-panel //= require ./discourse/components/dropdown-button //= require ./discourse/components/notifications-button diff --git a/app/assets/javascripts/discourse/components/d-modal-body.js.es6 b/app/assets/javascripts/discourse/components/d-modal-body.js.es6 index 0753cf4fef7..fa2d8fa168c 100644 --- a/app/assets/javascripts/discourse/components/d-modal-body.js.es6 +++ b/app/assets/javascripts/discourse/components/d-modal-body.js.es6 @@ -22,8 +22,6 @@ export default Ember.Component.extend({ } } - this.appEvents.trigger('modal:body-shown', { - title: this.get('title') - }); + this.appEvents.trigger('modal:body-shown', this.getProperties('title')); } }); diff --git a/app/assets/javascripts/discourse/lib/show-modal.js.es6 b/app/assets/javascripts/discourse/lib/show-modal.js.es6 index 6b5b91c9d96..e34d7398ef0 100644 --- a/app/assets/javascripts/discourse/lib/show-modal.js.es6 +++ b/app/assets/javascripts/discourse/lib/show-modal.js.es6 @@ -18,7 +18,7 @@ export default function(name, opts) { } else { const templateName = opts.templateName || Ember.String.dasherize(name); - const renderArgs = { into: 'modal', outlet: 'modalBody', view: 'modal-body'}; + const renderArgs = { into: 'modal', outlet: 'modalBody'}; if (controller) { renderArgs.controller = controllerName; } const modalName = `modal/${templateName}`; diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6 index e2c3aa3f6aa..187199ff533 100644 --- a/app/assets/javascripts/discourse/routes/application.js.es6 +++ b/app/assets/javascripts/discourse/routes/application.js.es6 @@ -127,12 +127,12 @@ const ApplicationRoute = Discourse.Route.extend(OpenComposer, { }, editCategory(category) { - Category.reloadById(category.get('id')).then((atts) => { + Category.reloadById(category.get('id')).then(atts => { const model = this.store.createRecord('category', atts.category); model.setupGroupsAndPermissions(); this.site.updateCategory(model); - showModal('editCategory', { model }); - this.controllerFor('editCategory').set('selectedTab', 'general'); + showModal('edit-category', { model }); + this.controllerFor('edit-category').set('selectedTab', 'general'); }); }, diff --git a/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 b/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 index 13fecc98f80..ad7118fcc0e 100644 --- a/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 +++ b/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 @@ -117,8 +117,8 @@ const DiscoveryCategoriesRoute = Discourse.Route.extend(OpenComposer, { allow_badges: true }); - showModal("editCategory", { model }); - this.controllerFor("editCategory").set("selectedTab", "general"); + showModal("edit-category", { model }); + this.controllerFor("edit-category").set("selectedTab", "general"); }, reorderCategories() { diff --git a/app/assets/javascripts/discourse/templates/modal/change-owner.hbs b/app/assets/javascripts/discourse/templates/modal/change-owner.hbs index fea9e119d25..c23cefd4692 100644 --- a/app/assets/javascripts/discourse/templates/modal/change-owner.hbs +++ b/app/assets/javascripts/discourse/templates/modal/change-owner.hbs @@ -1,4 +1,4 @@ - +{{/d-modal-body}}