From 76a06dfa038cb1f6bd7797d9514c824b4359b611 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 2 Mar 2020 20:23:46 +0100 Subject: [PATCH] DEV: Remove the last (defunct) use of Ember.View (#8976) This codepath has been deprecated 3 years ago in c5687100b04662b3d754ed0a8ae053d6298fca26. Ember.View has been removed in Ember 2.0. --- .../discourse/widgets/connector.js.es6 | 33 ++----------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/connector.js.es6 b/app/assets/javascripts/discourse/widgets/connector.js.es6 index 9701f4c80ab..99b80538814 100644 --- a/app/assets/javascripts/discourse/widgets/connector.js.es6 +++ b/app/assets/javascripts/discourse/widgets/connector.js.es6 @@ -1,5 +1,4 @@ import { next } from "@ember/runloop"; -import deprecated from "discourse-common/lib/deprecated"; import { setOwner, getOwner } from "@ember/application"; export default class Connector { @@ -16,44 +15,18 @@ export default class Connector { next(() => { const mounted = widget._findView(); - if (opts.templateName) { - deprecated( - `Using a 'templateName' for a connector is deprecated. Use 'component' instead [${opts.templateName}]` - ); - } - - const container = getOwner ? getOwner(mounted) : mounted.container; - - let view; - if (opts.component) { const connector = widget.register.lookupFactory( "component:connector-container" ); - view = connector.create({ + + const view = connector.create({ layoutName: `components/${opts.component}`, model: widget.findAncestorModel() }); - } - if (opts.templateName) { - let context; - if (opts.context === "model") { - const model = widget.findAncestorModel(); - context = model; - } + setOwner(view, getOwner(mounted)); - view = Ember.View.create({ - container: container || widget.register, - templateName: opts.templateName, - context - }); - } - - if (view) { - if (setOwner) { - setOwner(view, getOwner(mounted)); - } mounted._connected.push(view); view.renderer.appendTo(view, $elem[0]); }