Reintroduce linting rule that requires single-quotes in x-pack. (#30893)

* Reintroduce linting rule that requires single-quotes in x-pack.
* Remove redundant quotes rule for ML.
* Convert ES-UI code to single quotes.
  - Dev tools
  - CCR
  - ILM
  - Index management
  - License management
  - Remote clusters
  - Rollup
  - Watcher
* Convert Graph code to single quotes.
* Convert Maps to single quotes.
* Convert Monitoring code to single quotes.
* Convert Reporting code to single quotes.
* Convert Security code to single quotes.
* Convert Telemetry code to single quotes.
* Convert Upgrade Assistant code to single quotes.
* Convert Grok Debugger to single quotes.
This commit is contained in:
CJ Cenizal 2019-02-14 12:08:37 -08:00 committed by GitHub
parent c7700ce378
commit e4ba818ff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
100 changed files with 1753 additions and 1764 deletions

View file

@ -284,16 +284,6 @@ module.exports = {
},
},
/**
* X-Pack global overrides
*/
{
files: ['x-pack/**/*'],
rules: {
quotes: 'off',
},
},
/**
* Files that require Elastic license headers instead of Apache 2.0 header
*/
@ -366,7 +356,6 @@ module.exports = {
{
files: ['x-pack/plugins/ml/**/*'],
rules: {
quotes: 'error',
'no-shadow': 'error',
},
},

View file

@ -11,21 +11,21 @@ export function createJestConfig({
return {
rootDir: xPackKibanaDirectory,
roots: [
"<rootDir>/plugins",
"<rootDir>/server",
'<rootDir>/plugins',
'<rootDir>/server',
],
moduleFileExtensions: [
"js",
"json",
"ts",
"tsx",
'js',
'json',
'ts',
'tsx',
],
moduleNameMapper: {
"^ui/(.*)": `${kibanaDirectory}/src/legacy/ui/public/$1`,
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
'^ui/(.*)': `${kibanaDirectory}/src/legacy/ui/public/$1`,
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
`${kibanaDirectory}/src/dev/jest/mocks/file_mock.js`,
"\\.(css|less|scss)$": `${kibanaDirectory}/src/dev/jest/mocks/style_mock.js`,
"^test_utils/enzyme_helpers": `${xPackKibanaDirectory}/test_utils/enzyme_helpers.tsx`
'\\.(css|less|scss)$': `${kibanaDirectory}/src/dev/jest/mocks/style_mock.js`,
'^test_utils/enzyme_helpers': `${xPackKibanaDirectory}/test_utils/enzyme_helpers.tsx`
},
setupFiles: [
`${kibanaDirectory}/src/dev/jest/setup/babel_polyfill.js`,
@ -33,20 +33,20 @@ export function createJestConfig({
`<rootDir>/dev-tools/jest/setup/enzyme.js`,
],
testMatch: [
"**/*.test.{js,ts,tsx}"
'**/*.test.{js,ts,tsx}'
],
transform: {
"^.+\\.js$": `${kibanaDirectory}/src/dev/jest/babel_transform.js`,
"^.+\\.tsx?$": `${kibanaDirectory}/src/dev/jest/ts_transform.js`,
'^.+\\.js$': `${kibanaDirectory}/src/dev/jest/babel_transform.js`,
'^.+\\.tsx?$': `${kibanaDirectory}/src/dev/jest/ts_transform.js`,
},
transformIgnorePatterns: [
"[/\\\\]node_modules[/\\\\].+\\.js$"
'[/\\\\]node_modules[/\\\\].+\\.js$'
],
snapshotSerializers: [
`${kibanaDirectory}/node_modules/enzyme-to-json/serializer`
],
"reporters": [
"default",
'reporters': [
'default',
[`${kibanaDirectory}/src/dev/jest/junit_reporter.js`, {
reportName: 'X-Pack Jest Tests',
rootDirectory: xPackKibanaDirectory,

View file

@ -38,14 +38,14 @@ export const validateName = (name = '') => {
if (name[0] === '_') {
errorMsg = i18n.translate(
'xpack.crossClusterReplication.autoFollowPattern.nameValidation.errorUnderscore',
{ defaultMessage: "Name can't begin with an underscore." }
{ defaultMessage: `Name can't begin with an underscore.` }
);
}
if (name.includes(',')) {
errorMsg = i18n.translate(
'xpack.crossClusterReplication.autoFollowPattern.nameValidation.errorComma',
{ defaultMessage: "Commas are not allowed in the name." }
{ defaultMessage: 'Commas are not allowed in the name.' }
);
}
}

View file

@ -44,7 +44,7 @@ class Routing {
*/
getRouterLinkProps(to, base = BASE_PATH, params = {}, encodeParams = false) {
const search = queryParamsFromObject(params, encodeParams) || '';
const location = typeof to === "string"
const location = typeof to === 'string'
? createLocation(base + to + search, null, null, this._reactRouter.history.location)
: to;
const href = this._reactRouter.history.createHref(location);

View file

@ -9,29 +9,29 @@ import { deserializeAutoFollowStats } from './ccr_stats_serialization';
describe('[CCR] auto-follow stats serialization', () => {
it('should deserialize auto-follow stats', () => {
const esObject = {
"number_of_failed_follow_indices": 0,
"number_of_failed_remote_cluster_state_requests": 0,
"number_of_successful_follow_indices": 0,
"recent_auto_follow_errors": [
'number_of_failed_follow_indices': 0,
'number_of_failed_remote_cluster_state_requests': 0,
'number_of_successful_follow_indices': 0,
'recent_auto_follow_errors': [
{
"leader_index": "pattern-1:kibana_sample_1",
"auto_follow_exception": {
"type": "exception",
"reason": "index to follow [kibana_sample_1] for pattern [pattern-1] matches with other patterns [pattern-2]"
'leader_index': 'pattern-1:kibana_sample_1',
'auto_follow_exception': {
'type': 'exception',
'reason': 'index to follow [kibana_sample_1] for pattern [pattern-1] matches with other patterns [pattern-2]'
}
},
{
"leader_index": "pattern-2:kibana_sample_1",
"auto_follow_exception": {
"type": "exception",
"reason": "index to follow [kibana_sample_1] for pattern [pattern-2] matches with other patterns [pattern-1]"
'leader_index': 'pattern-2:kibana_sample_1',
'auto_follow_exception': {
'type': 'exception',
'reason': 'index to follow [kibana_sample_1] for pattern [pattern-2] matches with other patterns [pattern-1]'
}
}
],
"auto_followed_clusters": [{
"cluster_name": "new-york",
"time_since_last_check_millis": 2426,
"last_seen_metadata_version": 15
'auto_followed_clusters': [{
'cluster_name': 'new-york',
'time_since_last_check_millis': 2426,
'last_seen_metadata_version': 15
}]
};

View file

@ -1236,19 +1236,19 @@ module.exports = (function () {
filterMap[nodeNum] = nodeQuery;
});
const searchReq = {
"size": 0,
"query": {
"bool": {
'size': 0,
'query': {
'bool': {
// Only match docs that share 2 nodes so can help describe their relationship
'minimum_should_match': 2,
'should': shoulds
}
},
"aggs": {
"matrix": {
"adjacency_matrix": {
"separator": "|",
"filters": filterMap
'aggs': {
'matrix': {
'adjacency_matrix': {
'separator': '|',
'filters': filterMap
}
}
}
@ -1261,10 +1261,10 @@ module.exports = (function () {
const buckets = data.aggregations.matrix.buckets;
const vertices = nodesForLinking.map(function (existingNode) {
return {
"field": existingNode.data.field,
"term": existingNode.data.term,
"weight": 1,
"depth": 0
'field': existingNode.data.field,
'term': existingNode.data.term,
'weight': 1,
'depth': 0
};
});
@ -1279,7 +1279,7 @@ module.exports = (function () {
buckets.forEach(function (bucket) {
// We calibrate line thickness based on % of max weight of
// all edges (including the edges we may already have in the workspace)
const ids = bucket.key.split("|");
const ids = bucket.key.split('|');
if(ids.length === 2) {
// bucket represents an edge
if (self.options.exploreControls.useSignificance) {
@ -1301,7 +1301,7 @@ module.exports = (function () {
if(bucket.doc_count < parseInt(self.options.exploreControls.minDocCount)) {
return;
}
const ids = bucket.key.split("|");
const ids = bucket.key.split('|');
if(ids.length == 2) {
// Bucket represents an edge
const srcNode = nodesForLinking[ids[0]];
@ -1314,11 +1314,11 @@ module.exports = (function () {
} else {
connections.push({
// source and target values are indexes into the vertices array
"source": parseInt(ids[0]),
"target": parseInt(ids[1]),
"weight": bucket.weight,
"width": Math.max(backFilledMinLineSize, ((bucket.weight / maxEdgeWeight) * backFilledMaxLineSize)),
"doc_count": bucket.doc_count
'source': parseInt(ids[0]),
'target': parseInt(ids[1]),
'weight': bucket.weight,
'width': Math.max(backFilledMinLineSize, ((bucket.weight / maxEdgeWeight) * backFilledMaxLineSize)),
'doc_count': bucket.doc_count
});
}
}

View file

@ -15,25 +15,25 @@ export class GrokHighlightRules extends TextHighlightRules {
start: [
{
token: [
"grokStart",
"grokPatternName",
"grokSeparator",
"grokFieldName",
"grokEnd"
'grokStart',
'grokPatternName',
'grokSeparator',
'grokFieldName',
'grokEnd'
],
regex: "(%{)([^:]+)(:)([^:]+)(})"
regex: '(%{)([^:]+)(:)([^:]+)(})'
},
{
token: [
"grokStart",
"grokPatternName",
"grokSeparator",
"grokFieldName",
"grokSeparator",
"grokFieldType",
"grokEnd"
'grokStart',
'grokPatternName',
'grokSeparator',
'grokFieldName',
'grokSeparator',
'grokFieldType',
'grokEnd'
],
regex: "(%{)([^:]+)(:)([^:]+)(:)([^:]+)(})"
regex: '(%{)([^:]+)(:)([^:]+)(:)([^:]+)(})'
},
{
token: (escapeToken, /* regexToken */) => {
@ -42,7 +42,7 @@ export class GrokHighlightRules extends TextHighlightRules {
}
return 'grokRegex';
},
regex: "(\\\\)?([\\[\\]\\(\\)\\?\\:\\|])"
regex: '(\\\\)?([\\[\\]\\(\\)\\?\\:\\|])'
},
]
};

View file

@ -7,7 +7,7 @@
import ace from 'ace';
import { GrokHighlightRules } from './grok_highlight_rules';
const TextMode = ace.acequire("ace/mode/text").Mode;
const TextMode = ace.acequire('ace/mode/text').Mode;
export class GrokMode extends TextMode {
constructor() {

View file

@ -47,21 +47,21 @@ describe('grokdebugger_request', () => {
description: 'this is a grokdebugger simulation',
processors: [
{
"grok": {
"field": "rawEvent",
"patterns": ["%{IP:client} %{WORD:method} %{URIPATHPARAM:request}"],
"pattern_definitions": {}
'grok': {
'field': 'rawEvent',
'patterns': ['%{IP:client} %{WORD:method} %{URIPATHPARAM:request}'],
'pattern_definitions': {}
}
}
]
},
docs: [
{
"_index": "grokdebugger",
"_type": "grokdebugger",
"_id": "grokdebugger",
"_source": {
"rawEvent": "55.3.244.1 GET /index.html"
'_index': 'grokdebugger',
'_type': 'grokdebugger',
'_id': 'grokdebugger',
'_source': {
'rawEvent': '55.3.244.1 GET /index.html'
}
}
]
@ -77,21 +77,21 @@ describe('grokdebugger_request', () => {
description: 'this is a grokdebugger simulation',
processors: [
{
"grok": {
"field": "rawEvent",
"patterns": ["%{IP:client} %{WORD:method} %{URIPATHPARAM:request}"],
"pattern_definitions": '%{FOO:bar}'
'grok': {
'field': 'rawEvent',
'patterns': ['%{IP:client} %{WORD:method} %{URIPATHPARAM:request}'],
'pattern_definitions': '%{FOO:bar}'
}
}
]
},
docs: [
{
"_index": "grokdebugger",
"_type": "grokdebugger",
"_id": "grokdebugger",
"_source": {
"rawEvent": "55.3.244.1 GET /index.html"
'_index': 'grokdebugger',
'_type': 'grokdebugger',
'_id': 'grokdebugger',
'_source': {
'rawEvent': '55.3.244.1 GET /index.html'
}
}
]

View file

@ -11,8 +11,8 @@ import { get } from 'lodash';
*/
export class GrokdebuggerRequest {
constructor(props) {
this.rawEvent = get(props, 'rawEvent', "");
this.pattern = get(props, 'pattern', "");
this.rawEvent = get(props, 'rawEvent', '');
this.pattern = get(props, 'pattern', '');
this.customPatterns = get(props, 'customPatterns', {});
}

View file

@ -22,13 +22,13 @@ describe('grokdebugger_response', () => {
_type: 'grokdebugger',
_id: 'grokdebugger',
_source: {
"request": "/index.html",
"rawEvent": "55.3.244.1 GET /index.html",
"method": "GET",
"client": "55.3.244.1"
'request': '/index.html',
'rawEvent': '55.3.244.1 GET /index.html',
'method': 'GET',
'client': '55.3.244.1'
},
_ingest: {
"timestamp": "2017-05-13T23:29:14.809Z"
'timestamp': '2017-05-13T23:29:14.809Z'
}
}
}
@ -52,10 +52,10 @@ describe('grokdebugger_response', () => {
error: {
root_cause: [
{
"type": "exception",
"reason": "java.lang.IllegalArgumentException",
"header": {
"processor_type": "grok"
'type': 'exception',
'reason': 'java.lang.IllegalArgumentException',
'header': {
'processor_type': 'grok'
}
}
],

View file

@ -142,7 +142,7 @@ export class IndexLifecycleSummary extends Component {
<EuiDescriptionListTitle key={fieldName}>
<strong>{headers[fieldName]}</strong>
</EuiDescriptionListTitle>,
<EuiDescriptionListDescription key={fieldName + "_desc"}>
<EuiDescriptionListDescription key={fieldName + '_desc'}>
{content}
</EuiDescriptionListDescription>
];

View file

@ -106,7 +106,7 @@ class EditPolicyUi extends Component {
const errorRowId = `${firstError.replace('.', '-')}-row`;
const element = document.getElementById(errorRowId);
if (element) {
element.scrollIntoView({ block: "center", inline: "nearest" });
element.scrollIntoView({ block: 'center', inline: 'nearest' });
}
} else {
const success = await saveLifecyclePolicy(lifecycle, saveAsNewPolicy);

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export const settingsDocumentationLink = "https://stuff.com/docs";
export const settingsDocumentationLink = 'https://stuff.com/docs';

View file

@ -11,7 +11,7 @@ import { registerSettingsRoutes } from './server/routes/api/settings';
import { registerStatsRoute } from './server/routes/api/stats';
import { registerLicenseChecker } from '../../server/lib/register_license_checker';
import { PLUGIN } from './common/constants';
import { addIndexManagementDataEnricher } from "./index_management_data";
import { addIndexManagementDataEnricher } from './index_management_data';
import { createRouter } from '../../server/lib/create_router';
export function indexManagement(kibana) {

View file

@ -4,8 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/
import ace from "ace";
import "brace/ext/language_tools";
import ace from 'ace';
import 'brace/ext/language_tools';
const splitTokens = (line) => {
return line.split(/\s+/);
@ -53,9 +53,9 @@ export const createAceEditor = (
editor.setValue(value, -1);
const session = editor.getSession();
session.setUseWrapMode(true);
session.setMode("ace/mode/json");
session.setMode('ace/mode/json');
if (autocompleteArray) {
const languageTools = ace.acequire("ace/ext/language_tools");
const languageTools = ace.acequire('ace/ext/language_tools');
const autocompleter = wordCompleter(autocompleteArray);
languageTools.setCompleters([autocompleter]);
}

View file

@ -4,9 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { connect } from "react-redux";
import { ShowJson as PresentationComponent } from "./show_json";
import { loadIndexData, closeDetailPanel } from "../../../../../store/actions";
import { connect } from 'react-redux';
import { ShowJson as PresentationComponent } from './show_json';
import { loadIndexData, closeDetailPanel } from '../../../../../store/actions';
import {
getDetailPanelData,
@ -14,7 +14,7 @@ import {
getDetailPanelIndexName,
getDetailPanelType,
getIndexStatusByIndexName
} from "../../../../../store/selectors";
} from '../../../../../store/selectors';
const mapStateToProps = state => {
const indexName = getDetailPanelIndexName(state);

View file

@ -4,8 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/
import React from "react";
import { EuiCodeEditor } from "@elastic/eui";
import React from 'react';
import { EuiCodeEditor } from '@elastic/eui';
import 'brace/theme/textmate';

View file

@ -86,7 +86,7 @@ export class Summary extends React.PureComponent {
<EuiDescriptionListTitle key={fieldName}>
<strong>{headers[fieldName]}</strong>
</EuiDescriptionListTitle>,
<EuiDescriptionListDescription key={fieldName + "_desc"}>
<EuiDescriptionListDescription key={fieldName + '_desc'}>
{content}
</EuiDescriptionListDescription>
];

View file

@ -4,12 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { createAction } from "redux-actions";
import { createAction } from 'redux-actions';
export const openDetailPanel = createAction(
"INDEX_MANAGEMENT_OPEN_DETAIL_PANEL"
'INDEX_MANAGEMENT_OPEN_DETAIL_PANEL'
);
export const closeDetailPanel = createAction(
"INDEX_MANAGEMENT_CLOSE_DETAIL_PANEL"
'INDEX_MANAGEMENT_CLOSE_DETAIL_PANEL'
);

View file

@ -12,7 +12,7 @@ import { clearRowStatus, reloadIndices } from '../actions';
import { toastNotifications } from 'ui/notify';
export const refreshIndicesStart = createAction(
"INDEX_MANAGEMENT_REFRESH_INDICES_START"
'INDEX_MANAGEMENT_REFRESH_INDICES_START'
);
export const refreshIndices = ({ indexNames }) => async (dispatch) => {
dispatch(refreshIndicesStart({ indexNames }));

View file

@ -11,10 +11,10 @@ import { reloadIndices } from './reload_indices';
import { toastNotifications } from 'ui/notify';
export const updateIndexSettingsSuccess = createAction(
"INDEX_MANAGEMENT_UPDATE_INDEX_SETTINGS_SUCCESS"
'INDEX_MANAGEMENT_UPDATE_INDEX_SETTINGS_SUCCESS'
);
export const updateIndexSettingsError = createAction(
"INDEX_MANAGEMENT_UPDATE_INDEX_SETTINGS_ERROR"
'INDEX_MANAGEMENT_UPDATE_INDEX_SETTINGS_ERROR'
);
export const updateIndexSettings = ({

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { handleActions } from "redux-actions";
import { handleActions } from 'redux-actions';
import { openDetailPanel, closeDetailPanel } from '../actions/detail_panel';
import { loadIndexDataSuccess } from '../actions/load_index_data';
import { updateIndexSettingsSuccess, updateIndexSettingsError } from '../actions/update_index_settings';

View file

@ -29,8 +29,8 @@ function formatHits(hits, aliases) {
uuid: hit.uuid,
primary: hit.pri,
replica: hit.rep,
documents: hit["docs.count"],
size: hit["store.size"],
documents: hit['docs.count'],
size: hit['store.size'],
isFrozen: hit.sth === 'true', // sth value coming back as a string from ES
aliases: aliases.hasOwnProperty(hit.index) ? aliases[hit.index] : 'none',
};

View file

@ -13,10 +13,10 @@ function formatHits(hits) {
uuid: hit.uuid,
primary: hit.pri,
replica: hit.rep,
documents: hit["docs.count"],
documents_deleted: hit["docs.deleted"],
size: hit["store.size"],
primary_size: hit["pri.store.size"],
documents: hit['docs.count'],
documents_deleted: hit['docs.deleted'],
size: hit['store.size'],
primary_size: hit['pri.store.size'],
};
});
}

View file

@ -6,7 +6,7 @@
import { resolve } from 'path';
import { PLUGIN } from './common/constants';
import { registerLicenseRoute, registerStartTrialRoutes, registerStartBasicRoute } from "./server/routes/api/license/";
import { registerLicenseRoute, registerStartTrialRoutes, registerStartBasicRoute } from './server/routes/api/license/';
import { createRouter } from '../../server/lib/create_router';
import { registerLicenseChecker } from '../../server/lib/register_license_checker';

View file

@ -13,7 +13,7 @@ import { I18nContext } from 'ui/i18n';
import chrome from 'ui/chrome';
import App from './app';
import { BASE_PATH } from "../common/constants/base_path";
import { BASE_PATH } from '../common/constants/base_path';
import routes from 'ui/routes';
import { XPackInfoProvider as xpackInfoProvider } from 'plugins/xpack_main/services/xpack_info';

View file

@ -5,8 +5,8 @@
*/
import { connect } from 'react-redux';
import { uploadLicense, uploadLicenseStatus } from "../../store/actions/upload_license";
import { addUploadErrorMessage } from "../../store/actions/add_error_message";
import { uploadLicense, uploadLicenseStatus } from '../../store/actions/upload_license';
import { addUploadErrorMessage } from '../../store/actions/add_error_message';
import {
getUploadErrorMessage,
@ -15,7 +15,7 @@ import {
isApplying,
uploadNeedsAcknowledgement,
uploadMessages
} from "../../store/reducers/licenseManagement";
} from '../../store/reducers/licenseManagement';
import { UploadLicense as PresentationComponent } from './upload_license';

View file

@ -8,7 +8,7 @@ import { createAction } from 'redux-actions';
import { addLicense } from '../actions/add_license';
import { BASE_PATH } from '../../../common/constants/base_path';
import { putLicense } from '../../lib/es';
import { addUploadErrorMessage } from "./add_error_message";
import { addUploadErrorMessage } from './add_error_message';
import { i18n } from '@kbn/i18n';
export const uploadLicenseStatus = createAction('LICENSE_MANAGEMENT_UPLOAD_LICENSE_STATUS');

View file

@ -62,23 +62,23 @@ describe('Saved object does not have layer list', () => {
};
const layers = getInitialLayers(null);
expect(layers).toEqual([{
"alpha": 1,
"__dataRequests": [],
"id": layers[0].id,
"label": null,
"maxZoom": 24,
"minZoom": 0,
"sourceDescriptor": {
"type": "EMS_TMS",
"id": "road_map",
'alpha': 1,
'__dataRequests': [],
'id': layers[0].id,
'label': null,
'maxZoom': 24,
'minZoom': 0,
'sourceDescriptor': {
'type': 'EMS_TMS',
'id': 'road_map',
},
"style": {
"properties": {},
"type": "TILE",
'style': {
'properties': {},
'type': 'TILE',
},
"temporary": false,
"type": "TILE",
"visible": true,
'temporary': false,
'type': 'TILE',
'visible': true,
}]);
});
@ -92,7 +92,7 @@ describe('Saved object does not have layer list', () => {
const layers = getInitialLayers(null);
expect(layers).toEqual([{
"alpha": 1,
'alpha': 1,
__dataRequests: [],
id: layers[0].id,
label: null,
@ -119,7 +119,7 @@ describe('Saved object does not have layer list', () => {
const layers = getInitialLayers(null);
expect(layers).toEqual([{
"alpha": 1,
'alpha': 1,
__dataRequests: [],
id: layers[0].id,
label: null,

View file

@ -70,10 +70,10 @@ export class GisMap extends Component {
if (noFlyoutVisible) {
currentPanel = null;
} else if (addLayerVisible) {
currentPanelClassName = "mapMapLayerPanel-isVisible";
currentPanelClassName = 'mapMapLayerPanel-isVisible';
currentPanel = <AddLayerPanel/>;
} else if (layerDetailsVisible) {
currentPanelClassName = "mapMapLayerPanel-isVisible";
currentPanelClassName = 'mapMapLayerPanel-isVisible';
currentPanel = (
<LayerPanel/>
);

View file

@ -8,13 +8,13 @@ import { connect } from 'react-redux';
import { AddLayerPanel } from './view';
import { getFlyoutDisplay, updateFlyout, FLYOUT_STATE }
from '../../store/ui';
import { getTemporaryLayers } from "../../selectors/map_selectors";
import { getTemporaryLayers } from '../../selectors/map_selectors';
import {
addLayer,
removeLayer,
clearTemporaryLayers,
setSelectedLayer,
} from "../../actions/store_actions";
} from '../../actions/store_actions';
import _ from 'lodash';
function mapStateToProps(state = {}) {

View file

@ -15,7 +15,7 @@ import {
clearGoto,
setLayerErrorStatus,
} from '../../../actions/store_actions';
import { getLayerList, getMapReady, getGoto } from "../../../selectors/map_selectors";
import { getLayerList, getMapReady, getGoto } from '../../../selectors/map_selectors';
function mapStateToProps(state = {}) {
return {

View file

@ -6,7 +6,7 @@
import { connect } from 'react-redux';
import { AttributionControl } from './view';
import { getLayerList } from "../../../selectors/map_selectors";
import { getLayerList } from '../../../selectors/map_selectors';
function mapStateToProps(state = {}) {
return {

View file

@ -6,8 +6,8 @@
import { connect } from 'react-redux';
import { LayerTOC } from './view';
import { updateLayerOrder } from "../../../../actions/store_actions";
import { getLayerList } from "../../../../selectors/map_selectors";
import { updateLayerOrder } from '../../../../actions/store_actions';
import { getLayerList } from '../../../../selectors/map_selectors';
const mapDispatchToProps = {
updateLayerOrder: newOrder => updateLayerOrder(newOrder)

View file

@ -6,7 +6,7 @@
import { connect } from 'react-redux';
import { ViewControl } from './view_control';
import { getMouseCoordinates } from "../../../selectors/map_selectors";
import { getMouseCoordinates } from '../../../selectors/map_selectors';
import {
getIsSetViewOpen,
closeSetView,

View file

@ -7,7 +7,7 @@
import { connect } from 'react-redux';
import { SetView } from './set_view';
import { setGotoWithCenter } from '../../../../actions/store_actions';
import { getMapZoom, getMapCenter } from "../../../../selectors/map_selectors";
import { getMapZoom, getMapCenter } from '../../../../selectors/map_selectors';
import { closeSetView } from '../../../../store/ui';
function mapStateToProps(state = {}) {

View file

@ -115,7 +115,7 @@ export function geoShapeToGeometry(value) {
}
// TODO handle case where value is WKT and convert to geojson
if (typeof value === "string") {
if (typeof value === 'string') {
throw new Error(`Unable to convert WKT to geojson, not supported`);
}
@ -196,8 +196,8 @@ function formatEnvelopeAsPolygon({ maxLat, maxLon, minLat, minLon }) {
const bottomRight = [right, bottom];
const topRight = [right, top];
return {
"type": "polygon",
"coordinates": [
'type': 'polygon',
'coordinates': [
[ topLeft, bottomLeft, bottomRight, topRight, topLeft ]
]
};

View file

@ -230,8 +230,8 @@ describe('geoPointToGeometry', () => {
const lon2 = -60;
const value = [
{
"lat": lat,
"lon": lon
'lat': lat,
'lon': lon
},
`${lat2},${lon2}`
];
@ -281,10 +281,10 @@ describe('createExtentFilter', () => {
it('should return elasticsearch geo_bounding_box filter for geo_point field', () => {
const filter = createExtentFilter(mapExtent, geoFieldName, 'geo_point');
expect(filter).toEqual({
"geo_bounding_box": {
"location": {
"bottom_right": [-83, 35],
"top_left": [-89, 39]
'geo_bounding_box': {
'location': {
'bottom_right': [-83, 35],
'top_left': [-89, 39]
}
}
});
@ -293,14 +293,14 @@ describe('createExtentFilter', () => {
it('should return elasticsearch geo_shape filter for geo_shape field', () => {
const filter = createExtentFilter(mapExtent, geoFieldName, 'geo_shape');
expect(filter).toEqual({
"geo_shape": {
"location": {
"relation": "INTERSECTS",
"shape": {
"coordinates": [
'geo_shape': {
'location': {
'relation': 'INTERSECTS',
'shape': {
'coordinates': [
[[-89, 39], [-89, 35], [-83, 35], [-83, 39], [-89, 39]]
],
"type": "polygon"
'type': 'polygon'
}
}
}
@ -316,14 +316,14 @@ describe('createExtentFilter', () => {
};
const filter = createExtentFilter(mapExtent, geoFieldName, 'geo_shape');
expect(filter).toEqual({
"geo_shape": {
"location": {
"relation": "INTERSECTS",
"shape": {
"coordinates": [
'geo_shape': {
'location': {
'relation': 'INTERSECTS',
'shape': {
'coordinates': [
[[-180, 39], [-180, 35], [180, 35], [180, 39], [-180, 39]]
],
"type": "polygon"
'type': 'polygon'
}
}
}
@ -340,8 +340,8 @@ describe('convertMapExtentToPolygon', () => {
minLon: 90,
};
expect(convertMapExtentToPolygon(bounds)).toEqual({
"type": "polygon",
"coordinates": [
'type': 'polygon',
'coordinates': [
[[90, 10], [90, -10], [100, -10], [100, 10], [90, 10]]
]
});
@ -355,8 +355,8 @@ describe('convertMapExtentToPolygon', () => {
minLon: -400,
};
expect(convertMapExtentToPolygon(bounds)).toEqual({
"type": "polygon",
"coordinates": [
'type': 'polygon',
'coordinates': [
[[-180, 10], [-180, -10], [180, -10], [180, 10], [-180, 10]]
]
});
@ -370,8 +370,8 @@ describe('convertMapExtentToPolygon', () => {
minLon: -400,
};
expect(convertMapExtentToPolygon(bounds)).toEqual({
"type": "polygon",
"coordinates": [
'type': 'polygon',
'coordinates': [
[[-180, 10], [-180, -10], [180, -10], [180, 10], [-180, 10]]
]
});
@ -385,8 +385,8 @@ describe('convertMapExtentToPolygon', () => {
minLon: 170,
};
expect(convertMapExtentToPolygon(bounds)).toEqual({
"type": "polygon",
"coordinates": [
'type': 'polygon',
'coordinates': [
[[170, 10], [170, -10], [-170, -10], [-170, 10], [170, 10]]
]
});
@ -400,8 +400,8 @@ describe('convertMapExtentToPolygon', () => {
minLon: -190,
};
expect(convertMapExtentToPolygon(bounds)).toEqual({
"type": "polygon",
"coordinates": [
'type': 'polygon',
'coordinates': [
[[170, 10], [170, -10], [-170, -10], [-170, 10], [170, 10]]
]
});

View file

@ -24,7 +24,7 @@ import 'ui/autoload/styles';
import 'ui/autoload/all';
import 'react-vis/dist/style.css';
import "mapbox-gl/dist/mapbox-gl.css";
import 'mapbox-gl/dist/mapbox-gl.css';
import 'ui/vis/map/service_settings';
import './angular/services/gis_map_saved_object_loader';

View file

@ -14,7 +14,7 @@ const SCALED_PROPERTY_NAME = '__kbn_heatmap_weight__';//unique name to store sca
export class HeatmapLayer extends AbstractLayer {
static type = "HEATMAP";
static type = 'HEATMAP';
static createDescriptor(options) {
const heatmapLayerDescriptor = super.createDescriptor(options);

View file

@ -19,12 +19,12 @@ jest.mock('../vector_layer', () => {});
const leftJoin = new LeftInnerJoin({
leftField: "iso2",
leftField: 'iso2',
right: {
id: "d3625663-5b34-4d50-a784-0d743f676a0c",
indexPatternId: "90943e30-9a47-11e8-b64d-95841ca0b247",
indexPatternTitle: "kibana_sample_data_logs",
term: "geo.dest",
id: 'd3625663-5b34-4d50-a784-0d743f676a0c',
indexPatternId: '90943e30-9a47-11e8-b64d-95841ca0b247',
indexPatternTitle: 'kibana_sample_data_logs',
term: 'geo.dest',
}
});
@ -36,7 +36,7 @@ describe('joinPropertiesToFeatureCollection', () => {
features: [
{
properties: {
iso2: "CN",
iso2: 'CN',
}
}
]
@ -46,7 +46,7 @@ describe('joinPropertiesToFeatureCollection', () => {
leftJoin.joinPropertiesToFeatureCollection(featureCollection, propertiesMap);
expect(featureCollection.features[0].properties).toEqual({
iso2: "CN",
iso2: 'CN',
[COUNT_PROPERTY_NAME]: 61,
});
});
@ -56,7 +56,7 @@ describe('joinPropertiesToFeatureCollection', () => {
features: [
{
properties: {
iso2: "CN",
iso2: 'CN',
[COUNT_PROPERTY_NAME]: 61,
[`__kbn__scaled(${COUNT_PROPERTY_NAME})`]: 1,
}
@ -67,7 +67,7 @@ describe('joinPropertiesToFeatureCollection', () => {
leftJoin.joinPropertiesToFeatureCollection(featureCollection, propertiesMap);
expect(featureCollection.features[0].properties).toEqual({
iso2: "CN",
iso2: 'CN',
});
});
});

View file

@ -145,21 +145,21 @@ describe('_makeAggConfigs', () => {
describe('extractPropertiesMap', () => {
const resp = {
"aggregations": {
"join": {
"buckets": [
'aggregations': {
'join': {
'buckets': [
{
"key": 109,
"doc_count": 1130,
"__kbnjoin__min_of_avlAirTemp_groupby_kibana_sample_data_ky_avl.kytcCountyNmbr": {
"value": 36
'key': 109,
'doc_count': 1130,
'__kbnjoin__min_of_avlAirTemp_groupby_kibana_sample_data_ky_avl.kytcCountyNmbr': {
'value': 36
}
},
{
"key": 62,
"doc_count": 448,
"__kbnjoin__min_of_avlAirTemp_groupby_kibana_sample_data_ky_avl.kytcCountyNmbr": {
"value": 0
'key': 62,
'doc_count': 448,
'__kbnjoin__min_of_avlAirTemp_groupby_kibana_sample_data_ky_avl.kytcCountyNmbr': {
'value': 0
}
},
]

View file

@ -129,12 +129,12 @@ class WMSEditor extends React.Component {
onChange={(e) => this._handleServiceUrlChange(e)}
/>
</EuiFormRow>
<EuiFormRow label="Layers" helpText={"use comma separated list of layer names"}>
<EuiFormRow label="Layers" helpText={'use comma separated list of layer names'}>
<EuiFieldText
onChange={(e) => this._handleLayersChange(e)}
/>
</EuiFormRow>
<EuiFormRow label="Styles" helpText={"use comma separated list of style names"}>
<EuiFormRow label="Styles" helpText={'use comma separated list of style names'}>
<EuiFieldText
onChange={(e) => this._handleStylesChange(e)}
/>

View file

@ -93,7 +93,7 @@ export class StaticDynamicStyleRow extends React.Component {
render() {
const isDynamic = this._isDynamic();
const dynamicTooltipContent =
isDynamic ? "Use static styling properties to symbolize features." : "Use property values to symbolize features.";
isDynamic ? 'Use static styling properties to symbolize features.' : 'Use property values to symbolize features.';
return (
<EuiFlexGroup gutterSize="s">

View file

@ -12,7 +12,7 @@ import { TileStyle } from '../layers/styles/tile_style';
export class TileLayer extends AbstractLayer {
static type = "TILE";
static type = 'TILE';
constructor({ layerDescriptor, source, style }) {
super({ layerDescriptor, source, style });

View file

@ -35,7 +35,7 @@ import {
TRACK_CURRENT_LAYER_STATE,
ROLLBACK_TO_TRACKED_LAYER_STATE,
REMOVE_TRACKED_LAYER_STATE
} from "../actions/store_actions";
} from '../actions/store_actions';
import { copyPersistentState, TRACKED_LAYER_DESCRIPTOR } from './util';

View file

@ -17,21 +17,21 @@ describe('buildMapsTelemetry', () => {
const result = buildMapsTelemetry(gisMaps);
expect(result).toMatchObject({
"attributesPerMap": {
"dataSourcesCount": {
"avg": 0,
"max": 0,
"min": 0
'attributesPerMap': {
'dataSourcesCount': {
'avg': 0,
'max': 0,
'min': 0
},
"emsVectorLayersCount": {},
"layerTypesCount": {},
"layersCount": {
"avg": 0,
"max": 0,
"min": 0
'emsVectorLayersCount': {},
'layerTypesCount': {},
'layersCount': {
'avg': 0,
'max': 0,
'min': 0
}
},
"mapsTotalCount": 0
'mapsTotalCount': 0
});
});
@ -41,48 +41,48 @@ describe('buildMapsTelemetry', () => {
const result = buildMapsTelemetry(gisMaps);
expect(result).toMatchObject({
"attributesPerMap": {
"dataSourcesCount": {
"avg": 2.6666666666666665,
"max": 3,
"min": 2
'attributesPerMap': {
'dataSourcesCount': {
'avg': 2.6666666666666665,
'max': 3,
'min': 2
},
"emsVectorLayersCount": {
"canada_provinces": {
"avg": 0.3333333333333333,
"max": 1,
"min": 1
'emsVectorLayersCount': {
'canada_provinces': {
'avg': 0.3333333333333333,
'max': 1,
'min': 1
},
"france_departments": {
"avg": 0.3333333333333333,
"max": 1,
"min": 1
'france_departments': {
'avg': 0.3333333333333333,
'max': 1,
'min': 1
},
"italy_provinces": {
"avg": 0.3333333333333333,
"max": 1,
"min": 1
'italy_provinces': {
'avg': 0.3333333333333333,
'max': 1,
'min': 1
}
},
"layerTypesCount": {
"TILE": {
"avg": 1,
"max": 1,
"min": 1
'layerTypesCount': {
'TILE': {
'avg': 1,
'max': 1,
'min': 1
},
"VECTOR": {
"avg": 1.6666666666666667,
"max": 2,
"min": 1
'VECTOR': {
'avg': 1.6666666666666667,
'max': 2,
'min': 1
}
},
"layersCount": {
"avg": 2.6666666666666665,
"max": 3,
"min": 2
'layersCount': {
'avg': 2.6666666666666665,
'max': 3,
'min': 2
}
},
"mapsTotalCount": 3
'mapsTotalCount': 3
});
});
});

View file

@ -40,8 +40,8 @@ function AlertsPanelUi({ alerts, changeUrl, intl }) {
defaultMessage: '{severityIconTitle} (resolved {time} ago)' },
{ severityIconTitle: severityIcon.title, time: formatTimestampToDuration(item.resolved_timestamp, CALCULATE_DURATION_SINCE)
});
severityIcon.color = "success";
severityIcon.iconType = "check";
severityIcon.color = 'success';
severityIcon.iconType = 'check';
}
return (

View file

@ -83,7 +83,7 @@ describe('PluginVertex', () => {
expect(pluginVertex.latestEventsPerSecond).to.be(20);
});
describe("isTimeConsuming", () => {
describe('isTimeConsuming', () => {
let percentExecution;
beforeEach(() => {
@ -96,7 +96,7 @@ describe('PluginVertex', () => {
expect(pluginVertex.isTimeConsuming()).to.be(false);
});
it("should have a true isTimeConsuming result when the plugin consumes a large amount of execution time", () => {
it('should have a true isTimeConsuming result when the plugin consumes a large amount of execution time', () => {
vertexJson.stats.percent_of_total_processor_duration.data[1][1] = 0.1 +
(percentExecution * (TIME_CONSUMING_PROCESSOR_THRESHOLD_COEFFICIENT));
const pluginVertex = new PluginVertex(graph, vertexJson);
@ -104,7 +104,7 @@ describe('PluginVertex', () => {
});
});
describe("isSlow", () => {
describe('isSlow', () => {
beforeEach(() => {
graph.processorVertices[0].millis_per_event = 1;
graph.processorVertices[1].millis_per_event = 999999999999999999;

View file

@ -116,19 +116,19 @@ describe('AWS', () => {
it('parses object in expected format', () => {
const body = {
devpayProductCodes: null,
privateIp: "10.0.0.38",
availabilityZone: "us-west-2c",
version: "2010-08-31",
instanceId: "i-0c7a5b7590a4d811c",
privateIp: '10.0.0.38',
availabilityZone: 'us-west-2c',
version: '2010-08-31',
instanceId: 'i-0c7a5b7590a4d811c',
billingProducts: null,
instanceType: "t2.micro",
accountId: "1234567890",
architecture: "x86_64",
instanceType: 't2.micro',
accountId: '1234567890',
architecture: 'x86_64',
kernelId: null,
ramdiskId: null,
imageId: "ami-6df1e514",
pendingTime: "2017-07-06T02:09:12Z",
region: "us-west-2"
imageId: 'ami-6df1e514',
pendingTime: '2017-07-06T02:09:12Z',
region: 'us-west-2'
};
const response = AWS._parseBody(body);
@ -137,17 +137,17 @@ describe('AWS', () => {
expect(response.isConfirmed()).to.eql(true);
expect(response.toJSON()).to.eql({
name: 'aws',
id: "i-0c7a5b7590a4d811c",
vm_type: "t2.micro",
region: "us-west-2",
zone: "us-west-2c",
id: 'i-0c7a5b7590a4d811c',
vm_type: 't2.micro',
region: 'us-west-2',
zone: 'us-west-2c',
metadata: {
version: "2010-08-31",
architecture: "x86_64",
version: '2010-08-31',
architecture: 'x86_64',
kernelId: null,
ramdiskId: null,
imageId: "ami-6df1e514",
pendingTime: "2017-07-06T02:09:12Z"
imageId: 'ami-6df1e514',
pendingTime: '2017-07-06T02:09:12Z'
}
});
});

View file

@ -83,40 +83,40 @@ describe('Azure', () => {
// it's expected that most users use the resource manager UI (which has been out for years)
it('parses object in expected format', () => {
const body = {
"compute": {
"location": "eastus",
"name": "pickypg-ubuntu-rm",
"offer": "UbuntuServer",
"osType": "Linux",
"platformFaultDomain": "0",
"platformUpdateDomain": "0",
"publisher": "Canonical",
"sku": "16.04-LTS",
"version": "16.04.201706191",
"vmId": "d4c57456-2b3b-437a-9f1f-7082cf123456",
"vmSize": "Standard_A1"
'compute': {
'location': 'eastus',
'name': 'pickypg-ubuntu-rm',
'offer': 'UbuntuServer',
'osType': 'Linux',
'platformFaultDomain': '0',
'platformUpdateDomain': '0',
'publisher': 'Canonical',
'sku': '16.04-LTS',
'version': '16.04.201706191',
'vmId': 'd4c57456-2b3b-437a-9f1f-7082cf123456',
'vmSize': 'Standard_A1'
},
"network": {
"interface": [
'network': {
'interface': [
{
"ipv4": {
"ipAddress": [
'ipv4': {
'ipAddress': [
{
"privateIpAddress": "10.1.0.4",
"publicIpAddress": "52.170.25.71"
'privateIpAddress': '10.1.0.4',
'publicIpAddress': '52.170.25.71'
}
],
"subnet": [
'subnet': [
{
"address": "10.1.0.0",
"prefix": "24"
'address': '10.1.0.0',
'prefix': '24'
}
]
},
"ipv6": {
"ipAddress": [ ]
'ipv6': {
'ipAddress': [ ]
},
"macAddress": "000D3A143CE3"
'macAddress': '000D3A143CE3'
}
]
}
@ -128,19 +128,19 @@ describe('Azure', () => {
expect(response.isConfirmed()).to.eql(true);
expect(response.toJSON()).to.eql({
name: 'azure',
id: "d4c57456-2b3b-437a-9f1f-7082cf123456",
vm_type: "Standard_A1",
region: "eastus",
id: 'd4c57456-2b3b-437a-9f1f-7082cf123456',
vm_type: 'Standard_A1',
region: 'eastus',
zone: undefined,
metadata: {
name: "pickypg-ubuntu-rm",
offer: "UbuntuServer",
osType: "Linux",
platformFaultDomain: "0",
platformUpdateDomain: "0",
publisher: "Canonical",
sku: "16.04-LTS",
version: "16.04.201706191"
name: 'pickypg-ubuntu-rm',
offer: 'UbuntuServer',
osType: 'Linux',
platformFaultDomain: '0',
platformUpdateDomain: '0',
publisher: 'Canonical',
sku: '16.04-LTS',
version: '16.04.201706191'
}
});
});
@ -148,27 +148,27 @@ describe('Azure', () => {
// classic represents the "old" way of launching things in Azure
it('parses object in expected classic format', () => {
const body = {
"network": {
"interface": [
'network': {
'interface': [
{
"ipv4": {
"ipAddress": [
'ipv4': {
'ipAddress': [
{
"privateIpAddress": "10.1.0.4",
"publicIpAddress": "52.170.25.71"
'privateIpAddress': '10.1.0.4',
'publicIpAddress': '52.170.25.71'
}
],
"subnet": [
'subnet': [
{
"address": "10.1.0.0",
"prefix": "24"
'address': '10.1.0.0',
'prefix': '24'
}
]
},
"ipv6": {
"ipAddress": [ ]
'ipv6': {
'ipAddress': [ ]
},
"macAddress": "000D3A143CE3"
'macAddress': '000D3A143CE3'
}
]
}

View file

@ -65,7 +65,7 @@ describe('CloudService', () => {
// invalid JSON
expect(() => service._stringToJson('{"xyz"}')).to.throwException();
// (single quotes are not actually valid in serialized JSON)
expect(() => service._stringToJson("{'a': 'xyz'}")).to.throwException();
expect(() => service._stringToJson('{\'a\': \'xyz\'}')).to.throwException();
expect(() => service._stringToJson('{{}')).to.throwException();
expect(() => service._stringToJson('{}}')).to.throwException();
});

View file

@ -9,26 +9,26 @@ import { handleResponse } from './get_shard_allocation';
describe('get_shard_allocation', () => {
const exampleShardSource = {
cluster_uuid: "Xb_iFZeMSDialSlUwnH53w",
state_uuid: "Xobm9shMQGa2p52j-Vh61A",
type: "shards",
timestamp: "2018-07-05T23:59:51.259Z",
cluster_uuid: 'Xb_iFZeMSDialSlUwnH53w',
state_uuid: 'Xobm9shMQGa2p52j-Vh61A',
type: 'shards',
timestamp: '2018-07-05T23:59:51.259Z',
};
const shards = [
{
node: "X7Cq5UJ9TrS6gWVLItV-0A",
index: "my-index-v1",
node: 'X7Cq5UJ9TrS6gWVLItV-0A',
index: 'my-index-v1',
relocating_node: null,
state: "STARTED",
state: 'STARTED',
shard: 0,
primary: true,
},
{
node: "Y8Cq5UJ9TrS6gWVLItV-0A",
index: "my-index-v1",
node: 'Y8Cq5UJ9TrS6gWVLItV-0A',
index: 'my-index-v1',
relocating_node: null,
state: "STARTED",
state: 'STARTED',
shard: 0,
primary: false,
},
@ -37,7 +37,7 @@ describe('get_shard_allocation', () => {
describe('handleResponse', () => {
it('deduplicates shards', () => {
const nextTimestamp = "2018-07-06T00:00:01.259Z";
const nextTimestamp = '2018-07-06T00:00:01.259Z';
const hits = shards.map(shard => {
return {
_source: {

View file

@ -35,7 +35,7 @@ describe('get_logstash_info', () => {
failures: 2
},
queue: {
type: "persisted",
type: 'persisted',
events: 100
}
}
@ -56,7 +56,7 @@ describe('get_logstash_info', () => {
successes: 5,
failures: 2
},
queue_type: "persisted"
queue_type: 'persisted'
});
});
@ -81,7 +81,7 @@ describe('get_logstash_info', () => {
failures: 2
},
queue: {
type: "persisted",
type: 'persisted',
events: 100
}
}
@ -102,7 +102,7 @@ describe('get_logstash_info', () => {
successes: 5,
failures: 2
},
queue_type: "persisted"
queue_type: 'persisted'
});
});

View file

@ -112,7 +112,7 @@ function createTimeseriesAggs(pipelineId, pipelineHash, maxBucketSize, timeserie
vertices: nestedVertices(maxBucketSize),
total_processor_duration_stats: {
stats: {
field: "logstash_stats.pipelines.events.duration_in_millis"
field: 'logstash_stats.pipelines.events.duration_in_millis'
}
}
})

View file

@ -45,7 +45,7 @@ export function ConnectionStatus({ isConnected }) {
}
const seedNodeTooltip = i18n.translate('xpack.remoteClusters.connectedStatus.notConnectedToolTip', {
defaultMessage: "Ensure the seed nodes are configured with the remote cluster's transport port, not the http port.",
defaultMessage: `Ensure the seed nodes are configured with the remote cluster's transport port, not the http port.`,
});
return (

View file

@ -38,7 +38,7 @@ export function getRouter() {
* https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/modules/Link.js.
*/
export function getRouterLinkProps(to) {
const location = typeof to === "string"
const location = typeof to === 'string'
? createLocation(to, null, null, router.history.location)
: to;

View file

@ -39,17 +39,17 @@ describe('[API Routes] Remote Clusters Add', () => {
it('should return the cluster information from Elasticsearch', async () => {
const mock = {
"acknowledged": true,
"persistent": {
"cluster": {
"remote": {
"test_cluster": {
"seeds": []
'acknowledged': true,
'persistent': {
'cluster': {
'remote': {
'test_cluster': {
'seeds': []
}
}
}
},
"transient": {}
'transient': {}
};
setHttpRequestResponse(null, mock);
@ -70,9 +70,9 @@ describe('[API Routes] Remote Clusters Add', () => {
it('should return an error if the response does not contain cluster information', async () => {
const mock = {
"acknowledged": true,
"persistent": {},
"transient": {}
'acknowledged': true,
'persistent': {},
'transient': {}
};
setHttpRequestResponse(null, mock);

View file

@ -39,9 +39,9 @@ describe('[API Routes] Remote Clusters Delete', () => {
it('should return empty cluster information from Elasticsearch', async () => {
const mock = {
"acknowledged": true,
"persistent": {},
"transient": {}
'acknowledged': true,
'persistent': {},
'transient': {}
};
setHttpRequestResponse(null, mock);
@ -57,17 +57,17 @@ describe('[API Routes] Remote Clusters Delete', () => {
it('should return an error if the response does still contain cluster information', async () => {
const mock = {
"acknowledged": true,
"persistent": {
"cluster": {
"remote": {
"test_cluster": {
"seeds": []
'acknowledged': true,
'persistent': {
'cluster': {
'remote': {
'test_cluster': {
'seeds': []
}
}
}
},
"transient": {}
'transient': {}
};
setHttpRequestResponse(null, mock);

View file

@ -39,17 +39,17 @@ describe('[API Routes] Remote Clusters Update', () => {
it('should return the cluster information from Elasticsearch', async () => {
const mock = {
"acknowledged": true,
"persistent": {
"cluster": {
"remote": {
"test_cluster": {
"seeds": []
'acknowledged': true,
'persistent': {
'cluster': {
'remote': {
'test_cluster': {
'seeds': []
}
}
}
},
"transient": {}
'transient': {}
};
setHttpRequestResponse(null, mock);
@ -72,9 +72,9 @@ describe('[API Routes] Remote Clusters Update', () => {
it('should return an error if the response does not contain cluster information', async () => {
const mock = {
"acknowledged": true,
"persistent": {},
"transient": {}
'acknowledged': true,
'persistent': {},
'transient': {}
};
setHttpRequestResponse(null, mock);

View file

@ -45,7 +45,7 @@ export function screenshotsObservableFactory(server) {
await browser.evaluate({
fn: function (css) {
const node = document.createElement('style');
node.type = "text/css";
node.type = 'text/css';
node.innerHTML = css; // eslint-disable-line no-unsanitized/property
document.getElementsByTagName('head')[0].appendChild(node);
},

View file

@ -461,7 +461,7 @@ describe('CSV Execute Job', function () {
const executeJob = executeJobFactory(mockServer);
const jobParams = {
headers: encryptedHeaders,
fields: [ 'one and a half', 'two', "three-and-four", "five & six" ],
fields: [ 'one and a half', 'two', 'three-and-four', 'five & six' ],
searchRequest: { index: null, body: null }
};
const { content } = await executeJob(jobParams, cancellationToken);
@ -473,7 +473,7 @@ describe('CSV Execute Job', function () {
const executeJob = executeJobFactory(mockServer);
const jobParams = {
headers: encryptedHeaders,
fields: [ 'one and a half', 'two', "three-and-four", "five & six" ],
fields: [ 'one and a half', 'two', 'three-and-four', 'five & six' ],
searchRequest: { index: null, body: null }
};
const { content } = await executeJob(jobParams, cancellationToken);

View file

@ -28,7 +28,7 @@ describe('field format map', function () {
};
const configMock = {};
configMock['format:defaultTypeMap'] = {
"number": { "id": "number", "params": {} }
'number': { 'id': 'number', 'params': {} }
};
configMock['format:number:defaultPattern'] = '0,0.[000]';
const getConfig = (key) => configMock[key];

View file

@ -231,7 +231,7 @@ function getTemplate(layout, logo, title) {
}),
fontSize: 10,
style: {
color: "#aaa"
color: '#aaa'
},
margin: [0, 2, 0, 0]
} : '',

View file

@ -178,10 +178,10 @@ export const reporting = (kibana) => {
deprecations: function ({ unused }) {
return [
unused("capture.concurrency"),
unused("capture.timeout"),
unused("capture.settleTime"),
unused("kibanaApp"),
unused('capture.concurrency'),
unused('capture.timeout'),
unused('capture.settleTime'),
unused('kibanaApp'),
];
},
});

View file

@ -253,7 +253,7 @@ describe('Worker class', function () {
it('should use error multiplier when processPendingJobs rejects the Promise', async function () {
worker = new Worker(mockQueue, 'test', noop, defaultWorkerOptions);
const processPendingJobsStub = sinon.stub(worker, "_processPendingJobs").returns(Promise.reject(new Error('test error')));
const processPendingJobsStub = sinon.stub(worker, '_processPendingJobs').returns(Promise.reject(new Error('test error')));
await allowPoll(defaultWorkerOptions.interval);
expect(processPendingJobsStub.callCount).to.be(1);
@ -266,7 +266,7 @@ describe('Worker class', function () {
it('should not use error multiplier when processPendingJobs resolved the Promise', async function () {
worker = new Worker(mockQueue, 'test', noop, defaultWorkerOptions);
const processPendingJobsStub = sinon.stub(worker, "_processPendingJobs").callsFake(() => Promise.resolve());
const processPendingJobsStub = sinon.stub(worker, '_processPendingJobs').callsFake(() => Promise.resolve());
await allowPoll(defaultWorkerOptions.interval);
expect(processPendingJobsStub.callCount).to.be(1);

View file

@ -10,7 +10,7 @@ export function WorkerTimeoutError(message, props = {}) {
this.timeout = props.timeout;
this.jobId = props.jobId;
if ("captureStackTrace" in Error) Error.captureStackTrace(this, WorkerTimeoutError);
if ('captureStackTrace' in Error) Error.captureStackTrace(this, WorkerTimeoutError);
else this.stack = (new Error()).stack;
}
WorkerTimeoutError.prototype = Object.create(Error.prototype);
@ -20,7 +20,7 @@ export function UnspecifiedWorkerError(message, props = {}) {
this.message = message;
this.jobId = props.jobId;
if ("captureStackTrace" in Error) Error.captureStackTrace(this, UnspecifiedWorkerError);
if ('captureStackTrace' in Error) Error.captureStackTrace(this, UnspecifiedWorkerError);
else this.stack = (new Error()).stack;
}
UnspecifiedWorkerError.prototype = Object.create(Error.prototype);

View file

@ -104,7 +104,7 @@ async function getReportingUsageWithinRange(callCluster, server, reportingAvaila
return {
_all: (total || total === 0) ? total : undefined,
...jobTypes,
"status": {
'status': {
...statusCounts
}
};

View file

@ -38,7 +38,7 @@ export function getRouter() {
* https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/modules/Link.js.
*/
export function getRouterLinkProps(to) {
const location = typeof to === "string"
const location = typeof to === 'string'
? createLocation(to, null, null, router.history.location)
: to;

View file

@ -18,16 +18,16 @@ class ConfirmDeleteUI extends Component {
await apiClient.deleteUser(username);
toastNotifications.addSuccess(
this.props.intl.formatMessage({
id: "xpack.security.management.users.confirmDelete.userSuccessfullyDeletedNotificationMessage",
defaultMessage: "Deleted user {username}"
id: 'xpack.security.management.users.confirmDelete.userSuccessfullyDeletedNotificationMessage',
defaultMessage: 'Deleted user {username}'
}, { username })
);
} catch (e) {
errors.push(username);
toastNotifications.addDanger(
this.props.intl.formatMessage({
id: "xpack.security.management.users.confirmDelete.userDeletingErrorNotificationMessage",
defaultMessage: "Error deleting user {username}"
id: 'xpack.security.management.users.confirmDelete.userDeletingErrorNotificationMessage',
defaultMessage: 'Error deleting user {username}'
}, { username })
);
}
@ -41,12 +41,12 @@ class ConfirmDeleteUI extends Component {
const moreThanOne = usersToDelete.length > 1;
const title = moreThanOne
? intl.formatMessage({
id: "xpack.security.management.users.confirmDelete.deleteMultipleUsersTitle",
defaultMessage: "Delete {userLength} users"
id: 'xpack.security.management.users.confirmDelete.deleteMultipleUsersTitle',
defaultMessage: 'Delete {userLength} users'
}, { userLength: usersToDelete.length })
: intl.formatMessage({
id: "xpack.security.management.users.confirmDelete.deleteOneUserTitle",
defaultMessage: "Delete user {userLength}"
id: 'xpack.security.management.users.confirmDelete.deleteOneUserTitle',
defaultMessage: 'Delete user {userLength}'
}, { userLength: usersToDelete[0] });
return (
<EuiOverlayMask>
@ -55,12 +55,12 @@ class ConfirmDeleteUI extends Component {
onCancel={onCancel}
onConfirm={this.deleteUsers}
cancelButtonText={intl.formatMessage({
id: "xpack.security.management.users.confirmDelete.cancelButtonLabel",
defaultMessage: "Cancel"
id: 'xpack.security.management.users.confirmDelete.cancelButtonLabel',
defaultMessage: 'Cancel'
})}
confirmButtonText={intl.formatMessage({
id: "xpack.security.management.users.confirmDelete.confirmButtonLabel",
defaultMessage: "Delete"
id: 'xpack.security.management.users.confirmDelete.confirmButtonLabel',
defaultMessage: 'Delete'
})}
buttonColor="danger"
>

View file

@ -64,8 +64,8 @@ class EditUserUI extends Component {
} catch (err) {
toastNotifications.addDanger({
title: this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.errorLoadingUserTitle",
defaultMessage: "Error loading user"
id: 'xpack.security.management.users.editUser.errorLoadingUserTitle',
defaultMessage: 'Error loading user'
}),
text: get(err, 'data.message') || err.message,
});
@ -79,8 +79,8 @@ class EditUserUI extends Component {
} catch (err) {
toastNotifications.addDanger({
title: this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.errorLoadingRolesTitle",
defaultMessage: "Error loading roles"
id: 'xpack.security.management.users.editUser.errorLoadingRolesTitle',
defaultMessage: 'Error loading roles'
}),
text: get(err, 'data.message') || err.message,
});
@ -106,8 +106,8 @@ class EditUserUI extends Component {
const { password } = this.state;
if (password !== null && password.length < 6) {
return this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.passwordLengthErrorMessage",
defaultMessage: "Password must be at least 6 characters"
id: 'xpack.security.management.users.editUser.passwordLengthErrorMessage',
defaultMessage: 'Password must be at least 6 characters'
});
}
};
@ -115,8 +115,8 @@ class EditUserUI extends Component {
const { currentPasswordError } = this.state;
if (currentPasswordError) {
return this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.incorrectPasswordErrorMessage",
defaultMessage: "The current password you entered is incorrect"
id: 'xpack.security.management.users.editUser.incorrectPasswordErrorMessage',
defaultMessage: 'The current password you entered is incorrect'
});
}
};
@ -124,8 +124,8 @@ class EditUserUI extends Component {
const { password, confirmPassword } = this.state;
if (password && confirmPassword !== null && password !== confirmPassword) {
return this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.passwordDoNotMatchErrorMessage",
defaultMessage: "Passwords do not match"
id: 'xpack.security.management.users.editUser.passwordDoNotMatchErrorMessage',
defaultMessage: 'Passwords do not match'
});
}
};
@ -133,13 +133,13 @@ class EditUserUI extends Component {
const { username } = this.state.user;
if (username !== null && !username) {
return this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.requiredUsernameErrorMessage",
defaultMessage: "Username is required"
id: 'xpack.security.management.users.editUser.requiredUsernameErrorMessage',
defaultMessage: 'Username is required'
});
} else if (username && !username.match(validUsernameRegex)) {
return this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.usernameAllowedCharactersErrorMessage",
defaultMessage: "Username must begin with a letter or underscore and contain only letters, underscores, and numbers"
id: 'xpack.security.management.users.editUser.usernameAllowedCharactersErrorMessage',
defaultMessage: 'Username must begin with a letter or underscore and contain only letters, underscores, and numbers'
});
}
};
@ -147,8 +147,8 @@ class EditUserUI extends Component {
const { email } = this.state.user;
if (email !== null && email !== '' && !email.match(validEmailRegex)) {
return this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.validEmailRequiredErrorMessage",
defaultMessage: "Email address is invalid"
id: 'xpack.security.management.users.editUser.validEmailRequiredErrorMessage',
defaultMessage: 'Email address is invalid'
});
}
};
@ -159,8 +159,8 @@ class EditUserUI extends Component {
await apiClient.changePassword(user.username, password, currentPassword);
toastNotifications.addSuccess(
this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.passwordSuccessfullyChangedNotificationMessage",
defaultMessage: "Password changed."
id: 'xpack.security.management.users.editUser.passwordSuccessfullyChangedNotificationMessage',
defaultMessage: 'Password changed.'
})
);
} catch (e) {
@ -169,8 +169,8 @@ class EditUserUI extends Component {
} else {
toastNotifications.addDanger(
this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.settingPasswordErrorMessage",
defaultMessage: "Error setting password: {message}"
id: 'xpack.security.management.users.editUser.settingPasswordErrorMessage',
defaultMessage: 'Error setting password: {message}'
}, { message: e.data.message })
);
}
@ -191,16 +191,16 @@ class EditUserUI extends Component {
await apiClient.saveUser(userToSave);
toastNotifications.addSuccess(
this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.userSuccessfullySavedNotificationMessage",
defaultMessage: "Saved user {message}"
id: 'xpack.security.management.users.editUser.userSuccessfullySavedNotificationMessage',
defaultMessage: 'Saved user {message}'
}, { message: user.username })
);
changeUrl(USERS_PATH);
} catch (e) {
toastNotifications.addDanger(
this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.savingUserErrorMessage",
defaultMessage: "Error saving user: {message}"
id: 'xpack.security.management.users.editUser.savingUserErrorMessage',
defaultMessage: 'Error saving user: {message}'
}, { message: e.data.message })
);
}
@ -220,8 +220,8 @@ class EditUserUI extends Component {
{userIsLoggedInUser ? (
<EuiFormRow
label={this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.currentPasswordFormRowLabel",
defaultMessage: "Current password"
id: 'xpack.security.management.users.editUser.currentPasswordFormRowLabel',
defaultMessage: 'Current password'
})}
isInvalid={!!this.currentPasswordError()}
error={this.currentPasswordError()}
@ -236,11 +236,11 @@ class EditUserUI extends Component {
<EuiFormRow
label={
userIsLoggedInUser ? this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.newPasswordFormRowLabel",
defaultMessage: "New password"
id: 'xpack.security.management.users.editUser.newPasswordFormRowLabel',
defaultMessage: 'New password'
}) : this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.passwordFormRowLabel",
defaultMessage: "Password"
id: 'xpack.security.management.users.editUser.passwordFormRowLabel',
defaultMessage: 'Password'
})
}
isInvalid={!!this.passwordError()}
@ -256,8 +256,8 @@ class EditUserUI extends Component {
</EuiFormRow>
<EuiFormRow
label={this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.confirmPasswordFormRowLabel",
defaultMessage: "Confirm password"
id: 'xpack.security.management.users.editUser.confirmPasswordFormRowLabel',
defaultMessage: 'Confirm password'
})}
isInvalid={!!this.confirmPasswordError()}
error={this.confirmPasswordError()}
@ -291,8 +291,8 @@ class EditUserUI extends Component {
<Fragment>
<EuiCallOut
title={this.props.intl.formatMessage({
id: "xpack.security.management.users.editUser.changePasswordExtraStepTitle",
defaultMessage: "Extra step needed"
id: 'xpack.security.management.users.editUser.changePasswordExtraStepTitle',
defaultMessage: 'Extra step needed'
})}
color="warning"
iconType="help"
@ -445,14 +445,14 @@ class EditUserUI extends Component {
helpText={
!isNewUser && !reserved
? intl.formatMessage({
id: "xpack.security.management.users.editUser.changingUserNameAfterCreationDescription",
defaultMessage: "Username's cannot be changed after creation."
id: 'xpack.security.management.users.editUser.changingUserNameAfterCreationDescription',
defaultMessage: `Usernames can't be changed after creation.`
})
: null
}
label={intl.formatMessage({
id: "xpack.security.management.users.editUser.usernameFormRowLabel",
defaultMessage: "Username"
id: 'xpack.security.management.users.editUser.usernameFormRowLabel',
defaultMessage: 'Username'
})}
>
<EuiFieldText
@ -480,8 +480,8 @@ class EditUserUI extends Component {
<Fragment>
<EuiFormRow
label={intl.formatMessage({
id: "xpack.security.management.users.editUser.fullNameFormRowLabel",
defaultMessage: "Full name"
id: 'xpack.security.management.users.editUser.fullNameFormRowLabel',
defaultMessage: 'Full name'
})}
>
<EuiFieldText
@ -510,8 +510,8 @@ class EditUserUI extends Component {
isInvalid={!!this.emailError()}
error={this.emailError()}
label={intl.formatMessage({
id: "xpack.security.management.users.editUser.emailAddressFormRowLabel",
defaultMessage: "Email address"
id: 'xpack.security.management.users.editUser.emailAddressFormRowLabel',
defaultMessage: 'Email address'
})}
>
<EuiFieldText
@ -540,15 +540,15 @@ class EditUserUI extends Component {
)}
<EuiFormRow
label={intl.formatMessage({
id: "xpack.security.management.users.editUser.rolesFormRowLabel",
defaultMessage: "Roles"
id: 'xpack.security.management.users.editUser.rolesFormRowLabel',
defaultMessage: 'Roles'
})}
>
<EuiComboBox
data-test-subj="userFormRolesDropdown"
placeholder={intl.formatMessage({
id: "xpack.security.management.users.editUser.addRolesPlaceholder",
defaultMessage: "Add roles"
id: 'xpack.security.management.users.editUser.addRolesPlaceholder',
defaultMessage: 'Add roles'
})}
onChange={this.onRolesChange}
isDisabled={reserved}

View file

@ -19,7 +19,7 @@ import {
} from '@elastic/eui';
import { toastNotifications } from 'ui/notify';
import { ConfirmDelete } from './confirm_delete';
import { injectI18n, FormattedMessage } from "@kbn/i18n/react";
import { injectI18n, FormattedMessage } from '@kbn/i18n/react';
class UsersUI extends Component {
constructor(props) {
@ -54,8 +54,8 @@ class UsersUI extends Component {
} else {
toastNotifications.addDanger(
this.props.intl.formatMessage({
id: "xpack.security.management.users.fetchingUsersErrorMessage",
defaultMessage: "Error fetching users: {message}"
id: 'xpack.security.management.users.fetchingUsersErrorMessage',
defaultMessage: 'Error fetching users: {message}'
}, { message: e.data.message })
);
}
@ -119,7 +119,7 @@ class UsersUI extends Component {
const columns = [
{
field: 'full_name',
name: intl.formatMessage({ id: "xpack.security.management.users.fullNameColumnName", defaultMessage: "Full Name" }),
name: intl.formatMessage({ id: 'xpack.security.management.users.fullNameColumnName', defaultMessage: 'Full Name' }),
sortable: true,
truncateText: true,
render: fullName => {
@ -128,7 +128,7 @@ class UsersUI extends Component {
},
{
field: 'username',
name: intl.formatMessage({ id: "xpack.security.management.users.userNameColumnName", defaultMessage: "User Name" }),
name: intl.formatMessage({ id: 'xpack.security.management.users.userNameColumnName', defaultMessage: 'User Name' }),
sortable: true,
truncateText: true,
render: username => (
@ -140,15 +140,15 @@ class UsersUI extends Component {
{
field: 'email',
name: intl.formatMessage({
id: "xpack.security.management.users.emailAddressColumnName",
defaultMessage: "Email Address"
id: 'xpack.security.management.users.emailAddressColumnName',
defaultMessage: 'Email Address'
}),
sortable: true,
truncateText: true,
},
{
field: 'roles',
name: intl.formatMessage({ id: "xpack.security.management.users.rolesColumnName", defaultMessage: "Roles" }),
name: intl.formatMessage({ id: 'xpack.security.management.users.rolesColumnName', defaultMessage: 'Roles' }),
render: rolenames => {
const roleLinks = rolenames.map((rolename, index) => {
return (
@ -163,14 +163,14 @@ class UsersUI extends Component {
},
{
field: 'metadata._reserved',
name: intl.formatMessage({ id: "xpack.security.management.users.reservedColumnName", defaultMessage: "Reserved" }),
name: intl.formatMessage({ id: 'xpack.security.management.users.reservedColumnName', defaultMessage: 'Reserved' }),
sortable: false,
width: '100px',
align: 'right',
description:
intl.formatMessage({
id: "xpack.security.management.users.reservedColumnDescription",
defaultMessage: "Reserved users are built-in and cannot be removed. Only the password can be changed."
id: 'xpack.security.management.users.reservedColumnDescription',
defaultMessage: 'Reserved users are built-in and cannot be removed. Only the password can be changed.'
}),
render: reserved =>
reserved ? (

View file

@ -48,7 +48,7 @@ module.controller('securityNavController', ($scope, ShieldUser, globalNavState,
};
$scope.logoutLabel = i18n('xpack.security.navControl.logoutLabel', {
defaultMessage: "Logout"
defaultMessage: 'Logout'
});
});

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { validateEsPrivilegeResponse } from "./validate_es_response";
import { validateEsPrivilegeResponse } from './validate_es_response';
const resource1 = 'foo-resource';
const resource2 = 'bar-resource';

View file

@ -28,8 +28,8 @@ describe('action', () => {
upstreamJson = {
id: 'my-action',
actionJson: {
"logging": {
"text": "foo"
'logging': {
'text': 'foo'
}
}
};
@ -112,8 +112,8 @@ describe('action', () => {
upstreamJson = {
id: 'my-action',
actionJson: {
"email": {
"to": "elastic@elastic.co"
'email': {
'to': 'elastic@elastic.co'
}
}
};

View file

@ -15,38 +15,38 @@ describe('fields', () => {
let upstreamJson;
beforeEach(() => {
upstreamJson = {
"fields": {
"field-foo": {
"text": {
"type": "text",
"searchable": true,
"aggregatable": false
'fields': {
'field-foo': {
'text': {
'type': 'text',
'searchable': true,
'aggregatable': false
}
},
"field-bar": {
"boolean": {
"type": "boolean",
"searchable": true,
"aggregatable": true
'field-bar': {
'boolean': {
'type': 'boolean',
'searchable': true,
'aggregatable': true
},
"integer": {
"type": "integer",
"searchable": true,
"aggregatable": true
'integer': {
'type': 'integer',
'searchable': true,
'aggregatable': true
}
},
"field-baz": {
"_footype": {
"type": "_footype",
"searchable": true,
"aggregatable": true
'field-baz': {
'_footype': {
'type': '_footype',
'searchable': true,
'aggregatable': true
}
},
"field-bop": {
"integer": {
"type": "integer",
"searchable": true,
"aggregatable": true
'field-bop': {
'integer': {
'type': 'integer',
'searchable': true,
'aggregatable': true
}
},
}

View file

@ -376,18 +376,18 @@ describe('ThresholdWatch', () => {
it('should generate a valid ThresholdWatch object', () => {
const actual = ThresholdWatch.fromUpstreamJson(upstreamJson);
const expected = {
index: "index",
timeField: "timeField",
triggerIntervalSize: "triggerIntervalSize",
triggerIntervalUnit: "triggerIntervalUnit",
aggType: "aggType",
aggField: "aggField",
termSize: "termSize",
termField: "termField",
thresholdComparator: "thresholdComparator",
timeWindowSize: "timeWindowSize",
timeWindowUnit: "timeWindowUnit",
threshold: "threshold"
index: 'index',
timeField: 'timeField',
triggerIntervalSize: 'triggerIntervalSize',
triggerIntervalUnit: 'triggerIntervalUnit',
aggType: 'aggType',
aggField: 'aggField',
termSize: 'termSize',
termField: 'termField',
thresholdComparator: 'thresholdComparator',
timeWindowSize: 'timeWindowSize',
timeWindowUnit: 'timeWindowUnit',
threshold: 'threshold'
};
expect(actual).to.eql(expected);
@ -426,18 +426,18 @@ describe('ThresholdWatch', () => {
it('should generate a valid ThresholdWatch object', () => {
const actual = ThresholdWatch.fromDownstreamJson(downstreamJson);
const expected = {
index: "index",
timeField: "timeField",
triggerIntervalSize: "triggerIntervalSize",
triggerIntervalUnit: "triggerIntervalUnit",
aggType: "aggType",
aggField: "aggField",
termSize: "termSize",
termField: "termField",
thresholdComparator: "thresholdComparator",
timeWindowSize: "timeWindowSize",
timeWindowUnit: "timeWindowUnit",
threshold: "threshold"
index: 'index',
timeField: 'timeField',
triggerIntervalSize: 'triggerIntervalSize',
triggerIntervalUnit: 'triggerIntervalUnit',
aggType: 'aggType',
aggField: 'aggField',
termSize: 'termSize',
termField: 'termField',
thresholdComparator: 'thresholdComparator',
timeWindowSize: 'timeWindowSize',
timeWindowUnit: 'timeWindowUnit',
threshold: 'threshold'
};
expect(actual).to.eql(expected);

View file

@ -19,28 +19,28 @@ describe('watch', () => {
};
const response = {
"aggregations": {
"dateAgg": {
"buckets": [
'aggregations': {
'dateAgg': {
'buckets': [
{
"key_as_string": "2017-06-17T00:00:00.000-05:00",
"key": 1497675600000,
"doc_count": 13622
'key_as_string': '2017-06-17T00:00:00.000-05:00',
'key': 1497675600000,
'doc_count': 13622
},
{
"key_as_string": "2017-06-17T12:00:00.000-05:00",
"key": 1497718800000,
"doc_count": 13639
'key_as_string': '2017-06-17T12:00:00.000-05:00',
'key': 1497718800000,
'doc_count': 13639
},
{
"key_as_string": "2017-06-18T00:00:00.000-05:00",
"key": 1497762000000,
"doc_count": 13811
'key_as_string': '2017-06-18T00:00:00.000-05:00',
'key': 1497762000000,
'doc_count': 13811
},
{
"key_as_string": "2017-06-18T12:00:00.000-05:00",
"key": 1497805200000,
"doc_count": 13461
'key_as_string': '2017-06-18T12:00:00.000-05:00',
'key': 1497805200000,
'doc_count': 13461
}
]
}
@ -68,62 +68,62 @@ describe('watch', () => {
};
const response = {
"aggregations": {
"bucketAgg": {
"buckets": [
'aggregations': {
'bucketAgg': {
'buckets': [
{
"key": "foo_term",
"dateAgg": {
"buckets": [
'key': 'foo_term',
'dateAgg': {
'buckets': [
{
"key": 1498366800000,
"doc_count": 8878
'key': 1498366800000,
'doc_count': 8878
},
{
"key": 1498410000000,
"doc_count": 8674
'key': 1498410000000,
'doc_count': 8674
},
{
"key": 1498453200000,
"doc_count": 8720
'key': 1498453200000,
'doc_count': 8720
}
]
}
},
{
"key": "bar_term",
"dateAgg": {
"buckets": [
'key': 'bar_term',
'dateAgg': {
'buckets': [
{
"key": 1498366800000,
"doc_count": 2163
'key': 1498366800000,
'doc_count': 2163
},
{
"key": 1498410000000,
"doc_count": 2202
'key': 1498410000000,
'doc_count': 2202
},
{
"key": 1498453200000,
"doc_count": 2311
'key': 1498453200000,
'doc_count': 2311
}
]
}
},
{
"key": "baz_term",
"dateAgg": {
"buckets": [
'key': 'baz_term',
'dateAgg': {
'buckets': [
{
"key": 1497675600000,
"doc_count": 891
'key': 1497675600000,
'doc_count': 891
},
{
"key": 1497718800000,
"doc_count": 866
'key': 1497718800000,
'doc_count': 866
},
{
"key": 1497762000000,
"doc_count": 906
'key': 1497762000000,
'doc_count': 906
}
]
}
@ -163,25 +163,25 @@ describe('watch', () => {
};
const response = {
"aggregations": {
"dateAgg": {
"buckets": [
'aggregations': {
'dateAgg': {
'buckets': [
{
"key": 1497675600000,
"metricAgg": {
"value": 5721.5481573924535
'key': 1497675600000,
'metricAgg': {
'value': 5721.5481573924535
}
},
{
"key": 1497718800000,
"metricAgg": {
"value": 5696.727765965246
'key': 1497718800000,
'metricAgg': {
'value': 5696.727765965246
}
},
{
"key": 1497762000000,
"metricAgg": {
"value": 5725.888567084208
'key': 1497762000000,
'metricAgg': {
'value': 5725.888567084208
}
}
]
@ -209,91 +209,91 @@ describe('watch', () => {
};
const response = {
"aggregations": {
"bucketAgg": {
"buckets": [
'aggregations': {
'bucketAgg': {
'buckets': [
{
"key": "foo_term",
"dateAgg": {
"buckets": [
'key': 'foo_term',
'dateAgg': {
'buckets': [
{
"key": 1498366800000,
"metricAgg": {
"value": 10741.000753579503
'key': 1498366800000,
'metricAgg': {
'value': 10741.000753579503
}
},
{
"key": 1498410000000,
"metricAgg": {
"value": 10350.321100917432
'key': 1498410000000,
'metricAgg': {
'value': 10350.321100917432
}
},
{
"key": 1498453200000,
"metricAgg": {
"value": 10534.54078549849
'key': 1498453200000,
'metricAgg': {
'value': 10534.54078549849
}
}
]
},
"metricAgg": {
"value": 10477.102294853963
'metricAgg': {
'value': 10477.102294853963
}
},
{
"key": "bar_term",
"dateAgg": {
"buckets": [
'key': 'bar_term',
'dateAgg': {
'buckets': [
{
"key": 1498366800000,
"metricAgg": {
"value": 5629.317614424411
'key': 1498366800000,
'metricAgg': {
'value': 5629.317614424411
}
},
{
"key": 1498410000000,
"metricAgg": {
"value": 5548.141689373297
'key': 1498410000000,
'metricAgg': {
'value': 5548.141689373297
}
},
{
"key": 1498453200000,
"metricAgg": {
"value": 5603.887494591086
'key': 1498453200000,
'metricAgg': {
'value': 5603.887494591086
}
}
]
},
"metricAgg": {
"value": 5595.034518438806
'metricAgg': {
'value': 5595.034518438806
}
},
{
"key": "baz_term",
"dateAgg": {
"buckets": [
'key': 'baz_term',
'dateAgg': {
'buckets': [
{
"key": 1498366800000,
"metricAgg": {
"value": 5577.867537733724
'key': 1498366800000,
'metricAgg': {
'value': 5577.867537733724
}
},
{
"key": 1498410000000,
"metricAgg": {
"value": 5543.652870647913
'key': 1498410000000,
'metricAgg': {
'value': 5543.652870647913
}
},
{
"key": 1498453200000,
"metricAgg": {
"value": 5553.1327981651375
'key': 1498453200000,
'metricAgg': {
'value': 5553.1327981651375
}
}
]
},
"metricAgg": {
"value": 5567.288459750643
'metricAgg': {
'value': 5567.288459750643
}
}
]

View file

@ -42,7 +42,7 @@ async function asyncInjectBanner($injector) {
// determine if the banner should be displayed
if (await shouldShowBanner(telemetryOptInProvider, config)) {
const $http = $injector.get("$http");
const $http = $injector.get('$http');
renderBanner(telemetryOptInProvider, () => fetchTelemetry($http));
}

View file

@ -3,14 +3,14 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { TelemetryOptInProvider } from "./telemetry_opt_in";
import { TelemetryOptInProvider } from './telemetry_opt_in';
describe('TelemetryOptInProvider', () => {
const setup = ({ optedIn, simulatePostError }) => {
const mockHttp = {
post: jest.fn(async () => {
if (simulatePostError) {
return Promise.reject("Something happened");
return Promise.reject('Something happened');
}
})
};

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { getTelemetryOptIn } from "./get_telemetry_opt_in";
import { getTelemetryOptIn } from './get_telemetry_opt_in';
import { buildUserProfile } from './user_profile_registry';
export async function replaceInjectedVars(originalInjectedVars, request, server) {

View file

@ -119,7 +119,7 @@ export function processResults(results = [], { clusters, clusterHostSets, cluste
for (const proto in heartbeatState) {
if (!heartbeatState.hasOwnProperty(proto)) continue;
const val = heartbeatState[proto];
if (typeof val !== "object") continue;
if (typeof val !== 'object') continue;
if (!clusterHb.hasOwnProperty(proto)) {
clusterHb[proto] = {

View file

@ -23,11 +23,11 @@ export const initClusterHelpers = (supertest) => {
.post(`${REMOTE_CLUSTERS_API_BASE_PATH}`)
.set('kbn-xsrf', 'xxx')
.send({
"name": name,
"seeds": [
"localhost:9300"
'name': name,
'seeds': [
'localhost:9300'
],
"skipUnavailable": true,
'skipUnavailable': true,
})
);
};

View file

@ -14,7 +14,7 @@ export default function ({ getService }) {
after(async () => {
// turn off collection
const disableCollection = {
"persistent":
'persistent':
{
xpack: {
monitoring: {

View file

@ -110,63 +110,63 @@ export default function ({ getService }) {
const actual = flatKeys(stats);
const expected = [
"cluster_name",
"cluster_stats.cluster_uuid",
"cluster_stats.indices.completion",
"cluster_stats.indices.count",
"cluster_stats.indices.docs",
"cluster_stats.indices.fielddata",
"cluster_stats.indices.query_cache",
"cluster_stats.indices.segments",
"cluster_stats.indices.shards",
"cluster_stats.indices.store",
"cluster_stats.nodes.count",
"cluster_stats.nodes.discovery_types",
"cluster_stats.nodes.fs",
"cluster_stats.nodes.jvm",
"cluster_stats.nodes.network_types",
"cluster_stats.nodes.os",
"cluster_stats.nodes.plugins",
"cluster_stats.nodes.process",
"cluster_stats.nodes.versions",
"cluster_stats.status",
"cluster_stats.timestamp",
"cluster_uuid",
"collection",
"license.expiry_date",
"license.expiry_date_in_millis",
"license.issue_date",
"license.issue_date_in_millis",
"license.issued_to",
"license.issuer",
"license.max_nodes",
"license.start_date_in_millis",
"license.status",
"license.type",
"license.uid",
"stack_stats.kibana.count",
"stack_stats.kibana.dashboard",
"stack_stats.kibana.graph_workspace",
"stack_stats.kibana.index_pattern",
"stack_stats.kibana.indices",
"stack_stats.kibana.os",
"stack_stats.kibana.plugins",
"stack_stats.kibana.search",
"stack_stats.kibana.timelion_sheet",
"stack_stats.kibana.versions",
"stack_stats.kibana.visualization",
"stack_stats.xpack.ccr",
"stack_stats.xpack.graph",
"stack_stats.xpack.ilm",
"stack_stats.xpack.logstash",
"stack_stats.xpack.ml",
"stack_stats.xpack.monitoring",
"stack_stats.xpack.rollup",
"stack_stats.xpack.security",
"stack_stats.xpack.sql",
"stack_stats.xpack.watcher",
"timestamp",
"version"
'cluster_name',
'cluster_stats.cluster_uuid',
'cluster_stats.indices.completion',
'cluster_stats.indices.count',
'cluster_stats.indices.docs',
'cluster_stats.indices.fielddata',
'cluster_stats.indices.query_cache',
'cluster_stats.indices.segments',
'cluster_stats.indices.shards',
'cluster_stats.indices.store',
'cluster_stats.nodes.count',
'cluster_stats.nodes.discovery_types',
'cluster_stats.nodes.fs',
'cluster_stats.nodes.jvm',
'cluster_stats.nodes.network_types',
'cluster_stats.nodes.os',
'cluster_stats.nodes.plugins',
'cluster_stats.nodes.process',
'cluster_stats.nodes.versions',
'cluster_stats.status',
'cluster_stats.timestamp',
'cluster_uuid',
'collection',
'license.expiry_date',
'license.expiry_date_in_millis',
'license.issue_date',
'license.issue_date_in_millis',
'license.issued_to',
'license.issuer',
'license.max_nodes',
'license.start_date_in_millis',
'license.status',
'license.type',
'license.uid',
'stack_stats.kibana.count',
'stack_stats.kibana.dashboard',
'stack_stats.kibana.graph_workspace',
'stack_stats.kibana.index_pattern',
'stack_stats.kibana.indices',
'stack_stats.kibana.os',
'stack_stats.kibana.plugins',
'stack_stats.kibana.search',
'stack_stats.kibana.timelion_sheet',
'stack_stats.kibana.versions',
'stack_stats.kibana.visualization',
'stack_stats.xpack.ccr',
'stack_stats.xpack.graph',
'stack_stats.xpack.ilm',
'stack_stats.xpack.logstash',
'stack_stats.xpack.ml',
'stack_stats.xpack.monitoring',
'stack_stats.xpack.rollup',
'stack_stats.xpack.security',
'stack_stats.xpack.sql',
'stack_stats.xpack.watcher',
'timestamp',
'version'
];
expect(actual).to.eql(expected);

View file

@ -160,8 +160,8 @@ export default function ({ getService, getPageObjects }) {
expect(smallVennTerm1).to.be('5');
expect(smallVennTerm12).to.be(' (5) ');
expect(smallVennTerm2).to.be('21');
expect(vennEllipse1).to.eql({ "cx": "3.8470077339232853", "cy": "2.5854414729132054", "rx": "1.2615662610100802" });
expect(vennEllipse2).to.eql({ "cx": "5.170882945826411", "cy": "2.5854414729132054", "rx": "2.5854414729132054" });
expect(vennEllipse1).to.eql({ 'cx': '3.8470077339232853', 'cy': '2.5854414729132054', 'rx': '1.2615662610100802' });
expect(vennEllipse2).to.eql({ 'cx': '5.170882945826411', 'cy': '2.5854414729132054', 'rx': '2.5854414729132054' });
});

View file

@ -24,7 +24,7 @@ export default function ({ getService, getPageObjects }) {
after(async () => {
// turn off collection
const disableCollection = {
"persistent":
'persistent':
{
xpack: {
monitoring: {

View file

@ -35,10 +35,10 @@ export default function ({ getService, getPageObjects }) {
it('should add new role myroleEast', async function () {
await PageObjects.security.addRole('myroleEast', {
elasticsearch: {
"indices": [{
"names": ["dlstest"],
"privileges": ["read", "view_index_metadata"],
"query": "{\"match\": {\"region\": \"EAST\"}}"
'indices': [{
'names': ['dlstest'],
'privileges': ['read', 'view_index_metadata'],
'query': '{"match": {"region": "EAST"}}'
}]
},
kibana: {

View file

@ -29,10 +29,10 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.security.clickElasticsearchRoles();
await PageObjects.security.addRole('viewssnrole', {
elasticsearch: {
"indices": [{
"names": ["flstest"],
"privileges": ["read", "view_index_metadata"],
"field_security": { "grant": ["customer_ssn", "customer_name", "customer_region", "customer_type"] }
'indices': [{
'names': ['flstest'],
'privileges': ['read', 'view_index_metadata'],
'field_security': { 'grant': ['customer_ssn', 'customer_name', 'customer_region', 'customer_type'] }
}]
},
kibana: {
@ -50,10 +50,10 @@ export default function ({ getService, getPageObjects }) {
it('should add new role view_no_ssn_role', async function () {
await PageObjects.security.addRole('view_no_ssn_role', {
elasticsearch: {
"indices": [{
"names": ["flstest"],
"privileges": ["read", "view_index_metadata"],
"field_security": { "grant": ["customer_name", "customer_region", "customer_type"] }
'indices': [{
'names': ['flstest'],
'privileges': ['read', 'view_index_metadata'],
'field_security': { 'grant': ['customer_name', 'customer_region', 'customer_type'] }
}]
},
kibana: {

View file

@ -29,9 +29,9 @@ export default function ({ getService, getPageObjects }) {
global: ['all']
},
elasticsearch: {
"indices": [{
"names": ["logstash-*"],
"privileges": ["read", "view_index_metadata"]
'indices': [{
'names': ['logstash-*'],
'privileges': ['read', 'view_index_metadata']
}]
}
});
@ -42,9 +42,9 @@ export default function ({ getService, getPageObjects }) {
global: ['read']
},
elasticsearch: {
"indices": [{
"names": ["logstash-*"],
"privileges": ["read", "view_index_metadata"]
'indices': [{
'names': ['logstash-*'],
'privileges': ['read', 'view_index_metadata']
}]
}
});

View file

@ -33,9 +33,9 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.security.clickElasticsearchRoles();
await PageObjects.security.addRole('logstash_reader', {
elasticsearch: {
"indices": [{
"names": ["logstash-*"],
"privileges": ["read", "view_index_metadata"]
'indices': [{
'names': ['logstash-*'],
'privileges': ['read', 'view_index_metadata']
}]
},
kibana: {

View file

@ -7,9 +7,9 @@
import expect from 'expect.js';
import { indexBy } from 'lodash';
const watchID = "watchID";
const watchName = "watch Name";
const updatedName = "updatedName";
const watchID = 'watchID';
const watchName = 'watch Name';
const updatedName = 'updatedName';
export default function ({ getService, getPageObjects }) {
const browser = getService('browser');
const testSubjects = getService('testSubjects');
@ -33,7 +33,7 @@ export default function ({ getService, getPageObjects }) {
it('should prompt user to check to see if you can override a watch with a sameID', async () => {
await PageObjects.watcher.createWatch(watchID, updatedName);
const modal = await testSubjects.find("confirmModalBodyText");
const modal = await testSubjects.find('confirmModalBodyText');
const modalText = await modal.getVisibleText();
expect(modalText).to.be(`Watch with ID "${watchID}" (name: "${watchName}") already exists. Do you want to overwrite it?`);
await testSubjects.click('confirmModalConfirmButton');
@ -48,7 +48,7 @@ export default function ({ getService, getPageObjects }) {
log.debug(watchList);
expect(watchList.watchID.name).to.eql([updatedName]);
await PageObjects.watcher.deleteWatch(watchID);
const modal = await testSubjects.find("confirmModalBodyText");
const modal = await testSubjects.find('confirmModalBodyText');
const modalText = await modal.getVisibleText();
expect(modalText).to.be('This will permanently delete 1 Watch. Are you sure?');
await testSubjects.click('confirmModalConfirmButton');

View file

@ -335,8 +335,8 @@ export function SecurityPageProvider({ getService, getPageObjects }) {
}
async selectRole(role) {
const dropdown = await testSubjects.find("userFormRolesDropdown");
const input = await dropdown.findByCssSelector("input");
const dropdown = await testSubjects.find('userFormRolesDropdown');
const input = await dropdown.findByCssSelector('input');
await input.type(role);
await testSubjects.click(`roleOption-${role}`);
await testSubjects.click('comboBoxToggleListButton');

View file

@ -33,7 +33,7 @@ export function WatcherPageProvider({ getPageObjects, getService }) {
async getWatch(watchID) {
const watchRow = await testSubjects.find(`watchRow-${watchID}`);
const text = await watchRow.getVisibleText();
const columns = text.split("\n");
const columns = text.split('\n');
return {
id: columns[0],
name: columns[1]

View file

@ -7,7 +7,7 @@
import { range } from 'lodash';
const generateVisibleTextString = text => {
return text.split("\n").join(' | ');
return text.split('\n').join(' | ');
};
const classificationsAndTooltipsReducer = (classifications, tooltips) => {

View file

@ -5,7 +5,7 @@
*/
import expect from 'expect.js';
import * as GenerationUrls from "./generation_urls";
import * as GenerationUrls from './generation_urls';
export default function ({ getService }) {
const esArchiver = getService('esArchiver');

View file

@ -39,9 +39,9 @@ export default function ({ getService }) {
refresh: true,
body: {
query: {
"simple_query_string": {
'simple_query_string': {
query: REINDEX_OP_TYPE,
fields: ["type"]
fields: ['type']
}
}
}