Skip to content

Commit c61d66d

Browse files
committed
Merge branch 'dev' into fix/update-doc-links
2 parents 6b971e7 + 31f8fab commit c61d66d

File tree

170 files changed

+6988
-7554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+6988
-7554
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"package.json": "package-lock.json, .npmrc"
2424
},
2525
"cSpell.words": [
26-
"fluentui"
26+
"fluentui",
27+
"noreferrer"
2728
],
2829
}

azure-pipelines.yml

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -109,50 +109,6 @@ extends:
109109
npm run build
110110
displayName: "Run build"
111111
- job: Two
112-
displayName: "Run playwright tests"
113-
condition: eq(variables['isDev'], 'true')
114-
steps:
115-
- task: NodeTool@0
116-
inputs:
117-
versionSpec: "18.16.x"
118-
displayName: "Install npm"
119-
- script: |
120-
npm install
121-
displayName: "npm install"
122-
- script: |
123-
npm install -D @playwright/test
124-
npx playwright install-deps
125-
displayName: "Install playwright dependancies"
126-
- script: |
127-
npx playwright install
128-
displayName: "Install playwright"
129-
- script: |
130-
npm run test-playwright-accessibility
131-
displayName: "Run accessibility tests"
132-
- script: |
133-
set CI=true
134-
npm run test-playwright
135-
env:
136-
REACT_APP_CLIENT_ID: $(REACT_APP_PLAYWRIGHT_TEST_CLIENT_ID)
137-
REACT_APP_INSTRUMENTATION_KEY: $(REACT_APP_STAGING_INSTRUMENTATION_KEY)
138-
REACT_APP_CONNECTION_STRING: $(REACT_APP_STAGING_CONNECTION_STRING)
139-
REACT_APP_FEEDBACK_CAMPAIGN_ID: $(REACT_APP_STAGING_FEEDBACK_CAMPAIGN_ID)
140-
REACT_APP_NPS_FEEDBACK_CAMPAIGN_ID: $(REACT_APP_NPS_FEEDBACK_CAMPAIGN_ID)
141-
REACT_APP_NOMINATION_PERIOD: $(REACT_APP_NOMINATION_PERIOD)
142-
REACT_APP_COOLDOWN_PERIOD: $(REACT_APP_COOLDOWN_PERIOD)
143-
REACT_APP_USAGE_TIME: $(REACT_APP_USAGE_TIME)
144-
PLAYWRIGHT_TESTS_BASE_URL: $(PLAYWRIGHT_TESTS_BASE_URL)
145-
PLAYWRIGHT_TESTS_USERNAME: $(PLAYWRIGHT_TESTS_USERNAME)
146-
PLAYWRIGHT_TESTS_PASSWORD: $(PLAYWRIGHT_TESTS_PASSWORD)
147-
displayName: "Run playwright tests"
148-
templateContext:
149-
outputs:
150-
- output: pipelineArtifact
151-
displayName: 'Publish test results'
152-
condition: always()
153-
targetPath: $(System.DefaultWorkingDirectory)/playwright-report
154-
artifactName: playwright-report
155-
- job: Three
156112
displayName: "Publish artifacts"
157113
dependsOn: One
158114
steps:
@@ -252,7 +208,7 @@ extends:
252208
parameters:
253209
directory: 'microsoft-graph-explorer-v4'
254210
repoName: ReleasePipelines
255-
dependsOn: ['Three']
211+
dependsOn: ['Two']
256212

257213
- stage: DeployProduction
258214
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded())
@@ -275,7 +231,7 @@ extends:
275231
displayName: 'Deploy to portal - staging'
276232
inputs:
277233
SourcePath: '$(Build.ArtifactStagingDirectory)/drop/*'
278-
azureSubscription: 'Federated GE-Portals Managed Identity Connection'
234+
azureSubscription: 'Federated Portals Managed Identity Connection'
279235
Destination: AzureBlob
280236
storage: graphstagingblobstorage
281237
ContainerName: staging
@@ -285,7 +241,7 @@ extends:
285241
displayName: 'Deploy to portal - production'
286242
inputs:
287243
SourcePath: '$(Build.ArtifactStagingDirectory)/drop/*'
288-
azureSubscription: 'Federated GE-Portals Managed Identity Connection'
244+
azureSubscription: 'Federated Portals Managed Identity Connection'
289245
Destination: AzureBlob
290246
storage: graphprodblobstorage
291247
ContainerName: prod

