diff --git a/docs/apm/api.asciidoc b/docs/apm/api.asciidoc
new file mode 100644
index 0000000000000..b520cc46bef8d
--- /dev/null
+++ b/docs/apm/api.asciidoc
@@ -0,0 +1,260 @@
+[role="xpack"]
+[[apm-api]]
+== API
+
+Some APM app features are provided via a REST API:
+
+* <
-
+ Array test setting
+
+
+ }
>
-
- Array test setting
-
-
- }
- >
-
- Array test setting
-
-
- }
- >
-
+ Array test setting
+
+
+ }
+>
+
+ Array test setting
+
+ }
>
-
- Array test setting
-
- }
- >
-
+ Array test setting
+
+
+ }
>
-
- Array test setting
-
-
- }
- >
-
+ Array test setting
+
+ }
+>
+
+ Setting is currently not saved. +
+
-
-
-
-
-
-
-
+ {unsavedChanges.error + ? unsavedChanges.error + : i18n.translate('advancedSettings.field.settingIsUnsaved', { + defaultMessage: 'Setting is currently not saved.', + })} +
+{this.renderCountOfUnsaved()}
+
+
+
+
+
- {listItems.map(({ title, description }) => (
-
>
diff --git a/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/DeleteButton.tsx b/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/DeleteButton.tsx
index 496147b02589b..1564f1ae746a9 100644
--- a/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/DeleteButton.tsx
+++ b/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/DeleteButton.tsx
@@ -51,12 +51,18 @@ async function deleteConfig(
) {
try {
await callApmApi({
- pathname: '/api/apm/settings/agent-configuration/{configurationId}',
+ pathname: '/api/apm/settings/agent-configuration',
method: 'DELETE',
params: {
- path: { configurationId: selectedConfig.id }
+ body: {
+ service: {
+ name: selectedConfig.service.name,
+ environment: selectedConfig.service.environment
+ }
+ }
}
});
+
toasts.addSuccess({
title: i18n.translate(
'xpack.apm.settings.agentConf.flyout.deleteSection.deleteConfigSucceededTitle',
diff --git a/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/index.tsx
index 653dedea733f2..c77617fbb424f 100644
--- a/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/index.tsx
+++ b/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/index.tsx
@@ -135,8 +135,8 @@ export function AddEditFlyout({
sampleRate,
captureBody,
transactionMaxSpans,
- configurationId: selectedConfig ? selectedConfig.id : undefined,
agentName,
+ isExistingConfig: Boolean(selectedConfig),
toasts,
trackApmEvent
});
diff --git a/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/saveConfig.ts b/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/saveConfig.ts
index 19934cafb4694..d36120a054795 100644
--- a/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/saveConfig.ts
+++ b/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/saveConfig.ts
@@ -27,8 +27,8 @@ export async function saveConfig({
sampleRate,
captureBody,
transactionMaxSpans,
- configurationId,
agentName,
+ isExistingConfig,
toasts,
trackApmEvent
}: {
@@ -38,8 +38,8 @@ export async function saveConfig({
sampleRate: string;
captureBody: string;
transactionMaxSpans: string;
- configurationId?: string;
agentName?: string;
+ isExistingConfig: boolean;
toasts: NotificationsStart['toasts'];
trackApmEvent: UiTracker;
}) {
@@ -64,24 +64,14 @@ export async function saveConfig({
settings
};
- if (configurationId) {
- await callApmApi({
- pathname: '/api/apm/settings/agent-configuration/{configurationId}',
- method: 'PUT',
- params: {
- path: { configurationId },
- body: configuration
- }
- });
- } else {
- await callApmApi({
- pathname: '/api/apm/settings/agent-configuration/new',
- method: 'POST',
- params: {
- body: configuration
- }
- });
- }
+ await callApmApi({
+ pathname: '/api/apm/settings/agent-configuration',
+ method: 'PUT',
+ params: {
+ query: { overwrite: isExistingConfig },
+ body: configuration
+ }
+ });
toasts.addSuccess({
title: i18n.translate(
diff --git a/x-pack/legacy/plugins/apm/readme.md b/x-pack/legacy/plugins/apm/readme.md
index 2106243d12aea..a513249c296db 100644
--- a/x-pack/legacy/plugins/apm/readme.md
+++ b/x-pack/legacy/plugins/apm/readme.md
@@ -71,6 +71,28 @@ node scripts/jest.js plugins/apm --watch
node scripts/jest.js plugins/apm --updateSnapshot
```
+### Functional tests
+
+**Start server**
+`node scripts/functional_tests_server --config x-pack/test/functional/config.js`
+
+**Run tests**
+`node scripts/functional_test_runner --config x-pack/test/functional/config.js --grep='APM specs'`
+
+APM tests are located in `x-pack/test/functional/apps/apm`.
+For debugging access Elasticsearch on http://localhost:9220` (elastic/changeme)
+
+### API integration tests
+
+**Start server**
+`node scripts/functional_tests_server --config x-pack/test/api_integration/config.js`
+
+**Run tests**
+`node scripts/functional_test_runner --config x-pack/test/api_integration/config.js --grep='APM specs'`
+
+APM tests are located in `x-pack/test/api_integration/apis/apm`.
+For debugging access Elasticsearch on http://localhost:9220` (elastic/changeme)
+
### Linting
_Note: Run the following commands from `kibana/`._
diff --git a/x-pack/legacy/plugins/canvas/public/components/toolbar/__examples__/toolbar.stories.tsx b/x-pack/legacy/plugins/canvas/public/components/toolbar/__examples__/toolbar.stories.tsx
new file mode 100644
index 0000000000000..5907c932ddabb
--- /dev/null
+++ b/x-pack/legacy/plugins/canvas/public/components/toolbar/__examples__/toolbar.stories.tsx
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+/*
+ TODO: uncomment and fix this test to address storybook errors as a result of nested component dependencies - https://github.com/elastic/kibana/issues/58289
+ */
+
+/*
+import { action } from '@storybook/addon-actions';
+import { storiesOf } from '@storybook/react';
+import React from 'react';
+import { Toolbar } from '../toolbar';
+
+storiesOf('components/Toolbar', module)
+ .addDecorator(story => (
+
+
+
-
-
+
+
+
+
+
+