Skip to content

Commit

Permalink
Upgraded to ember 1.12.0
Browse files Browse the repository at this point in the history
Upgraded ember list view to v 0.0.6
Moved required properties into list-view mixin
Part of emberjs#360
  • Loading branch information
patsy-issa committed Oct 13, 2015
1 parent b35f015 commit 836a737
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 41 deletions.
3 changes: 1 addition & 2 deletions app/styles/list_view.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

.list-view {
.list-view {
position: relative;
font-size: 11px;
height: 100%;
Expand Down
22 changes: 18 additions & 4 deletions app/views/instance-list.js
Original file line number Diff line number Diff line change
@@ -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'
})

});
3 changes: 2 additions & 1 deletion app/views/list-item.js
Original file line number Diff line number Diff line change
@@ -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"]
});
42 changes: 37 additions & 5 deletions app/views/list.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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
});
20 changes: 17 additions & 3 deletions app/views/promise-list.js
Original file line number Diff line number Diff line change
@@ -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'
})

});
31 changes: 25 additions & 6 deletions app/views/record-list.js
Original file line number Diff line number Diff line change
@@ -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')
})
});
32 changes: 26 additions & 6 deletions app/views/route-list.js
Original file line number Diff line number Diff line change
@@ -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')
})
});
60 changes: 52 additions & 8 deletions app/views/view-list.js
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion ember_debug/object-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,8 @@ function getDebugInfo(object) {
'layout',
'templateData',
'domManager',
'states'
'states',
'element'
);
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/object_inspector_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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');
Expand Down

0 comments on commit 836a737

Please sign in to comment.