-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Lens] Inline editing of lens panels on a dashboard or canvas #166169
Merged
Merged
Changes from 51 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
636f9c5
[Lens] Inline editing of lens panels
stratoula 5bd75d6
Fix types CI check
stratoula e6167bc
Merge branch 'main' into inline-editing-byvalue
stratoula 97bb468
Remove unecessary query check
stratoula 21a2b49
Revert
stratoula bfaaba5
Fixes in initialization logic
stratoula b71a16c
Some cleanup
stratoula d99c926
Fix types
stratoula 69e80bf
Merge branch 'main' into inline-editing-byvalue
stratoula fad8506
Fix jest test
stratoula 0029688
Remove test case
stratoula 34d32a9
Some refactoring and props renaming
stratoula 93020bb
Display the action on dashboard edit mode and when the user has the p…
stratoula cf620ad
Refactoring, fix the activeData refresh bug
stratoula 0b18c38
Remove the reset button from Discover
stratoula 78f0ea2
Change the unified histogram implementation to get the embeddable out…
stratoula 9bd9cdd
Enable reset button in Discover
stratoula 02cfa2f
Navigate to the editor
stratoula a66be7e
Merge branch 'main' into inline-editing-byvalue
stratoula 08d704c
fix translation
stratoula be818f0
Fix content management change and userMessages, add indexpattern chan…
stratoula 02a8884
Fixes broken jest tests
stratoula 0e4b64b
Remove edit action and fix FTs
stratoula 22ae74e
Display clone panel
stratoula c48bd2a
fixes the bug with adding a layer with another dataview
stratoula 2dcc215
Fix bugs concerning the indexpattern id
stratoula 3a49513
Add more unit tests
stratoula 52d0ae2
Adds Functional tests
stratoula 3de9971
Merge with main and resolve conflicts
stratoula c2324c8
Fix some bugs
stratoula 997e886
Fixes
stratoula 26122aa
Revert
stratoula 34ea0b7
Fixes CI
stratoula b2dfd6c
Adds back navigation buttons
stratoula 1357877
Merge branch 'main' into inline-editing-byvalue
stratoula 93ca7d9
Fixes inline tests
stratoula 1ccef1a
Fixes last FT fai;
stratoula cebc687
Update src/plugins/unified_histogram/public/container/hooks/use_state…
stratoula 96294f4
Update src/plugins/unified_histogram/public/container/hooks/use_state…
stratoula 96f8d52
Update src/plugins/unified_histogram/public/chart/chart_config_panel.tsx
stratoula 3ed8d35
Merge branch 'main' into inline-editing-byvalue
stratoula 49acc97
Fixes Safari scroll issue
stratoula 1056df8
Removes the extra shadown from the dimension flyout when in editing mode
stratoula c1453fa
Merge branch 'main' into inline-editing-byvalue
stratoula f9ecad4
Apply PR comments
stratoula 056c584
Merge branch 'main' into inline-editing-byvalue
stratoula 17b910f
Fixes dancing in layer settings too
stratoula 6f32df6
Removes dancing from the load annotations from library flyout
stratoula f8f23e7
Merge branch 'main' into inline-editing-byvalue
stratoula 441313e
Merge branch 'main' into inline-editing-byvalue
stratoula 5db6354
Merge branch 'main' into inline-editing-byvalue
stratoula f64ac1b
Fixes broken types
stratoula ca55c78
Fixes pointer events problem
stratoula 83ed9a4
Address PR comments
stratoula 2e5f380
Merge branch 'main' into inline-editing-byvalue
stratoula dcdbe04
Merge branch 'main' into inline-editing-byvalue
stratoula dd1f8f5
Merge branch 'main' into inline-editing-byvalue
stratoula 5d41f4f
Fix
stratoula 062ae4a
Merge branch 'main' into inline-editing-byvalue
stratoula File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/plugins/unified_histogram/public/__mocks__/lens_adapters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { UnifiedHistogramChartLoadEvent } from '../types'; | ||
|
||
export const lensAdaptersMock = { | ||
tables: { | ||
tables: { | ||
default: { | ||
columns: [ | ||
{ | ||
id: 'col-0-1', | ||
meta: { | ||
dimensionName: 'Slice size', | ||
type: 'number', | ||
}, | ||
name: 'Field 1', | ||
}, | ||
{ | ||
id: 'col-0-2', | ||
meta: { | ||
dimensionName: 'Slice', | ||
type: 'number', | ||
}, | ||
name: 'Field 2', | ||
}, | ||
], | ||
rows: [ | ||
{ | ||
'col-0-1': 0, | ||
'col-0-2': 0, | ||
'col-0-3': 0, | ||
'col-0-4': 0, | ||
}, | ||
], | ||
type: 'datatable', | ||
}, | ||
}, | ||
}, | ||
} as unknown as UnifiedHistogramChartLoadEvent['adapters']; |
40 changes: 0 additions & 40 deletions
40
src/plugins/unified_histogram/public/__mocks__/lens_table_adapter.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
*/ | ||
|
||
import React, { ReactElement, useMemo, useState, useEffect, useCallback, memo } from 'react'; | ||
import type { Observable } from 'rxjs'; | ||
import { | ||
EuiButtonIcon, | ||
EuiContextMenu, | ||
|
@@ -17,8 +18,11 @@ import { | |
EuiProgress, | ||
} from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import type { EmbeddableComponentProps, Suggestion } from '@kbn/lens-plugin/public'; | ||
import type { Datatable } from '@kbn/expressions-plugin/common'; | ||
import type { | ||
EmbeddableComponentProps, | ||
Suggestion, | ||
LensEmbeddableOutput, | ||
} from '@kbn/lens-plugin/public'; | ||
import { DataView, DataViewField, DataViewType } from '@kbn/data-views-plugin/public'; | ||
import type { LensEmbeddableInput } from '@kbn/lens-plugin/public'; | ||
import type { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query'; | ||
|
@@ -69,7 +73,8 @@ export interface ChartProps { | |
disableTriggers?: LensEmbeddableInput['disableTriggers']; | ||
disabledActions?: LensEmbeddableInput['disabledActions']; | ||
input$?: UnifiedHistogramInput$; | ||
lensTablesAdapter?: Record<string, Datatable>; | ||
lensAdapters?: UnifiedHistogramChartLoadEvent['adapters']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ️ Instead of sending only the tables we now send all the adapters object to Lens flyout. With this way we can fetch correctly the active data. (Solves a bug currently in main more visible on this PR, check first bullet here |
||
lensEmbeddableOutput$?: Observable<LensEmbeddableOutput>; | ||
isOnHistogramMode?: boolean; | ||
isChartLoading?: boolean; | ||
onResetChartHeight?: () => void; | ||
|
@@ -78,7 +83,10 @@ export interface ChartProps { | |
onBreakdownFieldChange?: (breakdownField: DataViewField | undefined) => void; | ||
onSuggestionChange?: (suggestion: Suggestion | undefined) => void; | ||
onTotalHitsChange?: (status: UnifiedHistogramFetchStatus, result?: number | Error) => void; | ||
onChartLoad?: (event: UnifiedHistogramChartLoadEvent) => void; | ||
onChartLoad?: ( | ||
event: UnifiedHistogramChartLoadEvent, | ||
lensEmbeddableOutput$?: Observable<LensEmbeddableOutput> | ||
) => void; | ||
onFilter?: LensEmbeddableInput['onFilter']; | ||
onBrushEnd?: LensEmbeddableInput['onBrushEnd']; | ||
withDefaultActions: EmbeddableComponentProps['withDefaultActions']; | ||
|
@@ -107,7 +115,8 @@ export function Chart({ | |
disableTriggers, | ||
disabledActions, | ||
input$: originalInput$, | ||
lensTablesAdapter, | ||
lensAdapters, | ||
lensEmbeddableOutput$, | ||
isOnHistogramMode, | ||
isChartLoading, | ||
onResetChartHeight, | ||
|
@@ -463,8 +472,8 @@ export function Chart({ | |
{...{ | ||
services, | ||
lensAttributesContext, | ||
dataView, | ||
lensTablesAdapter, | ||
lensAdapters, | ||
lensEmbeddableOutput$, | ||
currentSuggestion, | ||
isFlyoutVisible, | ||
setIsFlyoutVisible, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ hides the embeddable edit action if inline editing exists