Skip to content

Commit

Permalink
Merge branch 'main' into autosuggest-value-suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstn authored Oct 21, 2024
2 parents ef744b6 + 7da5443 commit 3381377
Show file tree
Hide file tree
Showing 439 changed files with 16,745 additions and 7,968 deletions.
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
http:/adomas.org/javascript-mouse-wheel/
site.com
http://sites.google.com/site/murmurhash/
helpmenow.com
2 changes: 2 additions & 0 deletions changelogs/fragments/8352.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Add discover summary error info and button click logic enhancement ([#8352](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8352))
2 changes: 2 additions & 0 deletions changelogs/fragments/8500.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Introducing workspace level ui settings and hide non-global ui settings from advance settings page ([#8500](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8500))
6 changes: 6 additions & 0 deletions changelogs/fragments/8504.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
feat:
- Allow hiding the TSVB axis for time series visualizations ([#8504](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8504))
- Allow setting scale of each axis for TSVB time series ([#8504](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8504))

fix:
- Compress non-OUI input fields in TSVB visualizations ([#8504](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8504))
2 changes: 2 additions & 0 deletions changelogs/fragments/8520.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace]Remove collaborators in workspace creation page ([#8520](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8520))
2 changes: 2 additions & 0 deletions changelogs/fragments/8529.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Update the title of header recent menu ([#8529](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8529))
2 changes: 2 additions & 0 deletions changelogs/fragments/8531.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace]Display duplicate collaborators error in add collaborators modal ([#8531](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8531))
2 changes: 2 additions & 0 deletions changelogs/fragments/8537.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [MDS] Mute the non-mds endpoints for direct query data connections ([#8537](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8537))
2 changes: 2 additions & 0 deletions changelogs/fragments/8538.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace] Add global search bar into left nav ([#8538](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8538))
2 changes: 2 additions & 0 deletions changelogs/fragments/8540.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace]Replace connections copy with data sources ([#8540](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8540))
2 changes: 2 additions & 0 deletions changelogs/fragments/8541.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- The workspace selector jump that occurs when hovering and clicking. ([#8541](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8541))
2 changes: 2 additions & 0 deletions changelogs/fragments/8543.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
refactor:
- Update workspace collaborator table UI ([#8543](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8543))
2 changes: 2 additions & 0 deletions changelogs/fragments/8544.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Direct query connections fit and finish fixes ([#8544](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8544))
2 changes: 2 additions & 0 deletions changelogs/fragments/8545.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Refactor data source list page to include data source association features for workspace ([#8545](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8545))
2 changes: 2 additions & 0 deletions changelogs/fragments/8554.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix new home page small screen display issues ([#8554](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8554))
2 changes: 2 additions & 0 deletions changelogs/fragments/8555.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Refactored polling logic to poll for results once current request completes ([#8555](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8555))
2 changes: 2 additions & 0 deletions changelogs/fragments/8557.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add ACL auditor ([#8557](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8557))
2 changes: 2 additions & 0 deletions changelogs/fragments/8564.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chore:
- Update oui to 1.16 ([#8564](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8564))
2 changes: 2 additions & 0 deletions changelogs/fragments/8570.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix workspace update issue ([#8570](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8570))
2 changes: 2 additions & 0 deletions changelogs/fragments/8574.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace]Show add collaborators modal until collaborators added ([#8574](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8574))
2 changes: 2 additions & 0 deletions changelogs/fragments/8581.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Disable cope all button when there is no saved objects in assets page ([#8581](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8581))
2 changes: 2 additions & 0 deletions changelogs/fragments/8587.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add support for otel sample data - logs, traces and metrics ([#8587](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8587))
2 changes: 2 additions & 0 deletions changelogs/fragments/8592.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Workspace selector style alignment ([#8592](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8592))
2 changes: 2 additions & 0 deletions changelogs/fragments/8594.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add workspace collaborators page ([#8594](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8594))
2 changes: 2 additions & 0 deletions changelogs/fragments/8600.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix padding and responsive behavior of page header ([#8600](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8600))
2 changes: 2 additions & 0 deletions changelogs/fragments/8603.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Upgrade JSON11 from 1.1.2 to 2.0.0 to ensure UTF-8 safety when stringifying JSON data ([#8603](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8603))
2 changes: 2 additions & 0 deletions changelogs/fragments/8604.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace]Keep confirm modal and disable confirm button during collaborators operation ([#8604](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8604))
2 changes: 2 additions & 0 deletions changelogs/fragments/8606.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [workspace]fix content management render dashboard with duplicate visualizations ([#8606](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8606))
2 changes: 2 additions & 0 deletions changelogs/fragments/8607.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Limit workspace colors ([#8607](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8607))
2 changes: 2 additions & 0 deletions changelogs/fragments/8614.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Update content and styling of use case getting started cards ([#8614](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8614))
2 changes: 2 additions & 0 deletions changelogs/fragments/8616.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Adds sample queries and saved queries to Discover no results page ([#8616](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8616))
2 changes: 2 additions & 0 deletions changelogs/fragments/8617.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
refactor:
- [Workspace] Update default OSD admin config permission and support wildcard. ([#8617](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8617))
2 changes: 2 additions & 0 deletions changelogs/fragments/8619.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
refactor:
- Fine-tune workspace list page compressed style to align with compressed table ([#8619](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8619))
2 changes: 2 additions & 0 deletions changelogs/fragments/8620.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add data-connection type support for association modal ([#8620](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8620))
2 changes: 2 additions & 0 deletions changelogs/fragments/8624.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- (contentManagement) Add a Page API to allow remove section ([#8624](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8624))
2 changes: 2 additions & 0 deletions changelogs/fragments/8640.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chore:
- Update oui to 1.17 ([#8640](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8640))
2 changes: 2 additions & 0 deletions changelogs/fragments/8641.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace] Response forbidden error for not permitted workspace ([#8641](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8641))
2 changes: 2 additions & 0 deletions changelogs/fragments/8648.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [Workspace] Workspace assets page crashed after library_write permission revoked ([#8648](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8648))
2 changes: 2 additions & 0 deletions changelogs/fragments/8650.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix random big number when loading in query result ([#8650](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8650))
2 changes: 2 additions & 0 deletions changelogs/fragments/8651.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Update the appearance of Discover ([#8651](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8651))
2 changes: 2 additions & 0 deletions changelogs/fragments/8659.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Discover UI stuck on searching after failing to find deleted index pattern ([#8659](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8659))
2 changes: 2 additions & 0 deletions config/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,7 @@

# 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.
# The default config is [], and no one will be dashboard admin.
# If the user config is set to wildcard ["*"], anyone will be dashboard admin.
# opensearchDashboards.dashboardAdmin.groups: ["dashboard_admin"]
# opensearchDashboards.dashboardAdmin.users: ["dashboard_admin"]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"**/jest-config": "npm:@amoo-miki/jest-config@27.5.1",
"**/jest-jasmine2": "npm:@amoo-miki/jest-jasmine2@27.5.1",
"**/joi/hoek": "npm:@amoo-miki/hoek@6.1.3",
"**/json11": "^1.1.2",
"**/json11": "^2.0.0",
"**/json-schema": "^0.4.0",
"**/kind-of": ">=6.0.3",
"**/load-bmfont/phin": "^3.7.1",
Expand Down Expand Up @@ -148,7 +148,7 @@
"dependencies": {
"@aws-crypto/client-node": "^3.1.1",
"@elastic/datemath": "5.0.3",
"@elastic/eui": "npm:@opensearch-project/oui@1.15.0",
"@elastic/eui": "npm:@opensearch-project/oui@1.17.0",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/numeral": "npm:@amoo-miki/numeral@2.6.0",
"@elastic/request-crypto": "2.0.0",
Expand Down
22 changes: 16 additions & 6 deletions packages/osd-i18n/src/core/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ describe('I18n engine', () => {
'en-us'
);

expect(i18n.getLocale()).toBe('en-us');
expect(i18n.getLocale()).toBe('en-US');
expect(i18n.getTranslation()).toEqual({
messages: {
['a.b.c']: 'bar',
Expand Down Expand Up @@ -246,9 +246,19 @@ describe('I18n engine', () => {
expect(i18n.getLocale()).toBe('foo');
});

test('should normalize passed locale', () => {
i18n.setLocale('en-US');
expect(i18n.getLocale()).toBe('en-us');
test('should normalize basic locale', () => {
i18n.setLocale('It-iT');
expect(i18n.getLocale()).toBe('it-IT');
});

test('should normalize simple locale', () => {
i18n.setLocale('en-LATN-us_PRIVATE-variant');
expect(i18n.getLocale()).toBe('en-Latn-US');
});

test('should normalize complex locale', () => {
i18n.setLocale('FR-CA-X-FALLBACK-und-u@keyword=calendarKey');
expect(i18n.getLocale()).toBe('fr-CA');
});
});

Expand Down Expand Up @@ -280,8 +290,8 @@ describe('I18n engine', () => {
});

test('should normalize passed locale', () => {
i18n.setDefaultLocale('en-US');
expect(i18n.getDefaultLocale()).toBe('en-us');
i18n.setDefaultLocale('eN-uS');
expect(i18n.getDefaultLocale()).toBe('en-US');
});

test('should set "en" locale as default for IntlMessageFormat and IntlRelativeFormat', () => {
Expand Down
22 changes: 20 additions & 2 deletions packages/osd-i18n/src/core/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ const EN_LOCALE = 'en';
const translationsForLocale: Record<string, Translation> = {};
const getMessageFormat = memoizeIntlConstructor(IntlMessageFormat);

/* A locale code is made of several components:
* * lang: The two- and three-letter lower-case language code follows the ISO 639-1 and ISO 639-2/3 standards, respectively.
* * script: The optional four-letter title-case code follows the ISO 15924 standard for representing writing systems.
* * region: The two-letter upper-case region code follows the ISO 3166-1 alpha-2 standard.
*
* Ref: https://www.rfc-editor.org/rfc/rfc5646.txt
* Note: While case carries no distinction with locale codes, proper formatting is recommended.
*/
const localeParser = /^(?<lang>[a-z]{2,3})(?:-(?<script>[a-z]{4}))?(?:-(?<region>[a-z]{2}|[0-9]{3}))?(?:[_@\-].*)?$/i;

let defaultLocale = EN_LOCALE;
let currentLocale = EN_LOCALE;
let formats = EN_FORMATS;
Expand All @@ -64,8 +74,16 @@ function getMessageById(id: string): string | undefined {
* Normalizes locale to make it consistent with IntlMessageFormat locales
* @param locale
*/
function normalizeLocale(locale: string) {
return locale.toLowerCase();
export function normalizeLocale(locale: string) {
const { lang, script, region } = localeParser.exec(locale)?.groups || {};
// If parsing failed or the language code was not extracted, return the locale
if (!lang) return locale;

const parts = [lang.toLowerCase()];
if (script) parts.push(script[0].toUpperCase() + script.slice(1).toLowerCase());
if (region) parts.push(region.toUpperCase());

return parts.join('-');
}

/**
Expand Down
Loading

0 comments on commit 3381377

Please sign in to comment.