Browse Source

Merge branch 'Dev' of https://github.com/dotnet/eShopOnContainers into Dev

pull/49/merge
Quique Fernandez 8 years ago
parent
commit
e8c3a14717
11 changed files with 28 additions and 70 deletions
  1. +0
    -19
      add-host-entry.ps1
  2. +5
    -5
      docker-compose.override.yml
  3. +2
    -2
      src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs
  4. +1
    -0
      src/Services/Catalog/Catalog.API/project.json
  5. +0
    -0
      src/Web/WebMVC/wwwroot/css/site.min.css
  6. +11
    -2
      src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket-status/basket-status.component.ts
  7. +6
    -1
      src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket.service.ts
  8. +1
    -1
      src/Web/WebSPA/eShopOnContainers.WebSPA/Program.cs
  9. +1
    -1
      src/Web/WebSPA/eShopOnContainers.WebSPA/Properties/launchSettings.json
  10. +0
    -37
      src/Web/WebSPA/eShopOnContainers.WebSPA/appsettings.json
  11. +1
    -2
      src/Web/WebSPA/eShopOnContainers.WebSPA/project.json

+ 0
- 19
add-host-entry.ps1 View File

@ -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"

+ 5
- 5
docker-compose.override.yml View File

@ -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:


+ 2
- 2
src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs View File

@ -57,7 +57,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers
.Take(pageSize)
.ToListAsync();
itemsOnPage = ComposePicUri(itemsOnPage);
//itemsOnPage = ComposePicUri(itemsOnPage);
var model = new PaginatedItemsViewModel<CatalogItem>(
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<CatalogItem>(
pageIndex, pageSize, totalItems, itemsOnPage);


+ 1
- 0
src/Services/Catalog/Catalog.API/project.json View File

@ -47,6 +47,7 @@
"publishOptions": {
"include": [
"wwwroot",
"Pics",
"Views",
"Areas/**/Views",
"settings.json",


+ 0
- 0
src/Web/WebMVC/wwwroot/css/site.min.css View File


+ 11
- 2
src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket-status/basket-status.component.ts View File

@ -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 => {


+ 6
- 1
src/Web/WebSPA/eShopOnContainers.WebSPA/Client/modules/basket/basket.service.ts View File

@ -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();
}
}

+ 1
- 1
src/Web/WebSPA/eShopOnContainers.WebSPA/Program.cs View File

@ -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<Startup>()
.Build();


+ 1
- 1
src/Web/WebSPA/eShopOnContainers.WebSPA/Properties/launchSettings.json View File

@ -11,7 +11,7 @@
"IIS Express": {
"commandName": "IISExpress",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
"ASPNETCORE_ENVIRONMENT": "Production"
}
}
}

+ 0
- 37
src/Web/WebSPA/eShopOnContainers.WebSPA/appsettings.json View File

@ -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": ""
}
}
}

+ 1
- 2
src/Web/WebSPA/eShopOnContainers.WebSPA/project.json View File

@ -97,8 +97,7 @@
"web.config",
"config",
"wwwroot",
"dockerfile",
"wait-for-it.sh"
"dockerfile"
]
},
"scripts": {


Loading…
Cancel
Save