Skip to content

Commit

Permalink
chore(release): 4.1.11 (#769)
Browse files Browse the repository at this point in the history
* chore(release): 4.1.11

Co-authored-by: OfficeGlobal <47977325+OfficeGlobal@users.noreply.github.com>
Co-authored-by: OfficeGlobal <OfficeGlobal@microsoft.com>
Co-authored-by: Azure Static Web Apps <opensource@microsoft.com>
Co-authored-by: Elinor <ekaguongo@gmail.com>
Co-authored-by: jobala <japhethobalak@gmail.com>
Co-authored-by: Millicent Achieng <achieng.milli@gmail.com>
  • Loading branch information
7 people authored Nov 20, 2020
1 parent 627c748 commit d1be4a1
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 58 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graph-explorer-v2",
"version": "4.1.10",
"version": "4.1.11",
"private": true,
"dependencies": {
"@babel/core": "7.2.2",
Expand Down
130 changes: 82 additions & 48 deletions src/app/views/query-response/QueryResponse.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
import {
DefaultButton, FontSizes,
DefaultButton,
FontSizes,
getId,
Icon,
IconButton, Modal, Pivot,
IconButton,
Modal,
Pivot,
PivotItem,
PrimaryButton,
TooltipHost
TooltipHost,
} from 'office-ui-fabric-react';
import { Dialog, DialogFooter, DialogType } from 'office-ui-fabric-react/lib/Dialog';
import {
Dialog,
DialogFooter,
DialogType,
} from 'office-ui-fabric-react/lib/Dialog';
import React, { Component } from 'react';
import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';

import { IQueryResponseProps, IQueryResponseState } from '../../../types/query-response';
import {
IQueryResponseProps,
IQueryResponseState,
} from '../../../types/query-response';
import { translateMessage } from '../../utils/translate-messages';
import { copy } from '../common/copy';
import { createShareLink } from '../common/share';
import { getPivotItems } from './pivot-items/pivot-items';
import { getPivotItems, onPivotItemClick } from './pivot-items/pivot-items';
import './query-response.scss';

class QueryResponse extends Component<IQueryResponseProps, IQueryResponseState> {
class QueryResponse extends Component<
IQueryResponseProps,
IQueryResponseState
> {
constructor(props: any) {
super(props);
this.state = {
Expand All @@ -29,32 +42,36 @@ class QueryResponse extends Component<IQueryResponseProps, IQueryResponseState>
};
}

public shouldComponentUpdate(nextProps: IQueryResponseProps, nextState: IQueryResponseState) {
return nextProps.graphResponse !== this.props.graphResponse
|| nextProps.mobileScreen !== this.props.mobileScreen
|| nextState !== this.state
|| nextProps.theme !== this.props.theme;
public shouldComponentUpdate(
nextProps: IQueryResponseProps,
nextState: IQueryResponseState
) {
return (
nextProps.graphResponse !== this.props.graphResponse ||
nextProps.mobileScreen !== this.props.mobileScreen ||
nextState !== this.state ||
nextProps.theme !== this.props.theme
);
}

public handleCopy = () => {
copy('share-query-text')
.then(() => this.toggleShareQueryDialogState());
}
copy('share-query-text').then(() => this.toggleShareQueryDialogState());
};

public handleShareQuery = () => {
const { sampleQuery } = this.props;
const shareableLink = createShareLink(sampleQuery);
this.setState({ query: shareableLink });
this.toggleShareQueryDialogState();
}
};

public toggleShareQueryDialogState = () => {
this.setState({ showShareQueryDialog: !this.state.showShareQueryDialog });
};

public toggleExpandResponse = () => {
this.setState({ showModal: !this.state.showModal });
}
};

public toggleModal = (event: any) => {
const { key } = event;
Expand All @@ -64,11 +81,15 @@ class QueryResponse extends Component<IQueryResponseProps, IQueryResponseState>
if (key && key.includes('share')) {
this.handleShareQuery();
}
}
};

public renderItemLink(link: any) {
return (
<TooltipHost content={link.title} id={getId()} calloutProps={{ gapSpace: 0 }} >
<TooltipHost
content={link.title}
id={getId()}
calloutProps={{ gapSpace: 0 }}
>
<Icon iconName={link.itemIcon} style={{ paddingRight: 5 }} />
{link.headerText}
</TooltipHost>
Expand All @@ -81,7 +102,7 @@ class QueryResponse extends Component<IQueryResponseProps, IQueryResponseState>
const {
intl: { messages },
verb,
sampleQuery
sampleQuery,
}: any = this.props;

const { showShareQueryDialog, query, showModal } = this.state;
Expand All @@ -93,25 +114,33 @@ class QueryResponse extends Component<IQueryResponseProps, IQueryResponseState>
}

const pivotProperties = {
messages, body, verb, mode, headers, mobileScreen, sampleQuery
messages,
body,
verb,
mode,
headers,
mobileScreen,
sampleQuery,
};

const pivotItems = getPivotItems(pivotProperties);

return (
<div >
<div>
<div className='query-response'>
<Pivot className='pivot-response'
onLinkClick={this.toggleModal}
>
<Pivot className='pivot-response' onLinkClick={this.toggleModal}>
{pivotItems}
<PivotItem headerText='Share' key='share'
<PivotItem
headerText='Share'
key='share'
itemIcon='Share'
ariaLabel={translateMessage('Share Query Message')}
title={translateMessage('Share Query Message')}
onRenderItemLink={this.renderItemLink}
/>
<PivotItem headerText='Expand' key='expand'
<PivotItem
headerText='Expand'
key='expand'
itemIcon='MiniExpandMirrored'
ariaLabel={translateMessage('Expand response')}
title={translateMessage('Expand response')}
Expand All @@ -125,23 +154,20 @@ class QueryResponse extends Component<IQueryResponseProps, IQueryResponseState>
<Modal
isOpen={showModal}
onDismiss={this.toggleExpandResponse}
styles={{ main: { width: '80%', height: '90%' }, }}
styles={{ main: { width: '80%', height: '90%' } }}
>

<IconButton
styles={{
root: {
float: 'right',
zIndex: 1
zIndex: 1,
},
}}
iconProps={{ iconName: 'Cancel' }}
ariaLabel='Close popup modal'
onClick={this.toggleExpandResponse}
/>
<Pivot className='pivot-response'>
{pivotItems}
</Pivot>
<Pivot className='pivot-response'>{pivotItems}</Pivot>
</Modal>
}
<Dialog
Expand All @@ -151,25 +177,33 @@ class QueryResponse extends Component<IQueryResponseProps, IQueryResponseState>
type: DialogType.normal,
title: 'Share Query',
isMultiline: true,
subText: messages['Share Query Message']
subText: messages['Share Query Message'],
}}
>
<textarea style={{
wordWrap: 'break-word',
fontFamily: 'monospace',
fontSize: FontSizes.xSmall,
width: '100%',
height: 63,
overflowY: 'scroll',
border: 'none',
resize: 'none'
}} className='share-query-params' id='share-query-text' defaultValue={query} />
<textarea
style={{
wordWrap: 'break-word',
fontFamily: 'monospace',
fontSize: FontSizes.xSmall,
width: '100%',
height: 63,
overflowY: 'scroll',
border: 'none',
resize: 'none',
}}
className='share-query-params'
id='share-query-text'
defaultValue={query}
/>
<DialogFooter>
<PrimaryButton text={messages.Copy} onClick={this.handleCopy} />
<DefaultButton text={messages.Close} onClick={this.toggleShareQueryDialogState} />
<DefaultButton
text={messages.Close}
onClick={this.toggleShareQueryDialogState}
/>
</DialogFooter>
</Dialog>
</div >
</div>
);
}
}
Expand All @@ -181,10 +215,10 @@ function mapStateToProps(state: any) {
mode: state.graphExplorerMode,
scopes: state.scopes.data,
sampleQuery: state.sampleQuery,
mobileScreen: !!state.sidebarProperties.mobileScreen
mobileScreen: !!state.sidebarProperties.mobileScreen,
};
}

