Skip to content

Commit

Permalink
Merge branch 'main' into 146162d-fix-group-mini-histograms
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Dec 19, 2022
2 parents 9be48a1 + aecad27 commit 537ea61
Show file tree
Hide file tree
Showing 336 changed files with 10,335 additions and 4,925 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
/src/plugins/ui_actions/ @elastic/kibana-global-experience
/src/plugins/ui_actions_enhanced/ @elastic/kibana-global-experience
/src/plugins/navigation/ @elastic/kibana-global-experience
/src/plugins/image_embeddable/ @elastic/kibana-global-experience
/x-pack/plugins/notifications/ @elastic/kibana-global-experience

## Examples
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"inspectorViews": "src/legacy/core_plugins/inspector_views",
"interactiveSetup": "src/plugins/interactive_setup",
"interpreter": "src/legacy/core_plugins/interpreter",
"imageEmbeddable": "src/plugins/image_embeddable",
"kbn": "src/legacy/core_plugins/kibana",
"kbnConfig": "packages/kbn-config/src",
"kbnDocViews": "src/legacy/core_plugins/kbn_doc_views",
Expand Down
5 changes: 5 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ for use in their own application.
|Moves the legacy ui/registry/feature_catalogue module for registering "features" that should be shown in the home page's feature catalogue to a service within a "home" plugin. The feature catalogue refered to here should not be confused with the "feature" plugin for registering features used to derive UI capabilities for feature controls.
|{kib-repo}blob/{branch}/src/plugins/image_embeddable/README.md[imageEmbeddable]
|This plugin contains image embeddable. Image embeddable allows to embed images into the dashboard.
Images can be added either by URL or by uploading the image file via file service.
|{kib-repo}blob/{branch}/src/plugins/input_control_vis/README.md[inputControlVis]
|Contains the input control visualization allowing to place custom filter controls on a dashboard.
Expand Down
29 changes: 29 additions & 0 deletions docs/management/upgrade-assistant.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[[upgrade-assistant]]
== Upgrade Assistant

The Upgrade Assistant helps you prepare for your upgrade
to the next version of the {stack}.
To access the assistant, go to *{stack-manage-app} > Upgrade Assistant*.

The assistant identifies deprecated settings in your configuration
and guides you through the process of resolving issues if any deprecated features are enabled.

[discrete]
=== Required permissions

The `manage` cluster privilege is required to access the *Upgrade assistant*.
Additional privileges may be needed to perform certain actions.

[discrete]
=== Feature set
Some features of the Upgrade assistant are only needed when upgrading to a new major version. The feature set enabled by default are those for the very next version from the one Kibana currently runs on.

[discrete]
=== Deprecations
The Upgrade assistant pulls information about deprecations from the following sources:

* Elasticsearch Deprecation Info API
* Elasticsearch deprecation logs
* Kibana deprecations API

For more information about the API's the Upgraed assistant provides, refer to <<upgrade-assistant-api, Upgrade Assistant APIs>>.
7 changes: 1 addition & 6 deletions docs/redirects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,6 @@ This content has moved. Refer to <<saved-object-migrations>>.

This content has moved. Refer to {stack-ref}/upgrading-kibana.html[Upgrade Kibana].

[role="exclude",id="upgrade-assistant"]
== Upgrade Assistant

This content has moved. Refer to {kibana-ref-all}/7.17/upgrade-assistant.html[Upgrade Assistant].

[role="exclude",id="brew"]
== Install {kib} on macOS with Homebrew

Expand All @@ -424,4 +419,4 @@ This page has been deleted. Refer to <<machine-learning-api-sync>>.
[role="exclude",id="managing-alerts-and-actions"]
== Alerts and Actions

This page has been deleted. Refer to <<alerting-getting-started>>.
This page has been deleted. Refer to <<alerting-getting-started>>.
2 changes: 1 addition & 1 deletion docs/setup/upgrade/resolving-migration-failures.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Migrations will fail if saved objects belong to an unknown
saved object type. Unknown saved objects are typically caused by performing manual modifications
to the {es} index (no longer allowed in 8.x), or by disabling a plugin that had previously created a saved object.

