Skip to content

Commit 2e50097

Browse files
committed
2 parents 25a7060 + fa54144 commit 2e50097

49 files changed

Lines changed: 442 additions & 403 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docker-compose.override.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ services:
4444
- ASPNETCORE_URLS=http://0.0.0.0:5102
4545
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
4646
- identityUrl=http://identity.api:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
47+
- BasketUrl=http://basket.api:5103
4748
- EventBusConnection=rabbitmq
4849
ports:
4950
- "5102:5102"

docker-compose.prod.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
- ASPNETCORE_URLS=http://0.0.0.0:5103
2020
- ConnectionString=basket.data
2121
- identityUrl=http://identity.api:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105.
22+
- EventBusConnection=rabbitmq
2223
ports:
2324
- "5103:5103"
2425

@@ -28,6 +29,7 @@ services:
2829
- ASPNETCORE_URLS=http://0.0.0.0:5101
2930
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word
3031
- ExternalCatalogBaseUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5101 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105.
32+
- EventBusConnection=rabbitmq
3133
ports:
3234
- "5101:5101"
3335

@@ -47,6 +49,8 @@ services:
4749
- ASPNETCORE_URLS=http://0.0.0.0:5102
4850
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
4951
- identityUrl=http://identity.api:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105.
52+
- BasketUrl=http://basket.api:5103
53+
- EventBusConnection=rabbitmq
5054
ports:
5155
- "5102:5102"
5256

@@ -81,10 +85,13 @@ services:
8185

8286
webstatus:
8387
environment:
84-
- ASPNETCORE_ENVIRONMENT=Development
88+
- ASPNETCORE_ENVIRONMENT=Production
89+
- ASPNETCORE_URLS=http://0.0.0.0:5107
8590
- CatalogUrl=http://catalog.api:5101/hc
8691
- OrderingUrl=http://ordering.api:5102/hc
8792
- BasketUrl=http://basket.api:5103/hc
88-
- IdentityUrl=http://10.0.75.1:5105/hc
93+
- mvc=http://webmvc:5100/hc
94+
- spa=http://webspa:5104/hc
95+
- IdentityUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser.
8996
ports:
90-
- "5107:5107"
97+
- "5107:5107"
Binary file not shown.
30.2 KB
Loading

src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
44
xmlns:light="clr-namespace:Xamarin.Forms.Themes;assembly=Xamarin.Forms.Theme.Light"
55
xmlns:converters="clr-namespace:eShopOnContainers.Core.Converters;assembly=eShopOnContainers.Core"
6-
xmlns:effects="clr-namespace:eShopOnContainers.Core.Effects;assembly=eShopOnContainers.Core"
6+
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
77
x:Class="eShopOnContainers.App">
88
<Application.Resources>
99
<ResourceDictionary MergedWith="light:LightThemeResources">
@@ -17,6 +17,7 @@
1717
<Color x:Key="GreenColor">#00A69C</Color>
1818
<Color x:Key="DarkGreenColor">#00857D</Color>
1919
<Color x:Key="GrayColor">#e2e2e2</Color>
20+
<Color x:Key="ErrorColor">#ff5252</Color>
2021

2122
<!-- FONTS -->
2223
<OnPlatform
@@ -100,6 +101,7 @@
100101
<!-- CONVERTERS -->
101102
<converters:CountToBoolConverter x:Key="CountToBoolConverter" />
102103
<converters:DatetimeConverter x:Key="DatetimeConverter" />
104+
<converters:FirstValidationErrorConverter x:Key="FirstValidationErrorConverter" />
103105
<converters:ImageConverter x:Key="ImageConverter" />
104106
<converters:ItemTappedEventArgsConverter x:Key="ItemTappedEventArgsConverter" />
105107
<converters:InverseCountToBoolConverter x:Key="InverseCountToBoolConverter" />
@@ -109,6 +111,14 @@
109111
<converters:WebNavigatingEventArgsConverter x:Key="WebNavigatingEventArgsConverter" />
110112

111113
<!-- STYLES -->
114+
<Style x:Key="ValidationErrorLabelStyle"
115+
TargetType="{x:Type Label}">
116+
<Setter Property="TextColor"
117+
Value="{StaticResource ErrorColor}" />
118+
<Setter Property="FontSize"
119+
Value="{StaticResource LittleSize}" />
120+
</Style>
121+
112122
<Style x:Key="EntryStyle"
113123
TargetType="{x:Type Entry}">
114124
<Setter Property="FontFamily"
@@ -125,9 +135,9 @@
125135
Value="Bold" />
126136
<Setter Property="Opacity"
127137
Value="0.6" />
128-
<Setter Property="effects:LineColorEffect.ApplyLineColor"
138+
<Setter Property="behaviors:LineColorBehavior.ApplyLineColor"
129139
Value="True" />
130-
<Setter Property="effects:LineColorEffect.LineColor"
140+
<Setter Property="behaviors:LineColorBehavior.LineColor"
131141
Value="{StaticResource BlackColor}" />
132142
<Style.Triggers>
133143
<Trigger TargetType="Entry"
@@ -156,16 +166,16 @@
156166
Value="Transparent" />
157167
<Setter Property="Opacity"
158168
Value="0.6" />
159-
<Setter Property="effects:LineColorEffect.ApplyLineColor"
169+
<Setter Property="behaviors:LineColorBehavior.ApplyLineColor"
160170
Value="True" />
161-
<Setter Property="effects:LineColorEffect.LineColor"
171+
<Setter Property="behaviors:LineColorBehavior.LineColor"
162172
Value="Gray" />
163173
<Style.Triggers>
164174
<Trigger TargetType="Entry"
165175
Property="IsFocused"
166176
Value="True">
167177
<Setter Property="Opacity" Value="1" />
168-
<Setter Property="effects:LineColorEffect.LineColor"
178+
<Setter Property="behaviors:LineColorBehavior.LineColor"
169179
Value="{StaticResource GreenColor}" />
170180
</Trigger>
171181
</Style.Triggers>

