Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ingest-overview-page
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Harding committed Apr 17, 2020
2 parents e24269e + f179ec4 commit c5710fa
Show file tree
Hide file tree
Showing 26 changed files with 510 additions and 461 deletions.
16 changes: 8 additions & 8 deletions src/plugins/maps_legacy/public/__tests__/map/service_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,32 +143,32 @@ describe('service_settings (FKA tilemaptest)', function() {
}

it('accepts an object', async () => {
serviceSettings.addQueryParams({ foo: 'bar' });
serviceSettings.setQueryParams({ foo: 'bar' });
tilemapServices = await serviceSettings.getTMSServices();
await assertQuery({ foo: 'bar' });
});

it('merged additions with previous values', async () => {
// ensure that changes are always additive
serviceSettings.addQueryParams({ foo: 'bar' });
serviceSettings.addQueryParams({ bar: 'stool' });
serviceSettings.setQueryParams({ foo: 'bar' });
serviceSettings.setQueryParams({ bar: 'stool' });
tilemapServices = await serviceSettings.getTMSServices();
await assertQuery({ foo: 'bar', bar: 'stool' });
});

it('overwrites conflicting previous values', async () => {
// ensure that conflicts are overwritten
serviceSettings.addQueryParams({ foo: 'bar' });
serviceSettings.addQueryParams({ bar: 'stool' });
serviceSettings.addQueryParams({ foo: 'tstool' });
serviceSettings.setQueryParams({ foo: 'bar' });
serviceSettings.setQueryParams({ bar: 'stool' });
serviceSettings.setQueryParams({ foo: 'tstool' });
tilemapServices = await serviceSettings.getTMSServices();
await assertQuery({ foo: 'tstool', bar: 'stool' });
});

it('when overridden, should continue to work', async () => {
mapConfig.emsFileApiUrl = emsFileApiUrl2;
mapConfig.emsTileApiUrl = emsTileApiUrl2;
serviceSettings.addQueryParams({ foo: 'bar' });
serviceSettings.setQueryParams({ foo: 'bar' });
tilemapServices = await serviceSettings.getTMSServices();
await assertQuery({ foo: 'bar' });
});
Expand Down Expand Up @@ -292,7 +292,7 @@ describe('service_settings (FKA tilemaptest)', function() {

describe('File layers', function() {
it('should load manifest (all props)', async function() {
serviceSettings.addQueryParams({ foo: 'bar' });
serviceSettings.setQueryParams({ foo: 'bar' });
const fileLayers = await serviceSettings.getFileLayers();
expect(fileLayers.length).to.be(18);
const assertions = fileLayers.map(async function(fileLayer) {
Expand Down
9 changes: 7 additions & 2 deletions src/plugins/maps_legacy/public/map/service_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export class ServiceSettings {
return origin === ORIGIN.EMS && this._showZoomMessage;
}

enableZoomMessage() {
this._showZoomMessage = true;
}

disableZoomMessage() {
this._showZoomMessage = false;
}
Expand Down Expand Up @@ -148,11 +152,12 @@ export class ServiceSettings {
}

/**
* Add optional query-parameters to all requests
* Set optional query-parameters for all requests
*
* @param additionalQueryParams
*/
addQueryParams(additionalQueryParams) {
setQueryParams(additionalQueryParams) {
// Functions more as a "set" than an "add" in ems-client
this._emsClient.addQueryParams(additionalQueryParams);
}

Expand Down
2 changes: 0 additions & 2 deletions x-pack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { graph } from './legacy/plugins/graph';
import { monitoring } from './legacy/plugins/monitoring';
import { reporting } from './legacy/plugins/reporting';
import { security } from './legacy/plugins/security';
import { tilemap } from './legacy/plugins/tilemap';
import { dashboardMode } from './legacy/plugins/dashboard_mode';
import { logstash } from './legacy/plugins/logstash';
import { beats } from './legacy/plugins/beats_management';
Expand Down Expand Up @@ -40,7 +39,6 @@ module.exports = function(kibana) {
reporting(kibana),
spaces(kibana),
security(kibana),
tilemap(kibana),
dashboardMode(kibana),
logstash(kibana),
beats(kibana),
Expand Down
31 changes: 0 additions & 31 deletions x-pack/legacy/plugins/tilemap/index.js

This file was deleted.

This file was deleted.

This file was deleted.

32 changes: 0 additions & 32 deletions x-pack/legacy/plugins/tilemap/server/lib/inspect_settings.js

This file was deleted.

File renamed without changes.
8 changes: 8 additions & 0 deletions x-pack/plugins/maps_legacy_licensing/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "mapsLegacyLicensing",
"version": "8.0.0",
"kibanaVersion": "kibana",
"server": false,
"ui": true,
"requiredPlugins": ["licensing", "mapsLegacy"]
}
11 changes: 11 additions & 0 deletions x-pack/plugins/maps_legacy_licensing/public/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { MapsLegacyLicensing } from './plugin';

export function plugin() {
return new MapsLegacyLicensing();
}
49 changes: 49 additions & 0 deletions x-pack/plugins/maps_legacy_licensing/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { CoreSetup, CoreStart, Plugin } from 'kibana/public';
import { LicensingPluginSetup, ILicense } from '../../licensing/public';

/**
* These are the interfaces with your public contracts. You should export these
* for other plugins to use in _their_ `SetupDeps`/`StartDeps` interfaces.
* @public
*/

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface MapsLegacyLicensingSetupDependencies {
licensing: LicensingPluginSetup;
mapsLegacy: any;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface MapsLegacyLicensingStartDependencies {}

export type MapsLegacyLicensingSetup = ReturnType<MapsLegacyLicensing['setup']>;
export type MapsLegacyLicensingStart = ReturnType<MapsLegacyLicensing['start']>;

export class MapsLegacyLicensing
implements Plugin<MapsLegacyLicensingSetup, MapsLegacyLicensingStart> {
public setup(core: CoreSetup, plugins: MapsLegacyLicensingSetupDependencies) {
const {
licensing,
mapsLegacy: { serviceSettings },
} = plugins;
if (licensing) {
licensing.license$.subscribe((license: ILicense) => {
const { uid, isActive } = license;
if (isActive && license.hasAtLeast('basic')) {
serviceSettings.setQueryParams({ license: uid });
serviceSettings.disableZoomMessage();
} else {
serviceSettings.setQueryParams({ license: undefined });
serviceSettings.enableZoomMessage();
}
});
}
}

public start(core: CoreStart, plugins: MapsLegacyLicensingStartDependencies) {}
}
5 changes: 2 additions & 3 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -15960,7 +15960,7 @@
"xpack.triggersActionsUI.sections.alertAdd.saveButtonLabel": "保存",
"xpack.triggersActionsUI.sections.alertAdd.saveErrorNotificationText": "アラートを作成できません。",
"xpack.triggersActionsUI.sections.alertAdd.saveSuccessNotificationText": "「{alertName}」 を保存しました",
"xpack.triggersActionsUI.sections.alertAdd.selectIndex": "インデックスを選択してください",
"xpack.triggersActionsUI.sections.alertAdd.selectIndex": "インデックスを選択してください",
"xpack.triggersActionsUI.sections.alertAdd.threshold.closeIndexPopoverLabel": "閉じる",
"xpack.triggersActionsUI.sections.alertAdd.threshold.fixErrorInExpressionBelowValidationMessage": "下の表現のエラーを修正してください。",
"xpack.triggersActionsUI.sections.alertAdd.threshold.howToBroadenSearchQueryDescription": "* で検索クエリの範囲を広げます。",
Expand Down Expand Up @@ -16044,7 +16044,6 @@
"xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.muteAllTitle": "ミュート",
"xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.unmuteAllTitle": "ミュート解除",
"xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.deleteTitle": "削除",
"xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.enableTitle": "有効にする",
"xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.muteTitle": "ミュート",
"xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.popoverButtonTitle": "アクション",
"xpack.triggersActionsUI.components.emptyPrompt.emptyButton": "アラートの作成",
Expand Down Expand Up @@ -16757,4 +16756,4 @@
"xpack.watcher.watchEdit.thresholdWatchExpression.aggType.fieldIsRequiredValidationMessage": "フィールドを選択してください。",
"xpack.watcher.watcherDescription": "アラートの作成、管理、監視によりデータへの変更を検知します。"
}
}
}
7 changes: 3 additions & 4 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -15957,15 +15957,15 @@
"xpack.triggersActionsUI.sections.addModalConnectorForm.updateSuccessNotificationText": "已创建“{connectorName}”",
"xpack.triggersActionsUI.sections.alertAdd.betaBadgeTooltipContent": "{pluginName} 为公测版,可能会进行更改。设计和代码相对于正式发行版功能还不够成熟,将按原样提供,且不提供任何保证。公测版功能不受正式发行版功能支持 SLA 的约束。",
"xpack.triggersActionsUI.sections.alertAdd.cancelButtonLabel": "取消",
"xpack.triggersActionsUI.sections.alertAdd.conditionPrompt": "定义条件",
"xpack.triggersActionsUI.sections.alertAdd.conditionPrompt": "定义条件",
"xpack.triggersActionsUI.sections.alertAdd.errorLoadingAlertVisualizationTitle": "无法加载告警可视化",
"xpack.triggersActionsUI.sections.alertAdd.flyoutTitle": "创建告警",
"xpack.triggersActionsUI.sections.alertAdd.loadingAlertVisualizationDescription": "正在加载告警可视化……",
"xpack.triggersActionsUI.sections.alertAdd.previewAlertVisualizationDescription": "完成表达式以生成预览。",
"xpack.triggersActionsUI.sections.alertAdd.saveButtonLabel": "保存",
"xpack.triggersActionsUI.sections.alertAdd.saveErrorNotificationText": "无法创建告警。",
"xpack.triggersActionsUI.sections.alertAdd.saveSuccessNotificationText": "已保存“{alertName}”",
"xpack.triggersActionsUI.sections.alertAdd.selectIndex": "选择索引",
"xpack.triggersActionsUI.sections.alertAdd.selectIndex": "选择索引",
"xpack.triggersActionsUI.sections.alertAdd.threshold.closeIndexPopoverLabel": "关闭",
"xpack.triggersActionsUI.sections.alertAdd.threshold.fixErrorInExpressionBelowValidationMessage": "表达式包含错误。",
"xpack.triggersActionsUI.sections.alertAdd.threshold.howToBroadenSearchQueryDescription": "使用 * 可扩大您的查询范围。",
Expand Down Expand Up @@ -16049,7 +16049,6 @@
"xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.muteAllTitle": "静音",
"xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.unmuteAllTitle": "取消静音",
"xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.deleteTitle": "删除",
"xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.enableTitle": "启用",
"xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.muteTitle": "静音",
"xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.popoverButtonTitle": "操作",
"xpack.triggersActionsUI.components.emptyPrompt.emptyButton": "创建告警",
Expand Down Expand Up @@ -16762,4 +16761,4 @@
"xpack.watcher.watchEdit.thresholdWatchExpression.aggType.fieldIsRequiredValidationMessage": "此字段必填。",
"xpack.watcher.watcherDescription": "通过创建、管理和监测警报来检测数据中的更改。"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
.actAlertVisualization__chart {
height: $euiSize * 15;
height: $euiSize * 14;
}

.actAddAlertSteps {
.euiStep__titleWrapper {
align-items: center;
}

.euiStep__title {
@include euiTitle('xs');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent<IndexThr
const firstSetOfSteps = [
{
title: i18n.translate('xpack.triggersActionsUI.sections.alertAdd.selectIndex', {
defaultMessage: 'Select an index.',
defaultMessage: 'Select an index',
}),
children: (
<>
Expand Down Expand Up @@ -396,7 +396,7 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent<IndexThr
},
{
title: i18n.translate('xpack.triggersActionsUI.sections.alertAdd.conditionPrompt', {
defaultMessage: 'Define the condition.',
defaultMessage: 'Define the condition',
}),
children: (
<>
Expand Down Expand Up @@ -445,12 +445,10 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent<IndexThr
</Fragment>
) : null}
<EuiSpacer size="l" />
<EuiSteps steps={firstSetOfSteps} />
<EuiSpacer size="l" />
<EuiSteps className="actAddAlertSteps" steps={firstSetOfSteps} />
<div className="actAlertVisualization__chart">
{canShowVizualization ? (
<Fragment>
<EuiSpacer size="xl" />
<EuiEmptyPrompt
iconType="visBarVertical"
body={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export const EmptyPrompt = ({ onCTAClicked }: { onCTAClicked: () => void }) => (
data-test-subj="createFirstAlertButton"
key="create-action"
fill
iconType="plusInCircle"
iconSide="left"
onClick={onCTAClicked}
>
<FormattedMessage
Expand Down
Loading

0 comments on commit c5710fa

Please sign in to comment.