angular update to version 8
parent
4f507eddf3
commit
e6891861e5
@ -0,0 +1,12 @@
|
||||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||
# For additional information regarding the format and rule options, please see:
|
||||
# https://github.com/browserslist/browserslist#queries
|
||||
|
||||
# You can see what browsers were selected by your queries by running:
|
||||
# npx browserslist
|
||||
|
||||
> 0.5%
|
||||
last 2 versions
|
||||
Firefox ESR
|
||||
not dead
|
||||
not IE 9-11 # For IE 9-11 support, remove 'not'.
|
@ -1,63 +1,58 @@
|
||||
{
|
||||
"name": "dmp-frontend2",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build --prod",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^6.1.7",
|
||||
"@angular/common": "^6.1.7",
|
||||
"@angular/compiler": "^6.1.7",
|
||||
"@angular/core": "^6.1.7",
|
||||
"@angular/flex-layout": "6.0.0-beta.18",
|
||||
"@angular/forms": "^6.1.7",
|
||||
"@angular/material-moment-adapter": "^6.4.7",
|
||||
"@angular/platform-browser": "^6.1.7",
|
||||
"@ngx-translate/core": "^10.0.2",
|
||||
"@ngx-translate/http-loader": "^3.0.1",
|
||||
"@swimlane/ngx-datatable": "^13.1.0",
|
||||
"bootstrap": "^4.1.3",
|
||||
"core-js": "^2.5.5",
|
||||
"file-saver": "^2.0.0-rc.3",
|
||||
"moment": "^2.22.2",
|
||||
"moment-timezone": "^0.5.23",
|
||||
"ngx-cookie-service": "^1.0.10",
|
||||
"rxjs": "^6.3.2",
|
||||
"rxjs-compat": "^6.3.2",
|
||||
"web-animations-js": "^2.3.1",
|
||||
"zone.js": "^0.8.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^0.8.5",
|
||||
"@angular/cdk": "^6.3.0",
|
||||
"@angular/material": "^6.4.7",
|
||||
"@angular/cli": "6.2.5",
|
||||
"@angular/compiler-cli": "^6.1.10",
|
||||
"@angular/http": "^6.1.10",
|
||||
"@angular/platform-browser-dynamic": "^6.1.10",
|
||||
"@angular/router": "^6.1.10",
|
||||
"@angular/language-service": "^6.1.10",
|
||||
"@types/facebook-js-sdk": "^2.8.4",
|
||||
"@types/file-saver": "^1.3.1",
|
||||
"@types/gapi": "^0.0.36",
|
||||
"@types/gapi.auth2": "^0.0.47",
|
||||
"@types/jasmine": "~2.8.9",
|
||||
"@types/jasminewd2": "~2.0.5",
|
||||
"@types/moment-timezone": "^0.5.4",
|
||||
"@types/node": "^10.11.7",
|
||||
"codelyzer": "~4.5.0",
|
||||
"jasmine-core": "^3.2.1",
|
||||
"jasmine-spec-reporter": "^4.2.1",
|
||||
"protractor": "~5.4.1",
|
||||
"ts-node": "~7.0.1",
|
||||
"tslint": "~5.11.0",
|
||||
"typescript": "2.9.1"
|
||||
}
|
||||
"name": "dmp-frontend2",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build --prod",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^8.2.7",
|
||||
"@angular/common": "^8.2.7",
|
||||
"@angular/compiler": "^8.2.7",
|
||||
"@angular/core": "^8.2.7",
|
||||
"@angular/forms": "^8.2.7",
|
||||
"@angular/material-moment-adapter": "^8.2.0",
|
||||
"@angular/platform-browser": "^8.2.7",
|
||||
"@ngx-translate/core": "^11.0.1",
|
||||
"@ngx-translate/http-loader": "^4.0.0",
|
||||
"@swimlane/ngx-datatable": "^16.0.2",
|
||||
"bootstrap": "^4.3.1",
|
||||
"core-js": "^2.5.5",
|
||||
"file-saver": "^2.0.2",
|
||||
"moment": "^2.24.0",
|
||||
"moment-timezone": "^0.5.26",
|
||||
"ngx-cookie-service": "^2.2.0",
|
||||
"rxjs": "^6.3.2",
|
||||
"tslib": "^1.10.0",
|
||||
"web-animations-js": "^2.3.2",
|
||||
"zone.js": "~0.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.803.5",
|
||||
"@angular/cdk": "^8.2.0",
|
||||
"@angular/material": "^8.2.0",
|
||||
"@angular/cli": "8.3.5",
|
||||
"@angular/compiler-cli": "^8.2.7",
|
||||
"@angular/platform-browser-dynamic": "^8.2.7",
|
||||
"@angular/router": "^8.2.7",
|
||||
"@angular/language-service": "^8.2.7",
|
||||
"@types/facebook-js-sdk": "^3.3.0",
|
||||
"@types/file-saver": "^2.0.1",
|
||||
"@types/gapi": "^0.0.39",
|
||||
"@types/gapi.auth2": "^0.0.50",
|
||||
"@types/jasmine": "~3.4.0",
|
||||
"@types/jasminewd2": "~2.0.6",
|
||||
"@types/moment-timezone": "^0.5.12",
|
||||
"@types/node": "^10.11.7",
|
||||
"codelyzer": "^5.1.1",
|
||||
"ts-node": "~8.4.1",
|
||||
"tslint": "~5.20.0",
|
||||
"typescript": "3.5.3"
|
||||
}
|
||||
}
|
||||
|
@ -1,55 +1,57 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
/**
|
||||
* Created by stefania on 7/17/17.
|
||||
*/
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Http, Response } from '@angular/http';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { Observable, throwError as observableThrowError } from 'rxjs';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { PageHelpContent } from '../../model/help-content/page-help-content';
|
||||
import { CachedContentItem } from './cached-content-item';
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class HelpContentService {
|
||||
private _helpServiceUrl = environment.HelpService.Url;
|
||||
cache = new Map<String, CachedContentItem>();
|
||||
|
||||
constructor(private http: Http) {
|
||||
constructor(private http: HttpClient) {
|
||||
}
|
||||
|
||||
getActivePageContent(route: string) {
|
||||
if (!this.cache.get(route) || !this.isValidCachedItem(route)) {
|
||||
return this.http.get(this._helpServiceUrl + '/page/route?q=' + route)
|
||||
.map(res => {
|
||||
this.cache.set(route, { timestamp: Date.now(), content: <PageHelpContent>res.json() });
|
||||
return res.json();
|
||||
})
|
||||
.catch(this.handleError);
|
||||
}
|
||||
return Observable.create(observer => observer.next(this.cache.get(route).content));
|
||||
}
|
||||
private extractData(res: Response) {
|
||||
const body = res.json();
|
||||
return body.data || {};
|
||||
}
|
||||
private handleError(error: Response | any) {
|
||||
// In a real world app, we might use a remote logging infrastructure
|
||||
// We'd also dig deeper into the error to get a better message
|
||||
let errMsg = '';
|
||||
if (error instanceof Response) {
|
||||
const body = error.text() || '';
|
||||
//const err = body.error || JSON.stringify(body);
|
||||
errMsg = `${error.status} - ${error.statusText || ''} ${body}`;
|
||||
} else {
|
||||
errMsg = (error.message) ? error.message :
|
||||
error.status ? `${error.status} - ${error.statusText}` : 'Server error';
|
||||
console.error(errMsg); // log to console instead
|
||||
}
|
||||
return Observable.throw(errMsg);
|
||||
}
|
||||
// getActivePageContent(route: string) {
|
||||
// if (!this.cache.get(route) || !this.isValidCachedItem(route)) {
|
||||
// return this.http.get(this._helpServiceUrl + '/page/route?q=' + route).pipe(
|
||||
// map((res: Response) => {
|
||||
// this.cache.set(route, { timestamp: Date.now(), content: res.json() as PageHelpContent });
|
||||
// return res.json();
|
||||
// }),
|
||||
// catchError(this.handleError));
|
||||
// }
|
||||
// return Observable.create(observer => observer.next(this.cache.get(route).content));
|
||||
// }
|
||||
// private extractData(res: Response) {
|
||||
// const body = res.json();
|
||||
// return body. || {};
|
||||
// }
|
||||
// private handleError(error: Response | any) {
|
||||
// // In a real world app, we might use a remote logging infrastructure
|
||||
// // We'd also dig deeper into the error to get a better message
|
||||
// let errMsg = '';
|
||||
// if (error instanceof Response) {
|
||||
// const body = error.text() || '';
|
||||
// //const err = body.error || JSON.stringify(body);
|
||||
// errMsg = `${error.status} - ${error.statusText || ''} ${body}`;
|
||||
// } else {
|
||||
// errMsg = (error.message) ? error.message :
|
||||
// error.status ? `${error.status} - ${error.statusText}` : 'Server error';
|
||||
// console.error(errMsg); // log to console instead
|
||||
// }
|
||||
// return observableThrowError(errMsg);
|
||||
// }
|
||||
|
||||
isValidCachedItem(route) {
|
||||
const cachedTimestamp = this.cache.get(route).timestamp;
|
||||
const currentTimestamp = Date.now();
|
||||
if (currentTimestamp - cachedTimestamp > 30000) { return false; } else { return true; }
|
||||
}
|
||||
// isValidCachedItem(route) {
|
||||
// const cachedTimestamp = this.cache.get(route).timestamp;
|
||||
// const currentTimestamp = Date.now();
|
||||
// if (currentTimestamp - cachedTimestamp > 30000) { return false; } else { return true; }
|
||||
// }
|
||||
}
|
||||
|
Loading…
Reference in New Issue