Skip to content
This repository has been archived by the owner on Oct 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #126 from sirensolutions/5.2port
Browse files Browse the repository at this point in the history
Moving master to 5.2.2-SNAPSHOT
  • Loading branch information
fabiocorneti authored Apr 3, 2017
2 parents ff9a39c + c16cd5e commit dedf9a2
Show file tree
Hide file tree
Showing 21 changed files with 1,234 additions and 1,252 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This plugin can be installed in both:
### Automatic

```sh
$ ./bin/kibi plugin -i kibi_timeline_vis -u https://github.com/sirensolutions/kibi_timeline_vis/raw/4.6.3-1/target/kibi_timeline_vis-4.6.3-1.zip
$ ./bin/kibi plugin -i kibi_timeline_vis -u https://github.com/sirensolutions/kibi_timeline_vis/raw/5.2.2/target/kibi_timeline_vis-5.2.2.zip
```

### Manual
Expand All @@ -27,7 +27,7 @@ $ cd kibi_timeline_vis
$ npm install
$ npm run build
$ gulp package
$ unzip target/kibi_timeline_vis-4.6.4.zip -d KIBANA_FOLDER_PATH/installedPlugins/
$ unzip target/kibi_timeline_vis-5.2.2.zip -d KIBANA_FOLDER_PATH/plugins/
```

## Uninstall
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var knownOptions = {
};
var options = minimist(process.argv.slice(2), knownOptions);

var kibanaPluginDir = path.resolve(__dirname, options.kibanahomepath + '/installedPlugins/' + pkg.name);
var kibanaPluginDir = path.resolve(__dirname, options.kibanahomepath + '/plugins/' + pkg.name);


function syncPluginTo(dest, done) {
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "kibi_timeline_vis",
"version": "4.6.4",
"version": "5.2.2-SNAPSHOT",
"kibana" : {
"version": "5.2.2"
},
"authors": [
"SIREn Solutions <info@siren.solutions>"
],
Expand All @@ -24,9 +27,10 @@
"vis": "4.17.0"
},
"devDependencies": {
"babel-eslint": "^4.1.7",
"babel-eslint": "6.1.2",
"bluebird": "^3.0.6",
"eslint": "^1.10.3",
"bower": "^1.6.9",
"eslint": "3.11.1",
"gulp": "^3.9.0",
"gulp-eslint": "^1.1.1",
"gulp-zip": "3.1.0",
Expand Down
13 changes: 7 additions & 6 deletions public/__tests__/_vis.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const ngMock = require('ngMock');
const expect = require('expect.js');

require('../kibi_timeline');
import IndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
import visProvider from 'ui/vis';
import ngMock from 'ng_mock';
import expect from 'expect.js';
import '../kibi_timeline';

describe('Kibi Timeline', function () {
describe('Visualization', function () {
Expand All @@ -18,8 +19,8 @@ describe('Kibi Timeline', function () {
});

ngMock.inject(function ($injector, Private) {
const Vis = Private(require('ui/Vis'));
const indexPattern = Private(require('fixtures/stubbed_logstash_index_pattern'));
const Vis = Private(visProvider);
const indexPattern = Private(IndexPatternProvider);
vis = new Vis(indexPattern, {
type: 'kibi_timeline'
});
Expand Down
10 changes: 4 additions & 6 deletions public/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
describe('Kibi Timeline', function () {
require('./kibi_timeline');
require('./_vis');
require('./kibi_select');
require('../lib/helpers/__tests__/timeline_helper');
});
import './kibi_timeline';
import './_vis';
import './kibi_select';
import '../lib/helpers/__tests__/timeline_helper';
16 changes: 8 additions & 8 deletions public/__tests__/kibi_select.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const sinon = require('auto-release-sinon');
const angular = require('angular');
const _ = require('lodash');
const ngMock = require('ngMock');
const expect = require('expect.js');

require('../lib/directives/kibi_select');
import SelectHelperProvider from '../lib/directives/kibi_select_helper';
import sinon from 'auto-release-sinon';
import angular from 'angular';
import _ from 'lodash';
import ngMock from 'ng_mock';
import expect from 'expect.js';
import '../lib/directives/kibi_select';

let $rootScope;
let $elem;
Expand All @@ -18,7 +18,7 @@ const init = function (initValue,items, objectType,include) {
$rootScope = _$rootScope_;
$rootScope.model = initValue;

const selectHelper = Private(require('../lib/directives/kibi_select_helper'));
const selectHelper = Private(SelectHelperProvider);
$rootScope.action = sinon.stub(selectHelper, 'getObjects').returns(Promise.resolve(items));

let select = '<kibi-select-port ng-model="model" object-type="' + objectType + '"';
Expand Down
35 changes: 20 additions & 15 deletions public/__tests__/kibi_timeline.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
const sinon = require('auto-release-sinon');
const angular = require('angular');
const expect = require('expect.js');
const _ = require('lodash');
const ngMock = require('ngMock');
const moment = require('moment');
import SearchSourceProvider from 'fixtures/stubbed_search_source';
import TimelineHelper from '../lib/helpers/timeline_helper';
import sinon from 'auto-release-sinon';
import angular from 'angular';
import expect from 'expect.js';
import _ from 'lodash';
import ngMock from 'ng_mock';
import moment from 'moment';
import 'plugins/kibi_timeline_vis/kibi_timeline_vis_controller';

require('plugins/kibi_timeline_vis/kibi_timeline_vis_controller');

Expand Down Expand Up @@ -53,12 +56,12 @@ describe('KibiTimeline Directive', function () {
$elem.appendTo('body');

ngMock.inject(function (_highlightTags_, Private) {
const timelineHelper = Private(require('../lib/helpers/timeline_helper'));
getSortOnFieldObjectSpy = sinon.spy(timelineHelper, 'getSortOnFieldObject');
const TimelineHelper = Private(require('../lib/helpers/timeline_helper'));
getSortOnFieldObjectSpy = sinon.spy(TimelineHelper, 'getSortOnFieldObject');

highlightTags = _highlightTags_;

searchSource = Private(require('fixtures/stubbed_search_source'));
searchSource = Private(SearchSourceProvider);
searchSource.highlight = sinon.stub();
searchSource.sort = sinon.stub();
});
Expand Down Expand Up @@ -147,7 +150,6 @@ describe('KibiTimeline Directive', function () {
});
});


it('should return an event with the all the labels joined', function () {
initTimeline({
startField: '@timestamp',
Expand Down Expand Up @@ -417,6 +419,7 @@ describe('KibiTimeline Directive', function () {
});

describe('Missing data', function () {

it('should support documents with missing label', function () {
initTimeline({
startField: '@timestamp',
Expand Down Expand Up @@ -515,6 +518,7 @@ describe('KibiTimeline Directive', function () {
});

describe('Filter creation', function () {

const simulateClickOnItem = function ($el) {
const $panel = $el.find('.vis-panel.vis-center');
const $item = $el.find('.vis-content .vis-itemset .vis-foreground .vis-group .vis-item .vis-item-content .kibi-tl-label-item');
Expand Down Expand Up @@ -545,8 +549,8 @@ describe('KibiTimeline Directive', function () {
failed: 0
},
hits: {
total : 49487,
max_score : 1.0,
total: 49487,
max_score: 1.0,
hits: [
{
_index: 'logstash-2014.09.09',
Expand All @@ -561,15 +565,14 @@ describe('KibiTimeline Directive', function () {
}
},
fields: {
'@timestamp': [ dateStartObj ],
'endDate': [ dateEndObj ],
'@timestamp': [dateStartObj],
'endDate': [dateEndObj],
}
}
]
}
};


it('correct filter should be created - (default) ID', function (done) {
initTimeline({
startField: '@timestamp',
Expand Down Expand Up @@ -723,6 +726,8 @@ describe('KibiTimeline Directive', function () {
}, 0);
}, 0);
});

});

});

20 changes: 10 additions & 10 deletions public/__tests__/kibi_timeline_vis_controller.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
const ngMock = require('ngMock');
const _ = require('lodash');
const expect = require('expect.js');
const $ = require('jquery');
const sinon = require('auto-release-sinon');
const mockSavedObjects = require('fixtures/kibi/mock_saved_objects');

require('../kibi_timeline_vis_controller');
import ngMock from 'ng_mock';
import _ from 'lodash';
import expect from 'expect.js';
import $ from 'jquery';
import sinon from 'auto-release-sinon';
import mockSavedObjects from 'fixtures/kibi/mock_saved_objects';
import '../kibi_timeline_vis_controller';
import noDigestPromises from 'test_utils/no_digest_promises';

describe('Kibi Timeline', function () {

require('testUtils/noDigestPromises').activateForSuite();

let $scope;
let $element;

Expand Down Expand Up @@ -68,6 +66,8 @@ describe('Kibi Timeline', function () {
};

describe('Controller', function () {
noDigestPromises.activateForSuite();

it('should set the vis options', function () {
init({});

Expand Down
Loading

0 comments on commit dedf9a2

Please sign in to comment.