package-lock.json

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

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"@azure/msal-browser": "4.5.1",
99
"@babel/core": "7.26.10",
1010
"@babel/runtime": "7.26.10",
11-
"@fluentui/react": "8.122.9",
11+
"@fluentui-contrib/react-resize-handle": "0.6.1",
1212
"@fluentui/react-components": "9.60.0",
1313
"@fluentui/react-icons": "2.0.274",
14-
"@fluentui/react-icons-mdl2": "1.3.83",
1514
"@microsoft/applicationinsights-react-js": "17.3.4",
1615
"@microsoft/applicationinsights-web": "3.3.6",
1716
"@microsoft/microsoft-graph-client": "3.0.7",
17+
"@microsoft/microsoft-graph-types": "2.40.0",
1818
"@monaco-editor/react": "4.7.0",
1919
"@ms-ofb/officebrowserfeedbacknpm": "file:packages/officebrowserfeedbacknpm-1.6.6.tgz",
2020
"@reduxjs/toolkit": "2.6.0",
@@ -48,7 +48,6 @@
4848
"postcss-flexbugs-fixes": "5.0.2",
4949
"postcss-loader": "8.1.1",
5050
"postcss-preset-env": "10.1.1",
51-
"re-resizable": "6.11.2",
5251
"react": "18.3.0",
5352
"react-app-polyfill": "3.0.0",
5453
"react-dom": "18.3.0",
@@ -69,7 +68,8 @@
6968
"start": "node scripts/start.js",
7069
"build": "node scripts/build.js && node versioned-build.js",
7170
"test": "node scripts/test.js --no-watch --testPathIgnorePatterns=src/tests/ui src/tests/accessibility /scripts/ --max-old-space-size=8192",
72-
"lint": "eslint . \"**/*.{js,ts,tsx}\"",
71+
"lint": "eslint . \"**/*.{js,ts,tsx}\" --quiet",
72+
"lint-fix": "eslint . \"**/*.{js,ts,tsx}\" --quiet --fix",
7373
"prebuild:prod": "standard-version",
7474
"build:prod": "npm run build",
7575
"bump": "standard-version --skip.tag --skip.changelog",

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ApplicationState, store } from '../../../../src/store/index';
66
import { fetchAutoCompleteOptions } from '../../../app/services/slices/autocomplete.slice';
77
import { suggestions } from '../../../modules/suggestions/suggestions';
88
import { Mode } from '../../../types/enums';
9+
import { SnippetError } from '../../../types/snippets';
910
import { AUTOCOMPLETE_FETCH_ERROR, AUTOCOMPLETE_FETCH_PENDING, AUTOCOMPLETE_FETCH_SUCCESS } from '../redux-constants';
1011
import { mockThunkMiddleware } from './mockThunkMiddleware';
1112

@@ -61,13 +62,13 @@ const mockState: ApplicationState = {
6162
isLoadingData: false,
6263
response: {
6364
body: undefined,
64-
headers: undefined
65+
headers: {}
6566
}
6667
},
6768
snippets: {
6869
pending: false,
69-
data: [],
70-
error: null
70+
data: {},
71+
error: {} as SnippetError
7172
},
7273
responseAreaExpanded: false,
7374
dimensions: {

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
import { authenticationWrapper } from '../../../modules/authentication';
1212
import { ApplicationState, store } from '../../../store/index';
1313
import { Mode } from '../../../types/enums';
14+
import { SnippetError } from '../../../types/snippets';
1415
import { getPermissionsScopeType } from '../../utils/getPermissionsScopeType';
1516
import { translateMessage } from '../../utils/translate-messages';
1617
import { ACCOUNT_TYPE } from '../graph-constants';
@@ -82,13 +83,13 @@ const mockState: ApplicationState = {
8283
isLoadingData: false,
8384
response: {
8485
body: undefined,
85-
headers: undefined
86+
headers: {}
8687
}
8788
},
8889
snippets: {
8990
pending: false,
90-
data: [],
91-
error: null
91+
data: {},
92+
error: {} as SnippetError
9293
},
9394
responseAreaExpanded: false,
9495
dimensions: {
@@ -301,7 +302,7 @@ describe('Permissions action creators', () => {
301302
statusText: translateMessage('Revoking'),
302303
status: translateMessage('Please wait while we revoke this permission'),
303304
ok: false,
304-
messageType: 0
305+
messageBarType: 'info'
305306
}
306307
}
307308
]
@@ -357,7 +358,7 @@ describe('Permissions action creators', () => {
357358
statusText: translateMessage('Revoking '),
358359
status: translateMessage('Please wait while we revoke this permission'),
359360
ok: false,
360-
messageType: 0
361+
messageBarType: 'info'
361362
}
362363
}
363364
]
@@ -416,7 +417,7 @@ describe('Permissions action creators', () => {
416417
statusText: translateMessage('Revoking'),
417418
status: translateMessage('Please wait while we revoke this permission'),
418419
ok: false,
419-
messageType: 0
420+
messageBarType: 'info'
420421
}
421422
}
422423
]

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

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import { User } from '@microsoft/microsoft-graph-types';
12
import { componentNames, eventTypes, telemetry } from '../../../telemetry';
23
import { IOAuthGrantPayload, IPermissionGrant } from '../../../types/permissions';
34
import { IUser } from '../../../types/profile';
5+
import { CustomBody, ResponseValue } from '../../../types/query-response';
46
import { IQuery } from '../../../types/query-runner';
57
import { RevokeScopesError } from '../../utils/error-utils/RevokeScopesError';
68
import { exponentialFetchRetry } from '../../utils/fetch-retry-handler';
79
import { GRAPH_URL } from '../graph-constants';
8-
import { makeGraphRequest, parseResponse } from './query-action-creator-util';
10+
import { parseResponse, makeGraphRequest as queryMakeGraphRequest } from './query-action-creator-util';
911