src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using eShopOnContainers.Core.Helpers;
22
using eShopOnContainers.Services;
3-
using eShopOnContainers.ViewModels.Base;
3+
using eShopOnContainers.Core.ViewModels.Base;
44
using System.Threading.Tasks;
55
using Xamarin.Forms;
66
using Xamarin.Forms.Xaml;
@@ -27,13 +27,13 @@ public App()
2727
private void InitApp()
2828
{
2929
UseMockServices = Settings.UseMocks;
30-
31-
ViewModelLocator.Instance.UpdateDependencies(UseMockServices);
30+
ViewModelLocator.Initialize();
31+
ViewModelLocator.UpdateDependencies(UseMockServices);
3232
}
3333

3434
private Task InitNavigation()
3535
{
36-
var navigationService = ViewModelLocator.Instance.Resolve<INavigationService>();
36+
var navigationService = ViewModelLocator.Resolve<INavigationService>();
3737
return navigationService.InitializeAsync();
3838
}
3939

src/Mobile/eShopOnContainers/eShopOnContainers.Core/Effects/LineColorEffect.cs renamed to src/Mobile/eShopOnContainers/eShopOnContainers.Core/Behaviors/LineColorBehavior.cs

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
using System.Linq;
22
using Xamarin.Forms;
3+
using eShopOnContainers.Core.Effects;
34

4-
namespace eShopOnContainers.Core.Effects
5+
namespace eShopOnContainers.Core.Behaviors
56
{
6-
public static class LineColorEffect
7+
public static class LineColorBehavior
78
{
89
public static readonly BindableProperty ApplyLineColorProperty =
9-
BindableProperty.CreateAttached("ApplyLineColor", typeof(bool), typeof(LineColorEffect), false,
10+
BindableProperty.CreateAttached("ApplyLineColor", typeof(bool), typeof(LineColorBehavior), false,
1011
propertyChanged: OnApplyLineColorChanged);
1112

13+
public static readonly BindableProperty LineColorProperty =
14+
BindableProperty.CreateAttached("LineColor", typeof(Color), typeof(LineColorBehavior), Color.Default);
15+
1216
public static bool GetApplyLineColor(BindableObject view)
1317
{
1418
return (bool)view.GetValue(ApplyLineColorProperty);
@@ -19,6 +23,16 @@ public static void SetApplyLineColor(BindableObject view, bool value)
1923
view.SetValue(ApplyLineColorProperty, value);
2024
}
2125

26+
public static Color GetLineColor(BindableObject view)
27+
{
28+
return (Color)view.GetValue(LineColorProperty);
29+
}
30+
31+
public static void SetLineColor(BindableObject view, Color value)
32+
{
33+
view.SetValue(LineColorProperty, value);
34+
}
35+
2236
private static void OnApplyLineColorChanged(BindableObject bindable, object oldValue, object newValue)
2337
{
2438
var view = bindable as View;
@@ -28,9 +42,9 @@ private static void OnApplyLineColorChanged(BindableObject bindable, object oldV
2842
return;
2943
}
3044

31-
bool hasShadow = (bool)newValue;
45+
bool hasLine = (bool)newValue;
3246

33-
if (hasShadow)
47+
if (hasLine)
3448
{
3549
view.Effects.Add(new EntryLineColorEffect());
3650
}
@@ -43,25 +57,5 @@ private static void OnApplyLineColorChanged(BindableObject bindable, object oldV
4357
}
4458
}
4559
}
46-
47-
public static readonly BindableProperty LineColorProperty =
48-
BindableProperty.CreateAttached("LineColor", typeof(Color), typeof(LineColorEffect), Color.Default);
49-
50-
public static Color GetLineColor(BindableObject view)
51-
{
52-
return (Color)view.GetValue(LineColorProperty);
53-
}
54-
55-
public static void SetLineColor(BindableObject view, Color value)
56-
{
57-
view.SetValue(LineColorProperty, value);
58-
}
59-
60-
class EntryLineColorEffect : RoutingEffect
61-
{
62-
public EntryLineColorEffect() : base("eShopOnContainers.EntryLineColorEffect")
63-
{
64-
}
65-
}
6660
}
6761
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Globalization;
4+
using System.Linq;
5+
using Xamarin.Forms;
6+
7+
namespace eShopOnContainers.Core.Converters
8+
{
9+
public class FirstValidationErrorConverter : IValueConverter
10+
{
11+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
12+
{
13+
ICollection<string> errors = value as ICollection<string>;
14+
return errors != null && errors.Count > 0 ? errors.ElementAt(0) : null;
15+
}
16+
17+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
18+
{
19+
throw new NotImplementedException();
20+
}
21+
}
22+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Xamarin.Forms;
2+
3+
namespace eShopOnContainers.Core.Effects
4+
{
5+
public class EntryLineColorEffect : RoutingEffect
6+
{
7+
public EntryLineColorEffect() : base("eShopOnContainers.EntryLineColorEffect")
8+
{
9+
}
10+
}
11+
}

src/Mobile/eShopOnContainers/eShopOnContainers.Core/Extensions/AnimationExtension.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)