We recommend using the {kibana-ref-all}/7.17/upgrade-assistant.html[Upgrade Assistant]
We recommend using the <<upgrade-assistant,Upgrade Assistant>>
to discover and remedy any unknown saved object types. {kib} version 7.17.0 deployments containing unknown saved
object types will also log the following warning message:

Expand Down
2 changes: 1 addition & 1 deletion docs/setup/upgrade/saved-objects-migration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Each time you upgrade {kib}, an upgrade migration is performed to ensure that all <<managing-saved-objects,saved objects>> are compatible with the new version.

NOTE: To help you prepare for the upgrade to 8.0.0, 7.17.0 includes an https://www.elastic.co/guide/en/kibana/7.17/upgrade-assistant.html[*Upgrade Assistant*].
NOTE: {kib} includes an <<upgrade-assistant,*Upgrade Assistant*>> to help you prepare for an upgrade.
To access the assistant, go to *Stack Management > Upgrade Assistant*.

WARNING: {kib} 7.12.0 and later uses a new migration process and index naming scheme. Before you upgrade, read the documentation for your version of {kib}.
Expand Down
3 changes: 1 addition & 2 deletions docs/setup/upgrade/upgrade-standard.asciidoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[[upgrade-standard]]
=== Standard upgrade

NOTE: 7.17 includes an https://www.elastic.co/guide/en/kibana/7.17/upgrade-assistant.html[Upgrade Assistant]
to help you prepare for your upgrade to 8.0. To access the assistant, go to *Stack Management > Upgrade Assistant*.
NOTE: {kib} includes an <<upgrade-assistant,Upgrade Assistant>> to help you prepare for an upgrade. To access the assistant, go to *{stack-manage-app} > Upgrade Assistant*.

[IMPORTANT]
===========================================
Expand Down
2 changes: 2 additions & 0 deletions docs/user/management.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ include::{kib-repo-dir}/management/advanced-options.asciidoc[]

include::{kib-repo-dir}/management/managing-tags.asciidoc[]

include::{kib-repo-dir}/management/upgrade-assistant.asciidoc[]

include::{kib-repo-dir}/management/watcher-ui/index.asciidoc[]


8 changes: 0 additions & 8 deletions docs/user/security/audit-logging.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -407,19 +407,11 @@ Example: `[marketing]`
| *Field*
| *Description*

| `client.ip`
| Client IP address.

| `http.request.method`
| HTTP request method.

Example: `get`, `post`, `put`, `delete`

| `http.request.headers.x-forwarded-for`
| `X-Forwarded-For` request header used to identify the originating client IP address when connecting through proxy servers.

Example: `161.66.20.177, 236.198.214.101`

| `url.domain`
| Domain of the URL.

Expand Down
22 changes: 9 additions & 13 deletions packages/content-management/table_list/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Side Public License, v 1.
*/
import type { IHttpFetchError } from '@kbn/core-http-browser';
import type { CriteriaWithPagination, Direction, Query } from '@elastic/eui';
import type { Query } from '@elastic/eui';

import type { SortColumnField } from './components';
import type { State, UserContentCommonSchema } from './table_list_view';

/** Action to trigger a fetch of the table items */
export interface OnFetchItemsAction {
Expand Down Expand Up @@ -49,17 +49,14 @@ export interface OnSelectionChangeAction<T> {
}

/** Action to update the state of the table whenever the sort or page size changes */
export interface OnTableChangeAction<T> {
export interface OnTableChangeAction<T extends UserContentCommonSchema> {
type: 'onTableChange';
data: CriteriaWithPagination<T>;
}

/** Action to update the sort column of the table */
export interface OnTableSortChangeAction<T> {
type: 'onTableSortChange';
data: {
field: SortColumnField;
direction: Direction;
sort?: State<T>['tableSort'];
page?: {
pageIndex: number;
pageSize: number;
};
};
}

Expand All @@ -77,13 +74,12 @@ export interface OnSearchQueryChangeAction {
};
}

export type Action<T> =
export type Action<T extends UserContentCommonSchema> =
| OnFetchItemsAction
| OnFetchItemsSuccessAction<T>
| OnFetchItemsErrorAction
| DeleteItemsActions
| OnSelectionChangeAction<T>
| OnTableChangeAction<T>
| OnTableSortChangeAction<T>
| ShowConfirmDeleteItemsModalAction
| OnSearchQueryChangeAction;
20 changes: 4 additions & 16 deletions packages/content-management/table_list/src/components/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
SearchFilterConfig,
Direction,
Query,
Ast,
} from '@elastic/eui';

