Browse Source

Packages updates

1. Update to ng 5.2.0
2 Update to bootstrap 4.0.0.beta.3
pull/443/head
Adrian MIHAILESCU 7 years ago
parent
commit
2d70cb6e8b
14 changed files with 122 additions and 10056 deletions
  1. +1
    -1
      src/Web/WebSPA/.angulardoc.json
  2. +1
    -0
      src/Web/WebSPA/.gitignore
  3. +4
    -1
      src/Web/WebSPA/Client/modules/app.component.ts
  4. +35
    -19
      src/Web/WebSPA/Client/modules/basket/basket.service.ts
  5. +8
    -2
      src/Web/WebSPA/Client/modules/campaigns/campaigns.service.ts
  6. +11
    -6
      src/Web/WebSPA/Client/modules/catalog/catalog.service.ts
  7. +3
    -4
      src/Web/WebSPA/Client/modules/orders/orders-detail/orders-detail.component.html
  8. +9
    -4
      src/Web/WebSPA/Client/modules/orders/orders.service.ts
  9. +4
    -2
      src/Web/WebSPA/Client/modules/shared/services/configuration.service.ts
  10. +3
    -1
      src/Web/WebSPA/Client/modules/shared/services/data.service.ts
  11. +7
    -1
      src/Web/WebSPA/Client/modules/shared/services/security.service.ts
  12. +9
    -18
      src/Web/WebSPA/WebSPA.csproj
  13. +0
    -9970
      src/Web/WebSPA/package-lock.json
  14. +27
    -27
      src/Web/WebSPA/package.json

+ 1
- 1
src/Web/WebSPA/.angulardoc.json View File

@ -1,4 +1,4 @@
{
"repoId": "bccb75c8-567f-4f97-923c-d56cd1208aa5",
"repoId": "9f88a22f-bb27-444a-a7b9-b451b6003d91",
"lastSync": 0
}

+ 1
- 0
src/Web/WebSPA/.gitignore View File

@ -11,6 +11,7 @@ npm-debug.log*
*.user
*.userosscache
*.sln.docstates
package.lock.json
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs


+ 4
- 1
src/Web/WebSPA/Client/modules/app.component.ts View File

