Skip to content

Commit

Permalink
Revert to legacy discover table and add toggle to new discover table (o…
Browse files Browse the repository at this point in the history
…pensearch-project#5789)

* basic table working

Signed-off-by: abbyhu2000 <[email protected]>

* basic styling

Signed-off-by: abbyhu2000 <[email protected]>

* fix header column style

Signed-off-by: abbyhu2000 <[email protected]>

* correctly display optional col header actions

Signed-off-by: abbyhu2000 <[email protected]>

* move col to the right or left if applicable

Signed-off-by: abbyhu2000 <[email protected]>

* add cell filter for and filter out buttons

Signed-off-by: abbyhu2000 <[email protected]>

* add cell action on doc table, half working on toggle columns

Signed-off-by: abbyhu2000 <[email protected]>

* sorting

Signed-off-by: abbyhu2000 <[email protected]>

* Add toggling between legacy and new table

According to opensearch-project#5739, add toggle using storage.

Signed-off-by: abbyhu2000 <[email protected]>

* get rid of the console log

Signed-off-by: abbyhu2000 <[email protected]>

* optimize cell filter logics

Signed-off-by: abbyhu2000 <[email protected]>

* add more refactoring

Signed-off-by: abbyhu2000 <[email protected]>

* remove an used line

Signed-off-by: abbyhu2000 <[email protected]>

* some more table cell optimization

Signed-off-by: abbyhu2000 <[email protected]>

* Initial UI fixes (opensearch-project#5758)
Signed-off-by: Ashwin P Chandran <[email protected]>

* Table optimization with lazy loading (opensearch-project#5760)

Signed-off-by: abbyhu2000 <[email protected]>

* [Discover with Legacy Table] fix copy issue and open feedbacks in a new tab (opensearch-project#5761)

* add a colon (:) after the key
* ensure there's a space between each key-value pair
* allow feedback url to open in a new tab

Signed-off-by: Anan Z <[email protected]>

* [Discover] Fix more UI (opensearch-project#5764)

Signed-off-by: Ashwin P Chandran <[email protected]>

* [Discover] Fixes table optimization (opensearch-project#5763)

* [Discover] Fixes table optimization

Signed-off-by: Ashwin P Chandran <[email protected]>

* improved loader

Signed-off-by: Ashwin P Chandran <[email protected]>

---------

Signed-off-by: Ashwin P Chandran <[email protected]>

* Change sort icon according to current sort conditions (opensearch-project#5772)

Signed-off-by: abbyhu2000 <[email protected]>

* fix breadcrumb navigation (opensearch-project#5773)

Signed-off-by: abbyhu2000 <[email protected]>

* Add pagination to discover embeddable (opensearch-project#5770)

* Add pagination

Signed-off-by: abbyhu2000 <[email protected]>

* fix an errir

Signed-off-by: abbyhu2000 <[email protected]>

* small change

Signed-off-by: abbyhu2000 <[email protected]>

* fix errors

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>

* [Discover] Prevent wrapping of time series cells (opensearch-project#5779)

Signed-off-by: Miki <[email protected]>

* Vertically align the text in QueryStringInputUI with other elements on the page (opensearch-project#5780)

Signed-off-by: Miki <[email protected]>

* Use `ouiCodeFont` in Discover and reduce text size (opensearch-project#5783)

Also:
* Fix react `key` errors
* vertically align source cells
* Clamp the height of the cells
* Make sure time-series column never grows

Signed-off-by: Miki <[email protected]>

* [Discover] Display filter buttons at top right of the cell (opensearch-project#5784)

Signed-off-by: Miki <[email protected]>

* [Discover] Vertically align the details toggle button (opensearch-project#5785)

Signed-off-by: Miki <[email protected]>

* [Discover] Fix overflow of the expanded document (opensearch-project#5788)

* Fix vertical alignment of expand details button
Fix colspan of details cells

Signed-off-by: Miki <[email protected]>

* Fix overflow problem of detailed doc

Signed-off-by: Miki <[email protected]>

---------

Signed-off-by: Miki <[email protected]>

* update feedback msg (opensearch-project#5787)

Signed-off-by: Anan Z <[email protected]>

* Resolve sort, default sort and short dot (opensearch-project#5771)

Signed-off-by: Anan Z <[email protected]>
Signed-off-by: Anan Zhuang <[email protected]>

* [Discover] Fixes pagination style (opensearch-project#5778)

* fixes pagination style

Signed-off-by: Ashwin P Chandran <[email protected]>

* style-lint fix

Signed-off-by: Ashwin P Chandran <[email protected]>

* fix react warning for unnecessary prop

Signed-off-by: Ashwin P Chandran <[email protected]>

* Show total hit count and pass services in embeddable

Signed-off-by: Ashwin P Chandran <[email protected]>

* removed unnecessary div

Signed-off-by: Ashwin P Chandran <[email protected]>

---------

Signed-off-by: Ashwin P Chandran <[email protected]>
Signed-off-by: Anan Zhuang <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>

* add changelog

Signed-off-by: abbyhu2000 <[email protected]>

* fix table column error

Signed-off-by: abbyhu2000 <[email protected]>

* Fix pagination edge case

Signed-off-by: abbyhu2000 <[email protected]>

* Routing for surrounding doc link should work without a question mark appending to the end (opensearch-project#5776)

* routing for surrounding doc should work without ?

Signed-off-by: abbyhu2000 <[email protected]>

* change path to not include appstate

Signed-off-by: abbyhu2000 <[email protected]>

* delete optional app state for single doc link too

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>

* type fixes (opensearch-project#5795)

Signed-off-by: Ashwin P Chandran <[email protected]>

* Update toggle to button (opensearch-project#5808)

Signed-off-by: Ashwin P Chandran <[email protected]>

* Adds support for line count (opensearch-project#5814)

Signed-off-by: Ashwin P Chandran <[email protected]>

* Add swith to datagrid table and fix ciGroup1 (opensearch-project#5816)

* add swith to datagrid table and fix ciGroup1

Signed-off-by: Anan <[email protected]>

* fix ciGroup7

Signed-off-by: Anan Z <[email protected]>

* fix ciGroup6

Signed-off-by: Anan Z <[email protected]>

---------

Signed-off-by: Anan <[email protected]>
Signed-off-by: Anan Z <[email protected]>

* add missing snapshot (opensearch-project#5818)

Signed-off-by: Anan Z <[email protected]>

* fix pluign ftr tests (opensearch-project#5821)

Signed-off-by: Anan Z <[email protected]>

* update snapshot (opensearch-project#5824)

Signed-off-by: abbyhu2000 <[email protected]>

* Fix functional 3 and 4 for discover legacy (opensearch-project#5822)

* fix 3 and 4

Signed-off-by: abbyhu2000 <[email protected]>

* fix functional 3 and 4

Signed-off-by: abbyhu2000 <[email protected]>

* dashboard expect

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>

* Solve cigroup 7 flakiness (opensearch-project#5826)

* test hover

Signed-off-by: abbyhu2000 <[email protected]>

* comment out other ci to speed up

Signed-off-by: abbyhu2000 <[email protected]>

* uncomment

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>

* [Discover] Simplify feedback modal (opensearch-project#5837)

* Simplify feedback modal

Signed-off-by: Ashwin P Chandran <[email protected]>

* renames datagrid  settng to newDiscover setting

Signed-off-by: Ashwin P Chandran <[email protected]>

* removes sub module from branch

Signed-off-by: Ashwin P Chandran <[email protected]>

---------

Signed-off-by: Ashwin P Chandran <[email protected]>

* Persist line height (opensearch-project#5836)

Signed-off-by: Ashwin P Chandran <[email protected]>

* Update table revert changelog (opensearch-project#5835)

* Update table revert changelog
### Description

updates changelog

### Issues Resolved

<!-- List any issues this PR will resolve. Prefix the issue with the keyword closes, fixes, fix -->
<!-- Example: closes opensearch-project#1234 or fixes <Issue_URL> -->

## Screenshot

<!-- Attach any relevant screenshots. Any change to the UI requires an attached screenshot in the PR Description -->

## Testing the changes

<!--
  Please provide detailed steps for validating your changes. This could involve specific commands to run,
  pages to visit, scenarios to try or any other information that would help reviewers verify
  the functionality of your change
-->

### Check List

- [ ] All tests pass
  - [ ] `yarn test:jest`
  - [ ] `yarn test:jest_integration`
- [ ] New functionality includes testing.
- [ ] New functionality has been documented.
- [ ] Update [CHANGELOG.md](./../CHANGELOG.md)
- [ ] Commits are signed per the DCO using --signoff

* revert dependency change

Signed-off-by: Ashwin P Chandran <[email protected]>

* nit

Signed-off-by: Ashwin P Chandran <[email protected]>

* update changelog

Signed-off-by: Ashwin P Chandran <[email protected]>

---------

Signed-off-by: Ashwin P Chandran <[email protected]>

* fix table height persist on context page

Signed-off-by: Ashwin P Chandran <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>
Signed-off-by: Ashwin P Chandran <[email protected]>
Signed-off-by: Anan Z <[email protected]>
Signed-off-by: Miki <[email protected]>
Signed-off-by: Anan Zhuang <[email protected]>
Signed-off-by: Anan <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>
Co-authored-by: Miki <[email protected]>
Co-authored-by: Ganesh0107 <[email protected]>
  • Loading branch information
5 people authored Feb 7, 2024
1 parent 9c3738d commit e13dbff
Show file tree
Hide file tree
Showing 70 changed files with 1,989 additions and 375 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Chrome] Introduce registerCollapsibleNavHeader to allow plugins to customize the rendering of nav menu header ([#5244](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5244))
- [PM] Enhance single version requirements imposed during bootstrapping ([#5675](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5675))
- [Custom Branding] Relative URL should be allowed for logos ([#5572](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5572))
- Revert to legacy discover table and add toggle to new discover table ([#5789](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5789))
- [Discover] Add collapsible and resizeable sidebar ([#5789](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5789))
- [Discover] Enhanced the data source selector with added sorting functionality ([#5609](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5609))
- [Multiple Datasource] Add datasource picker component and use it in devtools and tutorial page when multiple datasource is enabled ([#5756](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5756))
- [Multiple Datasource] Add datasource picker to import saved object flyout when multiple data source is enabled ([#5781](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5781))
Expand All @@ -54,6 +56,12 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [BUG][Discover] Fix advanced setting `discover:modifyColumnsOnSwitch` ([#5508](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5508))
- [BUG][Discover] Show 0 filters when there are no active filters ([#5508](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5508))
- [Discover] Fix missing index pattern field from breaking Discover [#5626](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5626)
- [BUG][Discover] Fix Discover table panel not adjusting its size automatically when the time range changes ([#5789](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5789))
- [BUG] Fix issue where changing from a search with few results to a search with more results keeps the number of rows from the previous search ([#5789](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5789))
- [BUG] Fix copying data from columns in Discover including extra data ([#5789](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5789))
- [BUG] Fix no line wrapping when displaying fields in Discover datagrid ([#5789](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5789))
- [BUG] Fix 'truncate:maxHeight' not working in Discover since 2.10.0 ([#5789](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5789))
- [BUG] Fix UI glitch when mouseover Discover datagrid element ([#5789](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5789))
- [BUG] Remove duplicate sample data as id 90943e30-9a47-11e8-b64d-95841ca0b247 ([5668](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5668))
- [BUG][Multiple Datasource] Fix datasource testing connection unexpectedly passed with wrong endpoint [#5663](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5663)
- [Table Visualization] Fix filter action buttons for split table aggregations ([#5619](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5619))
Expand Down
3 changes: 2 additions & 1 deletion packages/osd-stylelint-config/config/global_selectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"src/plugins/vis_builder/public/application/components/side_nav.scss",
"packages/osd-ui-framework/src/components/button/button_group/_button_group.scss",
"src/plugins/discover/public/application/components/data_grid/data_grid_table_cell_value.scss",
"src/plugins/discover/public/application/view_components/canvas/discover_canvas.scss"
"src/plugins/discover/public/application/view_components/canvas/discover_canvas.scss",
"src/plugins/discover/public/application/components/sidebar/discover_sidebar.scss"
]
}
}
1 change: 0 additions & 1 deletion packages/osd-ui-shared-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@
"webpack": "npm:@amoo-miki/[email protected]"
}
}

2 changes: 1 addition & 1 deletion src/core/server/core_app/assets/legacy_dark_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@
width: 100%;
max-width: 100%;
margin-bottom: 20px;
font-size: 14px;
font-size: 12px;
}
.table thead {
font-size: 12px;
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/core_app/assets/legacy_light_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@
width: 100%;
max-width: 100%;
margin-bottom: 20px;
font-size: 14px;
font-size: 12px;
}
.table thead {
font-size: 12px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const DataSourceSelectable = ({
setDataSourceOptionList,
onGetDataSetError, // onGetDataSetError, Callback for handling get data set errors. Ensure it's memoized.
singleSelection = { asPlainText: true },
...comboBoxProps
}: DataSourceSelectableProps) => {
// This effect gets data sets and prepares the datasource list for UI rendering.
useEffect(() => {
Expand Down Expand Up @@ -131,6 +132,7 @@ export const DataSourceSelectable = ({

return (
<EuiComboBox
{...comboBoxProps}
data-test-subj="dataExplorerDSSelect"
placeholder={i18n.translate('data.datasource.selectADatasource', {
defaultMessage: 'Select a datasource',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @experimental These interfaces are experimental and might change in future releases.
*/

import { EuiComboBoxSingleSelectionShape } from '@elastic/eui';
import { EuiComboBoxProps, EuiComboBoxSingleSelectionShape } from '@elastic/eui';
import { GenericDataSource } from '../datasource_services';

export interface DataSourceGroup {
Expand All @@ -22,7 +22,7 @@ export interface DataSourceOption {
ds: GenericDataSource;
}

export interface DataSourceSelectableProps {
export interface DataSourceSelectableProps extends Pick<EuiComboBoxProps<unknown>, 'fullWidth'> {
dataSources: GenericDataSource[];
onDataSourceSelect: (dataSourceOption: DataSourceOption[]) => void;
singleSelection?: boolean | EuiComboBoxSingleSelectionShape;
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/data/public/ui/query_string_input/_query_bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@

// Unlike most inputs within layout control groups, the text area still needs a border.
// These adjusts help it sit above the control groups shadow to line up correctly.
padding: $euiSizeS;
padding-top: $euiSizeS + 3px;
transform: translateY(-1px) translateX(-1px);
padding: ($euiSizeS + 2px) $euiSizeS $euiSizeS;
transform: translateY(-2px) translateX(-1px);

&:not(:focus):not(:invalid) {
@include euiYScrollWithShadows;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
$osdHeaderOffset: $euiHeaderHeightCompensation;

.deSidebar {
max-width: 462px;
min-width: 400px;
height: 100%;

@include ouiBreakpoint("xs", "s", "m") {
max-width: initial;
Expand Down
37 changes: 29 additions & 8 deletions src/plugins/data_explorer/public/components/app_container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

import React from 'react';
import { EuiPage, EuiPageBody } from '@elastic/eui';
import React, { memo } from 'react';
import { EuiPage, EuiPageBody, EuiResizableContainer, useIsWithinBreakpoints } from '@elastic/eui';
import { Suspense } from 'react';
import { AppMountParameters } from '../../../../core/public';
import { Sidebar } from './sidebar';
Expand All @@ -13,25 +13,46 @@ import { View } from '../services/view_service/view';
import './app_container.scss';

export const AppContainer = ({ view, params }: { view?: View; params: AppMountParameters }) => {
const isMobile = useIsWithinBreakpoints(['xs', 's', 'm']);
// TODO: Make this more robust.
if (!view) {
return <NoView />;
}

const { Canvas, Panel, Context } = view;

const MemoizedPanel = memo(Panel);
const MemoizedCanvas = memo(Canvas);

// Render the application DOM.
return (
<EuiPage className="deLayout" paddingSize="none">
{/* TODO: improve fallback state */}
<Suspense fallback={<div>Loading...</div>}>
<Context {...params}>
<Sidebar>
<Panel {...params} />
</Sidebar>
<EuiPageBody className="deLayout__canvas">
<Canvas {...params} />
</EuiPageBody>
<EuiResizableContainer direction={isMobile ? 'vertical' : 'horizontal'}>
{(EuiResizablePanel, EuiResizableButton) => (
<>
<EuiResizablePanel
initialSize={20}
minSize="260px"
mode={['collapsible', { position: 'top' }]}
paddingSize="none"
>
<Sidebar>
<MemoizedPanel {...params} />
</Sidebar>
</EuiResizablePanel>
<EuiResizableButton />

<EuiResizablePanel initialSize={80} minSize="65%" mode="main" paddingSize="none">
<EuiPageBody className="deLayout__canvas">
<MemoizedCanvas {...params} />
</EuiPageBody>
</EuiResizablePanel>
</>
)}
</EuiResizableContainer>
</Context>
</Suspense>
</EuiPage>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data_explorer/public/components/no_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const NoView = () => {
return (
<EuiPageTemplate
template="centeredContent"
className="dePageTemplate"
className="deLayout"
pageContentProps={{
role: 'alertdialog',
color: 'plain',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.deSidebar {
&_panel {
border-top: 0;
}

&_dataSource {
border-bottom: $euiBorderThin !important;
}
}
18 changes: 15 additions & 3 deletions src/plugins/data_explorer/public/components/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { DataSourceOption } from '../../../../data/public/';
import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public';
import { DataExplorerServices } from '../../types';
import { setIndexPattern, useTypedDispatch, useTypedSelector } from '../../utils/state_management';
import './index.scss';

export const Sidebar: FC = ({ children }) => {
const { indexPattern: indexPatternId } = useTypedSelector((state) => state.metadata);
Expand Down Expand Up @@ -91,18 +92,29 @@ export const Sidebar: FC = ({ children }) => {

return (
<EuiPageSideBar className="deSidebar" sticky>
<EuiSplitPanel.Outer className="eui-yScroll" hasBorder={true} borderRadius="none">
<EuiSplitPanel.Inner paddingSize="s" color="subdued" grow={false}>
<EuiSplitPanel.Outer
className="eui-yScroll deSidebar_panel"
hasBorder={true}
borderRadius="none"
color="transparent"
>
<EuiSplitPanel.Inner
paddingSize="s"
grow={false}
color="transparent"
className="deSidebar_dataSource"
>
<DataSourceSelectable
dataSources={activeDataSources}
dataSourceOptionList={dataSourceOptionList}
setDataSourceOptionList={setDataSourceOptionList}
onDataSourceSelect={handleSourceSelection}
selectedSources={selectedSources}
onGetDataSetError={handleGetDataSetError}
fullWidth
/>
</EuiSplitPanel.Inner>
<EuiSplitPanel.Inner paddingSize="none" color="subdued" className="eui-yScroll">
<EuiSplitPanel.Inner paddingSize="none" color="transparent" className="eui-yScroll">
{children}
</EuiSplitPanel.Inner>
</EuiSplitPanel.Outer>
Expand Down
9 changes: 0 additions & 9 deletions src/plugins/data_explorer/public/index.scss

This file was deleted.

2 changes: 0 additions & 2 deletions src/plugins/data_explorer/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import './index.scss';

import { DataExplorerPlugin } from './plugin';

// This exports static code and TypeScript types,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,14 @@ export class DiscoverHistogram extends Component<DiscoverHistogramProps, Discove
type: TooltipType.VerticalCursor,
};

// These styles override the chartsTheme so that the correct base chart colors are used
delete chartsTheme.axes?.gridLine?.horizontal?.stroke;
delete chartsTheme.axes?.gridLine?.vertical?.stroke;
delete chartsTheme.axes?.axisLine;
chartsTheme.axes!.axisTitle = {
fill: euiThemeVars.euiTextColor,
};

return (
<Chart size="100%">
<Settings
Expand Down

This file was deleted.

Loading

0 comments on commit e13dbff

Please sign in to comment.