Merge branch 'develop' into vislib/refactor

This commit is contained in:
Shelby Sturgis 2014-08-25 18:38:37 +03:00
commit 431b2de7b0
8 changed files with 40 additions and 46 deletions

View file

@ -1,28 +1,26 @@
# TODO items
> Automatically extracted
- **src/kibana/apps/dashboard/directives/grid.js**
- change this from event based to calling a method on dashboardApp (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/apps/dashboard/directives/grid.js)
- **src/kibana/apps/discover/controllers/discover.js**
- On array fields, negating does not negate the combination, rather all terms (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/apps/discover/controllers/discover.js)
- Move to utility class (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/apps/discover/controllers/discover.js)
- Move to utility class (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/apps/discover/controllers/discover.js)
- a legit way to update the index pattern (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/apps/discover/controllers/discover.js)
- **src/kibana/apps/settings/sections/indices/_create.js**
- we should probably display a message of some kind (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/apps/settings/sections/indices/_create.js)
- **src/kibana/components/agg_types/buckets/terms.js**
- We need more than just _count here. (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/components/agg_types/buckets/terms.js)
- **src/kibana/components/index_patterns/_mapper.js**
- Change index to be the resolved in some way, last three months, last hour, last year, whatever (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/components/index_patterns/_mapper.js)
- **src/kibana/components/state_management/state.js**
- Change all the references to onUpdate to the actual fetch_with_changes event (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/components/state_management/state.js)
- **src/kibana/components/visualize/visualize.js**
- we need to have some way to clean up result requests (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/components/visualize/visualize.js)
- **src/kibana/directives/rows.js**
- It would be better to actually check the type of the field, but we don't have (https://github.com/elasticsearch/kibana4/blob/master/src/kibana/directives/rows.js)
- **test/unit/specs/apps/dashboard/directives/panel.js**
- This should not be needed, timefilter is only included here (https://github.com/elasticsearch/kibana4/blob/master/test/unit/specs/apps/dashboard/directives/panel.js)
- **test/unit/specs/directives/timepicker.js**
- This should not be needed, timefilter is only included here, it should move (https://github.com/elasticsearch/kibana4/blob/master/test/unit/specs/directives/timepicker.js)
- **test/unit/specs/directives/typeahead.js**
- This should not be needed, timefilter is only included here, it should move (https://github.com/elasticsearch/kibana4/blob/master/test/unit/specs/directives/typeahead.js)
- **[src/kibana/apps/dashboard/directives/grid.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/apps/dashboard/directives/grid.js)**
- change this from event based to calling a method on dashboardApp
- **[src/kibana/apps/discover/controllers/discover.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/apps/discover/controllers/discover.js)**
- On array fields, negating does not negate the combination, rather all terms
- Move to utility class
- Move to utility class
- a legit way to update the index pattern
- **[src/kibana/apps/settings/sections/indices/_create.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/apps/settings/sections/indices/_create.js)**
- we should probably display a message of some kind
- **[src/kibana/components/agg_types/buckets/terms.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/components/agg_types/buckets/terms.js)**
- We need more than just _count here.
- **[src/kibana/components/index_patterns/_mapper.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/components/index_patterns/_mapper.js)**
- Change index to be the resolved in some way, last three months, last hour, last year, whatever
- **[src/kibana/components/visualize/visualize.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/components/visualize/visualize.js)**
- we need to have some way to clean up result requests
- **[src/kibana/directives/rows.js](https://github.com/elasticsearch/kibana4/blob/master/src/kibana/directives/rows.js)**
- It would be better to actually check the type of the field, but we don't have
- **[test/unit/specs/apps/dashboard/directives/panel.js](https://github.com/elasticsearch/kibana4/blob/master/test/unit/specs/apps/dashboard/directives/panel.js)**
- This should not be needed, timefilter is only included here
- **[test/unit/specs/directives/timepicker.js](https://github.com/elasticsearch/kibana4/blob/master/test/unit/specs/directives/timepicker.js)**
- This should not be needed, timefilter is only included here, it should move
- **[test/unit/specs/directives/typeahead.js](https://github.com/elasticsearch/kibana4/blob/master/test/unit/specs/directives/typeahead.js)**
- This should not be needed, timefilter is only included here, it should move

View file

@ -137,7 +137,7 @@ define(function (require) {
var ignoreStateChanges = ['columns'];
// listen for changes, and relisten everytime something happens
$state.onUpdate(function (changed) {
$scope.$listen($state, 'fetch_with_changes', function (changed) {
if (_.contains(changed, 'columns')) {
$scope.fields.forEach(function (field) {
field.display = _.contains($state.columns, field.name);

View file

@ -73,7 +73,7 @@
{{ opts.savedSearch.title }}
<i tooltip="Reload saved query" ng-click="resetQuery();" class="fa fa-undo smallest small"></i>
</h3>
<div class="discover-timechart" ng-if="vis">
<div class="discover-timechart" >
<center class="small">
<span tooltip="To change the time, click the clock icon in the navigation bar">{{timeRange.from | moment}} - {{timeRange.to | moment}}</span>
<!-- TODO: Currently no way to apply this setting to the visualization -->
@ -90,7 +90,7 @@
<div class="spinner large"> </div>
</div>
<visualize vis="vis" es-resp="mergedEsResp" search-source="searchSource"></visualize>
<visualize ng-if="vis && rows.length != 0" vis="vis" es-resp="mergedEsResp" search-source="searchSource"></visualize>
</div>
<div class="discover-table"

View file

@ -110,7 +110,8 @@ define(function (require) {
editableVis.dirty = !angular.equals(newState, vis.getState());
}, true);
$state.on('fetch_with_changes', function () {
$scope.$listen($state, 'fetch_with_changes', function () {
vis.setState($state.vis);
editableVis.setState($state.vis);
@ -122,10 +123,11 @@ define(function (require) {
}
$scope.fetch();
});
timefilter.enabled = true;
timefilter.on('update', _.bindKey($scope, 'fetch'));
$scope.$listen(timefilter, 'update', _.bindKey($scope, 'fetch'));
$scope.$on('ready:vis', function () {
$scope.$emit('application.load');

View file

@ -64,9 +64,9 @@ define(function (require) {
'date'
],
name: 'date',
convert: function (val) {
convert: _.memoize(function (val) {
return moment(val).format(config.get('dateFormat'));
}
})
},
{
types: [

View file

@ -67,15 +67,6 @@ define(function (require) {
this.save();
};
/**
* Registers a listner for updates to pulls
* TODO: Change all the references to onUpdate to the actual fetch_with_changes event
* @returns {void}
*/
State.prototype.onUpdate = function (cb) {
this.on('fetch_with_changes', cb);
};
/**
* Cleans up the state object
* @returns {void}

View file

@ -67,7 +67,12 @@ module.exports = function (grunt) {
}
})
.forEach(function (path) {
newFileLines.push(' - **' + path + '**');
newFileLines.push(
' - **' +
'[' + path + ']' +
'(https://github.com/elasticsearch/kibana4/blob/master/' + path + ')' +
'**'
);
_(groupedByPath[path])
.sortBy(function (match) {
@ -77,9 +82,7 @@ module.exports = function (grunt) {
var priority = TYPE_PRIORITIES[match.type] || 0;
newFileLines.push(
' - ' + (priority ? match.type + ' ' : '') +
match.msg + ' ' +
'(https://github.com/elasticsearch/kibana4/blob/master/' + match.path + ')'
' - ' + (priority ? match.type + ' [ ] ' : '') + match.msg
);
});
});

View file

@ -73,7 +73,7 @@ define(function (require) {
it('should fire listeners for #onUpdate() on #fetch()', function (done) {
var state = new State();
state.onUpdate(function (keys) {
state.on('fetch_with_changes', function (keys) {
expect(keys).to.eql(['foo']);
done();
});