mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-08 14:51:14 +00:00
[ACA-1529] performance fixes for permission checks (#498)
* fix recent files * fix files component * fix shared files * don't evaluate permissions for empty selection * fix info drawer * fix viewer * fix tests * reduce one more check * track upload errors on app level * remove console log * reduce service dependencies
This commit is contained in:
@@ -25,8 +25,7 @@
|
||||
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { PeopleContentService, AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { LayoutComponent } from './layout.component';
|
||||
import { SidenavViewsManagerDirective } from './sidenav-views-manager.directive';
|
||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||
@@ -44,14 +43,6 @@ describe('LayoutComponent', () => {
|
||||
LayoutComponent,
|
||||
SidenavViewsManagerDirective
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: PeopleContentService,
|
||||
useValue: {
|
||||
getCurrentPerson: () => Observable.of({ entry: {} })
|
||||
}
|
||||
}
|
||||
],
|
||||
schemas: [ NO_ERRORS_SCHEMA ]
|
||||
});
|
||||
|
||||
|
@@ -63,7 +63,7 @@ export class LayoutComponent implements OnInit, OnDestroy {
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(node => {
|
||||
this.node = node;
|
||||
this.canUpload = this.permission.check(node, ['create']);
|
||||
this.canUpload = node && this.permission.check(node, ['create']);
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user