Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/feature/design' into fix/nav-d…
Browse files Browse the repository at this point in the history
…etails
  • Loading branch information
panda01 committed Feb 10, 2016
2 parents 6afcb8c + e96cb37 commit 180aacd
Show file tree
Hide file tree
Showing 984 changed files with 32,790 additions and 32,174 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ rules:
no-bitwise: 0
no-caller: 2
no-cond-assign: 0
no-const-assign: 2
no-debugger: 2
no-empty: 2
no-eval: 2
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ Distributable packages can be found in `target/` after the build completes.
Packages are built using fpm, pleaserun, dpkg, and rpm. fpm and pleaserun can be installed using gem. Package building has only been tested on Linux and is not supported on any other platform.
```sh
gem install pleaserun
apt-get install ruby-dev
gem install fpm
npm run build:ospackages
```
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Kibana is an open source ([Apache Licensed](https://github.com/elastic/kibana/bl

## Requirements

- Elasticsearch version 2.2.0 or later
- Elasticsearch master
- Kibana binary package

## Installation
Expand Down
6 changes: 3 additions & 3 deletions docs/setup.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
You can set up Kibana and start exploring your Elasticsearch indices in minutes.
All you need is:

* Elasticsearch 2.1 or later
* Elasticsearch master
* A modern web browser - http://www.elastic.co/subscriptions/matrix#matrix_browsers[Supported Browsers].
* Information about your Elasticsearch installation:
** URL of the Elasticsearch instance you want to connect to.
Expand Down Expand Up @@ -82,8 +82,8 @@ simply be the name of a single index.
reads the index mapping to list all of the fields that contain a timestamp. If your index doesn't have time-based data,
disable the *Index contains time-based events* option.
+
WARNING: Using event times to create index names is *deprecated* in this release of Kibana. Support for this functionality
will be removed entirely in the next major Kibana release. Elasticsearch 2.1 includes sophisticated date parsing APIs that
WARNING: Using event times to create index names is *deprecated* in this release of Kibana. Support for this functionality
will be removed entirely in the next major Kibana release. Elasticsearch 2.1 includes sophisticated date parsing APIs that
Kibana uses to determine date information, removing the need to specify dates in the index pattern name.
+
. Click *Create* to add the index pattern. This first pattern is automatically configured as the default.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
"commander": "2.8.1",
"css-loader": "0.17.0",
"d3": "3.5.6",
"elasticsearch": "8.0.1",
"elasticsearch-browser": "8.0.1",
"elasticsearch": "10.1.2",
"elasticsearch-browser": "10.1.2",
"expiry-js": "0.1.7",
"exports-loader": "0.6.2",
"expose-loader": "0.7.0",
Expand Down Expand Up @@ -154,7 +154,7 @@
"grunt-cli": "0.1.13",
"grunt-contrib-clean": "0.6.0",
"grunt-contrib-copy": "0.8.1",
"grunt-esvm": "2.0.0",
"grunt-esvm": "2.1.1",
"grunt-karma": "0.12.0",
"grunt-run": "0.5.0",
"grunt-s3": "0.2.0-alpha.3",
Expand Down
10 changes: 5 additions & 5 deletions src/cli/Command.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
let _ = require('lodash');
let Command = require('commander').Command;
import _ from 'lodash';

let red = require('./color').red;
let yellow = require('./color').yellow;
let help = require('./help');
import help from './help';
import { Command } from 'commander';
import { red } from './color';
import { yellow } from './color';

Command.prototype.error = function (err) {
if (err && err.message) err = err.message;
Expand Down
6 changes: 3 additions & 3 deletions src/cli/Log.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
let _ = require('lodash');
let ansicolors = require('ansicolors');
import _ from 'lodash';
import ansicolors from 'ansicolors';

let log = _.restParam(function (color, label, rest1) {
console.log.apply(console, [color(` ${_.trim(label)} `)].concat(rest1));
});

let color = require('./color');
import color from './color';

module.exports = class Log {
constructor(quiet, silent) {
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cli.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
let _ = require('lodash');
import _ from 'lodash';

let utils = require('requirefrom')('src/utils');
let pkg = utils('packageJson');
let Command = require('./Command');
import Command from './Command';

let argv = process.env.kbnWorkerArgv ? JSON.parse(process.env.kbnWorkerArgv) : process.argv.slice();
let program = new Command('bin/kibana');
Expand Down
10 changes: 5 additions & 5 deletions src/cli/cluster/cluster_manager.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const cluster = require('cluster');
import cluster from 'cluster';
const { join } = require('path');
const { format: formatUrl } = require('url');
const Hapi = require('hapi');
import Hapi from 'hapi';
const { debounce, compact, get, invoke, bindAll, once, sample } = require('lodash');

const Log = require('../Log');
const Worker = require('./worker');
const BasePathProxy = require('./base_path_proxy');
import Log from '../Log';
import Worker from './worker';
import BasePathProxy from './base_path_proxy';

process.env.kbnWorkerType = 'managr';

Expand Down
6 changes: 3 additions & 3 deletions src/cli/cluster/worker.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
let _ = require('lodash');
let cluster = require('cluster');
import _ from 'lodash';
import cluster from 'cluster';
let { resolve } = require('path');
let { EventEmitter } = require('events');

let fromRoot = require('../../utils/fromRoot');
import fromRoot from '../../utils/fromRoot';

let cliPath = fromRoot('src/cli');
let baseArgs = _.difference(process.argv.slice(2), ['--no-watch']);
Expand Down
4 changes: 2 additions & 2 deletions src/cli/color.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

var _ = require('lodash');
var ansicolors = require('ansicolors');
import _ from 'lodash';
import ansicolors from 'ansicolors';

exports.green = _.flow(ansicolors.black, ansicolors.bgGreen);
exports.red = _.flow(ansicolors.white, ansicolors.bgRed);
Expand Down
2 changes: 1 addition & 1 deletion src/cli/help.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var _ = require('lodash');
import _ from 'lodash';

module.exports = function (command, spaces) {
if (!_.size(command.commands)) {
Expand Down
31 changes: 31 additions & 0 deletions src/cli/plugin/__tests__/file_type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import expect from 'expect.js';
import fileType, { ZIP, TAR } from '../file_type';

describe('kibana cli', function () {
describe('file_type', function () {
it('returns ZIP for .zip filename', function () {
const type = fileType('wat.zip');
expect(type).to.equal(ZIP);
});
it('returns TAR for .tar.gz filename', function () {
const type = fileType('wat.tar.gz');
expect(type).to.equal(TAR);
});
it('returns TAR for .tgz filename', function () {
const type = fileType('wat.tgz');
expect(type).to.equal(TAR);
});
it('returns undefined for unknown file type', function () {
const type = fileType('wat.unknown');
expect(type).to.equal(undefined);
});
it('accepts paths', function () {
const type = fileType('/some/path/to/wat.zip');
expect(type).to.equal(ZIP);
});
it('accepts urls', function () {
const type = fileType('http://example.com/wat.zip');
expect(type).to.equal(ZIP);
});
});
});
6 changes: 3 additions & 3 deletions src/cli/plugin/__tests__/plugin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const expect = require('expect.js');
const sinon = require('sinon');
const plugin = require('../plugin');
import expect from 'expect.js';
import sinon from 'sinon';
import plugin from '../plugin';

describe('kibana cli', function () {

Expand Down
12 changes: 6 additions & 6 deletions src/cli/plugin/__tests__/plugin_cleaner.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const expect = require('expect.js');
const sinon = require('sinon');
const fs = require('fs');
const rimraf = require('rimraf');
import expect from 'expect.js';
import sinon from 'sinon';
import fs from 'fs';
import rimraf from 'rimraf';

const pluginCleaner = require('../plugin_cleaner');
const pluginLogger = require('../plugin_logger');
import pluginCleaner from '../plugin_cleaner';
import pluginLogger from '../plugin_logger';

describe('kibana cli', function () {

Expand Down
37 changes: 28 additions & 9 deletions src/cli/plugin/__tests__/plugin_downloader.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const expect = require('expect.js');
const sinon = require('sinon');
const nock = require('nock');
const glob = require('glob');
const rimraf = require('rimraf');
const { join } = require('path');
const mkdirp = require('mkdirp');
const pluginLogger = require('../plugin_logger');
const pluginDownloader = require('../plugin_downloader');
import expect from 'expect.js';
import sinon from 'sinon';
import nock from 'nock';
import glob from 'glob';
import rimraf from 'rimraf';
import mkdirp from 'mkdirp';
import pluginLogger from '../plugin_logger';
import pluginDownloader from '../plugin_downloader';
import { join } from 'path';

describe('kibana cli', function () {

Expand Down Expand Up @@ -124,6 +124,25 @@ describe('kibana cli', function () {
});
});

it('should consider .tgz files as archive type .tar.gz', function () {
const filePath = join(__dirname, 'replies/test_plugin_master.tar.gz');

const couchdb = nock('http://www.files.com')
.defaultReplyHeaders({
'content-length': '10'
})
.get('/plugin.tgz')
.replyWithFile(200, filePath);

const sourceUrl = 'http://www.files.com/plugin.tgz';

return downloader._downloadSingle(sourceUrl)
.then(function (data) {
expect(data.archiveType).to.be('.tar.gz');
expectWorkingPathNotEmpty();
});
});

it('should download a zip from a valid http url', function () {
const filePath = join(__dirname, 'replies/test_plugin_master.zip');

Expand Down
20 changes: 10 additions & 10 deletions src/cli/plugin/__tests__/plugin_extractor.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const expect = require('expect.js');
const sinon = require('sinon');
const glob = require('glob');
const rimraf = require('rimraf');
const { join } = require('path');
const mkdirp = require('mkdirp');

const pluginLogger = require('../plugin_logger');
const extract = require('../plugin_extractor');
const pluginDownloader = require('../plugin_downloader');
import expect from 'expect.js';
import sinon from 'sinon';
import glob from 'glob';
import rimraf from 'rimraf';
import mkdirp from 'mkdirp';

import pluginLogger from '../plugin_logger';
import extract from '../plugin_extractor';
import pluginDownloader from '../plugin_downloader';
import { join } from 'path';

describe('kibana cli', function () {

Expand Down
14 changes: 7 additions & 7 deletions src/cli/plugin/__tests__/plugin_installer.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const expect = require('expect.js');
const sinon = require('sinon');
const rimraf = require('rimraf');
const { mkdirSync } = require('fs');
const { join } = require('path');
const pluginLogger = require('../plugin_logger');
const pluginInstaller = require('../plugin_installer');
import expect from 'expect.js';
import sinon from 'sinon';
import rimraf from 'rimraf';
import pluginLogger from '../plugin_logger';
import pluginInstaller from '../plugin_installer';
import { mkdirSync } from 'fs';
import { join } from 'path';

describe('kibana cli', function () {

Expand Down
6 changes: 3 additions & 3 deletions src/cli/plugin/__tests__/plugin_logger.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const expect = require('expect.js');
const sinon = require('sinon');
const pluginLogger = require('../plugin_logger');
import expect from 'expect.js';
import sinon from 'sinon';
import pluginLogger from '../plugin_logger';

describe('kibana cli', function () {

Expand Down
8 changes: 4 additions & 4 deletions src/cli/plugin/__tests__/progress_reporter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const expect = require('expect.js');
const sinon = require('sinon');
const progressReporter = require('../progress_reporter');
const pluginLogger = require('../plugin_logger');
import expect from 'expect.js';
import sinon from 'sinon';
import progressReporter from '../progress_reporter';
import pluginLogger from '../plugin_logger';

describe('kibana cli', function () {

Expand Down
6 changes: 3 additions & 3 deletions src/cli/plugin/__tests__/setting_parser.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var path = require('path');
var expect = require('expect.js');
import path from 'path';
import expect from 'expect.js';

var utils = require('requirefrom')('src/utils');
var fromRoot = utils('fromRoot');
var settingParser = require('../setting_parser');
import settingParser from '../setting_parser';

describe('kibana cli', function () {

Expand Down
16 changes: 4 additions & 12 deletions src/cli/plugin/downloaders/file.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { createWriteStream, createReadStream, unlinkSync, statSync } = require('fs');
const getProgressReporter = require('../progress_reporter');
import getProgressReporter from '../progress_reporter';
import { createWriteStream, createReadStream, unlinkSync, statSync } from 'fs';
import fileType from '../file_type';

function openSourceFile({ sourcePath }) {
try {
Expand Down Expand Up @@ -36,15 +37,6 @@ async function copyFile({ readStream, writeStream, progressReporter }) {
});
}

function getArchiveTypeFromFilename(path) {
if (/\.zip$/i.test(path)) {
return '.zip';
}
if (/\.tar\.gz$/i.test(path)) {
return '.tar.gz';
}
}

/*
// Responsible for managing local file transfers
*/
Expand All @@ -67,7 +59,7 @@ export default async function copyLocalFile(logger, sourcePath, targetPath) {
}

// all is well, return our archive type
const archiveType = getArchiveTypeFromFilename(sourcePath);
const archiveType = fileType(sourcePath);
return { archiveType };
} catch (err) {
logger.error(err);
Expand Down
Loading

0 comments on commit 180aacd

Please sign in to comment.