Skip to content

Commit

Permalink
Chore (release): 5.2.0 (#1729)
Browse files Browse the repository at this point in the history
* Fix: Request section layout (#1681)

* Task: Refactor permissions (#1665)

* Fix: Permissions consent button color (#1679)

* Fix: OCV Feedback rating (#1687)

* Remove objective c (#1731)

* Dependabot updates (#1732)
  • Loading branch information
github-actions[bot] authored May 16, 2022
1 parent bc54fb4 commit d523741
Show file tree
Hide file tree
Showing 27 changed files with 1,749 additions and 2,252 deletions.
9 changes: 4 additions & 5 deletions config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
const fs = require('fs');
const path = require('path');
const paths = require('./paths');
const dotenvExpand = require('dotenv-expand');
const dotenv = require('dotenv')

// Make sure that including paths.js after env.js will read .env variables.
delete require.cache[require.resolve('./paths')];
Expand Down Expand Up @@ -32,11 +34,8 @@ const dotenvFiles = [
// https://github.com/motdotla/dotenv-expand
dotenvFiles.forEach(dotenvFile => {
if (fs.existsSync(dotenvFile)) {
require('dotenv-expand')(
require('dotenv').config({
path: dotenvFile
})
);
dotenvFile = dotenv.config({ path: dotenvFile});
dotenvExpand.expand(dotenvFile);
}
});

Expand Down
2 changes: 1 addition & 1 deletion config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ module.exports = function (webpackEnv) {
maxChunks: 1
}),
new MonacoWebpackPlugin({
languages: ['json', 'javascript', 'java', 'objective-c', 'csharp', 'html', 'powershell', 'go']
languages: ['json', 'javascript', 'java', 'csharp', 'html', 'powershell', 'go']
}),
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin(
Expand Down
3,279 changes: 1,448 additions & 1,831 deletions package-lock.json

Large diffs are not rendered by default.

34 changes: 19 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graph-explorer-v2",
"version": "5.1.1",
"version": "5.2.0",
"private": true,
"dependencies": {
"@augloop/types-core": "file:packages/types-core-2.16.189.tgz",
Expand All @@ -10,7 +10,7 @@
"@babel/runtime": "7.17.9",
"@fluentui/react": "8.66.1",
"@microsoft/applicationinsights-react-js": "3.2.4",
"@microsoft/applicationinsights-web": "2.7.4",
"@microsoft/applicationinsights-web": "2.7.6",
"@microsoft/microsoft-graph-client": "3.0.2",
"@monaco-editor/react": "4.4.1",
"@ms-ofb/officebrowserfeedbacknpm": "file:packages/officebrowserfeedbacknpm-1.6.6.tgz",
Expand All @@ -23,14 +23,14 @@
"case-sensitive-paths-webpack-plugin": "2.4.0",
"css-loader": "6.7.1",
"dotenv": "16.0.0",
"dotenv-expand": "4.2.0",
"eslint-config-react-app": "7.0.0",
"dotenv-expand": "8.0.3",
"eslint-config-react-app": "7.0.1",
"eslint-plugin-react": "7.29.4",
"eslint-webpack-plugin": "3.1.1",
"express": "4.17.3",
"express": "4.18.1",
"file-loader": "6.2.0",
"fork-ts-checker-webpack-plugin": "7.2.3",
"fs-extra": "10.0.1",
"fs-extra": "10.1.0",
"guid-typescript": "1.0.9",
"isomorphic-fetch": "3.0.0",
"jest": "27.5.1",
Expand All @@ -44,10 +44,10 @@
"postcss-flexbugs-fixes": "5.0.2",
"postcss-loader": "6.2.1",
"postcss-preset-env": "7.4.3",
"re-resizable": "6.9.5",
"re-resizable": "6.9.9",
"react": "16.14.0",
"react-app-polyfill": "3.0.0",
"react-dom": "16.8.2",
"react-dom": "16.14.0",
"react-intl": "2.8.0",
"react-redux": "7.2.8",
"redux": "4.1.2",
Expand All @@ -56,7 +56,7 @@
"sass": "1.50.0",
"sass-loader": "12.6.0",
"style-loader": "3.3.1",
"typescript": "4.6.3",
"typescript": "4.6.4",
"url": "0.11.0",
"url-loader": "4.1.1",
"webpack": "5.72.0",
Expand All @@ -74,7 +74,8 @@
"test-ci": "node scripts/test.js --no-watch -- -f \"src/tests/accessibility/accessibility.spec.ts\" -t \"Graph Explorer accessibility\"",
"prebuild:prod": "standard-version",
"build:prod": "npm run build",
"bump": "standard-version --skip.tag --skip.changelog"
"bump": "standard-version --skip.tag --skip.changelog",
"preinstall": "npx npm-force-resolutions"
},
"eslintConfig": {
"extends": "react-app"
Expand All @@ -87,7 +88,7 @@
],
"devDependencies": {
"@testing-library/react": "13.0.0",
"@testing-library/user-event": "14.0.4",
"@testing-library/user-event": "14.1.1",
"@types/chromedriver": "81.0.1",
"@types/enzyme": "3.10.11",
"@types/enzyme-adapter-react-16": "1.0.6",
Expand All @@ -100,19 +101,19 @@
"@types/react-redux": "7.1.23",
"@types/redux-logger": "3.0.9",
"@types/redux-mock-store": "1.0.3",
"@types/selenium-webdriver": "4.0.18",
"@typescript-eslint/eslint-plugin": "5.18.0",
"@types/selenium-webdriver": "4.0.19",
"@typescript-eslint/eslint-plugin": "5.22.0",
"@typescript-eslint/parser": "5.18.0",
"acorn": "8.7.0",
"babel-jest": "27.5.1",
"chromedriver": "^99.0.0",
"chromedriver": "101.0.0",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.6",
"eslint": "8.12.0",
"html-webpack-plugin": "5.5.0",
"jest-fetch-mock": "3.0.3",
"node-notifier": "10.0.1",
"react-dev-utils": "12.0.0",
"react-dev-utils": "12.0.1",
"redux-logger": "3.0.6",
"redux-mock-store": "1.5.4",
"selenium-webdriver": "4.1.1",
Expand All @@ -123,5 +124,8 @@
"reportPath": "reports",
"reportFile": "test-report.xml",
"indent": 4
},
"resolutions": {
"@types/react": "17.0.30"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const mockState: IRootState = {
error: null
},
scopes: {
pending: false,
pending: { isSpecificPermissions: false, isFullPermissions: false },
data: {
fullPermissions: [],
specificPermissions: []
Expand Down
21 changes: 14 additions & 7 deletions src/app/services/actions/permissions-action-creator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {
FETCH_SCOPES_ERROR,
FETCH_SCOPES_PENDING,
FETCH_FULL_SCOPES_PENDING,
QUERY_GRAPH_STATUS,
FETCH_FULL_SCOPES_SUCCESS
FETCH_FULL_SCOPES_SUCCESS,
FETCH_URL_SCOPES_PENDING
} from '../../../app/services/redux-constants';

import {
Expand Down Expand Up @@ -58,7 +59,7 @@ const mockState: IRootState = {
error: null
},
scopes: {
pending: false,
pending: { isSpecificPermissions: false, isFullPermissions: false },
data: {
fullPermissions: [],
specificPermissions: []
Expand Down Expand Up @@ -173,15 +174,21 @@ describe('tests permissions action creators', () => {

it('Tests if FETCH_SCOPES_PENDING is dispatched when fetchScopes pending is called', () => {
// Arrange
const expectedAction = {
type: FETCH_SCOPES_PENDING
const expectedFullScopesAction = {
type: FETCH_FULL_SCOPES_PENDING
}

const expectedUrlScopesAction = {
type: FETCH_URL_SCOPES_PENDING
}

// Act
const action = fetchScopesPending();
const fullScopesAction = fetchScopesPending(FETCH_FULL_SCOPES_PENDING);
const urlScopesAction = fetchScopesPending(FETCH_URL_SCOPES_PENDING)

// Assert
expect(action).toEqual(expectedAction);
expect(fullScopesAction).toEqual(expectedFullScopesAction);
expect(urlScopesAction).toEqual(expectedUrlScopesAction)
})

it('returns valid scope type given a user profile or with null', () => {
Expand Down
11 changes: 5 additions & 6 deletions src/app/services/actions/permissions-action-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { getConsentAuthErrorHint } from '../../../modules/authentication/authent
import { ACCOUNT_TYPE, PERMS_SCOPE } from '../graph-constants';
import {
FETCH_SCOPES_ERROR,
FETCH_SCOPES_PENDING,
FETCH_FULL_SCOPES_PENDING,
FETCH_URL_SCOPES_PENDING,
FETCH_FULL_SCOPES_SUCCESS,
FETCH_URL_SCOPES_SUCCESS
} from '../redux-constants';
Expand All @@ -38,10 +39,8 @@ export function fetchUrlScopesSuccess(response: Object): IAction {
}
}

export function fetchScopesPending(): any {
return {
type: FETCH_SCOPES_PENDING
};
export function fetchScopesPending(type: string): any {
return { type };
}

export function fetchScopesError(response: object): IAction {
Expand Down Expand Up @@ -82,7 +81,7 @@ export function fetchScopes(): Function {

const options: IRequestOptions = { headers };

dispatch(fetchScopesPending());
dispatch(fetchScopesPending(permissionsPanelOpen ? FETCH_FULL_SCOPES_PENDING : FETCH_URL_SCOPES_PENDING));

const response = await fetch(permissionsUrl, options);
if (response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/actions/query-action-creator-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export function queryResultsInCorsError(sampleUrl: string): boolean {
if (
(['/drive/', '/drives/', '/driveItem/'].some((x) =>
sampleUrl.includes(x)) && sampleUrl.endsWith('/content')) ||
(sampleUrl.includes('/reports/') && sampleUrl.includes('$format=text/csv'))
sampleUrl.includes('/reports/')
) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const mockState: IRootState = {
error: null
},
scopes: {
pending: false,
pending: { isSpecificPermissions: false, isFullPermissions: false },
data: {
fullPermissions: [],
specificPermissions: []
Expand Down
38 changes: 29 additions & 9 deletions src/app/services/reducers/permissions-reducer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { scopes } from '../../../app/services/reducers/permissions-reducer';
import {
FETCH_SCOPES_ERROR, FETCH_SCOPES_PENDING,
FETCH_SCOPES_ERROR, FETCH_FULL_SCOPES_PENDING,
FETCH_FULL_SCOPES_SUCCESS,
FETCH_URL_SCOPES_SUCCESS
FETCH_URL_SCOPES_SUCCESS,
FETCH_URL_SCOPES_PENDING
} from '../../../app/services/redux-constants';

const initialState = {
pending: false,
pending: { isSpecificPermissions: false, isFullPermissions: false },
data: {
fullPermissions: [],
specificPermissions: []
Expand All @@ -27,7 +28,7 @@ describe('Permissions reducer', () => {
}

const expectedState = {
pending: false,
pending: { isSpecificPermissions: false, isFullPermissions: false },
data: {
fullPermissions: ['profile.read', 'profile.write', 'email.read', 'email.write'],
specificPermissions: []
Expand All @@ -51,7 +52,7 @@ describe('Permissions reducer', () => {
}

const expectedState = {
pending: false,
pending: { isSpecificPermissions: false, isFullPermissions: false },
data: {
fullPermissions: [],
specificPermissions: ['profile.read', 'profile.write', 'email.read', 'email.write']
Expand All @@ -69,7 +70,7 @@ describe('Permissions reducer', () => {
response: 'error'
}
const expectedState = {
pending: false,
pending: { isSpecificPermissions: false, isFullPermissions: false },
data: {},
error: 'error'
}
Expand All @@ -78,14 +79,33 @@ describe('Permissions reducer', () => {
expect(newState).toEqual(expectedState);
});

it('should handle FETCH_SCOPES_PENDING', () => {
it('should handle FETCH_FULL_SCOPES_PENDING', () => {
const action = {
type: FETCH_SCOPES_PENDING,
type: FETCH_FULL_SCOPES_PENDING,
response: ''
}

const expectedState = {
pending: true,
pending: { isSpecificPermissions: false, isFullPermissions: true },
data: {
fullPermissions: [],
specificPermissions: []
},
error: null
}

const newState = scopes(initialState, action);
expect(newState).toEqual(expectedState);
});

it('should handle FETCH_URL_SCOPES_PENDING', () => {
const action = {
type: FETCH_URL_SCOPES_PENDING,
response: ''
}

const expectedState = {
pending: { isSpecificPermissions: true, isFullPermissions: false },
data: {
fullPermissions: [],
specificPermissions: []
Expand Down
25 changes: 17 additions & 8 deletions src/app/services/reducers/permissions-reducer.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { IAction } from '../../../types/action';
import { IPermissionsResponse, IScopes } from '../../../types/permissions';
import {
FETCH_SCOPES_ERROR, FETCH_SCOPES_PENDING, FETCH_FULL_SCOPES_SUCCESS,
FETCH_URL_SCOPES_SUCCESS
FETCH_SCOPES_ERROR, FETCH_URL_SCOPES_PENDING, FETCH_FULL_SCOPES_SUCCESS,
FETCH_URL_SCOPES_SUCCESS, FETCH_FULL_SCOPES_PENDING
} from '../redux-constants';

const initialState: IScopes = {
pending: false,
pending: {
isSpecificPermissions: false,
isFullPermissions: false
},
data: {
specificPermissions: [],
fullPermissions: []
Expand All @@ -19,26 +22,32 @@ export function scopes(state: IScopes = initialState, action: IAction): any {
case FETCH_FULL_SCOPES_SUCCESS:
let response: IPermissionsResponse = { ...action.response as IPermissionsResponse };
return {
pending: false,
pending: { ...state.pending, isFullPermissions: false },
data: { ...state.data, fullPermissions: response.scopes.fullPermissions },
error: null
};
case FETCH_URL_SCOPES_SUCCESS:
response = { ...action.response as IPermissionsResponse };
return {
pending: false,
pending: { ...state.pending, isSpecificPermissions: false },
data: { ...state.data, specificPermissions: response.scopes.specificPermissions },
error: null
}
case FETCH_SCOPES_ERROR:
return {
pending: false,
pending: { isFullPermissions: false, isSpecificPermissions: false },
error: action.response,
data: {}
};
case FETCH_SCOPES_PENDING:
case FETCH_URL_SCOPES_PENDING:
return {
pending: { ...state.pending, isSpecificPermissions: true },
data: state.data,
error: null
};
case FETCH_FULL_SCOPES_PENDING:
return {
pending: true,
pending: { ...state.pending, isFullPermissions: true },
data: state.data,
error: null
};
Expand Down
3 changes: 2 additions & 1 deletion src/app/services/redux-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export const CLEAR_TERMS_OF_USE = 'CLEAR_TERMS_OF_USE';
export const FETCH_FULL_SCOPES_SUCCESS = 'FULL_SCOPES_FETCH_SUCCESS';
export const FETCH_URL_SCOPES_SUCCESS = 'FETCH_URL_SCOPES_SUCCESS';
export const FETCH_SCOPES_ERROR = 'SCOPES_FETCH_ERROR';
export const FETCH_SCOPES_PENDING = 'FETCH_SCOPES_PENDING';
export const FETCH_FULL_SCOPES_PENDING = 'FETCH_SCOPES_PENDING';
export const FETCH_URL_SCOPES_PENDING = 'FETCH_URL_SCOPES_PENDING';
export const GET_CONSENT_ERROR = 'GET_CONSENT_ERROR';
export const GET_CONSENTED_SCOPES_SUCCESS = 'GET_CONSENTED_SCOPES_SUCCESS';
export const SET_DEVX_API_URL_SUCCESS = 'SET_DEVX_API_URL_SUCCESS';
Expand Down
Loading

0 comments on commit d523741

Please sign in to comment.