Update branch for JS-API PR#438 (#8010)

* [ci:force][auto-commit] Update JS-API to 5.2.0-443 for branch: update-js-api originated from JS-API PR: 443

* [ADF-5507] Fix failing unit tests for auth service

* remove unnecessary method

Co-authored-by: Michal Kinas <michal.kinas@hyland.com>
Co-authored-by: eromano <eugenioromano16@gmail.com>
This commit is contained in:
Alfresco Build 2022-11-29 13:39:50 +01:00 committed by GitHub
parent 740e3cef9b
commit 97e6129b6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 22 additions and 53 deletions

View File

@ -5,9 +5,9 @@
"requires": true,
"dependencies": {
"@alfresco/js-api": {
"version": "5.2.0-435",
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-435.tgz",
"integrity": "sha512-zBSwGdQZGJdm+/KlUWjOOTKb97TIA3BLTHTthnbNK/csAtK4CQSzeRn3Xph1px2eYQsxChf1nirSEUcEEgNV6w==",
"version": "5.2.0-443",
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-443.tgz",
"integrity": "sha512-yJxRnNlrAstZzYAkZJZIlxzf5yVlWf9ElvRhXJNVzI1Q9vpFBGJutA7NqVllgelPYhGZK4Oj4bS0F/lYOR5fjA==",
"requires": {
"event-emitter": "^0.3.5",
"minimatch": "5.0.1",

View File

@ -20,7 +20,7 @@
"dist": "rm -rf ../../dist/libs/cli && npm run build && cp -R ./bin ../../dist/libs/cli && cp -R ./resources ../../dist/libs/cli && cp -R ./templates ../../dist/libs/cli && cp ./package.json ../../dist/libs/cli"
},
"dependencies": {
"@alfresco/js-api": "5.2.0-435",
"@alfresco/js-api": "5.2.0-443",
"commander": "6.2.1",
"ejs": "^2.6.1",
"license-checker": "^25.0.1",

View File

@ -22,7 +22,7 @@
"@angular/platform-browser": ">=14.0.5",
"@angular/platform-browser-dynamic": ">=14.0.5",
"@angular/router": ">=14.0.5",
"@alfresco/js-api": "5.2.0-435",
"@alfresco/js-api": "5.2.0-443",
"@ngx-translate/core": ">=13.0.0",
"moment": ">=2.22.2",
"@alfresco/adf-core": "5.1.0"

View File

@ -42,7 +42,7 @@
"@angular/router": ">=10.0.2",
"@mat-datetimepicker/core": ">=4.1.0",
"@mat-datetimepicker/moment": ">=4.1.0",
"@alfresco/js-api": "5.2.0-435",
"@alfresco/js-api": "5.2.0-443",
"@alfresco/adf-extensions": "5.1.0",
"@ngx-translate/core": ">=13.0.0",
"minimatch-browser": ">=1.0.0",

View File

@ -23,7 +23,6 @@ import { AppConfigService } from '../app-config/app-config.service';
import { setupTestBed } from '../testing/setup-test-bed';
import { CoreTestingModule } from '../testing/core.testing.module';
import { TranslateModule } from '@ngx-translate/core';
import { PersonEntry } from '@alfresco/js-api';
declare let jasmine: any;
@ -67,12 +66,8 @@ describe('AuthenticationService', () => {
appConfigService.config.auth = { withCredentials: true };
});
it('should emit login event for kerberos', (done) => {
spyOn(authService.peopleApi, 'getPerson').and.returnValue(Promise.resolve(new PersonEntry()));
spyOn(authService.profileApi, 'getProfile').and.returnValue(Promise.resolve({}));
it('should emit login event for kerberos', (done) => {
const disposableLogin = authService.onLogin.subscribe(() => {
expect(authService.profileApi.getProfile).toHaveBeenCalledTimes(1);
expect(authService.peopleApi.getPerson).toHaveBeenCalledTimes(1);
disposableLogin.unsubscribe();
done();
});
@ -85,6 +80,7 @@ describe('AuthenticationService', () => {
const fakeECMLoginResponse = { type: 'ECM', ticket: 'fake-post-ticket' };
beforeEach(() => {
appConfigService.config.auth = { withCredentials: false };
appConfigService.config.providers = 'ECM';
appConfigService.load();
apiService.reset();

View File

@ -17,13 +17,13 @@
import { Authentication } from '@alfresco/adf-core/auth';
import { Injectable } from '@angular/core';
import { Observable, from, throwError, Observer, ReplaySubject, forkJoin } from 'rxjs';
import { Observable, from, throwError, Observer, ReplaySubject } from 'rxjs';
import { AlfrescoApiService } from './alfresco-api.service';
import { CookieService } from './cookie.service';
import { LogService } from './log.service';
import { RedirectionModel } from '../models/redirection.model';
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
import { PeopleApi, UserProfileApi, UserRepresentation } from '@alfresco/js-api';
import { UserProfileApi, UserRepresentation } from '@alfresco/js-api';
import { map, catchError, tap } from 'rxjs/operators';
import { HttpHeaders } from '@angular/common/http';
import { JwtHelperService } from './jwt-helper.service';
@ -49,12 +49,6 @@ export class AuthenticationService extends Authentication {
*/
onLogout: ReplaySubject<any> = new ReplaySubject<any>(1);
_peopleApi: PeopleApi;
get peopleApi(): PeopleApi {
this._peopleApi = this._peopleApi ?? new PeopleApi(this.alfrescoApi.getInstance());
return this._peopleApi;
}
_profileApi: UserProfileApi;
get profileApi(): UserProfileApi {
this._profileApi = this._profileApi ?? new UserProfileApi(this.alfrescoApi.getInstance());
@ -72,30 +66,9 @@ export class AuthenticationService extends Authentication {
this.alfrescoApi.getInstance().reply('logged-in', () => {
this.onLogin.next();
});
if (this.isKerberosEnabled()) {
this.loadUserDetails();
}
});
}
private loadUserDetails() {
if (this.isALLProvider()) {
const ecmUser$ = from(this.peopleApi.getPerson('-me-'));
const bpmUser$ = this.getBpmLoggedUser();
forkJoin([ecmUser$, bpmUser$]).subscribe(() => this.onLogin.next());
} else if (this.isECMProvider()) {
const ecmUser$ = from(this.peopleApi.getPerson('-me-'));
ecmUser$.subscribe(() => this.onLogin.next());
} else {
const bpmUser$ = this.getBpmLoggedUser();
bpmUser$.subscribe(() => this.onLogin.next());
}
}
/**
* Checks if the user logged in.
*

View File

@ -14,7 +14,7 @@
"peerDependencies": {
"@angular/common": ">=14.0.5",
"@angular/core": ">=14.0.5",
"@alfresco/js-api": "5.2.0-435"
"@alfresco/js-api": "5.2.0-443"
},
"keywords": [
"extensions",

View File

@ -23,7 +23,7 @@
"@angular/platform-browser": ">=14.0.5",
"@angular/platform-browser-dynamic": ">=14.0.5",
"@angular/router": ">=14.0.5",
"@alfresco/js-api": "5.2.0-435",
"@alfresco/js-api": "5.2.0-443",
"@alfresco/adf-core": "5.1.0",
"@alfresco/adf-content-services": "5.1.0",
"@apollo/client": "^3.3.7",

View File

@ -22,7 +22,7 @@
"@angular/platform-browser": ">=14.0.5",
"@angular/platform-browser-dynamic": ">=14.0.5",
"@angular/router": ">=14.0.5",
"@alfresco/js-api": "5.2.0-435",
"@alfresco/js-api": "5.2.0-443",
"@alfresco/adf-core": "5.1.0",
"@alfresco/adf-content-services": "5.1.0",
"@ngx-translate/core": ">=13.0.0",

View File

@ -11,7 +11,7 @@
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
},
"peerDependencies": {
"@alfresco/js-api": "5.2.0-435"
"@alfresco/js-api": "5.2.0-443"
},
"keywords": [
"testing",

6
package-lock.json generated
View File

@ -5,9 +5,9 @@
"requires": true,
"dependencies": {
"@alfresco/js-api": {
"version": "5.2.0-435",
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-435.tgz",
"integrity": "sha512-zBSwGdQZGJdm+/KlUWjOOTKb97TIA3BLTHTthnbNK/csAtK4CQSzeRn3Xph1px2eYQsxChf1nirSEUcEEgNV6w==",
"version": "5.2.0-443",
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-443.tgz",
"integrity": "sha512-yJxRnNlrAstZzYAkZJZIlxzf5yVlWf9ElvRhXJNVzI1Q9vpFBGJutA7NqVllgelPYhGZK4Oj4bS0F/lYOR5fjA==",
"requires": {
"event-emitter": "^0.3.5",
"minimatch": "5.0.1",

View File

@ -66,7 +66,7 @@
"process services-cloud"
],
"dependencies": {
"@alfresco/js-api": "5.2.0-435",
"@alfresco/js-api": "5.2.0-443",
"@angular/animations": "14.1.3",
"@angular/cdk": "14.1.2",
"@angular/common": "14.1.3",

View File

@ -5,9 +5,9 @@
"requires": true,
"dependencies": {
"@alfresco/js-api": {
"version": "5.2.0-435",
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-435.tgz",
"integrity": "sha512-zBSwGdQZGJdm+/KlUWjOOTKb97TIA3BLTHTthnbNK/csAtK4CQSzeRn3Xph1px2eYQsxChf1nirSEUcEEgNV6w==",
"version": "5.2.0-443",
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-443.tgz",
"integrity": "sha512-yJxRnNlrAstZzYAkZJZIlxzf5yVlWf9ElvRhXJNVzI1Q9vpFBGJutA7NqVllgelPYhGZK4Oj4bS0F/lYOR5fjA==",
"requires": {
"event-emitter": "^0.3.5",
"minimatch": "5.0.1",

View File

@ -5,7 +5,7 @@
"author": "Alfresco Software, Ltd.",
"scripts": {},
"dependencies": {
"@alfresco/js-api": "5.2.0-435",
"@alfresco/js-api": "5.2.0-443",
"ejs": "^3.1.6",
"fast-levenshtein": "^3.0.0",
"graphql": "^15.4.0",