Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLEANUP beta] Remove emptyView="Global.foo" for view #11754

Merged
merged 1 commit into from Jul 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions packages/ember-views/lib/streams/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Ember from 'ember-metal/core';
import { get } from 'ember-metal/property_get';
import { isGlobal } from 'ember-metal/path_cache';
import { fmt } from 'ember-runtime/system/string';
import { read, isStream } from 'ember-metal/streams/utils';
import ControllerMixin from 'ember-runtime/mixins/controller';
Expand All @@ -10,13 +9,8 @@ export function readViewFactory(object, container) {
var viewClass;

if (typeof value === 'string') {
if (isGlobal(value)) {
viewClass = get(null, value);
Ember.deprecate('Resolved the view "' + value + '" on the global context. Pass a view name to be looked up on the container instead, such as {{view "select"}}.', !viewClass, { url: 'http://emberjs.com/guides/deprecations/#toc_global-lookup-of-views' });
} else {
Ember.assert('View requires a container to resolve views not passed in through the context', !!container);
viewClass = container.lookupFactory('view:' + value);
}
Ember.assert('View requires a container to resolve views not passed in through the context', !!container);
viewClass = container.lookupFactory('view:' + value);
} else {
viewClass = value;
}
Expand Down
26 changes: 0 additions & 26 deletions packages/ember-views/tests/views/collection_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,32 +564,6 @@ QUnit.test('should render the emptyView if content array is empty and emptyView
ok(view.$().find('kbd:contains("THIS IS AN EMPTY VIEW")').length, 'displays empty view');
});

QUnit.test('should render the emptyView if content array is empty and emptyView is given as global string [DEPRECATED]', function() {
expectDeprecation(/Resolved the view "App.EmptyView" on the global context/);

Ember.lookup = {
App: {
EmptyView: View.extend({
tagName: 'kbd',
template: compile('THIS IS AN EMPTY VIEW')
})
}
};

view = CollectionView.create({
tagName: 'del',
content: Ember.A(),

emptyView: 'App.EmptyView'
});

run(function() {
view.append();
});

ok(view.$().find('kbd:contains("THIS IS AN EMPTY VIEW")').length, 'displays empty view');
});

QUnit.test('should lookup against the container if itemViewClass is given as a string', function() {
var ItemView = View.extend({
template: compile('{{view.content}}')
Expand Down