Skip to content

Commit d523741

Browse files
Chore (release): 5.2.0 (#1729)
* 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)
1 parent bc54fb4 commit d523741

27 files changed

+1749
-2252
lines changed

config/env.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
const fs = require('fs');
44
const path = require('path');
55
const paths = require('./paths');
6+
const dotenvExpand = require('dotenv-expand');
7+
const dotenv = require('dotenv')
68

79
// Make sure that including paths.js after env.js will read .env variables.
810
delete require.cache[require.resolve('./paths')];
@@ -32,11 +34,8 @@ const dotenvFiles = [
3234
// https://github.com/motdotla/dotenv-expand
3335
dotenvFiles.forEach(dotenvFile => {
3436
if (fs.existsSync(dotenvFile)) {
35-
require('dotenv-expand')(
36-
require('dotenv').config({
37-
path: dotenvFile
38-
})
39-
);
37+
dotenvFile = dotenv.config({ path: dotenvFile});
38+
dotenvExpand.expand(dotenvFile);
4039
}
4140
});
4241

config/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ module.exports = function (webpackEnv) {
417417
maxChunks: 1
418418
}),
419419
new MonacoWebpackPlugin({
420-
languages: ['json', 'javascript', 'java', 'objective-c', 'csharp', 'html', 'powershell', 'go']
420+
languages: ['json', 'javascript', 'java', 'csharp', 'html', 'powershell', 'go']
421421
}),
422422
// Generates an `index.html` file with the <script> injected.
423423
new HtmlWebpackPlugin(

package-lock.json

Lines changed: 1448 additions & 1831 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graph-explorer-v2",
3-
"version": "5.1.1",
3+
"version": "5.2.0",
44
"private": true,
55
"dependencies": {
66
"@augloop/types-core": "file:packages/types-core-2.16.189.tgz",
@@ -10,7 +10,7 @@
1010
"@babel/runtime": "7.17.9",
1111
"@fluentui/react": "8.66.1",
1212
"@microsoft/applicationinsights-react-js": "3.2.4",
13-
"@microsoft/applicationinsights-web": "2.7.4",
13+
"@microsoft/applicationinsights-web": "2.7.6",
1414
"@microsoft/microsoft-graph-client": "3.0.2",
1515
"@monaco-editor/react": "4.4.1",
1616
"@ms-ofb/officebrowserfeedbacknpm": "file:packages/officebrowserfeedbacknpm-1.6.6.tgz",
@@ -23,14 +23,14 @@
2323
"case-sensitive-paths-webpack-plugin": "2.4.0",
2424
"css-loader": "6.7.1",
2525
"dotenv": "16.0.0",
26-
"dotenv-expand": "4.2.0",
27-
"eslint-config-react-app": "7.0.0",
26+
"dotenv-expand": "8.0.3",
27+
"eslint-config-react-app": "7.0.1",
2828
"eslint-plugin-react": "7.29.4",
2929
"eslint-webpack-plugin": "3.1.1",
30-
"express": "4.17.3",
30+
"express": "4.18.1",
3131
"file-loader": "6.2.0",
3232
"fork-ts-checker-webpack-plugin": "7.2.3",
33-
"fs-extra": "10.0.1",
33+
"fs-extra": "10.1.0",
3434
"guid-typescript": "1.0.9",
3535
"isomorphic-fetch": "3.0.0",
3636
"jest": "27.5.1",
@@ -44,10 +44,10 @@
4444
"postcss-flexbugs-fixes": "5.0.2",
4545
"postcss-loader": "6.2.1",
4646
"postcss-preset-env": "7.4.3",
47-
"re-resizable": "6.9.5",
47+
"re-resizable": "6.9.9",
4848
"react": "16.14.0",
4949
"react-app-polyfill": "3.0.0",
50-
"react-dom": "16.8.2",
50+
"react-dom": "16.14.0",
5151
"react-intl": "2.8.0",
5252
"react-redux": "7.2.8",
5353
"redux": "4.1.2",
@@ -56,7 +56,7 @@
5656
"sass": "1.50.0",
5757
"sass-loader": "12.6.0",
5858
"style-loader": "3.3.1",
59-
"typescript": "4.6.3",
59+
"typescript": "4.6.4",
6060
"url": "0.11.0",
6161
"url-loader": "4.1.1",
6262
"webpack": "5.72.0",
@@ -74,7 +74,8 @@
7474
"test-ci": "node scripts/test.js --no-watch -- -f \"src/tests/accessibility/accessibility.spec.ts\" -t \"Graph Explorer accessibility\"",
7575
"prebuild:prod": "standard-version",
7676
"build:prod": "npm run build",
77-
"bump": "standard-version --skip.tag --skip.changelog"
77+
"bump": "standard-version --skip.tag --skip.changelog",
78+
"preinstall": "npx npm-force-resolutions"
7879
},
7980
"eslintConfig": {
8081
"extends": "react-app"
@@ -87,7 +88,7 @@
8788
],
8889
"devDependencies": {
8990
"@testing-library/react": "13.0.0",
90-
"@testing-library/user-event": "14.0.4",
91+
"@testing-library/user-event": "14.1.1",
9192
"@types/chromedriver": "81.0.1",
9293
"@types/enzyme": "3.10.11",
9394
"@types/enzyme-adapter-react-16": "1.0.6",
@@ -100,19 +101,19 @@
100101
"@types/react-redux": "7.1.23",
101102
"@types/redux-logger": "3.0.9",
102103
"@types/redux-mock-store": "1.0.3",
103-
"@types/selenium-webdriver": "4.0.18",
104-
"@typescript-eslint/eslint-plugin": "5.18.0",
104+
"@types/selenium-webdriver": "4.0.19",
105+
"@typescript-eslint/eslint-plugin": "5.22.0",
105106
"@typescript-eslint/parser": "5.18.0",
106107
"acorn": "8.7.0",
107108
"babel-jest": "27.5.1",
108-
"chromedriver": "^99.0.0",
109+
"chromedriver": "101.0.0",
109110
"enzyme": "3.11.0",
110111
"enzyme-adapter-react-16": "1.15.6",
111112
"eslint": "8.12.0",
112113
"html-webpack-plugin": "5.5.0",
113114
"jest-fetch-mock": "3.0.3",
114115
"node-notifier": "10.0.1",
115-
"react-dev-utils": "12.0.0",
116+
"react-dev-utils": "12.0.1",
116117
"redux-logger": "3.0.6",
117118
"redux-mock-store": "1.5.4",
118119
"selenium-webdriver": "4.1.1",
@@ -123,5 +124,8 @@
123124
"reportPath": "reports",
124125
"reportFile": "test-report.xml",
125126
"indent": 4
127+
},
128+
"resolutions": {
129+
"@types/react": "17.0.30"
126130
}
127131
}

