conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
$scope.indexPattern = $route.current.locals.selectedEntity;
docTitle.change($scope.indexPattern.id);
const otherIds = _.without($route.current.locals.indexPatternIds, $scope.indexPattern.id);
=======
$scope.indexPattern = $route.current.locals.indexPattern;
docTitle.change($scope.indexPattern.title);
const otherPatterns = _.filter($route.current.locals.indexPatterns, pattern => {
return pattern.id !== $scope.indexPattern.id;
});
>>>>>>>
$scope.indexPattern = $route.current.locals.selectedEntity;
docTitle.change($scope.indexPattern.id);
const otherIds = _.without($route.current.locals.indexPatternIds, $scope.indexPattern.id);
const otherPatterns = _.filter($route.current.locals.indexPatterns, pattern => {
return pattern.id !== $scope.indexPattern.id;
}); |
<<<<<<<
kibi_version: pkg.kibi_version, // kibi: added to manage kibi version
kibi_kibana_announcement: pkg.kibi_kibana_announcement, // kibi: added by kibi
=======
branch: pkg.branch,
>>>>>>>
kibi_version: pkg.kibi_version, // kibi: added to manage kibi version
kibi_kibana_announcement: pkg.kibi_kibana_announcement, // kibi: added by kibi
branch: pkg.branch, |
<<<<<<<
kbnUrl, createNotifier, config, $timeout, Private, savedVisualizations, safeConfirm) {
=======
kbnUrl, Notifier, config, $timeout, Private, savedVisualizations, confirmModal) {
>>>>>>>
kbnUrl, createNotifier, config, $timeout, Private, savedVisualizations, confirmModal) {
<<<<<<<
const notify = createNotifier({
=======
const notify = new Notifier({
>>>>>>>
const notify = createNotifier({
<<<<<<<
const title = savedSheet.title;
safeConfirm('Are you sure you want to delete the sheet ' + title + ' ?').then(function () {
=======
const title = savedSheet.title;
function doDelete() {
>>>>>>>
const title = savedSheet.title;
function doDelete() { |
<<<<<<<
import { saveAs } from '@spalger/filesaver';
import { filter, each, extend, find, flattenDeep, partialRight, pick, pluck, sortBy } from 'lodash';
=======
import { saveAs } from '@elastic/filesaver';
import { find, flattenDeep, pluck, sortBy } from 'lodash';
>>>>>>>
import { saveAs } from '@elastic/filesaver';
import { find, flattenDeep, pluck, sortBy, partialRight, pick, filter } from 'lodash';
<<<<<<<
.directive('kbnManagementObjects', function (kbnIndex, createNotifier, Private, kbnUrl, Promise, confirmModal) {
// kibi: all below dependencies added by kibi to improve import/export and delete operations
const cache = Private(CacheProvider);
const deleteHelper = Private(DeleteHelperFactory);
const refreshKibanaIndex = Private(RefreshKibanaIndex);
const importExportHelper = Private(ImportExportProvider);
// kibi: end
=======
.directive('kbnManagementObjects', function (kbnIndex, Notifier, Private, kbnUrl, Promise, confirmModal) {
const savedObjectsClient = Private(SavedObjectsClientProvider);
>>>>>>>
.directive('kbnManagementObjects', function (kbnIndex, createNotifier, Private, kbnUrl, Promise, confirmModal) {
// kibi: all below dependencies added by kibi to improve import/export and delete operations
const cache = Private(CacheProvider);
const deleteHelper = Private(DeleteHelperFactory);
const importExportHelper = Private(ImportExportProvider);
// kibi: end
const savedObjectsClient = Private(SavedObjectsClientProvider);
<<<<<<<
// kibi: replaces esAdmin with savedObjectsAPI
controller: function (kbnVersion, queryEngineClient, $scope, $injector, $q, AppState, savedObjectsAPI) {
const notify = createNotifier({ location: 'Saved Objects' });
=======
controller: function ($scope, $injector, $q, AppState) {
const notify = new Notifier({ location: 'Saved Objects' });
>>>>>>>
// kibi: replaces esAdmin with savedObjectsAPI
// kibi: added savedObjectsAPI, kbnVersion, queryEngineClient
controller: function ($scope, $injector, $q, AppState, savedObjectsAPI, kbnVersion, queryEngineClient) {
const notify = createNotifier({ location: 'Saved Objects' });
<<<<<<<
.then((results) => {
// kibi: add extra objects to the export
return importExportHelper.addExtraObjectForExportAll(results);
})
.then((results) => {
retrieveAndExportDocs(flattenDeep(results));
})
.catch(notify.error);
};
=======
.then(results => saveToFile(flattenDeep(results)))
.catch(error => notify.error(error));
>>>>>>>
.then((results) => {
// kibi: add extra objects to the export
return importExportHelper.addExtraObjectForExportAll(results);
})
.then((results) => {
retrieveAndExportDocs(flattenDeep(results));
})
.catch(notify.error);
};
<<<<<<<
.then((overwriteAll) => {
// kibi: change the import to sequential to solve the dependency problem between objects
// as visualisations could depend on searches
// lets order the export to make sure that searches comes before visualisations
// then also import object sequentially to avoid errors
return importExportHelper.importDocuments(docs, $scope.services, notify, overwriteAll)
.then(refreshKibanaIndex)
.then(() => queryEngineClient.clearCache()) // kibi: to clear backend cache
.then(importExportHelper.reloadQueries) // kibi: to clear backend cache
.then(refreshData)
.catch(notify.error);
});
};
=======
.then((overwriteAll) => {
function importDocument(doc) {
const { service } = find($scope.services, { type: doc._type }) || {};
if (!service) {
const msg = `Skipped import of "${doc._source.title}" (${doc._id})`;
const reason = `Invalid type: "${doc._type}"`;
notify.warning(`${msg}, ${reason}`, {
lifetime: 0,
});
return;
}
return service.get()
.then(function (obj) {
obj.id = doc._id;
return obj.applyESResp(doc)
.then(() => {
return obj.save({ confirmOverwrite : !overwriteAll });
})
.catch((err) => {
// swallow errors here so that the remaining promise chain executes
err.message = `Importing ${obj.title} (${obj.id}) failed: ${err.message}`;
notify.error(err);
});
});
}
function groupByType(docs) {
const defaultDocTypes = {
searches: [],
other: [],
};
return docs.reduce((types, doc) => {
switch (doc._type) {
case 'search':
types.searches.push(doc);
break;
default:
types.other.push(doc);
}
return types;
}, defaultDocTypes);
}
const docTypes = groupByType(docs);
return Promise.map(docTypes.searches, importDocument)
.then(() => Promise.map(docTypes.other, importDocument))
.then(refreshData)
.catch(notify.error);
});
};
>>>>>>>
.then((overwriteAll) => {
// kibi: change the import to sequential to solve the dependency problem between objects
// as visualisations could depend on searches
// lets order the export to make sure that searches comes before visualisations
// then also import object sequentially to avoid errors
return importExportHelper.importDocuments(docs, $scope.services, notify, overwriteAll)
.then(() => queryEngineClient.clearCache()) // kibi: to clear backend cache
.then(importExportHelper.reloadQueries) // kibi: to clear backend cache
.then(refreshData)
.catch(notify.error);
});
}; |
<<<<<<<
log(...args) {
console.log(moment().format('HH:mm:ss.SSS') + ':', util.format(...args));
=======
try(block) {
return this.tryForTime(defaultFindTimeout, block);
},
log: function log(logString) {
console.log(moment().format('HH:mm:ss.SSS') + ': ' + logString);
>>>>>>>
try(block) {
return this.tryForTime(defaultFindTimeout, block);
},
log(...args) {
console.log(moment().format('HH:mm:ss.SSS') + ':', util.format(...args)); |
<<<<<<<
{ name: 'bytes', type: 'number', indexed: true, analyzed: true, count: 10 },
{ name: 'ssl', type: 'boolean', indexed: true, analyzed: true, count: 20 },
{ name: '@timestamp', type: 'date', indexed: true, analyzed: true, count: 30 },
{ name: 'time', type: 'date', indexed: true, analyzed: true, count: 30 },
{ name: '@tags', type: 'string', indexed: true, analyzed: true },
{ name: 'utc_time', type: 'date', indexed: true, analyzed: true },
{ name: 'phpmemory', type: 'number', indexed: true, analyzed: true },
{ name: 'ip', type: 'ip', indexed: true, analyzed: true },
{ name: 'request_body', type: 'attachment', indexed: true, analyzed: true },
{ name: 'point', type: 'geo_point', indexed: true, analyzed: true },
{ name: 'area', type: 'geo_shape', indexed: true, analyzed: true },
{ name: 'extension', type: 'string', indexed: true, analyzed: true },
{ name: 'machine.os', type: 'string', indexed: true, analyzed: true },
{ name: 'geo.src', type: 'string', indexed: true, analyzed: true },
{ name: '_type', type: 'string', indexed: true, analyzed: true },
{ name: 'custom_user_field', type: 'conflict', indexed: false, analyzed: false },
{ name: 'script string', type: 'string', scripted: true, script: '\'i am a string\''},
{ name: 'script number', type: 'number', scripted: true, script: '1234'},
=======
{ name: 'bytes', type: 'number', indexed: true, analyzed: true, sortable: true, filterable: true, count: 10 },
{ name: 'ssl', type: 'boolean', indexed: true, analyzed: true, sortable: true, filterable: true, count: 20 },
{ name: '@timestamp', type: 'date', indexed: true, analyzed: true, sortable: true, filterable: true, count: 30 },
{ name: 'time', type: 'date', indexed: true, analyzed: true, sortable: true, filterable: true, count: 30 },
{ name: 'utc_time', type: 'date', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'phpmemory', type: 'number', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'ip', type: 'ip', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'request_body', type: 'attachment', indexed: true, analyzed: true, sortable: false, filterable: true },
{ name: 'point', type: 'geo_point', indexed: true, analyzed: true, sortable: false, filterable: false },
{ name: 'area', type: 'geo_shape', indexed: true, analyzed: true, sortable: true, filterable: false },
{ name: 'hashed', type: 'murmur3', indexed: true, analyzed: true, sortable: false, filterable: false },
{ name: 'extension', type: 'string', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'machine.os', type: 'string', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'geo.src', type: 'string', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: '_type', type: 'string', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: '_id', type: 'string', indexed: false, analyzed: false, sortable: false, filterable: true},
{ name: '_source', type: 'string', indexed: false, analyzed: false, sortable: false, filterable: false},
{ name: 'custom_user_field', type: 'conflict', indexed: false, analyzed: false, sortable: false, filterable: true },
{ name: 'script string', type: 'string', scripted: true, script: '\'i am a string\'', lang: 'expression'},
{ name: 'script number', type: 'number', scripted: true, script: '1234', lang: 'expression'},
>>>>>>>
{ name: 'bytes', type: 'number', indexed: true, analyzed: true, sortable: true, filterable: true, count: 10 },
{ name: 'ssl', type: 'boolean', indexed: true, analyzed: true, sortable: true, filterable: true, count: 20 },
{ name: '@timestamp', type: 'date', indexed: true, analyzed: true, sortable: true, filterable: true, count: 30 },
{ name: 'time', type: 'date', indexed: true, analyzed: true, sortable: true, filterable: true, count: 30 },
{ name: '@tags', type: 'string', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'utc_time', type: 'date', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'phpmemory', type: 'number', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'ip', type: 'ip', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'request_body', type: 'attachment', indexed: true, analyzed: true, sortable: false, filterable: true },
{ name: 'point', type: 'geo_point', indexed: true, analyzed: true, sortable: false, filterable: false },
{ name: 'area', type: 'geo_shape', indexed: true, analyzed: true, sortable: true, filterable: false },
{ name: 'hashed', type: 'murmur3', indexed: true, analyzed: true, sortable: false, filterable: false },
{ name: 'extension', type: 'string', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'machine.os', type: 'string', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: 'geo.src', type: 'string', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: '_type', type: 'string', indexed: true, analyzed: true, sortable: true, filterable: true },
{ name: '_id', type: 'string', indexed: false, analyzed: false, sortable: false, filterable: true},
{ name: '_source', type: 'string', indexed: false, analyzed: false, sortable: false, filterable: false},
{ name: 'custom_user_field', type: 'conflict', indexed: false, analyzed: false, sortable: false, filterable: true },
{ name: 'script string', type: 'string', scripted: true, script: '\'i am a string\'', lang: 'expression'},
{ name: 'script number', type: 'number', scripted: true, script: '1234', lang: 'expression'}, |
<<<<<<<
// Private(require('components/vis_types/line')),
Private(require('components/vis_types/pie'))
=======
Private(require('components/vis_types/line')),
// Private(require('components/vis_types/pie'))
>>>>>>>
Private(require('components/vis_types/line')),
Private(require('components/vis_types/pie')) |
<<<<<<<
import { getDefaultQuery } from 'ui/parse_query';
// kibi: imports
import 'ui/kibi/directives/kibi_param_entity_uri';
import { DoesVisDependsOnSelectedEntitiesProvider } from 'ui/kibi/components/commons/_does_vis_depends_on_selected_entities';
import { HashedItemStoreSingleton } from 'ui/state_management/state_storage';
// kibi: end
=======
import { getDefaultQuery } from 'ui/parse_query';
>>>>>>>
import { getDefaultQuery } from 'ui/parse_query';
// kibi: imports
import 'ui/kibi/directives/kibi_param_entity_uri';
import { DoesVisDependsOnSelectedEntitiesProvider } from 'ui/kibi/components/commons/_does_vis_depends_on_selected_entities';
import { HashedItemStoreSingleton } from 'ui/state_management/state_storage';
// kibi: end
<<<<<<<
function VisEditor($rootScope, $scope, $route, timefilter, AppState, $window, kbnUrl, courier, Private, Promise, kbnBaseUrl,
createNotifier, kibiState) {
=======
function VisEditor($rootScope, $scope, $route, timefilter, AppState, $window, kbnUrl, courier, Private, Promise, kbnBaseUrl) {
>>>>>>>
function VisEditor($rootScope, $scope, $route, timefilter, AppState, $window, kbnUrl, courier, Private, Promise, kbnBaseUrl,
createNotifier, kibiState) {
<<<<<<<
// kibi: disable the save button if the visualization is being edited
disableButton() {
return Boolean($scope.editableVis.dirty);
}
=======
>>>>>>>
// kibi: disable the save button if the visualization is being edited
disableButton() {
return Boolean($scope.editableVis.dirty);
}
<<<<<<<
}, notify.error); // kibi: changed from fatal to error
=======
}, notify.error);
>>>>>>>
}, notify.error); |
<<<<<<<
import Notifier from 'kibie/notify/notifier';
=======
import { Notifier } from 'ui/notify/notifier';
>>>>>>>
import { Notifier } from 'kibie/notify/notifier'; |
<<<<<<<
]
// kibi: removed the kibana original mappings as our one are done by saved_objec_api
=======
],
mappings,
uiSettingDefaults: getUiSettingDefaults(),
>>>>>>>
],
// kibi: removed the kibana original mappings as our one are done by saved_objec_api
uiSettingDefaults: getUiSettingDefaults(), |
<<<<<<<
const { partialRecordUpdate, deleteRecord, reingest } = require('../es/indexer');
const log = require('@cumulus/common/log');
const { moveGranuleFiles } = require('@cumulus/ingest/granule');
async function removeGranuleFromCmr(granuleId, collectionId) {
log.info(`granules.removeGranuleFromCmr ${granuleId}`);
const password = await DefaultProvider.decrypt(process.env.cmr_password);
const cmr = new CMR(
process.env.cmr_provider,
process.env.cmr_client_id,
process.env.cmr_username,
password
);
await cmr.deleteGranule(granuleId, collectionId);
await partialRecordUpdate(
null,
granuleId,
'granule',
{ published: false, cmrLink: null },
collectionId
);
}
=======
const models = require('../models');
>>>>>>>
const models = require('../models');
const { moveGranuleFiles } = require('@cumulus/ingest/granule'); |
<<<<<<<
import AggResponseTabifyResponseWriterProvider from 'ui/agg_response/tabify/_response_writer';
import AggResponseTabifyBucketsProvider from 'ui/agg_response/tabify/_buckets';
export default function tabifyAggResponseProvider(Private, createNotifier) {
const TabbedAggResponseWriter = Private(AggResponseTabifyResponseWriterProvider);
const Buckets = Private(AggResponseTabifyBucketsProvider);
const notify = createNotifier({ location: 'agg_response/tabify' });
=======
import { TabbedAggResponseWriterProvider } from 'ui/agg_response/tabify/_response_writer';
import { AggResponseBucketsProvider } from 'ui/agg_response/tabify/_buckets';
export function AggResponseTabifyProvider(Private, Notifier) {
const TabbedAggResponseWriter = Private(TabbedAggResponseWriterProvider);
const Buckets = Private(AggResponseBucketsProvider);
const notify = new Notifier({ location: 'agg_response/tabify' });
>>>>>>>
import { TabbedAggResponseWriterProvider } from 'ui/agg_response/tabify/_response_writer';
import { AggResponseBucketsProvider } from 'ui/agg_response/tabify/_buckets';
export function AggResponseTabifyProvider(Private, createNotifier) {
const TabbedAggResponseWriter = Private(TabbedAggResponseWriterProvider);
const Buckets = Private(AggResponseBucketsProvider);
const notify = createNotifier({ location: 'agg_response/tabify' }); |
<<<<<<<
const collectionConfigStore =
new CollectionConfigStore(event.config.internalBucket, event.config.stackName);
await Promise.all( // eslint-disable-line function-paren-newline
granules.map(async (granule) => {
const collectionConfig = await collectionConfigStore.get(granule.dataType);
return enqueueGranuleIngestMessage(
granule,
event.config.queueUrl,
event.config.granuleIngestMessageTemplateUri,
event.config.provider,
collectionConfig,
event.input.pdr
);
}));
=======
const executionArns = await Promise.all(granules.map((granule) => enqueueGranuleIngestMessage(
granule,
event.config.queueUrl,
event.config.granuleIngestMessageTemplateUri,
event.config.provider,
event.config.collection,
event.input.pdr
)));
>>>>>>>
const collectionConfigStore =
new CollectionConfigStore(event.config.internalBucket, event.config.stackName);
const executionArns = await Promise.all( // eslint-disable-line function-paren-newline
granules.map(async (granule) => {
const collectionConfig = await collectionConfigStore.get(granule.dataType);
return enqueueGranuleIngestMessage(
granule,
event.config.queueUrl,
event.config.granuleIngestMessageTemplateUri,
event.config.provider,
collectionConfig,
event.input.pdr
);
})); |
<<<<<<<
// kibi: timelion-sheet saved object via savedObjectsAPI
import CacheProvider from 'ui/kibi/helpers/cache_helper';
=======
import { savedObjectManagementRegistry } from 'plugins/kibana/management/saved_object_registry';
>>>>>>>
// kibi: timelion-sheet saved object via savedObjectsAPI
import CacheProvider from 'ui/kibi/helpers/cache_helper';
import { savedObjectManagementRegistry } from 'plugins/kibana/management/saved_object_registry'; |
<<<<<<<
let _ = require('lodash');
let sinon = require('auto-release-sinon');
let expect = require('expect.js');
let ngMock = require('ngMock');
let initialDocTitle;
let MAIN_TITLE = 'Kibana 4';
=======
let initialDocTitle;
let MAIN_TITLE = 'Kibana 4';
>>>>>>>
let initialDocTitle;
const MAIN_TITLE = 'Kibana 4';
<<<<<<<
let getActiveTabStub;
beforeEach(function () {
getActiveTabStub = sinon.stub(require('ui/chrome'), 'getActiveTab');
});
=======
>>>>>>> |
<<<<<<<
import angular from 'angular';
=======
>>>>>>> |
<<<<<<<
define(function (require) {
return function transformMappingIntoFields(Private, kbnIndex, config) {
let _ = require('lodash');
let mapField = Private(require('ui/index_patterns/_map_field'));
/**
* Convert the ES response into the simple map for fields to
* mappings which we will cache
*
* @param {object} response - complex, excessively nested
* object returned from ES
* @return {object} - simple object that works for all of kibana
* use-cases
*/
return function (response) {
let fields = {};
_.each(response, function (index, indexName) {
if (indexName === kbnIndex) return;
_.each(index.mappings, function (mappings) {
_.each(mappings, function (field, name) {
let keys = Object.keys(field.mapping);
if (keys.length === 0 || (name[0] === '_') && !_.contains(config.get('metaFields'), name)) return;
let mapping = mapField(field, name);
if (fields[name]) {
if (fields[name].type !== mapping.type) {
// conflict fields are not available for much except showing in the discover table
mapping.type = 'conflict';
mapping.indexed = false;
}
=======
import _ from 'lodash';
import IndexPatternsMapFieldProvider from 'ui/index_patterns/_map_field';
import { ConflictTracker } from 'ui/index_patterns/_conflict_tracker';
export default function transformMappingIntoFields(Private, kbnIndex, config) {
let mapField = Private(IndexPatternsMapFieldProvider);
/**
* Convert the ES response into the simple map for fields to
* mappings which we will cache
*
* @param {object} response - complex, excessively nested
* object returned from ES
* @return {object} - simple object that works for all of kibana
* use-cases
*/
return function (response) {
let fields = {};
const conflictTracker = new ConflictTracker();
_.each(response, function (index, indexName) {
if (indexName === kbnIndex) return;
_.each(index.mappings, function (mappings) {
_.each(mappings, function (field, name) {
let keys = Object.keys(field.mapping);
if (keys.length === 0 || (name[0] === '_') && !_.contains(config.get('metaFields'), name)) return;
let mapping = mapField(field, name);
// track the name, type and index for every field encountered so that the source
// of conflicts can be described later
conflictTracker.trackField(name, mapping.type, indexName);
if (fields[name]) {
if (fields[name].type !== mapping.type) {
// conflict fields are not available for much except showing in the discover table
// overwrite the entire mapping object to reset all fields
fields[name] = { type: 'conflict' };
>>>>>>>
import _ from 'lodash';
import IndexPatternsMapFieldProvider from 'ui/index_patterns/_map_field';
import { ConflictTracker } from 'ui/index_patterns/_conflict_tracker';
export default function transformMappingIntoFields(Private, kbnIndex, config) {
const mapField = Private(IndexPatternsMapFieldProvider);
/**
* Convert the ES response into the simple map for fields to
* mappings which we will cache
*
* @param {object} response - complex, excessively nested
* object returned from ES
* @return {object} - simple object that works for all of kibana
* use-cases
*/
return function (response) {
const fields = {};
const conflictTracker = new ConflictTracker();
_.each(response, function (index, indexName) {
if (indexName === kbnIndex) return;
_.each(index.mappings, function (mappings) {
_.each(mappings, function (field, name) {
const keys = Object.keys(field.mapping);
if (keys.length === 0 || (name[0] === '_') && !_.contains(config.get('metaFields'), name)) return;
const mapping = mapField(field, name);
// track the name, type and index for every field encountered so that the source
// of conflicts can be described later
conflictTracker.trackField(name, mapping.type, indexName);
if (fields[name]) {
if (fields[name].type !== mapping.type) {
// conflict fields are not available for much except showing in the discover table
// overwrite the entire mapping object to reset all fields
fields[name] = { type: 'conflict' };
<<<<<<<
let field = { mapping: {} };
field.mapping[meta] = {};
fields[meta] = mapField(field, meta);
});
=======
let field = { mapping: {} };
field.mapping[meta] = {};
fields[meta] = mapField(field, meta);
});
>>>>>>>
const field = { mapping: {} };
field.mapping[meta] = {};
fields[meta] = mapField(field, meta);
}); |
<<<<<<<
},
// kibi: added by kibi
'kibi:awesomeDemoMode' : {
value: false,
description: 'Set to true to suppress all warnings and errors'
},
'kibi:timePrecision' : {
type: 'string',
value: 's',
description: 'Set to generate time filters with certain precision. Possible values are: s, m, h, d, w, M, y'
},
'kibi:zoom' : {
value: 1.0,
description: 'Set the zoom level for the whole page. Good if the default size is too big for you. Does not work in Firefox.'
},
'kibi:relationalPanel': {
value: false,
description: 'Display the Relational panel in the dashboard tab'
},
'kibi:relations': {
type: 'json',
value: '{ "relationsIndices": [], "relationsDashboards": [], "version": 2 }',
description: 'Relations between index patterns and dashboards'
},
'kibi:panel_vertical_size': {
type: 'number',
value: 3,
description: 'Set to change the default vertical panel size.',
validator: 'positiveIntegerValidator'
},
'kibi:vertical_grid_resolution': {
type: 'number',
value: 100,
description: 'Set to change vertical grid resolution.',
validator: 'positiveIntegerValidator'
},
'kibi:enableAllDashboardsCounts' : {
value: true,
description: 'Enable counts on all dashboards.'
},
'kibi:enableAllRelBtnCounts' : {
value: true,
description: 'Enable counts on all relational buttons.'
}
// kibi: end
};
// kibi: enterprise options
const enterpriseOptions = {
'kibi:shieldAuthorizationWarning': {
value: true,
description: 'Set to true to show all authorization warnings'
},
'kibi:graphUseWebGl' : {
value: true,
description: 'Set to false to disable WebGL rendering'
},
'kibi:graphUseFiltersFromDashboards' : {
value: false,
description: 'Set to true to use filters from dashboards on expansion'
},
'kibi:graphExpansionLimit' : {
value: 500,
description: 'Limit the number of elements to retrieve during the graph expansion'
},
'kibi:graphRelationFetchLimit' : {
value: 2500,
description: 'Limit the number of relations to retrieve after the graph expansion'
},
'kibi:graphMaxConcurrentCalls' : {
value: 15,
description: 'Limit the number of concurrent calls done by the Graph Browser'
}
=======
},
'context:defaultSize': {
value: 5,
description: 'The number of surrounding entries to show in the context view',
},
'context:step': {
value: 5,
description: 'The step size to increment or decrement the context size by',
},
>>>>>>>
},
'context:defaultSize': {
value: 5,
description: 'The number of surrounding entries to show in the context view',
},
'context:step': {
value: 5,
description: 'The step size to increment or decrement the context size by',
},
// kibi: kibi options
'kibi:awesomeDemoMode' : {
value: false,
description: 'Set to true to suppress all warnings and errors'
},
'kibi:timePrecision' : {
type: 'string',
value: 's',
description: 'Set to generate time filters with certain precision. Possible values are: s, m, h, d, w, M, y'
},
'kibi:zoom' : {
value: 1.0,
description: 'Set the zoom level for the whole page. Good if the default size is too big for you. Does not work in Firefox.'
},
'kibi:relationalPanel': {
value: false,
description: 'Display the Relational panel in the dashboard tab'
},
'kibi:relations': {
type: 'json',
value: '{ "relationsIndices": [], "relationsDashboards": [], "version": 2 }',
description: 'Relations between index patterns and dashboards'
},
'kibi:panel_vertical_size': {
type: 'number',
value: 3,
description: 'Set to change the default vertical panel size.',
validator: 'positiveIntegerValidator'
},
'kibi:vertical_grid_resolution': {
type: 'number',
value: 100,
description: 'Set to change vertical grid resolution.',
validator: 'positiveIntegerValidator'
},
'kibi:enableAllDashboardsCounts' : {
value: true,
description: 'Enable counts on all dashboards.'
},
'kibi:enableAllRelBtnCounts' : {
value: true,
description: 'Enable counts on all relational buttons.'
}
// kibi: end
};
// kibi: enterprise options
const enterpriseOptions = {
'kibi:shieldAuthorizationWarning': {
value: true,
description: 'Set to true to show all authorization warnings'
},
'kibi:graphUseWebGl' : {
value: true,
description: 'Set to false to disable WebGL rendering'
},
'kibi:graphUseFiltersFromDashboards' : {
value: false,
description: 'Set to true to use filters from dashboards on expansion'
},
'kibi:graphExpansionLimit' : {
value: 500,
description: 'Limit the number of elements to retrieve during the graph expansion'
},
'kibi:graphRelationFetchLimit' : {
value: 2500,
description: 'Limit the number of relations to retrieve after the graph expansion'
},
'kibi:graphMaxConcurrentCalls' : {
value: 15,
description: 'Limit the number of concurrent calls done by the Graph Browser'
} |
<<<<<<<
=======
// need to add reference to resize function on toggle
self.vis.resize();
>>>>>>>
// need to add reference to resize function on toggle
self.vis.resize(); |
<<<<<<<
interpolates: ['linear', 'smooth'],
=======
scales: ['linear', 'log', 'square root'],
>>>>>>>
interpolates: ['linear', 'smooth'],
scales: ['linear', 'log', 'square root'], |
<<<<<<<
.directive('visEditorAggParams', function ($compile, $parse, Private, createNotifier, $filter) {
var _ = require('lodash');
var $ = require('jquery');
var aggTypes = Private(require('ui/agg_types/index'));
var aggSelectHtml = require('plugins/kibana/visualize/editor/agg_select.html');
var advancedToggleHtml = require('plugins/kibana/visualize/editor/advanced_toggle.html');
=======
.directive('visEditorAggParams', function ($compile, $parse, Private, Notifier, $filter) {
const _ = require('lodash');
const $ = require('jquery');
const aggTypes = Private(require('ui/agg_types/index'));
const aggSelectHtml = require('plugins/kibana/visualize/editor/agg_select.html');
const advancedToggleHtml = require('plugins/kibana/visualize/editor/advanced_toggle.html');
>>>>>>>
.directive('visEditorAggParams', function ($compile, $parse, Private, createNotifier, $filter) {
const _ = require('lodash');
const $ = require('jquery');
const aggTypes = Private(require('ui/agg_types/index'));
const aggSelectHtml = require('plugins/kibana/visualize/editor/agg_select.html');
const advancedToggleHtml = require('plugins/kibana/visualize/editor/advanced_toggle.html');
<<<<<<<
var notify = createNotifier({
=======
const notify = new Notifier({
>>>>>>>
const notify = createNotifier({ |
<<<<<<<
'[email protected]': ['MIT'],
'[email protected]': ['BSD'],
'[email protected]': ['MIT']
=======
'[email protected]': ['BSD'],
'[email protected]': ['BSD-3-Clause', 'MIT'],
'[email protected]': ['BSD-3-Clause', 'MIT']
>>>>>>>
'[email protected]': ['MIT'],
'[email protected]': ['BSD'],
'[email protected]': ['MIT'],
'[email protected]': ['BSD-3-Clause', 'MIT'],
'[email protected]': ['BSD-3-Clause', 'MIT'] |
<<<<<<<
var BucketAggType = Private(AggTypesBucketsBucketAggTypeProvider);
var TimeBuckets = Private(TimeBucketsProvider);
var createFilter = Private(AggTypesBucketsCreateFilterDateHistogramProvider);
var intervalOptions = Private(AggTypesBucketsIntervalOptionsProvider);
=======
let BucketAggType = Private(AggTypesBucketsBucketAggTypeProvider);
let TimeBuckets = Private(TimeBucketsProvider);
let createFilter = Private(AggTypesBucketsCreateFilterDateHistogramProvider);
let intervalOptions = Private(AggTypesBucketsIntervalOptionsProvider);
let configDefaults = Private(ConfigDefaultsProvider);
>>>>>>>
let BucketAggType = Private(AggTypesBucketsBucketAggTypeProvider);
let TimeBuckets = Private(TimeBucketsProvider);
let createFilter = Private(AggTypesBucketsCreateFilterDateHistogramProvider);
let intervalOptions = Private(AggTypesBucketsIntervalOptionsProvider);
<<<<<<<
var isDefaultTimezone = config.isDefault('dateFormat:tz');
if (isDefaultTimezone) {
output.params.time_zone = detectedTimezone || tzOffset;
} else {
output.params.time_zone = config.get('dateFormat:tz');
}
=======
let isDefaultTimezone = config.get('dateFormat:tz') === configDefaults['dateFormat:tz'].value;
output.params.time_zone = isDefaultTimezone ?
(detectedTimezone || tzOffset) :
config.get('dateFormat:tz');
>>>>>>>
let isDefaultTimezone = config.isDefault('dateFormat:tz');
if (isDefaultTimezone) {
output.params.time_zone = detectedTimezone || tzOffset;
} else {
output.params.time_zone = config.get('dateFormat:tz');
} |
<<<<<<<
import DoesVisDependsOnSelectedEntitiesProvider from 'ui/kibi/components/commons/_does_vis_depends_on_selected_entities';
=======
import { savedObjectManagementRegistry } from 'plugins/kibana/management/saved_object_registry';
>>>>>>>
import DoesVisDependsOnSelectedEntitiesProvider from 'ui/kibi/components/commons/_does_vis_depends_on_selected_entities';
import { savedObjectManagementRegistry } from 'plugins/kibana/management/saved_object_registry'; |
<<<<<<<
aws: { s3, s3ObjectExists },
=======
aws: {
headObject,
parseS3Uri,
s3,
s3ObjectExists
},
stringUtils: { globalReplace },
testUtils: {
randomString
}
>>>>>>>
api: apiTestUtils,
buildAndExecuteWorkflow,
addProviders,
cleanupProviders,
addCollections,
cleanupCollections,
LambdaStep
} = require('@cumulus/integration-tests');
const { Execution } = require('@cumulus/api/models');
const {
aws: {
headObject,
parseS3Uri,
s3,
s3ObjectExists
},
testUtils: {
randomString
}
<<<<<<<
=======
>>>>>>>
const {
aws: {
headObject,
parseS3Uri,
s3,
s3ObjectExists
},
testUtils: {
randomString
}
} = require('@cumulus/common');
<<<<<<<
const { setupTestGranuleForIngest, loadFileWithUpdatedGranuleIdAndPath } = require('../helpers/granuleUtils');
=======
const {
setupTestGranuleForIngest,
loadFileWithUpdatedGranuleId
} = require('../helpers/granuleUtils');
>>>>>>>
const {
setupTestGranuleForIngest,
loadFileWithUpdatedGranuleIdAndPath
} = require('../helpers/granuleUtils');
<<<<<<<
const taskName = 'SyncGranule';
const granuleRegex = '^MOD09GQ\\.A[\\d]{7}\\.[\\w]{6}\\.006\\.[\\d]{13}$';
const testDataGranuleId = 'MOD09GQ.A2016358.h13v04.006.2016360104606';
const defaultDataFolder = 'cumulus-test-data/pdrs';
=======
const workflowName = 'SyncGranule';
const granuleRegex = '^MOD09GQ\\.A[\\d]{7}\\.[\\w]{6}\\.006\\.[\\d]{13}$';
const testDataGranuleId = 'MOD09GQ.A2016358.h13v04.006.2016360104606';
>>>>>>>
const workflowName = 'SyncGranuleDuplicateSkipTest';
const granuleRegex = '^MOD09GQ\\.A[\\d]{7}\\.[\\w]{6}\\.006\\.[\\d]{13}$';
const testDataGranuleId = 'MOD09GQ.A2016358.h13v04.006.2016360104606';
const defaultDataFolder = 'cumulus-test-data/pdrs';
<<<<<<<
describe('The Sync Granules workflow', () => {
const testId = createTimestampedTestId(config.stackName, 'SyncGranuleSuccess');
const testSuffix = `_${testId}`;
const testDataFolder = createTestDataPath(testId);
const providersDir = './data/providers/s3/';
const collectionsDir = './data/collections/s3_MOD09GQ_006';
const collection = { name: `MOD09GQ${testSuffix}`, version: '006' };
const provider = { id: `s3_provider${testSuffix}` };
=======
describe('When the Sync Granules workflow is configured to overwrite data with duplicate filenames', () => {
const testDataFolder = timestampedTestDataPrefix(`${config.stackName}-SyncGranuleSuccess`);
>>>>>>>
describe('When the Sync Granules workflow is configured to overwrite data with duplicate filenames', () => {
const testId = createTimestampedTestId(config.stackName, 'SyncGranuleSuccess');
const testSuffix = `_${testId}`;
const testDataFolder = createTestDataPath(testId);
const providersDir = './data/providers/s3/';
const collectionsDir = './data/collections/s3_MOD09GQ_006';
const collection = { name: `MOD09GQ${testSuffix}`, version: '006' };
const provider = { id: `s3_provider${testSuffix}` };
<<<<<<<
let workflowExecution = null;
=======
const collection = { name: 'MOD09GQ', version: '006' };
const provider = { id: 's3_provider' };
let workflowExecution;
>>>>>>>
let workflowExecution;
<<<<<<<
// populate collections, providers and test data
await Promise.all([
uploadTestDataToBucket(config.bucket, s3data, testDataFolder),
addCollections(config.stackName, config.bucket, collectionsDir, testSuffix),
addProviders(config.stackName, config.bucket, providersDir, config.bucket, testSuffix)
]);
=======
// upload test data
await uploadTestDataToBucket(config.bucket, s3data, testDataFolder);
>>>>>>>
// populate collections, providers and test data
await Promise.all([
uploadTestDataToBucket(config.bucket, s3data, testDataFolder),
addCollections(config.stackName, config.bucket, collectionsDir, testSuffix),
addProviders(config.stackName, config.bucket, providersDir, config.bucket, testSuffix)
]);
<<<<<<<
// clean up stack state added by test
await Promise.all([
deleteFolder(config.bucket, testDataFolder),
cleanupCollections(config.stackName, config.bucket, collectionsDir, testSuffix),
cleanupProviders(config.stackName, config.bucket, providersDir, testSuffix)
]);
=======
// Remove the granule files added for the test
await deleteFolder(config.bucket, testDataFolder);
// delete ingested granule
await apiTestUtils.deleteGranule({
prefix: config.stackName,
granuleId: inputPayload.granules[0].granuleId
});
>>>>>>>
// clean up stack state added by test
await Promise.all([
deleteFolder(config.bucket, testDataFolder),
cleanupCollections(config.stackName, config.bucket, collectionsDir, testSuffix),
cleanupProviders(config.stackName, config.bucket, providersDir, testSuffix),
apiTestUtils.deleteGranule({
prefix: config.stackName,
granuleId: inputPayload.granules[0].granuleId
})
]);
<<<<<<<
afterAll(async () => {
await Promise.all([
s3().deleteObject({ Bucket: files[0].bucket, Key: key1 }).promise(),
s3().deleteObject({ Bucket: files[1].bucket, Key: key2 }).promise()
]);
});
=======
>>>>>>> |
<<<<<<<
var _ = require('lodash');
var fieldExcludedFor = require('./kibi_field_excluded_for');
var joinFields = require('ui/kibi/settings/sections/indices/join_fields');
=======
const _ = require('lodash');
>>>>>>>
const _ = require('lodash');
const fieldExcludedFor = require('./kibi_field_excluded_for');
const joinFields = require('ui/kibi/settings/sections/indices/join_fields');
<<<<<<<
.directive('indexedFields', function ($filter, config) {
var templates = {
all: '<i class="fa fa-globe" aria-label="excluded in any visualisation" title="excluded in any visualisation"></i> ',
kibi_graph_browser: '<i class="fa fak-graph" aria-label="excluded in graph browser" title="excluded in graph browser"></i>'
};
var yesTemplate = '<i class="fa fa-check" aria-label="yes"></i>';
var noTemplate = '';
var nameHtml = require('plugins/kibana/settings/sections/indices/_field_name.html');
var typeHtml = require('plugins/kibana/settings/sections/indices/_field_type.html');
var controlsHtml = require('plugins/kibana/settings/sections/indices/_field_controls.html');
var filter = $filter('filter');
=======
.directive('indexedFields', function ($filter) {
const yesTemplate = '<i class="fa fa-check" aria-label="yes"></i>';
const noTemplate = '';
const nameHtml = require('plugins/kibana/settings/sections/indices/_field_name.html');
const typeHtml = require('plugins/kibana/settings/sections/indices/_field_type.html');
const controlsHtml = require('plugins/kibana/settings/sections/indices/_field_controls.html');
const filter = $filter('filter');
>>>>>>>
.directive('indexedFields', function ($filter, config) {
const templates = {
all: '<i class="fa fa-globe" aria-label="excluded in any visualisation" title="excluded in any visualisation"></i> ',
kibi_graph_browser: '<i class="fa fak-graph" aria-label="excluded in graph browser" title="excluded in graph browser"></i>'
};
const yesTemplate = '<i class="fa fa-check" aria-label="yes"></i>';
const noTemplate = '';
const nameHtml = require('plugins/kibana/settings/sections/indices/_field_name.html');
const typeHtml = require('plugins/kibana/settings/sections/indices/_field_type.html');
const controlsHtml = require('plugins/kibana/settings/sections/indices/_field_controls.html');
const filter = $filter('filter');
<<<<<<<
var sourceFiltering = $scope.indexPattern.getSourceFiltering();
var relations = config.get('kibi:relations');
var fields = filter($scope.indexPattern.getNonScriptedFields(), $scope.fieldFilter);
=======
const fields = filter($scope.indexPattern.getNonScriptedFields(), $scope.fieldFilter);
>>>>>>>
const sourceFiltering = $scope.indexPattern.getSourceFiltering();
const relations = config.get('kibi:relations');
const fields = filter($scope.indexPattern.getNonScriptedFields(), $scope.fieldFilter);
<<<<<<<
// kibi: added join field for describing the connected indices
var childScope = _.assign($scope.$new(), {
field: field,
join: joinFields(relations.relationsIndices, $scope.indexPattern.id, field.name)
});
=======
const childScope = _.assign($scope.$new(), { field: field });
>>>>>>>
const childScope = _.assign($scope.$new(), {
field: field,
join: joinFields(relations.relationsIndices, $scope.indexPattern.id, field.name)
}); |
<<<<<<<
let expect = require('expect.js');
let ngMock = require('ngMock');
=======
>>>>>>>
<<<<<<<
let aggConfig = vis.aggs.byTypeName.ip_range[0];
let filter = createFilter(aggConfig, '0.0.0.0-1.1.1.1');
=======
let aggConfig = vis.aggs.byTypeName.ip_range[0];
let filter = createFilter(aggConfig, '0.0.0.0 to 1.1.1.1');
>>>>>>>
const aggConfig = vis.aggs.byTypeName.ip_range[0];
const filter = createFilter(aggConfig, '0.0.0.0 to 1.1.1.1'); |
<<<<<<<
'run:chromeDriver',
=======
'downloadSelenium',
'run:seleniumServer',
'clean:screenshots',
>>>>>>>
'run:chromeDriver',
'clean:screenshots', |
<<<<<<<
var services = Private(require('ui/saved_objects/saved_object_registry')).byLoaderPropertiesName;
var urlHelper = Private(require('ui/kibi/helpers/url_helper'));
=======
let services = Private(require('ui/saved_objects/saved_object_registry')).byLoaderPropertiesName;
>>>>>>>
let services = Private(require('ui/saved_objects/saved_object_registry')).byLoaderPropertiesName;
let urlHelper = Private(require('ui/kibi/helpers/url_helper'));
<<<<<<<
// kibi: variable to store the checkbox state
$scope.kibi = {
onDashboardTab: urlHelper.onDashboardTab(),
basedOnSameSavedSearch: false,
_prevBasedOnSameSavedSearch: false
};
$scope.$watch('kibi.basedOnSameSavedSearch', function () {
filterResults();
});
// kibi: end
var self = this;
=======
let self = this;
>>>>>>>
// kibi: variable to store the checkbox state
$scope.kibi = {
onDashboardTab: urlHelper.onDashboardTab(),
basedOnSameSavedSearch: false,
_prevBasedOnSameSavedSearch: false
};
$scope.$watch('kibi.basedOnSameSavedSearch', function () {
filterResults();
});
// kibi: end
let self = this;
<<<<<<<
var filter = currentFilter;
// kibi: allow to filter visualizations based on the savedsearch associated to a dashboard
var basedOnSameSavedSearch = $scope.kibi.basedOnSameSavedSearch;
if (prevSearch === filter && $scope.kibi._prevBasedOnSameSavedSearch === basedOnSameSavedSearch) return;
=======
let filter = currentFilter;
if (prevSearch === filter) return;
>>>>>>>
let filter = currentFilter;
// kibi: allow to filter visualizations based on the savedsearch associated to a dashboard
let basedOnSameSavedSearch = $scope.kibi.basedOnSameSavedSearch;
if (prevSearch === filter && $scope.kibi._prevBasedOnSameSavedSearch === basedOnSameSavedSearch) return; |
<<<<<<<
var flattenHit;
var indexPattern;
var hit;
var flat;
beforeEach(module('kibana'));
beforeEach(inject(function (Private) {
flattenHit = Private(require('components/index_patterns/_flatten_hit'));
indexPattern = {
fields: {
byName: {
'message': { type: 'string' },
'geo.coordinates': { type: 'geo_point' },
'geo.dest': { type: 'string' },
'geo.src': { type: 'string' },
'bytes': { type: 'number' },
'@timestamp': { type: 'date' },
'team': { type: 'nested' },
'team.name': { type: 'string' },
'team.role': { type: 'string' },
'delta': { type: 'number', scripted: true }
}
=======
var indexPattern = {
fields: {
byName: {
'message': { type: 'string' },
'geo.coordinates': { type: 'geo_point' },
'geo.dest': { type: 'string' },
'geo.src': { type: 'string' },
'bytes': { type: 'number' },
'@timestamp': { type: 'date' },
'team': { type: 'nested' },
'team.name': { type: 'string' },
'team.role': { type: 'string' },
'user': { type: 'conflict' },
'user.name': { type: 'string' },
'user.id': { type: 'conflict' },
'delta': { type: 'number', scripted: true }
>>>>>>>
var flattenHit;
var indexPattern;
var hit;
var flat;
beforeEach(module('kibana'));
beforeEach(inject(function (Private) {
flattenHit = Private(require('components/index_patterns/_flatten_hit'));
indexPattern = {
fields: {
byName: {
'message': { type: 'string' },
'geo.coordinates': { type: 'geo_point' },
'geo.dest': { type: 'string' },
'geo.src': { type: 'string' },
'bytes': { type: 'number' },
'@timestamp': { type: 'date' },
'team': { type: 'nested' },
'team.name': { type: 'string' },
'team.role': { type: 'string' },
'user': { type: 'conflict' },
'user.name': { type: 'string' },
'user.id': { type: 'conflict' },
'delta': { type: 'number', scripted: true }
} |
<<<<<<<
var notify = createNotifier({
=======
let notify = new Notifier({
>>>>>>>
let notify = createNotifier({ |
<<<<<<<
import _ from 'lodash';
import savedObjectRegistry from 'ui/saved_objects/saved_object_registry';
=======
import 'ui/accessibility/kbn_accessible_click';
import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_registry';
>>>>>>>
import _ from 'lodash';
import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_registry';
<<<<<<<
// kibi: imports
import 'ui/kibi/directives/kibi_select'; // added as it is needed by src/plugins/kibana/public/dashboard/partials/save_dashboard.html
import 'ui/kibi/session/siren_session'; // added to make sirenSession service available
import 'ui/filter_bar/join_explanation'; // provides explanations of queries and filters to tooltips
// kibi: end
savedObjectRegistry.register(savedDashboardRegister);
=======
SavedObjectRegistryProvider.register(savedDashboardRegister);
>>>>>>>
// kibi: imports
import 'ui/kibi/directives/kibi_select'; // added as it is needed by src/plugins/kibana/public/dashboard/partials/save_dashboard.html
import 'ui/kibi/session/siren_session'; // added to make sirenSession service available
import 'ui/filter_bar/join_explanation'; // provides explanations of queries and filters to tooltips
// kibi: end
SavedObjectRegistryProvider.register(savedDashboardRegister); |
<<<<<<<
import Notifier from 'kibie/notify/notifier';
import { intersection } from 'lodash';
=======
import Notifier from 'ui/notify/notifier';
>>>>>>>
import Notifier from 'kibie/notify/notifier'; |
<<<<<<<
var notify = createNotifier();
=======
let notify = new Notifier();
>>>>>>>
let notify = createNotifier(); |
<<<<<<<
import ngMock from 'ng_mock';
import CourierDataSourceDocSourceProvider from 'ui/courier/data_source/doc_source';
import CourierFetchRequestDocProvider from 'ui/courier/fetch/request/doc';
=======
import ngMock from 'ngMock';
>>>>>>>
import ngMock from 'ng_mock'; |
<<<<<<<
const self = this;
return self.remote
.findByCssSelector('input[name="dashboards-filter"]')
.click()
.type(dashName.replace('-',' '))
// TODO: KIBI5: restore when the filter is backed by ES
//.then(() => {
//return PageObjects.header.isGlobalLoadingIndicatorHidden();
//})
//.then(() => {
//return PageObjects.common.sleep(1000);
//})
=======
const self = this;
return this.gotoDashboardLandingPage()
.then(function filterDashboard() {
PageObjects.common.debug('Load Saved Dashboard button clicked');
return PageObjects.common.findTestSubject('searchFilter')
.click()
.type(dashName.replace('-',' '));
})
.then(() => {
return PageObjects.header.waitUntilLoadingHasFinished();
})
.then(() => {
return PageObjects.common.sleep(1000);
})
>>>>>>>
const self = this;
return this.gotoDashboardLandingPage()
.then(function filterDashboard() {
PageObjects.common.debug('Load Saved Dashboard button clicked');
return PageObjects.common.findTestSubject('searchFilter')
.click()
.type(dashName.replace('-',' '));
// TODO: KIBI5: restore when the filter is backed by ES
//.then(() => {
//return PageObjects.header.isGlobalLoadingIndicatorHidden();
//})
//.then(() => {
//return PageObjects.common.sleep(1000);
//})
})
.then(() => {
return PageObjects.header.waitUntilLoadingHasFinished();
})
.then(() => {
return PageObjects.common.sleep(1000);
})
<<<<<<<
PageObjects.common.debug(`Loading ${dashName} dashboard`);
return PageObjects.header.isGlobalLoadingIndicatorHidden();
=======
return PageObjects.header.waitUntilLoadingHasFinished();
>>>>>>>
return PageObjects.header.waitUntilLoadingHasFinished(); |
<<<<<<<
module.exports = function (kibana) {
var healthCheck = require('./lib/health_check');
var exposeClient = require('./lib/expose_client');
var createKibanaProxy = require('./lib/create_kibana_proxy');
var createKibiProxy = require('./lib/create_kibi_proxy');
=======
import { trim, trimRight } from 'lodash';
import { methodNotAllowed } from 'boom';
>>>>>>>
import { trim, trimRight } from 'lodash';
import { methodNotAllowed } from 'boom';
<<<<<<<
apiVersion: Joi.string().default('2.0'),
engineVersion: Joi.string().valid('^2.2.0').default('^2.2.0'),
plugins: Joi.array().default([])
=======
apiVersion: string().default('2.0'),
engineVersion: string().valid('^2.3.0').default('^2.3.0')
>>>>>>>
apiVersion: string().default('2.0'),
engineVersion: string().valid('^2.3.0').default('^2.3.0'),
plugins: Joi.array().default([])
<<<<<<<
createKibiProxy(
=======
function noDirectIndex({ path }, reply) {
const requestPath = trimRight(trim(path), '/');
const matchPath = createPath(kibanaIndex);
if (requestPath === matchPath) {
return reply(methodNotAllowed('You cannot modify the primary kibana index through this interface.'));
}
reply.continue();
}
// These routes are actually used to deal with things such as managing
// index patterns and advanced settings, but since hapi treats route
// wildcards as zero-or-more, the routes also match the kibana index
// itself. The client-side kibana code does not deal with creating nor
// destroying the kibana index, so we limit that ability here.
createProxy(
>>>>>>>
function noDirectIndex({ path }, reply) {
const requestPath = trimRight(trim(path), '/');
const matchPath = createPath(kibanaIndex);
if (requestPath === matchPath) {
return reply(methodNotAllowed('You cannot modify the primary kibana index through this interface.'));
}
reply.continue();
}
// These routes are actually used to deal with things such as managing
// index patterns and advanced settings, but since hapi treats route
// wildcards as zero-or-more, the routes also match the kibana index
// itself. The client-side kibana code does not deal with creating nor
// destroying the kibana index, so we limit that ability here.
createKibiProxy( |
<<<<<<<
url: '/elasticsearch/.kibi',
statusCode: 405
});
=======
url: '/elasticsearch/.kibana'
}, 405);
>>>>>>>
url: '/elasticsearch/.kibana'
}, 405);
<<<<<<<
url: '/elasticsearch/.kibi',
statusCode: 405
});
=======
url: '/elasticsearch/.kibana'
}, 405);
>>>>>>>
url: '/elasticsearch/.kibana'
}, 405);
<<<<<<<
url: '/elasticsearch/.kibi',
statusCode: 405
});
=======
url: '/elasticsearch/.kibana'
}, 405);
>>>>>>>
url: '/elasticsearch/.kibana'
}, 405);
<<<<<<<
url: '/elasticsearch/.kibi/_bulk',
payload: '{}',
statusCode: 400
});
=======
url: '/elasticsearch/.kibana/_bulk',
payload: '{}'
}, 400);
>>>>>>>
url: '/elasticsearch/.kibi/_bulk',
payload: '{}'
}, 400); |
<<<<<<<
=======
var statSync = require('fs').statSync;
>>>>>>>
var statSync = require('fs').statSync;
<<<<<<<
var cwd = join(grunt.config.get('build'), 'dist', grunt.config.get('pkg.name'), 'src');
=======
>>>>>>> |
<<<<<<<
define(function (require) {
require('ui/field_format_editor');
require('angular-bootstrap-colorpicker');
require('angular-bootstrap-colorpicker/css/colorpicker.css');
require('ui/modules')
.get('kibana', ['colorpicker.module'])
.directive('fieldEditor', function (Private, $sce) {
let _ = require('lodash');
let fieldFormats = Private(require('ui/registry/field_formats'));
let Field = Private(require('ui/index_patterns/_field'));
let scriptingInfo = $sce.trustAsHtml(require('ui/field_editor/scripting_info.html'));
let scriptingWarning = $sce.trustAsHtml(require('ui/field_editor/scripting_warning.html'));
return {
restrict: 'E',
template: require('ui/field_editor/field_editor.html'),
scope: {
getIndexPattern: '&indexPattern',
getField: '&field'
},
controllerAs: 'editor',
controller: function ($scope, kbnUrl, createNotifier) {
let self = this;
let notify = createNotifier({ location: 'Field Editor' });
self.scriptingInfo = scriptingInfo;
self.scriptingWarning = scriptingWarning;
self.indexPattern = $scope.getIndexPattern();
self.field = shadowCopy($scope.getField());
self.formatParams = self.field.format.params();
// only init on first create
self.creating = !self.indexPattern.fields.byName[self.field.name];
self.selectedFormatId = _.get(self.indexPattern, ['fieldFormatMap', self.field.name, 'type', 'id']);
self.defFormatType = initDefaultFormat();
self.fieldFormatTypes = [self.defFormatType].concat(fieldFormats.byFieldType[self.field.type] || []);
self.cancel = redirectAway;
self.save = function () {
let indexPattern = self.indexPattern;
let fields = indexPattern.fields;
let field = self.field.toActualField();
=======
import 'ui/field_format_editor';
import 'angular-bootstrap-colorpicker';
import 'angular-bootstrap-colorpicker/css/colorpicker.css';
import _ from 'lodash';
import RegistryFieldFormatsProvider from 'ui/registry/field_formats';
import IndexPatternsFieldProvider from 'ui/index_patterns/_field';
import uiModules from 'ui/modules';
import fieldEditorTemplate from 'ui/field_editor/field_editor.html';
import chrome from 'ui/chrome';
import IndexPatternsCastMappingTypeProvider from 'ui/index_patterns/_cast_mapping_type';
import { scriptedFields as docLinks } from '../documentation_links/documentation_links';
import './field_editor.less';
import { GetEnabledScriptingLangsProvider, getSupportedScriptingLangs } from '../scripting_langs';
uiModules
.get('kibana', ['colorpicker.module'])
.directive('fieldEditor', function (Private, $sce) {
let fieldFormats = Private(RegistryFieldFormatsProvider);
let Field = Private(IndexPatternsFieldProvider);
let getEnabledScriptingLangs = Private(GetEnabledScriptingLangsProvider);
const fieldTypesByLang = {
painless: ['number', 'string', 'date', 'boolean'],
expression: ['number'],
default: _.keys(Private(IndexPatternsCastMappingTypeProvider).types.byType)
};
return {
restrict: 'E',
template: fieldEditorTemplate,
scope: {
getIndexPattern: '&indexPattern',
getField: '&field'
},
controllerAs: 'editor',
controller: function ($scope, Notifier, kbnUrl, $http, $q) {
let self = this;
let notify = new Notifier({ location: 'Field Editor' });
self.docLinks = docLinks;
getEnabledScriptingLangs().then((langs) => {
self.scriptingLangs = langs;
if (!_.includes(self.scriptingLangs, self.field.lang)) {
self.field.lang = undefined;
}
});
self.indexPattern = $scope.getIndexPattern();
self.field = shadowCopy($scope.getField());
self.formatParams = self.field.format.params();
self.conflictDescriptionsLength = (self.field.conflictDescriptions) ? Object.keys(self.field.conflictDescriptions).length : 0;
// only init on first create
self.creating = !self.indexPattern.fields.byName[self.field.name];
self.selectedFormatId = _.get(self.indexPattern, ['fieldFormatMap', self.field.name, 'type', 'id']);
self.defFormatType = initDefaultFormat();
self.cancel = redirectAway;
self.save = function () {
let indexPattern = self.indexPattern;
let fields = indexPattern.fields;
let field = self.field.toActualField();
fields.remove({ name: field.name });
fields.push(field);
if (!self.selectedFormatId) {
delete indexPattern.fieldFormatMap[field.name];
} else {
indexPattern.fieldFormatMap[field.name] = self.field.format;
}
>>>>>>>
import 'ui/field_format_editor';
import 'angular-bootstrap-colorpicker';
import 'angular-bootstrap-colorpicker/css/colorpicker.css';
import _ from 'lodash';
import RegistryFieldFormatsProvider from 'ui/registry/field_formats';
import IndexPatternsFieldProvider from 'ui/index_patterns/_field';
import uiModules from 'ui/modules';
import fieldEditorTemplate from 'ui/field_editor/field_editor.html';
import chrome from 'ui/chrome';
import IndexPatternsCastMappingTypeProvider from 'ui/index_patterns/_cast_mapping_type';
import { scriptedFields as docLinks } from '../documentation_links/documentation_links';
import './field_editor.less';
import { GetEnabledScriptingLangsProvider, getSupportedScriptingLangs } from '../scripting_langs';
uiModules
.get('kibana', ['colorpicker.module'])
.directive('fieldEditor', function (Private, $sce) {
const fieldFormats = Private(RegistryFieldFormatsProvider);
const Field = Private(IndexPatternsFieldProvider);
const getEnabledScriptingLangs = Private(GetEnabledScriptingLangsProvider);
const fieldTypesByLang = {
painless: ['number', 'string', 'date', 'boolean'],
expression: ['number'],
default: _.keys(Private(IndexPatternsCastMappingTypeProvider).types.byType)
};
return {
restrict: 'E',
template: fieldEditorTemplate,
scope: {
getIndexPattern: '&indexPattern',
getField: '&field'
},
controllerAs: 'editor',
controller: function ($scope, Notifier, kbnUrl, $http, $q) {
const self = this;
const notify = new Notifier({ location: 'Field Editor' });
self.docLinks = docLinks;
getEnabledScriptingLangs().then((langs) => {
self.scriptingLangs = langs;
if (!_.includes(self.scriptingLangs, self.field.lang)) {
self.field.lang = undefined;
}
});
self.indexPattern = $scope.getIndexPattern();
self.field = shadowCopy($scope.getField());
self.formatParams = self.field.format.params();
self.conflictDescriptionsLength = (self.field.conflictDescriptions) ? Object.keys(self.field.conflictDescriptions).length : 0;
// only init on first create
self.creating = !self.indexPattern.fields.byName[self.field.name];
self.selectedFormatId = _.get(self.indexPattern, ['fieldFormatMap', self.field.name, 'type', 'id']);
self.defFormatType = initDefaultFormat();
self.cancel = redirectAway;
self.save = function () {
const indexPattern = self.indexPattern;
const fields = indexPattern.fields;
const field = self.field.toActualField();
fields.remove({ name: field.name });
fields.push(field);
if (!self.selectedFormatId) {
delete indexPattern.fieldFormatMap[field.name];
} else {
indexPattern.fieldFormatMap[field.name] = self.field.format;
}
<<<<<<<
self.delete = function () {
let indexPattern = self.indexPattern;
let field = self.field;
=======
self.isSupportedLang = function (lang) {
return _.contains(getSupportedScriptingLangs(), lang);
};
>>>>>>>
self.isSupportedLang = function (lang) {
return _.contains(getSupportedScriptingLangs(), lang);
};
<<<<<<<
$scope.$watch('editor.selectedFormatId', function (cur, prev) {
let format = self.field.format;
let changedFormat = cur !== prev;
let missingFormat = cur && (!format || format.type.id !== cur);
=======
if (!changedFormat || !missingFormat) return;
>>>>>>>
if (!changedFormat || !missingFormat) return;
<<<<<<<
function initDefaultFormat() {
let def = Object.create(fieldFormats.getDefaultType(self.field.type));
=======
Object.getOwnPropertyNames(field).forEach(function (prop) {
let desc = Object.getOwnPropertyDescriptor(field, prop);
shadowProps[prop] = {
enumerable: desc.enumerable,
get: function () {
return _.has(changes, prop) ? changes[prop] : field[prop];
},
set: function (v) {
changes[prop] = v;
}
};
});
>>>>>>>
Object.getOwnPropertyNames(field).forEach(function (prop) {
const desc = Object.getOwnPropertyDescriptor(field, prop);
shadowProps[prop] = {
enumerable: desc.enumerable,
get: function () {
return _.has(changes, prop) ? changes[prop] : field[prop];
},
set: function (v) {
changes[prop] = v;
}
};
}); |
<<<<<<<
const templateParams = {
order: 0,
create: true,
name: ingestConfigName,
body: {
template: indexPatternId,
mappings: {
_default_: {
dynamic_templates: [{
string_fields: {
match: '*',
match_mapping_type: 'string',
mapping: {
type: 'string',
index: 'analyzed',
omit_norms: true,
fielddata: {format: 'disabled'},
fields: {
raw: {type: 'string', index: 'not_analyzed', doc_values: true, ignore_above: 256}
=======
return callWithRequest(req, 'create', patternCreateParams)
.then((patternResponse) => {
const templateParams = {
order: 0,
create: true,
name: patternToTemplate(indexPatternId),
body: {
template: indexPatternId,
mappings: {
_default_: {
dynamic_templates: [{
string_fields: {
match: '*',
match_mapping_type: 'string',
mapping: {
type: 'string',
index: 'analyzed',
fields: {
raw: {type: 'string', index: 'not_analyzed', doc_values: true, ignore_above: 256}
}
}
>>>>>>>
const templateParams = {
order: 0,
create: true,
name: ingestConfigName,
body: {
template: indexPatternId,
mappings: {
_default_: {
dynamic_templates: [{
string_fields: {
match: '*',
match_mapping_type: 'string',
mapping: {
type: 'string',
index: 'analyzed',
fields: {
raw: {type: 'string', index: 'not_analyzed', doc_values: true, ignore_above: 256} |
<<<<<<<
// kibi: add support for time precision
var duration = moment.duration(moment().diff(dateMath.parseWithPrecision($scope.from, false, $scope.kibiTimePrecision)));
var units = _.pluck(_.clone($scope.relativeOptions).reverse(), 'value');
=======
let duration = moment.duration(moment().diff(dateMath.parse($scope.from)));
let units = _.pluck(_.clone($scope.relativeOptions).reverse(), 'value');
>>>>>>>
// kibi: add support for time precision
let duration = moment.duration(moment().diff(dateMath.parseWithPrecision($scope.from, false, $scope.kibiTimePrecision)));
let units = _.pluck(_.clone($scope.relativeOptions).reverse(), 'value');
<<<<<<<
// kibi: add support for time precision
var parsed = dateMath.parseWithPrecision(getRelativeString(), false, $scope.kibiTimePrecision);
=======
let parsed = dateMath.parse(getRelativeString());
>>>>>>>
// kibi: add support for time precision
let parsed = dateMath.parseWithPrecision(getRelativeString(), false, $scope.kibiTimePrecision); |
<<<<<<<
return { service: service, serviceName: obj.service, title: obj.title, type: service.type, data: data.hits };
=======
return { service: obj.service, title: obj.title, data: data.hits, total: data.total };
>>>>>>>
return {
service: service,
serviceName: obj.service,
title: obj.title,
type: service.type,
data: data.hits,
total: data.total
}; |
<<<<<<<
const defaultInjectedVars = {};
if (config.has('kibana')) {
defaultInjectedVars.kbnIndex = config.get('kibana.index');
}
if (config.has('elasticsearch')) {
defaultInjectedVars.esRequestTimeout = config.get('elasticsearch.requestTimeout');
defaultInjectedVars.esShardTimeout = config.get('elasticsearch.shardTimeout');
defaultInjectedVars.esApiVersion = config.get('elasticsearch.apiVersion');
}
=======
>>>>>>> |
<<<<<<<
module.service('savedSearches', function (Promise, config, kbnIndex, es, createNotifier, SavedSearch, kbnUrl, Private) {
var cache = Private(require('ui/kibi/helpers/cache_helper')); // kibi: added to cache requests for saved searches
var scanner = new Scanner(es, {
=======
module.service('savedSearches', function (Promise, config, kbnIndex, es, createNotifier, SavedSearch, kbnUrl) {
const scanner = new Scanner(es, {
>>>>>>>
module.service('savedSearches', function (Promise, config, kbnIndex, es, createNotifier, SavedSearch, kbnUrl, Private) {
const cache = Private(require('ui/kibi/helpers/cache_helper')); // kibi: added to cache requests for saved searches
const scanner = new Scanner(es, { |
<<<<<<<
removeFromCMR
=======
removeFromCMR,
applyWorkflow,
getExecution,
getExecutionStatus
>>>>>>>
removeFromCMR,
getExecutionStatus |
<<<<<<<
const {
aws: {
headObject,
parseS3Uri,
s3,
s3ObjectExists
},
testUtils: {
randomString
}
} = require('@cumulus/common');
=======
const {
aws: { s3, s3ObjectExists },
stringUtils: { globalReplace }
} = require('@cumulus/common');
>>>>>>>
const {
aws: {
headObject,
parseS3Uri,
s3,
s3ObjectExists
},
stringUtils: { globalReplace },
testUtils: {
randomString
}
} = require('@cumulus/common');
<<<<<<<
const inputPayloadJson = fs.readFileSync(inputPayloadFilename, 'utf8');
inputPayload = await setupTestGranuleForIngest(config.bucket, inputPayloadJson, testDataGranuleId, granuleRegex);
const granuleId = inputPayload.granules[0].granuleId;
expectedPayload = loadFileWithUpdatedGranuleId(templatedOutputPayloadFilename, testDataGranuleId, granuleId);
=======
// upload test data
await uploadTestDataToBucket(config.bucket, s3data, testDataFolder, true);
const inputPayloadJson = fs.readFileSync(inputPayloadFilename, 'utf8');
// update test data filepaths
const updatedInputPayloadJson = globalReplace(inputPayloadJson, 'cumulus-test-data/pdrs', testDataFolder);
inputPayload = JSON.parse(updatedInputPayloadJson);
const expectedPayloadJson = fs.readFileSync(templatedOutputPayloadFilename, 'utf8');
const updatedExpectedPayloadJson = globalReplace(expectedPayloadJson, 'cumulus-test-data/pdrs', testDataFolder);
expectedPayload = JSON.parse(updatedExpectedPayloadJson);
// eslint-disable-next-line function-paren-newline
>>>>>>>
// upload test data
await uploadTestDataToBucket(config.bucket, s3data, testDataFolder, true);
const inputPayloadJson = fs.readFileSync(inputPayloadFilename, 'utf8');
// update test data filepaths
const updatedInputPayloadJson = globalReplace(inputPayloadJson, 'cumulus-test-data/pdrs', testDataFolder);
inputPayload = await setupTestGranuleForIngest(config.bucket, updatedInputPayloadJson, testDataGranuleId, granuleRegex);
const granuleId = inputPayload.granules[0].granuleId;
expectedPayload = loadFileWithUpdatedGranuleId(templatedOutputPayloadFilename, testDataGranuleId, granuleId);
const updatedOutputPayload = loadFileWithUpdatedGranuleId(templatedOutputPayloadFilename, testDataGranuleId, granuleId);
// update test data filepaths
expectedPayload = JSON.parse(globalReplace(JSON.stringify(updatedOutputPayload), 'cumulus-test-data/pdrs', testDataFolder)); |
<<<<<<<
const key = relByDomain.directLabel;
if (!button.sub[key]) {
button.sub[key] = [];
}
button.sub[key].push(subButton);
=======
_.each(compatibleSavedSearches, (compatibleSavedSearch) => {
const compatibleDashboards = _.filter(savedDashboards.hits, (savedDashboard) => {
return savedDashboard.savedSearchId === compatibleSavedSearch.id;
});
_.each(compatibleDashboards, (compatibleDashboard) => {
const subButton = sirenSequentialJoinVisHelper.constructSubButton(button,
compatibleDashboard, relByDomain);
sirenSequentialJoinVisHelper.addClickHandlerToButton(subButton);
const key = relByDomain.directLabel;
if (!button.sub[key]) {
button.sub[key] = [];
}
if ($scope.btnCountsEnabled()) {
subButton.showSpinner = true;
}
button.sub[key].push(subButton);
});
>>>>>>>
const key = relByDomain.directLabel;
if (!button.sub[key]) {
button.sub[key] = [];
}
if ($scope.btnCountsEnabled()) {
subButton.showSpinner = true;
}
button.sub[key].push(subButton); |
<<<<<<<
const fieldCache = self.cache = new LocalCache();
/**
* kibi: getPathsSequenceForIndexPattern returns an object which keys are paths, and values the path as an array
* with each element being a field name.
*/
self.getPathsSequenceForIndexPattern = function (indexPattern) {
let promise = Promise.resolve(indexPattern.id);
if (indexPattern.intervalName) {
promise = self.getIndicesForIndexPattern(indexPattern)
.then(function (existing) {
if (existing.matches.length === 0) throw new IndexPatternMissingIndices();
return existing.matches.slice(-config.get('indexPattern:fieldMapping:lookBack')); // Grab the most recent
});
}
return promise.then(function (indexList) {
// kibi: use our service to reduce the number of calls to the backend
return mappings.getMapping(indexList);
})
.catch(handleMissingIndexPattern)
.then(_getPathsForIndexPattern);
};
// kibi: end
=======
const fieldCache = self.cache = new LocalCache();
>>>>>>>
const fieldCache = self.cache = new LocalCache();
/**
* kibi: getPathsSequenceForIndexPattern returns an object which keys are paths, and values the path as an array
* with each element being a field name.
*/
self.getPathsSequenceForIndexPattern = function (indexPattern) {
let promise = Promise.resolve(indexPattern.id);
if (indexPattern.intervalName) {
promise = self.getIndicesForIndexPattern(indexPattern)
.then(function (existing) {
if (existing.matches.length === 0) throw new IndexPatternMissingIndices();
return existing.matches.slice(-config.get('indexPattern:fieldMapping:lookBack')); // Grab the most recent
});
}
return promise.then(function (indexList) {
// kibi: use our service to reduce the number of calls to the backend
return mappings.getMapping(indexList);
})
.catch(handleMissingIndexPattern)
.then(_getPathsForIndexPattern);
};
// kibi: end
<<<<<<<
if (!skipIndexPatternCache) {
// kibi: retrieve index pattern using the saved objects API.
return savedObjectsAPI.get({
=======
if (!opts.skipIndexPatternCache) {
return esAdmin.get({
>>>>>>>
if (!opts.skipIndexPatternCache) {
// kibi: retrieve index pattern using the saved objects API.
return savedObjectsAPI.get({ |
<<<<<<<
var notify = createNotifier({
=======
const notify = new Notifier({
>>>>>>>
const notify = createNotifier({ |
<<<<<<<
const s3Mixin = require('./s3').s3Mixin;
=======
const { baseProtocol } = require('./protocol');
>>>>>>>
const s3Mixin = require('./s3').s3Mixin;
const { baseProtocol } = require('./protocol'); |
<<<<<<<
// kibi: added by kibi
require('brace/mode/jade');
require('brace/mode/handlebars');
require('brace/mode/sql');
require('src/ui/public/kibi/ace_modes/sparql');
// kibi: end
require('node_modules/@spalger/ui-ace/ui-ace');
=======
require('node_modules/@elastic/ui-ace/ui-ace');
>>>>>>>
// kibi: added by kibi
require('brace/mode/jade');
require('brace/mode/handlebars');
require('brace/mode/sql');
require('src/ui/public/kibi/ace_modes/sparql');
// kibi: end
require('node_modules/@elastic/ui-ace/ui-ace'); |
<<<<<<<
.config(chrome.$setupXsrfRequestInterceptor)
.run(($location, $rootScope, Private) => {
const notify = new Notifier();
const urlOverflow = Private(UrlOverflowServiceProvider);
const check = (event) => {
if ($location.path() === '/error/url-overflow') return;
try {
if (urlOverflow.check($location.absUrl()) <= URL_LIMIT_WARN_WITHIN) {
notify.warning(`
The URL has gotten big and may cause Kibana
to stop working. Please simplify the data on screen.
`);
}
} catch (e) {
const { host, path, search, protocol } = parseUrl(window.location.href);
// rewrite the entire url to force the browser to reload and
// discard any potentially unstable state from before
window.location.href = formatUrl({ host, path, search, protocol, hash: '#/error/url-overflow' });
}
};
$rootScope.$on('$routeUpdate', check);
$rootScope.$on('$routeChangeStart', check);
});
=======
// kibi: saved objects API url
.value('savedObjectsAPIUrl', (function () {
var a = document.createElement('a');
a.href = chrome.addBasePath('/api/saved-objects/v1');
return a.href;
}()))
// kibi: end
.config(chrome.$setupXsrfRequestInterceptor);
>>>>>>>
// kibi: saved objects API url
.value('savedObjectsAPIUrl', (function () {
var a = document.createElement('a');
a.href = chrome.addBasePath('/api/saved-objects/v1');
return a.href;
}()))
// kibi: end
.config(chrome.$setupXsrfRequestInterceptor)
.run(($location, $rootScope, Private) => {
const notify = new Notifier();
const urlOverflow = Private(UrlOverflowServiceProvider);
const check = (event) => {
if ($location.path() === '/error/url-overflow') return;
try {
if (urlOverflow.check($location.absUrl()) <= URL_LIMIT_WARN_WITHIN) {
notify.warning(`
The URL has gotten big and may cause Kibana
to stop working. Please simplify the data on screen.
`);
}
} catch (e) {
const { host, path, search, protocol } = parseUrl(window.location.href);
// rewrite the entire url to force the browser to reload and
// discard any potentially unstable state from before
window.location.href = formatUrl({ host, path, search, protocol, hash: '#/error/url-overflow' });
}
};
$rootScope.$on('$routeUpdate', check);
$rootScope.$on('$routeChangeStart', check);
}); |
<<<<<<<
=======
require('angular-ui-select');
require('plugins/visualize/editor/agg_params');
require('filters/match_any');
>>>>>>>
<<<<<<<
(function setupControlManagement() {
var $editorContainer = $el.find('.vis-editor-agg-editor');
// this will contain the controls for the schema (rows or columns?), which are unrelated to
// controls for the agg, which is why they are first
var $schemaEditor = $('<div>').addClass('schemaEditors').appendTo($editorContainer);
if ($scope.agg.schema.editor) {
$schemaEditor.append($scope.agg.schema.editor);
$compile($schemaEditor)(editorScope());
}
// allow selection of an aggregation
var $aggSelect = $(aggSelectHtml).appendTo($editorContainer);
$compile($aggSelect)($scope);
// params for the selected agg, these are rebuilt every time the agg in $aggSelect changes
var $aggParamEditors; // container for agg type param editors
var $aggParamEditorsScope;
$scope.$watch('agg.type', function updateAggParamEditor(newType, oldType) {
if ($aggParamEditors) {
$aggParamEditors.remove();
$aggParamEditors = null;
}
// if there's an old scope, destroy it
if ($aggParamEditorsScope) {
$aggParamEditorsScope.$destroy();
$aggParamEditorsScope = null;
}
// create child scope, used in the editors
$aggParamEditorsScope = $scope.$new();
var agg = $scope.agg;
var type = $scope.agg.type;
if (!agg) return;
if (newType !== oldType) {
// don't reset on initial load, the
// saved params should persist
agg.resetParams();
}
if (!type) return;
var aggParamHTML = {
basic: [],
advanced: []
};
// build collection of agg params html
type.params.forEach(function (param, i) {
var aggParam;
var type = 'basic';
if (param.advanced) type = 'advanced';
if (aggParam = getAggParamHTML(param, i)) {
aggParamHTML[type].push(aggParam);
}
// if field param exists, compute allowed fields
if (param.name === 'field') {
$aggParamEditorsScope.indexedFields = getIndexedFields(param);
}
});
// compile the paramEditors html elements
var paramEditors = aggParamHTML.basic;
if (aggParamHTML.advanced.length) {
paramEditors.push($(advancedToggleHtml).get(0));
paramEditors = paramEditors.concat(aggParamHTML.advanced);
}
$aggParamEditors = $(paramEditors).appendTo($editorContainer);
$compile($aggParamEditors)($aggParamEditorsScope);
});
// build HTML editor given an aggParam and index
function getAggParamHTML(param, idx) {
// don't show params without an editor
if (!param.editor) {
return;
}
var attrs = {};
attrs['agg-param'] = 'agg.type.params[' + idx + ']';
if (param.advanced) {
attrs['ng-show'] = 'advancedToggled';
}
return $('<vis-agg-param-editor>')
.attr(attrs)
.append(param.editor)
.get(0);
}
function getIndexedFields(param) {
var fields = $scope.agg.vis.indexPattern.fields.raw;
var fieldTypes = param.filterFieldTypes;
if (fieldTypes) {
fields = $filter('fieldType')(fields, fieldTypes);
fields = $filter('matchAny')(fields, [{ indexed: true }, { scripted: true }]);
fields = $filter('orderBy')(fields, ['type', 'name']);
}
return fields;
}
// generic child scope creation, for both schema and agg
function editorScope() {
var $editorScope = $scope.$new();
setupBoundProp($editorScope, 'agg.type', 'aggType');
setupBoundProp($editorScope, 'agg', 'aggConfig');
setupBoundProp($editorScope, 'agg.params', 'params');
return $editorScope;
}
// bind a property from our scope a child scope, with one-way binding
function setupBoundProp($child, get, set) {
var getter = _.partial($parse(get), $scope);
var setter = _.partial($parse(set).assign, $child);
$scope.$watch(getter, setter);
}
}());
=======
>>>>>>> |
<<<<<<<
define(function (require) {
require('ui/field_editor');
require('plugins/kibana/settings/sections/indices/_index_header');
require('ui/routes')
.when('/settings/indices/edit/:indexPatternId/field/:fieldName', { mode: 'edit' })
.when('/settings/indices/edit/:indexPatternId/create-field/', { mode: 'create' })
.defaults(/settings\/indices\/edit\/[^\/]+\/(field|create-field)(\/|$)/, {
template: require('plugins/kibana/settings/sections/indices/_field_editor.html'),
resolve: {
indexPattern: function ($route, courier) {
return courier.indexPatterns.get($route.current.params.indexPatternId)
.catch(courier.redirectWhenMissing('/settings/indices'));
}
},
controllerAs: 'fieldSettings',
controller: function FieldEditorPageController($route, Private, Notifier, docTitle) {
var Field = Private(require('ui/index_patterns/_field'));
var notify = new Notifier({ location: 'Field Editor' });
var kbnUrl = Private(require('ui/url'));
=======
import 'ui/field_editor';
import 'plugins/kibana/settings/sections/indices/_index_header';
import IndexPatternsFieldProvider from 'ui/index_patterns/_field';
import UrlProvider from 'ui/url';
import uiRoutes from 'ui/routes';
import fieldEditorTemplate from 'plugins/kibana/settings/sections/indices/_field_editor.html';
uiRoutes
.when('/settings/indices/:indexPatternId/field/:fieldName', { mode: 'edit' })
.when('/settings/indices/:indexPatternId/create-field/', { mode: 'create' })
.defaults(/settings\/indices\/[^\/]+\/(field|create-field)(\/|$)/, {
template: fieldEditorTemplate,
resolve: {
indexPattern: function ($route, courier) {
return courier.indexPatterns.get($route.current.params.indexPatternId)
.catch(courier.redirectWhenMissing('/settings/indices'));
}
},
controllerAs: 'fieldSettings',
controller: function FieldEditorPageController($route, Private, Notifier, docTitle) {
const Field = Private(IndexPatternsFieldProvider);
const notify = new Notifier({ location: 'Field Editor' });
const kbnUrl = Private(UrlProvider);
>>>>>>>
import 'ui/field_editor';
import 'plugins/kibana/settings/sections/indices/_index_header';
import IndexPatternsFieldProvider from 'ui/index_patterns/_field';
import UrlProvider from 'ui/url';
import uiRoutes from 'ui/routes';
import fieldEditorTemplate from 'plugins/kibana/settings/sections/indices/_field_editor.html';
uiRoutes
.when('/settings/indices/edit/:indexPatternId/field/:fieldName', { mode: 'edit' })
.when('/settings/indices/edit/:indexPatternId/create-field/', { mode: 'create' })
.defaults(/settings\/indices\/edit\/[^\/]+\/(field|create-field)(\/|$)/, {
template: fieldEditorTemplate,
resolve: {
indexPattern: function ($route, courier) {
return courier.indexPatterns.get($route.current.params.indexPatternId)
.catch(courier.redirectWhenMissing('/settings/indices'));
}
},
controllerAs: 'fieldSettings',
controller: function FieldEditorPageController($route, Private, Notifier, docTitle) {
const Field = Private(IndexPatternsFieldProvider);
const notify = new Notifier({ location: 'Field Editor' });
const kbnUrl = Private(UrlProvider); |
<<<<<<<
scale: 'linear',
=======
showCircles: true,
drawLinesBetweenPoints: true,
radiusRatio: 9,
>>>>>>>
showCircles: true,
drawLinesBetweenPoints: true,
radiusRatio: 9,
scale: 'linear',
<<<<<<<
scales: ['linear', 'log', 'square root'],
editor: require('text!plugins/vis_types/vislib/editors/line.html')
=======
editor: require('text!plugins/vis_types/vislib/editors/line.html')
>>>>>>>
scales: ['linear', 'log', 'square root'],
editor: require('text!plugins/vis_types/vislib/editors/line.html') |
<<<<<<<
var util = require('../lib/sindicetech/util');
var filterJoin = require('../lib/sindicetech/filterJoin');
var dbfilter = require('../lib/sindicetech/dbfilter');
var inject = require('../lib/sindicetech/inject');
var queryEngine = require('../lib/sindicetech/queryEngine');
// If the target is backed by an SSL and a CA is provided via the config
// then we need to inject the CA
var customCA;
if (/^https/.test(target.protocol) && config.kibana.ca) {
customCA = fs.readFileSync(config.kibana.ca, 'utf8');
}
// Add client certificate and key if required by elasticsearch
var clientCrt;
var clientKey;
if (/^https/.test(target.protocol) && config.kibana.kibana_elasticsearch_client_crt && config.kibana.kibana_elasticsearch_client_key) {
clientCrt = fs.readFileSync(config.kibana.kibana_elasticsearch_client_crt, 'utf8');
clientKey = fs.readFileSync(config.kibana.kibana_elasticsearch_client_key, 'utf8');
}
=======
>>>>>>>
var util = require('../lib/sindicetech/util');
var filterJoin = require('../lib/sindicetech/filterJoin');
var dbfilter = require('../lib/sindicetech/dbfilter');
var inject = require('../lib/sindicetech/inject');
var queryEngine = require('../lib/sindicetech/queryEngine');
<<<<<<<
url: elasticsearch_url,
=======
agent: router.proxyAgent,
url: config.elasticsearch + path,
>>>>>>>
agent: router.proxyAgent,
url: elasticsearch_url,
<<<<<<<
// If the server has a custom CA we need to add it to the agent options
if (customCA) {
options.agentOptions = { ca: [customCA] };
}
// Add client key and certificate for elasticsearch if needed.
if (clientCrt && clientKey) {
if (!options.agentOptions) {
options.agentOptions = {};
}
options.agentOptions.cert = clientCrt;
options.agentOptions.key = clientKey;
}
var savedQueries = {};
=======
>>>>>>>
var savedQueries = {}; |
<<<<<<<
import { createPanelState } from 'plugins/kibana/dashboard/panel/panel_state';
import { DashboardConstants, createDashboardEditUrl } from './dashboard_constants';
import { VisualizeConstants } from 'plugins/kibana/visualize/visualize_constants';
=======
import { DashboardConstants, createDashboardEditUrl } from './dashboard_constants';
import { VisualizeConstants } from 'plugins/kibana/visualize/visualize_constants';
>>>>>>>
import { DashboardConstants, createDashboardEditUrl } from './dashboard_constants';
import { VisualizeConstants } from 'plugins/kibana/visualize/visualize_constants';
<<<<<<<
import { FilterUtils } from './filter_utils';
import { getPersistedStateId } from 'plugins/kibana/dashboard/panel/panel_state';
import errors from 'ui/errors';
import notify from 'ui/notify';
// kibi: imports
import 'ui/kibi/directives/kibi_select'; // added as it is needed by src/plugins/kibana/public/dashboard/partials/save_dashboard.html
import 'ui/kibi/session/siren_session'; // added to make sirenSession service available
// kibi: end
=======
import { DashboardState } from './dashboard_state';
import notify from 'ui/notify';
>>>>>>>
// kibi: need to call private on dashboard_state
import DashboardStateProvider from './dashboard_state';
import notify from 'ui/notify';
// kibi: imports
import 'ui/kibi/directives/kibi_select'; // added as it is needed by src/plugins/kibana/public/dashboard/partials/save_dashboard.html
import 'ui/kibi/session/siren_session'; // added to make sirenSession service available
// kibi: end
<<<<<<<
app.directive('dashboardApp', function (createNotifier, courier, AppState, timefilter, kbnUrl, Private) {
=======
app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter, quickRanges, kbnUrl, confirmModal, Private) {
>>>>>>>
app.directive('dashboardApp', function (createNotifier, courier, AppState, timefilter, quickRanges, kbnUrl, confirmModal, Private) {
<<<<<<<
controller: function (
$scope, $rootScope, $route, $routeParams, $location, Private, getAppState,
// kibi: added dashboardGroups, kibiState, config
dashboardGroups, kibiState, config) {
const queryFilter = Private(FilterBarQueryFilterProvider);
// kibi: added
const numeral = require('numeral')();
const getEmptyQueryOptionHelper = Private(require('ui/kibi/helpers/get_empty_query_with_options_helper'));
// kibi: end
const notify = createNotifier({
location: 'Dashboard'
});
=======
controller: function ($scope, $rootScope, $route, $routeParams, $location, Private, getAppState) {
const filterBar = Private(FilterBarQueryFilterProvider);
const docTitle = Private(DocTitleProvider);
const notify = new Notifier({ location: 'Dashboard' });
>>>>>>>
controller: function ($scope, $rootScope, $route, $routeParams, $location, Private, getAppState,
// kibi: added dashboardGroups, kibiState, config
dashboardGroups, kibiState, config) {
const filterBar = Private(FilterBarQueryFilterProvider);
const docTitle = Private(DocTitleProvider);
const notify = createNotifier({ location: 'Dashboard' });
<<<<<<<
$scope.$watch('state.options.darkTheme', setDarkTheme);
$scope.topNavMenu = getTopNavConfig(kbnUrl);
$scope.landingPageUrl = () => `#${DashboardConstants.LANDING_PAGE_PATH}`;
$scope.refresh = _.bindKey(courier, 'fetch');
=======
dashboardState.applyFilters(dashboardState.getQuery(), filterBar.getFilters());
let pendingVisCount = _.size(dashboardState.getPanels());
>>>>>>>
dashboardState.applyFilters(dashboardState.getQuery(), filterBar.getFilters());
let pendingVisCount = _.size(dashboardState.getPanels());
<<<<<<<
$scope.timefilter = timefilter;
$scope.$listen(timefilter, 'fetch', $scope.refresh);
dash.searchSource.highlightAll(true);
=======
dash.searchSource.highlightAll(true);
dash.searchSource.version(true);
>>>>>>>
dash.searchSource.highlightAll(true);
dash.searchSource.version(true);
<<<<<<<
const docTitle = Private(DocTitleProvider);
function init() {
getMetadata(); // siren: calls getMetadata to fetch dashboard related info
updateQueryOnRootSource();
if (dash.id) {
docTitle.change(dash.title);
}
initPanelIndexes();
// watch for state changes and update the appStatus.dirty value
stateMonitor = stateMonitorFactory.create($state, stateDefaults);
stateMonitor.onChange((status) => {
$appStatus.dirty = status.dirty || !dash.id;
});
$scope.$on('$destroy', () => {
stateMonitor.destroy();
dash.destroy();
// Remove dark theme to keep it from affecting the appearance of other apps.
setDarkTheme(false);
});
$scope.$emit('application.load');
}
function initPanelIndexes() {
// find the largest panelIndex in all the panels
let maxIndex = getMaxPanelIndex();
=======
// Following the "best practice" of always have a '.' in your ng-models –
// https://github.com/angular/angular.js/wiki/Understanding-Scopes
$scope.model = {
query: dashboardState.getQuery(),
darkTheme: dashboardState.getDarkTheme(),
timeRestore: dashboardState.getTimeRestore(),
title: dashboardState.getTitle()
};
>>>>>>>
// Following the "best practice" of always have a '.' in your ng-models –
// https://github.com/angular/angular.js/wiki/Understanding-Scopes
$scope.model = {
query: dashboardState.getQuery(),
darkTheme: dashboardState.getDarkTheme(),
timeRestore: dashboardState.getTimeRestore(),
title: dashboardState.getTitle()
};
<<<<<<<
$scope.brushEvent = brushEvent;
$scope.filterBarClickHandler = filterBarClickHandler;
$scope.expandedPanel = null;
$scope.hasExpandedPanel = () => $scope.expandedPanel !== null;
$scope.toggleExpandPanel = (panelIndex) => {
if ($scope.expandedPanel && $scope.expandedPanel.panelIndex === panelIndex) {
$scope.expandedPanel = null;
} else {
$scope.expandedPanel =
$scope.state.panels.find((panel) => panel.panelIndex === panelIndex);
}
=======
const navActions = {};
navActions[TopNavIds.EXIT_EDIT_MODE] = () => onChangeViewMode(DashboardViewMode.VIEW);
navActions[TopNavIds.ENTER_EDIT_MODE] = () => onChangeViewMode(DashboardViewMode.EDIT);
updateViewMode(dashboardState.getViewMode());
$scope.save = function () {
return dashboardState.saveDashboard(angular.toJson, timefilter).then(function (id) {
$scope.kbnTopNav.close('save');
if (id) {
notify.info(`Saved Dashboard as "${dash.title}"`);
if (dash.id !== $routeParams.id) {
kbnUrl.change(createDashboardEditUrl(dash.id));
} else {
docTitle.change(dash.lastSavedTitle);
updateViewMode(DashboardViewMode.VIEW);
}
}
}).catch(notify.fatal);
>>>>>>>
const navActions = {};
navActions[TopNavIds.EXIT_EDIT_MODE] = () => onChangeViewMode(DashboardViewMode.VIEW);
navActions[TopNavIds.ENTER_EDIT_MODE] = () => onChangeViewMode(DashboardViewMode.EDIT);
updateViewMode(dashboardState.getViewMode());
$scope.save = function () {
return dashboardState.saveDashboard(angular.toJson, timefilter).then(function (id) {
$scope.kbnTopNav.close('save');
if (id) {
notify.info(`Saved Dashboard as "${dash.title}"`);
$rootScope.$emit('kibi:dashboard:changed', id); // kibi: allow helpers to react to dashboard changes
if (dash.id !== $routeParams.id) {
kbnUrl.change(createDashboardEditUrl(dash.id));
} else {
docTitle.change(dash.lastSavedTitle);
updateViewMode(DashboardViewMode.VIEW);
}
}
}).catch(notify.fatal);
<<<<<<<
$scope.newDashboard = function () {
// kibi: changed from '/dashboard' because now there's a specific path for dashboard creation
kbnUrl.change('/dashboard/new-dashboard/create', {});
};
=======
// Remove dark theme to keep it from affecting the appearance of other apps.
setLightTheme();
});
>>>>>>>
// Remove dark theme to keep it from affecting the appearance of other apps.
setLightTheme();
});
<<<<<<<
$scope.save = function () {
// kibi: lock the dashboard so kibi_state._getCurrentDashboardId ignore the change for a moment
dash.locked = true;
// kibi added previousDashId
const previousDashId = dash.id;
$state.save();
const timeRestoreObj = _.pick(timefilter.refreshInterval, ['display', 'pause', 'section', 'value']);
dash.panelsJSON = angular.toJson($state.panels);
dash.uiStateJSON = angular.toJson($uiState.getChanges());
// kibi: save the timepicker mode
dash.timeMode = dash.timeRestore ? timefilter.time.mode : undefined;
dash.timeFrom = dash.timeRestore ? timefilter.time.from : undefined;
dash.timeTo = dash.timeRestore ? timefilter.time.to : undefined;
dash.refreshInterval = dash.timeRestore ? timeRestoreObj : undefined;
dash.optionsJSON = angular.toJson($state.options);
dash.save()
.then(function (id) {
delete dash.locked; // kibi: our lock for the dashboard!
stateMonitor.setInitialState($state.toJSON());
$scope.kbnTopNav.close('save');
if (id) {
notify.info('Saved Dashboard as "' + dash.title + '"');
$rootScope.$emit('kibi:dashboard:changed', id); // kibi: allow helpers to react to dashboard changes
if (dash.id !== $routeParams.id) {
kbnUrl.change('/dashboard/{{id}}', { id: dash.id });
} else {
docTitle.change(dash.lastSavedTitle);
}
}
})
.catch((err) => {
// kibi: if the dashboard can't be saved rollback the dashboard id
dash.id = previousDashId;
delete dash.locked; // kibi: our lock for the dashboard!
$scope.configTemplate.close('save');
notify.error(err);
// kibi: end
});
};
=======
function setDarkTheme() {
chrome.removeApplicationClass(['theme-light']);
chrome.addApplicationClass('theme-dark');
}
function setLightTheme() {
chrome.removeApplicationClass(['theme-dark']);
chrome.addApplicationClass('theme-light');
}
>>>>>>>
function setDarkTheme() {
chrome.removeApplicationClass(['theme-light']);
chrome.addApplicationClass('theme-dark');
}
function setLightTheme() {
chrome.removeApplicationClass(['theme-dark']);
chrome.addApplicationClass('theme-light');
}
<<<<<<<
kbnUrl.change(
`${VisualizeConstants.WIZARD_STEP_1_PAGE_PATH}?${DashboardConstants.ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM}`);
};
$scope.addSearch = function (hit) {
pendingVis++;
$state.panels.push(createPanelState(hit.id, 'search', getMaxPanelIndex()));
=======
kbnUrl.change(
`${VisualizeConstants.WIZARD_STEP_1_PAGE_PATH}?${DashboardConstants.ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM}`);
>>>>>>>
kbnUrl.change(
`${VisualizeConstants.WIZARD_STEP_1_PAGE_PATH}?${DashboardConstants.ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM}`);
<<<<<<<
// kibi: If you click the back/forward browser button:
// 1. The $locationChangeSuccess event is fired when you click back/forward browser button.
$rootScope.$on('$locationChangeSuccess', () => $rootScope.actualLocation = $location.url());
// 2. The following watcher is fired.
$rootScope.$watch(() => { return $location.url(); }, (newLocation, oldLocation) => {
if ($rootScope.actualLocation === newLocation) {
/* kibi: Here we execute init() if the newLocation is equal to the URL we saved during
the $locationChangeSuccess event above. */
init();
}
});
/* kibi: If you click an ordinary hyperlink, the above order is reversed.
First, you have the watcher fired, then the $locationChangeSuccess event.
That's why the actualLocation and newLocation will never be equal inside the watcher callback
if you click on an ordinary hyperlink.
*/
init();
$scope.showEditHelpText = () => {
return !$scope.state.panels.length;
};
=======
$scope.$emit('application.load');
>>>>>>>
$scope.$emit('application.load');
// KIBI5: try to add this back
//// kibi: If you click the back/forward browser button:
//// 1. The $locationChangeSuccess event is fired when you click back/forward browser button.
//$rootScope.$on('$locationChangeSuccess', () => $rootScope.actualLocation = $location.url());
//// 2. The following watcher is fired.
//$rootScope.$watch(() => { return $location.url(); }, (newLocation, oldLocation) => {
//if ($rootScope.actualLocation === newLocation) {
//[> kibi: Here we execute init() if the newLocation is equal to the URL we saved during
//the $locationChangeSuccess event above. */
//init();
//}
//});
//[> kibi: If you click an ordinary hyperlink, the above order is reversed.
//First, you have the watcher fired, then the $locationChangeSuccess event.
//That's why the actualLocation and newLocation will never be equal inside the watcher callback
//if you click on an ordinary hyperlink.
//*/
//init(); |
<<<<<<<
$scope.$emit('application.load');
}
};
});
export default {
name: 'indices',
display: 'Indices',
url: '#/settings/indices',
};
=======
$scope.$emit('application.load');
}
};
});
registry.register(_.constant({
order: 1,
name: 'indices',
display: 'Indices',
url: '#/settings/indices'
}));
});
>>>>>>>
$scope.$emit('application.load');
}
};
});
registry.register(_.constant({
order: 1,
name: 'indices',
display: 'Indices',
url: '#/settings/indices'
})); |
<<<<<<<
controller: function FieldEditorPageController($route, Private, createNotifier, docTitle) {
var Field = Private(require('ui/index_patterns/_field'));
var notify = createNotifier({ location: 'Field Editor' });
var kbnUrl = Private(require('ui/url'));
=======
controller: function FieldEditorPageController($route, Private, Notifier, docTitle) {
const Field = Private(require('ui/index_patterns/_field'));
const notify = new Notifier({ location: 'Field Editor' });
const kbnUrl = Private(require('ui/url'));
>>>>>>>
controller: function FieldEditorPageController($route, Private, createNotifier, docTitle) {
const Field = Private(require('ui/index_patterns/_field'));
const notify = createNotifier({ location: 'Field Editor' });
const kbnUrl = Private(require('ui/url')); |
<<<<<<<
require('./_color');
=======
require('./_date');
>>>>>>>
require('./_color');
require('./_date'); |
<<<<<<<
import { each } from 'lodash';
=======
>>>>>>>
<<<<<<<
columns: '=?',
columnAliases: '=?'
=======
columns: '=?',
onAddColumn: '=?',
onRemoveColumn: '=?',
>>>>>>>
columns: '=?',
columnAliases: '=?',
onAddColumn: '=?',
onRemoveColumn: '=?'
<<<<<<<
// kibi: added columnAliases to $viewAttrs
const $viewAttrs = 'hit="hit" index-pattern="indexPattern" filter="filter" columns="columns" column-aliases="columnAliases"';
=======
const $viewAttrs = `
hit="hit"
index-pattern="indexPattern"
filter="filter"
columns="columns"
on-add-column="onAddColumn"
on-remove-column="onRemoveColumn"
`;
>>>>>>>
// kibi: added columnAliases to $viewAttrs
const $viewAttrs = `
hit="hit"
index-pattern="indexPattern"
filter="filter"
columns="columns"
on-add-column="onAddColumn"
on-remove-column="onRemoveColumn"
column-aliases="columnAliases"
`; |
<<<<<<<
=======
const s3Mixin = require('./s3').s3Mixin;
const aws = require('@cumulus/common/aws');
const { S3 } = require('./aws');
const queue = require('./queue');
>>>>>>>
<<<<<<<
=======
* This is a base class for discovering PDRs
* It must be mixed with a FTP, HTTP or S3 mixing to work
*
* @class
* @abstract
*/
class DiscoverAndQueue extends Discover {
async findNewPdrs(pdrs) {
let newPdrs = await super.findNewPdrs(pdrs);
if (this.limit) newPdrs = newPdrs.slice(0, this.limit);
return Promise.all(newPdrs.map((p) => queue.queuePdr(
this.queueUrl,
this.templateUri,
this.provider,
this.collection,
p
)));
}
}
/**
>>>>>>>
<<<<<<<
=======
* This is a base class for discovering PDRs
* It must be mixed with a FTP, HTTP or S3 mixing to work
*
* @class
* @abstract
*/
class ParseAndQueue extends Parse {
async ingest() {
const payload = await super.ingest();
const collections = {};
//payload.granules = payload.granules.slice(0, 10);
// make sure all parsed granules have the correct collection
for (const g of payload.granules) {
if (!collections[g.dataType]) {
// if the collection is not provided in the payload
// get it from S3
if (g.dataType !== this.collection.name) {
const bucket = this.bucket;
const key = `${this.stack}` +
`/collections/${g.dataType}.json`;
let file;
try {
file = await S3.get(bucket, key);
}
catch (e) {
throw new MismatchPdrCollection(
`${g.dataType} dataType in ${this.pdr.name} doesn't match ${this.collection.name}`
);
}
collections[g.dataType] = JSON.parse(file.Body.toString());
}
else {
collections[g.dataType] = this.collection;
}
}
g.granuleId = this.extractGranuleId(
g.files[0].name,
collections[g.dataType].granuleIdExtraction
);
}
log.info(`Queueing ${payload.granules.length} granules to be processed`);
const names = await Promise.all(
payload.granules.map((g) => queue.queueGranule(
g,
this.queueUrl,
this.templateUri,
this.provider,
collections[g.dataType],
this.pdr,
this.stack,
this.bucket
))
);
let isFinished = false;
const running = names.filter((n) => n[0] === 'running').map((n) => n[1]);
const completed = names.filter((n) => n[0] === 'completed').map((n) => n[1]);
const failed = names.filter((n) => n[0] === 'failed').map((n) => n[1]);
if (running.length === 0) {
isFinished = true;
}
return { running, completed, failed, isFinished };
}
}
/**
>>>>>>>
<<<<<<<
=======
* Discover PDRs from a S3 endpoint.
*
* @class
*/
class S3Discover extends s3Mixin(Discover) {}
/**
* Discover and Queue PDRs from a FTP endpoint.
*
* @class
*/
class FtpDiscoverAndQueue extends ftpMixin(baseProtocol(DiscoverAndQueue)) {}
/**
* Discover and Queue PDRs from a HTTP endpoint.
*
* @class
*/
class HttpDiscoverAndQueue extends httpMixin(baseProtocol(DiscoverAndQueue)) {}
/**
* Discover and Queue PDRs from a SFTP endpoint.
*
* @class
*/
class SftpDiscoverAndQueue extends sftpMixin(baseProtocol(DiscoverAndQueue)) {}
/**
* Discover and Queue PDRs from a S3 endpoint.
*
* @class
*/
class S3DiscoverAndQueue extends s3Mixin(DiscoverAndQueue) {}
/**
>>>>>>>
* Discover PDRs from a S3 endpoint.
*
* @class
*/
class S3Discover extends s3Mixin(baseProtocol(Discover)) {}
/**
<<<<<<<
=======
* Parse PDRs downloaded from a S3 endpoint.
*
* @class
*/
class S3Parse extends s3Mixin(Parse) {}
/**
* Parse and Queue PDRs downloaded from a FTP endpoint.
*
* @class
*/
class FtpParseAndQueue extends ftpMixin(baseProtocol(ParseAndQueue)) {}
/**
* Parse and Queue PDRs downloaded from a HTTP endpoint.
*
* @class
*/
class HttpParseAndQueue extends httpMixin(baseProtocol(ParseAndQueue)) {}
/**
* Parse and Queue PDRs downloaded from a SFTP endpoint.
*
* @classc
*/
class SftpParseAndQueue extends sftpMixin(baseProtocol(ParseAndQueue)) {}
/**
* Parse and Queue PDRs downloaded from a S3 endpoint.
*
* @classc
*/
class S3ParseAndQueue extends s3Mixin(ParseAndQueue) {}
/**
>>>>>>>
* Parse PDRs downloaded from a S3 endpoint.
*
* @class
*/
class S3Parse extends s3Mixin(baseProtocol(Parse)) {}
/**
<<<<<<<
* @param {string} protocol - `sftp`, `ftp`, or `http`
=======
* @param {string} protocol - `sftp`, `ftp`, `http` or 's3'
* @param {boolean} q - set to `true` to queue pdrs
>>>>>>>
* @param {string} protocol - `sftp`, `ftp`, `http` or 's3'
<<<<<<<
return SftpDiscover;
=======
return q ? SftpDiscoverAndQueue : SftpDiscover;
case 's3':
return q ? S3DiscoverAndQueue : S3Discover;
>>>>>>>
return SftpDiscover;
case 's3':
return S3Discover;
<<<<<<<
return SftpParse;
=======
return q ? SftpParseAndQueue : SftpParse;
case 's3':
return q ? S3ParseAndQueue : S3Parse;
>>>>>>>
return SftpParse;
case 's3':
return S3Parse;
<<<<<<<
module.exports.SftpDiscover = SftpDiscover;
=======
module.exports.SftpDiscover = SftpDiscover;
module.exports.S3Discover = S3Discover;
module.exports.FtpDiscoverAndQueue = FtpDiscoverAndQueue;
module.exports.HttpDiscoverAndQueue = HttpDiscoverAndQueue;
module.exports.SftpDiscoverAndQueue = SftpDiscoverAndQueue;
module.exports.S3DiscoverAndQueue = S3DiscoverAndQueue;
>>>>>>>
module.exports.HttpParse = HttpParse;
module.exports.S3Discover = S3Discover;
module.exports.S3Parse = S3Parse;
module.exports.SftpDiscover = SftpDiscover;
module.exports.SftpParse = SftpParse; |
<<<<<<<
let pkg = require('requirefrom')('src/utils')('packageJson');
import clone from './deep_clone_with_buffers';
=======
import pkg from '../../utils/packageJson';
import clone from './deepCloneWithBuffers';
>>>>>>>
import pkg from '../../utils/packageJson';
import clone from './deep_clone_with_buffers'; |
<<<<<<<
console.log('cmrResource: ', JSON.stringify(cmrResource));
=======
const accessTokenResponse = result[1];
accessToken = accessTokenResponse.accessToken;
>>>>>>>
console.log('cmrResource: ', JSON.stringify(cmrResource));
const accessTokenResponse = result[1];
accessToken = accessTokenResponse.accessToken; |
<<<<<<<
=======
* A class for discovering granules using FTP and queueing them to SQS.
*/
class FtpDiscoverAndQueueGranules extends ftpMixin(baseProtocol(DiscoverAndQueue)) {}
/**
* A class for discovering granules using s3
*/
class S3DiscoverGranules extends s3Mixin(Discover) {}
/**
* A class for discovering granules using s3 and queueing them to SQS.
*/
class S3DiscoverAndQueueGranules extends s3Mixin(DiscoverAndQueue) {}
/**
>>>>>>>
* A class for discovering granules using S3.
*/
class S3DiscoverGranules extends s3Mixin(baseProtocol(Discover)) {}
/**
<<<<<<<
* @param {string} protocol -`sftp`, `ftp`, or `http`
=======
* @param {string} protocol -`sftp`, `ftp`, `http` or `s3`
* @param {boolean} q - set to `true` to queue granules
>>>>>>>
* @param {string} protocol -`sftp`, `ftp`, `http` or `s3`
<<<<<<<
return HttpDiscoverGranules;
=======
return q ? HttpDiscoverAndQueueGranules : HttpDiscoverGranules;
case 's3':
return q ? S3DiscoverAndQueueGranules : S3DiscoverGranules;
>>>>>>>
return HttpDiscoverGranules;
case 's3':
return S3DiscoverGranules;
<<<<<<<
module.exports.HttpDiscoverGranules = HttpDiscoverGranules;
=======
module.exports.FtpDiscoverAndQueueGranules = FtpDiscoverAndQueueGranules;
module.exports.HttpDiscoverGranules = HttpDiscoverGranules;
module.exports.HttpDiscoverAndQueueGranules = HttpDiscoverAndQueueGranules;
module.exports.S3DiscoverGranules = S3DiscoverGranules;
module.exports.S3DiscoverAndQueueGranules = S3DiscoverAndQueueGranules;
>>>>>>>
module.exports.FtpGranule = FtpGranule;
module.exports.HttpDiscoverGranules = HttpDiscoverGranules;
module.exports.HttpGranule = HttpGranule;
module.exports.S3Granule = S3Granule;
module.exports.S3DiscoverGranules = S3DiscoverGranules;
module.exports.SftpDiscoverGranules = SftpDiscoverGranules;
module.exports.SftpGranule = SftpGranule; |
<<<<<<<
var $ = require('jquery');
var _ = require('lodash');
var expect = require('expect.js');
var ngMock = require('ngMock');
var sinon = require('auto-release-sinon');
var $rootScope;
var TableGroup;
var $compile;
var Private;
var $scope;
var $el;
var Vis;
var fixtures;
var AppState;
=======
let $rootScope;
let TableGroup;
let $compile;
let Private;
let $scope;
let $el;
let Vis;
let fixtures;
>>>>>>>
let $rootScope;
let TableGroup;
let $compile;
let Private;
let $scope;
let $el;
let Vis;
let fixtures;
let AppState; |
<<<<<<<
controller: function ($rootScope, $scope, $element, $timeout, PersistedLog, config) {
var self = this;
=======
controller: function ($scope, $element, $timeout, PersistedLog, config) {
let self = this;
>>>>>>>
controller: function ($rootScope, $scope, $element, $timeout, PersistedLog, config) {
let self = this; |
<<<<<<<
const initConfigOff = config.watch('init:config', function () {
_checkFilterJoinPlugin();
_initPanel();
=======
const initConfigOff = $rootScope.$on('init:config', function () {
_checkFilterJoinPlugin()
.then(() => _initPanel());
>>>>>>>
const initConfigOff = config.watch('init:config', function () {
_checkFilterJoinPlugin()
.then(() => _initPanel()); |
<<<<<<<
import { get, defaults } from 'lodash';
import url from 'url';
=======
import { defaults } from 'lodash';
>>>>>>>
import { get, defaults } from 'lodash';
<<<<<<<
mapUri(stubCluster(), '/elasticsearch', serverWithoutSirenPlugin)(request, function (err, upstreamUri, upstreamHeaders) {
=======
mapUri(stubCluster(), '/elasticsearch')(request, function (err, upstreamUri) {
>>>>>>>
mapUri(stubCluster(), '/elasticsearch', serverWithoutSirenPlugin)(request, function (err, upstreamUri) {
<<<<<<<
mapUri(stubCluster(settings), '/elasticsearch', serverWithoutSirenPlugin)(request, function (err, upstreamUri, upstreamHeaders) {
=======
mapUri(stubCluster(settings), '/elasticsearch')(request, function (err, upstreamUri) {
>>>>>>>
mapUri(stubCluster(settings), '/elasticsearch', serverWithoutSirenPlugin)(request, function (err, upstreamUri) {
<<<<<<<
mapUri(stubCluster(settings), '/elasticsearch', serverWithoutSirenPlugin)(request, function (err, upstreamUri, upstreamHeaders) {
=======
mapUri(stubCluster(settings), '/elasticsearch')(request, function (err, upstreamUri) {
>>>>>>>
mapUri(stubCluster(settings), '/elasticsearch', serverWithoutSirenPlugin)(request, function (err, upstreamUri) {
<<<<<<<
mapUri(stubCluster(), '/elasticsearch', serverWithoutSirenPlugin)(request, function (err, upstreamUri, upstreamHeaders) {
=======
mapUri(stubCluster(), '/elasticsearch')(request, function (err, upstreamUri) {
>>>>>>>
mapUri(stubCluster(), '/elasticsearch', serverWithoutSirenPlugin)(request, function (err, upstreamUri) { |
<<<<<<<
var mapTypes = ['Scaled Circle Markers', 'Shaded Circle Markers', 'Shaded Geohash Grid', 'Heatmap'];
=======
// TODO: Test the specific behavior of each these
var mapTypes = ['Scaled Circle Markers', 'Shaded Circle Markers', 'Shaded Geohash Grid'];
>>>>>>>
// TODO: Test the specific behavior of each these
var mapTypes = ['Scaled Circle Markers', 'Shaded Circle Markers', 'Shaded Geohash Grid', 'Heatmap'];
<<<<<<<
describe('TileMap Test Suite for ' + mapTypes[j] + ' with ' + names[i] + ' data', function () {
var vis;
var visLibParams = {
isDesaturated: true,
addLeafletPopup: true,
type: 'tile_map',
mapType: type
};
=======
module('TileMapFactory');
inject(function (Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))(visLibParams);
require('css!components/vislib/styles/main');
vis.render(data);
});
>>>>>>>
module('TileMapFactory');
inject(function (Private) {
vis = Private(require('vislib_fixtures/_vis_fixture'))(visLibParams);
require('css!components/vislib/styles/main');
vis.render(data);
});
<<<<<<<
afterEach(function () {
vis.handler.charts.forEach(function (chart) {
chart.destroy();
});
$(vis.el).remove();
vis = null;
});
=======
function destroyVis(vis) {
$(vis.el).remove();
vis = null;
}
describe('TileMap Tests', function () {
describe('Rendering each types of tile map', function () {
dataArray.forEach(function (data, i) {
>>>>>>>
function destroyVis(vis) {
$(vis.el).remove();
vis = null;
}
describe('TileMap Tests', function () {
describe('Rendering each types of tile map', function () {
dataArray.forEach(function (data, i) {
<<<<<<<
describe('geohashMinDistance method', function () {
it('should return a number', function () {
vis.handler.charts.forEach(function (chart) {
var mapData = chart.chartData.geoJson;
var i = _.random(0, mapData.features.length - 1);
var feature = mapData.features[i];
expect(_.isFinite(chart.geohashMinDistance(feature))).to.be(true);
=======
beforeEach(function () {
vis = bootstrapAndRender(dataArray[0], 'Scaled Circle Markers');
leafletContainer = $(vis.el).find('.leaflet-container');
});
afterEach(function () {
destroyVis(vis);
});
it('should attach the zoom controls', function () {
expect(leafletContainer.find('.leaflet-control-zoom-in').length).to.be(1);
expect(leafletContainer.find('.leaflet-control-zoom-out').length).to.be(1);
});
it('should attach the filter drawing button', function () {
expect(leafletContainer.find('.leaflet-draw').length).to.be(1);
});
it('should attach the crop button', function () {
expect(leafletContainer.find('.leaflet-control-fit').length).to.be(1);
});
it('should not attach the filter or crop buttons if no data is present', function () {
var noData = {
geoJson: {
features: [],
properties: {
label: null,
length: 30,
min: 1,
max: 608,
precision: 1,
allmin: 1,
allmax: 608
},
hits: 20
}
};
vis.render(noData);
leafletContainer = $(vis.el).find('.leaflet-container');
expect(leafletContainer.find('.leaflet-control-fit').length).to.be(0);
expect(leafletContainer.find('.leaflet-draw').length).to.be(0);
});
});
// Probably only neccesary to test one of these as we already know the the map will render
describe('Methods', function () {
var vis;
var leafletContainer;
beforeEach(function () {
vis = bootstrapAndRender(dataArray[0], 'Scaled Circle Markers');
leafletContainer = $(vis.el).find('.leaflet-container');
});
afterEach(function () {
destroyVis(vis);
});
describe('_filterToMapBounds method', function () {
it('should filter out data points that are outside of the map bounds', function () {
vis.handler.charts.forEach(function (chart) {
chart.maps.forEach(function (map) {
var featuresLength = chart.chartData.geoJson.features.length;
var mapFeatureLength;
function getSize(obj) {
var size = 0;
var key;
for (key in obj) { if (obj.hasOwnProperty(key)) size++; }
return size;
}
map.setZoom(13); // Zoom in on the map!
mapFeatureLength = getSize(map._layers);
expect(mapFeatureLength).to.be.lessThan(featuresLength);
>>>>>>>
beforeEach(function () {
vis = bootstrapAndRender(dataArray[0], 'Scaled Circle Markers');
leafletContainer = $(vis.el).find('.leaflet-container');
});
afterEach(function () {
destroyVis(vis);
});
it('should attach the zoom controls', function () {
expect(leafletContainer.find('.leaflet-control-zoom-in').length).to.be(1);
expect(leafletContainer.find('.leaflet-control-zoom-out').length).to.be(1);
});
it('should attach the filter drawing button', function () {
expect(leafletContainer.find('.leaflet-draw').length).to.be(1);
});
it('should attach the crop button', function () {
expect(leafletContainer.find('.leaflet-control-fit').length).to.be(1);
});
it('should not attach the filter or crop buttons if no data is present', function () {
var noData = {
geoJson: {
features: [],
properties: {
label: null,
length: 30,
min: 1,
max: 608,
precision: 1,
allmin: 1,
allmax: 608
},
hits: 20
}
};
vis.render(noData);
leafletContainer = $(vis.el).find('.leaflet-container');
expect(leafletContainer.find('.leaflet-control-fit').length).to.be(0);
expect(leafletContainer.find('.leaflet-draw').length).to.be(0);
});
});
// Probably only neccesary to test one of these as we already know the the map will render
describe('Methods', function () {
var vis;
var leafletContainer;
beforeEach(function () {
vis = bootstrapAndRender(dataArray[0], 'Scaled Circle Markers');
leafletContainer = $(vis.el).find('.leaflet-container');
});
afterEach(function () {
destroyVis(vis);
});
describe('_filterToMapBounds method', function () {
it('should filter out data points that are outside of the map bounds', function () {
vis.handler.charts.forEach(function (chart) {
chart.maps.forEach(function (map) {
var featuresLength = chart.chartData.geoJson.features.length;
var mapFeatureLength;
function getSize(obj) {
var size = 0;
var key;
for (key in obj) { if (obj.hasOwnProperty(key)) size++; }
return size;
}
map.setZoom(13); // Zoom in on the map!
mapFeatureLength = getSize(map._layers);
expect(mapFeatureLength).to.be.lessThan(featuresLength);
<<<<<<<
describe('radiusScale method', function () {
it('should return a number', function () {
vis.handler.charts.forEach(function (chart) {
var count = Math.random() * 50;
var max = 50;
var precision = 1;
var mapData = chart.chartData.geoJson;
var i = _.random(0, mapData.features.length - 1);
var feature = mapData.features[i];
expect(_.isFinite(chart.radiusScale(count, max, feature))).to.be(true);
});
});
});
describe('applyShadingStyle method', function () {
it('should return an object', function () {
vis.handler.charts.forEach(function (chart) {
var mapData = chart.chartData.geoJson;
var i = _.random(0, mapData.features.length - 1);
var feature = mapData.features[i];
var min = mapData.properties.allmin;
var max = mapData.properties.allmax;
expect(_.isObject(chart.applyShadingStyle(feature, min, max))).to.be(true);
});
=======
describe('geohashMinDistance method', function () {
it('should return a number', function () {
vis.handler.charts.forEach(function (chart) {
var feature = chart.chartData.geoJson.features[0];
expect(_.isNumber(chart.geohashMinDistance(feature))).to.be(true);
>>>>>>>
describe('geohashMinDistance method', function () {
it('should return a number', function () {
vis.handler.charts.forEach(function (chart) {
var feature = chart.chartData.geoJson.features[0];
expect(_.isNumber(chart.geohashMinDistance(feature))).to.be(true);
<<<<<<<
describe('getMinMax method', function () {
it('should return an object', function () {
vis.handler.charts.forEach(function (chart) {
var data = chart.handler.data.data;
expect(_.isObject(chart.getMinMax(data))).to.be(true);
});
});
it('should return a min number', function () {
vis.handler.charts.forEach(function (chart) {
var data = chart.handler.data.data;
expect(_.isFinite(chart.getMinMax(data).min)).to.be(true);
});
});
it('should return a max number', function () {
vis.handler.charts.forEach(function (chart) {
var data = chart.handler.data.data;
expect(_.isFinite(chart.getMinMax(data).max)).to.be(true);
});
});
});
describe('dataToHeatArray method', function () {
it('should return an array', function () {
vis.handler.charts.forEach(function (chart) {
var mapData = chart.chartData.geoJson;
var max = mapData.properties.allmax;
expect(_.isArray(chart.dataToHeatArray(mapData, max))).to.be(true);
});
});
it('should return an array item for each feature', function () {
vis.handler.charts.forEach(function (chart) {
var mapData = chart.chartData.geoJson;
var max = mapData.properties.allmax;
expect(chart.dataToHeatArray(mapData, max).length).to.be(mapData.features.length);
});
});
});
=======
describe('quantizeColorScale method', function () {
it('should return a hex color', function () {
vis.handler.charts.forEach(function (chart) {
var reds = ['#fed976', '#feb24c', '#fd8d3c', '#f03b20', '#bd0026'];
var count = Math.random() * 300;
var min = 0;
var max = 300;
expect(_.indexOf(reds, chart.quantizeColorScale(count, min, max))).to.not.be(-1);
});
});
>>>>>>>
describe('quantizeColorScale method', function () {
it('should return a hex color', function () {
vis.handler.charts.forEach(function (chart) {
var reds = ['#fed976', '#feb24c', '#fd8d3c', '#f03b20', '#bd0026'];
var count = Math.random() * 300;
var min = 0;
var max = 300;
expect(_.indexOf(reds, chart.quantizeColorScale(count, min, max))).to.not.be(-1);
});
});
});
describe('getMinMax method', function () {
it('should return an object', function () {
vis.handler.charts.forEach(function (chart) {
var data = chart.handler.data.data;
expect(_.isObject(chart.getMinMax(data))).to.be(true);
});
});
it('should return a min number', function () {
vis.handler.charts.forEach(function (chart) {
var data = chart.handler.data.data;
expect(_.isFinite(chart.getMinMax(data).min)).to.be(true);
});
});
it('should return a max number', function () {
vis.handler.charts.forEach(function (chart) {
var data = chart.handler.data.data;
expect(_.isFinite(chart.getMinMax(data).max)).to.be(true);
});
});
});
describe('dataToHeatArray method', function () {
it('should return an array', function () {
vis.handler.charts.forEach(function (chart) {
var mapData = chart.chartData.geoJson;
var max = mapData.properties.allmax;
expect(_.isArray(chart.dataToHeatArray(mapData, max))).to.be(true);
});
});
it('should return an array item for each feature', function () {
vis.handler.charts.forEach(function (chart) {
var mapData = chart.chartData.geoJson;
var max = mapData.properties.allmax;
expect(chart.dataToHeatArray(mapData, max).length).to.be(mapData.features.length);
});
});
});
describe('applyShadingStyle method', function () {
it('should return an object', function () {
vis.handler.charts.forEach(function (chart) {
var mapData = chart.chartData.geoJson;
var i = _.random(0, mapData.features.length - 1);
var feature = mapData.features[i];
var min = mapData.properties.allmin;
var max = mapData.properties.allmax;
expect(_.isObject(chart.applyShadingStyle(feature, min, max))).to.be(true);
});
}); |
<<<<<<<
return function IndexPatternFactory(Private, timefilter, configFile, Notifier, config, Promise, $rootScope) {
=======
return function IndexPatternFactory(Private, timefilter, Notifier, config, Promise) {
>>>>>>>
return function IndexPatternFactory(Private, timefilter, Notifier, config, Promise, $rootScope) {
<<<<<<<
var Field = Private(require('components/index_patterns/_field'));
=======
var fieldTypes = Private(require('components/index_patterns/_field_types'));
var flattenHit = Private(require('components/index_patterns/_flatten_hit'));
>>>>>>>
var Field = Private(require('components/index_patterns/_field'));
<<<<<<<
=======
var shortDotsFilter = Private(require('filters/short_dots'));
>>>>>>>
<<<<<<<
self.metaFields = config.get('metaFields');
=======
self.flattenHit = _.partial(flattenHit, self);
>>>>>>>
self.metaFields = config.get('metaFields'); |
<<<<<<<
const allowSpyMode = function (visType) {
return !visType.requiresMultiSearch && visType.name !== 'kibi-data-table';
};
function VisSpyTableProvider($rootScope, Private) {
=======
import spyModesRegistry from 'ui/registry/spy_modes';
function VisSpyTableProvider(Notifier, $filter, $rootScope, config, Private) {
>>>>>>>
import spyModesRegistry from 'ui/registry/spy_modes';
const allowSpyMode = function (visType) {
return !visType.requiresMultiSearch && visType.name !== 'kibi-data-table';
};
function VisSpyTableProvider(Notifier, $filter, $rootScope, config, Private) { |
<<<<<<<
import Notifier from 'kibie/notify/notifier'; // kibi: import Kibi notifier
=======
import { Notifier } from 'ui/notify/notifier';
>>>>>>>
import { Notifier } from 'kibie/notify/notifier'; // kibi: import Kibi notifier |
<<<<<<<
export class Convert extends Processor {
constructor(processorId) {
super(processorId, 'convert', 'Convert');
this.sourceField = '';
this.type = 'string';
}
get description() {
const source = this.sourceField || '?';
const type = this.type || '?';
return `[${source}] to ${type}`;
}
get model() {
return {
processorId: this.processorId,
typeId: this.typeId,
sourceField: this.sourceField || '',
type: this.type || 'string'
};
}
};
=======
export class Append extends Processor {
constructor(processorId) {
super(processorId, 'append', 'Append');
this.targetField = '';
this.values = [];
}
get description() {
const target = this.targetField || '?';
return `[${target}]`;
}
get model() {
return {
processorId: this.processorId,
typeId: this.typeId,
targetField: this.targetField || '',
values: this.values || []
};
}
};
>>>>>>>
export class Append extends Processor {
constructor(processorId) {
super(processorId, 'append', 'Append');
this.targetField = '';
this.values = [];
}
get description() {
const target = this.targetField || '?';
return `[${target}]`;
}
get model() {
return {
processorId: this.processorId,
typeId: this.typeId,
targetField: this.targetField || '',
values: this.values || []
};
}
};
export class Convert extends Processor {
constructor(processorId) {
super(processorId, 'convert', 'Convert');
this.sourceField = '';
this.type = 'string';
}
get description() {
const source = this.sourceField || '?';
const type = this.type || '?';
return `[${source}] to ${type}`;
}
get model() {
return {
processorId: this.processorId,
typeId: this.typeId,
sourceField: this.sourceField || '',
type: this.type || 'string'
};
}
}; |
<<<<<<<
beforeEach(ngMock.inject(function (savedObjectsAPI, es, esAdmin, Private, $window) {
=======
beforeEach(ngMock.inject(function (es, esAdmin, Private, $window) {
>>>>>>>
beforeEach(ngMock.inject(function (es, esAdmin, Private, $window, savedObjectsAPI) {
<<<<<<<
return createInitializedSavedObject({type: 'dashboard', id: 'myId'}).then(savedObject => {
const _doIndex = function () {
=======
return createInitializedSavedObject({ type: 'dashboard', id: 'myId' }).then(savedObject => {
sinon.stub(DocSource.prototype, 'doIndex', function () {
>>>>>>>
return createInitializedSavedObject({ type: 'dashboard', id: 'myId' }).then(savedObject => {
const _doIndex = function () {
<<<<<<<
const originalId = 'id1';
return createInitializedSavedObject({type: 'dashboard', id: originalId}).then(savedObject => {
sinon.stub(DocSource.prototype, 'doIndex', _doIndex);
sinon.stub(SavedObjectSource.prototype, 'doIndex', _doIndex);
=======
const originalId = 'id1';
return createInitializedSavedObject({ type: 'dashboard', id: originalId }).then(savedObject => {
sinon.stub(DocSource.prototype, 'doIndex', function () {
return BluebirdPromise.reject('simulated error');
});
>>>>>>>
const originalId = 'id1';
return createInitializedSavedObject({ type: 'dashboard', id: originalId }).then(savedObject => {
sinon.stub(DocSource.prototype, 'doIndex', _doIndex);
sinon.stub(SavedObjectSource.prototype, 'doIndex', _doIndex);
<<<<<<<
return createInitializedSavedObject({type: 'dashboard', id: id}).then(savedObject => {
const _doIndex = function () {
=======
return createInitializedSavedObject({ type: 'dashboard', id: id }).then(savedObject => {
sinon.stub(DocSource.prototype, 'doIndex', function () {
>>>>>>>
return createInitializedSavedObject({ type: 'dashboard', id: id }).then(savedObject => {
const _doIndex = function () {
<<<<<<<
return createInitializedSavedObject({type: 'dashboard', id: id}).then(savedObject => {
const _doIndex = function () {
=======
return createInitializedSavedObject({ type: 'dashboard', id: id }).then(savedObject => {
sinon.stub(DocSource.prototype, 'doIndex', () => {
>>>>>>>
return createInitializedSavedObject({ type: 'dashboard', id: id }).then(savedObject => {
const _doIndex = function () {
<<<<<<<
return createInitializedSavedObject({type: 'dashboard'}).then(savedObject => {
const _doIndex = function () {
=======
return createInitializedSavedObject({ type: 'dashboard' }).then(savedObject => {
sinon.stub(DocSource.prototype, 'doIndex', () => {
>>>>>>>
return createInitializedSavedObject({ type: 'dashboard' }).then(savedObject => {
const _doIndex = function () { |
<<<<<<<
=======
it('should be created with mappings for config.buildNum', function () {
const fn = createKibanaIndex(server, mappings);
return fn.then(function () {
const params = callWithInternalUser.args[0][1];
expect(params)
.to.have.property('body');
expect(params.body)
.to.have.property('mappings');
expect(params.body.mappings)
.to.have.property('config');
expect(params.body.mappings.config)
.to.have.property('properties');
expect(params.body.mappings.config.properties)
.to.have.property('buildNum');
expect(params.body.mappings.config.properties.buildNum)
.to.have.property('type', 'keyword');
});
});
>>>>>>>
it('should be created with mappings for config.buildNum', function () {
const fn = createKibanaIndex(server, mappings);
return fn.then(function () {
const params = callWithInternalUser.args[0][1];
expect(params)
.to.have.property('body');
expect(params.body)
.to.have.property('mappings');
expect(params.body.mappings)
.to.have.property('config');
expect(params.body.mappings.config)
.to.have.property('properties');
expect(params.body.mappings.config.properties)
.to.have.property('buildNum');
expect(params.body.mappings.config.properties.buildNum)
.to.have.property('type', 'keyword');
});
}); |
<<<<<<<
if (!err.data) {
rtn += 'An error occurred while performing a request, please check your connection.';
} else {
rtn += 'Error ' + err.status + ' ' + err.statusText + ': ' + err.data.message;
}
} else if (has(err, 'options') && has(err, 'response')) {
// siren: added to handle request-promise errors
rtn += formatMsg.describeRequestPromiseError(err);
} else if (has(err, 'reason')) {
// siren: added to handle certificate errors
rtn += err.reason;
=======
if (err.status === -1) {
// status = -1 indicates that the request was failed to reach the server
rtn += 'An HTTP request has failed to connect. ' +
'Please check if the Kibana server is running and that your browser has a working connection, ' +
'or contact your system administrator.';
} else {
rtn += 'Error ' + err.status + ' ' + err.statusText + ': ' + err.data.message;
}
>>>>>>>
if (!err.data) {
rtn += 'An error occurred while performing a request, please check your connection.';
} else {
rtn += 'Error ' + err.status + ' ' + err.statusText + ': ' + err.data.message;
}
if (err.status === -1) {
// status = -1 indicates that the request was failed to reach the server
rtn += 'An HTTP request has failed to connect. ' +
'Please check if the Kibana server is running and that your browser has a working connection, ' +
'or contact your system administrator.';
} else {
rtn += 'Error ' + err.status + ' ' + err.statusText + ': ' + err.data.message;
}
} else if (has(err, 'options') && has(err, 'response')) {
// siren: added to handle request-promise errors
rtn += formatMsg.describeRequestPromiseError(err);
} else if (has(err, 'reason')) {
// siren: added to handle certificate errors
rtn += err.reason;
<<<<<<<
};
// siren: added by kibi
formatMsg.describeRequestPromiseError = function (err) {
let msg = `Error ${err.statusCode}: `;
if (typeof err.response.body === 'string') {
msg += err.response.body;
} else if (err.response.body.message) {
msg += err.response.body.message;
}
return msg;
};
// siren: end
=======
};
>>>>>>>
};
// siren: added by kibi
formatMsg.describeRequestPromiseError = function (err) {
let msg = `Error ${err.statusCode}: `;
if (typeof err.response.body === 'string') {
msg += err.response.body;
} else if (err.response.body.message) {
msg += err.response.body.message;
}
return msg;
};
// siren: end |
<<<<<<<
return function SavedObjectFactory(es, kbnIndex, Promise, Private, createNotifier, safeConfirm, indexPatterns) {
var angular = require('angular');
var errors = require('ui/errors');
var _ = require('lodash');
var kibiUtils = require('kibiutils');
=======
return function SavedObjectFactory(es, kbnIndex, Promise, Private, Notifier, safeConfirm, indexPatterns) {
let angular = require('angular');
let errors = require('ui/errors');
let _ = require('lodash');
let slugifyId = require('ui/utils/slugify_id');
>>>>>>>
return function SavedObjectFactory(es, kbnIndex, Promise, Private, createNotifier, safeConfirm, indexPatterns) {
let angular = require('angular');
let errors = require('ui/errors');
let _ = require('lodash');
let kibiUtils = require('kibiutils');
<<<<<<<
var notify = createNotifier({
=======
let notify = new Notifier({
>>>>>>>
let notify = createNotifier({
<<<<<<<
// kibi: add force flag
// issue: https://github.com/sirensolutions/kibi-internal/issues/918
self.saveSource = function (source, force) {
var finish = function (id) {
cache.flush(); // kibi: flush the cache after object was saved
=======
self.saveSource = function (source) {
let finish = function (id) {
>>>>>>>
// kibi: add force flag
// issue: https://github.com/sirensolutions/kibi-internal/issues/918
self.saveSource = function (source, force) {
let finish = function (id) {
cache.flush(); // kibi: flush the cache after object was saved
<<<<<<<
if (force) { // kibi: if the force flag is true, silently updates the document
return docSource.doIndex(source).then(finish);
} else {
return docSource.doCreate(source).then(finish)
.catch(function (err) {
// record exists, confirm overwriting
if (_.get(err, 'origError.status') === 409) {
var confirmMessage = 'Are you sure you want to overwrite ' + self.title + '?';
return safeConfirm(confirmMessage).then(
function () {
return docSource.doIndex(source).then(finish);
},
_.noop // if the user doesn't overwrite record, just swallow the error
);
} else {
notify.error(err); // kibi: added here so the errors are shown by notifier
}
return Promise.reject(err);
});
}
=======
return docSource.doCreate(source)
.then(finish)
.catch(function (err) {
// record exists, confirm overwriting
if (_.get(err, 'origError.status') === 409) {
let confirmMessage = 'Are you sure you want to overwrite ' + self.title + '?';
return safeConfirm(confirmMessage).then(
function () {
return docSource.doIndex(source).then(finish);
},
_.noop // if the user doesn't overwrite record, just swallow the error
);
}
return Promise.reject(err);
});
>>>>>>>
if (force) { // kibi: if the force flag is true, silently updates the document
return docSource.doIndex(source).then(finish);
} else {
return docSource.doCreate(source)
.then(finish)
.catch(function (err) {
// record exists, confirm overwriting
if (_.get(err, 'origError.status') === 409) {
let confirmMessage = 'Are you sure you want to overwrite ' + self.title + '?';
return safeConfirm(confirmMessage).then(
function () {
return docSource.doIndex(source).then(finish);
},
_.noop // if the user doesn't overwrite record, just swallow the error
);
} else {
notify.error(err); // kibi: added here so the errors are shown by notifier
}
return Promise.reject(err);
});
} |
<<<<<<<
let _ = require('lodash');
let $ = require('jquery');
let ngMock = require('ngMock');
let expect = require('expect.js');
let fixtures = require('fixtures/fake_hierarchical_data');
let $rootScope;
let $compile;
let tabifyAggResponse;
let Vis;
let indexPattern;
beforeEach(ngMock.module('kibana', function ($provide) {
$provide.constant('kbnDefaultAppId', '');
$provide.constant('kibiDefaultDashboardTitle', '');
$provide.constant('elasticsearchPlugins', ['siren-join']);
}));
=======
let $rootScope;
let $compile;
let tabifyAggResponse;
let Vis;
let indexPattern;
beforeEach(ngMock.module('kibana'));
>>>>>>>
let $rootScope;
let $compile;
let tabifyAggResponse;
let Vis;
let indexPattern;
beforeEach(ngMock.module('kibana', function ($provide) {
$provide.constant('kbnDefaultAppId', '');
$provide.constant('kibiDefaultDashboardTitle', '');
$provide.constant('elasticsearchPlugins', ['siren-join']);
}));
<<<<<<<
let $el = $('<kbn-agg-table-group group="group"></kbn-agg-table-group>');
=======
$scope.sort = {
columnIndex: null,
direction: null
};
let $el = $('<kbn-agg-table-group group="group"></kbn-agg-table-group>');
>>>>>>>
$scope.sort = {
columnIndex: null,
direction: null
};
const $el = $('<kbn-agg-table-group group="group"></kbn-agg-table-group>'); |
<<<<<<<
queueUrl,
templateUri,
useList,
=======
>>>>>>>
useList,
<<<<<<<
this.queueUrl = queueUrl;
this.templateUri = templateUri;
this.useList = useList;
=======
>>>>>>>
this.useList = useList; |
<<<<<<<
=======
let nodeUrl = win ? `${baseUri}/win-x86/node.exe` : `${baseUri}/node-v${nodeVersion}-${name}.tar.gz`;
>>>>>>> |
<<<<<<<
=======
var flattenHit = Private(require('components/index_patterns/_flatten_hit'));
var getComputedFields = require('components/index_patterns/_get_computed_fields');
>>>>>>> |
<<<<<<<
super({
tableName: process.env.GranulesTable,
tableHash: { name: 'granuleId', type: 'S' },
schema: granuleSchema
});
=======
// initiate the manager class with the name of the
// granules table
super(process.env.GranulesTable, granuleSchema);
}
/**
* Adds fileSize values from S3 object metadata for granules missing that information
*
* @param {Array<Object>} files - Array of files from a payload granule object
* @returns {Promise<Array>} - Updated array of files with missing fileSize appended
*/
addMissingFileSizes(files) {
const filePromises = files.map((file) => {
if (!('fileSize' in file)) {
return commonAws.headObject(file.bucket, file.filepath)
.then((result) => {
const updatedFile = file;
updatedFile.fileSize = result.ContentLength;
return updatedFile;
})
.catch((error) => {
log.error(`Error: ${error}`);
log.error(`Could not validate missing filesize for s3://${file.filename}`);
return file;
});
}
return Promise.resolve(file);
});
return Promise.all(filePromises);
}
/**
* Create the dynamoDB for this class
*
* @returns {Promise} aws dynamodb createTable response
*/
async createTable() {
const hash = { name: 'granuleId', type: 'S' };
return Manager.createTable(this.tableName, hash);
>>>>>>>
super({
tableName: process.env.GranulesTable,
tableHash: { name: 'granuleId', type: 'S' },
schema: granuleSchema
});
}
/**
* Adds fileSize values from S3 object metadata for granules missing that information
*
* @param {Array<Object>} files - Array of files from a payload granule object
* @returns {Promise<Array>} - Updated array of files with missing fileSize appended
*/
addMissingFileSizes(files) {
const filePromises = files.map((file) => {
if (!('fileSize' in file)) {
return commonAws.headObject(file.bucket, file.filepath)
.then((result) => {
const updatedFile = file;
updatedFile.fileSize = result.ContentLength;
return updatedFile;
})
.catch((error) => {
log.error(`Error: ${error}`);
log.error(`Could not validate missing filesize for s3://${file.filename}`);
return file;
});
}
return Promise.resolve(file);
});
return Promise.all(filePromises);
}
/**
* Create the dynamoDB for this class
*
* @returns {Promise} aws dynamodb createTable response
*/
async createTable() {
const hash = { name: 'granuleId', type: 'S' };
return Manager.createTable(this.tableName, hash); |
<<<<<<<
export default function (Promise, Private, es, esAdmin, kbnIndex, savedObjectsAPI, savedObjectsAPITypes) {
=======
export function DocSendToEsProvider(Promise, Private, es, esAdmin, kbnIndex) {
>>>>>>>
export function DocSendToEsProvider(Promise, Private, es, esAdmin, kbnIndex, savedObjectsAPI, savedObjectsAPITypes) { |
<<<<<<<
function IndexPatternsProvider(es, createNotifier, Private, Promise, kbnIndex) {
var self = this;
var _ = require('lodash');
var errors = require('ui/errors');
=======
function IndexPatternsProvider(es, Notifier, Private, Promise, kbnIndex) {
let self = this;
let _ = require('lodash');
let errors = require('ui/errors');
>>>>>>>
function IndexPatternsProvider(es, createNotifier, Private, Promise, kbnIndex) {
let self = this;
let _ = require('lodash');
let errors = require('ui/errors');
<<<<<<<
var notify = createNotifier({ location: 'IndexPatterns Service'});
=======
let notify = new Notifier({ location: 'IndexPatterns Service'});
>>>>>>>
let notify = createNotifier({ location: 'IndexPatterns Service'}); |
<<<<<<<
columns: '=',
columnAliases: '='
=======
columns: '=',
onAddColumn: '=',
onRemoveColumn: '=',
>>>>>>>
columns: '=',
columnAliases: '=',
onAddColumn: '=',
onRemoveColumn: '='
<<<<<<<
// kibi: constructing aliases map
$scope.aliases = {};
_.each($scope.fields, (fieldName) =>{
$scope.aliases[fieldName] = fieldName;
if ($scope.columns && $scope.columnAliases && $scope.columnAliases.length > 0) {
const index = $scope.columns.indexOf(fieldName);
if ($scope.columnAliases[index]) {
$scope.aliases[fieldName] = $scope.columnAliases[index];
}
}
});
// kibi: end
$scope.toggleColumn = function (fieldName) {
_.toggleInOut($scope.columns, fieldName);
=======
$scope.canToggleColumns = function canToggleColumn() {
return (
_.isFunction($scope.onAddColumn)
&& _.isFunction($scope.onRemoveColumn)
);
};
$scope.toggleColumn = function toggleColumn(columnName) {
if ($scope.columns.includes(columnName)) {
$scope.onRemoveColumn(columnName);
} else {
$scope.onAddColumn(columnName);
}
>>>>>>>
// kibi: constructing aliases map
$scope.aliases = {};
_.each($scope.fields, (fieldName) =>{
$scope.aliases[fieldName] = fieldName;
if ($scope.columns && $scope.columnAliases && $scope.columnAliases.length > 0) {
const index = $scope.columns.indexOf(fieldName);
if ($scope.columnAliases[index]) {
$scope.aliases[fieldName] = $scope.columnAliases[index];
}
}
});
// kibi: end
$scope.canToggleColumns = function canToggleColumn() {
return (
_.isFunction($scope.onAddColumn)
&& _.isFunction($scope.onRemoveColumn)
);
};
$scope.toggleColumn = function toggleColumn(columnName) {
if ($scope.columns.includes(columnName)) {
$scope.onRemoveColumn(columnName);
} else {
$scope.onAddColumn(columnName);
} |
<<<<<<<
const notif = createNotifier({ location: 'Search Looper' });
=======
>>>>>>> |
<<<<<<<
import ngMock from 'ng_mock';
import CourierFetchRequestSegmentedProvider from 'ui/courier/fetch/request/segmented';
import CourierFetchRequestSearchProvider from 'ui/courier/fetch/request/search';
describe('ui/courier/fetch/request/segmented', () => {
=======
import ngMock from 'ngMock';
>>>>>>>
import ngMock from 'ng_mock'; |
<<<<<<<
/* eslint-disable no-param-reassign */
=======
>>>>>>>
<<<<<<<
const region = process.env.AWS_DEFAULT_REGION || 'us-east-1';
AWS.config.update({ region: region });
exports.region = region;
=======
/**
* Join strings into an S3 key without a leading slash or double slashes
*
* @param {Array<string>} tokens - the strings to join
* @returns {string} the full S3 key
*/
function s3Join(tokens) {
const removeLeadingSlash = (token) => token.replace(/^\//, '');
const removeTrailingSlash = (token) => token.replace(/\/$/, '');
const isNotEmptyString = (token) => token.length > 0;
const key = tokens
.map(removeLeadingSlash)
.map(removeTrailingSlash)
.filter(isNotEmptyString)
.join('/');
if (tokens[tokens.length - 1].endsWith('/')) return `${key}/`;
return key;
}
exports.s3Join = s3Join;
const region = exports.region = process.env.AWS_DEFAULT_REGION || 'us-east-1';
if (region) {
AWS.config.update({ region: region });
}
>>>>>>>
/**
* Join strings into an S3 key without a leading slash or double slashes
*
* @param {Array<string>} tokens - the strings to join
* @returns {string} the full S3 key
*/
function s3Join(tokens) {
const removeLeadingSlash = (token) => token.replace(/^\//, '');
const removeTrailingSlash = (token) => token.replace(/\/$/, '');
const isNotEmptyString = (token) => token.length > 0;
const key = tokens
.map(removeLeadingSlash)
.map(removeTrailingSlash)
.filter(isNotEmptyString)
.join('/');
if (tokens[tokens.length - 1].endsWith('/')) return `${key}/`;
return key;
}
exports.s3Join = s3Join;
const region = exports.region = process.env.AWS_DEFAULT_REGION || 'us-east-1';
if (region) {
AWS.config.update({ region: region });
} |
<<<<<<<
export default function tabifyAggResponseProvider(Private, createNotifier) {
const AggConfig = Private(VisAggConfigProvider);
=======
export default function tabifyAggResponseProvider(Private, Notifier) {
>>>>>>>
export default function tabifyAggResponseProvider(Private, createNotifier) { |
<<<<<<<
=======
var defaultTimeout = config.timeouts.findTimeout;
>>>>>>> |
<<<<<<<
return function IndexPatternFactory(Private, timefilter, createNotifier, config, kbnIndex, Promise, $rootScope, safeConfirm) {
var _ = require('lodash');
var errors = require('ui/errors');
var angular = require('angular');
=======
return function IndexPatternFactory(Private, timefilter, Notifier, config, kbnIndex, Promise, $rootScope, safeConfirm) {
let _ = require('lodash');
let errors = require('ui/errors');
let angular = require('angular');
>>>>>>>
return function IndexPatternFactory(Private, timefilter, createNotifier, config, kbnIndex, Promise, $rootScope, safeConfirm) {
let _ = require('lodash');
let errors = require('ui/errors');
let angular = require('angular');
<<<<<<<
var notify = createNotifier();
=======
let notify = new Notifier();
>>>>>>>
let notify = createNotifier(); |
<<<<<<<
test.serial('creating a failed pdr record', async (t) => {
=======
test.serial('indexing collection records with different versions', async (t) => {
const name = randomString();
for (let i = 1; i < 11; i += 1) {
const version = `00${i}`;
const key = `key${i}`;
const value = `value${i}`;
const collection = {
name: name,
version: version,
[`${key}`]: value
};
const r = await indexer.indexCollection(esClient, collection, esIndex); // eslint-disable-line no-await-in-loop
// make sure record is created
t.is(r.result, 'created');
}
await esClient.indices.refresh();
// check each record exists and is not affected by other collections
for (let i = 1; i < 11; i += 1) {
const version = `00${i}`;
const key = `key${i}`;
const value = `value${i}`;
const collectionId = indexer.constructCollectionId(name, version);
const record = await esClient.get({ // eslint-disable-line no-await-in-loop
index: esIndex,
type: 'collection',
id: collectionId
});
t.is(record._id, collectionId);
t.is(record._source.name, name);
t.is(record._source.version, version);
t.is(record._source[key], value);
t.is(typeof record._source.timestamp, 'number');
}
});
test.serial('updating a collection record', async (t) => {
const collection = {
name: randomString(),
version: '001',
anyObject: {
key: 'value',
key1: 'value1',
key2: 'value2'
},
anyKey: 'anyValue'
};
// updatedCollection has some parameters removed
const updatedCollection = {
name: collection.name,
version: '001',
anyparams: {
key1: 'value1'
}
};
const collectionId = indexer.constructCollectionId(collection.name, collection.version);
let r = await indexer.indexCollection(esClient, collection, esIndex);
// make sure record is created
t.is(r.result, 'created');
// update the collection record
r = await indexer.indexCollection(esClient, updatedCollection, esIndex);
t.is(r.result, 'updated');
// check the record exists
const record = await esClient.get({
index: esIndex,
type: 'collection',
id: collectionId
});
t.is(record._id, collectionId);
t.is(record._source.name, updatedCollection.name);
t.is(record._source.version, updatedCollection.version);
t.deepEqual(record._source.anyparams, updatedCollection.anyparams);
t.is(record._source.anyKey, undefined);
t.is(typeof record._source.timestamp, 'number');
});
test.serial('indexing a failed pdr record', async (t) => {
const type = 'pdr';
>>>>>>>
test.serial('indexing collection records with different versions', async (t) => {
const name = randomString();
for (let i = 1; i < 11; i += 1) {
const version = `00${i}`;
const key = `key${i}`;
const value = `value${i}`;
const collection = {
name: name,
version: version,
[`${key}`]: value
};
const r = await indexer.indexCollection(esClient, collection, esIndex); // eslint-disable-line no-await-in-loop
// make sure record is created
t.is(r.result, 'created');
}
await esClient.indices.refresh();
// check each record exists and is not affected by other collections
for (let i = 1; i < 11; i += 1) {
const version = `00${i}`;
const key = `key${i}`;
const value = `value${i}`;
const collectionId = indexer.constructCollectionId(name, version);
const record = await esClient.get({ // eslint-disable-line no-await-in-loop
index: esIndex,
type: 'collection',
id: collectionId
});
t.is(record._id, collectionId);
t.is(record._source.name, name);
t.is(record._source.version, version);
t.is(record._source[key], value);
t.is(typeof record._source.timestamp, 'number');
}
});
test.serial('updating a collection record', async (t) => {
const collection = {
name: randomString(),
version: '001',
anyObject: {
key: 'value',
key1: 'value1',
key2: 'value2'
},
anyKey: 'anyValue'
};
// updatedCollection has some parameters removed
const updatedCollection = {
name: collection.name,
version: '001',
anyparams: {
key1: 'value1'
}
};
const collectionId = indexer.constructCollectionId(collection.name, collection.version);
let r = await indexer.indexCollection(esClient, collection, esIndex);
// make sure record is created
t.is(r.result, 'created');
// update the collection record
r = await indexer.indexCollection(esClient, updatedCollection, esIndex);
t.is(r.result, 'updated');
// check the record exists
const record = await esClient.get({
index: esIndex,
type: 'collection',
id: collectionId
});
t.is(record._id, collectionId);
t.is(record._source.name, updatedCollection.name);
t.is(record._source.version, updatedCollection.version);
t.deepEqual(record._source.anyparams, updatedCollection.anyparams);
t.is(record._source.anyKey, undefined);
t.is(typeof record._source.timestamp, 'number');
});
test.serial('creating a failed pdr record', async (t) => { |
<<<<<<<
// siren: custom validator for value
$scope.validator = function (validator, val) {
switch (validator) {
case 'positiveIntegerValidator':
if (!/^\+?(0|[1-9]\d*)$/.test(val)) {
return new Error('Should be positive integer but was [' + val + '].');
}
return parseInt(val);
default:
return new Error('Unknown validator [' + validator + '] for [' + val + '].');
}
};
// siren: end
=======
$scope.isDefaultValue = (conf) => {
// conf.isCustom = custom setting, provided by user, so there is no notion of
// having a default or non-default value for it
return conf.isCustom
|| conf.value === undefined
|| conf.value === ''
|| String(conf.value) === String(conf.defVal);
};
>>>>>>>
// siren: custom validator for value
$scope.validator = function (validator, val) {
switch (validator) {
case 'positiveIntegerValidator':
if (!/^\+?(0|[1-9]\d*)$/.test(val)) {
return new Error('Should be positive integer but was [' + val + '].');
}
return parseInt(val);
default:
return new Error('Unknown validator [' + validator + '] for [' + val + '].');
}
};
// siren: end
$scope.isDefaultValue = (conf) => {
// conf.isCustom = custom setting, provided by user, so there is no notion of
// having a default or non-default value for it
return conf.isCustom
|| conf.value === undefined
|| conf.value === ''
|| String(conf.value) === String(conf.defVal);
}; |
<<<<<<<
import { cloneDeep, defaultsDeep, isPlainObject } from 'lodash';
=======
import { isEqual, once, cloneDeep, defaultsDeep, isPlainObject } from 'lodash';
import uiRoutes from 'ui/routes';
>>>>>>>
import { isEqual, cloneDeep, defaultsDeep, isPlainObject } from 'lodash'; |
<<<<<<<
},
// kibi: added by kibi
'kibi:awesomeDemoMode' : {
value: false,
description: 'Set to true to suppress all warnings and errors'
},
'kibi:timePrecision' : {
type: 'string',
value: 's',
description: 'Set to generate time filters with certain precision. Possible values are: s, m, h, d, w, M, y'
},
'kibi:zoom' : {
value: 1.0,
description: 'Set the zoom level for the whole page. Good if the default size is too big for you. Does not work in Firefox.'
},
'kibi:relationalPanel': {
value: false,
description: 'Display the Relational panel in the dashboard tab'
},
'kibi:relations': {
type: 'json',
value: '{ "relationsIndices": [], "relationsDashboards": [], "version": 2 }',
description: 'Relations between index patterns and dashboards'
},
'kibi:panel_vertical_size': {
type: 'number',
value: 2,
description: 'Set to change the default vertical panel size.',
validator: 'positiveIntegerValidator'
},
'kibi:vertical_grid_resolution': {
type: 'number',
value: 100,
description: 'Set to change vertical grid resolution.',
validator: 'positiveIntegerValidator'
},
'kibi:enableAllDashboardsCounts' : {
value: true,
description: 'Enable counts on all dashboards.'
},
'kibi:enableAllRelBtnCounts' : {
value: true,
description: 'Enable counts on all relational buttons.'
=======
},
'indexPattern:placeholder': {
value: 'logstash-*',
description: 'The placeholder for the field "Index name or pattern" in the "Settings > Indices" tab.',
>>>>>>>
},
'indexPattern:placeholder': {
value: 'logstash-*',
description: 'The placeholder for the field "Index name or pattern" in the "Settings > Indices" tab.',
},
// kibi: added by kibi
'kibi:awesomeDemoMode' : {
value: false,
description: 'Set to true to suppress all warnings and errors'
},
'kibi:timePrecision' : {
type: 'string',
value: 's',
description: 'Set to generate time filters with certain precision. Possible values are: s, m, h, d, w, M, y'
},
'kibi:zoom' : {
value: 1.0,
description: 'Set the zoom level for the whole page. Good if the default size is too big for you. Does not work in Firefox.'
},
'kibi:relationalPanel': {
value: false,
description: 'Display the Relational panel in the dashboard tab'
},
'kibi:relations': {
type: 'json',
value: '{ "relationsIndices": [], "relationsDashboards": [], "version": 2 }',
description: 'Relations between index patterns and dashboards'
},
'kibi:panel_vertical_size': {
type: 'number',
value: 2,
description: 'Set to change the default vertical panel size.',
validator: 'positiveIntegerValidator'
},
'kibi:vertical_grid_resolution': {
type: 'number',
value: 100,
description: 'Set to change vertical grid resolution.',
validator: 'positiveIntegerValidator'
},
'kibi:enableAllDashboardsCounts' : {
value: true,
description: 'Enable counts on all dashboards.'
},
'kibi:enableAllRelBtnCounts' : {
value: true,
description: 'Enable counts on all relational buttons.'
<<<<<<<
// kibi: enterprise options
const enterpriseOptions = {
'kibi:shieldAuthorizationWarning': {
value: true,
description: 'Set to true to show all authorization warnings'
},
'kibi:graphUseWebGl' : {
value: true,
description: 'Set to false to disable WebGL rendering'
},
'kibi:graphUseFiltersFromDashboards' : {
value: false,
description: 'Set to true to use filters from dashboards on expansion'
},
'kibi:graphExpansionLimit' : {
value: 500,
description: 'Limit the number of elements to retrieve during the graph expansion'
},
'kibi:graphRelationFetchLimit' : {
value: 2500,
description: 'Limit the number of relations to retrieve after the graph expansion'
},
'kibi:graphMaxConcurrentCalls' : {
value: 15,
description: 'Limit the number of concurrent calls done by the Graph Browser'
}
};
if (kibiEnterpriseEnabled) {
return merge({}, options, enterpriseOptions);
}
// kibi: end
return options;
};
=======
}
>>>>>>>
// kibi: enterprise options
const enterpriseOptions = {
'kibi:shieldAuthorizationWarning': {
value: true,
description: 'Set to true to show all authorization warnings'
},
'kibi:graphUseWebGl' : {
value: true,
description: 'Set to false to disable WebGL rendering'
},
'kibi:graphUseFiltersFromDashboards' : {
value: false,
description: 'Set to true to use filters from dashboards on expansion'
},
'kibi:graphExpansionLimit' : {
value: 500,
description: 'Limit the number of elements to retrieve during the graph expansion'
},
'kibi:graphRelationFetchLimit' : {
value: 2500,
description: 'Limit the number of relations to retrieve after the graph expansion'
},
'kibi:graphMaxConcurrentCalls' : {
value: 15,
description: 'Limit the number of concurrent calls done by the Graph Browser'
}
};
if (kibiEnterpriseEnabled) {
return merge({}, options, enterpriseOptions);
}
// kibi: end
return options;
} |
<<<<<<<
export default function createUrlShortener(createNotifier, $http, $location, sirenSession) {
const notify = createNotifier({
=======
export default function createUrlShortener(Notifier, $http) {
const notify = new Notifier({
>>>>>>>
export default function createUrlShortener(createNotifier, $http, sirenSession) {
const notify = createNotifier({ |
<<<<<<<
import onlyDisabled from 'ui/filter_bar/lib/only_disabled';
import onlyStateChanged from 'ui/filter_bar/lib/only_state_changed';
import uniqFilters from 'ui/filter_bar/lib/uniq_filters';
import compareFilters from 'ui/filter_bar/lib/compare_filters';
import angular from 'angular';
import EventsProvider from 'ui/events';
import FilterBarLibMapAndFlattenFiltersProvider from 'ui/filter_bar/lib/map_and_flatten_filters';
export default function (Private, $rootScope, getAppState, globalState, config, kibiState) {
=======
import { onlyDisabled } from 'ui/filter_bar/lib/only_disabled';
import { onlyStateChanged } from 'ui/filter_bar/lib/only_state_changed';
import { uniqFilters } from 'ui/filter_bar/lib/uniq_filters';
import { compareFilters } from 'ui/filter_bar/lib/compare_filters';
import { EventsProvider } from 'ui/events';
import { FilterBarLibMapAndFlattenFiltersProvider } from 'ui/filter_bar/lib/map_and_flatten_filters';
export function FilterBarQueryFilterProvider(Private, $rootScope, getAppState, globalState, config) {
>>>>>>>
import { onlyDisabled } from 'ui/filter_bar/lib/only_disabled';
import { onlyStateChanged } from 'ui/filter_bar/lib/only_state_changed';
import { uniqFilters } from 'ui/filter_bar/lib/uniq_filters';
import { compareFilters } from 'ui/filter_bar/lib/compare_filters';
import { EventsProvider } from 'ui/events';
import { FilterBarLibMapAndFlattenFiltersProvider } from 'ui/filter_bar/lib/map_and_flatten_filters';
export function FilterBarQueryFilterProvider(Private, $rootScope, getAppState, globalState, config, kibiState) { |
<<<<<<<
let getKnownKibanaTypes = _.once(function () {
let indexName = kbnIndex;
return es.indices.getFieldMapping({
=======
let getKnownKibanaTypes = _.once(function () {
return esAdmin.indices.getFieldMapping({
>>>>>>>
const getKnownKibanaTypes = _.once(function () {
return esAdmin.indices.getFieldMapping({
<<<<<<<
// kibi: if the mapping for this type is managed by the saved objects api return true.
if (savedObjectsAPITypes.indexOf(type) >= 0) {
return true;
}
// kibi: end
return es.indices.putMapping({
=======
return esAdmin.indices.putMapping({
>>>>>>>
// kibi: if the mapping for this type is managed by the saved objects api return true.
if (savedObjectsAPITypes.indexOf(type) >= 0) {
return true;
}
// kibi: end
return esAdmin.indices.putMapping({ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.