Skip to content

Commit

Permalink
Revert "Merge branch 'dev'"
Browse files Browse the repository at this point in the history
This reverts commit 194610a.
  • Loading branch information
Onokaev committed Jan 5, 2022
1 parent 194610a commit f167a60
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 490 deletions.
557 changes: 155 additions & 402 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 1 addition & 22 deletions src/app/middleware/telemetryMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import { SeverityLevel } from '@microsoft/applicationinsights-web';
import {
componentNames,
errorTypes,
eventTypes,
telemetry
} from '../../telemetry';
import { componentNames, errorTypes, telemetry } from '../../telemetry';
import { IAction } from '../../types/action';
import { IQuery } from '../../types/query-runner';
import { IRootState } from '../../types/root';
import {
FETCH_ADAPTIVE_CARD_ERROR,
FETCH_SCOPES_ERROR,
GET_SNIPPET_ERROR,
RESOURCEPATHS_ADD_SUCCESS,
RESOURCEPATHS_DELETE_SUCCESS,
SAMPLES_FETCH_ERROR
} from '../services/redux-constants';
import { sanitizeQueryUrl } from '../utils/query-url-sanitization';
Expand Down Expand Up @@ -62,20 +55,6 @@ const telemetryMiddleware =
);
break;
}
case RESOURCEPATHS_ADD_SUCCESS: {
telemetry.trackEvent(eventTypes.LISTITEM_CLICK_EVENT, {
ComponentName: componentNames.ADD_RESOURCE_TO_COLLECTION_LIST_ITEM,
ResourcePath: action.response[0].url
});
break;
}
case RESOURCEPATHS_DELETE_SUCCESS: {
telemetry.trackEvent(eventTypes.LISTITEM_CLICK_EVENT, {
ComponentName: componentNames.REMOVE_RESOURCE_FROM_COLLECTION_BUTTON,
ResourceCount: action.response.length
});
break;
}
}
return next(action);
};
Expand Down
4 changes: 2 additions & 2 deletions src/app/utils/query-parameter-sanitization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ function sanitizeFilterQueryOptionValue(queryParameterValue: string): string {
propertyName = '<property>';
}
sanitizedQueryString += `${queryFunctionPrefix}(${propertyName}${commaIndex > 0 ? ',<value>' : ''
})`;
})`;
} else {
sanitizedQueryString += `${queryFunctionPrefix}(<unknown>)`;
break;
Expand All @@ -460,7 +460,7 @@ function sanitizeFilterQueryOptionValue(queryParameterValue: string): string {
ARITHMETIC_OPERATORS.includes(expectedOperator)
) {
sanitizedQueryString += `${segment} ${filterSegments[index + 1]
} <value>`;
} <value>`;
index += 2;
continue;
}
Expand Down
25 changes: 0 additions & 25 deletions src/app/views/common/download.ts

This file was deleted.

12 changes: 3 additions & 9 deletions src/app/views/common/monaco/util/format-json.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import { SeverityLevel } from '@microsoft/applicationinsights-web';

import {
componentNames,
errorTypes,
telemetry
} from '../../../../../telemetry';
import { componentNames, errorTypes, telemetry } from '../../../../../telemetry';

