mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-5563] Fixed incorrect initial loading of security marks (#3405)
* [ACS-5563] fixed incorrect initial loading of security marks * [ACS-5563] added DoneFn
This commit is contained in:
committed by
GitHub
parent
e2ddd81cbc
commit
deba28c8e0
@@ -29,7 +29,7 @@ import { DocumentListService, FilterSearch, PathElementEntity, UploadService } f
|
||||
import { NodeActionsService } from '../../services/node-actions.service';
|
||||
import { FilesComponent } from './files.component';
|
||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
import { AppExtensionService, ContentApiService } from '@alfresco/aca-shared';
|
||||
import { of, Subject, throwError } from 'rxjs';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NodeEntry, NodePaging, Node } from '@alfresco/js-api';
|
||||
@@ -39,6 +39,7 @@ describe('FilesComponent', () => {
|
||||
let fixture: ComponentFixture<FilesComponent>;
|
||||
let component: FilesComponent;
|
||||
let uploadService: UploadService;
|
||||
let extensions: AppExtensionService;
|
||||
let nodeActionsService: NodeActionsService;
|
||||
let contentApi: ContentApiService;
|
||||
let route: ActivatedRoute;
|
||||
@@ -77,7 +78,8 @@ describe('FilesComponent', () => {
|
||||
params: of({ folderId: 'someId' }),
|
||||
queryParamMap: of({})
|
||||
}
|
||||
}
|
||||
},
|
||||
AppExtensionService
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
});
|
||||
@@ -96,6 +98,7 @@ describe('FilesComponent', () => {
|
||||
route = TestBed.inject(ActivatedRoute);
|
||||
nodeActionsService = TestBed.inject(NodeActionsService);
|
||||
contentApi = TestBed.inject(ContentApiService);
|
||||
extensions = TestBed.inject(AppExtensionService);
|
||||
spyContent = spyOn(contentApi, 'getNode');
|
||||
});
|
||||
|
||||
@@ -148,6 +151,24 @@ describe('FilesComponent', () => {
|
||||
expect(component.node).toBe(node);
|
||||
});
|
||||
|
||||
it('should set columns', () => {
|
||||
const filesDocumentListPresetMock = [
|
||||
{
|
||||
id: 'app.files.modifiedOn',
|
||||
key: 'modifiedAt',
|
||||
type: 'date',
|
||||
sortable: true,
|
||||
desktopOnly: true,
|
||||
template: 'template',
|
||||
sortingKey: 'sorting-key'
|
||||
}
|
||||
];
|
||||
|
||||
extensions.filesDocumentListPreset$ = of(filesDocumentListPresetMock);
|
||||
fixture.detectChanges();
|
||||
expect(component.columns).toEqual(filesDocumentListPresetMock);
|
||||
});
|
||||
|
||||
it('should navigate to parent if node is not a folder', () => {
|
||||
const nodeEntry = { isFolder: false, parentId: 'parent-id' };
|
||||
spyContent.and.returnValue(of({ entry: nodeEntry } as any));
|
||||
|
@@ -127,7 +127,10 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
this.isAdmin = value;
|
||||
});
|
||||
|
||||
this.columns = this.extensions.documentListPresets.files || [];
|
||||
this.extensions.filesDocumentListPreset$.pipe(takeUntil(this.onDestroy$)).subscribe((preset) => {
|
||||
this.columns = preset;
|
||||
});
|
||||
|
||||
if (this.queryParams && Object.keys(this.queryParams).length > 0) {
|
||||
this.isFilterHeaderActive = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user