Skip to content

Commit 29817ee

Browse files
committed
fix(ui): new mongodb-schema version
latest mongodb-schema version has lots of nice fixes and performance improvements. update field-list to use model changes.
1 parent c764d57 commit 29817ee

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

scout-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"lodash": "^3.8.0",
6666
"moment": "^2.8.2",
6767
"mongodb-extended-json": "^1.3.1",
68-
"mongodb-schema": "^2.1.0",
68+
"mongodb-schema": "^2.2.1",
6969
"numeral": "^1.5.3",
7070
"octicons": "https://github.com/github/octicons/archive/v2.2.0.tar.gz",
7171
"phantomjs-polyfill": "0.0.1",

scout-ui/src/field-list/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ var BasicFieldView = View.extend({
1010
minichartModel: 'state'
1111
},
1212
bindings: {
13-
'model._id': [
13+
'model.name': [
1414
{
1515
hook: 'name'
1616
},
1717
{
1818
hook: 'name',
1919
type: function(el) {
20-
if (this.model._id === '__basic__') {
20+
if (this.model.getId() === '__basic__') {
2121
el.classList.add('hidden');
2222
}
2323
}
@@ -50,7 +50,7 @@ var BasicFieldView = View.extend({
5050
this.viewSwitcher = new ViewSwitcher(this.queryByHook('minichart-container'));
5151
},
5252
switchView: function(typeModel) {
53-
var type = typeModel._id.toLowerCase();
53+
var type = typeModel.getId().toLowerCase();
5454

5555
// @todo currently only support boolean, number, date, category
5656
if (['objectid', 'boolean', 'number', 'date', 'string'].indexOf(type) === -1) return;
@@ -65,7 +65,7 @@ var BasicFieldView = View.extend({
6565

6666
var ExpandableFieldMixin = {
6767
bindings: {
68-
'model._id': {
68+
'model.name': {
6969
hook: 'name'
7070
},
7171
'expanded': {

scout-ui/src/field-list/type-list-item.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ require('bootstrap/js/tooltip');
88

99
module.exports = AmpersandView.extend({
1010
bindings: {
11-
'model._id': [
11+
'model.name': [
1212
{
13-
hook: '_id'
13+
hook: 'name'
1414
},
1515
{
1616
hook: 'bar',
@@ -49,7 +49,7 @@ module.exports = AmpersandView.extend({
4949
}.bind(this), 300));
5050
},
5151
template: require('./type-list-item.jade'),
52-
typeClicked: function(evt) {
52+
typeClicked: function() {
5353
if (this.parent.parent.minichartModel.cid !== this.model.cid) {
5454
this.parent.parent.switchView(this.model);
5555
}

scout-ui/src/field-list/value-list-item.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var AmpersandView = require('ampersand-view');
22

33
module.exports = AmpersandView.extend({
44
bindings: {
5-
'model._id': {
5+
'model.value': {
66
hook: 'value'
77
}
88
},

0 commit comments

Comments
 (0)