Browse Source

Merge pull request #1227 from dotnet-architecture/fix/1224

Fix npm & docker build warnings #1224
pull/1230/head
Miguel Veloso 5 years ago
committed by GitHub
parent
commit
98f5786b2b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 7540 additions and 6013 deletions
  1. +2
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
  2. +2
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
  3. +2
    -0
      src/Services/Basket/Basket.API/Dockerfile
  4. +2
    -0
      src/Services/Catalog/Catalog.API/Dockerfile
  5. +2
    -0
      src/Services/Identity/Identity.API/Dockerfile
  6. +2
    -0
      src/Services/Location/Locations.API/Dockerfile
  7. +2
    -0
      src/Services/Marketing/Marketing.API/Dockerfile
  8. +2
    -0
      src/Services/Ordering/Ordering.API/Dockerfile
  9. +2
    -0
      src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile
  10. +2
    -0
      src/Services/Ordering/Ordering.SignalrHub/Dockerfile
  11. +2
    -0
      src/Services/Payment/Payment.API/Dockerfile
  12. +2
    -0
      src/Services/Webhooks/Webhooks.API/Dockerfile
  13. +2
    -0
      src/Web/WebMVC/Dockerfile
  14. +10
    -7
      src/Web/WebSPA/Client/modules/basket/basket.service.ts
  15. +3
    -4
      src/Web/WebSPA/Client/modules/campaigns/campaigns.service.ts
  16. +10
    -20
      src/Web/WebSPA/Client/modules/catalog/catalog.service.ts
  17. +3
    -4
      src/Web/WebSPA/Client/modules/orders/orders.service.ts
  18. +6
    -6
      src/Web/WebSPA/Client/modules/shared/services/data.service.ts
  19. +26
    -20
      src/Web/WebSPA/Client/modules/shared/services/security.service.ts
  20. +4
    -4
      src/Web/WebSPA/Client/modules/shared/shared.module.ts
  21. +2
    -2
      src/Web/WebSPA/Client/polyfills.ts
  22. +4
    -3
      src/Web/WebSPA/Dockerfile
  23. +7413
    -5918
      src/Web/WebSPA/package-lock.json
  24. +25
    -24
      src/Web/WebSPA/package.json
  25. +2
    -0
      src/Web/WebStatus/Dockerfile
  26. +2
    -0
      src/Web/WebhookClient/Dockerfile
  27. +1
    -1
      src/docker-compose.yml
  28. +3
    -0
      src/package-lock.json

+ 2
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Services/Basket/Basket.API/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Services/Catalog/Catalog.API/Dockerfile View File

