Skip to content

Commit 9a5038f

Browse files
authored
Fixed integration user errors (#2679)
* Fixed integration user errors * Fixed GitHub build errors
1 parent d1e5332 commit 9a5038f

File tree

7 files changed

+15
-6
lines changed

7 files changed

+15
-6
lines changed

.github/workflows/mainCI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
input-urls: http://localhost:12345/profile http://localhost:12345/500 http://localhost:12345/404
4141

4242
- name: Upload report artifact
43-
uses: actions/upload-artifact@v2
43+
uses: actions/upload-artifact@v4
4444
with:
4545
name: accessibility-reports
4646
path: ${{ github.workspace }}/_accessibility-reports

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Run tests
5353
run: npx playwright test tests/ --workers 1
5454

55-
- uses: actions/upload-artifact@v3
55+
- uses: actions/upload-artifact@v4
5656
if: failure()
5757
with:
5858
name: playwright-report

src/components/users/profile/ko/runtime/profile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class Profile {
6969
await this.usersService.ensureSignedIn();
7070

7171
const model: User = await this.usersService.getCurrentUser();
72-
this.isBasicAccount(model.isBasicAccount);
72+
this.isBasicAccount(model?.isBasicAccount);
7373
this.setUser(model);
7474
}
7575

src/constants.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,4 +339,9 @@ export const overrideToastSessionKeyPrefix = "MS_APIM_CW_override_toast_dismisse
339339
* Styling constants
340340
*/
341341
export const mobileBreakpoint = 768;
342-
export const smallMobileBreakpoint = 400;
342+
export const smallMobileBreakpoint = 400;
343+
344+
/**
345+
* Key of the default admin user
346+
*/
347+
export const integrationUserId = '/users/integration';

src/models/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class User {
2323
this.note = contract.properties.note;
2424
this.groups = contract.properties.groups;
2525
this.identities = contract.properties.identities;
26-
this.isBasicAccount = this.identities[0]?.provider === "Basic";
26+
this.isBasicAccount = this.identities?.[0]?.provider === "Basic";
2727
}
2828
}
2929

src/services/productService.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ export class ProductService {
180180
if (!userId) {
181181
throw new Error(`Parameter "userId" not specified.`);
182182
}
183+
184+
if (userId === Constants.integrationUserId) {
185+
return new Page();
186+
}
183187

184188
const skip = searchRequest && searchRequest.skip || 0;
185189
const take = searchRequest && searchRequest.take || Constants.defaultPageSize;

src/services/usersService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export class UsersService {
181181
try {
182182
const userId = await this.getCurrentUserId();
183183

184-
if (!userId) {
184+
if (!userId || userId === Constants.integrationUserId) {
185185
return null;
186186
}
187187

0 commit comments

Comments
 (0)