diff --git a/package-lock.json b/package-lock.json index e12527c7d..bfb4f6c8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "graph-explorer-v2", - "version": "4.1.10", + "version": "4.1.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7eb51cd84..a042f70f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "graph-explorer-v2", - "version": "4.1.10", + "version": "4.1.11", "private": true, "dependencies": { "@babel/core": "7.2.2", diff --git a/src/app/views/query-response/QueryResponse.tsx b/src/app/views/query-response/QueryResponse.tsx index 5f593a538..b66a9d088 100644 --- a/src/app/views/query-response/QueryResponse.tsx +++ b/src/app/views/query-response/QueryResponse.tsx @@ -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 { +class QueryResponse extends Component< + IQueryResponseProps, + IQueryResponseState +> { constructor(props: any) { super(props); this.state = { @@ -29,24 +42,28 @@ class QueryResponse extends Component }; } - 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 }); @@ -54,7 +71,7 @@ class QueryResponse extends Component public toggleExpandResponse = () => { this.setState({ showModal: !this.state.showModal }); - } + }; public toggleModal = (event: any) => { const { key } = event; @@ -64,11 +81,15 @@ class QueryResponse extends Component if (key && key.includes('share')) { this.handleShareQuery(); } - } + }; public renderItemLink(link: any) { return ( - + {link.headerText} @@ -81,7 +102,7 @@ class QueryResponse extends Component const { intl: { messages }, verb, - sampleQuery + sampleQuery, }: any = this.props; const { showShareQueryDialog, query, showModal } = this.state; @@ -93,25 +114,33 @@ class QueryResponse extends Component } const pivotProperties = { - messages, body, verb, mode, headers, mobileScreen, sampleQuery + messages, + body, + verb, + mode, + headers, + mobileScreen, + sampleQuery, }; const pivotItems = getPivotItems(pivotProperties); return ( -
+
- + {pivotItems} - - - - - {pivotItems} - + {pivotItems} } type: DialogType.normal, title: 'Share Query', isMultiline: true, - subText: messages['Share Query Message'] + subText: messages['Share Query Message'], }} > -