Upgrade packages
This commit is contained in:
parent
fc9c9ff65a
commit
36ba0618ab
@ -1,58 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
||||||
"project": {
|
|
||||||
"name": "WebSPA"
|
|
||||||
},
|
|
||||||
"apps": [
|
|
||||||
{
|
|
||||||
"root": "Client",
|
|
||||||
"outDir": "wwwroot",
|
|
||||||
"assets": [
|
|
||||||
"assets",
|
|
||||||
"favicon.ico"
|
|
||||||
],
|
|
||||||
"index": "index.html",
|
|
||||||
"main": "main.ts",
|
|
||||||
"polyfills": "polyfills.ts",
|
|
||||||
"test": "test.ts",
|
|
||||||
"tsconfig": "tsconfig.app.json",
|
|
||||||
"testTsconfig": "tsconfig.spec.json",
|
|
||||||
"prefix": "app",
|
|
||||||
"styles": [
|
|
||||||
"globals.scss",
|
|
||||||
"../node_modules/bootstrap/scss/bootstrap.scss"
|
|
||||||
],
|
|
||||||
"scripts": [],
|
|
||||||
"environmentSource": "environments/environment.ts",
|
|
||||||
"environments": {
|
|
||||||
"dev": "environments/environment.ts",
|
|
||||||
"prod": "environments/environment.prod.ts"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"e2e": {
|
|
||||||
"protractor": {
|
|
||||||
"config": "./protractor.conf.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lint": [
|
|
||||||
{
|
|
||||||
"project": "Client/tsconfig.app.json"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"project": "Client/tsconfig.spec.json"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"project": "e2e/tsconfig.e2e.json"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"test": {
|
|
||||||
"karma": {
|
|
||||||
"config": "./karma.conf.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaults": {
|
|
||||||
"styleExt": "scss",
|
|
||||||
"component": {}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
import { Title } from '@angular/platform-browser';
|
import { Title } from '@angular/platform-browser';
|
||||||
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import { DataService } from './shared/services/data.service';
|
import { DataService } from './shared/services/data.service';
|
||||||
import { SecurityService } from './shared/services/security.service';
|
import { SecurityService } from './shared/services/security.service';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import { BasketService } from '../basket.service';
|
import { BasketService } from '../basket.service';
|
||||||
import { BasketWrapperService } from '../../shared/services/basket.wrapper.service';
|
import { BasketWrapperService } from '../../shared/services/basket.wrapper.service';
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import 'rxjs/Rx';
|
import { Observable } from 'rxjs';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import 'rxjs/add/observable/throw';
|
|
||||||
|
|
||||||
import { BasketService } from './basket.service';
|
import { BasketService } from './basket.service';
|
||||||
import { IBasket } from '../shared/models/basket.model';
|
import { IBasket } from '../shared/models/basket.model';
|
||||||
@ -52,9 +51,11 @@ export class BasketComponent implements OnInit {
|
|||||||
x => {
|
x => {
|
||||||
this.errorMessages = [];
|
this.errorMessages = [];
|
||||||
this.basketwrapper.basket = this.basket;
|
this.basketwrapper.basket = this.basket;
|
||||||
this.router.navigate(['order'],
|
this.router.navigate(['order'])
|
||||||
errMessage => this.errorMessages = errMessage.messages);
|
},
|
||||||
});
|
errMessage => this.errorMessages = errMessage.messages
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private calculateTotalPrice() {
|
private calculateTotalPrice() {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import {map} from 'rxjs/operators';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpResponse, HttpHeaders } from '@angular/common/http';
|
import { HttpResponse, HttpHeaders } from '@angular/common/http';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
@ -11,14 +12,7 @@ import { IBasketItem } from '../shared/models/basketItem.model';
|
|||||||
import { BasketWrapperService } from '../shared/services/basket.wrapper.service';
|
import { BasketWrapperService } from '../shared/services/basket.wrapper.service';
|
||||||
import { ConfigurationService } from '../shared/services/configuration.service';
|
import { ConfigurationService } from '../shared/services/configuration.service';
|
||||||
import { StorageService } from '../shared/services/storage.service';
|
import { StorageService } from '../shared/services/storage.service';
|
||||||
|
import { Observable, Observer, Subject } from 'rxjs';
|
||||||
import 'rxjs/Rx';
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import 'rxjs/add/observable/throw';
|
|
||||||
import { Observer } from 'rxjs/Observer';
|
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
import 'rxjs/add/operator/catch';
|
|
||||||
import { Subject } from 'rxjs/Subject';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BasketService {
|
export class BasketService {
|
||||||
@ -68,28 +62,28 @@ export class BasketService {
|
|||||||
setBasket(basket): Observable<boolean> {
|
setBasket(basket): Observable<boolean> {
|
||||||
let url = this.purchaseUrl + '/api/v1/basket/';
|
let url = this.purchaseUrl + '/api/v1/basket/';
|
||||||
this.basket = basket;
|
this.basket = basket;
|
||||||
return this.service.post<Object>(url, basket).map((response: HttpResponse<Object>) => {
|
return this.service.post<Object>(url, basket).pipe(map((response: HttpResponse<Object>) => {
|
||||||
return true;
|
return true;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
setBasketCheckout(basketCheckout): Observable<boolean> {
|
setBasketCheckout(basketCheckout): Observable<boolean> {
|
||||||
let url = this.basketUrl + '/api/v1/b/basket/checkout';
|
let url = this.basketUrl + '/api/v1/b/basket/checkout';
|
||||||
return this.service.postWithId<Object>(url, basketCheckout).map((response: HttpResponse<Object>) => {
|
return this.service.postWithId<Object>(url, basketCheckout).pipe(map((response: HttpResponse<Object>) => {
|
||||||
this.basketEvents.orderCreated();
|
this.basketEvents.orderCreated();
|
||||||
return true;
|
return true;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
getBasket(): Observable<IBasket> {
|
getBasket(): Observable<IBasket> {
|
||||||
let url = this.basketUrl + '/api/v1/b/basket/' + this.basket.buyerId;
|
let url = this.basketUrl + '/api/v1/b/basket/' + this.basket.buyerId;
|
||||||
return this.service.get<IBasket>(url).map((response: HttpResponse<IBasket>) => {
|
return this.service.get<IBasket>(url).pipe(map((response: HttpResponse<IBasket>) => {
|
||||||
if (response.status === 204) {
|
if (response.status === 204) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return response.body;
|
return response.body;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
mapBasketInfoCheckout(order: IOrder): IBasketCheckout {
|
mapBasketInfoCheckout(order: IOrder): IBasketCheckout {
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
|
||||||
|
import {throwError as observableThrowError, Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import {catchError} from 'rxjs/operators';
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { CampaignsService } from './campaigns.service';
|
import { CampaignsService } from './campaigns.service';
|
||||||
import { ICampaign } from '../shared/models/campaign.model';
|
import { ICampaign } from '../shared/models/campaign.model';
|
||||||
import { IPager } from '../shared/models/pager.model';
|
import { IPager } from '../shared/models/pager.model';
|
||||||
import { ConfigurationService } from '../shared/services/configuration.service';
|
import { ConfigurationService } from '../shared/services/configuration.service';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'esh-campaigns',
|
selector: 'esh-campaigns',
|
||||||
@ -40,8 +43,8 @@ export class CampaignsComponent implements OnInit {
|
|||||||
|
|
||||||
getCampaigns(pageSize: number, pageIndex: number) {
|
getCampaigns(pageSize: number, pageIndex: number) {
|
||||||
this.errorReceived = false;
|
this.errorReceived = false;
|
||||||
this.service.getCampaigns(pageIndex, pageSize)
|
this.service.getCampaigns(pageIndex, pageSize).pipe(
|
||||||
.catch((err) => this.handleError(err))
|
catchError((err) => this.handleError(err)))
|
||||||
.subscribe(campaigns => {
|
.subscribe(campaigns => {
|
||||||
this.campaigns = campaigns;
|
this.campaigns = campaigns;
|
||||||
this.paginationInfo = {
|
this.paginationInfo = {
|
||||||
@ -60,7 +63,7 @@ export class CampaignsComponent implements OnInit {
|
|||||||
|
|
||||||
private handleError(error: any) {
|
private handleError(error: any) {
|
||||||
this.errorReceived = true;
|
this.errorReceived = true;
|
||||||
return Observable.throw(error);
|
return observableThrowError(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
|
import {map} from 'rxjs/operators';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpResponse } from '@angular/common/http';
|
import { HttpResponse } from '@angular/common/http';
|
||||||
|
|
||||||
import { DataService } from '../shared/services/data.service';
|
import { DataService } from '../shared/services/data.service';
|
||||||
@ -7,11 +9,8 @@ import { ICampaignItem } from '../shared/models/campaignItem.model';
|
|||||||
import { SecurityService } from '../shared/services/security.service';
|
import { SecurityService } from '../shared/services/security.service';
|
||||||
import { ConfigurationService } from '../shared/services/configuration.service';
|
import { ConfigurationService } from '../shared/services/configuration.service';
|
||||||
|
|
||||||
import 'rxjs/Rx';
|
import { Observable , Observer } from 'rxjs';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import 'rxjs/add/observable/throw';
|
|
||||||
import { Observer } from 'rxjs/Observer';
|
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -36,17 +35,17 @@ export class CampaignsService {
|
|||||||
let url = this.marketingUrl + '/api/v1/m/campaigns/user';
|
let url = this.marketingUrl + '/api/v1/m/campaigns/user';
|
||||||
url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize;
|
url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize;
|
||||||
|
|
||||||
return this.service.get<ICampaign>(url).map((response: HttpResponse<ICampaign>) => {
|
return this.service.get<ICampaign>(url).pipe(map((response: HttpResponse<ICampaign>) => {
|
||||||
return response.body;
|
return response.body;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
getCampaign(id: number): Observable<ICampaignItem> {
|
getCampaign(id: number): Observable<ICampaignItem> {
|
||||||
let url = this.marketingUrl + '/api/v1/m/campaigns/' + id;
|
let url = this.marketingUrl + '/api/v1/m/campaigns/' + id;
|
||||||
|
|
||||||
return this.service.get<ICampaignItem>(url).map((response: HttpResponse<ICampaignItem>) => {
|
return this.service.get<ICampaignItem>(url).pipe(map((response: HttpResponse<ICampaignItem>) => {
|
||||||
return response.body;
|
return response.body;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
|
|
||||||
|
import {throwError as observableThrowError, Subscription , Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import {catchError} from 'rxjs/operators';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
|
||||||
|
|
||||||
import { CatalogService } from './catalog.service';
|
import { CatalogService } from './catalog.service';
|
||||||
import { ConfigurationService } from '../shared/services/configuration.service';
|
import { ConfigurationService } from '../shared/services/configuration.service';
|
||||||
@ -10,7 +13,6 @@ import { ICatalogBrand } from '../shared/models/catalogBrand.model';
|
|||||||
import { IPager } from '../shared/models/pager.model';
|
import { IPager } from '../shared/models/pager.model';
|
||||||
import { BasketWrapperService} from '../shared/services/basket.wrapper.service';
|
import { BasketWrapperService} from '../shared/services/basket.wrapper.service';
|
||||||
import { SecurityService } from '../shared/services/security.service';
|
import { SecurityService } from '../shared/services/security.service';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'esh-catalog .esh-catalog',
|
selector: 'esh-catalog .esh-catalog',
|
||||||
@ -82,8 +84,8 @@ export class CatalogComponent implements OnInit {
|
|||||||
|
|
||||||
getCatalog(pageSize: number, pageIndex: number, brand?: number, type?: number) {
|
getCatalog(pageSize: number, pageIndex: number, brand?: number, type?: number) {
|
||||||
this.errorReceived = false;
|
this.errorReceived = false;
|
||||||
this.service.getCatalog(pageIndex, pageSize, brand, type)
|
this.service.getCatalog(pageIndex, pageSize, brand, type).pipe(
|
||||||
.catch((err) => this.handleError(err))
|
catchError((err) => this.handleError(err)))
|
||||||
.subscribe(catalog => {
|
.subscribe(catalog => {
|
||||||
this.catalog = catalog;
|
this.catalog = catalog;
|
||||||
this.paginationInfo = {
|
this.paginationInfo = {
|
||||||
@ -114,7 +116,7 @@ export class CatalogComponent implements OnInit {
|
|||||||
|
|
||||||
private handleError(error: any) {
|
private handleError(error: any) {
|
||||||
this.errorReceived = true;
|
this.errorReceived = true;
|
||||||
return Observable.throw(error);
|
return observableThrowError(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
|
||||||
|
import {map} from 'rxjs/operators';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpResponse } from '@angular/common/http';
|
import { HttpResponse } from '@angular/common/http';
|
||||||
|
|
||||||
@ -7,11 +9,8 @@ import { ICatalog } from '../shared/models/catalog.model';
|
|||||||
import { ICatalogBrand } from '../shared/models/catalogBrand.model';
|
import { ICatalogBrand } from '../shared/models/catalogBrand.model';
|
||||||
import { ICatalogType } from '../shared/models/catalogType.model';
|
import { ICatalogType } from '../shared/models/catalogType.model';
|
||||||
|
|
||||||
import 'rxjs/Rx';
|
import { Observable , Observer } from 'rxjs';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import 'rxjs/add/observable/throw';
|
|
||||||
import { Observer } from 'rxjs/Observer';
|
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CatalogService {
|
export class CatalogService {
|
||||||
@ -35,20 +34,20 @@ export class CatalogService {
|
|||||||
|
|
||||||
url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize;
|
url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize;
|
||||||
|
|
||||||
return this.service.get<ICatalog>(url).map((response: HttpResponse<ICatalog>) => {
|
return this.service.get<ICatalog>(url).pipe(map((response: HttpResponse<ICatalog>) => {
|
||||||
return response.body;
|
return response.body;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
getBrands(): Observable<ICatalogBrand[]> {
|
getBrands(): Observable<ICatalogBrand[]> {
|
||||||
return this.service.get<ICatalogBrand[]>(this.brandUrl).map((response: HttpResponse<ICatalogBrand[]>) => {
|
return this.service.get<ICatalogBrand[]>(this.brandUrl).pipe(map((response: HttpResponse<ICatalogBrand[]>) => {
|
||||||
return response.body;
|
return response.body;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
getTypes(): Observable<ICatalogType[]> {
|
getTypes(): Observable<ICatalogType[]> {
|
||||||
return this.service.get<ICatalogType[]>(this.typesUrl).map((response: HttpResponse<ICatalogType[]>) => {
|
return this.service.get<ICatalogType[]>(this.typesUrl).pipe(map((response: HttpResponse<ICatalogType[]>) => {
|
||||||
return response.body;
|
return response.body;
|
||||||
});
|
}));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
|
|
||||||
|
import {throwError as observableThrowError, Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import {catchError} from 'rxjs/operators';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import { OrdersService } from '../orders.service';
|
import { OrdersService } from '../orders.service';
|
||||||
import { BasketService } from '../../basket/basket.service';
|
import { BasketService } from '../../basket/basket.service';
|
||||||
import { IOrder } from '../../shared/models/order.model';
|
import { IOrder } from '../../shared/models/order.model';
|
||||||
@ -48,12 +51,12 @@ export class OrdersNewComponent implements OnInit {
|
|||||||
this.order.cardexpiration = new Date(20 + this.newOrderForm.controls['expirationdate'].value.split('/')[1], this.newOrderForm.controls['expirationdate'].value.split('/')[0]);
|
this.order.cardexpiration = new Date(20 + this.newOrderForm.controls['expirationdate'].value.split('/')[1], this.newOrderForm.controls['expirationdate'].value.split('/')[0]);
|
||||||
this.order.cardsecuritynumber = this.newOrderForm.controls['securitycode'].value;
|
this.order.cardsecuritynumber = this.newOrderForm.controls['securitycode'].value;
|
||||||
let basketCheckout = this.basketService.mapBasketInfoCheckout(this.order);
|
let basketCheckout = this.basketService.mapBasketInfoCheckout(this.order);
|
||||||
this.basketService.setBasketCheckout(basketCheckout)
|
this.basketService.setBasketCheckout(basketCheckout).pipe(
|
||||||
.catch((errMessage) => {
|
catchError((errMessage) => {
|
||||||
this.errorReceived = true;
|
this.errorReceived = true;
|
||||||
this.isOrderProcessing = false;
|
this.isOrderProcessing = false;
|
||||||
return Observable.throw(errMessage);
|
return observableThrowError(errMessage);
|
||||||
})
|
}))
|
||||||
.subscribe(res => {
|
.subscribe(res => {
|
||||||
this.router.navigate(['orders']);
|
this.router.navigate(['orders']);
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
|
|
||||||
|
import {throwError as observableThrowError, Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import {catchError} from 'rxjs/operators';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { OrdersService } from './orders.service';
|
import { OrdersService } from './orders.service';
|
||||||
import { IOrder } from '../shared/models/order.model';
|
import { IOrder } from '../shared/models/order.model';
|
||||||
import { ConfigurationService } from '../shared/services/configuration.service';
|
import { ConfigurationService } from '../shared/services/configuration.service';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'esh-orders',
|
selector: 'esh-orders',
|
||||||
@ -40,8 +43,8 @@ export class OrdersComponent implements OnInit {
|
|||||||
|
|
||||||
getOrders() {
|
getOrders() {
|
||||||
this.errorReceived = false;
|
this.errorReceived = false;
|
||||||
this.service.getOrders()
|
this.service.getOrders().pipe(
|
||||||
.catch((err) => this.handleError(err))
|
catchError((err) => this.handleError(err)))
|
||||||
.subscribe(orders => {
|
.subscribe(orders => {
|
||||||
this.orders = orders;
|
this.orders = orders;
|
||||||
this.oldOrders = this.orders;
|
this.oldOrders = this.orders;
|
||||||
@ -51,7 +54,7 @@ export class OrdersComponent implements OnInit {
|
|||||||
|
|
||||||
private handleError(error: any) {
|
private handleError(error: any) {
|
||||||
this.errorReceived = true;
|
this.errorReceived = true;
|
||||||
return Observable.throw(error);
|
return observableThrowError(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
|
||||||
|
import {map} from 'rxjs/operators';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpResponse } from '@angular/common/http';
|
import { HttpResponse } from '@angular/common/http';
|
||||||
|
|
||||||
@ -9,11 +11,8 @@ import { SecurityService } from '../shared/services/security.service';
|
|||||||
import { ConfigurationService } from '../shared/services/configuration.service';
|
import { ConfigurationService } from '../shared/services/configuration.service';
|
||||||
import { BasketWrapperService } from '../shared/services/basket.wrapper.service';
|
import { BasketWrapperService } from '../shared/services/basket.wrapper.service';
|
||||||
|
|
||||||
import 'rxjs/Rx';
|
import { Observable , Observer } from 'rxjs';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import 'rxjs/add/observable/throw';
|
|
||||||
import { Observer } from 'rxjs/Observer';
|
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -31,17 +30,17 @@ export class OrdersService {
|
|||||||
getOrders(): Observable<IOrder[]> {
|
getOrders(): Observable<IOrder[]> {
|
||||||
let url = this.ordersUrl + '/api/v1/o/orders';
|
let url = this.ordersUrl + '/api/v1/o/orders';
|
||||||
|
|
||||||
return this.service.get<IOrder[]>(url).map((response: HttpResponse<IOrder[]>) => {
|
return this.service.get<IOrder[]>(url).pipe(map((response: HttpResponse<IOrder[]>) => {
|
||||||
return response.body;
|
return response.body;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
getOrder(id: number): Observable<IOrderDetail> {
|
getOrder(id: number): Observable<IOrderDetail> {
|
||||||
let url = this.ordersUrl + '/api/v1/o/orders/' + id;
|
let url = this.ordersUrl + '/api/v1/o/orders/' + id;
|
||||||
|
|
||||||
return this.service.get<IOrderDetail>(url).map((response: HttpResponse<IOrderDetail>) => {
|
return this.service.get<IOrderDetail>(url).pipe(map((response: HttpResponse<IOrderDetail>) => {
|
||||||
return response.body;
|
return response.body;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
mapOrderAndIdentityInfoNewOrder(): IOrder {
|
mapOrderAndIdentityInfoNewOrder(): IOrder {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit, OnChanges, Output, Input, EventEmitter } from '@angular/core';
|
import { Component, OnInit, OnChanges, Output, Input, EventEmitter } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import { IIdentity } from '../../models/identity.model';
|
import { IIdentity } from '../../models/identity.model';
|
||||||
import { SecurityService } from '../../services/security.service';
|
import { SecurityService } from '../../services/security.service';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Subject } from 'rxjs/Subject';
|
import { Subject } from 'rxjs';
|
||||||
|
|
||||||
import { ICatalogItem } from '../models/catalogItem.model';
|
import { ICatalogItem } from '../models/catalogItem.model';
|
||||||
import { IBasketItem } from '../models/basketItem.model';
|
import { IBasketItem } from '../models/basketItem.model';
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient, HttpResponse, HttpHeaders } from '@angular/common/http';
|
import { HttpClient, HttpResponse, HttpHeaders } from '@angular/common/http';
|
||||||
import { IConfiguration } from '../models/configuration.model';
|
import { IConfiguration } from '../models/configuration.model';
|
||||||
import { StorageService } from './storage.service';
|
import { StorageService } from './storage.service';
|
||||||
|
|
||||||
import 'rxjs/Rx';
|
import { Observable , Observer , Subject } from 'rxjs';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import 'rxjs/add/observable/throw';
|
|
||||||
import { Observer } from 'rxjs/Observer';
|
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
import { Subject } from 'rxjs/Subject';
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { HttpClient, HttpHeaders, HttpResponse, HttpErrorResponse } from '@angular/common/http';
|
|
||||||
|
|
||||||
import 'rxjs/Rx';
|
import {throwError as observableThrowError, Observable , Observer } from 'rxjs';
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import 'rxjs/add/observable/throw';
|
import {map, catchError} from 'rxjs/operators';
|
||||||
import { Observer } from 'rxjs/Observer';
|
import { Injectable } from '@angular/core';
|
||||||
import 'rxjs/add/operator/map';
|
import { HttpClient, HttpHeaders, HttpResponse, HttpErrorResponse } from '@angular/common/http';
|
||||||
import 'rxjs/add/operator/catch';
|
|
||||||
|
|
||||||
import { SecurityService } from './security.service';
|
import { SecurityService } from './security.service';
|
||||||
import { Guid } from '../../../guid';
|
import { Guid } from '../../../guid';
|
||||||
@ -24,8 +21,8 @@ export class DataService {
|
|||||||
headers = headers.set('Authorization', 'Bearer ' + this.securityService.GetToken());
|
headers = headers.set('Authorization', 'Bearer ' + this.securityService.GetToken());
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.http.get(url, {headers: headers, observe: "response"}).map(
|
return this.http.get(url, {headers: headers, observe: "response"}).pipe(map(
|
||||||
(res: HttpResponse<T>) => res).catch(this.handleError);
|
(res: HttpResponse<T>) => res),catchError(this.handleError),);
|
||||||
}
|
}
|
||||||
|
|
||||||
postWithId<T>(url: string, data: any, params?: any): Observable<HttpResponse<T>> {
|
postWithId<T>(url: string, data: any, params?: any): Observable<HttpResponse<T>> {
|
||||||
@ -51,10 +48,10 @@ export class DataService {
|
|||||||
headers = headers.set('x-requestid', guid);
|
headers = headers.set('x-requestid', guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.http.post(url, data, {headers: headers, observe:'response'}).map(
|
return this.http.post(url, data, {headers: headers, observe:'response'}).pipe(map(
|
||||||
(res: HttpResponse<T>) => {
|
(res: HttpResponse<T>) => {
|
||||||
return res;
|
return res;
|
||||||
}).catch(this.handleError);
|
}),catchError(this.handleError),);
|
||||||
}
|
}
|
||||||
|
|
||||||
private doPut<T>(url: string, data: any, needId: boolean, params?: any): Observable<HttpResponse<T>> {
|
private doPut<T>(url: string, data: any, needId: boolean, params?: any): Observable<HttpResponse<T>> {
|
||||||
@ -67,10 +64,10 @@ export class DataService {
|
|||||||
headers = headers.set('x-requestid', guid);
|
headers = headers.set('x-requestid', guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.http.put(url, data, {headers: headers, observe: 'response'}).map(
|
return this.http.put(url, data, {headers: headers, observe: 'response'}).pipe(map(
|
||||||
(res: HttpResponse<T>) => {
|
(res: HttpResponse<T>) => {
|
||||||
return res;
|
return res;
|
||||||
}).catch(this.handleError);
|
}),catchError(this.handleError),);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(url: string, params?: any) {
|
delete(url: string, params?: any) {
|
||||||
@ -99,8 +96,8 @@ export class DataService {
|
|||||||
{
|
{
|
||||||
errMessage = error.status.toString();
|
errMessage = error.status.toString();
|
||||||
}
|
}
|
||||||
return Observable.throw(errMessage);
|
return observableThrowError(errMessage);
|
||||||
}
|
}
|
||||||
return Observable.throw(error || 'server error');
|
return observableThrowError(error || 'server error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
|
import {map} from 'rxjs/operators';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient, HttpResponse, HttpHeaders } from '@angular/common/http';
|
import { HttpClient, HttpResponse, HttpHeaders } from '@angular/common/http';
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable , Subject } from 'rxjs';
|
||||||
import { Subject } from 'rxjs/Subject';
|
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { ConfigurationService } from './configuration.service';
|
import { ConfigurationService } from './configuration.service';
|
||||||
@ -226,7 +227,7 @@ export class SecurityService {
|
|||||||
|
|
||||||
return this._http.get<string[]>(this.authorityUrl + '/connect/userinfo', {
|
return this._http.get<string[]>(this.authorityUrl + '/connect/userinfo', {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
}).map(res => res);
|
}).pipe(map(res => res));
|
||||||
}
|
}
|
||||||
|
|
||||||
private setHeaders() {
|
private setHeaders() {
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"test.ts"
|
"test.ts",
|
||||||
|
"polyfills.ts"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
|
130
src/Web/WebSPA/angular.json
Normal file
130
src/Web/WebSPA/angular.json
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"WebSPA": {
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "Client",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "wwwroot",
|
||||||
|
"index": "Client/index.html",
|
||||||
|
"main": "Client/main.ts",
|
||||||
|
"tsConfig": "Client/tsconfig.app.json",
|
||||||
|
"polyfills": "Client/polyfills.ts",
|
||||||
|
"assets": [
|
||||||
|
"Client/assets/images",
|
||||||
|
"Client/favicon.ico"
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"./Client/globals.scss",
|
||||||
|
"./node_modules/bootstrap/scss/bootstrap.scss"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"extractCss": true,
|
||||||
|
"namedChunks": false,
|
||||||
|
"aot": true,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "Client/environments/environment.ts",
|
||||||
|
"with": "Client/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "WebSPA:build"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"browserTarget": "WebSPA:build:production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "WebSPA:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"main": "Client/test.ts",
|
||||||
|
"karmaConfig": "./karma.conf.js",
|
||||||
|
"polyfills": "Client/polyfills.ts",
|
||||||
|
"tsConfig": "Client/tsconfig.spec.json",
|
||||||
|
"scripts": [],
|
||||||
|
"styles": [
|
||||||
|
"Client/globals.scss",
|
||||||
|
"node_modules/bootstrap/scss/bootstrap.scss"
|
||||||
|
],
|
||||||
|
"assets": [
|
||||||
|
"Client/assets",
|
||||||
|
"Client/favicon.ico"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"Client/tsconfig.app.json",
|
||||||
|
"Client/tsconfig.spec.json"
|
||||||
|
],
|
||||||
|
"exclude": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"WebSPA-e2e": {
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"e2e": {
|
||||||
|
"builder": "@angular-devkit/build-angular:protractor",
|
||||||
|
"options": {
|
||||||
|
"protractorConfig": "./protractor.conf.js",
|
||||||
|
"devServerTarget": "WebSPA:serve"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"e2e/tsconfig.e2e.json"
|
||||||
|
],
|
||||||
|
"exclude": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultProject": "WebSPA",
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"prefix": "app",
|
||||||
|
"styleext": "scss"
|
||||||
|
},
|
||||||
|
"@schematics/angular:directive": {
|
||||||
|
"prefix": "app"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
10537
src/Web/WebSPA/package-lock.json
generated
10537
src/Web/WebSPA/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -26,41 +26,42 @@
|
|||||||
"lint:ts": "tslint -c tslint.json Client/**/*.ts"
|
"lint:ts": "tslint -c tslint.json Client/**/*.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "^4.0.0",
|
"@angular/common": "^6.0.1",
|
||||||
"@angular/compiler": "^4.0.0",
|
"@angular/compiler": "^6.0.1",
|
||||||
"@angular/core": "^4.0.0",
|
"@angular/core": "^6.0.1",
|
||||||
"@angular/forms": "^4.0.0",
|
"@angular/forms": "^6.0.1",
|
||||||
"@angular/http": "^4.0.0",
|
"@angular/http": "^6.0.1",
|
||||||
"@angular/platform-browser": "^4.0.0",
|
"@angular/platform-browser": "^6.0.1",
|
||||||
"@angular/platform-browser-dynamic": "^4.0.0",
|
"@angular/platform-browser-dynamic": "^6.0.1",
|
||||||
"@angular/router": "^4.0.0",
|
"@angular/router": "^6.0.1",
|
||||||
"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.22",
|
"@ng-bootstrap/ng-bootstrap": "^2.0.0",
|
||||||
"bootstrap": "4.0.0-alpha.5",
|
"bootstrap": "^4.1.1",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
"file-loader": "0.9.0",
|
"file-loader": "0.9.0",
|
||||||
"font-awesome": "4.6.3",
|
"font-awesome": "4.6.3",
|
||||||
"isomorphic-fetch": "2.2.1",
|
"isomorphic-fetch": "2.2.1",
|
||||||
"normalize.css": "5.0.0",
|
"normalize.css": "5.0.0",
|
||||||
"preboot": "4.5.2",
|
"preboot": "4.5.2",
|
||||||
"rxjs": "^5.1.0",
|
"rxjs": "^6.1.0",
|
||||||
"zone.js": "^0.8.4"
|
"zone.js": "^0.8.26"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/cli": "^1.3.0",
|
"@angular-devkit/build-angular": "~0.6.1",
|
||||||
"@angular/compiler-cli": "^4.0.0",
|
"@angular/cli": "^6.0.1",
|
||||||
|
"@angular/compiler-cli": "^6.0.1",
|
||||||
"@types/core-js": "0.9.34",
|
"@types/core-js": "0.9.34",
|
||||||
"@types/hammerjs": "2.0.33",
|
"@types/hammerjs": "2.0.33",
|
||||||
"@types/jasmine": "2.5.38",
|
"@types/jasmine": "2.5.38",
|
||||||
"@types/node": "~6.0.60",
|
"@types/node": "~6.0.60",
|
||||||
"@types/protractor": "1.5.20",
|
"@types/protractor": "1.5.20",
|
||||||
"@types/selenium-webdriver": "2.44.26",
|
"@types/selenium-webdriver": "2.44.26",
|
||||||
"codelyzer": "~2.0.0",
|
"codelyzer": "^4.3.0",
|
||||||
"sass-lint": "1.10.2",
|
"sass-lint": "1.10.2",
|
||||||
"ts-helpers": "1.1.1",
|
"ts-helpers": "1.1.1",
|
||||||
"ts-node": "~2.0.0",
|
"ts-node": "~2.0.0",
|
||||||
"tslint": "~4.5.0",
|
"tslint": "~4.5.0",
|
||||||
"typedoc": "0.5.0",
|
"typedoc": "0.5.0",
|
||||||
"typescript": "~2.2.0",
|
"typescript": "^2.7.2",
|
||||||
"url-loader": "0.5.7"
|
"url-loader": "0.5.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user