[ADF-2056] update dependencies (#2764)

* update dependencies
add ban for fdescribe in tslint
reenable test
add badge codacy
check bundles esm5 and esm2015
travis run new vuild script

* remove fdescribe

* material 5.0.0 stable release
This commit is contained in:
Eugenio Romano
2017-12-07 11:58:16 +00:00
committed by GitHub
parent 321c4f48e1
commit a99c1a37e4
32 changed files with 666 additions and 584 deletions

View File

@@ -34,32 +34,17 @@ export class DownloadZipDialogComponent implements OnInit {
constructor(private apiService: AlfrescoApiService,
private dialogRef: MatDialogRef<DownloadZipDialogComponent>,
@Inject(MAT_DIALOG_DATA) private data: { nodeIds?: string[] },
@Inject(MAT_DIALOG_DATA) private data: any,
private logService: LogService) {
}
private get downloadsApi() {
return this.apiService.getInstance().core.downloadsApi;
}
private get nodesApi() {
return this.apiService.getInstance().core.nodesApi;
}
private get contentApi() {
return this.apiService.getInstance().content;
}
ngOnInit() {
if (this.data && this.data.nodeIds && this.data.nodeIds.length > 0) {
// change timeout to have a delay for demo purposes
setTimeout(() => {
if (!this.cancelled) {
this.downloadZip(this.data.nodeIds);
} else {
this.logService.log('Cancelled');
}
}, 0);
if (!this.cancelled) {
this.downloadZip(this.data.nodeIds);
} else {
this.logService.log('Cancelled');
}
}
}
@@ -71,7 +56,7 @@ export class DownloadZipDialogComponent implements OnInit {
downloadZip(nodeIds: string[]) {
if (nodeIds && nodeIds.length > 0) {
const promise: any = this.downloadsApi.createDownload({ nodeIds });
const promise: any = this.apiService.getInstance().core.downloadsApi.createDownload({ nodeIds });
promise.on('progress', progress => this.logService.log('Progress', progress));
promise.on('error', error => this.logService.error('Error', error));
@@ -79,9 +64,9 @@ export class DownloadZipDialogComponent implements OnInit {
promise.on('success', (data: DownloadEntry) => {
if (data && data.entry && data.entry.id) {
const url = this.contentApi.getContentUrl(data.entry.id, true);
// the call is needed only to get the name of the package
this.nodesApi.getNode(data.entry.id).then((downloadNode: MinimalNodeEntity) => {
const url = this.apiService.getInstance().content.getContentUrl(data.entry.id, true);
this.apiService.getInstance().core.nodesApi.getNode(data.entry.id).then((downloadNode: MinimalNodeEntity) => {
this.logService.log(downloadNode);
const fileName = downloadNode.entry.name;
this.waitAndDownload(data.entry.id, url, fileName);
@@ -96,9 +81,9 @@ export class DownloadZipDialogComponent implements OnInit {
return;
}
this.downloadsApi.getDownload(downloadId).then((d: DownloadEntry) => {
if (d.entry) {
if (d.entry.status === 'DONE') {
this.apiService.getInstance().core.downloadsApi.getDownload(downloadId).then((downloadEntry: DownloadEntry) => {
if (downloadEntry.entry) {
if (downloadEntry.entry.status === 'DONE') {
this.download(url, fileName);
} else {
setTimeout(() => {

View File

@@ -153,7 +153,7 @@ describe('DropdownSitesComponent', () => {
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(fixture.nativeElement.innerText.trim()).toBe('DROPDOWN.PLACEHOLDER_LABEL');
expect(fixture.nativeElement.innerText.trim()).toContain('DROPDOWN.PLACEHOLDER_LABEL');
});
}));
@@ -166,7 +166,7 @@ describe('DropdownSitesComponent', () => {
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(fixture.nativeElement.innerText.trim()).toBe('NODE_SELECTOR.SELECT_LOCATION');
expect(fixture.nativeElement.innerText.trim()).toContain('NODE_SELECTOR.SELECT_LOCATION');
});
}));

View File

@@ -37,23 +37,21 @@ describe('WebscriptComponent', () => {
declarations: [
WebscriptComponent
]
}).compileComponents();
}).compileComponents().then(()=>{
let appConfig: AppConfigService = TestBed.get(AppConfigService);
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
fixture = TestBed.createComponent(WebscriptComponent);
component = fixture.componentInstance;
element = fixture.nativeElement;
component = fixture.componentInstance;
component.scriptPath = 'fakePath';
component.showData = true;
fixture.detectChanges();
});
}));
beforeEach(() => {
let appConfig: AppConfigService = TestBed.get(AppConfigService);
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
fixture = TestBed.createComponent(WebscriptComponent);
component = fixture.componentInstance;
element = fixture.nativeElement;
component = fixture.componentInstance;
component.scriptPath = 'fakePath';
component.showData = true;
fixture.detectChanges();
});
describe('View', () => {
it('html wrapper should be present', () => {
expect(element.querySelector('#webscript-html-wrapper')).toBeDefined();