Skip to content

Commit

Permalink
Merge branch 'main' into savedSearchEditFix
Browse files Browse the repository at this point in the history
  • Loading branch information
LDrago27 committed Sep 24, 2024
2 parents 3e8e756 + 9a88bf5 commit 45e26fd
Show file tree
Hide file tree
Showing 103 changed files with 2,309 additions and 580 deletions.
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ https://www.quandl.com/api/v1/datasets/
https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
http:/adomas.org/javascript-mouse-wheel/
site.com
https://sites.google.com/site/murmurhash
2 changes: 2 additions & 0 deletions changelogs/fragments/8013.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Integrate workspace with data connections in front end ([#8013](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8013))
2 changes: 2 additions & 0 deletions changelogs/fragments/8186.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add data summary panel in discover ([#8186](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8186))
3 changes: 3 additions & 0 deletions changelogs/fragments/8189.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fix:
- Current nav group will be mapped to global system nav group even if user is in a workspace. ([#8189](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8189))
- Current nav group will be mapped to a nav group even when user is out of a workspace. ([#8189](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8189))
2 changes: 2 additions & 0 deletions changelogs/fragments/8212.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add loading indicator and counter to query result ([#8212](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8212))
2 changes: 2 additions & 0 deletions changelogs/fragments/8215.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix: use workspace type icons and compressed input ([#8215](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8215))
2 changes: 2 additions & 0 deletions changelogs/fragments/8217.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix initial page UI issues ([#8217](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8217))
2 changes: 2 additions & 0 deletions changelogs/fragments/8226.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Remove unused enhancements APIs, clean up, and error handling ([#8226](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8226))
2 changes: 2 additions & 0 deletions changelogs/fragments/8232.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Use @osd/std to prettify objects for display ([#8232](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8232))
2 changes: 2 additions & 0 deletions changelogs/fragments/8236.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [Workspace] drop user personal settings page ([#8236](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8236))
2 changes: 2 additions & 0 deletions changelogs/fragments/8245.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Expose method to register search strategy routes in query enhancement ([#8245](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8245))
2 changes: 2 additions & 0 deletions changelogs/fragments/8246.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chore:
- Update oui to 1.13 ([#8246](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8246))
2 changes: 2 additions & 0 deletions changelogs/fragments/8252.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Run recent query button work properly ([#8252](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8252))
2 changes: 2 additions & 0 deletions changelogs/fragments/8274.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Add a temporary fix for a bug with Chrome 129 when handling mask-image ([#8274](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8274))
2 changes: 2 additions & 0 deletions changelogs/fragments/8299.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Expose datasets and data_frames directories for specific imports ([#8299](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8299))
2 changes: 0 additions & 2 deletions docs/multi-datasource/high_level_design.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ To support multiple data source in OpenSearch Dashboards, we will add “data so

With this new “data source” reference in index pattern, OpenSearch Dashboards users will need to first create data sources in OpenSearch Dashboards, then select a data source when creating index patterns. Then the visualization and dashboard creation experience will remain the same. Also for any other save object types, if they reference index-pattern, or reference any save object that references index-pattern. Retrieving data from data source will be supported out of the box.

- For OpenSearch Dashboards multiple data source user experience, refer to [OpenSearch Dashboards Multiple OpenSearch Data Source Support User Stories](https://quip-amazon.com/VXQ0AhpPs3gU)

- The OpenSearch Dashboards visualization rendering flow will look like following with multi-datasource support: ![image](./img/hld_vis_flow.png)

### Backward Compatibility
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"dependencies": {
"@aws-crypto/client-node": "^3.1.1",
"@elastic/datemath": "5.0.3",
"@elastic/eui": "npm:@opensearch-project/oui@1.12.0",
"@elastic/eui": "npm:@opensearch-project/oui@1.13.0",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/numeral": "npm:@amoo-miki/numeral@2.6.0",
"@elastic/request-crypto": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-ui-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"enzyme-adapter-react-16": "^1.9.1"
},
"devDependencies": {
"@elastic/eui": "npm:@opensearch-project/oui@1.12.0",
"@elastic/eui": "npm:@opensearch-project/oui@1.13.0",
"@osd/babel-preset": "1.0.0",
"@osd/optimizer": "1.0.0",
"comment-stripper": "^0.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-ui-shared-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@elastic/charts": "31.1.0",
"@elastic/eui": "npm:@opensearch-project/oui@1.12.0",
"@elastic/eui": "npm:@opensearch-project/oui@1.13.0",
"@elastic/numeral": "npm:@amoo-miki/numeral@2.6.0",
"@opensearch/datemath": "5.0.3",
"@osd/i18n": "1.0.0",
Expand Down
88 changes: 87 additions & 1 deletion src/core/public/chrome/nav_group/nav_group_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ describe('ChromeNavGroupService#start()', () => {
expect(currentNavGroup).toBeUndefined();
});

it('should set current nav group automatically if application only belongs 1 nav group', async () => {
it('should set current nav group automatically if application only belongs to 1 visible nav group', async () => {
const uiSettings = uiSettingsServiceMock.createSetupContract();
const navGroupEnabled$ = new Rx.BehaviorSubject(true);
uiSettings.get$.mockImplementation(() => navGroupEnabled$);
Expand Down Expand Up @@ -424,6 +424,39 @@ describe('ChromeNavGroupService#start()', () => {
expect(currentNavGroup?.id).toEqual('bar-group');
});

it('should be able to find the right nav group when visible nav group length is 1 and is not all nav group', async () => {
const uiSettings = uiSettingsServiceMock.createSetupContract();
const navGroupEnabled$ = new Rx.BehaviorSubject(true);
uiSettings.get$.mockImplementation(() => navGroupEnabled$);

const chromeNavGroupService = new ChromeNavGroupService();
const chromeNavGroupServiceSetup = chromeNavGroupService.setup({ uiSettings });

chromeNavGroupServiceSetup.addNavLinksToGroup(
{
id: 'foo',
title: 'fooGroupTitle',
description: 'foo description',
},
[mockedNavLinkFoo]
);

const chromeNavGroupServiceStart = await chromeNavGroupService.start({
navLinks: mockedNavLinkService,
application: mockedApplicationService,
breadcrumbsEnricher$: new Rx.BehaviorSubject<ChromeBreadcrumbEnricher | undefined>(undefined),
workspaces: workspacesServiceMock.createStartContract(),
});
mockedApplicationService.navigateToApp(mockedNavLinkFoo.id);

const currentNavGroup = await chromeNavGroupServiceStart
.getCurrentNavGroup$()
.pipe(first())
.toPromise();

expect(currentNavGroup?.id).toEqual('foo');
});

it('should erase current nav group if application can not be found in any of the visible nav groups', async () => {
const uiSettings = uiSettingsServiceMock.createSetupContract();
const navGroupEnabled$ = new Rx.BehaviorSubject(true);
Expand Down Expand Up @@ -469,6 +502,59 @@ describe('ChromeNavGroupService#start()', () => {
expect(currentNavGroup).toBeFalsy();
});

it('should erase current nav group if application can only be found in use case but outside workspace', async () => {
const uiSettings = uiSettingsServiceMock.createSetupContract();
const navGroupEnabled$ = new Rx.BehaviorSubject(true);
uiSettings.get$.mockImplementation(() => navGroupEnabled$);

const chromeNavGroupService = new ChromeNavGroupService();
const chromeNavGroupServiceSetup = chromeNavGroupService.setup({ uiSettings });

chromeNavGroupServiceSetup.addNavLinksToGroup(
{
id: 'foo-group',
title: 'fooGroupTitle',
description: 'foo description',
},
[mockedNavLinkFoo]
);

chromeNavGroupServiceSetup.addNavLinksToGroup(
{
id: 'bar-group',
title: 'barGroupTitle',
description: 'bar description',
},
[mockedNavLinkFoo, mockedNavLinkBar]
);

const chromeNavGroupServiceStart = await chromeNavGroupService.start({
navLinks: mockedNavLinkService,
application: {
...mockedApplicationService,
capabilities: Object.freeze({
...mockedApplicationService.capabilities,
workspaces: {
...mockedApplicationService.capabilities.workspaces,
enabled: true,
},
}),
},
breadcrumbsEnricher$: new Rx.BehaviorSubject<ChromeBreadcrumbEnricher | undefined>(undefined),
workspaces: workspacesServiceMock.createStartContract(),
});

chromeNavGroupServiceStart.setCurrentNavGroup('foo-group');

mockedApplicationService.navigateToApp(mockedNavLinkBar.id);
const currentNavGroup = await chromeNavGroupServiceStart
.getCurrentNavGroup$()
.pipe(first())
.toPromise();

expect(currentNavGroup).toBeFalsy();
});

it('should set breadcrumbs enricher when nav group is enabled', async () => {
const uiSettings = uiSettingsServiceMock.createSetupContract();
const navGroupEnabled$ = new Rx.BehaviorSubject(true);
Expand Down
36 changes: 30 additions & 6 deletions src/core/public/chrome/nav_group/nav_group_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from '../utils';
import { ChromeNavLinks } from '../nav_links';
import { InternalApplicationStart } from '../../application';
import { NavGroupStatus } from '../../../../core/types';
import { NavGroupStatus, NavGroupType } from '../../../../core/types';
import { ChromeBreadcrumb, ChromeBreadcrumbEnricher } from '../chrome_service';
import { ALL_USE_CASE_ID } from '../../../utils';

Expand Down Expand Up @@ -270,10 +270,15 @@ export class ChromeNavGroupService {
appIdNavGroupMap.set(navLinkId, navGroupSet);
});
};
if (visibleUseCases.length === 1 && visibleUseCases[0].id === ALL_USE_CASE_ID) {
// If the only visible use case is all use case
// All the other nav groups will be visible because all use case can visit all of the nav groups.
Object.values(navGroupMap).forEach((navGroup) => mapAppIdToNavGroup(navGroup));
if (visibleUseCases.length === 1) {
if (visibleUseCases[0].id === ALL_USE_CASE_ID) {
// If the only visible use case is all use case
// All the other nav groups will be visible because all use case can visit all of the nav groups.
Object.values(navGroupMap).forEach((navGroup) => mapAppIdToNavGroup(navGroup));
} else {
// It means we are in a workspace, we should only use the visible use cases
visibleUseCases.forEach((navGroup) => mapAppIdToNavGroup(navGroup));
}
} else {
// Nav group of Hidden status should be filtered out when counting navGroups the currentApp belongs to
Object.values(navGroupMap).forEach((navGroup) => {
Expand All @@ -287,7 +292,26 @@ export class ChromeNavGroupService {

const navGroups = appIdNavGroupMap.get(appId);
if (navGroups && navGroups.size === 1) {
setCurrentNavGroup(navGroups.values().next().value);
const navGroupId = navGroups.values().next().value as string;
/**
* If
* 1. workspace enabled
* 2. outside of workspace: visibleUseCases.length > 1
* 3. the matched nav group is a use case nav group
*
* It means a workspace application is incorrectly opened in global place.
* We need to set current nav group to undefined to not show the use case nav.
*/
const navGroupInfo = navGroupMap[navGroupId];
if (
application.capabilities.workspaces.enabled &&
visibleUseCases.length > 1 &&
navGroupInfo.type !== NavGroupType.SYSTEM
) {
setCurrentNavGroup(undefined);
} else {
setCurrentNavGroup(navGroupId);
}
} else if (!navGroups) {
setCurrentNavGroup(undefined);
}
Expand Down
52 changes: 28 additions & 24 deletions src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 45e26fd

Please sign in to comment.