Skip to content

Commit

Permalink
Release 4.1.3 (#581)
Browse files Browse the repository at this point in the history
* commit translated contents

* Check for instumentation key

* Fix prop errors

* Refactor getInstrumentationKey

* Remove unused variable

* increases spacing in profile to show names properly

* changes wording and colour on info bar

* shares link with authentication token

* Sanitise url

* commit translated contents

* adds the language to the share liink

* commit translated contents

* replaces access token with email address in share link

* adds a dialog to prompt mismatched users to login

* commit translated contents

* commit translated contents

* commit translated contents

* renames auth tab and snippets tabs

* improves display of auth token

* renames the Officedev link

* adds modify permissions labelling

* changes naming styles to sentence case

* changes wording on delete history feature

* adds tooltip message to share query and expand response button

* adds a close button to expanded response

* commit translated contents

* fixes re-rendering problems on query response

* Experiment: Check if a user can switch context without logging in

* shows message instead of components when history items are missing

* Fix lint errors

* commit translated contents

* commit translated contents

* commit translated contents

* Ask user to sign in if no session id

* Asks user to log in if they do not have a session id

* changes implementation from using an email to a session id

* adds the language to the share link

* commit translated contents

* checks authentication status before creating link

* adds the category to filters in the sidebar

* bumps version to 4.0.5

* commit translated contents

* commit translated contents

* commit translated contents

* adds tests for sample url generation

* adds checks to url generation steps

* utilises the parseUrl function for consistency

* prevents fetching of scopes if url is invalid

* fixes permissions error when url invalid

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* Get instrumentation key from window object

* Use dot instead of string

* refactors showProfile logic to show correct profile

* enhance vertical alignment

* handles errors in catch statements; line spacing improvements

* fixes faulty url encoding in the url

* only show get requests - anonymous try-it

* prepares march 17 2020 release

* Bump acorn from 5.7.3 to 5.7.4

Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](acornjs/acorn@5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>

* shows long endpoints

* increases padding in search texts

* give context to the search place holder

* moves files to feature folders

* enables headers scrolling

* remove cartoon references

* adds icons to pivot items

* displays icons only when on mobile view

* adds  an authentication required icon

* displays tip after 403 error

* change header names and add them to localisation

* adds descriptive text to permissions tab

* remove har as a property of Ihistory item

* export query

* exports bulk items

* change modify permissions message

* add aria controls to localization; hide icon when logged in

* append category name to exported history item

* change the privacy statement layout and words

* change empty access token wording

* adds a descriptive phrase below the samples tab

* fix linting errors

* adds headers tp share query link

* refactor sample headers to display shared headers

* fix linting errors

* remove request headers reducers tests

* change default value

* use autolayout grids

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* fixes enter key press not running new query

* add tooltips to the pivot items

* add tooltip to request pivot items

* fix linting errors

* bump to v4.1.0

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* Fix: align try it scroll bars (#478)

* Feature: list all permissions (#477)

* change samples endpoint

* creates a new setting to handle permissions

* changes permission to allow panel view and tab view

* allow consent of multiple items at a go

* enhance action creator to take state's url

* enhance permissions hooks to enable dispatch fetchScopes

* perform search when sample url changes

* change snippets to use state devX api url

* fix failing test

* fix liniting errors

* subscribe permissions to selected verb

* move consent function to action creator for reusability

* displays the permissions in order when in the panel

* adds sorting tests

* remove bulk permissions consent

* create groups to categorise permissions

* convert to class component :-(

* select multiiple permissions for consent

* accessibility edits

* Improve messaging

* display message of empty permissions

* use object destructuring

* change settings class component to hooks to fix close/reopen bug

* Feature: Display blue dot present adaptive cards (#493)

* create blue dot on tab

* abstract adaptive cards lookup function

* display dot on adaptive cards title when card template is present

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* Fix: responsive views (#496)

* add app sections to make app.tsx more readable

* treat screens with width less than 992px as mobile screens
At point 992 is where the screen breaks

* Fix: provide account choice on sign in (#497)

* commit translated contents

* Fix: Share query errors (#501)

* fixes header undefined error when sharing link

* add null check for headers passed from url

* Fix: Stop Infinite spinning when login fails (#492)

* stop infinite spinning and display error

* add status text to localisation

* fix failing internationalization

* FIx: Build static assets for master & dev (#498)

* Build static assets for master & dev

* Build prod assets with prod client id

* Fix typo

* Fix typo in yml

* Fix: try it logout (#502)

* displays authentication section

* enables logging out using a popup

* add try it check when displaying authentication

* Feature: add locale to headers devxapi (#500)

* add accept-language to queries to the devxApi

* remove localisation from sample queries

* add placeholder texts to localisation

* reuse locale code to enable url overriding

* add reference to new translation files

* delete unused translation files

* add try catch to sample queries fetch

* Fix: Remove redundant authentication (#518)

* Task: responsive sidebar (#519)

* bump breakpoint to 1260px

* remove comments

* Task: translate key value pair (#517)

* Task: Remove opt out toggle (#516)

* remove opt out toggle

* remove opt out function

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* Task: GA bug bash (#526)

* add tooltip on the sample query name

* add current locale to all links

* fix permissions column misalignment

* fix permissions tooltip mismatch

* Fix: sidebar http methods (#527)

* fixes unresponsive method badge

* adds horizontal scrolling to the sidebar

* Fix: Portuguese locale not loading (#529)

* Task: refine permission column sizes (#528)

* Fix: Misaligned sidebar elements (#530)

* Task: localised login popup (#534)

* Task: display settings icon mobile view (#535)

* display the auth and settings on sidebar in mobile view

* align auth to the left instead of indented

* only show adaptive card after response is set

* Release: 4.1.1 (#536)

* bump to version 4.1.1

* create build files for 4.1.1

* Fix: remove duplicate content type header (#537)

* dispatch thrown response

* remove content type header

* add comment on the reliance on the graph client

* Release/v4.1.2 (#538)

* bump version to 4.1.2

* create build files

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* commit translated contents

* Make Run Query button responsive

* Fix indentation

* Fix: select permissions pop up (#559)

* fully closes the select permissions panel

* remove false authenticated check

* Fix: lowercase locales (#551)

* change share query location from preview

* adds a redirecturi in lowercase when signing in

* localise locale section

* Fix: snippets generation for queries with search parameters (#549)

* re-render list when user consents to permission

* Support for tenanted endpoint in Graph explorer. 

Currently to go a tenant in Graph Explorer, we need to create a local account in tenant. After this change a tenantId queryString parameter can be passed and then all login requests will go to that tenant.
sample request 
https://developer.microsoft.com/en-us/graph/graph-explorer?tenantId=abc.onmicrosoft.com

if no tenantId is specified, the request goes to common endpoint. 

Tested the redirection is happening correctly.

* fixed lint errors

* working changes

* doe

* displays logout option in dropdown on smaller screens

* fixes documentation link colour and responsiveness

* adds a token for user-id in the presence api

* Updated redirect URI

* linting checks

* view query when history item is clicked

* add json validation for sample queries

* add message to localisation

* add action to message

* bump to version 4.1.3

* add 4.1.3 build files

Co-authored-by: olprod <olprod@microsoft.com>
Co-authored-by: jobala <japhethobalak@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Abhishek Agrawal <abhiagr@microsoft.com>
  • Loading branch information
5 people authored Jun 10, 2020
1 parent 233a6ae commit 468dea9
Show file tree
Hide file tree
Showing 28 changed files with 174 additions and 94 deletions.
2 changes: 1 addition & 1 deletion build/asset-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"index.html": "/index.html",
"json.worker.js": "/json.worker.js",
"json.worker.js.map": "/json.worker.js.map",
"precache-manifest.6b3ae80a3dbb52db4cc0a9cb32ba8421.js": "/precache-manifest.6b3ae80a3dbb52db4cc0a9cb32ba8421.js",
"precache-manifest.e0165064ec63201493530b5cb65c7c5b.js": "/precache-manifest.e0165064ec63201493530b5cb65c7c5b.js",
"service-worker.js": "/service-worker.js"
}
22 changes: 22 additions & 0 deletions build/precache-manifest.e0165064ec63201493530b5cb65c7c5b.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
self.__precacheManifest = [
{
"revision": "e4fa559d9f2507916520",
"url": "/static/js/graph-explorer-v2.js"
},
{
"revision": "e4fa559d9f2507916520",
"url": "/static/css/graph-explorer-v2.css"
},
{
"revision": "dabb6794539dcffa626977241f045733",
"url": "/json.worker.js"
},
{
"revision": "c3777c4227ca9d1a9defdec7a4629805",
"url": "/index.html"
},
{
"revision": "28fb5d03fade2944cf2e027e36c7517b",
"url": "/editor.worker.js"
}
];
2 changes: 1 addition & 1 deletion build/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");

importScripts(
"/precache-manifest.6b3ae80a3dbb52db4cc0a9cb32ba8421.js"
"/precache-manifest.e0165064ec63201493530b5cb65c7c5b.js"
);

workbox.clientsClaim();
Expand Down
2 changes: 1 addition & 1 deletion build/static/css/graph-explorer-v2.css.map

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions build/static/js/graph-explorer-v2.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/js/graph-explorer-v2.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graph-explorer-v2",
"version": "4.1.2",
"version": "4.1.3",
"private": true,
"dependencies": {
"@babel/core": "7.2.2",
Expand Down Expand Up @@ -115,4 +115,4 @@
"tslint-config-prettier": "1.18.0",
"tslint-react": "4.0.0"
}
}
}
4 changes: 2 additions & 2 deletions src/app/services/actions/snippet-action-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function getSnippet(language: string): Function {
const { devxApi, sampleQuery } = getState();
let snippetsUrl = `${devxApi}/api/graphexplorersnippets`;

const { requestUrl, sampleUrl, queryVersion } = parseSampleUrl(sampleQuery.sampleUrl);
const { requestUrl, sampleUrl, queryVersion, search } = parseSampleUrl(sampleQuery.sampleUrl);
if (!sampleUrl) {
throw new Error('url is invalid');
}
Expand All @@ -39,7 +39,7 @@ export function getSnippet(language: string): Function {
dispatch(getSnippetPending());

// tslint:disable-next-line: max-line-length
const body = `${sampleQuery.selectedVerb} /${queryVersion}/${requestUrl} HTTP/1.1\r\nHost: graph.microsoft.com\r\nContent-Type: application/json\r\n\r\n${JSON.stringify(sampleQuery.sampleBody)}`;
const body = `${sampleQuery.selectedVerb} /${queryVersion}/${requestUrl + search} HTTP/1.1\r\nHost: graph.microsoft.com\r\nContent-Type: application/json\r\n\r\n${JSON.stringify(sampleQuery.sampleBody)}`;
const obj: any = {};
const response = await fetch(snippetsUrl, {
method: 'POST',
Expand Down
27 changes: 25 additions & 2 deletions src/app/services/graph-client/msal-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,32 @@ export function getSessionId() {
}
}

// get current uri for redirect uri purpose
// ref - https://github.com/AzureAD/microsoft-authentication-library-for
// -js/blob/9274fac6d100a6300eb2faa4c94aa2431b1ca4b0/lib/msal-browser/src/utils/BrowserUtils.ts#L49
function getCurrentUri(): string {
return window.location.href.split('?')[0].split('#')[0];
}

function getAuthority(): string {
// support for tenanted endpoint
const urlParams = new URLSearchParams(location.search);
let tenant = urlParams.get('tenant');

if (tenant === null) {
tenant = 'common';
}

return `https://login.microsoftonline.com/${tenant}/`;
}

export async function logIn(sessionId = ''): Promise<any> {

const loginRequest: AuthenticationParameters = {
scopes: defaultUserScopes,
authority: getAuthority(),
prompt: 'select_account',
redirectUri: getCurrentUri().toLowerCase(),
extraQueryParameters: { mkt: geLocale }
};

Expand Down Expand Up @@ -82,8 +104,8 @@ export function logOutPopUp() {
// @ts-ignore
msalApplication.authorityInstance.resolveEndpointsAsync().then(authority => {
const urlNavigate = authority.EndSessionEndpoint
? authority.EndSessionEndpoint
: `${msalApplication.authority}oauth2/v2.0/logout`;
? authority.EndSessionEndpoint
: `${msalApplication.authority}oauth2/v2.0/logout`;
(msalApplication as any).openPopup(urlNavigate, 'msal', 400, 600);
});
}
Expand All @@ -96,6 +118,7 @@ export function logOutPopUp() {
export async function acquireNewAccessToken(scopes: string[] = []): Promise<any> {
const loginRequest: AuthenticationParameters = {
scopes,
authority: getAuthority(),
};
if (loginType === LoginType.Popup) {
try {
Expand Down
19 changes: 7 additions & 12 deletions src/app/views/authentication/profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export class Profile extends Component<IProfileProps, IProfileState> {
const { user } = this.state;
const {
intl: { messages },
mobileScreen,
minimised,
graphExplorerMode,
}: any = this.props;
Expand Down Expand Up @@ -158,11 +157,7 @@ export class Profile extends Component<IProfileProps, IProfileState> {

return (
<div className={classes.profile}>
{mobileScreen &&
<Persona {...persona} size={PersonaSize.size40} />
}

{!mobileScreen && this.showProfileComponent(profileProperties, graphExplorerMode, menuProperties)}
{this.showProfileComponent(profileProperties, graphExplorerMode, menuProperties)}
</div>
);
}
Expand All @@ -175,13 +170,13 @@ export class Profile extends Component<IProfileProps, IProfileState> {
styles={profileProperties.styles}
hidePersonaDetails={profileProperties.hidePersonaDetails} />;

if (graphExplorerMode === Mode.TryIt) {
return <ActionButton ariaLabel='profile' role='button' menuProps={menuProperties}>
{persona}
</ActionButton>;
}
if (graphExplorerMode === Mode.TryIt) {
return <ActionButton ariaLabel='profile' role='button' menuProps={menuProperties}>
{persona}
</ActionButton>;
}

return persona;
return persona;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/views/common/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const createShareLink = (sampleQuery: IQuery, authenticated?: boolean): s

const url = new URL(sampleUrl);
const graphUrl = url.origin;
const appUrl = 'https://developer.microsoft.com/' + geLocale + '/graph/graph-explorer/preview';
const appUrl = 'https://developer.microsoft.com/' + geLocale.toLowerCase() + '/graph/graph-explorer';
/**
* To ensure backward compatibility the version is removed from the pathname.
* V3 expects the request query param to not have the version number.
Expand Down
4 changes: 2 additions & 2 deletions src/app/views/query-runner/QueryInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class QueryInput extends Component<IQueryInputProps, any> {
onChange={(event, method) => handleOnVersionChange(method)}
/>
</div>
<div className='col-xs-12 col-lg-7'>
<div className='col-xs-12 col-lg-6'>
<TextField
ariaLabel='Query Sample Input'
role='textbox'
Expand All @@ -100,7 +100,7 @@ export class QueryInput extends Component<IQueryInputProps, any> {
onKeyDown={this.handleKeyDown}
/>
</div>
<div className='col-xs-12 col-lg-1'>
<div className='col-xs-12 col-lg-2'>
<SubmitButton
className='run-query-button'
text={messages['Run Query']}
Expand Down
25 changes: 20 additions & 5 deletions src/app/views/query-runner/QueryRunner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { IDropdownOption } from 'office-ui-fabric-react';
import { IDropdownOption, MessageBarType } from 'office-ui-fabric-react';
import React, { Component } from 'react';
import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { bindActionCreators, Dispatch } from 'redux';

Expand All @@ -9,6 +10,7 @@ import {
} from '../../../types/query-runner';
import * as queryActionCreators from '../../services/actions/query-action-creators';
import * as queryInputActionCreators from '../../services/actions/query-input-action-creators';
import * as queryStatusActionCreators from '../../services/actions/query-status-action-creator';
import { parseSampleUrl } from '../../utils/sample-url-generation';
import './query-runner.scss';
import QueryInput from './QueryInput';
Expand Down Expand Up @@ -66,10 +68,21 @@ export class QueryRunner extends Component<

private handleOnRunQuery = () => {
const { sampleBody } = this.state;
const { actions, sampleQuery } = this.props;
const { actions, sampleQuery, } = this.props;
const { intl: { messages } }: any = this.props;

if (sampleBody) {
sampleQuery.sampleBody = JSON.parse(sampleBody);
try {
sampleQuery.sampleBody = JSON.parse(sampleBody);
} catch (error) {
actions!.setQueryResponseStatus({
ok: false,
statusText: messages['Malformed JSON body'],
status: `${messages['Review the request body']} ${error}`,
messageType: MessageBarType.error
});
return;
}
}

if (actions) {
Expand Down Expand Up @@ -136,7 +149,7 @@ export class QueryRunner extends Component<
function mapDispatchToProps(dispatch: Dispatch): object {
return {
actions: bindActionCreators(
{ ...queryActionCreators, ...queryInputActionCreators },
{ ...queryActionCreators, ...queryInputActionCreators, ...queryStatusActionCreators },
dispatch
)
};
Expand All @@ -148,7 +161,9 @@ function mapStateToProps(state: any) {
};
}

// @ts-ignore
const IntlQueryRunner = injectIntl(QueryRunner);
export default connect(
mapStateToProps,
mapDispatchToProps
)(QueryRunner);
)(IntlQueryRunner);
19 changes: 10 additions & 9 deletions src/app/views/query-runner/request/permissions/Permission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ export class Permission extends Component<IPermissionProps, IPermissionState> {

public shouldComponentUpdate(nextProps: IPermissionProps, nextState: IPermissionState) {
const shouldUpdate = nextProps.sample !== this.props.sample
|| nextProps.scopes !== this.props.scopes
|| nextState.permissions !== this.state.permissions;
|| nextProps.scopes !== this.props.scopes
|| nextProps.consentedScopes !== this.props.consentedScopes
|| nextState.permissions !== this.state.permissions;
return shouldUpdate;
}

Expand Down Expand Up @@ -137,7 +138,7 @@ export class Permission extends Component<IPermissionProps, IPermissionState> {
id={hostId}
calloutProps={{ gapSpace: 0 }}
styles={{
root: { display: 'block'}
root: { display: 'block' }
}}
>
<span aria-labelledby={hostId}>
Expand All @@ -150,12 +151,12 @@ export class Permission extends Component<IPermissionProps, IPermissionState> {
default:
return (
<TooltipHost
content={content}
id={hostId}
content={content}
id={hostId}
calloutProps={{ gapSpace: 0 }}
className={classes.tooltipHost}
>
<span aria-labelledby={hostId} style={{ fontSize: FontSizes.medium}}>
<span aria-labelledby={hostId} style={{ fontSize: FontSizes.medium }}>
{content}
</span>
</TooltipHost>
Expand Down Expand Up @@ -295,7 +296,7 @@ export class Permission extends Component<IPermissionProps, IPermissionState> {
ariaLabelForSelectionColumn='Toggle selection'
ariaLabelForSelectAllCheckbox='Toggle selection for all items'
checkButtonAriaLabel='Row checkbox'
/>
/>
</>
);
}
Expand All @@ -307,7 +308,7 @@ export class Permission extends Component<IPermissionProps, IPermissionState> {
<Label className={classes.permissionText}>
<FormattedMessage id='permissions required to run the query' />
</Label>
<DetailsList styles={{ root: { minHeight: '300px'}}}
<DetailsList styles={{ root: { minHeight: '300px' } }}
items={permissions}
columns={columns}
onRenderItemColumn={this.renderItemColumn}
Expand All @@ -325,7 +326,7 @@ export class Permission extends Component<IPermissionProps, IPermissionState> {
const { permissions } = this.state;

return (
<div className={classes.container} style={{ minHeight: (panel) ? '800px' : '300px' }}>
<div className={classes.container} style={{ minHeight: (panel) ? '800px' : '300px' }}>
{loading && <Label>
<FormattedMessage id={'Fetching permissions'} />...
</Label>}
Expand Down
10 changes: 5 additions & 5 deletions src/app/views/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import { Permission } from '../query-runner/request/permissions';
function Settings(props: ISettingsProps) {
const dispatch = useDispatch();

const [ themeChooserDialogHidden, hideThemeChooserDialog] = useState(true);
const [ items, setItems] = useState([]);
const [ selectedPermissions, setSelectedPermissions] = useState([]);
const [ panelIsOpen, setPanelState] = useState(false);
const [themeChooserDialogHidden, hideThemeChooserDialog] = useState(true);
const [items, setItems] = useState([]);
const [selectedPermissions, setSelectedPermissions] = useState([]);
const [panelIsOpen, setPanelState] = useState(false);

const {
intl: { messages }
Expand Down Expand Up @@ -194,7 +194,7 @@ function Settings(props: ISettingsProps) {

<Panel
isOpen={panelIsOpen}
onDismiss={() => togglePermissionsPanel}
onDismiss={() => togglePermissionsPanel()}
type={PanelType.medium}
hasCloseButton={true}
headerText={messages.Permissions}
Expand Down
4 changes: 3 additions & 1 deletion src/app/views/sidebar/Sidebar.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export const sidebarStyles = (theme: ITheme) => {
marginTop: '-7.5%',
marginRight: theme.spacing.s1,
},

links: {
color: `${theme.palette.blueMid} !important`,
},
};
};
3 changes: 2 additions & 1 deletion src/app/views/sidebar/history/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export class History extends Component<IHistoryProps, any> {
const classes = classNames(this.props);
return (
<div className={classes.groupHeader}>
<DetailsRow {...props} className={classes.queryRow} />
<DetailsRow {...props} className={classes.queryRow}
onClick={() => this.onViewQuery(props.item)} />
</div>
);
};
Expand Down
Loading

0 comments on commit 468dea9

Please sign in to comment.