[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:
Denys Vuika
2018-07-08 12:25:20 +01:00
committed by GitHub
parent fe683015c5
commit 718a32a907
23 changed files with 171 additions and 151 deletions

View File

@@ -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 ]
});

View File

@@ -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']);
});
}