[ADF-4125] simplify extension load in extension module (#4214)

* add extension load in extension module

* add viewer extensions

* fix license header

* fix node passed in the viewer extension

* fix node passed in the viewer extension

* startup factory extension

* startup factory extension

* fix script

* fix beta tag build

* fix build

* fix build

* refactoring configuration files

* extension using map

* fix build

* fix config

* fix test

* fix test
This commit is contained in:
Eugenio Romano
2019-02-22 14:19:41 +00:00
committed by GitHub
parent bf4d1a2806
commit bda7e07b52
92 changed files with 1035 additions and 785 deletions

View File

@@ -27,6 +27,7 @@ import { of } from 'rxjs';
import { ContentTestingModule } from '../testing/content.testing.module';
import { DocumentListService } from '../document-list/services/document-list.service';
import { DocumentListComponent } from '../document-list/components/document-list.component';
import { ShareDataRow } from '../document-list';
describe('ContentNodeSelectorDialogComponent', () => {
@@ -36,7 +37,10 @@ describe('ContentNodeSelectorDialogComponent', () => {
title: 'Move along citizen...',
actionName: 'move',
select: new EventEmitter<Node>(),
rowFilter: () => {
rowFilter: (shareDataRow: ShareDataRow) => {
if (shareDataRow.node.entry.name === 'impossible-name') {
return true;
}
},
imageResolver: () => 'piccolo',
currentFolderId: 'cat-girl-nuku-nuku'
@@ -88,14 +92,25 @@ describe('ContentNodeSelectorDialogComponent', () => {
expect(documentList.componentInstance.currentFolderId).toBe('cat-girl-nuku-nuku');
});
xit('should pass through the injected rowFilter to the documentList', (done) => {
fixture.whenStable().then(() => {
let documentList = fixture.debugElement.query(By.directive(DocumentListComponent));
expect(documentList).not.toBeNull('Document list should be shown');
expect(documentList.componentInstance.rowFilter).toBe(data.rowFilter);
done();
});
it('should pass through the injected rowFilter to the documentList', () => {
let documentList = fixture.debugElement.query(By.directive(DocumentListComponent));
expect(documentList).not.toBeNull('Document list should be shown');
expect(documentList.componentInstance.rowFilter({
node: {
entry: new Node({
name: 'impossible-name',
id: 'name'
})
}
}))
.toBe(data.rowFilter(<ShareDataRow> {
node: {
entry: new Node({
name: 'impossible-name',
id: 'name'
})
}
}));
});
it('should pass through the injected imageResolver to the documentList', () => {

View File

@@ -120,31 +120,6 @@ describe('ShareDialogComponent', () => {
});
}));
xit(`should copy shared link and notify on button event`, (done) => {
node.entry.properties['qshare:sharedId'] = 'sharedId';
spyOn(document, 'execCommand').and.callThrough();
component.data = {
node,
baseShareUrl: 'some-url/'
};
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
fixture.nativeElement.querySelector('.adf-input-action')
.dispatchEvent(new MouseEvent('click'));
fixture.detectChanges();
expect(document.execCommand).toHaveBeenCalledWith('copy');
expect(notificationServiceMock.openSnackMessage).toHaveBeenCalledWith('SHARE.CLIPBOARD-MESSAGE');
done();
});
});
it('should open a confirmation dialog when unshare button is triggered', () => {
spyOn(matDialog, 'open').and.returnValue({ beforeClose: () => of(false) });
spyOn(sharedLinksApiService, 'deleteSharedLink').and.callThrough();

View File

@@ -1219,7 +1219,7 @@ describe('DocumentList', () => {
documentList.loadFolderByNodeId('-recent-');
});
xit('should emit error when fetch recent fails on search call', (done) => {
it('should emit error when fetch recent fails on search call', (done) => {
spyOn(customResourcesService, 'loadFolderByNodeId').and.returnValue(throwError('error'));
let disposableError = documentList.error.subscribe((val) => {

View File

@@ -55,7 +55,6 @@ class TestComponent {
describe('FolderCreateDirective', () => {
let fixture: ComponentFixture<TestTypeComponent | TestComponent>;
let element;
let node: any;
let dialog: MatDialog;
let contentService: ContentService;
let dialogRefMock;
@@ -85,8 +84,6 @@ describe('FolderCreateDirective', () => {
});
beforeEach(() => {
node = { entry: { id: 'nodeId' } };
dialogRefMock = {
afterClosed: (val) => of(val),
componentInstance: {
@@ -106,22 +103,6 @@ describe('FolderCreateDirective', () => {
spyOn(dialog, 'open').and.returnValue(dialogRefMock);
});
xit('should emit folderCreate event when input value is not undefined', (done) => {
spyOn(dialogRefMock, 'afterClosed').and.returnValue(of(node));
spyOn(contentService.folderCreate, 'next');
contentService.folderCreate.subscribe((val) => {
expect(val).toBe(node);
done();
});
fixture.detectChanges();
fixture.whenStable().then(() => {
element.nativeElement.click();
});
});
it('should not emit folderCreate event when input value is undefined', () => {
spyOn(dialogRefMock, 'afterClosed').and.returnValue(of(null));
spyOn(contentService.folderCreate, 'next');

View File

@@ -9,7 +9,7 @@
"entryFile": "./public-api.ts",
"flatModuleFile": "adf-content-services",
"umdModuleIds": {
"@alfresco/js-api": "@alfresco/js-ap",
"@alfresco/js-api": "@alfresco/js-api",
"minimatch": "minimatch",
"@angular/platform-browser/animations": "@angular/platform-browser/animations",
"@angular/material": "@angular/material",

View File

@@ -20,7 +20,7 @@ import { TreeViewService } from './tree-view.service';
import { TestBed } from '@angular/core/testing';
import { ContentTestingModule } from '../../testing/content.testing.module';
import { of } from 'rxjs';
import { TreeBaseNode } from 'tree-view/models/tree-view.model';
import { TreeBaseNode } from '../models/tree-view.model';
describe('TreeViewService', () => {

View File

@@ -1,41 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": false,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "../dist/content-services/",
"baseUrl" : "./",
"paths": {
"@alfresco/adf-process-services": ["../process-services"],
"@alfresco/adf-core": ["../core"]
},
"lib": [
"es2016",
"dom"
],
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}

View File

@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../dist/content-services/"
}
}

View File

@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.spec.json",
"files": [
"test.ts"
]
}