Skip to content
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

Fix: Resize query response area when zoomed out #2048

Merged
merged 4 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/app/views/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ class App extends Component<IAppProps, IAppState> {
let sideWidth = sidebar.width;
let maxWidth = '50%';
let contentWidth = content.width;
const contentHeight = content.height;

const query = createShareLink(sampleQuery, authenticated);
const { mobileScreen, showSidebar } = sidebarProperties;
Expand Down Expand Up @@ -453,15 +452,21 @@ class App extends Component<IAppProps, IAppState> {
}}
size={{
width: graphExplorerMode === Mode.TryIt ? '100%' : contentWidth,
height: contentHeight
height: ''
}}
style={!sidebarProperties.showSidebar && !mobileScreen ? {
marginLeft: '8px', display:'flex', flexDirection: 'column', alignItems: 'stretch', flex: 1
} : {
display:'flex', flexDirection: 'column', alignItems: 'stretch', flex: 1
}}
style={!sidebarProperties.showSidebar && !mobileScreen ? { marginLeft: '8px', flex: 1 } : {flex: 1}}
>
<div style={{ marginBottom: 8}} >
<div style={{ marginBottom: 2}} >
<QueryRunner onSelectVerb={this.handleSelectVerb} />
</div>

<div>
<div style={{
display:'flex', flexDirection: 'column', alignItems: 'stretch', flex: 1
}}>
<div style={mobileScreen ? this.statusAreaMobileStyle : this.statusAreaFullScreenStyle}>
<StatusMessages />
</div>
Expand Down
24 changes: 16 additions & 8 deletions src/app/views/query-response/QueryResponse.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
Announced, Dialog, DialogFooter, DialogType,
DefaultButton, FontSizes, IconButton,
Modal, Pivot, PivotItem, ITheme, getTheme
Modal, Pivot, PivotItem, getTheme, ITheme
} from '@fluentui/react';
import { Resizable } from 're-resizable';
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, CSSProperties } from 'react';
import { injectIntl } from 'react-intl';
import { useDispatch, useSelector } from 'react-redux';
import { componentNames, eventTypes, telemetry } from '../../../telemetry';
Expand Down Expand Up @@ -43,6 +43,13 @@ const QueryResponse = (props: IQueryResponseProps) => {
intl: { messages }
}: any = props;

const flexQueryElement: CSSProperties = {
display:'flex',
flexDirection: 'column',
alignItems: 'stretch',
flex: 1,
marginTop: -13
}
const toggleShareQueryDialogState = () => {
setShareQuaryDialogStatus(!showShareQueryDialog);
};
Expand Down Expand Up @@ -98,14 +105,14 @@ const QueryResponse = (props: IQueryResponseProps) => {
}

return (
<>
<div style={flexQueryElement} >
<Resizable
style={{
marginBottom: 10,
marginTop: 10
marginBottom: 20,
marginTop: 10,
flex: 1
}}
bounds={'window'}
maxHeight={810}
minHeight={350}
size={{
height: responseHeight,
Expand All @@ -117,7 +124,8 @@ const QueryResponse = (props: IQueryResponseProps) => {
>
<div className='query-response' style={{
minHeight: 350,
height: '100%'
height: '100%',
flex: 1
}}
onScroll={onScroll}>

Expand Down Expand Up @@ -200,7 +208,7 @@ const QueryResponse = (props: IQueryResponseProps) => {
/>
</DialogFooter>
</Dialog>
</>
</div>
);
};

Expand Down