diff --git a/add-host-entry.ps1 b/add-host-entry.ps1 deleted file mode 100644 index e373be888..000000000 --- a/add-host-entry.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -param([switch]$Elevated) -function Check-Admin { -$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent()) -$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) -} -if ((Check-Admin) -eq $false) { -if ($elevated) -{ -# could not elevate, quit -} - -else { - -Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition)) -} -exit -} - -ac -Encoding UTF8 C:\Windows\system32\drivers\etc\hosts "127.0.0.1 identity.service" \ No newline at end of file diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 048784fb9..c6ea3459d 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -11,7 +11,7 @@ services: webmvc: environment: - - CatalogUrl=http://catalog.api + - CatalogUrl=http://catalog.api:5101 - OrderingUrl=http://ordering.api:5102 #- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105. - IdentityUrl=http://10.0.75.1:5105 #Local: You need to open windows firewall at range 5100-5105. @@ -22,14 +22,14 @@ services: webspa: environment: - - CatalogUrl=http://catalog.api - - OrderingUrl=http://ordering.api + - CatalogUrl=http://catalog.api:5101 + - OrderingUrl=http://ordering.api:5102 #- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105. #- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker. - IdentityUrl=http://10.0.75.1:5105 #Local: You need to open windows firewall at range 5100-5105. - BasketUrl=http://basket.api:5103 ports: - - "5104:80" + - "5104:5104" basket.api: environment: @@ -44,7 +44,7 @@ services: environment: - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word ports: - - "5101:80" + - "5101:5101" ordering.api: environment: diff --git a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs index 5dd202b2c..14730b307 100644 --- a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs +++ b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs @@ -57,7 +57,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers .Take(pageSize) .ToListAsync(); - itemsOnPage = ComposePicUri(itemsOnPage); + //itemsOnPage = ComposePicUri(itemsOnPage); var model = new PaginatedItemsViewModel( pageIndex, pageSize, totalItems, itemsOnPage); @@ -90,7 +90,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers .Take(pageSize) .ToListAsync(); - itemsOnPage = ComposePicUri(itemsOnPage); + //itemsOnPage = ComposePicUri(itemsOnPage); var model = new PaginatedItemsViewModel( pageIndex, pageSize, totalItems, itemsOnPage); diff --git a/src/Services/Catalog/Catalog.API/project.json b/src/Services/Catalog/Catalog.API/project.json index d6a5f88e2..6705792b9 100644 --- a/src/Services/Catalog/Catalog.API/project.json +++ b/src/Services/Catalog/Catalog.API/project.json @@ -47,6 +47,7 @@ "publishOptions": { "include": [ "wwwroot", + "Pics", "Views", "Areas/**/Views", "settings.json", diff --git a/src/Web/WebMVC/wwwroot/css/site.min.css b/src/Web/WebMVC/wwwroot/css/site.min.css new file mode 100644 index 000000000..e69de29bb diff --git a/src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket-status/basket-status.component.ts b/src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket-status/basket-status.component.ts index a69f94e3b..abe21eca4 100644 --- a/src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket-status/basket-status.component.ts +++ b/src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket-status/basket-status.component.ts @@ -11,15 +11,17 @@ import { SecurityService } from '../../shared/services/security.service'; templateUrl: './basket-status.component.html' }) export class BasketStatusComponent implements OnInit { - subscription: Subscription; + basketItemAddedSubscription: Subscription; authSubscription: Subscription; + basketDroppedSubscription: Subscription; + badge: number = 0; constructor(private service: BasketService, private basketEvents: BasketWrapperService, private authService: SecurityService) { } ngOnInit() { // Subscribe to Add Basket Observable: - this.subscription = this.basketEvents.addItemToBasket$.subscribe( + this.basketItemAddedSubscription = this.basketEvents.addItemToBasket$.subscribe( item => { this.service.setBasket(item).subscribe(res => { this.service.getBasket().subscribe(basket => { @@ -28,6 +30,13 @@ export class BasketStatusComponent implements OnInit { }); }); + // Subscribe to Drop Basket Observable: + this.basketDroppedSubscription = this.service.basketDroped$.subscribe(res => + this.service.getBasket().subscribe(basket => { + this.badge = basket.items.length; + }) + ); + // Subscribe to login and logout observable this.authSubscription = this.authService.authenticationChallenge$.subscribe(res => { this.service.getBasket().subscribe(basket => { diff --git a/src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket.service.ts b/src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket.service.ts index 02b2b9877..0227b7a2d 100644 --- a/src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket.service.ts +++ b/src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket.service.ts @@ -14,6 +14,7 @@ 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() export class BasketService { @@ -23,6 +24,10 @@ export class BasketService { items: [] }; + //observable that is fired when the basket is dropped + private basketDropedSource = new Subject(); + basketDroped$ = this.basketDropedSource.asObservable(); + constructor(private service: DataService, private authService: SecurityService, private basketEvents: BasketWrapperService, private router: Router) { this.basket.items = []; @@ -55,7 +60,7 @@ export class BasketService { } dropBasket() { - console.log('drop basket!'); this.service.delete(this.basketUrl + '/' + this.basket.buyerId); + this.basketDropedSource.next(); } } \ No newline at end of file diff --git a/src/Web/WebSPA/eShopOnContainers.WebSPA/Program.cs b/src/Web/WebSPA/eShopOnContainers.WebSPA/Program.cs index 1f25bb104..dc32e7ee6 100644 --- a/src/Web/WebSPA/eShopOnContainers.WebSPA/Program.cs +++ b/src/Web/WebSPA/eShopOnContainers.WebSPA/Program.cs @@ -17,7 +17,7 @@ namespace eShopConContainers.WebSPA .UseKestrel() .UseConfiguration(config) .UseContentRoot(Directory.GetCurrentDirectory()) - .UseUrls("http://localhost:5104/") + .UseUrls("http://0.0.0.0:5104") .UseIISIntegration() .UseStartup() .Build(); diff --git a/src/Web/WebSPA/eShopOnContainers.WebSPA/Properties/launchSettings.json b/src/Web/WebSPA/eShopOnContainers.WebSPA/Properties/launchSettings.json index c9baa91bd..fd33f59ec 100644 --- a/src/Web/WebSPA/eShopOnContainers.WebSPA/Properties/launchSettings.json +++ b/src/Web/WebSPA/eShopOnContainers.WebSPA/Properties/launchSettings.json @@ -11,7 +11,7 @@ "IIS Express": { "commandName": "IISExpress", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Production" } } } diff --git a/src/Web/WebSPA/eShopOnContainers.WebSPA/appsettings.json b/src/Web/WebSPA/eShopOnContainers.WebSPA/appsettings.json index e31f67b1c..23bef8a13 100644 --- a/src/Web/WebSPA/eShopOnContainers.WebSPA/appsettings.json +++ b/src/Web/WebSPA/eShopOnContainers.WebSPA/appsettings.json @@ -1,7 +1,4 @@ { - "ConnectionStrings": { - "DefaultConnection": "Data Source=AspNetCore.db" - }, "Logging": { "IncludeScopes": false, "LogLevel": { @@ -9,39 +6,5 @@ "System": "Information", "Microsoft": "Information" } - }, - "Email": { - "From": "", - "Subject": "", - "SendGrid": { - "Username": "", - "Password": "" - } - }, - "Authentication": { - "Google": { - "ClientId": "", - "ClientSecret": "" - }, - "Facebook": { - "AppId": "", - "AppSecret": "" - }, - "Microsoft": { - "ClientId": "", - "ClientSecret": "" - }, - "Twitter": { - "ConsumerKey": "", - "ConsumerSecret": "" - }, - "Github": { - "ClientId": "", - "ClientSecret": "" - }, - "LinkedIn": { - "ClientId": "", - "ClientSecret": "" - } } } \ No newline at end of file diff --git a/src/Web/WebSPA/eShopOnContainers.WebSPA/project.json b/src/Web/WebSPA/eShopOnContainers.WebSPA/project.json index 356ae60c3..42bacd71b 100644 --- a/src/Web/WebSPA/eShopOnContainers.WebSPA/project.json +++ b/src/Web/WebSPA/eShopOnContainers.WebSPA/project.json @@ -97,8 +97,7 @@ "web.config", "config", "wwwroot", - "dockerfile", - "wait-for-it.sh" + "dockerfile" ] }, "scripts": {