export function formatJsonStringForAllBrowsers(
body: string | object | undefined
) {
export function formatJsonStringForAllBrowsers(body: string | object | undefined) {
/**
* 1. Remove whitespace, tabs or raw string (Safari related issue)
* 2. Convert back to javascript object
Expand All @@ -22,7 +16,7 @@ export function formatJsonStringForAllBrowsers(
new Error(errorTypes.OPERATIONAL_ERROR),
SeverityLevel.Error,
{
ComponentName: componentNames.MONACO_EDITOR_FORMAT_JSON_ACTION,
ComponentName: componentNames.MONACO_EDITOR,
Message: `${error}`
}
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/views/sidebar/history/har-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IHarFormat, IHarHeaders, IHarPayload } from '../../../../types/har';
import { IHistoryItem } from '../../../../types/history';
import { downloadToLocal } from '../../common/download';
import { downloadToLocal } from '../../../utils/download';

export function createHarPayload(query: IHistoryItem): IHarPayload {
const queryResult = JSON.stringify(query.result);
Expand Down
11 changes: 0 additions & 11 deletions src/app/views/sidebar/resource-explorer/ResourceExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
import React, { useEffect, useState } from 'react';
import { FormattedMessage } from 'react-intl';
import { useDispatch, useSelector } from 'react-redux';
import { telemetry, eventTypes, componentNames } from '../../../../telemetry';

import { IResource, IResourceLink, ResourceOptions } from '../../../../types/resources';
import { IRootState } from '../../../../types/root';
Expand Down Expand Up @@ -140,11 +139,6 @@ const unstyledResourceExplorer = (props: any) => {
];
setItems(tree);
setIsolated(navLink);
telemetry.trackEvent(eventTypes.LISTITEM_CLICK_EVENT,
{
ComponentName: componentNames.RESOURCES_ISOLATE_QUERY_LIST_ITEM,
ResourcePath: getUrlFromLink(navLink)
});
}

const disableIsolation = (): void => {
Expand Down Expand Up @@ -174,11 +168,6 @@ const unstyledResourceExplorer = (props: any) => {
context
});
setPanelHeaderText(`${requestUrl}`);
telemetry.trackEvent(eventTypes.LISTITEM_CLICK_EVENT,
{
ComponentName: componentNames.RESOURCES_QUERY_PARAMETERS_LIST_ITEM,
ResourcePath: requestUrl
});
}
}

Expand Down
10 changes: 1 addition & 9 deletions src/app/views/sidebar/resource-explorer/ResourceLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { useDispatch } from 'react-redux';
import { telemetry, eventTypes, componentNames } from '../../../../telemetry';

import { IQuery } from '../../../../types/query-runner';
import { IResourceLink, ResourceOptions } from '../../../../types/resources';
Expand Down Expand Up @@ -34,8 +33,7 @@ const ResourceLink = (props: IResourceLinkProps) => {
};

const setQuery = (link: IResourceLink, selectedVerb: string) => {
const resourceUrl = getUrlFromLink(link);
const sampleUrl = `${GRAPH_URL}/${version}${resourceUrl}`;
const sampleUrl = `${GRAPH_URL}/${version}${getUrlFromLink(link)}`;
const query: IQuery = {
selectedVerb,
selectedVersion: version,
Expand All @@ -44,12 +42,6 @@ const ResourceLink = (props: IResourceLinkProps) => {
sampleBody: undefined
};
dispatch(setSampleQuery(query));
telemetry.trackEvent(eventTypes.LISTITEM_CLICK_EVENT,
{
ComponentName: componentNames.RESOURCES_SET_QUERY_LIST_ITEM,
SelectedVerb: selectedVerb,
ResourcePath: resourceUrl
});
}

const items = getMenuItems();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { useDispatch, useSelector } from 'react-redux';
import { IResourceLink, IResourceMethod } from '../../../../../types/resources';
import { IRootState } from '../../../../../types/root';
import { removeResourcePaths } from '../../../../services/actions/resource-explorer-action-creators';
import { downloadToLocal } from '../../../../utils/download';
import { translateMessage } from '../../../../utils/translate-messages';
import { downloadToLocal } from '../../../common/download';
import { removeCounter } from '../resource-explorer.utils';
import Paths from './Paths';
import { generatePostmanCollection } from './postman.util';
Expand Down
10 changes: 2 additions & 8 deletions src/telemetry/component-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ export const VIEW_ALL_PERMISSIONS_BUTTON = 'View all permissions button';
export const EXPORT_HISTORY_ITEM_BUTTON = 'Export history item button';
export const DELETE_HISTORY_ITEM_BUTTON = 'Delete history item button';
export const RESPONSE_HEADERS_COPY_BUTTON = 'Response headers copy button';
export const DOWNLOAD_POSTMAN_COLLECTION_BUTTON = 'Download postman collection button';
export const REMOVE_RESOURCE_FROM_COLLECTION_BUTTON = 'Remove resource from collection button';

// List items
export const HISTORY_LIST_ITEM = 'History list item';
export const SAMPLE_QUERY_LIST_ITEM = 'Sample query list item';
export const RESOURCES_SET_QUERY_LIST_ITEM = 'Resources set query list item';
export const RESOURCES_ISOLATE_QUERY_LIST_ITEM = 'Resources isolate query list item';
export const RESOURCES_QUERY_PARAMETERS_LIST_ITEM = 'Resources query parameters list item';
export const ADD_RESOURCE_TO_COLLECTION_LIST_ITEM = 'Add resource to collection list item';

// Tabs
export const HISTORY_TAB = 'History tab';
Expand All @@ -47,17 +41,17 @@ export const QUERY_URL_AUTOCOMPLETE_DROPDOWN = 'Query URL autocomplete dropdown'

// Links
export const DOCUMENTATION_LINK = 'Documentation link';
export const REPORT_AN_ISSUE_LINK = 'Report an issue link';
export const OFFICE_DEV_PROGRAM_LINK = 'Office dev program link';
export const GRAPH_TOOLKIT_PLAYGROUND_LINK = 'Graph toolkit playground link';
export const MICROSOFT_APIS_TERMS_OF_USE_LINK = 'Microsoft APIs terms of use link';
export const MICROSOFT_PRIVACY_STATEMENT_LINK = 'Microsoft privacy statement link';
export const MICROSOFT_GRAPH_API_REFERENCE_DOCS_LINK = 'Microsoft graph API reference docs link';
export const REPORT_AN_ISSUE_LINK = 'Report an issue link';

// Actions
export const GET_SNIPPET_ACTION = 'Get snippet action';
export const FETCH_SAMPLES_ACTION = 'Fetch samples action';
export const AUTHENTICATION_ACTION = 'Authentication action';
export const GET_ADAPTIVE_CARD_ACTION = 'Get adaptive card action';
export const FETCH_PERMISSIONS_ACTION = 'Fetch permissions action';
export const MONACO_EDITOR_FORMAT_JSON_ACTION = 'Monaco editor format JSON action';
export const MONACO_EDITOR = 'Monaco editor display';

0 comments on commit f167a60

Please sign in to comment.