Skip to content

Commit

Permalink
Merge branch 'main' into 30-builtin-service-definition
Browse files Browse the repository at this point in the history
  • Loading branch information
klacabane authored Jul 9, 2024
2 parents 1b13eaf + ff651f2 commit 644da09
Show file tree
Hide file tree
Showing 589 changed files with 11,439 additions and 6,829 deletions.
9 changes: 6 additions & 3 deletions .buildkite/scripts/steps/serverless/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,12 @@ EOF

is_pr_with_label "ci:project-deploy-elasticsearch" && deploy "elasticsearch"
if is_pr_with_label "ci:project-deploy-observability" ; then
create_github_issue_oblt_test_environments
echo "--- Deploy observability with Kibana CI"
deploy "observability"
# Only deploy observability if the PR is targeting main
if [[ "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" == "main" ]]; then
create_github_issue_oblt_test_environments
echo "--- Deploy observability with Kibana CI"
deploy "observability"
fi
fi
is_pr_with_label "ci:project-deploy-security" && deploy "security"

Expand Down
31 changes: 16 additions & 15 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ packages/kbn-eslint-plugin-imports @elastic/kibana-operations
packages/kbn-eslint-plugin-telemetry @elastic/obs-knowledge-team
examples/eso_model_version_example @elastic/kibana-security
x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin @elastic/kibana-security
src/plugins/esql @elastic/kibana-esql
packages/kbn-esql-ast @elastic/kibana-esql
examples/esql_ast_inspector @elastic/kibana-esql
src/plugins/esql_datagrid @elastic/kibana-esql
Expand All @@ -422,7 +423,7 @@ x-pack/plugins/event_log @elastic/response-ops
packages/kbn-expandable-flyout @elastic/security-threat-hunting-investigations
packages/kbn-expect @elastic/kibana-operations @elastic/appex-qa
x-pack/examples/exploratory_view_example @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/exploratory_view @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/exploratory_view @elastic/obs-ux-management-team
src/plugins/expression_error @elastic/kibana-presentation
src/plugins/chart_expressions/expression_gauge @elastic/kibana-visualizations
src/plugins/chart_expressions/expression_heatmap @elastic/kibana-visualizations
Expand Down Expand Up @@ -658,6 +659,7 @@ packages/react/kibana_context/root @elastic/appex-sharedux
packages/react/kibana_context/styled @elastic/appex-sharedux
packages/react/kibana_context/theme @elastic/appex-sharedux
packages/react/kibana_mount @elastic/appex-sharedux
packages/kbn-recently-accessed @elastic/appex-sharedux
x-pack/plugins/remote_clusters @elastic/kibana-management
test/plugin_functional/plugins/rendering_plugin @elastic/kibana-core
packages/kbn-repo-file-maps @elastic/kibana-operations
Expand Down Expand Up @@ -848,7 +850,7 @@ test/server_integration/plugins/status_plugin_b @elastic/kibana-core
packages/kbn-std @elastic/kibana-core
packages/kbn-stdio-dev-helpers @elastic/kibana-operations
packages/kbn-storybook @elastic/kibana-operations
x-pack/plugins/observability_solution/synthetics @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/synthetics @elastic/obs-ux-management-team
x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture @elastic/response-ops
x-pack/test/plugin_api_perf/plugins/task_manager_performance @elastic/response-ops
x-pack/plugins/task_manager @elastic/response-ops
Expand All @@ -865,7 +867,6 @@ packages/kbn-test-jest-helpers @elastic/kibana-operations @elastic/appex-qa
packages/kbn-test-subj-selector @elastic/kibana-operations @elastic/appex-qa
x-pack/examples/testing_embedded_lens @elastic/kibana-visualizations
packages/kbn-text-based-editor @elastic/kibana-esql
src/plugins/text_based_languages @elastic/kibana-esql
x-pack/examples/third_party_lens_navigation_prompt @elastic/kibana-visualizations
x-pack/examples/third_party_vis_lens_example @elastic/kibana-visualizations
x-pack/plugins/threat_intelligence @elastic/security-threat-hunting-investigations
Expand Down Expand Up @@ -904,7 +905,7 @@ src/plugins/unified_search @elastic/kibana-visualizations
packages/kbn-unsaved-changes-badge @elastic/kibana-data-discovery
packages/kbn-unsaved-changes-prompt @elastic/kibana-management
x-pack/plugins/upgrade_assistant @elastic/kibana-management
x-pack/plugins/observability_solution/uptime @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/uptime @elastic/obs-ux-management-team
x-pack/plugins/drilldowns/url_drilldown @elastic/appex-sharedux
src/plugins/url_forwarding @elastic/kibana-visualizations
src/plugins/usage_collection @elastic/kibana-core
Expand Down Expand Up @@ -1142,15 +1143,15 @@ x-pack/test/observability_ai_assistant_functional @elastic/obs-ai-assistant
#CC# /x-pack/plugins/observability_solution/observability/ @elastic/apm-ui