src/app/services/actions/autocomplete-action-creators.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const mockState: IRootState = {
5555
error: null
5656
},
5757
scopes: {
58-
pending: false,
58+
pending: { isSpecificPermissions: false, isFullPermissions: false },
5959
data: {
6060
fullPermissions: [],
6161
specificPermissions: []

src/app/services/actions/permissions-action-creator.spec.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import {
22
FETCH_SCOPES_ERROR,
3-
FETCH_SCOPES_PENDING,
3+
FETCH_FULL_SCOPES_PENDING,
44
QUERY_GRAPH_STATUS,
5-
FETCH_FULL_SCOPES_SUCCESS
5+
FETCH_FULL_SCOPES_SUCCESS,
6+
FETCH_URL_SCOPES_PENDING
67
} from '../../../app/services/redux-constants';
78

89
import {
@@ -58,7 +59,7 @@ const mockState: IRootState = {
5859
error: null
5960
},
6061
scopes: {
61-
pending: false,
62+
pending: { isSpecificPermissions: false, isFullPermissions: false },
6263
data: {
6364
fullPermissions: [],
6465
specificPermissions: []
@@ -173,15 +174,21 @@ describe('tests permissions action creators', () => {
173174

174175
it('Tests if FETCH_SCOPES_PENDING is dispatched when fetchScopes pending is called', () => {
175176
// Arrange
176-
const expectedAction = {
177-
type: FETCH_SCOPES_PENDING
177+
const expectedFullScopesAction = {
178+
type: FETCH_FULL_SCOPES_PENDING
179+
}
180+
181+
const expectedUrlScopesAction = {
182+
type: FETCH_URL_SCOPES_PENDING
178183
}
179184

180185
// Act
181-
const action = fetchScopesPending();
186+
const fullScopesAction = fetchScopesPending(FETCH_FULL_SCOPES_PENDING);
187+
const urlScopesAction = fetchScopesPending(FETCH_URL_SCOPES_PENDING)
182188

183189
// Assert
184-
expect(action).toEqual(expectedAction);
190+
expect(fullScopesAction).toEqual(expectedFullScopesAction);
191+
expect(urlScopesAction).toEqual(expectedUrlScopesAction)
185192
})
186193

187194
it('returns valid scope type given a user profile or with null', () => {

src/app/services/actions/permissions-action-creator.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import { getConsentAuthErrorHint } from '../../../modules/authentication/authent
1313
import { ACCOUNT_TYPE, PERMS_SCOPE } from '../graph-constants';
1414
import {
1515
FETCH_SCOPES_ERROR,
16-
FETCH_SCOPES_PENDING,
16+
FETCH_FULL_SCOPES_PENDING,
17+
FETCH_URL_SCOPES_PENDING,
1718
FETCH_FULL_SCOPES_SUCCESS,
1819
FETCH_URL_SCOPES_SUCCESS
1920
} from '../redux-constants';
@@ -38,10 +39,8 @@ export function fetchUrlScopesSuccess(response: Object): IAction {
3839
}
3940
}
4041

41-
export function fetchScopesPending(): any {
42-
return {
43-
type: FETCH_SCOPES_PENDING
44-
};
42+
export function fetchScopesPending(type: string): any {
43+
return { type };
4544
}
4645

4746
export function fetchScopesError(response: object): IAction {
@@ -82,7 +81,7 @@ export function fetchScopes(): Function {
8281

8382
const options: IRequestOptions = { headers };
8483

85-
dispatch(fetchScopesPending());
84+
dispatch(fetchScopesPending(permissionsPanelOpen ? FETCH_FULL_SCOPES_PENDING : FETCH_URL_SCOPES_PENDING));
8685

8786
const response = await fetch(permissionsUrl, options);
8887
if (response.ok) {

src/app/services/actions/query-action-creator-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export function queryResultsInCorsError(sampleUrl: string): boolean {
263263
if (
264264
(['/drive/', '/drives/', '/driveItem/'].some((x) =>
265265
sampleUrl.includes(x)) && sampleUrl.endsWith('/content')) ||
266-
(sampleUrl.includes('/reports/') && sampleUrl.includes('$format=text/csv'))
266+
sampleUrl.includes('/reports/')
267267
) {
268268
return true;
269269
}

src/app/services/actions/resource-explorer-action-creators.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const mockState: IRootState = {
5050
error: null
5151
},
5252
scopes: {
53-
pending: false,
53+
pending: { isSpecificPermissions: false, isFullPermissions: false },
5454
data: {
5555
fullPermissions: [],
5656
specificPermissions: []

src/app/services/reducers/permissions-reducer.spec.ts

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { scopes } from '../../../app/services/reducers/permissions-reducer';
22
import {
3-
FETCH_SCOPES_ERROR, FETCH_SCOPES_PENDING,
3+
FETCH_SCOPES_ERROR, FETCH_FULL_SCOPES_PENDING,
44
FETCH_FULL_SCOPES_SUCCESS,
5-
FETCH_URL_SCOPES_SUCCESS
5+
FETCH_URL_SCOPES_SUCCESS,
6+
FETCH_URL_SCOPES_PENDING
67
} from '../../../app/services/redux-constants';
78

89
const initialState = {
9-
pending: false,
10+
pending: { isSpecificPermissions: false, isFullPermissions: false },
1011
data: {
1112
fullPermissions: [],
1213
specificPermissions: []
@@ -27,7 +28,7 @@ describe('Permissions reducer', () => {
2728
}
2829

2930
const expectedState = {
30-
pending: false,
31+
pending: { isSpecificPermissions: false, isFullPermissions: false },
3132
data: {
3233
fullPermissions: ['profile.read', 'profile.write', 'email.read', 'email.write'],
3334
specificPermissions: []
@@ -51,7 +52,7 @@ describe('Permissions reducer', () => {
5152
}
5253

5354
const expectedState = {
54-
pending: false,
55+
pending: { isSpecificPermissions: false, isFullPermissions: false },
5556
data: {
5657
fullPermissions: [],
5758
specificPermissions: ['profile.read', 'profile.write', 'email.read', 'email.write']
@@ -69,7 +70,7 @@ describe('Permissions reducer', () => {
6970
response: 'error'
7071
}
7172
const expectedState = {
72-
pending: false,
73+
pending: { isSpecificPermissions: false, isFullPermissions: false },
7374
data: {},
7475
error: 'error'
7576
}
@@ -78,14 +79,33 @@ describe('Permissions reducer', () => {
7879
expect(newState).toEqual(expectedState);
7980
});
8081

81-
it('should handle FETCH_SCOPES_PENDING', () => {
82+
it('should handle FETCH_FULL_SCOPES_PENDING', () => {
8283
const action = {
83-
type: FETCH_SCOPES_PENDING,
84+
type: FETCH_FULL_SCOPES_PENDING,
8485
response: ''
8586
}
8687

8788
const expectedState = {
88-
pending: true,
89+
pending: { isSpecificPermissions: false, isFullPermissions: true },
90+
data: {
91+
fullPermissions: [],
92+
specificPermissions: []
93+
},
94+
error: null
95+
}
96+
97+
const newState = scopes(initialState, action);
98+
expect(newState).toEqual(expectedState);
99+
});
100+
101+
it('should handle FETCH_URL_SCOPES_PENDING', () => {
102+
const action = {
103+
type: FETCH_URL_SCOPES_PENDING,
104+
response: ''
105+
}
106+
107+
const expectedState = {
108+
pending: { isSpecificPermissions: true, isFullPermissions: false },
89109
data: {
90110
fullPermissions: [],
91111
specificPermissions: []

0 commit comments

Comments
 (0)