[ADF-1868] Update to Angular 5 (#2606)

* Angular 5.0.0 update

* fix core http import

* split language html from ts

* http deprecation module change

* fix test core

* fix analytics api

* update dependency

* exclude breadcrumb object picker test

* fix viewer and common new test

* fix test cs

* fix tasklist test

* fix demo shell angular 5

* fix translate

* dix search test

* restore files demo shell

* update tsconfig

* rebuild automatic prebuild theme

* Fix breadcrumb tests

* Fix tests, the right way
This commit is contained in:
Eugenio Romano
2017-11-06 14:23:46 +00:00
committed by GitHub
parent 7146ee51a2
commit 9f3ea6ea71
62 changed files with 723 additions and 704 deletions

View File

@@ -42,17 +42,18 @@
"alfresco"
],
"dependencies": {
"@angular/animations": "4.4.5",
"@angular/animations": "5.0.0",
"@angular/cdk": "2.0.0-beta.12",
"@angular/common": "4.4.5",
"@angular/compiler": "4.4.5",
"@angular/core": "4.4.5",
"@angular/forms": "4.4.5",
"@angular/http": "4.4.5",
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/core": "5.0.0",
"@angular/flex-layout": "2.0.0-beta.10",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/material": "2.0.0-beta.12",
"@angular/platform-browser": "4.4.5",
"@angular/platform-browser-dynamic": "4.4.5",
"@angular/router": "4.4.5",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@angular/router": "5.0.0",
"@ngx-translate/core": "8.0.0",
"alfresco-js-api": "1.9.0",
"core-js": "2.4.1",
@@ -61,18 +62,18 @@
"ng2-alfresco-datatable": "1.9.0",
"ng2-alfresco-documentlist": "1.9.0",
"reflect-metadata": "0.1.10",
"rxjs": "5.1.0",
"rxjs": "5.5.2",
"systemjs": "0.19.27",
"zone.js": "0.8.12"
"zone.js": "0.8.14"
},
"devDependencies": {
"@types/hammerjs": "2.0.35",
"@types/jasmine": "2.5.35",
"@types/node": "6.0.45",
"@types/node": "6.0.90",
"adf-tslint-rules": "0.0.4",
"angular2-template-loader": "0.6.2",
"autoprefixer": "6.5.4",
"codelyzer": "3.1.2",
"codelyzer": "4.0.0",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.25.0",
"css-to-string-loader": "0.1.2",
@@ -80,23 +81,23 @@
"extract-text-webpack-plugin": "2.0.0-rc.3",
"file-loader": "0.11.1",
"fork-ts-checker-webpack-plugin": "0.2.3",
"happypack": "3.0.0",
"happypack": "4.0.0",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.28.0",
"istanbul-instrumenter-loader": "0.2.0",
"jasmine-ajax": "3.2.0",
"jasmine-core": "2.4.1",
"karma": "0.13.22",
"karma-chrome-launcher": "~1.0.1",
"karma-chrome-launcher": "2.2.0",
"karma-coverage": "1.1.1",
"karma-jasmine": "~1.0.2",
"karma-jasmine": "1.1.0",
"karma-jasmine-ajax": "0.1.13",
"karma-jasmine-html-reporter": "0.2.0",
"karma-jasmine-html-reporter": "0.2.2",
"karma-mocha-reporter": "2.2.2",
"karma-remap-istanbul": "0.6.0",
"karma-sourcemap-loader": "0.3.7",
"karma-systemjs": "0.16.0",
"karma-webpack": "2.0.3",
"karma-webpack": "2.0.5",
"loader-utils": "1.1.0",
"merge-stream": "1.0.1",
"node-sass": "4.5.3",
@@ -113,13 +114,13 @@
"systemjs-builder": "0.15.34",
"to-string-loader": "1.1.5",
"traceur": "0.0.91",
"ts-loader": "2.2.1",
"ts-node": "1.7.0",
"tslint": "5.5.0",
"ts-loader": "3.1.1",
"ts-node": "2.0.0",
"tslint": "5.7.0",
"tslint-loader": "3.5.3",
"typescript": "2.5.2",
"webpack": "2.2.1",
"webpack-dev-server": "2.3.0",
"typescript": "2.4.2",
"webpack": "3.8.1",
"webpack-dev-server": "2.9.4",
"webpack-merge": "2.6.1",
"wsrv": "0.1.7"
},

View File

@@ -340,28 +340,6 @@ describe('SearchControlComponent', () => {
}, 500);
});
it('click on the search button should not trigger the search when you click on it to close the search bar', (done) => {
spyOn(searchService, 'getQueryNodesPromise')
.and.returnValue(Promise.resolve(results));
component.liveSearchTerm = 'test';
fixture.detectChanges();
component.subscriptAnimationState = 'active';
let searchButton: any = element.querySelector('#adf-search-button');
searchButton.click();
setTimeout(() => {
fixture.detectChanges();
expect(component.liveSearchComponent.panelAnimationState).not.toBe('void');
let resultElement: Element = element.querySelector('#adf-search-results');
expect(resultElement).toBe(null);
done();
done();
}, 500);
});
it('click on the search button should open the input box when is close', (done) => {
fixture.detectChanges();
component.subscriptAnimationState = 'inactive';

View File

@@ -16,9 +16,22 @@
*/
import { animate, state, style, transition, trigger } from '@angular/animations';
import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core';
import {
Component,
ElementRef,
EventEmitter,
Input,
OnDestroy,
OnInit,
Output,
ViewChild,
ViewEncapsulation
} from '@angular/core';
import { FormControl, Validators } from '@angular/forms';
import { Observable, Subject } from 'rxjs/Rx';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/map';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { SearchTermValidator } from './../forms/search-term-validator';
import { SearchAutocompleteComponent } from './search-autocomplete.component';
@@ -28,9 +41,9 @@ import { SearchAutocompleteComponent } from './search-autocomplete.component';
styleUrls: ['./search-control.component.scss'],
animations: [
trigger('transitionMessages', [
state('active', style({transform: 'translateX(0%)'})),
state('inactive', style({transform: 'translateX(83%)'})),
state('no-animation', style({transform: 'translateX(0%)', width: '100%'})),
state('active', style({ transform: 'translateX(0%)' })),
state('inactive', style({ transform: 'translateX(83%)' })),
state('no-animation', style({ transform: 'translateX(0%)', width: '100%' })),
transition('inactive => active',
animate('300ms cubic-bezier(0.55, 0, 0.55, 0.2)')),
transition('active => inactive',
@@ -113,17 +126,17 @@ export class SearchControlComponent implements OnInit, OnDestroy {
}
}
});
this.searchControl.valueChanges.subscribe((value: string) => {
if (value) {
this.onSearchTermChange(value);
}
}
);
}
ngOnInit(): void {
this.subscriptAnimationState = this.expandable ? 'inactive' : 'no-animation';
this.searchControl.valueChanges.debounceTime(400).distinctUntilChanged()
.subscribe((value: string) => {
this.onSearchTermChange(value);
}
);
this.setupFocusEventHandlers();
}
@@ -134,7 +147,6 @@ export class SearchControlComponent implements OnInit, OnDestroy {
private onSearchTermChange(value: string): void {
this.searchValid = this.searchControl.valid;
this.liveSearchTerm = this.searchValid ? value : '';
this.searchControl.setValue(value);
this.searchChange.emit({
value: value,
valid: this.searchValid