Skip to content

Commit 4d5a4fc

Browse files
authored
Merge branch 'main' into visBuilder-table
2 parents 42c9f3b + 82eb0e8 commit 4d5a4fc

File tree

18 files changed

+545
-297
lines changed

18 files changed

+545
-297
lines changed

.github/workflows/backport.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ jobs:
1212
contents: write
1313
pull-requests: write
1414
name: Backport
15+
# Only react to merged PRs for security reasons.
16+
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
17+
if: >
18+
github.event.pull_request.merged
19+
&& (
20+
github.event.action == 'closed'
21+
|| (
22+
github.event.action == 'labeled'
23+
&& contains(github.event.label.name, 'backport')
24+
)
25+
)
1526
steps:
1627
- name: GitHub App token
1728
id: github_app_token

.github/workflows/cypress_workflow.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ env:
1111
FTR_PATH: 'ftr'
1212
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch'
1313
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot'
14-
SPEC: 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/*.js,'
14+
SPEC: 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,'
15+
CYPRESS_ENV: 'env CYPRESS_VISBUILDER_ENABLED=true '
1516

1617
jobs:
1718
cypress-tests:
@@ -75,7 +76,7 @@ jobs:
7576
working-directory: ${{ env.FTR_PATH }}
7677
start: ${{ env.OPENSEARCH_SNAPSHOT_CMD }}, ${{ env.START_CMD }}
7778
wait-on: 'http://localhost:9200, http://localhost:5601'
78-
command: yarn cypress:run-without-security --browser chromium --spec ${{ env.SPEC }}
79+
command: ${{ env.CYPRESS_ENV }} yarn cypress:run-without-security --browser chromium --spec ${{ env.SPEC }}
7980

8081
# Screenshots are only captured on failure, will change this once we do visual regression tests
8182
- uses: actions/upload-artifact@v3

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
3232
- [Vis Builder] Rename wizard to visBuilder in i18n id and formatted message id ([#2635](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2635))
3333
- [Vis Builder] Rename wizard to visBuilder in class name, type name and function name ([#2639](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2639))
3434
- [Vis Builder] Rename wizard on save modal and visualization table ([#2645](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2645))
35+
- [Vis Builder] Adds functional tests to CI ([#2728](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2728))
3536
- [Vis Builder] Enable VisBuilder by default ([#2725](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2725))
3637
- Change save object type, wizard id and name to visBuilder #2673 ([#2673](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2673))
3738
- [Multi DataSource] Update MD data source documentation link ([#2693](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2693))
@@ -53,7 +54,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5354
- [Multi DataSource] Address UX comments on index pattern management stack ([#2611](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2611))
5455
- [Multi DataSource] Apply get indices error handling in step index pattern ([#2652](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2652))
5556
- [Vis Builder] Last Updated Timestamp for visbuilder savedobject is getting Generated ([#2628](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2628))
56-
- Removed Leftover X Pack references ([#2638](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2638))
57+
- Removed Leftover X Pack references ([#2638](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2638))
58+
- Removes Add Integration button ([#2723](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2723))
5759

5860
### 🚞 Infrastructure
5961

@@ -69,7 +71,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6971
- Adding @zhongnansu as maintainer. ([#2590](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2590))
7072

7173
### 🪛 Refactoring
72-
* [MD] Refactor data source error handling ([#2661](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2661))
74+
75+
- [MD] Refactor data source error handling ([#2661](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2661))
76+
- Refactor and improve Discover field summaries ([#2391](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2391))
7377

7478
### 🔩 Tests
7579

src/core/public/mocks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ function createCoreSetupMock({
8383
uiSettings: uiSettingsServiceMock.createSetupContract(),
8484
injectedMetadata: {
8585
getInjectedVar: injectedMetadataServiceMock.createSetupContract().getInjectedVar,
86+
getBranding: injectedMetadataServiceMock.createSetupContract().getBranding,
8687
},
8788
};
8889

src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030

3131
import React from 'react';
32+
// @ts-ignore
3233
import { findTestSubject } from '@elastic/eui/lib/test';
3334
// @ts-ignore
3435
import stubbedLogstashFields from 'fixtures/logstash_fields';
@@ -99,8 +100,9 @@ function getComponent({
99100

100101
const props = {
101102
indexPattern,
103+
columns: [],
102104
field: finalField,
103-
getDetails: jest.fn(() => ({ buckets: [], error: '', exists: 1, total: true, columns: [] })),
105+
getDetails: jest.fn(() => ({ buckets: [], error: '', exists: 1, total: 1 })),
104106
onAddFilter: jest.fn(),
105107
onAddField: jest.fn(),
106108
onRemoveField: jest.fn(),

src/plugins/discover/public/application/components/sidebar/discover_field.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ import { getFieldTypeName } from './lib/get_field_type_name';
4040
import './discover_field.scss';
4141

4242
export interface DiscoverFieldProps {
43+
/**
44+
* the selected columns displayed in the doc table in discover
45+
*/
46+
columns: string[];
4347
/**
4448
* The displayed field
4549
*/
@@ -76,6 +80,7 @@ export interface DiscoverFieldProps {
7680
}
7781

7882
export function DiscoverField({
83+
columns,
7984
field,
8085
indexPattern,
8186
onAddField,
@@ -228,9 +233,10 @@ export function DiscoverField({
228233
</EuiPopoverTitle>
229234
{infoIsOpen && (
230235
<DiscoverFieldDetails
231-
indexPattern={indexPattern}
232-
field={field}
236+
columns={columns}
233237
details={getDetails(field)}
238+
field={field}
239+
indexPattern={indexPattern}
234240
onAddFilter={onAddFilter}
235241
/>
236242
)}

src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function DiscoverFieldBucket({ field, bucket, onAddFilter }: Props) {
6868
title={
6969
bucket.display === ''
7070
? emptyTxt
71-
: `${bucket.display}: ${bucket.count} (${bucket.percent}%)`
71+
: `${bucket.display}: ${bucket.count} (${bucket.percent.toFixed(1)}%)`
7272
}
7373
size="xs"
7474
className="eui-textTruncate"
@@ -78,7 +78,7 @@ export function DiscoverFieldBucket({ field, bucket, onAddFilter }: Props) {
7878
</EuiFlexItem>
7979
<EuiFlexItem grow={false} className="eui-textTruncate">
8080
<EuiText color="secondary" size="xs" className="eui-textTruncate">
81-
{bucket.percent}%
81+
{bucket.percent.toFixed(1)}%
8282
</EuiText>
8383
</EuiFlexItem>
8484
</EuiFlexGroup>

0 commit comments

Comments
 (0)