1012
interface IPreliminaryChecksObject {
1113
defaultUserScopes: string[];
@@ -107,7 +109,9 @@ export class RevokePermissionsUtil {
107109
const tenantAdminQuery = { ...genericQuery };
108110
tenantAdminQuery.sampleUrl = `${GRAPH_URL}/v1.0/me/memberOf`;
109111
const response = await RevokePermissionsUtil.makeExponentialFetch([], tenantAdminQuery);
110-
return response ? response.value.some((value: any) => value.displayName === 'Global Administrator') : false
112+
const value = (response as CustomBody).value
113+
const isAdmin = value ? value.some((v: Partial<User>)=>v?.displayName === 'Global Administrator') : false
114+
return isAdmin
111115
}
112116

113117
public async getUserPermissionChecks(preliminaryObject: PartialCheckObject): Promise<{
@@ -191,7 +195,7 @@ export class RevokePermissionsUtil {
191195
genericQuery.sampleUrl = `${GRAPH_URL}/v1.0/oauth2PermissionGrants?$filter=clientId eq '${servicePrincipalAppId}'`;
192196
genericQuery.sampleHeaders = [{ name: 'ConsistencyLevel', value: 'eventual' }];
193197
const oAuthGrant = await RevokePermissionsUtil.makeExponentialFetch(scopes, genericQuery);
194-
return oAuthGrant;
198+
return oAuthGrant as IOAuthGrantPayload;
195199
}
196200

197201
public permissionToRevokeInGrant(permissionsGrant: IPermissionGrant, allPrincipalGrant: IPermissionGrant,
@@ -207,7 +211,8 @@ export class RevokePermissionsUtil {
207211
const currentAppId = process.env.REACT_APP_CLIENT_ID;
208212
genericQuery.sampleUrl = `${GRAPH_URL}/v1.0/servicePrincipals?$filter=appId eq '${currentAppId}'`;
209213
const response = await this.makeGraphRequest(scopes, genericQuery);
210-
return response ? response.value[0].id : '';
214+
const value = (response as CustomBody)?.value
215+
return value ? value[0]?.id ?? '' : ''
211216
}
212217

213218
private async revokePermission(permissionGrantId: string, newScopes: string): Promise<boolean> {
@@ -219,32 +224,24 @@ export class RevokePermissionsUtil {
219224
patchQuery.sampleUrl = `${GRAPH_URL}/v1.0/oauth2PermissionGrants/${permissionGrantId}`;
220225
genericQuery.sampleHeaders = [{ name: 'ConsistencyLevel', value: 'eventual' }];
221226
patchQuery.selectedVerb = 'PATCH';
222-
// eslint-disable-next-line no-useless-catch
223-
try {
224-
const response = await RevokePermissionsUtil.makeGraphRequest([], patchQuery);
225-
const { error } = response;
226-
if (error) {
227-
return false;
228-
}
229-
return true;
230-
}
231-
catch (error: any) {
232-
throw error;
227+
228+
const response = await RevokePermissionsUtil.makeGraphRequest([], patchQuery);
229+
const error = (response as CustomBody).error;
230+
if (error) {
231+
return false;
233232
}
233+
return true;
234234
}
235235

236-
private static async makeExponentialFetch(scopes: string[], query: IQuery, condition?:
237-
(args?: any) => Promise<boolean>) {
238-
const respHeaders: any = {};
239-
const response = await exponentialFetchRetry(() => makeGraphRequest(scopes)(query),
240-
8, 100, condition);
241-
return parseResponse(response, respHeaders);
236+
private static async makeExponentialFetch(
237+
scopes: string[], query: IQuery, condition?: (args?: unknown) => Promise<boolean>) {
238+
const response = await exponentialFetchRetry(() => queryMakeGraphRequest(scopes)(query), 8, 100, condition);
239+
return parseResponse(response as Response);
242240
}
243241

244242
private static async makeGraphRequest(scopes: string[], query: IQuery) {
245-
const respHeaders: any = {};
246-
const response = await makeGraphRequest(scopes)(query);
247-
return parseResponse(response, respHeaders);
243+
const response = await queryMakeGraphRequest(scopes)(query);
244+
return parseResponse(response as Response);
248245
}
249246

250247
private trackRevokeConsentEvent = (status: string, permissionObject: any) => {

src/app/services/actions/profile-actions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ export async function getProfileImage(): Promise<string> {
103103

104104
export async function getProfileResponse(): Promise<IProfileResponse> {
105105
const scopes = DEFAULT_USER_SCOPES.split(' ');
106-
const respHeaders: Record<string, string> = {};
107106

108107
const response = await makeGraphRequest(scopes)(query);
109-
const userInfo = await parseResponse(response, respHeaders);
108+
const userInfo = await parseResponse(response as Response);
110109
return {
111110
userInfo,
112111
response

0 commit comments

Comments
 (0)