diff --git a/app/styles/list_view.scss b/app/styles/list_view.scss index 827729b98b..71b358f5ff 100644 --- a/app/styles/list_view.scss +++ b/app/styles/list_view.scss @@ -1,5 +1,4 @@ - - .list-view { +.list-view { position: relative; font-size: 11px; height: 100%; diff --git a/app/views/instance-list.js b/app/views/instance-list.js index 8553d1b3ce..6f46388198 100644 --- a/app/views/instance-list.js +++ b/app/views/instance-list.js @@ -1,9 +1,23 @@ -import ListView from "ember-inspector/views/list"; -import ListItemView from "ember-inspector/views/list-item"; +import ListView from 'ember-inspector/views/list'; +import ListItemView from 'ember-inspector/views/list-item'; +/** + * @module Views + * @extends Views.List + * @class InstanceList + * @namespace Views + */ export default ListView.extend({ + /** + * @property itemViewClass + * @type {Ember.View} + */ itemViewClass: ListItemView.extend({ - templateName: "instance_item" + /** + * @property templateName + * @type {String} + * @default 'instance_item' + */ + templateName: 'instance_item' }) - }); diff --git a/app/views/list-item.js b/app/views/list-item.js index 8571a3e3cf..fdd92875e6 100644 --- a/app/views/list-item.js +++ b/app/views/list-item.js @@ -1,4 +1,5 @@ -import ListItemView from "list-view/list-item-view"; +import ListItemView from 'ember-list-view/list-item-view'; + export default ListItemView.extend({ classNames: ["list-tree__item-wrapper", "row-wrapper"] }); diff --git a/app/views/list.js b/app/views/list.js index 77cc41c968..f4ce8364d9 100644 --- a/app/views/list.js +++ b/app/views/list.js @@ -1,13 +1,34 @@ -import Ember from "ember"; -import ListItemView from "ember-inspector/views/list-item"; -import ListView from "list-view/list-view"; -const { computed } = Ember; +import Ember from 'ember'; +import ListView from 'ember-list-view'; +import ListItemView from 'ember-inspector/views/list-item'; +const { computed, computed: { alias } } = Ember; + +/** + * Base list view config + * + * @module Views + * @extends ListView + * @class List + * @namespace Views + */ export default ListView.extend({ + /** + * @property classNames + * @type {Array} + */ classNames: ["list-tree"], - contentHeight: Ember.computed.alias('controller.controllers.application.contentHeight'), + /** + * @property contentHeight + * @type {Integer} + */ + contentHeight: alias('controller.controllers.application.contentHeight'), + /** + * @property height + * @type {Integer} + */ height: computed('contentHeight', function() { let headerHeight = 31; let contentHeight = this.get('contentHeight'); @@ -19,6 +40,17 @@ export default ListView.extend({ } return contentHeight - headerHeight; }), + + /** + * @property rowHeight + * @type {Integer} + * @default 30 + */ rowHeight: 30, + + /** + * @property itemViewClass + * @type {Ember.View} + */ itemViewClass: ListItemView }); diff --git a/app/views/promise-list.js b/app/views/promise-list.js index dc98b6687f..c7f36742ee 100644 --- a/app/views/promise-list.js +++ b/app/views/promise-list.js @@ -1,9 +1,23 @@ -import ListView from "ember-inspector/views/list"; +import ListView from 'ember-inspector/views/list'; import ListItemView from "ember-inspector/views/list-item"; +/** + * @module Views + * @extends Views.List + * @class PromiseList + * @namespace Views + */ export default ListView.extend({ + /** + * @property itemViewClass + * @type {Ember.View} + */ itemViewClass: ListItemView.extend({ - templateName: "promise_item" + /** + * @property templateName + * @type {String} + * @default 'promise_item' + */ + templateName: 'promise_item' }) - }); diff --git a/app/views/record-list.js b/app/views/record-list.js index 757f9ebee6..a3f4177420 100644 --- a/app/views/record-list.js +++ b/app/views/record-list.js @@ -1,15 +1,34 @@ import Ember from 'ember'; -import ListView from "ember-inspector/views/list"; -import ListItemView from "ember-inspector/views/list-item"; +import ListView from 'ember-inspector/views/list'; +import ListItemView from 'ember-inspector/views/list-item'; -const { computed } = Ember; -const { readOnly } = computed; +const { computed: { readOnly } } = Ember; +/** + * @module Views + * @extends Views.List + * @class RecordList + * @namespace Views + */ export default ListView.extend({ + /** + * @property itemViewClass + * @type {Ember.View} + */ itemViewClass: ListItemView.extend({ - templateName: "record_item", + /** + * @property templateName + * @type {String} + * @default 'record_item' + */ + templateName: 'record_item', - // TODO: Look for a better way + /** + * TODO: Need a better way to pass this + * + * @property columns + * @type {Array} + */ columns: readOnly('parentView.columns') }) }); diff --git a/app/views/route-list.js b/app/views/route-list.js index a742cbbf88..2875e44d23 100644 --- a/app/views/route-list.js +++ b/app/views/route-list.js @@ -1,14 +1,34 @@ import Ember from 'ember'; -import ListView from "ember-inspector/views/list"; -import ListItemView from "ember-inspector/views/list-item"; -const { computed } = Ember; -const { readOnly } = computed; +import ListView from 'ember-inspector/views/list'; +import ListItemView from 'ember-inspector/views/list-item'; +const { computed: { readOnly } } = Ember; + +/** + * @module Views + * @extends Views.List + * @class RouteList + * @namespace Views + */ export default ListView.extend({ + /** + * @property itemViewClass + * @type {Ember.View} + */ itemViewClass: ListItemView.extend({ - templateName: "route_item", + /** + * @property templateName + * @type {String} + * @default 'route_item' + */ + templateName: 'route_item', - // TODO: Need a better way to pass this + /** + * TODO: Need a better way to pass this + * + * @property currentRoute + * @type {String} + */ currentRoute: readOnly('parentView.currentRoute') }) }); diff --git a/app/views/view-list.js b/app/views/view-list.js index 3d1f84e6a0..36b55d7634 100644 --- a/app/views/view-list.js +++ b/app/views/view-list.js @@ -1,27 +1,71 @@ -import Ember from "ember"; -import ListView from "ember-inspector/views/list"; -import ListItemView from "ember-inspector/views/list-item"; +import Ember from 'ember'; +import ListView from 'ember-inspector/views/list'; +import ListItemView from 'ember-inspector/views/list-item'; -const { computed } = Ember; -const { readOnly } = computed; +const { computed: { readOnly } } = Ember; +/** + * @module Views + * @extends Views.List + * @class ViewList + * @namespace Views + */ export default ListView.extend({ + /** + * @property itemViewClass + * @type {Ember.View} + */ itemViewClass: ListItemView.extend({ - templateName: "view_item", + /** + * @property templateName + * @type {String} + * @default 'view_item' + */ + templateName: 'view_item', - // TODO: Find a better way + /** + * TODO: Need a better way to pass this + * + * @property pinnedObjectId + * @type {Integer} + */ pinnedObjectId: readOnly('parentView.pinnedObjectId'), + /** + * @property node + * @type {Ember.Controller} + */ node: readOnly('context'), - // for testing + + /** + * Needed for tests + * + * @property attributeBindings + * @type {Array} + * @default ['data-label:label'] + */ attributeBindings: ['data-label:label'], + + /** + * @property label + * @type {String} + * @default 'tree-node' + */ label: 'tree-node', + /** + * @method mouseEnter + * @param {Object} e event object + */ mouseEnter(e) { this.get('controller').send('previewLayer', this.get('node')); e.stopPropagation(); }, + /** + * @property mouseLeave + * @type {Object} e event object + */ mouseLeave(e) { this.get('controller').send('hidePreview', this.get('node')); e.stopPropagation(); diff --git a/bower.json b/bower.json index 7a794347ad..7c24b49c2d 100644 --- a/bower.json +++ b/bower.json @@ -2,7 +2,7 @@ "name": "ember-inspector", "dependencies": { "jquery": "^1.11.1", - "ember": "1.10.0", + "ember": "1.12.0", "ember-resolver": "~0.1.12", "loader.js": "ember-cli/loader.js#3.2.0", "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", diff --git a/ember_debug/object-inspector.js b/ember_debug/object-inspector.js index 033cb3ebac..359dce28aa 100644 --- a/ember_debug/object-inspector.js +++ b/ember_debug/object-inspector.js @@ -680,7 +680,8 @@ function getDebugInfo(object) { 'layout', 'templateData', 'domManager', - 'states' + 'states', + 'element' ); } diff --git a/package.json b/package.json index 36dfeea86c..dda9b58f88 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "ember-cli-qunit": "0.3.9", "ember-cli-uglify": "1.0.1", "ember-export-application-global": "^1.0.2", + "ember-list-view": "0.0.6", "ember-pikaday": "^0.2.1", "eslint-config-ember": "0.2.0", "grunt": "^0.4.5", @@ -59,8 +60,7 @@ "grunt-mozilla-addon-sdk": "~0.4.0", "grunt-s3": "^0.2.0-alpha.3", "grunt-version": "^0.3.0", - "js-string-escape": "^1.0.0", - "list-view": "emberjs/list-view#aefb20f" + "js-string-escape": "^1.0.0" }, "dependencies": { "ember-new-computed": "^1.0.0" diff --git a/tests/integration/object_inspector_test.js b/tests/integration/object_inspector_test.js index 4d694f166c..92b594ced7 100644 --- a/tests/integration/object_inspector_test.js +++ b/tests/integration/object_inspector_test.js @@ -464,7 +464,7 @@ test("Date fields are editable", async function t(assert) { }); test("Errors are correctly displayed", async function t(assert) { - let obj = objectFactory( { + let obj = objectFactory({ name: 'My Object', objectId: '1', errors: [ @@ -479,7 +479,7 @@ test("Errors are correctly displayed", async function t(assert) { assert.equal(findByLabel('object-inspector-errors').length, 1); assert.equal(findByLabel('object-inspector-error').length, 2); - clickByLabel('send-errors-to-console'); + await clickByLabel('send-errors-to-console'); assert.equal(name, 'objectInspector:traceErrors'); assert.equal(message.objectId, '1');