@ -6,6 +6,8 @@ EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Services/Identity/Identity.API/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Services/Location/Locations.API/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Services/Marketing/Marketing.API/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Services/Ordering/Ordering.API/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Services/Ordering/Ordering.SignalrHub/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Services/Payment/Payment.API/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Services/Webhooks/Webhooks.API/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Web/WebMVC/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 10
- 7
src/Web/WebSPA/Client/modules/basket/basket.service.ts View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Response } from '@angular/http';
import { HttpResponse } from '@angular/common/http';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { DataService } from '../shared/services/data.service'; import { DataService } from '../shared/services/data.service';
@ -12,7 +12,7 @@ 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 { Observable, Observer, Subject } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
import { map, catchError, tap } from 'rxjs/operators';
@Injectable() @Injectable()
export class BasketService { export class BasketService {
@ -61,15 +61,16 @@ 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(url, basket).pipe(map((response: any) => {
return true;
}));
return this.service.post(url, basket).pipe<boolean>(tap((response: any) => true));
} }
setBasketCheckout(basketCheckout): Observable<boolean> { setBasketCheckout(basketCheckout): Observable<boolean> {
let url = this.basketUrl + '/b/api/v1/basket/checkout'; let url = this.basketUrl + '/b/api/v1/basket/checkout';
return this.service.postWithId(url, basketCheckout).pipe(map((response: any) => {
return this.service.postWithId(url, basketCheckout).pipe<boolean>(tap((response: any) => {
this.basketEvents.orderCreated(); this.basketEvents.orderCreated();
return true; return true;
})); }));
@ -77,10 +78,12 @@ export class BasketService {
getBasket(): Observable<IBasket> { getBasket(): Observable<IBasket> {
let url = this.basketUrl + '/b/api/v1/basket/' + this.basket.buyerId; let url = this.basketUrl + '/b/api/v1/basket/' + this.basket.buyerId;
return this.service.get(url).pipe(map((response: any) => {
return this.service.get(url).pipe<IBasket>(tap((response: any) => {
if (response.status === 204) { if (response.status === 204) {
return null; return null;
} }
return response; return response;
})); }));
} }


+ 3
- 4
src/Web/WebSPA/Client/modules/campaigns/campaigns.service.ts View File

@ -1,5 +1,4 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Response } from '@angular/http';
import { DataService } from '../shared/services/data.service'; import { DataService } from '../shared/services/data.service';
import { ICampaign } from '../shared/models/campaign.model'; import { ICampaign } from '../shared/models/campaign.model';
@ -8,7 +7,7 @@ import { SecurityService } from '../shared/services/security.service';
import { ConfigurationService } from '../shared/services/configuration.service'; import { ConfigurationService } from '../shared/services/configuration.service';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { tap } from 'rxjs/operators';
@Injectable() @Injectable()
export class CampaignsService { export class CampaignsService {
@ -32,7 +31,7 @@ export class CampaignsService {
let url = this.marketingUrl + '/m/api/v1/campaigns/user'; let url = this.marketingUrl + '/m/api/v1/campaigns/user';
url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize; url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize;
return this.service.get(url).pipe(map((response: any) => {
return this.service.get(url).pipe<ICampaign>(tap((response: any) => {
return response; return response;
})); }));
} }
@ -40,7 +39,7 @@ export class CampaignsService {
getCampaign(id: number): Observable<ICampaignItem> { getCampaign(id: number): Observable<ICampaignItem> {
let url = this.marketingUrl + '/m/api/v1/campaigns/' + id; let url = this.marketingUrl + '/m/api/v1/campaigns/' + id;
return this.service.get(url).pipe(map((response: any) => {
return this.service.get(url).pipe<ICampaignItem>(tap((response: any) => {
return response; return response;
})); }));
} }


+ 10
- 20
src/Web/WebSPA/Client/modules/catalog/catalog.service.ts View File

@ -1,5 +1,4 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Response } from '@angular/http';
import { DataService } from '../shared/services/data.service'; import { DataService } from '../shared/services/data.service';
import { ConfigurationService } from '../shared/services/configuration.service'; import { ConfigurationService } from '../shared/services/configuration.service';
@ -8,7 +7,7 @@ import { ICatalogBrand } from '../shared/models/catalogBrand.model';
import { ICatalogType } from '../shared/models/catalogType.model'; import { ICatalogType } from '../shared/models/catalogType.model';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
import { tap } from 'rxjs/operators';
@Injectable() @Injectable()
export class CatalogService { export class CatalogService {
@ -36,29 +35,20 @@ export class CatalogService {
url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize; url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize;
return this.service.get(url)
.pipe(
map((response: any) => {
return response;
})
);
return this.service.get(url).pipe<ICatalog>(tap((response: any) => {
return response;
}));
} }
getBrands(): Observable<ICatalogBrand[]> { getBrands(): Observable<ICatalogBrand[]> {
return this.service.get(this.brandUrl)
.pipe(
map((response: any) => {
return response;
})
);
return this.service.get(this.brandUrl).pipe<ICatalogBrand[]>(tap((response: any) => {
return response;
}));
} }
getTypes(): Observable<ICatalogType[]> { getTypes(): Observable<ICatalogType[]> {
return this.service.get(this.typesUrl)
.pipe(
map((response: any) => {
return response;
})
);
return this.service.get(this.typesUrl).pipe<ICatalogType[]>(tap((response: any) => {
return response;
}));
}; };
} }

+ 3
- 4
src/Web/WebSPA/Client/modules/orders/orders.service.ts View File

@ -1,5 +1,4 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Response } from '@angular/http';
import { DataService } from '../shared/services/data.service'; import { DataService } from '../shared/services/data.service';
import { IOrder } from '../shared/models/order.model'; import { IOrder } from '../shared/models/order.model';
@ -10,7 +9,7 @@ import { ConfigurationService } from '../shared/services/configuration.service';
import { BasketWrapperService } from '../shared/services/basket.wrapper.service'; import { BasketWrapperService } from '../shared/services/basket.wrapper.service';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { tap } from 'rxjs/operators';
@Injectable() @Injectable()
export class OrdersService { export class OrdersService {
@ -27,7 +26,7 @@ export class OrdersService {
getOrders(): Observable<IOrder[]> { getOrders(): Observable<IOrder[]> {
let url = this.ordersUrl + '/o/api/v1/orders'; let url = this.ordersUrl + '/o/api/v1/orders';
return this.service.get(url).pipe(map((response: any) => {
return this.service.get(url).pipe<IOrder[]>(tap((response: any) => {
return response; return response;
})); }));
} }
@ -35,7 +34,7 @@ export class OrdersService {
getOrder(id: number): Observable<IOrderDetail> { getOrder(id: number): Observable<IOrderDetail> {
let url = this.ordersUrl + '/o/api/v1/orders/' + id; let url = this.ordersUrl + '/o/api/v1/orders/' + id;
return this.service.get(url).pipe(map((response: any) => {
return this.service.get(url).pipe<IOrderDetail>(tap((response: any) => {
return response; return response;
})); }));
} }


+ 6
- 6
src/Web/WebSPA/Client/modules/shared/services/data.service.ts View File

@ -2,7 +2,7 @@
import { HttpClient, HttpHeaders, HttpErrorResponse } from "@angular/common/http"; import { HttpClient, HttpHeaders, HttpErrorResponse } from "@angular/common/http";
import { Observable, throwError } from 'rxjs'; import { Observable, throwError } from 'rxjs';
import { retry, map, catchError } from 'rxjs/operators';
import { catchError, tap } from 'rxjs/operators';
import { SecurityService } from './security.service'; import { SecurityService } from './security.service';
import { Guid } from '../../../guid'; import { Guid } from '../../../guid';
@ -20,7 +20,7 @@ export class DataService {
return this.http.get(url, options) return this.http.get(url, options)
.pipe( .pipe(
// retry(3), // retry a failed request up to 3 times // retry(3), // retry a failed request up to 3 times
map((res: Response) => {
tap((res: Response) => {
return res; return res;
}), }),
catchError(this.handleError) catchError(this.handleError)
@ -45,7 +45,7 @@ export class DataService {
return this.http.post(url, data, options) return this.http.post(url, data, options)
.pipe( .pipe(
map((res: Response) => {
tap((res: Response) => {
return res; return res;
}), }),
catchError(this.handleError) catchError(this.handleError)
@ -86,7 +86,7 @@ export class DataService {
return this.http.put(url, data, options) return this.http.put(url, data, options)
.pipe( .pipe(
map((res: Response) => {
tap((res: Response) => {
return res; return res;
}), }),
catchError(this.handleError) catchError(this.handleError)
@ -94,12 +94,12 @@ export class DataService {
} }
private setHeaders(options: any, needId?: boolean){ private setHeaders(options: any, needId?: boolean){
if (needId && this.securityService) {
if (needId && this.securityService) {
options["headers"] = new HttpHeaders() options["headers"] = new HttpHeaders()
.append('authorization', 'Bearer ' + this.securityService.GetToken()) .append('authorization', 'Bearer ' + this.securityService.GetToken())
.append('x-requestid', Guid.newGuid()); .append('x-requestid', Guid.newGuid());
} }
else if (this.securityService) {
else if (this.securityService) {
options["headers"] = new HttpHeaders() options["headers"] = new HttpHeaders()
.append('authorization', 'Bearer ' + this.securityService.GetToken()); .append('authorization', 'Bearer ' + this.securityService.GetToken());
} }


+ 26
- 20
src/Web/WebSPA/Client/modules/shared/services/security.service.ts View File

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Http, Response, Headers } from '@angular/http';
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, Subject } from 'rxjs'; import { Observable, Subject } from 'rxjs';
import { map } from 'rxjs/operators';
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';
@ -11,14 +11,14 @@ import { StorageService } from './storage.service';
export class SecurityService { export class SecurityService {
private actionUrl: string; private actionUrl: string;
private headers: Headers;
private headers: HttpHeaders;
private storage: StorageService; private storage: StorageService;
private authenticationSource = new Subject<boolean>(); private authenticationSource = new Subject<boolean>();
authenticationChallenge$ = this.authenticationSource.asObservable(); authenticationChallenge$ = this.authenticationSource.asObservable();
private authorityUrl = ''; private authorityUrl = '';
constructor(private _http: Http, private _router: Router, private route: ActivatedRoute, private _configurationService: ConfigurationService, private _storageService: StorageService) {
this.headers = new Headers();
constructor(private _http: HttpClient, private _router: Router, private route: ActivatedRoute, private _configurationService: ConfigurationService, private _storageService: StorageService) {
this.headers = new HttpHeaders();
this.headers.append('Content-Type', 'application/json'); this.headers.append('Content-Type', 'application/json');
this.headers.append('Accept', 'application/json'); this.headers.append('Accept', 'application/json');
this.storage = _storageService; this.storage = _storageService;
@ -50,6 +50,7 @@ export class SecurityService {
} }
public UserData: any; public UserData: any;
public SetAuthorizationData(token: any, id_token: any) { public SetAuthorizationData(token: any, id_token: any) {
if (this.storage.retrieve('authorizationData') !== '') { if (this.storage.retrieve('authorizationData') !== '') {
this.storage.store('authorizationData', ''); this.storage.store('authorizationData', '');
@ -127,7 +128,6 @@ export class SecurityService {
id_token = result.id_token; id_token = result.id_token;
let dataIdToken: any = this.getDataFromToken(id_token); let dataIdToken: any = this.getDataFromToken(id_token);
console.log(dataIdToken);
// validate nonce // validate nonce
if (dataIdToken.nonce !== this.storage.retrieve('authNonce')) { if (dataIdToken.nonce !== this.storage.retrieve('authNonce')) {
@ -142,7 +142,6 @@ export class SecurityService {
} }
} }
if (authResponseIsValid) { if (authResponseIsValid) {
this.SetAuthorizationData(token, id_token); this.SetAuthorizationData(token, id_token);
} }
@ -196,8 +195,10 @@ export class SecurityService {
private getDataFromToken(token: any) { private getDataFromToken(token: any) {
let data = {}; let data = {};
if (typeof token !== 'undefined') { if (typeof token !== 'undefined') {
let encoded = token.split('.')[1]; let encoded = token.split('.')[1];
data = JSON.parse(this.urlBase64Decode(encoded)); data = JSON.parse(this.urlBase64Decode(encoded));
} }
@ -219,25 +220,30 @@ export class SecurityService {
//} //}
private getUserData = (): Observable<string[]> => { private getUserData = (): Observable<string[]> => {
this.setHeaders();
if (this.authorityUrl === '')
if (this.authorityUrl === '') {
this.authorityUrl = this.storage.retrieve('IdentityUrl'); this.authorityUrl = this.storage.retrieve('IdentityUrl');
}
return this._http.get(this.authorityUrl + '/connect/userinfo', {
headers: this.headers,
body: ''
}).pipe(map(res => res.json()));
const options = this.setHeaders();
return this._http.get<string[]>(`${this.authorityUrl}/connect/userinfo`, options)
.pipe<string[]>((info: any) => info);
} }
private setHeaders() {
this.headers = new Headers();
this.headers.append('Content-Type', 'application/json');
this.headers.append('Accept', 'application/json');
private setHeaders(): any {
const httpOptions = {
headers: new HttpHeaders()
};
let token = this.GetToken();
httpOptions.headers = httpOptions.headers.set('Content-Type', 'application/json');
httpOptions.headers = httpOptions.headers.set('Accept', 'application/json');
const token = this.GetToken();
if (token !== '') { if (token !== '') {
this.headers.append('Authorization', 'Bearer ' + token);
httpOptions.headers = httpOptions.headers.set('Authorization', `Bearer ${token}`);
} }
return httpOptions;
} }
} }

+ 4
- 4
src/Web/WebSPA/Client/modules/shared/shared.module.ts View File

@ -2,7 +2,7 @@ import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule, FormBuilder } from '@angular/forms'; import { FormsModule, ReactiveFormsModule, FormBuilder } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { HttpModule, JsonpModule } from '@angular/http';
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
// Services // Services
@ -29,10 +29,10 @@ import { UppercasePipe } from './pipes/uppercase.pipe';
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
RouterModule, RouterModule,
NgbModule.forRoot(),
NgbModule,
// No need to export as these modules don't expose any components/directive etc' // No need to export as these modules don't expose any components/directive etc'
HttpModule,
JsonpModule
HttpClientModule,
HttpClientJsonpModule
], ],
declarations: [ declarations: [
Pager, Pager,


+ 2
- 2
src/Web/WebSPA/Client/polyfills.ts View File

@ -41,8 +41,8 @@
/** Evergreen browsers require these. **/ /** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'core-js/es/reflect';
import 'core-js/proposals/reflect-metadata';
/** ALL Firefox browsers require the following to support `@angular/animation`. **/ /** ALL Firefox browsers require the following to support `@angular/animation`. **/


+ 4
- 3
src/Web/WebSPA/Dockerfile View File

@ -1,4 +1,4 @@
ARG NODE_IMAGE=node:8.11
ARG NODE_IMAGE=node:8.16
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
@ -7,13 +7,14 @@ FROM ${NODE_IMAGE} as node-build
WORKDIR /web WORKDIR /web
COPY Web/WebSPA/package.json . COPY Web/WebSPA/package.json .
COPY Web/WebSPA/package-lock.json . COPY Web/WebSPA/package-lock.json .
RUN npm install
COPY Web/WebSPA . COPY Web/WebSPA .
RUN npm run build:prod
RUN npm i npm@latest -g && npm update && npm install && npm run build:prod
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 7413
- 5918
src/Web/WebSPA/package-lock.json
File diff suppressed because it is too large
View File


+ 25
- 24
src/Web/WebSPA/package.json View File

@ -27,38 +27,39 @@
"lint:ts": "tslint -c tslint.json Client/**/*.ts" "lint:ts": "tslint -c tslint.json Client/**/*.ts"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "^7.2.10",
"@angular/common": "^7.2.10",
"@angular/compiler": "^7.2.10",
"@angular/core": "^7.2.10",
"@angular/forms": "^7.2.10",
"@angular/http": "^7.2.10",
"@angular/platform-browser": "^7.2.10",
"@angular/platform-browser-dynamic": "^7.2.10",
"@angular/platform-server": "^7.2.10",
"@angular/router": "^7.2.10",
"@angular/animations": "8.2.14",
"@angular/common": "8.2.14",
"@angular/compiler": "8.2.14",
"@angular/core": "8.2.14",
"@angular/forms": "8.2.14",
"@angular/platform-browser": "8.2.14",
"@angular/platform-browser-dynamic": "8.2.14",
"@angular/platform-server": "8.2.14",
"@angular/router": "8.2.14",
"@microsoft/signalr": "3.0.1", "@microsoft/signalr": "3.0.1",
"@ng-bootstrap/ng-bootstrap": "3.3.0",
"bootstrap": "4.3.1",
"core-js": "^2.5.0",
"@ng-bootstrap/ng-bootstrap": "5.2.1",
"bootstrap": "4.4.1",
"core-js": "^3.0.0",
"file-loader": "2.0.0", "file-loader": "2.0.0",
"font-awesome": "4.7.0", "font-awesome": "4.7.0",
"isomorphic-fetch": "2.2.1", "isomorphic-fetch": "2.2.1",
"jquery": "3.4.1", "jquery": "3.4.1",
"ngx-toastr": "10.1.0", "ngx-toastr": "10.1.0",
"normalize.css": "8.0.0", "normalize.css": "8.0.0",
"popper.js": "^1.14.4",
"preboot": "6.0.0-beta.5",
"rxjs": "~6.3.3",
"rxjs-compat": "~6.3.3",
"@popperjs/core": "2.0.0",
"rxjs": "~6.4.0",
"rxjs-compat": "~6.4.0",
"webpack-dev-server": "3.1.14", "webpack-dev-server": "3.1.14",
"zone.js": "^0.8.29"
"zone.js": "~0.9.1",
"acorn-dynamic-import": "4.0.0",
"acorn": "^6.0.0",
"popper.js": "1.16.1"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^0.13.6",
"@angular/cli": "^7.3.6",
"@angular/compiler-cli": "^7.2.10",
"@angular/language-service": "^7.2.10",
"@angular-devkit/build-angular": "0.803.23",
"@angular/cli": "8.3.23",
"@angular/compiler-cli": "8.2.14",
"@angular/language-service": "8.2.14",
"@types/core-js": "2.5.0", "@types/core-js": "2.5.0",
"@types/hammerjs": "2.0.35", "@types/hammerjs": "2.0.35",
"@types/jasmine": "^3.3.12", "@types/jasmine": "^3.3.12",
@ -66,8 +67,8 @@
"@types/protractor": "4.0.0", "@types/protractor": "4.0.0",
"@types/selenium-webdriver": "3.0.10", "@types/selenium-webdriver": "3.0.10",
"codelyzer": "^5.0.0-beta.1", "codelyzer": "^5.0.0-beta.1",
"handlebars": "^4.1.2",
"eslint": "4.18.2", "eslint": "4.18.2",
"handlebars": "^4.7.2",
"jasmine-core": "^3.3.0", "jasmine-core": "^3.3.0",
"jasmine-spec-reporter": "^4.2.1", "jasmine-spec-reporter": "^4.2.1",
"karma": "^4.0.1", "karma": "^4.0.1",
@ -85,7 +86,7 @@
"ts-node": "~7.0.1", "ts-node": "~7.0.1",
"tslint": "^5.14.0", "tslint": "^5.14.0",
"typedoc": "^0.15.0", "typedoc": "^0.15.0",
"typescript": "^3.2.4",
"typescript": "3.4.5",
"url-loader": "1.1.1", "url-loader": "1.1.1",
"webpack": "^4.29.6" "webpack": "^4.29.6"
} }


+ 2
- 0
src/Web/WebStatus/Dockerfile View File

@ -5,6 +5,8 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 2
- 0
src/Web/WebhookClient/Dockerfile View File

@ -6,6 +6,8 @@ EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
# to take advantage of Docker's build cache, to speed up local container builds
COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln"
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"


+ 1
- 1
src/docker-compose.yml View File

@ -161,7 +161,7 @@ services:
context: . context: .
dockerfile: Web/WebSPA/Dockerfile dockerfile: Web/WebSPA/Dockerfile
args: args:
NODE_IMAGE: ${NODE_IMAGE:-node:8.11}
NODE_IMAGE: ${NODE_IMAGE:-node:10.13}
# depends_on: # depends_on:
# - webshoppingagg # - webshoppingagg
# - webshoppingapigw # - webshoppingapigw


+ 3
- 0
src/package-lock.json View File

@ -0,0 +1,3 @@
{
"lockfileVersion": 1
}

Loading…
Cancel
Save