@ -30,7 +30,10 @@ export class AppComponent implements OnInit {
ngOnInit() {
console.log('app on init');
this.subscription = this.securityService.authenticationChallenge$.subscribe(res => this.Authenticated = res);
this.subscription = this
.securityService
.authenticationChallenge$
.subscribe(res => this.Authenticated = res);
// Get configuration from server environment variables:
console.log('configuration');


+ 35
- 19
src/Web/WebSPA/Client/modules/basket/basket.service.ts View File

@ -32,7 +32,13 @@ export class BasketService {
private basketDropedSource = new Subject();
basketDroped$ = this.basketDropedSource.asObservable();
constructor(private service: DataService, private authService: SecurityService, private basketEvents: BasketWrapperService, private router: Router, private configurationService: ConfigurationService, private storageService: StorageService) {
constructor(
private service: DataService,
private authService: SecurityService,
private basketEvents: BasketWrapperService,
private router: Router,
private configurationService: ConfigurationService,
private storageService: StorageService) {
this.basket.items = [];
// Init:
@ -65,28 +71,36 @@ export class BasketService {
setBasket(basket): Observable<boolean> {
let url = this.basketUrl + '/api/v1/basket/';
this.basket = basket;
return this.service.post(url, basket).map((response: Response) => {
return true;
});
return this
.service
.post(url, basket)
.map((response: Response) => {
return true;
});
}
setBasketCheckout(basketCheckout): Observable<boolean> {
let url = this.basketUrl + '/api/v1/basket/checkout';
return this.service.postWithId(url, basketCheckout).map((response: Response) => {
this.basketEvents.orderCreated();
return true;
});
return this
.service
.postWithId(url, basketCheckout)
.map((response: Response) => {
this.basketEvents.orderCreated();
return true;
});
}
getBasket(): Observable<IBasket> {
let url = this.basketUrl + '/api/v1/basket/' + this.basket.buyerId;
return this.service.get(url).map((response: Response) => {
if (response.status === 204) {
return null;
}
return response.json();
});
return this
.service
.get(url)
.map((response: Response) => {
if (response.status === 204) {
return null;
}
return response.json();
});
}
mapBasketInfoCheckout(order: IOrder): IBasketCheckout {
@ -114,9 +128,11 @@ export class BasketService {
}
private loadData() {
this.getBasket().subscribe(basket => {
if (basket != null)
this.basket.items = basket.items;
});
this
.getBasket()
.subscribe(basket => {
if (basket != null)
this.basket.items = basket.items;
});
}
}

+ 8
- 2
src/Web/WebSPA/Client/modules/campaigns/campaigns.service.ts View File

@ -18,7 +18,10 @@ import 'rxjs/add/operator/map';
export class CampaignsService {
private marketingUrl: string = '';
private buyerId: string = '';
constructor(private service: DataService, private identityService: SecurityService, private configurationService: ConfigurationService) {
constructor(
private service: DataService,
private identityService: SecurityService,
private configurationService: ConfigurationService) {
if (this.identityService.IsAuthorized) {
if (this.identityService.UserData) {
this.buyerId = this.identityService.UserData.sub;
@ -28,7 +31,10 @@ export class CampaignsService {
if (this.configurationService.isReady)
this.marketingUrl = this.configurationService.serverSettings.marketingUrl;
else
this.configurationService.settingsLoaded$.subscribe(x => this.marketingUrl = this.configurationService.serverSettings.marketingUrl);
this
.configurationService
.settingsLoaded$
.subscribe(x => this.marketingUrl = this.configurationService.serverSettings.marketingUrl);
}


+ 11
- 6
src/Web/WebSPA/Client/modules/catalog/catalog.service.ts View File

@ -19,12 +19,17 @@ export class CatalogService {
private brandUrl: string = '';
private typesUrl: string = '';
constructor(private service: DataService, private configurationService: ConfigurationService) {
this.configurationService.settingsLoaded$.subscribe(x => {
this.catalogUrl = this.configurationService.serverSettings.catalogUrl + '/api/v1/catalog/items';
this.brandUrl = this.configurationService.serverSettings.catalogUrl + '/api/v1/catalog/catalogbrands';
this.typesUrl = this.configurationService.serverSettings.catalogUrl + '/api/v1/catalog/catalogtypes';
});
constructor(
private service: DataService,
private configurationService: ConfigurationService) {
this
.configurationService
.settingsLoaded$
.subscribe(x => {
this.catalogUrl = this.configurationService.serverSettings.catalogUrl + '/api/v1/catalog/items';
this.brandUrl = this.configurationService.serverSettings.catalogUrl + '/api/v1/catalog/catalogbrands';
this.typesUrl = this.configurationService.serverSettings.catalogUrl + '/api/v1/catalog/catalogtypes';
});
}
getCatalog(pageIndex: number, pageSize: number, brand: number, type: number): Observable<ICatalog> {


+ 3
- 4
src/Web/WebSPA/Client/modules/orders/orders-detail/orders-detail.component.html View File

@ -17,7 +17,7 @@
<section class="esh-orders_detail-item col-xs-3">{{order.status}}</section>
</article>
</section>
<section class="esh-orders_detail-section">
<article class="esh-orders_detail-titles row">
<section class="esh-orders_detail-title col-xs-12">Description</section>
@ -51,8 +51,7 @@
<section class="esh-orders_detail-title col-xs-12">Order details</section>
</article>
<article class="esh-orders_detail-items esh-orders_detail-items--border row"
*ngFor="let item of order.orderitems">
<article class="esh-orders_detail-items esh-orders_detail-items--border row" *ngFor="let item of order.orderitems">
<section class="esh-orders_detail-item col-md-4 hidden-md-down">
<img class="esh-orders_detail-image" src="{{item.pictureurl}}">
</section>
@ -75,4 +74,4 @@
</article>
</section>
</div>
</div>
</div>

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

@ -8,7 +8,6 @@ import { IOrderDetail } from '../shared/models/order-detail.model';
import { SecurityService } from '../shared/services/security.service';
import { ConfigurationService } from '../shared/services/configuration.service';
import { BasketWrapperService } from '../shared/services/basket.wrapper.service';
import 'rxjs/Rx';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/throw';
@ -20,12 +19,18 @@ import 'rxjs/add/operator/map';
export class OrdersService {
private ordersUrl: string = '';
constructor(private service: DataService, private basketService: BasketWrapperService, private identityService: SecurityService, private configurationService: ConfigurationService) {
constructor(
private service: DataService,
private basketService: BasketWrapperService,
private identityService: SecurityService,
private configurationService: ConfigurationService) {
if (this.configurationService.isReady)
this.ordersUrl = this.configurationService.serverSettings.orderingUrl;
else
this.configurationService.settingsLoaded$.subscribe(x => this.ordersUrl = this.configurationService.serverSettings.orderingUrl);
this
.configurationService
.settingsLoaded$
.subscribe(x => this.ordersUrl = this.configurationService.serverSettings.orderingUrl);
}
getOrders(): Observable<IOrder[]> {


+ 4
- 2
src/Web/WebSPA/Client/modules/shared/services/configuration.service.ts View File

@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { Http, Response, RequestOptionsArgs, RequestMethod, Headers } from '@angular/http';
import { IConfiguration } from '../models/configuration.model';
import { StorageService } from './storage.service';
import 'rxjs/Rx';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/throw';
@ -19,7 +19,9 @@ export class ConfigurationService {
settingsLoaded$ = this.settingsLoadedSource.asObservable();
isReady: boolean = false;
constructor(private http: Http, private storageService: StorageService) { }
constructor(
private http: Http,
private storageService: StorageService) { }
load() {
const baseURI = document.baseURI.endsWith('/') ? document.baseURI : `${document.baseURI}/`;


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

@ -15,7 +15,9 @@ import { Guid } from '../../../guid';
// is pending to do for the SPA app
@Injectable()
export class DataService {
constructor(private http: Http, private securityService: SecurityService) { }
constructor(
private http: Http,
private securityService: SecurityService) { }
get(url: string, params?: any): Observable<Response> {
let options: RequestOptionsArgs = {};


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

@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { Http, Response, Headers } from '@angular/http';
import 'rxjs/add/operator/map';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
@ -18,7 +19,12 @@ export class SecurityService {
authenticationChallenge$ = this.authenticationSource.asObservable();
private authorityUrl = '';
constructor(private _http: Http, private _router: Router, private route: ActivatedRoute, private _configurationService: ConfigurationService, private _storageService: StorageService) {
constructor(
private _http: Http,
private _router: Router,
private route: ActivatedRoute,
private _configurationService: ConfigurationService,
private _storageService: StorageService) {
this.headers = new Headers();
this.headers.append('Content-Type', 'application/json');
this.headers.append('Accept', 'application/json');


+ 9
- 18
src/Web/WebSPA/WebSPA.csproj View File

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<UserSecretsId>aspnetcorespa-c23d27a4-eb88-4b18-9b77-2a93f3b15119</UserSecretsId>
@ -8,8 +7,8 @@
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<GeneratedItemPatterns>wwwroot/dist/**</GeneratedItemPatterns>
<DefaultItemExcludes>$(DefaultItemExcludes);$(GeneratedItemPatterns)</DefaultItemExcludes>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
</PropertyGroup>
<ItemGroup>
<Compile Remove="node_modules\**\*;Client\**\*" />
<Content Include="Setup\images.zip">
@ -25,7 +24,6 @@
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
@ -35,41 +33,34 @@
<PackageReference Include="Microsoft.AspNetCore.DataProtection.Redis" Version="0.3.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>
<!-- workaround for https://github.com/aspnet/websdk/issues/114 -->
<!--<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Exec Command="npm install" />
<Exec Command="npm run build:prod" />
<ItemGroup>
<_GeneratedFiles Include="$(GeneratedItemPatterns)" />
<ContentWithTargetPath Include="@(_GeneratedFiles)" TargetPath="%(Identity)" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>
</Target>-->
</Target>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.1" />
</ItemGroup>
<!-- workaround for https://github.com/aspnet/websdk/issues/114 -->
<!--
<Target Name="AddGeneratedContentItems" BeforeTargets="AssignTargetPaths" DependsOnTargets="PrepareForPublish">
<ItemGroup>
<Content Include="wwwroot/**" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder);@(Content)" />
</ItemGroup>
</Target>
<Target Name="AddGeneratedContentItems" BeforeTargets="AssignTargetPaths" DependsOnTargets="PrepareForPublish"><ItemGroup><Content Include="wwwroot/**" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder);@(Content)" /></ItemGroup></Target>
-->
<ItemGroup>
<ProjectReference Include="..\..\BuildingBlocks\HealthChecks\src\Microsoft.AspNetCore.HealthChecks\Microsoft.AspNetCore.HealthChecks.csproj" />
<ProjectReference Include="..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\assets\" />
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties package-lock_1json__JSONSchema="http://json.schemastore.org/bower" /></VisualStudio></ProjectExtensions>
<ProjectExtensions>
<VisualStudio>
<UserProperties package-lock_1json__JSONSchema="http://json.schemastore.org/bower" />
</VisualStudio>
</ProjectExtensions>
</Project>

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


+ 27
- 27
src/Web/WebSPA/package.json View File

@ -25,43 +25,43 @@
"lint:sass": "sass-lint -c .sass-lint.yml Client/**/*.scss --verbose",
"lint:ts": "tslint -c tslint.json Client/**/*.ts"
},
"dependencies": {
"@angular/common": "5.1.2",
"@angular/compiler": "5.1.2",
"@angular/core": "5.1.2",
"@angular/forms": "5.1.2",
"@angular/http": "5.1.2",
"@angular/platform-browser": "5.1.2",
"@angular/platform-browser-dynamic": "5.1.2",
"@angular/router": "5.1.2",
"@ng-bootstrap/ng-bootstrap": "1.0.0-beta.8",
"bootstrap": "4.0.0-beta.2",
"jquery": "3.2.1",
"popper.js": "1.12.9",
"dependencies": {},
"devDependencies": {
"@angular/common": "5.2.0",
"@angular/compiler": "5.2.0",
"@angular/core": "5.2.0",
"@angular/forms": "5.2.0",
"@angular/http": "5.2.0",
"@angular/platform-browser": "5.2.0",
"@angular/platform-browser-dynamic": "5.2.0",
"@angular/router": "5.2.0",
"@angular/cli": "1.6.4",
"@angular/compiler-cli": "5.2.0",
"@types/core-js": "0.9.44",
"@types/hammerjs": "2.0.35",
"@types/jasmine": "2.8.4",
"@types/node": "9.3.0",
"@types/selenium-webdriver": "3.0.8",
"@ng-bootstrap/ng-bootstrap": "1.0.0-beta.9",
"bootstrap": "4.0.0-beta.3",
"codelyzer": "4.0.2",
"core-js": "2.5.3",
"file-loader": "1.1.6",
"font-awesome": "4.7.0",
"isomorphic-fetch": "2.2.1",
"jquery": "3.2.1",
"popper.js": "1.12.9",
"node-sass": "4.7.2",
"normalize.css": "7.0.0",
"preboot": "4.5.2",
"rxjs": "5.5.6",
"zone.js": "^0.8.18"
},
"devDependencies": {
"@angular/cli": "1.6.2",
"@angular/compiler-cli": "5.1.2",
"@types/core-js": "0.9.43",
"@types/hammerjs": "2.0.35",
"@types/jasmine": "2.8.2",
"@types/node": "8.5.2",
"@types/selenium-webdriver": "3.0.8",
"codelyzer": "4.0.2",
"sass-lint": "1.12.1",
"ts-helpers": "1.1.2",
"ts-node": "4.0.2",
"tslint": "5.8.0",
"ts-node": "4.1.0",
"tslint": "5.9.1",
"typedoc": "0.9.0",
"typescript": "2.6.2",
"url-loader": "0.6.2"
"url-loader": "0.6.2",
"zone.js": "0.8.20"
}
}

Loading…
Cancel
Save