import { useServices } from '../services';
Expand Down Expand Up @@ -54,6 +53,7 @@ interface Props<T extends UserContentCommonSchema> extends State<T>, TagManageme
deleteItems: TableListViewProps<T>['deleteItems'];
onSortChange: (column: SortColumnField, direction: Direction) => void;
onTableChange: (criteria: CriteriaWithPagination<T>) => void;
onTableSearchChange: (arg: { query: Query | null; queryText: string }) => void;
clearTagSelection: () => void;
}

Expand All @@ -73,6 +73,7 @@ export function Table<T extends UserContentCommonSchema>({
deleteItems,
tableCaption,
onTableChange,
onTableSearchChange,
onSortChange,
addOrRemoveExcludeTagFilter,
addOrRemoveIncludeTagFilter,
Expand Down Expand Up @@ -128,19 +129,6 @@ export function Table<T extends UserContentCommonSchema>({
addOrRemoveIncludeTagFilter,
});

const onSearchQueryChange = useCallback(
(arg: { query: Query | null; queryText: string }) => {
dispatch({
type: 'onSearchQueryChange',
data: {
query: arg.query ?? new Query(Ast.create([]), undefined, arg.queryText),
text: arg.queryText,
},
});
},
[dispatch]
);

const tableSortSelectFilter = useMemo<SearchFilterConfig>(() => {
return {
type: 'custom_component',
Expand Down Expand Up @@ -191,7 +179,7 @@ export function Table<T extends UserContentCommonSchema>({

const search = useMemo(() => {
return {
onChange: onSearchQueryChange,
onChange: onTableSearchChange,
toolsLeft: renderToolsLeft(),
query: searchQuery.query ?? undefined,
box: {
Expand All @@ -200,7 +188,7 @@ export function Table<T extends UserContentCommonSchema>({
},
filters: searchFilters,
};
}, [onSearchQueryChange, renderToolsLeft, searchFilters, searchQuery.query]);
}, [onTableSearchChange, renderToolsLeft, searchFilters, searchQuery.query]);

const noItemsMessage = (
<FormattedMessage
Expand Down
30 changes: 20 additions & 10 deletions packages/content-management/table_list/src/reducer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import type { State, UserContentCommonSchema } from './table_list_view';
import type { Action } from './actions';

export function getReducer<T extends UserContentCommonSchema>() {
let sortColumnChanged = false;

return (state: State<T>, action: Action<T>): State<T> => {
switch (action.type) {
case 'onFetchItems': {
Expand All @@ -26,7 +28,10 @@ export function getReducer<T extends UserContentCommonSchema>() {
// We only get the state on the initial fetch of items
// After that we don't want to reset the columns or change the sort after fetching
hasUpdatedAtMetadata = Boolean(items.find((item) => Boolean(item.updatedAt)));
if (hasUpdatedAtMetadata) {

// Only change the table sort if it hasn't been changed already.
// For example if its state comes from the URL, we don't want to override it here.
if (hasUpdatedAtMetadata && !sortColumnChanged) {
tableSort = {
field: 'updatedAt' as const,
direction: 'desc' as const,
Expand Down Expand Up @@ -58,30 +63,35 @@ export function getReducer<T extends UserContentCommonSchema>() {
};
}
case 'onSearchQueryChange': {
if (action.data.text === state.searchQuery.text) {
return state;
}

return {
...state,
searchQuery: action.data,
isFetchingItems: true,
};
}
case 'onTableChange': {
const tableSort = (action.data.sort as State['tableSort']) ?? state.tableSort;
if (action.data.sort) {
sortColumnChanged = true;
}

const tableSort = action.data.sort ?? state.tableSort;
const pageIndex = action.data.page?.pageIndex ?? state.pagination.pageIndex;
const pageSize = action.data.page?.pageSize ?? state.pagination.pageSize;

return {
...state,
pagination: {
...state.pagination,
pageIndex: action.data.page.index,
pageSize: action.data.page.size,
pageIndex,
pageSize,
},
tableSort,
};
}
case 'onTableSortChange': {
return {
...state,
tableSort: action.data,
};
}
case 'showConfirmDeleteItemsModal': {
return {
...state,
Expand Down
12 changes: 6 additions & 6 deletions packages/content-management/table_list/src/services.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ export interface Services {
notifyError: NotifyFn;
currentAppId$: Observable<string | undefined>;
navigateToUrl: (url: string) => Promise<void> | void;
searchQueryParser?: (searchQuery: string) => {
searchQueryParser?: (searchQuery: string) => Promise<{
searchQuery: string;
references?: SavedObjectsFindOptionsReference[];
referencesToExclude?: SavedObjectsFindOptionsReference[];
};
}>;
DateFormatterComp?: DateFormatter;
/** Handler to retrieve the list of available tags */
getTagList: () => Tag[];
Expand Down Expand Up @@ -142,12 +142,12 @@ export interface TableListViewKibanaDependencies {
useName?: boolean;
tagField?: string;
}
) => {
) => Promise<{
searchTerm: string;
tagReferences: SavedObjectsFindOptionsReference[];
tagReferencesToExclude: SavedObjectsFindOptionsReference[];
valid: boolean;
};
}>;
getTagList: () => Tag[];
getTagIdsFromReferences: (references: SavedObjectsReference[]) => string[];
};
Expand All @@ -167,8 +167,8 @@ export const TableListViewKibanaProvider: FC<TableListViewKibanaDependencies> =

const searchQueryParser = useMemo(() => {
if (savedObjectsTagging) {
return (searchQuery: string) => {
const res = savedObjectsTagging.ui.parseSearchQuery(searchQuery, { useName: true });
return async (searchQuery: string) => {
const res = await savedObjectsTagging.ui.parseSearchQuery(searchQuery, { useName: true });
return {
searchQuery: res.searchTerm,
references: res.tagReferences,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const requiredProps: TableListViewProps = {
tableListTitle: 'test title',
findItems: jest.fn().mockResolvedValue({ total: 0, hits: [] }),
getDetailViewLink: () => 'http://elastic.co',
urlStateEnabled: false,
};

// FLAKY: https://github.com/elastic/kibana/issues/145267
Expand All @@ -66,7 +67,7 @@ describe.skip('TableListView', () => {
WithServices<TableListViewProps>(TableListView),
{
defaultProps: { ...requiredProps },
memoryRouter: { wrapComponent: false },
memoryRouter: { wrapComponent: true },
}
);

Expand Down Expand Up @@ -333,7 +334,7 @@ describe.skip('TableListView', () => {
WithServices<TableListViewProps>(TableListView, { TagList: getTagList({ references: [] }) }),
{
defaultProps: { ...requiredProps },
memoryRouter: { wrapComponent: false },
memoryRouter: { wrapComponent: true },
}
);

Expand Down Expand Up @@ -544,7 +545,7 @@ describe.skip('TableListView', () => {
WithServices<TableListViewProps>(TableListView),
{
defaultProps: { ...requiredProps },
memoryRouter: { wrapComponent: false },
memoryRouter: { wrapComponent: true },
}
);

Expand Down Expand Up @@ -602,7 +603,7 @@ describe.skip('TableListView', () => {
}),
{
defaultProps: { ...requiredProps },
memoryRouter: { wrapComponent: false },
memoryRouter: { wrapComponent: true },
}
);

Expand Down
Loading

0 comments on commit 537ea61

Please sign in to comment.