Commit 3617e595 by Dominik Prokop Committed by GitHub

New panel edit: support scrolling (#22026)

* Make new edit work again

* Add custom scrolls

* better merge

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
parent e7710f0c
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { css, cx } from 'emotion'; import { css, cx } from 'emotion';
import { GrafanaTheme, PanelData, LoadingState, DefaultTimeRange, PanelEvents } from '@grafana/data'; import { GrafanaTheme, PanelData, LoadingState, DefaultTimeRange, PanelEvents } from '@grafana/data';
import { stylesFactory, Forms } from '@grafana/ui'; import { stylesFactory, Forms, CustomScrollbar } from '@grafana/ui';
import config from 'app/core/config'; import config from 'app/core/config';
import { PanelModel } from '../../state/PanelModel'; import { PanelModel } from '../../state/PanelModel';
...@@ -52,6 +52,10 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => { ...@@ -52,6 +52,10 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
cursor: row-resize; cursor: row-resize;
` `
), ),
noScrollPaneContent: css`
height: 100%;
overflow: hidden;
`,
}; };
}); });
...@@ -171,8 +175,9 @@ export class PanelEditor extends PureComponent<Props, State> { ...@@ -171,8 +175,9 @@ export class PanelEditor extends PureComponent<Props, State> {
</div> </div>
<SplitPane <SplitPane
split="vertical" split="vertical"
primary="second"
minSize={50} minSize={50}
defaultSize={'80%'} defaultSize={350}
resizerClassName={styles.resizerV} resizerClassName={styles.resizerV}
onDragStarted={() => (document.body.style.cursor = 'col-resize')} onDragStarted={() => (document.body.style.cursor = 'col-resize')}
onDragFinished={this.onDragFinished} onDragFinished={this.onDragFinished}
...@@ -180,7 +185,8 @@ export class PanelEditor extends PureComponent<Props, State> { ...@@ -180,7 +185,8 @@ export class PanelEditor extends PureComponent<Props, State> {
<SplitPane <SplitPane
split="horizontal" split="horizontal"
minSize={50} minSize={50}
defaultSize={'60%'} primary="second"
defaultSize="40%"
resizerClassName={styles.resizerH} resizerClassName={styles.resizerH}
onDragStarted={() => (document.body.style.cursor = 'row-resize')} onDragStarted={() => (document.body.style.cursor = 'row-resize')}
onDragFinished={this.onDragFinished} onDragFinished={this.onDragFinished}
...@@ -195,12 +201,14 @@ export class PanelEditor extends PureComponent<Props, State> { ...@@ -195,12 +201,14 @@ export class PanelEditor extends PureComponent<Props, State> {
isInView={true} isInView={true}
/> />
</div> </div>
<div> <div className={styles.noScrollPaneContent}>
<QueriesTab panel={dirtyPanel} dashboard={dashboard} /> <QueriesTab panel={dirtyPanel} dashboard={dashboard} />
</div> </div>
</SplitPane> </SplitPane>
<div> <div className={styles.noScrollPaneContent}>
<div>TODO: viz settings</div> <CustomScrollbar>
<div>Viz settings</div>
</CustomScrollbar>
</div> </div>
</SplitPane> </SplitPane>
</div> </div>
......
...@@ -65,6 +65,8 @@ ...@@ -65,6 +65,8 @@
min-width: 0; min-width: 0;
display: flex; display: flex;
min-height: 0; min-height: 0;
height: 100%;
overflow: hidden;
} }
.panel-editor__content { .panel-editor__content {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment