Skip to content

Commit eaee431

Browse files
rueckstiesskangas
authored andcommitted
updated unique minicharts to new schema model.
1 parent b85441c commit eaee431

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

scout-ui/src/collection-stats/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var numeral = require('numeral');
33

44
var CollectionStatsView = AmpersandView.extend({
55
bindings: {
6-
'model._id': {
6+
'model.name': {
77
hook: 'name'
88
},
99
document_count: {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = AmpersandView.extend({
5050
},
5151
template: require('./type-list-item.jade'),
5252
typeClicked: function() {
53-
if (this.parent.parent.minichartModel.cid !== this.model.cid) {
53+
if (this.parent.parent.minichartModel.modelType !== this.model.modelType) {
5454
this.parent.parent.switchView(this.model);
5555
}
5656
}

scout-ui/src/home/collection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = AmpersandView.extend({
3232
'click .splitter': 'onSplitterClick',
3333
},
3434
bindings: {
35-
'model._id': {
35+
'model.name': {
3636
hook: 'name'
3737
},
3838
'sidebarWidth': {

scout-ui/src/minicharts/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ module.exports = AmpersandView.extend({
2727
this.renderWithTemplate(this);
2828

2929
// unique values get a div-based minichart
30-
if ((this.model._id === 'String') &&
31-
(this.model.unique === this.model.count)) {
32-
30+
if (this.model.unique === this.model.count) {
3331
this.viewOptions.renderMode = 'html';
3432
this.viewOptions.className = 'minichart unique';
3533
this.subview = new UniqueMinichartView(this.viewOptions);

scout-ui/src/minicharts/unique.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ module.exports = VizView.extend({
1212
template: require('./unique.jade'),
1313
derived: {
1414
randomValues: {
15-
deps: ['orderedValues'],
1615
cache: false,
1716
fn: function() {
18-
// @hack for demo: show values across all types
19-
return _(this.model.collection.parent.values.sample(15))
17+
return _(this.model.values.sample(15))
2018
.map(function(x) {
2119
return x.value;
2220
})

0 commit comments

Comments
 (0)