Skip to content

Commit

Permalink
Update connections table
Browse files Browse the repository at this point in the history
Signed-off-by: Kapian1234 <[email protected]>
  • Loading branch information
Kapian1234 committed Aug 29, 2024
2 parents 2c533b1 + 679d689 commit f22c7ac
Show file tree
Hide file tree
Showing 446 changed files with 15,192 additions and 8,442 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ snapshots.js
.yarn-local-mirror

# Ignore the generated antlr files
/src/plugins/data/public/antlr/opensearch_sql/grammar/.antlr
/src/plugins/data/public/antlr/opensearch_sql/grammar/.antlr
/src/plugins/data/public/antlr/dql/grammar/.antlr
2 changes: 2 additions & 0 deletions changelogs/fragments/7529.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [VisBuilder-Next] Migration of legacy visualizations to VisBuilder by constructing the URL. ([#7529](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7529))
2 changes: 2 additions & 0 deletions changelogs/fragments/7593.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Update DQL Autocomplete in code and functionality ([#7593](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7593))
2 changes: 2 additions & 0 deletions changelogs/fragments/7673.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace]Essential/Analytics(All) use case overview page ([#7673](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7673))
2 changes: 2 additions & 0 deletions changelogs/fragments/7716.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Display workspace picker content when outside workspace ([#7716](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7716))
2 changes: 2 additions & 0 deletions changelogs/fragments/7731.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
refactor:
- Multi-datasources and multi-query languages features to use generic structured types, abstract data querying, and the language service ([#7731](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7731))
2 changes: 2 additions & 0 deletions changelogs/fragments/7749.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Breadcrumb is not correct when clicking inspect / edit in Assets page ([#7749](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7749))
2 changes: 2 additions & 0 deletions changelogs/fragments/7785.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace] Add workspace navigation for default route ([#7785](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7785))
2 changes: 2 additions & 0 deletions changelogs/fragments/7795.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Adjust the appearance of collaborator panel ([#7795](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7795))
2 changes: 2 additions & 0 deletions changelogs/fragments/7802.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add home icon in left bottom ([#7802](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7802))
2 changes: 2 additions & 0 deletions changelogs/fragments/7811.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
security:
- [CVE-2017-16100] Use a patched version for the `dns-sync` dependency ([#7811](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7811))
2 changes: 2 additions & 0 deletions changelogs/fragments/7812.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Correct size of dashboard panel options icon button ([#7812](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7812))
2 changes: 2 additions & 0 deletions changelogs/fragments/7817.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [Workspace] maximum call stack error in use case service ([#7817](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7817))
2 changes: 2 additions & 0 deletions changelogs/fragments/7841.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace]Remove default appended features ([#7841](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7841))
2 changes: 2 additions & 0 deletions changelogs/fragments/7842.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
refactor:
- [Workspace] Use small button, small padding and compressed. ([#7842](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7842))
2 changes: 2 additions & 0 deletions changelogs/fragments/7865.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chore:
- Update oui to 1.12 ([#7865](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7865))
2 changes: 2 additions & 0 deletions changelogs/fragments/7866.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Query editor UI changes ([#7866](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7866))
8 changes: 7 additions & 1 deletion config/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,13 @@
# This publishes the Application Usage and UI Metrics into the saved object, which can be accessed by /api/stats?extended=true&legacy=true&exclude_usage=false
# usageCollection.uiMetric.enabled: false

# Set the value to true to enable enhancements for the data plugin
# data.enhancements.enabled: false

# Set the value to true to enable dynamic config service to obtain configs from a config store. By default, it's disabled
# dynamic_config_service.enabled: false

# Set the backend roles in groups or users, whoever has the backend roles or exactly match the user ids defined in this config will be regard as dashboard admin.
# Dashboard admin will have the access to all the workspaces(workspace.enabled: true) and objects inside OpenSearch Dashboards.
# opensearchDashboards.dashboardAdmin.groups: ["dashboard_admin"]
# opensearchDashboards.dashboardAdmin.users: ["dashboard_admin"]
# opensearchDashboards.dashboardAdmin.users: ["dashboard_admin"]
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
- [Opensearch dashboards.release notes 1.3.14](../release-notes/opensearch-dashboards.release-notes-1.3.14.md)
- [Opensearch dashboards.release notes 1.3.15](../release-notes/opensearch-dashboards.release-notes-1.3.15.md)
- [Opensearch dashboards.release notes 1.3.17](../release-notes/opensearch-dashboards.release-notes-1.3.17.md)
- [Opensearch dashboards.release notes 1.3.19](../release-notes/opensearch-dashboards.release-notes-1.3.19.md)
- [Opensearch dashboards.release notes 1.3.2](../release-notes/opensearch-dashboards.release-notes-1.3.2.md)
- [Opensearch dashboards.release notes 1.3.3](../release-notes/opensearch-dashboards.release-notes-1.3.3.md)
- [Opensearch dashboards.release notes 1.3.5](../release-notes/opensearch-dashboards.release-notes-1.3.5.md)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"start": "scripts/use_node scripts/opensearch_dashboards --dev",
"start:docker": "scripts/use_node scripts/opensearch_dashboards --dev --opensearch.hosts=$OPENSEARCH_HOSTS --opensearch.ignoreVersionMismatch=true --server.host=$SERVER_HOST",
"start:security": "scripts/use_node scripts/opensearch_dashboards --dev --security",
"start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --uiSettings.overrides['query:enhancements:enabled']=true --uiSettings.overrides['home:useNewHomePage']=true --uiSettings.overrides['state:storeInSessionStorage']=true",
"start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --uiSettings.overrides['query:enhancements:enabled']=true --uiSettings.overrides['home:useNewHomePage']=true",
"debug": "scripts/use_node --nolazy --inspect scripts/opensearch_dashboards --dev",
"debug-break": "scripts/use_node --nolazy --inspect-brk scripts/opensearch_dashboards --dev",
"lint": "yarn run lint:es && yarn run lint:style",
Expand Down Expand Up @@ -144,7 +144,7 @@
"dependencies": {
"@aws-crypto/client-node": "^3.1.1",
"@elastic/datemath": "5.0.3",
"@elastic/eui": "npm:@opensearch-project/oui@1.11.0",
"@elastic/eui": "npm:@opensearch-project/oui@1.12.0",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/numeral": "npm:@amoo-miki/[email protected]",
"@elastic/request-crypto": "2.0.0",
Expand Down Expand Up @@ -190,7 +190,7 @@
"core-js": "^3.6.5",
"deep-freeze-strict": "^1.1.1",
"del": "^6.1.1",
"dns-sync": "^0.2.1",
"dns-sync": "npm:@amoo-miki/dns-sync@^0.2.1",
"elastic-apm-node": "^3.43.0",
"elasticsearch": "^16.7.0",
"execa": "^4.0.2",
Expand Down
3 changes: 1 addition & 2 deletions packages/osd-stylelint-config/config/global_selectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"src/plugins/discover/public/application/view_components/canvas/discover_canvas.scss",
"src/plugins/discover/public/application/components/sidebar/discover_sidebar.scss",
"src/plugins/data/public/ui/query_string_input/_query_bar.scss",
"src/plugins/data/public/ui/query_editor/_query_editor.scss",
"src/plugins/data/public/ui/dataset_navigator/_dataset_navigator.scss"
"src/plugins/data/public/ui/query_editor/_query_editor.scss"
]
}
}
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.11.0",
"@elastic/eui": "npm:@opensearch-project/oui@1.12.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.11.0",
"@elastic/eui": "npm:@opensearch-project/oui@1.12.0",
"@elastic/numeral": "npm:@amoo-miki/[email protected]",
"@opensearch/datemath": "5.0.3",
"@osd/i18n": "1.0.0",
Expand Down
21 changes: 21 additions & 0 deletions release-notes/opensearch-dashboards.release-notes-1.3.19.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Version 1.3.19 Release Notes

### 🛡 Security

- [CVE-2024-28863] Bump tar from 6.1.11 to 6.2.1 ([#7736](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7736))
- [CVE-2024-28849] Bump follow-redirects from 1.15.2 to 1.15.6 ([#7737](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7737))
- [CVE-2024-29041] Bump express from 4.18.2 to 4.19.2 ([#7738](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7738))
- [CVE-2024-33883] Bump ejs from 3.1.7 to 3.1.10 ([#7740](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7740))
- [CVE-2024-37890] Bump ws from 6.2.2 to 6.2.3 and from 7.5.3 to 7.5.10 ([#7732](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7732))

### 📈 Features/Enhancements

### 🐛 Bug Fixes

### 🚞 Infrastructure

### 📝 Documentation

### 🛠 Maintenance

- [Version] Increment version to 1.3.19 ([#7733](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7733))
50 changes: 47 additions & 3 deletions src/core/public/chrome/nav_group/nav_group_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { uiSettingsServiceMock } from '../../ui_settings/ui_settings_service.moc
import { NavLinksService } from '../nav_links';
import { applicationServiceMock, httpServiceMock, workspacesServiceMock } from '../../mocks';
import { AppCategory } from 'opensearch-dashboards/public';
import { DEFAULT_NAV_GROUPS } from '../../';
import { DEFAULT_NAV_GROUPS, NavGroupStatus, ALL_USE_CASE_ID } from '../../';
import { ChromeBreadcrumbEnricher } from '../chrome_service';

const mockedGroupFoo = {
Expand Down Expand Up @@ -381,7 +381,50 @@ describe('ChromeNavGroupService#start()', () => {
expect(currentNavGroup?.title).toEqual('barGroupTitle');
});

it('should erase current nav group if application is home', async () => {
it('should be able to find the right nav group when visible nav group is all', 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: ALL_USE_CASE_ID,
title: 'fooGroupTitle',
description: 'foo description',
},
[mockedNavLinkFoo]
);

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

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

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

expect(currentNavGroup?.id).toEqual('bar-group');
});

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);
uiSettings.get$.mockImplementation(() => navGroupEnabled$);
Expand All @@ -403,6 +446,7 @@ describe('ChromeNavGroupService#start()', () => {
id: 'bar-group',
title: 'barGroupTitle',
description: 'bar description',
status: NavGroupStatus.Hidden,
},
[mockedNavLinkFoo, mockedNavLinkBar]
);
Expand All @@ -416,7 +460,7 @@ describe('ChromeNavGroupService#start()', () => {

chromeNavGroupServiceStart.setCurrentNavGroup('foo-group');

mockedApplicationService.navigateToApp('home');
mockedApplicationService.navigateToApp(mockedNavLinkBar.id);
const currentNavGroup = await chromeNavGroupServiceStart
.getCurrentNavGroup$()
.pipe(first())
Expand Down
46 changes: 30 additions & 16 deletions src/core/public/chrome/nav_group/nav_group_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ import {
import { map, switchMap, takeUntil } from 'rxjs/operators';
import { i18n } from '@osd/i18n';
import { IUiSettingsClient } from '../../ui_settings';
import { fulfillRegistrationLinksToChromeNavLinks, getSortedNavLinks } from '../utils';
import {
fulfillRegistrationLinksToChromeNavLinks,
getSortedNavLinks,
getVisibleUseCases,
} from '../utils';
import { ChromeNavLinks } from '../nav_links';
import { InternalApplicationStart } from '../../application';
import { NavGroupStatus } from '../../../../core/types';
import { ChromeBreadcrumb, ChromeBreadcrumbEnricher } from '../chrome_service';
import { ALL_USE_CASE_ID } from '../../../utils';

export const CURRENT_NAV_GROUP_ID = 'core.chrome.currentNavGroupId';

Expand Down Expand Up @@ -211,7 +216,7 @@ export class ChromeNavGroupService {

const setCurrentNavGroup = (navGroupId: string | undefined) => {
const navGroup = navGroupId ? this.navGroupsMap$.getValue()[navGroupId] : undefined;
if (navGroup && navGroup.status !== NavGroupStatus.Hidden) {
if (navGroup) {
this.currentNavGroup$.next(navGroup);
sessionStorage.setItem(CURRENT_NAV_GROUP_ID, navGroup.id);
} else {
Expand Down Expand Up @@ -254,28 +259,37 @@ export class ChromeNavGroupService {
application.currentAppId$,
this.getSortedNavGroupsMap$(),
]).subscribe(([appId, navGroupMap]) => {
if (appId === 'home') {
setCurrentNavGroup(undefined);
return;
}
if (appId && navGroupMap) {
const appIdNavGroupMap = new Map<string, Set<string>>();
// iterate navGroupMap
Object.keys(navGroupMap)
const visibleUseCases = getVisibleUseCases(navGroupMap);
const mapAppIdToNavGroup = (navGroup: NavGroupItemInMap) => {
navGroup.navLinks.forEach((navLink) => {
const navLinkId = navLink.id;
const navGroupSet = appIdNavGroupMap.get(navLinkId) || new Set();
navGroupSet.add(navGroup.id);
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));
} else {
// Nav group of Hidden status should be filtered out when counting navGroups the currentApp belongs to
.filter((navGroupId) => navGroupMap[navGroupId].status !== NavGroupStatus.Hidden)
.forEach((navGroupId) => {
navGroupMap[navGroupId].navLinks.forEach((navLink) => {
const navLinkId = navLink.id;
const navGroupSet = appIdNavGroupMap.get(navLinkId) || new Set();
navGroupSet.add(navGroupId);
appIdNavGroupMap.set(navLinkId, navGroupSet);
});
Object.values(navGroupMap).forEach((navGroup) => {
if (navGroup.status === NavGroupStatus.Hidden) {
return;
}

mapAppIdToNavGroup(navGroup);
});
}

const navGroups = appIdNavGroupMap.get(appId);
if (navGroups && navGroups.size === 1) {
setCurrentNavGroup(navGroups.values().next().value);
} else if (!navGroups) {
setCurrentNavGroup(undefined);
}
}
});
Expand Down
Loading

0 comments on commit f22c7ac

Please sign in to comment.