Skip to content

Commit

Permalink
Merge branch 'main' into discover-flyouts
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Nov 18, 2022
2 parents 586b976 + 31ca644 commit 09dd4ad
Show file tree
Hide file tree
Showing 32 changed files with 537 additions and 165 deletions.
3 changes: 2 additions & 1 deletion .buildkite/disabled_jest_configs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[
"x-pack/plugins/triggers_actions_ui/jest.config.js",
"x-pack/plugins/watcher/jest.config.js"
"x-pack/plugins/watcher/jest.config.js",
"src/core/server/integration_tests/ui_settings/jest.integration.config.js"
]
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export async function pickTestGroupRunOrder() {
? globby.sync(['**/jest.integration.config.js', '!**/__fixtures__/**'], {
cwd: process.cwd(),
absolute: false,
ignore: DISABLED_JEST_CONFIGS,
})
: [];

Expand Down
121 changes: 117 additions & 4 deletions docs/api/actions-and-connectors/execute.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ refer to <<action-types>>.
`documents`::
(Required, array of objects) The documents to index in JSON format.

For more information, refer to
{kibana-ref}/index-action-type.html[Index connector and action].
For more information, refer to <<index-action-type>>.
=====
.Jira connectors
Expand Down Expand Up @@ -158,10 +157,124 @@ the knowledge base.
=======
======

For more information, refer to
{kibana-ref}/jira-action-type.html[{jira} connector and action].
For more information, refer to <<jira-action-type>>.
=====
.{opsgenie} connectors
[%collapsible%open]
=====
`subAction`::
(Required, string) The action to test. Valid values include: `createAlert` and
`closeAlert`.

`subActionParams`::
(Required, object) The set of configuration properties, which vary depending on
the `subAction` value.
+
.Properties when `subAction` is `createAlert`
[%collapsible%open]
======
`actions`::::
(Optional, array of strings) The custom actions available to the alert.
`alias`::::
(Optional, string) The unique identifier used for alert de-duplication in {opsgenie}.
`description`::::
(Optional, string) A description that provides detailed information about the alert.
`details`::::
(Optional, object) The custom properties of the alert. For example:
`{"key1":"value1","key2":"value2"}`.
`entity`::::
(Optional, string) The domain of the alert. For example, the application or server
name.
`message`::::
(Required, string) The alert message.
`note`::::
(Optional, string) Additional information for the alert.
`priority`::::
(Optional, string) The priority level for the alert. Valid values are: `P1`,
`P2`, `P3`, `P4`, and `P5`.
`responders`::::
(Optional, array of objects) The entities to receive notifications about the
alert. If `type` is `user`, either `id` or `username` is required. If `type` is
`team`, either `id` or `name` is required.
+
.Properties of `responders` objects
[%collapsible%open]
=======
`id`::::
(Required^*^, string) The identifier for the entity.

`name`::::
(Required^*^, string) The name of the entity.

`type`::::
(Required, string) Valid values are `escalation`, `schedule`, `team`, and `user`.

`username`::::
(Required^*^, string) A valid email address for the user.
=======
`source`::::
(Optional, string) The display name for the source of the alert.
`tags`::::
(Optional, array of strings) The tags for the alert.
`user`::::
(Optional, string) The display name for the owner.
`visibleTo`::::
(Optional, array of objects) The teams and users that the alert will be visible
to without sending a notification. Only one of `id`, `name`, or `username` is
required.
+
.Properties of `visibleTo` objects
[%collapsible%open]
=======
`id`::::
(Required^*^, string) The identifier for the entity.

`name`::::
(Required^*^, string) The name of the entity.

`type`::::
(Required, string) Valid values are `team` and `user`.

`username`::::
(Required^*^, string) The user name. This property is required only when the
`type` is `user`.
=======
======
+
.Properties when `subAction` is `closeAlert`
[%collapsible%open]
======
`alias`::::
(Required, string) The unique identifier used for alert de-duplication in {opsgenie}.
The alias must match the value used when creating the alert.
`note`::::
(Optional, string) Additional information for the alert.
`source`::::
(Optional, string) The display name for the source of the alert.
`user`::::
(Optional, string) The display name for the owner.
======

For more information, refer to <<opsgenie-action-type>>.
=====
.{sn-itom} connectors
[%collapsible%open]
=====
Expand Down
1 change: 1 addition & 0 deletions docs/management/action-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Rules use connectors to route actions to different destinations like log files,

[role="screenshot"]
image::images/connector-listing.png[Example connector listing in the {rules-ui} UI]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

[float]
=== Required permissions
Expand Down
Binary file modified docs/management/connectors/images/connector-listing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/management/connectors/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ include::action-types/resilient.asciidoc[]
include::action-types/index.asciidoc[]
include::action-types/jira.asciidoc[]
include::action-types/teams.asciidoc[]
include::action-types/opsgenie.asciidoc[]
include::action-types/pagerduty.asciidoc[]
include::action-types/server-log.asciidoc[]
include::action-types/servicenow.asciidoc[leveloffset=+1]
include::action-types/servicenow-sir.asciidoc[leveloffset=+1]
include::action-types/servicenow-itom.asciidoc[leveloffset=+1]
include::action-types/swimlane.asciidoc[]
include::action-types/slack.asciidoc[]
include::action-types/tines.asciidoc[leveloffset=+1]
include::action-types/webhook.asciidoc[]
include::action-types/cases-webhook.asciidoc[leveloffset=+1]
include::action-types/opsgenie.asciidoc[]
include::action-types/xmatters.asciidoc[]
include::action-types/tines.asciidoc[leveloffset=+1]
include::pre-configured-connectors.asciidoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ export const getPluginState = async (savedObjectsClient: SavedObjectsClient) =>
return pluginState;
} else {
// create a SO to keep track of the correct creation date
await updatePluginStatus(savedObjectsClient, 'not_started');
try {
await updatePluginStatus(savedObjectsClient, 'not_started');
// @yulia, we need to add a user permissions
// check here instead of swallowing this error
// see issue: https://github.com/elastic/kibana/issues/145434
// eslint-disable-next-line no-empty
} catch (e) {}

return {
status: 'not_started',
isActivePeriod: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,100 @@
* 2.0.
*/

import { login, visit } from '../../tasks/login';
import { completeTour, goToNextStep, skipTour } from '../../tasks/guided_onboarding';
import { OVERVIEW_URL } from '../../urls/navigation';
import { navigateFromHeaderTo } from '../../tasks/security_header';
import { ALERTS, TIMELINES } from '../../screens/security_header';
import { closeAlertFlyout, expandFirstAlert } from '../../tasks/alerts';
import {
WELCOME_STEP,
MANAGE_STEP,
ALERTS_STEP,
CASES_STEP,
DATA_STEP,
} from '../../screens/guided_onboarding';

before(() => {
login();
});
assertTourStepExist,
assertTourStepNotExist,
closeCreateCaseFlyout,
completeTourWithActions,
completeTourWithNextButton,
addToCase,
finishTour,
goToStep,
startTour,
} from '../../tasks/guided_onboarding';
import { cleanKibana } from '../../tasks/common';
import { createCustomRuleEnabled } from '../../tasks/api_calls/rules';
import { getNewRule } from '../../objects/rule';
import { ALERTS_URL, DASHBOARDS_URL } from '../../urls/navigation';
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
import { login, visit } from '../../tasks/login';
import { quitGlobalTour, startAlertsCasesTour } from '../../tasks/api_calls/tour';
import { AlertsCasesTourSteps } from '../../../public/common/components/guided_onboarding_tour/tour_config';

// need to redo these tests for new implementation
describe.skip('Guided onboarding tour', () => {
describe('Tour is enabled', () => {
beforeEach(() => {
visit(OVERVIEW_URL);
});
describe('Guided onboarding tour', () => {
before(() => {
cleanKibana();
login();
createCustomRuleEnabled({ ...getNewRule(), customQuery: 'user.name:*' });
});
beforeEach(() => {
startAlertsCasesTour();
visit(ALERTS_URL);
waitForAlertsToPopulate();
});
after(() => {
quitGlobalTour();
});
it('Completes the tour with next button clicks', () => {
startTour();
completeTourWithNextButton();
finishTour();
cy.url().should('include', DASHBOARDS_URL);
});

it('can be completed', () => {
// Step 1: Overview
cy.get(WELCOME_STEP).should('be.visible');
goToNextStep(WELCOME_STEP);
it('Completes the tour with action clicks', () => {
startTour();
completeTourWithActions();
finishTour();
cy.url().should('include', DASHBOARDS_URL);
});

// Step 2: Manage
cy.get(MANAGE_STEP).should('be.visible');
goToNextStep(MANAGE_STEP);
// unhappy paths
it('Resets the tour to step 1 when we navigate away', () => {
startTour();
goToStep(AlertsCasesTourSteps.expandEvent);
assertTourStepExist(AlertsCasesTourSteps.expandEvent);
assertTourStepNotExist(AlertsCasesTourSteps.pointToAlertName);
navigateFromHeaderTo(TIMELINES);
navigateFromHeaderTo(ALERTS);
assertTourStepNotExist(AlertsCasesTourSteps.expandEvent);
assertTourStepExist(AlertsCasesTourSteps.pointToAlertName);
});

// Step 3: Alerts
cy.get(ALERTS_STEP).should('be.visible');
goToNextStep(ALERTS_STEP);
describe('persists tour steps in flyout on flyout toggle', () => {
const stepsInAlertsFlyout = [
AlertsCasesTourSteps.reviewAlertDetailsFlyout,
AlertsCasesTourSteps.addAlertToCase,
AlertsCasesTourSteps.viewCase,
];

// Step 4: Cases
cy.get(CASES_STEP).should('be.visible');
goToNextStep(CASES_STEP);
const stepsInCasesFlyout = [AlertsCasesTourSteps.createCase, AlertsCasesTourSteps.submitCase];

// Step 5: Add data
cy.get(DATA_STEP).should('be.visible');
completeTour();
stepsInAlertsFlyout.forEach((step) => {
it(`step: ${step}, resets to ${step}`, () => {
startTour();
goToStep(step);
assertTourStepExist(step);
closeAlertFlyout();
assertTourStepNotExist(step);
expandFirstAlert();
assertTourStepExist(step);
});
});

it('can be skipped', () => {
cy.get(WELCOME_STEP).should('be.visible');

skipTour();
// step 1 is not displayed
cy.get(WELCOME_STEP).should('not.exist');
// step 2 is not displayed
cy.get(MANAGE_STEP).should('not.exist');
stepsInCasesFlyout.forEach((step) => {
it(`step: ${step}, resets to ${AlertsCasesTourSteps.createCase}`, () => {
startTour();
goToStep(step);
assertTourStepExist(step);
closeCreateCaseFlyout();
assertTourStepNotExist(step);
addToCase();
assertTourStepExist(AlertsCasesTourSteps.createCase);
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
* 2.0.
*/

export const WELCOME_STEP = '[data-test-subj="welcomeStep"]';
export const MANAGE_STEP = '[data-test-subj="manageStep"]';
export const ALERTS_STEP = '[data-test-subj="alertsStep"]';
export const CASES_STEP = '[data-test-subj="casesStep"]';
export const DATA_STEP = '[data-test-subj="dataStep"]';
export const ALERTS_STEP_GUIDE_BUTTON = '[data-test-subj="onboarding--stepButton--siem--step3"]';
export const COMPLETE_SIEM_GUIDE_BUTTON =
'[data-test-subj="onboarding--completeGuideButton--siem"]';

export const NEXT_STEP_BUTTON = '[data-test-subj="onboarding--securityTourNextStepButton"]';
export const END_TOUR_BUTTON = '[data-test-subj="onboarding--securityTourEndButton"]';
export const SKIP_TOUR_BUTTON = '[data-test-subj="onboarding--securityTourSkipButton"]';
export const COMPLETION_POPOVER = '[data-test-subj="manualCompletionPopover"]';

export const GLOBAL_TOUR_BUTTON = `[data-test-subj="guideButton"]`;

export const CLOSE_CREATE_CASE_FLYOUT = `[data-test-subj="create-case-flyout"] [data-test-subj="euiFlyoutCloseButton"]`;
Loading

0 comments on commit 09dd4ad

Please sign in to comment.