// @ts-ignore
const WithIntl = injectIntl(QueryResponse);
export default connect(mapStateToProps)(WithIntl);
export default connect(mapStateToProps)(WithIntl);
2 changes: 1 addition & 1 deletion src/messages/GE.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@
"Microsoft Graph API Version option": "Microsoft Graph API Version option",
"Query Sample Input": "Query sample input",
"popup blocked, allow pop-up windows in your browser": "popup blocked, allow pop-up windows in your browser"
}
}
2 changes: 1 addition & 1 deletion src/messages/GE_de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@
"Microsoft Graph API Version option": "Microsoft Graph-API-Version (Option)",
"Query Sample Input": "Beispieleingabe für eine Abfrage",
"popup blocked, allow pop-up windows in your browser": "Popup blockiert, Popup-Fenster in Ihrem Browser zulassen"
}
}
2 changes: 1 addition & 1 deletion src/messages/GE_es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@
"Microsoft Graph API Version option": "Opción de la versión de la API de Microsoft Graph",
"Query Sample Input": "Entrada de ejemplo de consulta",
"popup blocked, allow pop-up windows in your browser": "elemento emergente bloqueado, permitir ventanas emergentes en el explorador"
}
}
2 changes: 1 addition & 1 deletion src/messages/GE_fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@
"Microsoft Graph API Version option": "Option de version de l’API Microsoft Graph",
"Query Sample Input": "Exemple d’entrée de requête",
"popup blocked, allow pop-up windows in your browser": "fenêtre contextuelle bloquée, autoriser les fenêtres contextuelles dans votre navigateur"
}
}
2 changes: 1 addition & 1 deletion src/messages/GE_ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@
"Microsoft Graph API Version option": "Microsoft Graph API バージョン オプション",
"Query Sample Input": "クエリのサンプル入力",
"popup blocked, allow pop-up windows in your browser": "ポップアップがブロックされています。ブラウザーでポップアップ ウィンドウを許可してください"
}
}
2 changes: 1 addition & 1 deletion src/messages/GE_pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@
"Microsoft Graph API Version option": "Opção de versão da API do Microsoft Graph",
"Query Sample Input": "Entrada de exemplo de consulta",
"popup blocked, allow pop-up windows in your browser": "popup bloqueado, permitir janelas pop-up em seu navegador"
}
}
2 changes: 1 addition & 1 deletion src/messages/GE_ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@
"Microsoft Graph API Version option": "Параметр версии API Microsoft Graph",
"Query Sample Input": "Пример ввода запроса",
"popup blocked, allow pop-up windows in your browser": "всплывающее окно заблокировано, разрешить всплывающие окна в браузере"
}
}
2 changes: 1 addition & 1 deletion src/messages/GE_zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@
"Microsoft Graph API Version option": "Microsoft Graph API 版本选项",
"Query Sample Input": "查询示例输入",
"popup blocked, allow pop-up windows in your browser": "已阻止弹出窗口,允许浏览器中的弹出窗口"
}
}

0 comments on commit d1be4a1

Please sign in to comment.