Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into stateful-sidenav/fe…
Browse files Browse the repository at this point in the history
…edback-btn
  • Loading branch information
sebelga committed Oct 10, 2024
2 parents e80a145 + 129c0a1 commit a562edd
Show file tree
Hide file tree
Showing 212 changed files with 2,085 additions and 4,004 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
####

x-pack/test/alerting_api_integration/common/plugins/aad @elastic/response-ops
packages/kbn-ace @elastic/kibana-management
x-pack/plugins/actions @elastic/response-ops
x-pack/test/alerting_api_integration/common/plugins/actions_simulators @elastic/response-ops
packages/kbn-actions-types @elastic/response-ops
src/plugins/advanced_settings @elastic/appex-sharedux @elastic/kibana-management
x-pack/packages/kbn-ai-assistant @elastic/search-kibana
src/plugins/ai_assistant_management/selection @elastic/obs-knowledge-team
x-pack/packages/ml/aiops_change_point_detection @elastic/ml-ui
x-pack/packages/ml/aiops_common @elastic/ml-ui
Expand Down
4 changes: 3 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ When forming the risk matrix, consider some of the following examples and how th

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

31 changes: 0 additions & 31 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,37 +68,6 @@ Author Tobias Koppers @sokra
---
This product has relied on ASTExplorer that is licensed under MIT.

---
This product includes code that is based on Ace editor, which was available
under a "BSD" license.

Distributed under the BSD license:

Copyright (c) 2010, Ajax.org B.V.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Ajax.org B.V. nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

---
This product includes code that is based on flot-charts, which was available
under a "MIT" license.
Expand Down
210 changes: 0 additions & 210 deletions api_docs/kbn_ace.devdocs.json

This file was deleted.

33 changes: 0 additions & 33 deletions api_docs/kbn_ace.mdx

This file was deleted.

2 changes: 0 additions & 2 deletions api_docs/plugin_directory.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana']

| Package name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Maintaining team | Description | API Cnt | Any Cnt | Missing<br />comments | Missing<br />exports |
|--------------|----------------|-----------|--------------|----------|---------------|--------|
| <DocLink id="kibKbnAcePluginApi" text="@kbn/ace"/> | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 11 | 5 | 11 | 0 |
| <DocLink id="kibKbnActionsTypesPluginApi" text="@kbn/actions-types"/> | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 14 | 0 | 14 | 0 |
| <DocLink id="kibKbnAiopsComponentsPluginApi" text="@kbn/aiops-components"/> | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 36 | 0 | 0 | 0 |
| <DocLink id="kibKbnAiopsLogPatternAnalysisPluginApi" text="@kbn/aiops-log-pattern-analysis"/> | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 2 | 0 | 0 | 0 |
Expand Down Expand Up @@ -797,4 +796,3 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana']
| <DocLink id="kibKbnYarnLockValidatorPluginApi" text="@kbn/yarn-lock-validator"/> | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 9 | 0 | 4 | 0 |
| <DocLink id="kibKbnZodPluginApi" text="@kbn/zod"/> | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 1254 | 0 | 4 | 0 |
| <DocLink id="kibKbnZodHelpersPluginApi" text="@kbn/zod-helpers"/> | [@elastic/security-detection-rule-management](https://github.com/orgs/elastic/teams/security-detection-rule-management) | - | 20 | 0 | 10 | 0 |

4 changes: 4 additions & 0 deletions dev_docs/nav-kibana-dev.docnav.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@
{
"id": "kibDevReactKibanaContext",
"label": "Kibana React Contexts"
},
{
"id": "kibDevDocsChromeRecentlyAccessed",
"label": "Recently Viewed"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
id: kibDevDocsChromeRecentlyAccessed
slug: /kibana-dev-docs/chrome/recently-accessed
title: Chrome Recently Viewed
description: How to use chrome's recently accessed service to add your links to the recently viewed list in the side navigation.
date: 2024-10-04
tags: ['kibana', 'dev', 'contributor', 'chrome', 'navigation', 'shared-ux']
---

## Introduction

The <DocLink id="kibKbnCoreChromeBrowserPluginApi" section="def-public.ChromeRecentlyAccessed" text="ChromeRecentlyAccessed" /> service allows applications to register recently visited objects. These items are displayed in the "Recently Viewed" section of a side navigation menu, providing users with quick access to their previously visited resources. This service includes methods for adding, retrieving, and subscribing to the recently accessed history.

![Recently viewed section in the sidenav](./chrome_recently_accessed.png)

## Guidelines

The <DocLink id="kibKbnCoreChromeBrowserPluginApi" section="def-public.ChromeRecentlyAccessed" text="ChromeRecentlyAccessed" /> service should be used thoughtfully to provide users with easy access to key resources they've interacted with. Unlike browser history, this feature is for important items that users may want to revisit.

### DOs

- Register important resources that users may want to revisit. Like a dashboard, a saved search, or another specific object.
- Update the link when the state of the current resource changes. For example, if a user changes the time range while on a dashboard, update the recently viewed link to reflect the latest viewed state where possible. See below for instructions on how to update the link when state changes.

### DON'Ts

- Don't register every page view.
- Don't register temporary or transient states as individual items.
- Prevent overloading. Keep the list focused on high-value resources.
- Don't add a recently viewed object without first speaking to relevant Product Managers.

## Usage

To register an item with the `ChromeRecentlyAccessed` service, provide a unique `id`, a `label`, and a `link`. The `id` is used to identify and deduplicate the item, the `label` is displayed in the "Recently Viewed" list and the `link` is used to navigate to the item when selected.

```ts
const link = '/app/map/1234';
const label = 'Map 1234';
const id = 'map-1234';

coreStart.chrome.recentlyAccessed.add(link, label, id);
```

To update the link when state changes, add another item with the same `id`. This will replace the existing item in the "Recently Viewed" list.

```ts
const link = '/app/map/1234';
const label = 'Map 1234';

coreStart.chrome.recentlyAccessed.add(`/app/map/1234`, label, id);

// User changes the time range and we want to update the link in the "Recently Viewed" list
coreStart.chrome.recentlyAccessed.add(
`/app/map/1234?timeRangeFrom=now-30m&timeRangeTo=now`,
label,
id
);
```

## Implementation details

The <DocLink id="kibKbnCoreChromeBrowserPluginApi" section="def-public.ChromeRecentlyAccessed" text="ChromeRecentlyAccessed" /> services is based on <DocLink id="kibKbnRecentlyAccessedPluginApi" text="@kbn/recently-accessed"/> package. This package provides a `RecentlyAccessedService` that uses browser local storage to manage records of recently accessed objects. Internally it implements the queue with a maximum length of 20 items. When the queue is full, the oldest item is removed.
Applications can create their own instance of `RecentlyAccessedService` to manage their own list of recently accessed items scoped to their application.

- <DocLink id="kibKbnCoreChromeBrowserPluginApi" section="def-public.ChromeRecentlyAccessed" text="ChromeRecentlyAccessed" /> is a service available via `coreStart.chrome.recentlyAccessed` and should be used to add items to chrome's sidenav.
- <DocLink id="kibKbnRecentlyAccessedPluginApi" text="@kbn/recently-accessed"/> is package that `ChromeRecentlyAccessed` is using internally and the package can be used to create your own instance and manage your own list of recently accessed items that is independent for chrome's sidenav.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a562edd

Please sign in to comment.