# Uptime
/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/uptime/ @elastic/obs-ux-infra_services-team
/x-pack/test/functional/apps/uptime @elastic/obs-ux-infra_services-team
/x-pack/test/functional/es_archives/uptime @elastic/obs-ux-infra_services-team
/x-pack/test/functional/services/uptime @elastic/obs-ux-infra_services-team
/x-pack/test/api_integration/apis/uptime @elastic/obs-ux-infra_services-team
/x-pack/test/api_integration/apis/synthetics @elastic/obs-ux-infra_services-team
/x-pack/test/alerting_api_integration/observability/synthetics_rule.ts @elastic/obs-ux-infra_services-team
/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/uptime/ @elastic/obs-ux-management-team
/x-pack/test/functional/apps/uptime @elastic/obs-ux-management-team
/x-pack/test/functional/es_archives/uptime @elastic/obs-ux-management-team
/x-pack/test/functional/services/uptime @elastic/obs-ux-management-team
/x-pack/test/api_integration/apis/uptime @elastic/obs-ux-management-team
/x-pack/test/api_integration/apis/synthetics @elastic/obs-ux-management-team
/x-pack/test/alerting_api_integration/observability/synthetics_rule.ts @elastic/obs-ux-management-team
/x-pack/test/alerting_api_integration/observability/index.ts @elastic/obs-ux-management-team
/x-pack/test_serverless/api_integration/test_suites/observability/synthetics @elastic/obs-ux-infra_services-team
/x-pack/test_serverless/api_integration/test_suites/observability/synthetics @elastic/obs-ux-management-team

# Logs
/x-pack/test/api_integration/apis/logs_ui @elastic/obs-ux-logs-team
Expand Down Expand Up @@ -1734,9 +1735,9 @@ packages/react @elastic/appex-sharedux
x-pack/plugins/actions/server/saved_objects/index.ts @elastic/response-ops @elastic/kibana-security
x-pack/plugins/alerting/server/saved_objects/index.ts @elastic/response-ops @elastic/kibana-security
x-pack/plugins/fleet/server/saved_objects/index.ts @elastic/fleet @elastic/kibana-security
x-pack/plugins/observability_solution/synthetics/server/saved_objects/saved_objects.ts @elastic/obs-ux-infra_services-team @elastic/kibana-security
x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor.ts @elastic/obs-ux-infra_services-team @elastic/kibana-security
x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_param.ts @elastic/obs-ux-infra_services-team @elastic/kibana-security
x-pack/plugins/observability_solution/synthetics/server/saved_objects/saved_objects.ts @elastic/obs-ux-management-team @elastic/kibana-security
x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor.ts @elastic/obs-ux-management-team @elastic/kibana-security
x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_param.ts @elastic/obs-ux-management-team @elastic/kibana-security

