mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[AAE-12501] Replace sitesService with authentication service since sitesService get the username from oauth2Auth
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||||
import { LogService, InfiniteSelectScrollDirective } from '@alfresco/adf-core';
|
import { LogService, InfiniteSelectScrollDirective, AuthenticationService } from '@alfresco/adf-core';
|
||||||
import { SitePaging, SiteEntry } from '@alfresco/js-api';
|
import { SitePaging, SiteEntry } from '@alfresco/js-api';
|
||||||
import { MatSelectChange } from '@angular/material/select';
|
import { MatSelectChange } from '@angular/material/select';
|
||||||
import {LiveAnnouncer} from '@angular/cdk/a11y';
|
import {LiveAnnouncer} from '@angular/cdk/a11y';
|
||||||
@@ -81,7 +81,8 @@ export class DropdownSitesComponent implements OnInit {
|
|||||||
selected: SiteEntry = null;
|
selected: SiteEntry = null;
|
||||||
MY_FILES_VALUE = '-my-';
|
MY_FILES_VALUE = '-my-';
|
||||||
|
|
||||||
constructor(private sitesService: SitesService,
|
constructor(private authService: AuthenticationService,
|
||||||
|
private sitesService: SitesService,
|
||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
private liveAnnouncer: LiveAnnouncer,
|
private liveAnnouncer: LiveAnnouncer,
|
||||||
private translateService: TranslateService) {
|
private translateService: TranslateService) {
|
||||||
@@ -174,7 +175,7 @@ export class DropdownSitesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private filteredResultsByMember(sites: SitePaging): SitePaging {
|
private filteredResultsByMember(sites: SitePaging): SitePaging {
|
||||||
const loggedUserName = this.sitesService.getEcmCurrentLoggedUserName();
|
const loggedUserName = this.authService.getEcmUsername();
|
||||||
sites.list.entries = sites.list.entries.filter((site) => this.isCurrentUserMember(site, loggedUserName));
|
sites.list.entries = sites.list.entries.filter((site) => this.isCurrentUserMember(site, loggedUserName));
|
||||||
return sites;
|
return sites;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user