mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
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:
parent
740e3cef9b
commit
97e6129b6e
6
lib/cli/package-lock.json
generated
6
lib/cli/package-lock.json
generated
@ -5,9 +5,9 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alfresco/js-api": {
|
"@alfresco/js-api": {
|
||||||
"version": "5.2.0-435",
|
"version": "5.2.0-443",
|
||||||
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-435.tgz",
|
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-443.tgz",
|
||||||
"integrity": "sha512-zBSwGdQZGJdm+/KlUWjOOTKb97TIA3BLTHTthnbNK/csAtK4CQSzeRn3Xph1px2eYQsxChf1nirSEUcEEgNV6w==",
|
"integrity": "sha512-yJxRnNlrAstZzYAkZJZIlxzf5yVlWf9ElvRhXJNVzI1Q9vpFBGJutA7NqVllgelPYhGZK4Oj4bS0F/lYOR5fjA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"event-emitter": "^0.3.5",
|
"event-emitter": "^0.3.5",
|
||||||
"minimatch": "5.0.1",
|
"minimatch": "5.0.1",
|
||||||
|
@ -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"
|
"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": {
|
"dependencies": {
|
||||||
"@alfresco/js-api": "5.2.0-435",
|
"@alfresco/js-api": "5.2.0-443",
|
||||||
"commander": "6.2.1",
|
"commander": "6.2.1",
|
||||||
"ejs": "^2.6.1",
|
"ejs": "^2.6.1",
|
||||||
"license-checker": "^25.0.1",
|
"license-checker": "^25.0.1",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"@angular/platform-browser": ">=14.0.5",
|
"@angular/platform-browser": ">=14.0.5",
|
||||||
"@angular/platform-browser-dynamic": ">=14.0.5",
|
"@angular/platform-browser-dynamic": ">=14.0.5",
|
||||||
"@angular/router": ">=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",
|
"@ngx-translate/core": ">=13.0.0",
|
||||||
"moment": ">=2.22.2",
|
"moment": ">=2.22.2",
|
||||||
"@alfresco/adf-core": "5.1.0"
|
"@alfresco/adf-core": "5.1.0"
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
"@angular/router": ">=10.0.2",
|
"@angular/router": ">=10.0.2",
|
||||||
"@mat-datetimepicker/core": ">=4.1.0",
|
"@mat-datetimepicker/core": ">=4.1.0",
|
||||||
"@mat-datetimepicker/moment": ">=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",
|
"@alfresco/adf-extensions": "5.1.0",
|
||||||
"@ngx-translate/core": ">=13.0.0",
|
"@ngx-translate/core": ">=13.0.0",
|
||||||
"minimatch-browser": ">=1.0.0",
|
"minimatch-browser": ">=1.0.0",
|
||||||
|
@ -23,7 +23,6 @@ import { AppConfigService } from '../app-config/app-config.service';
|
|||||||
import { setupTestBed } from '../testing/setup-test-bed';
|
import { setupTestBed } from '../testing/setup-test-bed';
|
||||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { PersonEntry } from '@alfresco/js-api';
|
|
||||||
|
|
||||||
declare let jasmine: any;
|
declare let jasmine: any;
|
||||||
|
|
||||||
@ -67,12 +66,8 @@ describe('AuthenticationService', () => {
|
|||||||
appConfigService.config.auth = { withCredentials: true };
|
appConfigService.config.auth = { withCredentials: true };
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should emit login event for kerberos', (done) => {
|
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({}));
|
|
||||||
const disposableLogin = authService.onLogin.subscribe(() => {
|
const disposableLogin = authService.onLogin.subscribe(() => {
|
||||||
expect(authService.profileApi.getProfile).toHaveBeenCalledTimes(1);
|
|
||||||
expect(authService.peopleApi.getPerson).toHaveBeenCalledTimes(1);
|
|
||||||
disposableLogin.unsubscribe();
|
disposableLogin.unsubscribe();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@ -85,6 +80,7 @@ describe('AuthenticationService', () => {
|
|||||||
const fakeECMLoginResponse = { type: 'ECM', ticket: 'fake-post-ticket' };
|
const fakeECMLoginResponse = { type: 'ECM', ticket: 'fake-post-ticket' };
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
appConfigService.config.auth = { withCredentials: false };
|
||||||
appConfigService.config.providers = 'ECM';
|
appConfigService.config.providers = 'ECM';
|
||||||
appConfigService.load();
|
appConfigService.load();
|
||||||
apiService.reset();
|
apiService.reset();
|
||||||
|
@ -17,13 +17,13 @@
|
|||||||
|
|
||||||
import { Authentication } from '@alfresco/adf-core/auth';
|
import { Authentication } from '@alfresco/adf-core/auth';
|
||||||
import { Injectable } from '@angular/core';
|
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 { AlfrescoApiService } from './alfresco-api.service';
|
||||||
import { CookieService } from './cookie.service';
|
import { CookieService } from './cookie.service';
|
||||||
import { LogService } from './log.service';
|
import { LogService } from './log.service';
|
||||||
import { RedirectionModel } from '../models/redirection.model';
|
import { RedirectionModel } from '../models/redirection.model';
|
||||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
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 { map, catchError, tap } from 'rxjs/operators';
|
||||||
import { HttpHeaders } from '@angular/common/http';
|
import { HttpHeaders } from '@angular/common/http';
|
||||||
import { JwtHelperService } from './jwt-helper.service';
|
import { JwtHelperService } from './jwt-helper.service';
|
||||||
@ -49,12 +49,6 @@ export class AuthenticationService extends Authentication {
|
|||||||
*/
|
*/
|
||||||
onLogout: ReplaySubject<any> = new ReplaySubject<any>(1);
|
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;
|
_profileApi: UserProfileApi;
|
||||||
get profileApi(): UserProfileApi {
|
get profileApi(): UserProfileApi {
|
||||||
this._profileApi = this._profileApi ?? new UserProfileApi(this.alfrescoApi.getInstance());
|
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.alfrescoApi.getInstance().reply('logged-in', () => {
|
||||||
this.onLogin.next();
|
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.
|
* Checks if the user logged in.
|
||||||
*
|
*
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/common": ">=14.0.5",
|
"@angular/common": ">=14.0.5",
|
||||||
"@angular/core": ">=14.0.5",
|
"@angular/core": ">=14.0.5",
|
||||||
"@alfresco/js-api": "5.2.0-435"
|
"@alfresco/js-api": "5.2.0-443"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"extensions",
|
"extensions",
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
"@angular/platform-browser": ">=14.0.5",
|
"@angular/platform-browser": ">=14.0.5",
|
||||||
"@angular/platform-browser-dynamic": ">=14.0.5",
|
"@angular/platform-browser-dynamic": ">=14.0.5",
|
||||||
"@angular/router": ">=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-core": "5.1.0",
|
||||||
"@alfresco/adf-content-services": "5.1.0",
|
"@alfresco/adf-content-services": "5.1.0",
|
||||||
"@apollo/client": "^3.3.7",
|
"@apollo/client": "^3.3.7",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"@angular/platform-browser": ">=14.0.5",
|
"@angular/platform-browser": ">=14.0.5",
|
||||||
"@angular/platform-browser-dynamic": ">=14.0.5",
|
"@angular/platform-browser-dynamic": ">=14.0.5",
|
||||||
"@angular/router": ">=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-core": "5.1.0",
|
||||||
"@alfresco/adf-content-services": "5.1.0",
|
"@alfresco/adf-content-services": "5.1.0",
|
||||||
"@ngx-translate/core": ">=13.0.0",
|
"@ngx-translate/core": ">=13.0.0",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@alfresco/js-api": "5.2.0-435"
|
"@alfresco/js-api": "5.2.0-443"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"testing",
|
"testing",
|
||||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -5,9 +5,9 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alfresco/js-api": {
|
"@alfresco/js-api": {
|
||||||
"version": "5.2.0-435",
|
"version": "5.2.0-443",
|
||||||
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-435.tgz",
|
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-443.tgz",
|
||||||
"integrity": "sha512-zBSwGdQZGJdm+/KlUWjOOTKb97TIA3BLTHTthnbNK/csAtK4CQSzeRn3Xph1px2eYQsxChf1nirSEUcEEgNV6w==",
|
"integrity": "sha512-yJxRnNlrAstZzYAkZJZIlxzf5yVlWf9ElvRhXJNVzI1Q9vpFBGJutA7NqVllgelPYhGZK4Oj4bS0F/lYOR5fjA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"event-emitter": "^0.3.5",
|
"event-emitter": "^0.3.5",
|
||||||
"minimatch": "5.0.1",
|
"minimatch": "5.0.1",
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
"process services-cloud"
|
"process services-cloud"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alfresco/js-api": "5.2.0-435",
|
"@alfresco/js-api": "5.2.0-443",
|
||||||
"@angular/animations": "14.1.3",
|
"@angular/animations": "14.1.3",
|
||||||
"@angular/cdk": "14.1.2",
|
"@angular/cdk": "14.1.2",
|
||||||
"@angular/common": "14.1.3",
|
"@angular/common": "14.1.3",
|
||||||
|
6
tools/doc/package-lock.json
generated
6
tools/doc/package-lock.json
generated
@ -5,9 +5,9 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alfresco/js-api": {
|
"@alfresco/js-api": {
|
||||||
"version": "5.2.0-435",
|
"version": "5.2.0-443",
|
||||||
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-435.tgz",
|
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-5.2.0-443.tgz",
|
||||||
"integrity": "sha512-zBSwGdQZGJdm+/KlUWjOOTKb97TIA3BLTHTthnbNK/csAtK4CQSzeRn3Xph1px2eYQsxChf1nirSEUcEEgNV6w==",
|
"integrity": "sha512-yJxRnNlrAstZzYAkZJZIlxzf5yVlWf9ElvRhXJNVzI1Q9vpFBGJutA7NqVllgelPYhGZK4Oj4bS0F/lYOR5fjA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"event-emitter": "^0.3.5",
|
"event-emitter": "^0.3.5",
|
||||||
"minimatch": "5.0.1",
|
"minimatch": "5.0.1",
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alfresco/js-api": "5.2.0-435",
|
"@alfresco/js-api": "5.2.0-443",
|
||||||
"ejs": "^3.1.6",
|
"ejs": "^3.1.6",
|
||||||
"fast-levenshtein": "^3.0.0",
|
"fast-levenshtein": "^3.0.0",
|
||||||
"graphql": "^15.4.0",
|
"graphql": "^15.4.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user