mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[eslint] enable no undef (#10825)
* [codeshift] add proper ignore comments * [codeshift] apply require-to-import transform * [codeshift/fixup] remove duplicate imports * [eslint] upgrade config for react "unused" support * [codeshift] apply remove-unused-imports transform * [codeshift] apply remove-unused-basic-requires transform * [codeshift] apply remove-unused-function-arguments transform * [lintroller] fix argument list spacing * [codeshift] apply remove-unused-basic-bars transform * [codeshift/fixup] fixup unused basic var removals * manually apply remove-unused-assignments transform * [codeshift] reapply remove-unused-imports transform * [codeshift] reapply remove-unused-function-arguments transform * [eslint] autofix param spacing * manually fix remaining no-undef errors * use more descriptive file ignore pattern * add eslint-plugin-react peerDependency * replace values that looked unused in tests * remove // kibana-jscodeshift-no-babel comment * remove import statements from code required by api tests * Remove '// kibana-jscodeshift-ignore' comments * address review feedback * remove remnant of removed if condition
This commit is contained in:
parent
8f51ec6d84
commit
d8d65526c6
789 changed files with 997 additions and 2240 deletions
|
@ -1,4 +1,2 @@
|
|||
---
|
||||
extends: '@elastic/kibana'
|
||||
rules:
|
||||
no-unused-vars: off
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
const camelCase = require('lodash').camelCase;
|
||||
require('./src/optimize/babel/register');
|
||||
|
||||
module.exports = function (grunt) {
|
||||
|
|
|
@ -198,7 +198,7 @@
|
|||
"wreck": "6.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@elastic/eslint-config-kibana": "0.3.0",
|
||||
"@elastic/eslint-config-kibana": "0.4.0",
|
||||
"angular-mocks": "1.4.7",
|
||||
"auto-release-sinon": "1.0.3",
|
||||
"babel-eslint": "6.1.2",
|
||||
|
@ -213,6 +213,7 @@
|
|||
"eslint": "3.11.1",
|
||||
"eslint-plugin-babel": "4.0.0",
|
||||
"eslint-plugin-mocha": "4.7.0",
|
||||
"eslint-plugin-react": "6.10.3",
|
||||
"event-stream": "3.3.2",
|
||||
"expect.js": "0.3.1",
|
||||
"faker": "1.1.0",
|
||||
|
|
|
@ -27,7 +27,7 @@ program
|
|||
|
||||
program
|
||||
.command('*', null, { noHelp: true })
|
||||
.action(function (cmd, options) {
|
||||
.action(function (cmd) {
|
||||
program.error(`unknown command ${cmd}`);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import expect from 'expect.js';
|
||||
import sinon from 'auto-release-sinon';
|
||||
import cluster from 'cluster';
|
||||
import { ChildProcess } from 'child_process';
|
||||
import { sample, difference } from 'lodash';
|
||||
import { sample } from 'lodash';
|
||||
|
||||
import ClusterManager from '../cluster_manager';
|
||||
import Worker from '../worker';
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import expect from 'expect.js';
|
||||
import sinon from 'auto-release-sinon';
|
||||
import cluster from 'cluster';
|
||||
import { ChildProcess } from 'child_process';
|
||||
import { difference, findIndex, sample } from 'lodash';
|
||||
import { fromNode as fn } from 'bluebird';
|
||||
import { findIndex } from 'lodash';
|
||||
|
||||
import MockClusterFork from './_mock_cluster_fork';
|
||||
import Worker from '../worker';
|
||||
|
@ -135,7 +133,6 @@ describe('CLI cluster manager', function () {
|
|||
context('when sent WORKER_LISTENING message', function () {
|
||||
it('sets the listening flag and emits the listening event', function () {
|
||||
const worker = setup();
|
||||
const data = {};
|
||||
const stub = sinon.stub(worker, 'emit');
|
||||
expect(worker).to.have.property('listening', false);
|
||||
worker.onMessage('WORKER_LISTENING');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Server } from 'hapi';
|
||||
import { notFound } from 'boom';
|
||||
import { map, merge, sample } from 'lodash';
|
||||
import { map, sample } from 'lodash';
|
||||
import { format as formatUrl } from 'url';
|
||||
import { map as promiseMap, fromNode } from 'bluebird';
|
||||
import { Agent as HttpsAgent } from 'https';
|
||||
|
@ -11,7 +11,6 @@ import setupConnection from '../../server/http/setup_connection';
|
|||
import registerHapiPlugins from '../../server/http/register_hapi_plugins';
|
||||
import setupLogging from '../../server/logging';
|
||||
import { transformDeprecations } from '../../server/config/transform_deprecations';
|
||||
import { DEV_SSL_CERT_PATH } from '../dev_ssl';
|
||||
|
||||
const alphabet = 'abcdefghijklmnopqrztuvwxyz'.split('');
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import cluster from 'cluster';
|
||||
const { join, resolve } = require('path');
|
||||
const { format: formatUrl } = require('url');
|
||||
import Hapi from 'hapi';
|
||||
const { debounce, compact, get, invoke, bindAll, once, sample, uniq } = require('lodash');
|
||||
import { resolve } from 'path';
|
||||
import { debounce, invoke, bindAll, once, uniq } from 'lodash';
|
||||
|
||||
import Log from '../log';
|
||||
import Worker from './worker';
|
||||
|
@ -124,7 +121,7 @@ module.exports = class ClusterManager {
|
|||
rl.setPrompt('');
|
||||
rl.prompt();
|
||||
|
||||
rl.on('line', line => {
|
||||
rl.on('line', () => {
|
||||
nls = nls + 1;
|
||||
|
||||
if (nls >= 2) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
import cluster from 'cluster';
|
||||
import { resolve } from 'path';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
import { BinderFor, fromRoot } from '../../utils';
|
||||
|
|
|
@ -3,7 +3,6 @@ import _ from 'lodash';
|
|||
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;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import _ from 'lodash';
|
||||
import ansicolors from 'ansicolors';
|
||||
|
||||
const log = _.restParam(function (color, label, rest1) {
|
||||
console.log.apply(console, [color(` ${_.trim(label)} `)].concat(rest1));
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import expect from 'expect.js';
|
||||
import { join, relative, resolve } from 'path';
|
||||
import readYamlConfig from '../read_yaml_config';
|
||||
import sinon from 'auto-release-sinon';
|
||||
|
||||
function fixture(name) {
|
||||
return resolve(__dirname, 'fixtures', name);
|
||||
|
@ -11,7 +10,7 @@ describe('cli/serve/read_yaml_config', function () {
|
|||
it('reads a single config file', function () {
|
||||
const config = readYamlConfig(fixture('one.yml'));
|
||||
|
||||
expect(readYamlConfig(fixture('one.yml'))).to.eql({
|
||||
expect(config).to.eql({
|
||||
foo: 1,
|
||||
bar: true,
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { spawn } from 'child_process';
|
||||
import { writeFileSync, readFile } from 'fs';
|
||||
import { writeFileSync } from 'fs';
|
||||
import { relative, resolve } from 'path';
|
||||
import { safeDump } from 'js-yaml';
|
||||
import es from 'event-stream';
|
||||
|
@ -33,7 +33,7 @@ describe(`Server logging configuration`, function () {
|
|||
|
||||
let asserted = false;
|
||||
let json = Infinity;
|
||||
const conf = setLoggingJson(true);
|
||||
setLoggingJson(true);
|
||||
const child = spawn(cli, [`--config`, testConfigFile]);
|
||||
|
||||
child.on('error', err => {
|
||||
|
|
|
@ -3,8 +3,6 @@ import { readFileSync as read } from 'fs';
|
|||
import { safeLoad } from 'js-yaml';
|
||||
|
||||
|
||||
import { fromRoot } from '../../utils';
|
||||
|
||||
export function merge(sources) {
|
||||
return transform(sources, (merged, source) => {
|
||||
forOwn(source, function apply(val, key) {
|
||||
|
|
|
@ -30,7 +30,7 @@ program
|
|||
|
||||
program
|
||||
.command('*', null, { noHelp: true })
|
||||
.action(function (cmd, options) {
|
||||
.action(function (cmd) {
|
||||
program.error(`unknown command ${cmd}`);
|
||||
});
|
||||
|
||||
|
|
|
@ -16,21 +16,14 @@ describe('kibana cli', function () {
|
|||
};
|
||||
|
||||
describe('cleanPrevious', function () {
|
||||
let cleaner;
|
||||
let errorStub;
|
||||
let logger;
|
||||
let progress;
|
||||
let request;
|
||||
|
||||
beforeEach(function () {
|
||||
errorStub = sinon.stub();
|
||||
logger = new Logger(settings);
|
||||
sinon.stub(logger, 'log');
|
||||
sinon.stub(logger, 'error');
|
||||
request = {
|
||||
abort: sinon.stub(),
|
||||
emit: sinon.stub()
|
||||
};
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
|
@ -50,7 +43,7 @@ describe('kibana cli', function () {
|
|||
|
||||
return cleanPrevious(settings, logger)
|
||||
.catch(errorStub)
|
||||
.then(function (data) {
|
||||
.then(function () {
|
||||
expect(errorStub.called).to.be(false);
|
||||
});
|
||||
});
|
||||
|
@ -76,7 +69,7 @@ describe('kibana cli', function () {
|
|||
|
||||
return cleanPrevious(settings, logger)
|
||||
.catch(errorStub)
|
||||
.then(function (data) {
|
||||
.then(function () {
|
||||
expect(logger.log.calledWith('Found previous install attempt. Deleting...')).to.be(true);
|
||||
});
|
||||
});
|
||||
|
@ -101,19 +94,14 @@ describe('kibana cli', function () {
|
|||
|
||||
return cleanPrevious(settings, logger)
|
||||
.catch(errorStub)
|
||||
.then(function (data) {
|
||||
.then(function () {
|
||||
expect(errorStub.called).to.be(false);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('cleanArtifacts', function () {
|
||||
let logger;
|
||||
|
||||
beforeEach(function () {
|
||||
logger = new Logger(settings);
|
||||
});
|
||||
beforeEach(function () {});
|
||||
|
||||
afterEach(function () {
|
||||
rimraf.sync.restore();
|
||||
|
@ -133,7 +121,6 @@ describe('kibana cli', function () {
|
|||
|
||||
expect(cleanArtifacts).withArgs(settings).to.not.throwError();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -62,7 +62,7 @@ describe('kibana cli', function () {
|
|||
describe('http downloader', function () {
|
||||
|
||||
it('should throw an ENOTFOUND error for a http ulr that returns 404', function () {
|
||||
const couchdb = nock('http://example.com')
|
||||
nock('http://example.com')
|
||||
.get('/plugin.tar.gz')
|
||||
.reply(404);
|
||||
|
||||
|
@ -88,7 +88,7 @@ describe('kibana cli', function () {
|
|||
it('should download a file from a valid http url', function () {
|
||||
const filePath = join(__dirname, 'replies/banana.jpg');
|
||||
|
||||
const couchdb = nock('http://example.com')
|
||||
nock('http://example.com')
|
||||
.defaultReplyHeaders({
|
||||
'content-length': '341965',
|
||||
'content-type': 'application/zip'
|
||||
|
@ -174,7 +174,7 @@ describe('kibana cli', function () {
|
|||
'http://example.com/goodfile.tar.gz'
|
||||
];
|
||||
|
||||
const couchdb = nock('http://example.com')
|
||||
nock('http://example.com')
|
||||
.defaultReplyHeaders({
|
||||
'content-length': '10'
|
||||
})
|
||||
|
@ -204,7 +204,7 @@ describe('kibana cli', function () {
|
|||
'http://example.com/badfile3.tar.gz'
|
||||
];
|
||||
|
||||
const couchdb = nock('http://example.com')
|
||||
nock('http://example.com')
|
||||
.defaultReplyHeaders({
|
||||
'content-length': '10'
|
||||
})
|
||||
|
@ -233,7 +233,7 @@ describe('kibana cli', function () {
|
|||
'http://example.com/badfile3.tar.gz'
|
||||
];
|
||||
|
||||
const couchdb = nock('http://example.com')
|
||||
nock('http://example.com')
|
||||
.defaultReplyHeaders({
|
||||
'content-length': '10'
|
||||
})
|
||||
|
|
|
@ -173,7 +173,7 @@ describe('kibana cli', function () {
|
|||
|
||||
it('throw an error if there is no kibana plugin', function () {
|
||||
return copyReplyFile('test_plugin_no_kibana.zip')
|
||||
.then((data) => {
|
||||
.then(() => {
|
||||
return getPackData(settings, logger);
|
||||
})
|
||||
.then(shouldReject, (err) => {
|
||||
|
@ -183,7 +183,7 @@ describe('kibana cli', function () {
|
|||
|
||||
it('throw an error with a corrupt zip', function () {
|
||||
return copyReplyFile('corrupt.zip')
|
||||
.then((data) => {
|
||||
.then(() => {
|
||||
return getPackData(settings, logger);
|
||||
})
|
||||
.then(shouldReject, (err) => {
|
||||
|
@ -193,7 +193,7 @@ describe('kibana cli', function () {
|
|||
|
||||
it('throw an error if there an invalid plugin name', function () {
|
||||
return copyReplyFile('invalid_name.zip')
|
||||
.then((data) => {
|
||||
.then(() => {
|
||||
return getPackData(settings, logger);
|
||||
})
|
||||
.then(shouldReject, (err) => {
|
||||
|
|
|
@ -10,7 +10,6 @@ describe('kibana cli', function () {
|
|||
describe('progressReporter', function () {
|
||||
let logger;
|
||||
let progress;
|
||||
let request;
|
||||
|
||||
beforeEach(function () {
|
||||
logger = new Logger({ silent: false, quiet: false });
|
||||
|
@ -87,7 +86,6 @@ describe('kibana cli', function () {
|
|||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -35,7 +35,7 @@ describe('plugin folder rename', function () {
|
|||
});
|
||||
|
||||
return renamePlugin('/foo/bar', '/bar/foo')
|
||||
.then(function (err) {
|
||||
.then(function () {
|
||||
expect(renameStub.callCount).to.be(1);
|
||||
})
|
||||
.catch(function () {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import path from 'path';
|
||||
import expect from 'expect.js';
|
||||
import { fromRoot } from '../../../utils';
|
||||
import { resolve } from 'path';
|
||||
import { parseMilliseconds, parse, getPlatform } from '../settings';
|
||||
import { parseMilliseconds, parse } from '../settings';
|
||||
|
||||
describe('kibana cli', function () {
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ describe('kibana cli', function () {
|
|||
workingPath: testWorkingPath,
|
||||
tempArchiveFile: tempArchiveFilePath,
|
||||
plugin: 'test-plugin',
|
||||
setPlugin: function (plugin) {}
|
||||
setPlugin: function () {}
|
||||
};
|
||||
|
||||
function shouldReject() {
|
||||
|
|
|
@ -7,7 +7,7 @@ function _isWindows() {
|
|||
return /^win/.test(process.platform);
|
||||
}
|
||||
|
||||
export function _getFilePath(filePath, sourceUrl) {
|
||||
export function _getFilePath(filePath) {
|
||||
const decodedPath = decodeURI(filePath);
|
||||
const prefixedDrive = /^\/[a-zA-Z]:/.test(decodedPath);
|
||||
if (_isWindows() && prefixedDrive) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Progress from '../progress';
|
||||
import { createWriteStream, createReadStream, unlinkSync, statSync } from 'fs';
|
||||
import { createWriteStream, createReadStream, statSync } from 'fs';
|
||||
|
||||
function openSourceFile({ sourcePath }) {
|
||||
try {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Wreck from 'wreck';
|
||||
import Progress from '../progress';
|
||||
import { fromNode as fn } from 'bluebird';
|
||||
import { createWriteStream, unlinkSync } from 'fs';
|
||||
import { createWriteStream } from 'fs';
|
||||
|
||||
function sendRequest({ sourceUrl, timeout }) {
|
||||
const maxRedirects = 11; //Because this one goes to 11.
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
import { fromRoot } from '../../utils';
|
||||
import fs from 'fs';
|
||||
import install from './install';
|
||||
import Logger from '../lib/logger';
|
||||
import pkg from '../../utils/package_json';
|
||||
import { getConfig } from '../../server/path';
|
||||
import { parse, parseMilliseconds } from './settings';
|
||||
import { find } from 'lodash';
|
||||
import logWarnings from '../lib/log_warnings';
|
||||
|
||||
function processCommand(command, options) {
|
||||
|
|
|
@ -17,7 +17,7 @@ async function listPackages(settings) {
|
|||
.map(file => file.replace(/\\/g, '/'))
|
||||
.map(file => file.match(regExp))
|
||||
.compact()
|
||||
.map(([ file, _, folder ]) => ({ file, folder }))
|
||||
.map(([ file, , folder ]) => ({ file, folder }))
|
||||
.uniq()
|
||||
.value();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import expiry from 'expiry-js';
|
||||
import { intersection } from 'lodash';
|
||||
import { resolve } from 'path';
|
||||
import { arch, platform } from 'os';
|
||||
|
||||
function generateUrls({ version, plugin }) {
|
||||
return [
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import path from 'path';
|
||||
import expect from 'expect.js';
|
||||
import fromRoot from '../../../utils/from_root';
|
||||
import { resolve } from 'path';
|
||||
import { parseMilliseconds, parse } from '../settings';
|
||||
import { parse } from '../settings';
|
||||
|
||||
describe('kibana cli', function () {
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import { resolve } from 'path';
|
||||
|
||||
export function parse(command, options) {
|
||||
export function parse(command) {
|
||||
const settings = {
|
||||
pluginDir: command.pluginDir || ''
|
||||
};
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import path from 'path';
|
||||
import expect from 'expect.js';
|
||||
import fromRoot from '../../../utils/from_root';
|
||||
import { resolve } from 'path';
|
||||
import { parseMilliseconds, parse } from '../settings';
|
||||
import { parse } from '../settings';
|
||||
|
||||
describe('kibana cli', function () {
|
||||
|
||||
|
|
|
@ -56,30 +56,6 @@ module.exports = function (api) {
|
|||
]
|
||||
});
|
||||
|
||||
|
||||
function getRepositoryType(context, editor) {
|
||||
var iter = editor.iterForCurrentLoc();
|
||||
// for now just iterate back to the first "type" key
|
||||
var t = iter.getCurrentToken();
|
||||
var type;
|
||||
while (t && t.type.indexOf("url") < 0) {
|
||||
if (t.type === 'variable' && t.value === '"type"') {
|
||||
t = editor.parser.nextNonEmptyToken(iter);
|
||||
if (!t || t.type !== "punctuation.colon") {
|
||||
// weird place to be in, but safe choice..
|
||||
break;
|
||||
}
|
||||
t = editor.parser.nextNonEmptyToken(iter);
|
||||
if (t && t.type === "string") {
|
||||
type = t.value.replace(/"/g, '');
|
||||
}
|
||||
break;
|
||||
}
|
||||
t = editor.parser.prevNonEmptyToken(iter);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
api.addEndpointDescription('put_repository', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
|
|
|
@ -3,7 +3,7 @@ import Boom from 'boom';
|
|||
import apiServer from './api_server/server';
|
||||
import { existsSync } from 'fs';
|
||||
import { resolve, join, sep } from 'path';
|
||||
import { has, startsWith, endsWith } from 'lodash';
|
||||
import { has } from 'lodash';
|
||||
import { ProxyConfigCollection } from './server/proxy_config_collection';
|
||||
import { getElasticsearchProxyConfig } from './server/elasticsearch_proxy_config';
|
||||
|
||||
|
@ -118,7 +118,7 @@ export default function (kibana) {
|
|||
done(null, uri, filterHeaders(request.headers, requestHeadersWhitelist));
|
||||
},
|
||||
xforward: true,
|
||||
onResponse(err, res, request, reply, settings, ttl) {
|
||||
onResponse(err, res, request, reply) {
|
||||
if (err != null) {
|
||||
reply(`Error connecting to '${uri}':\n\n${err.message}`).type('text/plain').statusCode = 502;
|
||||
} else {
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
var $ = require('jquery');
|
||||
|
||||
let curl = require('./curl');
|
||||
let history = require('./history');
|
||||
let mappings = require('./mappings');
|
||||
let es = require('./es');
|
||||
let _ = require('lodash');
|
||||
|
||||
export default function init(input, output, sourceLocation = 'stored') {
|
||||
$(document.body).removeClass('fouc');
|
||||
|
@ -51,7 +48,7 @@ export default function init(input, output, sourceLocation = 'stored') {
|
|||
var timer;
|
||||
var saveDelay = 500;
|
||||
|
||||
input.getSession().on("change", function onChange(e) {
|
||||
input.getSession().on("change", function onChange() {
|
||||
if (timer) {
|
||||
timer = clearTimeout(timer);
|
||||
}
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
let history = require('./history');
|
||||
let kb = require('./kb');
|
||||
let mappings = require('./mappings');
|
||||
let ace = require('ace');
|
||||
let utils = require('./utils');
|
||||
let autocomplete_engine = require('./autocomplete/engine');
|
||||
let url_pattern_matcher = require('./autocomplete/url_pattern_matcher');
|
||||
let _ = require('lodash');
|
||||
let ext_lang_tools = require('ace/ext-language_tools');
|
||||
let ace = require('ace');
|
||||
require('ace/ext-language_tools');
|
||||
|
||||
var AceRange = ace.require('ace/range').Range;
|
||||
|
||||
|
@ -81,17 +79,6 @@ module.exports = function (editor) {
|
|||
});
|
||||
}
|
||||
|
||||
function termToFilterRegex(term, prefix, suffix) {
|
||||
if (!prefix) {
|
||||
prefix = "";
|
||||
}
|
||||
if (!suffix) {
|
||||
suffix = "";
|
||||
}
|
||||
|
||||
return new RegExp(prefix + term.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') + suffix, 'i');
|
||||
}
|
||||
|
||||
function applyTerm(term) {
|
||||
var session = editor.getSession();
|
||||
|
||||
|
@ -318,7 +305,6 @@ module.exports = function (editor) {
|
|||
// - Nice token, broken before: {, "bla"
|
||||
|
||||
var session = editor.getSession();
|
||||
var insertingRelativeToToken;
|
||||
|
||||
context.updatedForToken = _.clone(session.getTokenAt(pos.row, pos.column));
|
||||
if (!context.updatedForToken) {
|
||||
|
@ -507,8 +493,12 @@ module.exports = function (editor) {
|
|||
context.suffixToAdd = "";
|
||||
}
|
||||
|
||||
function addMethodAutoCompleteSetToContext(context, pos) {
|
||||
context.autoCompleteSet = ["GET", "PUT", "POST", "DELETE", "HEAD"].map((m, i) => {name: m; score: -i; meta: 'method'});
|
||||
function addMethodAutoCompleteSetToContext(context) {
|
||||
context.autoCompleteSet = ["GET", "PUT", "POST", "DELETE", "HEAD"].map((m, i) => ({
|
||||
name: m,
|
||||
score: -i,
|
||||
meta: 'method'
|
||||
}));
|
||||
}
|
||||
|
||||
function addPathAutoCompleteSetToContext(context, pos) {
|
||||
|
@ -593,7 +583,7 @@ module.exports = function (editor) {
|
|||
function getCurrentMethodAndTokenPaths(pos) {
|
||||
var tokenIter = editor.iterForPosition(pos.row, pos.column);
|
||||
var startPos = pos;
|
||||
var bodyTokenPath = [], last_var = "", first_scope = true, ret = {};
|
||||
var bodyTokenPath = [], ret = {};
|
||||
|
||||
var STATES = {
|
||||
looking_for_key: 0, // looking for a key but without jumping over anything but white space and colon.
|
||||
|
@ -881,7 +871,7 @@ module.exports = function (editor) {
|
|||
editor.execCommand("startAutocomplete");
|
||||
}, 100);
|
||||
|
||||
function editorChangeListener(e) {
|
||||
function editorChangeListener() {
|
||||
var cursor = editor.selection.lead;
|
||||
if (editor.__ace.completer && editor.__ace.completer.activated) {
|
||||
return;
|
||||
|
@ -964,8 +954,7 @@ module.exports = function (editor) {
|
|||
// Hook into Ace
|
||||
|
||||
// disable standard context based autocompletion.
|
||||
ace.define('ace/autocomplete/text_completer', ['require', 'exports', 'module'], function (require, exports,
|
||||
module) {
|
||||
ace.define('ace/autocomplete/text_completer', ['require', 'exports', 'module'], function (require, exports) {
|
||||
exports.getCompletions = function (editor, session, pos, prefix, callback) {
|
||||
callback(null, []);
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ function compileList(listRule, compilingContext) {
|
|||
}
|
||||
|
||||
/** takes a compiled object and wraps in a {@link ConditionalProxy }*/
|
||||
function compileCondition(description, compiledObject, compilingContext) {
|
||||
function compileCondition(description, compiledObject) {
|
||||
if (description.lines_regex) {
|
||||
return new ConditionalProxy(function (context, editor) {
|
||||
let lines = editor.getSession().getLines(context.requestStartRow, editor.getCursorPosition().row).join("\n");
|
||||
|
@ -350,11 +350,11 @@ GlobalOnlyComponent.prototype = _.create(
|
|||
|
||||
(function (cls) {
|
||||
|
||||
cls.getTerms = function (context, editor) {
|
||||
cls.getTerms = function () {
|
||||
return null;
|
||||
};
|
||||
|
||||
cls.match = function (token, context, editor) {
|
||||
cls.match = function (token, context) {
|
||||
var result = {
|
||||
next: []
|
||||
};
|
||||
|
|
|
@ -7,7 +7,7 @@ module.exports.AutocompleteComponent = function (name) {
|
|||
/** called to get the possible suggestions for tokens, when this object is at the end of
|
||||
* the resolving chain (and thus can suggest possible continuation paths)
|
||||
*/
|
||||
module.exports.AutocompleteComponent.prototype.getTerms = function (context, editor) {
|
||||
module.exports.AutocompleteComponent.prototype.getTerms = function () {
|
||||
return [];
|
||||
};
|
||||
|
||||
|
@ -21,7 +21,7 @@ module.exports.AutocompleteComponent.prototype.getTerms = function (context, edi
|
|||
priority: optional priority to solve collisions between multiple paths. Min value is used across entire chain
|
||||
}
|
||||
*/
|
||||
module.exports.AutocompleteComponent.prototype.match = function (token, context, editor) {
|
||||
module.exports.AutocompleteComponent.prototype.match = function () {
|
||||
return {
|
||||
next: this.next
|
||||
};
|
||||
|
@ -97,7 +97,7 @@ module.exports.ListComponent = ListComponent;
|
|||
return ret;
|
||||
};
|
||||
|
||||
cls.validateTokens = function (tokens, context, editor) {
|
||||
cls.validateTokens = function (tokens) {
|
||||
if (!this.multi_valued && tokens.length > 1) {
|
||||
return false;
|
||||
}
|
||||
|
@ -114,11 +114,11 @@ module.exports.ListComponent = ListComponent;
|
|||
return true;
|
||||
};
|
||||
|
||||
cls.getContextKey = function (context, editor) {
|
||||
cls.getContextKey = function () {
|
||||
return this.name;
|
||||
};
|
||||
|
||||
cls.getDefaultTermMeta = function (context, editor) {
|
||||
cls.getDefaultTermMeta = function () {
|
||||
return this.name;
|
||||
};
|
||||
|
||||
|
|
|
@ -37,13 +37,12 @@ function UrlParams(description, defaults) {
|
|||
description = _.clone(description || {});
|
||||
_.defaults(description, defaults);
|
||||
_.each(description, function (p_description, param) {
|
||||
var values, component;
|
||||
component = new ParamComponent(param, this.rootComponent, p_description);
|
||||
var component = new ParamComponent(param, this.rootComponent, p_description);
|
||||
if (_.isArray(p_description)) {
|
||||
values = new engine.ListComponent(param, p_description, component);
|
||||
new engine.ListComponent(param, p_description, component);
|
||||
}
|
||||
else if (p_description === "__flag__") {
|
||||
values = new engine.ListComponent(param, ["true", "false"], component);
|
||||
new engine.ListComponent(param, ["true", "false"], component);
|
||||
}
|
||||
}, this);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var { assign, memoize } = require('lodash');
|
||||
var { memoize } = require('lodash');
|
||||
let moment = require('moment');
|
||||
|
||||
var history = require('../history');
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
const history = require('../history');
|
||||
let SenseEditor = require('../sense_editor/editor');
|
||||
import { useResizeCheckerProvider } from '../sense_editor_resize';
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
let _ = require('lodash');
|
||||
let $ = require('jquery');
|
||||
|
||||
let esVersion = [];
|
||||
|
@ -7,7 +6,7 @@ module.exports.getVersion = function () {
|
|||
return esVersion;
|
||||
};
|
||||
|
||||
module.exports.send = function (method, path, data, server, disable_auth_alert) {
|
||||
module.exports.send = function (method, path, data) {
|
||||
var wrappedDfd = $.Deferred();
|
||||
|
||||
console.log("Calling " + path);
|
||||
|
@ -15,9 +14,6 @@ module.exports.send = function (method, path, data, server, disable_auth_alert)
|
|||
method = "POST";
|
||||
}
|
||||
|
||||
// delayed loading for circular references
|
||||
var settings = require("./settings");
|
||||
|
||||
let contentType;
|
||||
if (data) {
|
||||
try {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const $ = require('jquery');
|
||||
const { uniq } = require('lodash');
|
||||
const storage = require('./storage');
|
||||
|
||||
const history = module.exports = {
|
||||
|
@ -55,7 +54,7 @@ const history = module.exports = {
|
|||
return { time, content };
|
||||
},
|
||||
|
||||
clearHistory($el) {
|
||||
clearHistory() {
|
||||
history
|
||||
.getHistoryKeys()
|
||||
.forEach(key => storage.delete(key));
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
let ace = require('ace');
|
||||
let $ = require('jquery');
|
||||
let ZeroClipboard = require('zeroclip');
|
||||
let ext_searchbox = require('ace/ext-searchbox');
|
||||
require('ace');
|
||||
require('ace/ext-searchbox');
|
||||
let Autocomplete = require('./autocomplete');
|
||||
let mappings = require('./mappings');
|
||||
let SenseEditor = require('./sense_editor/editor');
|
||||
let settings = require('./settings');
|
||||
let storage = require('./storage');
|
||||
|
@ -56,7 +55,7 @@ export function initializeInput($el, $actionsEl, $copyAsCurlEl, output) {
|
|||
* The original shortcut will now just open the menu and highlight the
|
||||
*
|
||||
*/
|
||||
var zc = (function setupZeroClipboard() {
|
||||
(function setupZeroClipboard() {
|
||||
var zc = new ZeroClipboard($copyAsCurlEl); // the ZeroClipboard instance
|
||||
|
||||
zc.on('wrongflash noflash', function () {
|
||||
|
@ -89,8 +88,6 @@ export function initializeInput($el, $actionsEl, $copyAsCurlEl, output) {
|
|||
$copyAsCurlEl.click();
|
||||
input.focus();
|
||||
});
|
||||
|
||||
return zc;
|
||||
}());
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
let $ = require('jquery');
|
||||
let _ = require('lodash');
|
||||
let mappings = require('./mappings');
|
||||
let es = require('./es');
|
||||
let Api = require('./kb/api');
|
||||
let autocomplete_engine = require('./autocomplete/engine');
|
||||
|
||||
|
@ -134,47 +133,39 @@ IdAutocompleteComponent.prototype = _.create(
|
|||
|
||||
var parametrizedComponentFactories = {
|
||||
|
||||
'index': function (name, parent, endpoint) {
|
||||
'index': function (name, parent) {
|
||||
return new IndexAutocompleteComponent(name, parent, false);
|
||||
},
|
||||
'indices': function (name, parent, endpoint) {
|
||||
'indices': function (name, parent) {
|
||||
return new IndexAutocompleteComponent(name, parent, true);
|
||||
},
|
||||
'type': function (name, parent, endpoint) {
|
||||
'type': function (name, parent) {
|
||||
return new TypeAutocompleteComponent(name, parent, false);
|
||||
},
|
||||
'types': function (name, parent, endpoint) {
|
||||
'types': function (name, parent) {
|
||||
return new TypeAutocompleteComponent(name, parent, true);
|
||||
},
|
||||
'id': function (name, parent, endpoint) {
|
||||
'id': function (name, parent) {
|
||||
return new IdAutocompleteComponent(name, parent);
|
||||
},
|
||||
'ids': function (name, parent, endpoint) {
|
||||
'ids': function (name, parent) {
|
||||
return new IdAutocompleteComponent(name, parent, true);
|
||||
},
|
||||
'fields': function (name, parent, endpoint) {
|
||||
'fields': function (name, parent) {
|
||||
return new FieldAutocompleteComponent(name, parent, true);
|
||||
},
|
||||
'field': function (name, parent, endpoint) {
|
||||
'field': function (name, parent) {
|
||||
return new FieldAutocompleteComponent(name, parent, false);
|
||||
},
|
||||
'nodes': function (name, parent, endpoint) {
|
||||
'nodes': function (name, parent) {
|
||||
return new autocomplete_engine.ListComponent(name, ["_local", "_master", "data:true", "data:false",
|
||||
"master:true", "master:false"], parent)
|
||||
},
|
||||
'node': function (name, parent, endpoint) {
|
||||
'node': function (name, parent) {
|
||||
return new autocomplete_engine.ListComponent(name, [], parent, false)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function expandAliases(indices) {
|
||||
if (indices && indices.length > 0) {
|
||||
indices = mappings.expandAliases(indices);
|
||||
}
|
||||
return indices;
|
||||
}
|
||||
|
||||
function getUnmatchedEndpointComponents() {
|
||||
return ACTIVE_API.getUnmatchedEndpointComponents();
|
||||
}
|
||||
|
@ -224,7 +215,7 @@ function setActiveApi(api) {
|
|||
dataType: "json", // disable automatic guessing
|
||||
}
|
||||
).then(
|
||||
function (data, textStatus, jqXHR) {
|
||||
function (data) {
|
||||
setActiveApi(loadApisFromJson(data));
|
||||
},
|
||||
function (jqXHR) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
let $ = require('jquery');
|
||||
let _ = require('lodash');
|
||||
let utils = require('./utils');
|
||||
let es = require('./es');
|
||||
let settings = require('./settings');
|
||||
|
||||
|
@ -89,7 +88,7 @@ function getTypes(indices) {
|
|||
}
|
||||
|
||||
// filter what we need
|
||||
$.each(type_dict, function (type, fields) {
|
||||
$.each(type_dict, function (type) {
|
||||
ret.push(type);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
let ace = require('ace');
|
||||
let $ = require('jquery');
|
||||
let settings = require('./settings');
|
||||
let OutputMode = require('./sense_editor/mode/output');
|
||||
const smartResize = require('./smart_resize');
|
||||
|
|
|
@ -10,10 +10,6 @@ import chrome from 'ui/chrome';
|
|||
|
||||
const smartResize = require('../smart_resize');
|
||||
|
||||
function isInt(x) {
|
||||
return !isNaN(parseInt(x, 10));
|
||||
}
|
||||
|
||||
function createInstance($el) {
|
||||
var aceEditor = ace.edit($el[0]);
|
||||
|
||||
|
@ -562,11 +558,11 @@ function SenseEditor($el) {
|
|||
});
|
||||
};
|
||||
|
||||
editor.getSession().on('tokenizerUpdate', function (e) {
|
||||
editor.getSession().on('tokenizerUpdate', function () {
|
||||
editor.highlightCurrentRequestsAndUpdateActionBar();
|
||||
});
|
||||
|
||||
editor.getSession().selection.on('changeCursor', function (e) {
|
||||
editor.getSession().selection.on('changeCursor', function () {
|
||||
editor.highlightCurrentRequestsAndUpdateActionBar();
|
||||
});
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let ace = require('ace');
|
||||
let acequire = require('acequire');
|
||||
let mode_json = require('ace/mode-json');
|
||||
require('ace');
|
||||
require('ace/mode-json');
|
||||
|
||||
var oop = acequire("ace/lib/oop");
|
||||
var TextMode = acequire("ace/mode/text").Mode;
|
||||
|
@ -28,7 +28,7 @@ var Mode = function () {
|
|||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function () {
|
||||
this.getCompletions = function (editor, session, pos, prefix) {
|
||||
this.getCompletions = function () {
|
||||
// autocomplete is done by the autocomplete module.
|
||||
return [];
|
||||
};
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
let ace = require('ace');
|
||||
let x_json = require('./x_json_highlight_rules');
|
||||
let _ = require('lodash');
|
||||
|
||||
var oop = ace.require("ace/lib/oop");
|
||||
var TextHighlightRules = ace.require("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
let ace = require('ace');
|
||||
let acequire = require('acequire');
|
||||
let mode_json = require('ace/mode-json');
|
||||
let output_highlighting_rules = require('./output_highlight_rules');
|
||||
require('ace/mode-json');
|
||||
require('./output_highlight_rules');
|
||||
|
||||
|
||||
var oop = ace.require("ace/lib/oop");
|
||||
|
@ -10,7 +9,7 @@ var HighlightRules = require("./output_highlight_rules").OutputJsonHighlightRule
|
|||
var MatchingBraceOutdent = ace.require("ace/mode/matching_brace_outdent").MatchingBraceOutdent;
|
||||
var CstyleBehaviour = ace.require("ace/mode/behaviour/cstyle").CstyleBehaviour;
|
||||
var CStyleFoldMode = ace.require("ace/mode/folding/cstyle").FoldMode;
|
||||
var WorkerClient = ace.require("ace/worker/worker_client").WorkerClient;
|
||||
ace.require("ace/worker/worker_client");
|
||||
var AceTokenizer = ace.require("ace/tokenizer").Tokenizer;
|
||||
|
||||
var Mode = function () {
|
||||
|
@ -22,7 +21,7 @@ var Mode = function () {
|
|||
oop.inherits(Mode, JSONMode);
|
||||
|
||||
(function () {
|
||||
this.createWorker = function (session) {
|
||||
this.createWorker = function () {
|
||||
return null;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
let ace = require('ace');
|
||||
let ace_mode_json = require('ace/mode-json');
|
||||
require('ace/mode-json');
|
||||
let x_json = require('./x_json_highlight_rules');
|
||||
|
||||
var oop = ace.require("ace/lib/oop");
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
let ace = require('ace');
|
||||
let acequire = require('acequire');
|
||||
let mode_json = require('ace/mode-json');
|
||||
require('ace');
|
||||
require('ace/mode-json');
|
||||
|
||||
var oop = acequire("ace/lib/oop");
|
||||
var TextMode = acequire("ace/mode/text").Mode;
|
||||
var MatchingBraceOutdent = acequire("ace/mode/matching_brace_outdent").MatchingBraceOutdent;
|
||||
var CstyleBehaviour = acequire("ace/mode/behaviour/cstyle").CstyleBehaviour;
|
||||
var CStyleFoldMode = acequire("ace/mode/folding/cstyle").FoldMode;
|
||||
var AceTokenizer = acequire("ace/tokenizer").Tokenizer;
|
||||
acequire("ace/tokenizer")
|
||||
|
||||
var ScriptHighlightRules = require("./script_highlight_rules").ScriptHighlightRules;
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
};
|
||||
})(this);// https://github.com/kriskowal/es5-shim
|
||||
|
||||
define('ace/lib/oop', ['require', 'exports', 'module' ], function (require, exports, module) {
|
||||
define('ace/lib/oop', ['require', 'exports', 'module' ], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
exports.inherits = function (ctor, superCtor) {
|
||||
|
@ -208,7 +208,7 @@ define('ace/lib/oop', ['require', 'exports', 'module' ], function (require, expo
|
|||
};
|
||||
|
||||
});
|
||||
define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function (require, exports, module) {
|
||||
define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
var Document = require("../document").Document;
|
||||
|
@ -258,7 +258,7 @@ define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'a
|
|||
});
|
||||
|
||||
define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter',
|
||||
'ace/range', 'ace/anchor'], function (require, exports, module) {
|
||||
'ace/range', 'ace/anchor'], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("./lib/oop");
|
||||
|
@ -616,7 +616,7 @@ define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib
|
|||
exports.Document = Document;
|
||||
});
|
||||
|
||||
define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function (require, exports, module) {
|
||||
define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
var EventEmitter = {};
|
||||
|
@ -701,7 +701,6 @@ define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function (req
|
|||
var disabled = handlers._disabled_[eventName];
|
||||
|
||||
if (handlers[eventName] == callback) {
|
||||
var old = handlers[eventName];
|
||||
if (disabled)
|
||||
this.setDefaultHandler(eventName, disabled.pop());
|
||||
} else if (disabled) {
|
||||
|
@ -746,7 +745,7 @@ define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function (req
|
|||
|
||||
});
|
||||
|
||||
define('ace/range', ['require', 'exports', 'module' ], function (require, exports, module) {
|
||||
define('ace/range', ['require', 'exports', 'module' ], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
var comparePoints = function (p1, p2) {
|
||||
|
@ -987,7 +986,7 @@ define('ace/range', ['require', 'exports', 'module' ], function (require, export
|
|||
exports.Range = Range;
|
||||
});
|
||||
|
||||
define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function (require, exports, module) {
|
||||
define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("./lib/oop");
|
||||
|
@ -1134,7 +1133,7 @@ define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/e
|
|||
|
||||
});
|
||||
|
||||
define('ace/lib/lang', ['require', 'exports', 'module' ], function (require, exports, module) {
|
||||
define('ace/lib/lang', ['require', 'exports', 'module' ], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
exports.stringReverse = function (string) {
|
||||
|
@ -1318,7 +1317,7 @@ define('ace/lib/lang', ['require', 'exports', 'module' ], function (require, exp
|
|||
});
|
||||
|
||||
|
||||
define("sense_editor/mode/worker_parser", ['require', 'exports', 'module' ], function (require, exports, module) {
|
||||
define("sense_editor/mode/worker_parser", ['require', 'exports', 'module' ], function () {
|
||||
"use strict";
|
||||
|
||||
var at, // The index of the current character
|
||||
|
@ -1642,7 +1641,7 @@ define("sense_editor/mode/worker_parser", ['require', 'exports', 'module' ], fun
|
|||
|
||||
request = function () {
|
||||
white();
|
||||
var meth = method();
|
||||
method();
|
||||
strictWhite();
|
||||
url();
|
||||
strictWhite(); // advance to one new line
|
||||
|
@ -1738,7 +1737,7 @@ define("sense_editor/mode/worker_parser", ['require', 'exports', 'module' ], fun
|
|||
|
||||
|
||||
define("sense_editor/mode/worker", ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror',
|
||||
'sense_editor/mode/worker_parser'], function (require, exports, module) {
|
||||
'sense_editor/mode/worker_parser'], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
|
||||
|
@ -1811,4 +1810,3 @@ define("sense_editor/mode/worker", ['require', 'exports', 'module' , 'ace/lib/oo
|
|||
}).call(SenseWorker.prototype);
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
let ace = require('ace');
|
||||
|
||||
ace.define("ace/theme/sense-dark", ['require', 'exports', 'module'],
|
||||
function (require, exports, module) {
|
||||
function (require, exports) {
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-sense-dark";
|
||||
exports.cssText = ".ace-sense-dark .ace_gutter {\
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
let $ = require('jquery');
|
||||
let es = require('./es');
|
||||
const storage = require('./storage');
|
||||
|
||||
import getInput from './input'
|
||||
|
@ -25,12 +23,6 @@ function setWrapMode(mode) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function setBasicAuth(mode) {
|
||||
storage.set('basic_auth', mode);
|
||||
applyCurrentSettings();
|
||||
return true;
|
||||
}
|
||||
|
||||
export function getAutocomplete() {
|
||||
return storage.get('autocomplete_settings', { fields: true, indices: true });
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ let _ = require('lodash');
|
|||
let curl = require('../../src/curl');
|
||||
let curlTests = require('raw!./curl_parsing_tests.txt');
|
||||
|
||||
var { test, module, ok, fail, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
var { test, module, ok, equal } = QUnit;
|
||||
|
||||
module("CURL");
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
let ace = require('ace');
|
||||
let es = require('../../src/es');
|
||||
import { initializeInput } from '../../src/input';
|
||||
let editor_input1 = require('raw!./editor_input1.txt');
|
||||
let utils = require('../../src/utils');
|
||||
|
||||
var aceRange = ace.require("ace/range");
|
||||
var { test, module, ok, fail, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
var { module, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
|
||||
let input;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { initializeInput } from '../../src/input';
|
|||
let input;
|
||||
|
||||
var token_iterator = ace.require("ace/token_iterator");
|
||||
var { test, module, ok, fail, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
var { module, asyncTest, deepEqual, start } = QUnit;
|
||||
|
||||
|
||||
module("Input Tokenization", {
|
||||
|
@ -374,4 +374,3 @@ states_test(
|
|||
' "something": """test script""",\n' +
|
||||
'}'
|
||||
);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ let kb = require('../../src/kb');
|
|||
let mappings = require('../../src/mappings');
|
||||
let $ = require('jquery');
|
||||
|
||||
var { test, module, ok, fail, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
var { module, ok, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
|
||||
module("Integration", {
|
||||
setup: function () {
|
||||
|
|
|
@ -2,7 +2,7 @@ let kb = require('../../src/kb');
|
|||
let mappings = require('../../src/mappings');
|
||||
let autocomplete_engine = require('../../src/autocomplete/engine');
|
||||
|
||||
var { test, module, ok, fail, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
var { test, module, deepEqual } = QUnit;
|
||||
|
||||
module("Knowledge base", {
|
||||
setup: function () {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let mappings = require('../../src/mappings');
|
||||
|
||||
var { test, module, ok, fail, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
var { test, module, deepEqual } = QUnit;
|
||||
|
||||
module("Mappings", {
|
||||
setup: function () {
|
||||
|
|
|
@ -5,7 +5,7 @@ import { initializeOutput } from '../../src/output';
|
|||
let output;
|
||||
|
||||
var token_iterator = ace.require("ace/token_iterator");
|
||||
var { test, module, ok, fail, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
var { module, asyncTest, deepEqual, start } = QUnit;
|
||||
|
||||
|
||||
module("Output Tokenization", {
|
||||
|
@ -76,5 +76,3 @@ token_test(
|
|||
'# GET url\n' +
|
||||
'{ "f": """raw""" }'
|
||||
);
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ let _ = require('lodash');
|
|||
let url_pattern_matcher = require('../../src/autocomplete/url_pattern_matcher');
|
||||
let autocomplete_engine = require('../../src/autocomplete/engine');
|
||||
|
||||
var { test, module, ok, fail, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
var { test, module, deepEqual } = QUnit;
|
||||
|
||||
module("Url autocomplete");
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ let _ = require('lodash');
|
|||
let url_params = require('../../src/autocomplete/url_params');
|
||||
let autocomplete_engine = require('../../src/autocomplete/engine');
|
||||
|
||||
var { test, module, ok, fail, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
var { test, module, deepEqual } = QUnit;
|
||||
|
||||
module("Url params");
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ let utils = require('../../src/utils');
|
|||
let collapsingTests = require('raw!./utils_string_collapsing.txt');
|
||||
let expandingTests = require('raw!./utils_string_expanding.txt');
|
||||
|
||||
var { test, module, ok, fail, asyncTest, deepEqual, equal, start } = QUnit;
|
||||
var { test, module, deepEqual } = QUnit;
|
||||
|
||||
module("Utils class");
|
||||
|
||||
|
|
|
@ -2,13 +2,11 @@ require('ace');
|
|||
|
||||
const module = require('ui/modules').get('app/sense');
|
||||
|
||||
module.run(function (Private, $rootScope) {
|
||||
module.setupResizeCheckerForRootEditors = ($el, ...editors) => {
|
||||
// mock the resize checker
|
||||
};
|
||||
// mock the resize checker
|
||||
module.run(function () {
|
||||
module.setupResizeCheckerForRootEditors = () => {};
|
||||
});
|
||||
|
||||
|
||||
require('ui/chrome')
|
||||
.setRootTemplate(require('./index.html'))
|
||||
.setRootController(function () {
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/* eslint-env mocha */
|
||||
import expect from 'expect.js';
|
||||
|
||||
import { WildcardMatcher } from '../wildcard_matcher';
|
||||
|
||||
function should(candidate, ...constructorArgs) {
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
import { memoize, values } from 'lodash';
|
||||
import { values } from 'lodash';
|
||||
import { format as formatUrl } from 'url';
|
||||
import { Agent as HttpsAgent } from 'https';
|
||||
import { readFileSync } from 'fs';
|
||||
|
||||
import { WildcardMatcher } from './wildcard_matcher';
|
||||
|
||||
const makeHttpsAgent = memoize(
|
||||
opts => new HttpsAgent(opts),
|
||||
opts => JSON.stringify(opts)
|
||||
);
|
||||
|
||||
export class ProxyConfig {
|
||||
constructor(config) {
|
||||
config = Object.assign({}, config);
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import visDebugSpyPanelTemplate from 'plugins/dev_mode/vis_debug_spy_panel.html';
|
||||
import spyModesRegistry from 'ui/registry/spy_modes';
|
||||
|
||||
function VisDetailsSpyProvider(Notifier, $filter, $rootScope, config) {
|
||||
function VisDetailsSpyProvider() {
|
||||
return {
|
||||
name: 'debug',
|
||||
display: 'Debug',
|
||||
template: visDebugSpyPanelTemplate,
|
||||
order: 5,
|
||||
link: function ($scope, $el) {
|
||||
link: function ($scope) {
|
||||
$scope.$watch('vis.getEnabledState() | json', function (json) {
|
||||
$scope.visStateJson = json;
|
||||
});
|
||||
|
|
|
@ -106,7 +106,7 @@ module.exports = function ({ Plugin }) {
|
|||
}
|
||||
},
|
||||
|
||||
init(server, options) {
|
||||
init(server) {
|
||||
const kibanaIndex = server.config().get('kibana.index');
|
||||
const clusters = createClusters(server);
|
||||
|
||||
|
|
|
@ -2,8 +2,7 @@ import expect from 'expect.js';
|
|||
import { Cluster } from '../cluster';
|
||||
import sinon from 'sinon';
|
||||
import { errors as esErrors } from 'elasticsearch';
|
||||
import { set, partial, cloneDeep } from 'lodash';
|
||||
import Boom from 'boom';
|
||||
import { set, partial } from 'lodash';
|
||||
|
||||
describe('plugins/elasticsearch', function () {
|
||||
describe('cluster', function () {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import expect from 'expect.js';
|
||||
import sinon from 'sinon';
|
||||
import { bindKey, set, get, partial } from 'lodash';
|
||||
import { set, get, partial } from 'lodash';
|
||||
import { createAdminCluster } from '../create_admin_cluster';
|
||||
|
||||
describe('plugins/elasticsearch', function () {
|
||||
|
|
|
@ -2,7 +2,6 @@ import expect from 'expect.js';
|
|||
import createAgent from '../create_agent';
|
||||
import https from 'https';
|
||||
import http from 'http';
|
||||
import { set } from 'lodash';
|
||||
|
||||
describe('plugins/elasticsearch', function () {
|
||||
describe('lib/create_agent', function () {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import expect from 'expect.js';
|
||||
import sinon from 'sinon';
|
||||
import { bindKey, set, get, partial } from 'lodash';
|
||||
import { set, get, partial } from 'lodash';
|
||||
import { createDataCluster } from '../create_data_cluster';
|
||||
|
||||
describe('plugins/elasticsearch', function () {
|
||||
|
|
|
@ -12,8 +12,6 @@ describe('plugins/elasticsearch', () => {
|
|||
const KIBANA_VERSION = '5.1.0';
|
||||
|
||||
let server;
|
||||
let plugin;
|
||||
let callWithInternalUser;
|
||||
|
||||
beforeEach(function () {
|
||||
server = {
|
||||
|
@ -53,14 +51,12 @@ describe('plugins/elasticsearch', () => {
|
|||
|
||||
const cluster = server.plugins.elasticsearch.getCluster('admin');
|
||||
cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any).returns(Promise.resolve({ nodes: nodes }));
|
||||
callWithInternalUser = cluster.callWithInternalUser;
|
||||
}
|
||||
|
||||
function setNodeWithoutHTTP(version) {
|
||||
const nodes = { 'node-without-http': { version, ip: 'ip' } };
|
||||
const cluster = server.plugins.elasticsearch.getCluster('admin');
|
||||
cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any).returns(Promise.resolve({ nodes: nodes }));
|
||||
callWithInternalUser = cluster.callWithInternalUser;
|
||||
}
|
||||
|
||||
it('returns true with single a node that matches', async () => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import expect from 'expect.js';
|
||||
import { noop } from 'lodash';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import { ensureNotTribe } from '../ensure_not_tribe';
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import expect from 'expect.js';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import isEsCompatibleWithKibana from '../is_es_compatible_with_kibana';
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
import expect from 'expect.js';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import isUpgradeable from '../is_upgradeable';
|
||||
import pkg from '../../../../utils/package_json';
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import expect from 'expect.js';
|
||||
import mapUri from '../map_uri';
|
||||
import { get, defaults } from 'lodash';
|
||||
import sinon from 'sinon';
|
||||
import url from 'url';
|
||||
import { defaults } from 'lodash';
|
||||
|
||||
describe('plugins/elasticsearch', function () {
|
||||
describe('lib/map_uri', function () {
|
||||
|
@ -101,7 +99,7 @@ describe('plugins/elasticsearch', function () {
|
|||
it('strips the /elasticsearch prefix from the path', () => {
|
||||
request.path = '/elasticsearch/es/path';
|
||||
|
||||
mapUri(stubCluster(), '/elasticsearch')(request, function (err, upstreamUri, upstreamHeaders) {
|
||||
mapUri(stubCluster(), '/elasticsearch')(request, function (err, upstreamUri) {
|
||||
expect(err).to.be(null);
|
||||
expect(upstreamUri).to.be('http://localhost:9200/es/path');
|
||||
});
|
||||
|
@ -111,7 +109,7 @@ describe('plugins/elasticsearch', function () {
|
|||
request.path = '/elasticsearch/index/type';
|
||||
const settings = { url: 'https://localhost:9200/base-path' };
|
||||
|
||||
mapUri(stubCluster(settings), '/elasticsearch')(request, function (err, upstreamUri, upstreamHeaders) {
|
||||
mapUri(stubCluster(settings), '/elasticsearch')(request, function (err, upstreamUri) {
|
||||
expect(err).to.be(null);
|
||||
expect(upstreamUri).to.be('https://localhost:9200/base-path/index/type');
|
||||
});
|
||||
|
@ -122,7 +120,7 @@ describe('plugins/elasticsearch', function () {
|
|||
request.query = { foo: 'bar' };
|
||||
const settings = { url: 'https://localhost:9200/?base=query' };
|
||||
|
||||
mapUri(stubCluster(settings), '/elasticsearch')(request, function (err, upstreamUri, upstreamHeaders) {
|
||||
mapUri(stubCluster(settings), '/elasticsearch')(request, function (err, upstreamUri) {
|
||||
expect(err).to.be(null);
|
||||
expect(upstreamUri).to.be('https://localhost:9200/*?foo=bar&base=query');
|
||||
});
|
||||
|
@ -132,7 +130,7 @@ describe('plugins/elasticsearch', function () {
|
|||
request.path = '/elasticsearch/*';
|
||||
request.query = { _: Date.now() };
|
||||
|
||||
mapUri(stubCluster(), '/elasticsearch')(request, function (err, upstreamUri, upstreamHeaders) {
|
||||
mapUri(stubCluster(), '/elasticsearch')(request, function (err, upstreamUri) {
|
||||
expect(err).to.be(null);
|
||||
expect(upstreamUri).to.be('http://localhost:9200/*');
|
||||
});
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import expect from 'expect.js';
|
||||
import { format } from 'util';
|
||||
|
||||
import * as kbnTestServer from '../../../../../test/utils/kbn_server';
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import expect from 'expect.js';
|
||||
import sinon from 'sinon';
|
||||
import setHeaders from '../set_headers';
|
||||
|
||||
describe('plugins/elasticsearch', function () {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import _ from 'lodash';
|
||||
import Promise from 'bluebird';
|
||||
import sinon from 'sinon';
|
||||
import expect from 'expect.js';
|
||||
|
@ -10,7 +9,6 @@ describe('plugins/elasticsearch', function () {
|
|||
let get;
|
||||
let server;
|
||||
let callWithInternalUser;
|
||||
let config;
|
||||
let upgrade;
|
||||
|
||||
beforeEach(function () {
|
||||
|
@ -54,7 +52,7 @@ describe('plugins/elasticsearch', function () {
|
|||
});
|
||||
|
||||
it('should resolve buildNum to pkg.buildNum config', function () {
|
||||
return upgrade(response).then(function (resp) {
|
||||
return upgrade(response).then(function () {
|
||||
sinon.assert.calledOnce(callWithInternalUser);
|
||||
const params = callWithInternalUser.args[0][1];
|
||||
expect(params.body).to.have.property('buildNum', get('pkg.buildNum'));
|
||||
|
@ -62,7 +60,7 @@ describe('plugins/elasticsearch', function () {
|
|||
});
|
||||
|
||||
it('should resolve version to pkg.version config', function () {
|
||||
return upgrade(response).then(function (resp) {
|
||||
return upgrade(response).then(function () {
|
||||
const params = callWithInternalUser.args[0][1];
|
||||
expect(params).to.have.property('id', get('pkg.version'));
|
||||
});
|
||||
|
@ -77,14 +75,14 @@ describe('plugins/elasticsearch', function () {
|
|||
});
|
||||
|
||||
it('should resolve buildNum to pkg.buildNum config', function () {
|
||||
return upgrade(response).then(function (resp) {
|
||||
return upgrade(response).then(function () {
|
||||
const params = callWithInternalUser.args[0][1];
|
||||
expect(params.body).to.have.property('buildNum', get('pkg.buildNum'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should resolve version to pkg.version config', function () {
|
||||
return upgrade(response).then(function (resp) {
|
||||
return upgrade(response).then(function () {
|
||||
const params = callWithInternalUser.args[0][1];
|
||||
expect(params).to.have.property('id', get('pkg.version'));
|
||||
});
|
||||
|
@ -104,7 +102,7 @@ describe('plugins/elasticsearch', function () {
|
|||
callWithInternalUser.withArgs('create', sinon.match.any).returns(Promise.resolve());
|
||||
|
||||
const response = { hits: { hits: [ { _id: '4.0.1-alpha3' }, { _id: '4.0.1-beta1' }, { _id: '4.0.0-SNAPSHOT1' } ] } };
|
||||
return upgrade(response).then(function (resp) {
|
||||
return upgrade(response).then(function () {
|
||||
sinon.assert.calledOnce(callWithInternalUser);
|
||||
const params = callWithInternalUser.args[0][1];
|
||||
expect(params).to.have.property('body');
|
||||
|
@ -121,7 +119,7 @@ describe('plugins/elasticsearch', function () {
|
|||
|
||||
const response = { hits: { hits: [ { _id: '4.0.0', _source: { buildNum: 1 } } ] } };
|
||||
|
||||
return upgrade(response).then(function (resp) {
|
||||
return upgrade(response).then(function () {
|
||||
sinon.assert.calledOnce(callWithInternalUser);
|
||||
const params = callWithInternalUser.args[0][1];
|
||||
expect(params).to.have.property('body');
|
||||
|
@ -138,7 +136,7 @@ describe('plugins/elasticsearch', function () {
|
|||
|
||||
const response = { hits: { hits: [ { _id: '4.0.0', _source: { buildNum: 1 } } ] } };
|
||||
|
||||
return upgrade(response).then(function (resp) {
|
||||
return upgrade(response).then(function () {
|
||||
sinon.assert.calledOnce(server.log);
|
||||
expect(server.log.args[0][0]).to.eql(['plugin', 'elasticsearch']);
|
||||
const msg = server.log.args[0][1];
|
||||
|
@ -154,13 +152,12 @@ describe('plugins/elasticsearch', function () {
|
|||
|
||||
const response = { hits: { hits: [ { _id: '4.0.0', _source: { buildNum: 1, defaultIndex: 'logstash-*' } } ] } };
|
||||
|
||||
return upgrade(response).then(function (resp) {
|
||||
return upgrade(response).then(function () {
|
||||
sinon.assert.calledOnce(callWithInternalUser);
|
||||
const params = callWithInternalUser.args[0][1];
|
||||
expect(params).to.have.property('body');
|
||||
expect(params.body).to.have.property('defaultIndex', 'logstash-*');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import url from 'url';
|
||||
import { get, size } from 'lodash';
|
||||
const readFile = (file) => require('fs').readFileSync(file, 'utf8');
|
||||
import { get } from 'lodash';
|
||||
import http from 'http';
|
||||
import https from 'https';
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { Cluster } from './cluster';
|
||||
import { get, set } from 'lodash';
|
||||
|
||||
export function createClusters(server) {
|
||||
const esPlugin = server.plugins.elasticsearch;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { format } from 'util';
|
||||
import { mappings } from './kibana_index_mappings';
|
||||
|
||||
module.exports = function (server) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import createAgent from './create_agent';
|
||||
import mapUri from './map_uri';
|
||||
import { resolve } from 'url';
|
||||
import { assign } from 'lodash';
|
||||
|
||||
function createProxy(server, method, path, config) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import _ from 'lodash';
|
||||
|
||||
export default function (originalHeaders, headersToKeep) {
|
||||
|
||||
const normalizeHeader = function (header) {
|
||||
if (!header) {
|
||||
return '';
|
||||
|
@ -13,10 +12,5 @@ export default function (originalHeaders, headersToKeep) {
|
|||
// Normalize list of headers we want to allow in upstream request
|
||||
const headersToKeepNormalized = headersToKeep.map(normalizeHeader);
|
||||
|
||||
// Normalize original headers in request
|
||||
const originalHeadersNormalized = _.mapKeys(originalHeaders, function (headerValue, headerName) {
|
||||
return normalizeHeader(headerName);
|
||||
});
|
||||
|
||||
return _.pick(originalHeaders, headersToKeepNormalized);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defaults, omit, trimLeft, trimRight } from 'lodash';
|
||||
import { parse as parseUrl, format as formatUrl, resolve } from 'url';
|
||||
import { parse as parseUrl, format as formatUrl } from 'url';
|
||||
import filterHeaders from './filter_headers';
|
||||
import setHeaders from './set_headers';
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import Promise from 'bluebird';
|
||||
import isUpgradeable from './is_upgradeable';
|
||||
import _ from 'lodash';
|
||||
import { format } from 'util';
|
||||
|
||||
module.exports = function (server) {
|
||||
const MAX_INTEGER = Math.pow(2, 53) - 1;
|
||||
|
||||
const { callWithInternalUser } = server.plugins.elasticsearch.getCluster('admin');
|
||||
const config = server.config();
|
||||
|
||||
|
@ -19,8 +16,6 @@ module.exports = function (server) {
|
|||
}
|
||||
|
||||
return function (response) {
|
||||
const newConfig = {};
|
||||
|
||||
// Check to see if there are any doc. If not then we set the build number and id
|
||||
if (response.hits.hits.length === 0) {
|
||||
return createNewConfig();
|
||||
|
|
|
@ -3,7 +3,6 @@ import _ from 'lodash';
|
|||
import sinon from 'auto-release-sinon';
|
||||
import expect from 'expect.js';
|
||||
import ngMock from 'ng_mock';
|
||||
import $ from 'jquery';
|
||||
import 'ui/render_directive';
|
||||
import 'plugins/kbn_doc_views/views/table';
|
||||
import docViewsRegistry from 'ui/registry/doc_views';
|
||||
|
@ -78,7 +77,6 @@ describe('docViews', function () {
|
|||
initView(docViews.byName.Table);
|
||||
});
|
||||
it('should have a row for each field', function () {
|
||||
const rows = $elem.find('tr');
|
||||
expect($elem.find('tr').length).to.be(_.keys(flattened).length);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import _ from 'lodash';
|
||||
import angular from 'angular';
|
||||
import 'ace';
|
||||
import docViewsRegistry from 'ui/registry/doc_views';
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import uiModules from 'ui/modules';
|
||||
import lineInterpolationOptionTemplate from 'plugins/kbn_vislib_vis_types/controls/line_interpolation_option.html';
|
||||
const module = uiModules.get('kibana');
|
||||
|
||||
module.directive('lineInterpolationOption', function ($parse, $compile) {
|
||||
module.directive('lineInterpolationOption', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: lineInterpolationOptionTemplate,
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import 'ui/directives/inequality';
|
||||
import uiModules from 'ui/modules';
|
||||
import pointSeriesOptionsTemplate from 'plugins/kbn_vislib_vis_types/controls/point_series_options.html';
|
||||
const module = uiModules.get('kibana');
|
||||
|
||||
module.directive('pointSeriesOptions', function ($parse, $compile) {
|
||||
module.directive('pointSeriesOptions', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: pointSeriesOptionsTemplate,
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import uiModules from 'ui/modules';
|
||||
import vislibBasicOptionsTemplate from 'plugins/kbn_vislib_vis_types/controls/vislib_basic_options.html';
|
||||
const module = uiModules.get('kibana');
|
||||
|
||||
module.directive('vislibBasicOptions', function ($parse, $compile) {
|
||||
module.directive('vislibBasicOptions', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: vislibBasicOptionsTemplate,
|
||||
|
|
|
@ -10,7 +10,6 @@ import AggConfigProvider from 'ui/vis/agg_config';
|
|||
|
||||
describe('point series editor', function () {
|
||||
let $parentScope;
|
||||
let $scope;
|
||||
let $container;
|
||||
let $elem;
|
||||
let lineVisType;
|
||||
|
@ -55,9 +54,6 @@ describe('point series editor', function () {
|
|||
|
||||
// Digest everything
|
||||
$elem.scope().$digest();
|
||||
|
||||
// give us a scope to work with
|
||||
$scope = $elem.isolateScope();
|
||||
}));
|
||||
|
||||
afterEach(function () {
|
||||
|
|
|
@ -131,7 +131,7 @@ module.exports = function (kibana) {
|
|||
}
|
||||
},
|
||||
|
||||
init: function (server, options) {
|
||||
init: function (server) {
|
||||
// uuid
|
||||
manageUuid(server);
|
||||
// routes
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import _ from 'lodash';
|
||||
|
||||
import { addComputedFields } from './utils/fields';
|
||||
import { getDocumentUid } from './utils/ids';
|
||||
import { createSuccessorsQueryBody } from './utils/queries.js';
|
||||
import { reverseQuerySort } from './utils/sorting';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ uiRoutes
|
|||
controller: ContextAppRouteController,
|
||||
controllerAs: 'contextAppRoute',
|
||||
resolve: {
|
||||
indexPattern: function ($route, courier, savedSearches) {
|
||||
indexPattern: function ($route, courier) {
|
||||
return courier.indexPatterns.get($route.current.params.indexPattern);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -5,14 +5,13 @@ import { DashboardState } from '../dashboard_state';
|
|||
|
||||
describe('DashboardState', function () {
|
||||
let AppState;
|
||||
let dashboardState;
|
||||
let savedDashboard;
|
||||
let SavedDashboard;
|
||||
let timefilter;
|
||||
let quickTimeRanges;
|
||||
|
||||
function initDashboardState() {
|
||||
dashboardState = new DashboardState(savedDashboard, timefilter, true, quickTimeRanges, AppState);
|
||||
new DashboardState(savedDashboard, timefilter, true, quickTimeRanges, AppState);
|
||||
}
|
||||
|
||||
beforeEach(ngMock.module('kibana'));
|
||||
|
|
|
@ -5,7 +5,6 @@ import chrome from 'ui/chrome';
|
|||
import 'gridster';
|
||||
import uiModules from 'ui/modules';
|
||||
import { PanelUtils } from 'plugins/kibana/dashboard/panel/panel_utils';
|
||||
import { getPersistedStateId } from 'plugins/kibana/dashboard/panel/panel_state';
|
||||
|
||||
const app = uiModules.get('app/dashboard');
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue