Skip to content

Commit

Permalink
Merge branch 'main' into updateAxeCoreVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavyarm authored Mar 28, 2023
2 parents 274e0af + 2cc12ce commit 71d6927
Show file tree
Hide file tree
Showing 41 changed files with 445 additions and 3,463 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,17 @@ export interface ISavedObjectsRepository {
/**
* Updates all objects containing a reference to the given {type, id} tuple to remove the said reference.
*
* @remarks Will throw a conflict error if the `update_by_query` operation returns any failure. In that case
* some references might have been removed, and some were not. It is the caller's responsibility
* to handle and fix this situation if it was to happen.
* @remarks
* Will throw a conflict error if the `update_by_query` operation returns any failure. In that case some
* references might have been removed, and some were not. It is the caller's responsibility to handle and fix
* this situation if it was to happen.
*
* Intended use is to provide clean up of any references to an object which is being deleted (e.g. deleting
* a tag). See discussion here: https://github.com/elastic/kibana/issues/135259#issuecomment-1482515139
*
* When security is enabled, authorization for this method is based only on authorization to delete the object
* represented by the {type, id} tuple. Therefore it is recommended only to call this method for the intended
* use case.
*
* @param {string} type - the type of the object to remove references to
* @param {string} id - the ID of the object to remove references to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,12 @@ export interface ISavedObjectsSecurityExtension {
) => Promise<CheckAuthorizationResult<A>>;

/**
* Performs authorization for the REMOVE_REFERENCES security action
* Performs authorization for the REMOVE_REFERENCES security action. Checks for authorization
* to delete the object to which references are to be removed. In reality, the operation is an
* UPDATE to all objects that reference the given object, but the intended use for the
* removeReferencesTo method is to clean up any references to an object which is being deleted
* (e.g. deleting a tag).
* See discussion here: https://github.com/elastic/kibana/issues/135259#issuecomment-1482515139
* @param params the namespace and object to authorize
* @returns CheckAuthorizationResult - the resulting authorization level and authorization map
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function ScriptRecorderFields({ onChange, script, fileName, isEditable }:
iconSide="right"
>
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.browser.zipUrl.showScriptLabel"
id="xpack.synthetics.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.browser.recorder.showScriptLabel"
defaultMessage="Show script"
/>
</EuiButton>
Expand All @@ -78,7 +78,7 @@ export function ScriptRecorderFields({ onChange, script, fileName, isEditable }:
color="danger"
>
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.browser.zipUrl.removeScriptLabel"
id="xpack.synthetics.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.browser.recorder.removeScriptLabel"
defaultMessage="Remove script"
/>
</EuiButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
defaultBrowserAdvancedFields as defaultConfig,
defaultBrowserSimpleFields,
} from '../contexts';
import { validate as centralValidation } from '../validation';
import { validate as centralValidation } from '../../monitor_management/validation';
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react';

const defaultValidation = centralValidation[DataStream.BROWSER];
Expand Down Expand Up @@ -89,29 +89,14 @@ describe('<BrowserAdvancedFields />', () => {
});
});

it('only displayed filter options when zip url is truthy', () => {
const { queryByText, getByText, rerender } = render(<WrappedComponent />);
it('does not display filter options (zip url has been deprecated)', () => {
const { queryByText } = render(<WrappedComponent />);

expect(
queryByText(
/Use these options to apply the selected monitor settings to a subset of the tests in your suite./
)
).not.toBeInTheDocument();

rerender(
<WrappedComponent
defaultSimpleFields={{
...defaultBrowserSimpleFields,
[ConfigKey.SOURCE_ZIP_URL]: 'https://elastic.zip',
}}
/>
);

expect(
getByText(
/Use these options to apply the selected monitor settings to a subset of the tests in your suite./
)
).toBeInTheDocument();
});

it('renders upstream fields', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@

import React, { memo, useCallback } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import {
EuiAccordion,
EuiSelect,
EuiFieldText,
EuiCheckbox,
EuiFormRow,
EuiSpacer,
} from '@elastic/eui';
import { EuiAccordion, EuiSelect, EuiCheckbox, EuiFormRow, EuiSpacer } from '@elastic/eui';
import { ComboBox } from '../combo_box';
import { DescribedFormGroupWithWrap } from '../common/described_form_group_with_wrap';

import { useBrowserAdvancedFieldsContext, useBrowserSimpleFieldsContext } from '../contexts';
import { useBrowserAdvancedFieldsContext } from '../contexts';

import { ConfigKey, Validation, ScreenshotOption } from '../types';

Expand All @@ -35,7 +28,6 @@ interface Props {
export const BrowserAdvancedFields = memo<Props>(
({ validate, children, minColumnWidth, onFieldBlur }) => {
const { fields, setFields } = useBrowserAdvancedFieldsContext();
const { fields: simpleFields } = useBrowserSimpleFieldsContext();

const handleInputChange = useCallback(
({ value, configKey }: { value: unknown; configKey: ConfigKey }) => {
Expand All @@ -51,78 +43,6 @@ export const BrowserAdvancedFields = memo<Props>(
data-test-subj="syntheticsBrowserAdvancedFieldsAccordion"
>
<EuiSpacer size="m" />
{simpleFields[ConfigKey.SOURCE_ZIP_URL] && (
<DescribedFormGroupWithWrap
minColumnWidth={minColumnWidth}
title={
<h4>
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.browserAdvancedSettings.filtering.title"
defaultMessage="Selective tests"
/>
</h4>
}
description={
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.browserAdvancedSettings.filtering.description"
defaultMessage="Use these options to apply the selected monitor settings to a subset of the tests in your suite. Only the configured subset will be run by this monitor."
/>
}
>
<EuiSpacer size="s" />
<EuiFormRow
label={
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.browserAdvancedSettings.journeyFiltersMatch.label"
defaultMessage="Filter match"
/>
}
labelAppend={<OptionalLabel />}
helpText={
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.browserAdvancedSettings.journeyFiltersMatch.helpText"
defaultMessage="Run only journeys with a name that matches the provided glob with this monitor."
/>
}
>
<EuiFieldText
value={fields[ConfigKey.JOURNEY_FILTERS_MATCH]}
onChange={(event) =>
handleInputChange({
value: event.target.value,
configKey: ConfigKey.JOURNEY_FILTERS_MATCH,
})
}
onBlur={() => onFieldBlur?.(ConfigKey.JOURNEY_FILTERS_MATCH)}
data-test-subj="syntheticsBrowserJourneyFiltersMatch"
/>
</EuiFormRow>
<EuiFormRow
label={
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.browserAdvancedSettings.journeyFiltersTags.label"
defaultMessage="Filter tags"
/>
}
labelAppend={<OptionalLabel />}
helpText={
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.browserAdvancedSettings.journeyFiltersTags.helpText"
defaultMessage="Run only journeys with the given tags with this monitor."
/>
}
>
<ComboBox
selectedOptions={fields[ConfigKey.JOURNEY_FILTERS_TAGS]}
onChange={(value) =>
handleInputChange({ value, configKey: ConfigKey.JOURNEY_FILTERS_TAGS })
}
onBlur={() => onFieldBlur?.(ConfigKey.JOURNEY_FILTERS_TAGS)}
data-test-subj="syntheticsBrowserJourneyFiltersTags"
/>
</EuiFormRow>
</DescribedFormGroupWithWrap>
)}
<DescribedFormGroupWithWrap
minColumnWidth={minColumnWidth}
title={
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 71d6927

Please sign in to comment.