# Specialised GitHub workflows for the Observability robots
/.github/workflows/deploy-my-kibana.yml @elastic/observablt-robots @elastic/kibana-operations
Expand Down
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"serverlessPackages": "packages/serverless",
"coloring": "packages/kbn-coloring/src",
"languageDocumentationPopover": "packages/kbn-language-documentation-popover/src",
"textBasedLanguages": "src/plugins/text_based_languages",
"esql": "src/plugins/esql",
"esqlDataGrid": "src/plugins/esql_datagrid",
"statusPage": "src/legacy/core_plugins/status_page",
"telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"],
Expand Down
8 changes: 4 additions & 4 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
|Embeddables are React components that manage their own state, can be serialized and deserialized, and return an API that can be used to interact with them imperatively.
|{kib-repo}blob/{branch}/src/plugins/esql/README.md[esql]
|The editor accepts the following properties:
|{kib-repo}blob/{branch}/src/plugins/esql_datagrid/README.md[esqlDataGrid]
|Contains a Discover-like table specifically for ES|QL queries:
Expand Down Expand Up @@ -328,10 +332,6 @@ generating deep links to other apps using locators, and creating short URLs.
|This plugin adds the Advanced Settings section for the Usage and Security Data collection (aka Telemetry).
|{kib-repo}blob/{branch}/src/plugins/text_based_languages/README.md[textBasedLanguages]
|The editor accepts the following properties:
|<<uiactions-plugin>>
|UI Actions plugins provides API to manage *triggers* and *actions*.
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@
"@kbn/es-ui-shared-plugin": "link:src/plugins/es_ui_shared",
"@kbn/eso-model-version-example": "link:examples/eso_model_version_example",
"@kbn/eso-plugin": "link:x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin",
"@kbn/esql": "link:src/plugins/esql",
"@kbn/esql-ast": "link:packages/kbn-esql-ast",
"@kbn/esql-ast-inspector-plugin": "link:examples/esql_ast_inspector",
"@kbn/esql-datagrid": "link:src/plugins/esql_datagrid",
Expand Down Expand Up @@ -674,6 +675,7 @@
"@kbn/react-kibana-context-styled": "link:packages/react/kibana_context/styled",
"@kbn/react-kibana-context-theme": "link:packages/react/kibana_context/theme",
"@kbn/react-kibana-mount": "link:packages/react/kibana_mount",
"@kbn/recently-accessed": "link:packages/kbn-recently-accessed",
"@kbn/remote-clusters-plugin": "link:x-pack/plugins/remote_clusters",
"@kbn/rendering-plugin": "link:test/plugin_functional/plugins/rendering_plugin",
"@kbn/repo-info": "link:packages/kbn-repo-info",
Expand Down Expand Up @@ -864,7 +866,6 @@
"@kbn/test-feature-usage-plugin": "link:x-pack/test/licensing_plugin/plugins/test_feature_usage",
"@kbn/testing-embedded-lens-plugin": "link:x-pack/examples/testing_embedded_lens",
"@kbn/text-based-editor": "link:packages/kbn-text-based-editor",
"@kbn/text-based-languages": "link:src/plugins/text_based_languages",
"@kbn/third-party-lens-navigation-prompt-plugin": "link:x-pack/examples/third_party_lens_navigation_prompt",
"@kbn/third-party-vis-lens-example-plugin": "link:x-pack/examples/third_party_vis_lens_example",
"@kbn/threat-intelligence-plugin": "link:x-pack/plugins/threat_intelligence",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type TableListViewProps<T extends UserContentCommonSchema = UserContentCo
| 'titleColumnName'
| 'withoutPageTemplateWrapper'
| 'createdByEnabled'
| 'recentlyAccessed'
> & {
title: string;
description?: string;
Expand Down Expand Up @@ -75,6 +76,7 @@ export const TableListView = <T extends UserContentCommonSchema>({
additionalRightSideActions,
withoutPageTemplateWrapper,
createdByEnabled,
recentlyAccessed,
}: TableListViewProps<T>) => {
const PageTemplate = withoutPageTemplateWrapper
? (React.Fragment as unknown as typeof KibanaPageTemplate)
Expand Down Expand Up @@ -124,6 +126,7 @@ export const TableListView = <T extends UserContentCommonSchema>({
onFetchSuccess={onFetchSuccess}
setPageDataTestSubject={setPageDataTestSubject}
createdByEnabled={createdByEnabled}
recentlyAccessed={recentlyAccessed}
/>
</KibanaPageTemplate.Section>
</PageTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
EuiButton,
EuiInMemoryTable,
CriteriaWithPagination,
PropertySort,
SearchFilterConfig,
Direction,
Query,
Expand Down Expand Up @@ -59,6 +58,7 @@ interface Props<T extends UserContentCommonSchema> extends State<T>, TagManageme
tableCaption: string;
tableColumns: Array<EuiBasicTableColumn<T>>;
hasUpdatedAtMetadata: boolean;
hasRecentlyAccessedMetadata: boolean;
deleteItems: TableListViewTableProps<T>['deleteItems'];
tableItemsRowActions: TableItemsRowActions;
renderCreateButton: () => React.ReactElement | undefined;
Expand All @@ -81,6 +81,7 @@ export function Table<T extends UserContentCommonSchema>({
tableSort,
tableFilter,
hasUpdatedAtMetadata,
hasRecentlyAccessedMetadata,
entityName,
entityNamePlural,
tagsToTableItemMap,
Expand Down Expand Up @@ -174,12 +175,13 @@ export function Table<T extends UserContentCommonSchema>({
<TableSortSelect
tableSort={tableSort}
hasUpdatedAtMetadata={hasUpdatedAtMetadata}
hasRecentlyAccessedMetadata={hasRecentlyAccessedMetadata}
onChange={onSortChange}
/>
);
},
};
}, [hasUpdatedAtMetadata, onSortChange, tableSort]);
}, [hasUpdatedAtMetadata, onSortChange, tableSort, hasRecentlyAccessedMetadata]);

const tagFilterPanel = useMemo<SearchFilterConfig | null>(() => {
if (!isTaggingEnabled()) return null;
Expand Down Expand Up @@ -278,6 +280,11 @@ export function Table<T extends UserContentCommonSchema>({
return { allUsers: Array.from(users), showNoUserOption: _showNoUserOption };
}, [createdByEnabled, items]);

const sorting =
tableSort.field === 'accessedAt' // "accessedAt" is a special case with a custom sorting
? true // by passing "true" we disable the EuiInMemoryTable sorting and handle it ourselves, but sorting is still enabled
: { sort: tableSort };

return (
<UserFilterContextProvider
enabled={createdByEnabled}
Expand All @@ -298,7 +305,7 @@ export function Table<T extends UserContentCommonSchema>({
selection={selection}
search={search}
executeQueryOptions={{ enabled: false }}
sorting={tableSort ? { sort: tableSort as PropertySort } : undefined}
sorting={sorting}
onChange={onTableChange}
data-test-subj="itemsInMemTable"
rowHeader="attributes.title"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { sortByRecentlyAccessed } from './table_sort_select';
import { UserContentCommonSchema } from '@kbn/content-management-table-list-view-common';

describe('sortByRecentlyAccessed', () => {
const items: UserContentCommonSchema[] = [
{
id: 'item-1',
type: 'dashboard',
updatedAt: '2020-01-01T00:00:00Z',
attributes: {
title: 'Item 1',
},
references: [],
},
{
id: 'item-2',
type: 'dashboard',
updatedAt: '2020-01-02T00:00:00Z',
attributes: {
title: 'Item 2',
},
createdBy: 'u_1',
references: [],
},
{
id: 'item-3',
type: 'dashboard',
updatedAt: '2020-01-03T00:00:00Z',
attributes: {
title: 'Item 3',
},
createdBy: 'u_2',
references: [],
},
{
id: 'item-4',
type: 'dashboard',
updatedAt: '2020-01-04T00:00:00Z',
attributes: {
title: 'Item 4',
},
references: [],
managed: true,
},
];

test('sort by last updated', () => {
const sortedItems = sortByRecentlyAccessed(items, []);
expect(sortedItems.map((item) => item.id)).toEqual(['item-4', 'item-3', 'item-2', 'item-1']);
});

test('pulls recently accessed to the top', () => {
const sortedItems = sortByRecentlyAccessed(items, [{ id: 'item-1' }, { id: 'item-2' }]);
expect(sortedItems.map((item) => item.id)).toEqual(['item-1', 'item-2', 'item-4', 'item-3']);
});
});
Loading

0 comments on commit 644da09

Please sign in to comment.