Skip to content

Commit

Permalink
Merge branch 'main' into app_filter_query_persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
abbyhu2000 authored Dec 29, 2022
2 parents 272eef8 + bd52024 commit 5efb139
Show file tree
Hide file tree
Showing 88 changed files with 814 additions and 5,876 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Add yarn opensearch arg to setup plugin dependencies ([#2544](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/2544))
- [Multi DataSource] Test the connection to an external data source when creating or updating ([#2973](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2973))
- [Vis Builder] Add app filter and query persistence without using state container ([#3100](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3100))
- [Table Visualization] Refactor table visualization using React and DataGrid component ([#2863](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2863))

### 🐛 Bug Fixes

Expand Down Expand Up @@ -76,6 +77,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Vis Builder] Add global data persistence for vis builder #2896 ([#2896](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2896))
- Update `leaflet-vega` and fix its usage ([#3005](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3005))
- [Table Visualization][BUG] Fix Url content display issue in table ([#2918](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2918))
- Fixes misleading embaddable plugin error message ([#3043](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3043))
- [MD] Update dummy url in tests to follow lychee url allowlist ([#3099](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3099))

### 🚞 Infrastructure
Expand Down Expand Up @@ -135,6 +137,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Resolve sub-dependent d3-color version and potential security issue ([#2454](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2454))
- [CVE-2022-3517] Bumps minimatch from 3.0.4 to 3.0.5 and [IBM X-Force ID: 220063] unset-value from 1.0.1 to 2.0.1 ([#2640](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2640))
- [CVE-2022-37601] Bump loader-utils to 2.0.3 ([#2689](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2689))
- [CVE-2022-37599] Bump loader-utils to 2.0.4 ([#3031](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3031))
- [CVE-2022-37603] Bump loader-utils to 2.0.4 ([#3031](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3031))
- [WS-2021-0638][Security] bump mocha to 10.1.0 ([#2711](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2711))

### 📈 Features/Enhancements
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"**/hoist-non-react-statics": "^3.3.2",
"**/json-schema": "^0.4.0",
"**/kind-of": ">=6.0.3",
"**/loader-utils": "^2.0.3",
"**/loader-utils": "^2.0.4",
"**/node-jose": "^2.1.0",
"**/nth-check": "^2.0.1",
"**/qs": "^6.10.3",
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/data/common/field_formats/field_format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ export abstract class FieldFormat {
*/
public type: any = this.constructor;

/**
* @property {boolean} - allow numeric aggregation
* @private
*/
allowsNumericalAggregations?: boolean;

protected readonly _params: any;
protected getConfig: FieldFormatsGetConfigFn | undefined;

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/embeddable/public/lib/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class EmbeddableFactoryNotFoundError extends Error {
constructor(type: string) {
super(
i18n.translate('embeddableApi.errors.embeddableFactoryNotFound', {
defaultMessage: `{type} can't be loaded. Please upgrade to the default distribution of OpenSearch and OpenSearch Dashboards with the appropriate license.`,
defaultMessage: `OpenSearch Dashboards can't load "{type}" visualizations. Check for a missing plugin or an incompatible visualization type.`,
values: {
type,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { get } from 'lodash';
import React, { useCallback, useEffect, useMemo } from 'react';
import React, { useCallback } from 'react';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
import produce from 'immer';
import { Draft } from 'immer';
import { EuiIconTip } from '@elastic/eui';
import { search } from '../../../../../data/public';
import { NumberInputOption, SwitchOption } from '../../../../../charts/public';
import {
useTypedDispatch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { SchemaConfig } from '../../../../visualizations/public';
import { TableVisExpressionFunctionDefinition } from '../../../../vis_type_table_new/public';
import { TableVisExpressionFunctionDefinition } from '../../../../vis_type_table/public';
import { AggConfigs, IAggConfig } from '../../../../data/common';
import { buildExpression, buildExpressionFunction } from '../../../../expressions/public';
import { RenderState } from '../../application/utils/state_management';
Expand Down Expand Up @@ -120,7 +120,7 @@ export const toExpression = async ({ style: styleState, visualization }: TableRo
};

const tableVis = buildExpressionFunction<TableVisExpressionFunctionDefinition>(
'opensearch_dashboards_table_new',
'opensearch_dashboards_table',
{
visConfig: JSON.stringify(visConfig),
}
Expand Down
36 changes: 35 additions & 1 deletion src/plugins/vis_type_table/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
Contains the data table visualization, that allows presenting data in a simple table format.
# Data Table

This is an OpenSearch Dashboards plugin that is used to visualize data and aggregations in tabular format.

## Create Data Table
To create a data table in OpenSearch Dashboards, first select `Visualize` from the navigation menu. Then click `Create Visualization` and choose `Data Table` as the visualization type.

## Select Metrics

### Metrics Aggregation
At the `Metrics`, select the metric aggregation type from the menu and configure it accordingly. You could also add multiple metrics and each metrics is a separate column in table visualization.

### Buckets Aggregation
At the `Buckets`, configure the columns to be displayed in the table visualization.
- `Split Rows` is used when you want to divide one row into more based on some category. It splits one row into multiple and add columns based on the categories you choose to split. For example, if you split the data based on gender then you want to know more on each gender's clothing preference. You could click `Split Rows` and input `clothing.category` in terms. Each gender's data is now split across to multiple rows based on a new added column `clothing.category`.
- `Split Table` splits the table into separate tables for the aggregation you choose. It is similar to `Split Rows`, but this time each row becomes a single table with aggregation columns arranged horizontally or vertically.

## Select Options
In the `Options` tab, you can configure more options.
- `Max rows per page` is the maximum number of rows displayed per page.
- `Show metrics for every bucket/level` adds metrics aggregation to every column.
- `Show partial rows` will include data with missing columns.
- `Show total` calculates the selected metrics per column and displays the result at the bottom. Warning - depending on your columns and the total aggregation function selected, this may generate statistically invalid results. For example, avoid summing or averaging averages.
- `Percentage column` adds one percentage column based on the chosen metrics aggregation.

## Example

Below is an example of creating a table visualization using sample ecommerce data.

- Create a new data table visualization and set a relative time 15 weeks ago.
- Compute the count of ecommerce: Choose `Count` in Metrics Aggregation.
- Split the rows on the top 5 of `manufacturer.keyword` ordered by `Metric:Count` in descending and add a label "manufacturer".
- Split the table in rows on the top 5 of `geoip.city_name` ordered by `Metric:Count` in ascending order.
- Click the `Save` button on the top left and save the visualization as "Top manufacturers by count per city".
- Choose a table and click the download icon to download the table.
4 changes: 2 additions & 2 deletions src/plugins/vis_type_table/opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"requiredPlugins": [
"expressions",
"visualizations",
"data",
"opensearchDashboardsLegacy"
"data"
],
"requiredBundles": [
"opensearchDashboardsUtils",
"opensearchDashboardsReact",
"share",
"charts",
"visDefaultEditor"
Expand Down

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

115 changes: 115 additions & 0 deletions src/plugins/vis_type_table/public/__snapshots__/to_ast.test.ts.snap

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

23 changes: 0 additions & 23 deletions src/plugins/vis_type_table/public/_table_vis.scss

This file was deleted.

42 changes: 0 additions & 42 deletions src/plugins/vis_type_table/public/agg_table/_agg_table.scss

This file was deleted.

1 change: 0 additions & 1 deletion src/plugins/vis_type_table/public/agg_table/_index.scss

This file was deleted.

34 changes: 0 additions & 34 deletions src/plugins/vis_type_table/public/agg_table/agg_table.html

This file was deleted.

Loading

0 comments on commit 5efb139

Please sign in to comment.