Skip to content

Commit

Permalink
Chore (release): 5.1.1 (#1678)
Browse files Browse the repository at this point in the history
* Fix: Build information for feedback and telemetry (#1669)

* Task: Persist sidebar selection (#1664)

* Chore: Update fluentUI package (#1674)

* Bump version to 5.1.1
  • Loading branch information
github-actions[bot] authored Apr 22, 2022
1 parent bb595f7 commit bc54fb4
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 68 deletions.
107 changes: 54 additions & 53 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "graph-explorer-v2",
"version": "5.1.0",
"version": "5.1.1",
"private": true,
"dependencies": {
"@augloop/types-core": "file:packages/types-core-2.16.189.tgz",
"@axe-core/webdriverjs": "4.4.2",
"@azure/msal-browser": "2.23.0",
"@babel/core": "7.17.9",
"@babel/runtime": "7.17.9",
"@fluentui/react": "8.64.1",
"@fluentui/react": "8.66.1",
"@microsoft/applicationinsights-react-js": "3.2.4",
"@microsoft/applicationinsights-web": "2.7.4",
"@microsoft/microsoft-graph-client": "3.0.2",
Expand Down
4 changes: 2 additions & 2 deletions src/app/utils/version.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import version from '../../../package.json';
import packageJsonFile from '../../../package.json';

export function getVersion() {
return version || 0;
return packageJsonFile.version || 0;
}
13 changes: 11 additions & 2 deletions src/app/views/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ interface IAppState {
selectedVerb: string;
mobileScreen: boolean;
hideDialog: boolean;
sidebarTabSelection: string;
}

class App extends Component<IAppProps, IAppState> {
Expand All @@ -78,10 +79,17 @@ class App extends Component<IAppProps, IAppState> {
this.state = {
selectedVerb: 'GET',
mobileScreen: false,
hideDialog: true
hideDialog: true,
sidebarTabSelection: 'sample-queries'
};
}

private setSidebarTabSelection = (selectedTab : string) => {
this.setState({
sidebarTabSelection: selectedTab
});
}

public componentDidMount = async () => {
this.displayToggleButton(this.mediaQueryList);
this.mediaQueryList.addListener(this.displayToggleButton);
Expand Down Expand Up @@ -476,7 +484,8 @@ class App extends Component<IAppProps, IAppState> {
{this.displayAuthenticationSection(minimised)}
<hr className={classes.separator} />

{showSidebar && (<Sidebar />)}
{showSidebar && ( <Sidebar currentTab = { this.state.sidebarTabSelection }
setSidebarTabSelection = { this.setSidebarTabSelection } /> ) }
</Resizable>
)}
{graphExplorerMode === Mode.TryIt &&
Expand Down
27 changes: 18 additions & 9 deletions src/app/views/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,25 @@ import { translateMessage } from '../../utils/translate-messages';
import History from './history/History';
import { ResourceExplorer } from './resource-explorer';
import SampleQueries from './sample-queries/SampleQueries';
export const Sidebar = () => {

interface ISidebar {
currentTab: string;
setSidebarTabSelection: Function;
}
export const Sidebar = (props: ISidebar) => {

const onPivotItemClick = (item?: PivotItem) => {
if (!item) { return; }
const key = item.props.itemKey;
if (key) {
props.setSidebarTabSelection(key);
telemetry.trackTabClickEvent(key);
}
}

return (
<div>
<Pivot onLinkClick={onPivotItemClick} overflowBehavior='menu'>
<Pivot onLinkClick={onPivotItemClick} overflowBehavior='menu' defaultSelectedKey={props.currentTab}>
<PivotItem
headerText={translateMessage('Sample Queries')}
itemIcon='Rocket'
Expand Down Expand Up @@ -45,10 +60,4 @@ export const Sidebar = () => {
);
};

function onPivotItemClick(item?: PivotItem) {
if (!item) { return; }
const key = item.props.itemKey;
if (key) {
telemetry.trackTabClickEvent(key);
}
}

0 comments on commit bc54fb4

Please sign in to comment.