Skip to content

Commit

Permalink
Merge branch 'master' into fix/elastic#1962
Browse files Browse the repository at this point in the history
  • Loading branch information
stormpython committed Feb 2, 2015
2 parents c9c2e77 + a12a7c7 commit 0032fb2
Show file tree
Hide file tree
Showing 56 changed files with 730 additions and 299 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ target
*.iml
*.log
esvm
.htpasswd
21 changes: 3 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,16 @@ Please make sure you have signed the [Contributor License Agreement](http://www.
nvm install 0.10
```

- Install ruby *1.9.3* (we recommend using [rbenv](https://github.com/sstephenson/rbenv))
- See [rbenv docs](https://github.com/sstephenson/rbenv#installation) for installation assistance

```sh
## install ruby and ruby-build using your local package manager (apt, brew, etc)
brew install rbenv ruby-build
```

- Run `rbenv init` and add `eval "$(rbenv init -)"` to your shell (ex. .bashrc/.bash_profile)
- Run `rbenv install` to install the required version
- Run `ruby -v` and make sure you are using 1.9.3
- Check the installation docs if you have issues getting the correct version
- Install bundler by running `gem install bundler`
- Install local gems by running `bundle`

- Install grunt and bower globally
- Install grunt and bower globally (as root if not using nvm)

```sh
npm install -g grunt-cli bower
```

- Install node, bower, and ruby dependencies
- Install node and bower dependencies

```sh
npm install && bower install && bundle
npm install && bower install
```

- Start the development server.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tests"
],
"dependencies": {
"angular": "~1.2.14",
"angular": "1.2.28",
"angular-bindonce": "~0.3.1",
"angular-bootstrap": "~0.10.0",
"angular-elastic": "~2.3.3",
Expand Down
27 changes: 15 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"dashboarding"
],
"private": false,
"version": "4.0.0-beta3",
"version": "4.0.0-rc1-snapshot",
"main": "src/server/app.js",
"homepage": "http://www.elasticsearch.org/overview/kibana/",
"bugs": "https://github.com/elasticsearch/kibana/issues",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/elasticsearch/kibana/issues"
},
"license": "Apache 2.0",
"author": "Rashid Khan <rashid.khan@elasticsearch.com>",
"contributors": [
"Spencer Alger <spencer.alger@elasticsearch.com>",
Expand All @@ -35,24 +37,29 @@
},
"dependencies": {
"ansicolors": "^0.3.2",
"bluebird": "~2.0.7",
"body-parser": "~1.10.1",
"bunyan": "^1.2.3",
"commander": "^2.6.0",
"compression": "^1.3.0",
"cookie-parser": "~1.3.3",
"debug": "~2.1.1",
"elasticsearch": "^3.1.1",
"express": "~4.10.6",
"glob": "^4.3.2",
"http-proxy": "^1.8.1",
"http-auth": "^2.2.5",
"jade": "~1.8.2",
"js-yaml": "^3.2.5",
"less-middleware": "1.0.x",
"lodash": "^2.4.1",
"morgan": "~1.5.1",
"serve-favicon": "~2.2.0"
"request": "^2.40.0",
"requirefrom": "^0.2.0",
"semver": "^4.2.0",
"serve-favicon": "~2.2.0",
"ssl-root-cas": "^1.1.7"
},
"devDependencies": {
"bluebird": "~2.0.7",
"connect": "~2.19.5",
"event-stream": "~3.1.5",
"expect.js": "~0.3.1",
Expand All @@ -66,12 +73,13 @@
"grunt-contrib-less": "~0.10.0",
"grunt-contrib-requirejs": "~0.4.4",
"grunt-contrib-watch": "~0.5.3",
"grunt-esvm": "~0.2.0",
"grunt-esvm": "~0.3.2",
"grunt-mocha": "~0.4.10",
"grunt-replace": "^0.7.9",
"grunt-run": "^0.2.3",
"grunt-s3": "~0.2.0-alpha.3",
"grunt-saucelabs": "~8.3.2",
"grunt-simple-mocha": "^0.4.0",
"html-entities": "^1.1.1",
"http-proxy": "~1.8.1",
"husky": "~0.6.0",
Expand All @@ -86,14 +94,9 @@
"opn": "~1.0.0",
"path-browserify": "0.0.0",
"progress": "^1.1.8",
"request": "^2.40.0",
"requirejs": "~2.1.14",
"rjs-build-analysis": "0.0.3",
"simple-git": "^0.11.0",
"tar": "^1.0.1"
},
"license": "Apache 2.0",
"bugs": {
"url": "https://github.com/elasticsearch/kibana/issues"
}
}
5 changes: 4 additions & 1 deletion src/kibana/components/agg_types/buckets/date_histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ define(function (require) {
params: [
{
name: 'field',
filterFieldTypes: 'date'
filterFieldTypes: 'date',
default: function (aggConfig) {
return aggConfig.vis.indexPattern.timeFieldName;
}
},

{
Expand Down
1 change: 1 addition & 0 deletions src/kibana/components/agg_types/controls/interval.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
class="form-control"
name="interval"
min="0"
input-whole-number
>
</div>
6 changes: 4 additions & 2 deletions src/kibana/components/config/_delayed_updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ define(function (require) {
if (updater.fired) return;
updater.fired = true;


var method;
var body;
var updated = [];
Expand All @@ -44,6 +43,9 @@ define(function (require) {
queue.forEach(function (q) { q.resolve(resp); });
}, function (err) {
queue.forEach(function (q) { q.reject(err); });
})
.finally(function () {
$rootScope.$emit('change:config', updated.concat(deleted));
});
};

Expand All @@ -68,7 +70,7 @@ define(function (require) {
var defer = Promise.defer();
queue.push(defer);
notify.log('config change: ' + key + ': ' + oldVal + ' -> ' + newVal);
$rootScope.$broadcast('change:config.' + key, newVal, oldVal);
$rootScope.$emit('change:config.' + key, newVal, oldVal);

// reset the fire timer
clearTimeout(timer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ define(function (require) {

var SearchTimeout = require('errors').SearchTimeout;
var RequestFailure = require('errors').RequestFailure;
var ShardFailure = require('errors').ShardFailure;

function callResponseHandlers(requests, responses) {
return Promise.map(requests, function (req, i) {
Expand All @@ -19,6 +20,10 @@ define(function (require) {
notify.warning(new SearchTimeout());
}

if (resp._shards && resp._shards.failed) {
notify.warning(new ShardFailure(resp));
}

function progress() {
if (req.isIncomplete()) {
return INCOMPLETE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define(function (require) {
var myHandlers = [];

errHandlers.splice(0).forEach(function (handler) {
(handler.source !== req.source ? myHandlers : errHandlers).push(handler);
(handler.source === req.source ? myHandlers : errHandlers).push(handler);
});

if (!myHandlers.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<span ng-click="sort(indexPattern.timeFieldName)" tooltip="Sort by time">Time <i ng-class="headerClass(indexPattern.timeFieldName)"></i></span>
</th>
<th ng-repeat="name in columns">
<span ng-click="sort(name)" class="table-header-name" tooltip="Sort by {{name | shortDots}}">
<span ng-click="sort(name)" class="table-header-name" tooltip="{{tooltip(name)}}">
{{name | shortDots}} <i ng-class="headerClass(name)"></i>
</span>
<span class="table-header-move">
Expand Down
6 changes: 5 additions & 1 deletion src/kibana/components/doc_table/components/table_header.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(function (require) {

require('filters/short_dots');

module.directive('kbnTableHeader', function () {
module.directive('kbnTableHeader', function (shortDotsFilter) {
var headerHtml = require('text!components/doc_table/components/table_header.html');
return {
restrict: 'A',
Expand All @@ -21,6 +21,10 @@ define(function (require) {
return $scope.indexPattern.fields.byName[field].sortable;
};

$scope.tooltip = function (column) {
if (!sortableField(column)) return ''; else return 'Sort by ' + shortDotsFilter(column);
};

$scope.headerClass = function (column) {
if (!sortableField(column)) return;

Expand Down
8 changes: 4 additions & 4 deletions src/kibana/components/doc_table/doc_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</table>
<kbn-infinite-scroll ng-if="infiniteScroll" more="addRows"></kbn-infinite-scroll>
</div>
<div ng-if="!hits.length" class="table-vis-error">
<h2><i class="fa fa-meh-o"></i></h2>
<h4>No results found</h4>
</div>
<div ng-if="hits != null && !hits.length" class="table-vis-error">
<h2><i class="fa fa-meh-o"></i></h2>
<h4>No results found</h4>
</div>
12 changes: 12 additions & 0 deletions src/kibana/components/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ define(function (require) {
};
inherits(errors.FetchFailure, KbnError);

/**
* ShardFailure Error - when one or more shards fail
* @param {String} [msg] - An error message that will probably end up in a log.
*/
errors.ShardFailure = function ShardFailure(resp) {
KbnError.call(this, resp._shards.failed + ' of ' + resp._shards.total + ' shards failed.',
errors.ShardFailure);

this.resp = resp;
};
inherits(errors.ShardFailure, KbnError);


/**
* A doc was re-indexed but it was out of date.
Expand Down
1 change: 0 additions & 1 deletion src/kibana/components/fancy_forms/_set_view_value.checksum

This file was deleted.

6 changes: 3 additions & 3 deletions src/kibana/components/fancy_forms/kbn_model.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define(function (require) {
var _ = require('lodash');
var SVV_CHECKSUM = require('text!components/fancy_forms/_set_view_value.checksum');
var angular = require('angular');
var PRISTINE_CLASS = 'ng-pristine';
var DIRTY_CLASS = 'ng-dirty';

Expand All @@ -24,8 +24,8 @@ define(function (require) {
var ngModel = this;

// verify that angular works the way we are assuming it does
if (String(ngModel.$setViewValue).replace(/\s+/g, '') !== SVV_CHECKSUM) {
throw new Error('ngModelController.$setViewValue has updated but KbnModelController has not!');
if (angular.version.full !== '1.2.28') {
throw new Error('angular version has updated but KbnModelController has not!');
}

/**
Expand Down
12 changes: 9 additions & 3 deletions src/kibana/components/vis/_agg_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ define(function (require) {

if (val == null) {
if (aggParam.default == null) return;
else val = aggParam.default;

if (!_.isFunction(aggParam.default)) {
val = aggParam.default;
} else {
val = aggParam.default(self);
if (val == null) return;
}
}

if (aggParam.deserialize) {
Expand Down Expand Up @@ -104,8 +110,8 @@ define(function (require) {
* @return {object} the new params object
*/
AggConfig.prototype.resetParams = function () {
// We need to ensure that row doesn't get overriden.
return this.fillDefaults(_.pick(this.params, 'row'));
// We need to ensure that row and field don't get overriden.
return this.fillDefaults(_.pick(this.params, 'row', 'field'));
};

AggConfig.prototype.write = function () {
Expand Down
4 changes: 2 additions & 2 deletions src/kibana/components/vislib/lib/resize_checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ define(function (require) {
var sequencer = require('utils/sequencer');

var SCHEDULE = ResizeChecker.SCHEDULE = sequencer.createEaseIn(
5, // shortest delay
100, // shortest delay
10000, // longest delay
125 // tick count
50 // tick count
);

// maximum ms that we can delay emitting 'resize'. This is only used
Expand Down
6 changes: 4 additions & 2 deletions src/kibana/components/vislib/visualizations/area_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ define(function (require) {
// Append the bars
circles = layer
.selectAll('rect')
.data(function appendData(d) {
return d;
.data(function appendData(data) {
return data.filter(function isNotZero(d) {
return d.y !== 0;
});
});

// exit
Expand Down
20 changes: 18 additions & 2 deletions src/kibana/components/visualize/visualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,24 @@ define(function (require) {
template: require('text!components/visualize/visualize.html'),
link: function ($scope, $el, attr) {
var chart; // set in "vis" watcher
var $visEl = $el.find('.visualize-chart');
var $spyEl = $el.find('visualize-spy');
var minVisChartHeight = 180;

function getter(selector) {
return function () {
var $sel = $el.find(selector);
if ($sel.size()) return $sel;
};
}

var getVisEl = getter('.visualize-chart');
var getSpyEl = getter('visualize-spy');

$scope.spy = {mode: false};
$scope.fullScreenSpy = false;

var applyClassNames = function () {
var $spyEl = getSpyEl();
var $visEl = getVisEl();
var fullSpy = ($scope.spy.mode && ($scope.spy.mode.fill || $scope.fullScreenSpy));

// external
Expand Down Expand Up @@ -68,6 +78,9 @@ define(function (require) {

$scope.$watch('fullScreenSpy', applyClassNames);
$scope.$watchCollection('spy.mode', function (spyMode, oldSpyMode) {
var $visEl = getVisEl();
if (!$visEl) return;

// if the spy has been opened, check chart height
if (spyMode && !oldSpyMode) {
$scope.fullScreenSpy = $visEl.height() < minVisChartHeight;
Expand All @@ -76,6 +89,9 @@ define(function (require) {
});

$scope.$watch('vis', prereq(function (vis, oldVis) {
var $visEl = getVisEl();
if (!$visEl) return;

if (!attr.editableVis) {
$scope.editableVis = vis;
}
Expand Down
Loading

0 comments on commit 0032fb2

Please sign in to comment.