diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 307dfd8211..ecd8b471a7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ "hostRequirements": { "cpus": 4 }, - "onCreateCommand": "wget https://download.visualstudio.microsoft.com/download/pr/9144f37e-b370-41ee-a86f-2d2a69251652/bc1d544112ec134184a5aec7f7a1eaf9/dotnet-sdk-8.0.100-rc.2.23502.2-linux-x64.tar.gz -O $HOME/dotnet.tar.gz && export DOTNET_ROOT=$HOME/.dotnet && mkdir -p \"$DOTNET_ROOT\" && tar zxf $HOME/dotnet.tar.gz -C \"$DOTNET_ROOT\" && export PATH=$DOTNET_ROOT:$DOTNET_ROOT/tools:$PATH && dotnet dev-certs https --trust && dotnet build src/BlazorUI/Demo/Client/Web/Bit.BlazorUI.Demo.Client.Web.csproj && dotnet build src/Websites/Platform/src/Bit.Websites.Platform.Web/Bit.Websites.Platform.Web.csproj -t:BeforeBuildTasks --no-restore && dotnet build src/Websites/Sales/src/Bit.Websites.Sales.Web/Bit.Websites.Sales.Web.csproj -t:BeforeBuildTasks --no-restore && dotnet build src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Boilerplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore", + "onCreateCommand": "wget https://download.visualstudio.microsoft.com/download/pr/9144f37e-b370-41ee-a86f-2d2a69251652/bc1d544112ec134184a5aec7f7a1eaf9/dotnet-sdk-8.0.100-rc.2.23502.2-linux-x64.tar.gz -O $HOME/dotnet.tar.gz && export DOTNET_ROOT=$HOME/.dotnet && mkdir -p \"$DOTNET_ROOT\" && tar zxf $HOME/dotnet.tar.gz -C \"$DOTNET_ROOT\" && export PATH=$DOTNET_ROOT:$DOTNET_ROOT/tools:$PATH && dotnet dev-certs https --trust && dotnet build src/BlazorUI/Demo/Client/Web/Bit.BlazorUI.Demo.Client.Web.csproj && dotnet build src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj -t:BeforeBuildTasks --no-restore && dotnet build src/Websites/Sales/src/Bit.Websites.Sales.Web/Bit.Websites.Sales.Web.csproj -t:BeforeBuildTasks --no-restore && dotnet build src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Boilerplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore", "waitFor": "onCreateCommand", "customizations": { "codespaces": { diff --git a/.github/workflows/adminpanel.cd.yml b/.github/workflows/adminpanel.cd.yml index 59ddd3aa85..0d966ccece 100644 --- a/.github/workflows/adminpanel.cd.yml +++ b/.github/workflows/adminpanel.cd.yml @@ -37,6 +37,13 @@ jobs: dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 dotnet new install Bit.Boilerplate.0.0.0.nupkg cd ../../../ && dotnet new bit-bp --name AdminPanel --database SqlServer --sample AdminPanel + + - name: Update appsettings.json api server address + uses: microsoft/variable-substitution@v1 + with: + files: 'AdminPanel/src/Client/Core/appsettings.json' + env: + ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/blazorui.demo.cd.yml b/.github/workflows/blazorui.demo.cd.yml index 8278ab6a8d..2c636e6d68 100644 --- a/.github/workflows/blazorui.demo.cd.yml +++ b/.github/workflows/blazorui.demo.cd.yml @@ -34,6 +34,13 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + + - name: Update appsettings.json api server address + uses: microsoft/variable-substitution@v1 + with: + files: 'src/BlazorUI/Demo/Client/Core/appsettings.json' + env: + ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} - name: Switch to blazor web assembly run: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' src/BlazorUI/Demo/Client/Web/Bit.BlazorUI.Demo.Client.Web.csproj diff --git a/.github/workflows/todotemplate.cd.yml b/.github/workflows/todotemplate.cd.yml index 5748f3f7b6..070ddfcc6d 100644 --- a/.github/workflows/todotemplate.cd.yml +++ b/.github/workflows/todotemplate.cd.yml @@ -41,6 +41,13 @@ jobs: dotnet new install Bit.Boilerplate.0.0.0.nupkg cd ../../../ && dotnet new bit-bp --name TodoTemplate --database SqlServer --sample Todo + - name: Update appsettings.json api server address + uses: microsoft/variable-substitution@v1 + with: + files: 'TodoTemplate/src/Client/Core/appsettings.json' + env: + ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} + - name: Switch to blazor web assembly run: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' TodoTemplate/src/Client/Web/TodoTemplate.Client.Web.csproj diff --git a/docs/how-to-build.md b/docs/how-to-build.md index 1b8ccf06fb..b4ad6a2389 100644 --- a/docs/how-to-build.md +++ b/docs/how-to-build.md @@ -34,7 +34,7 @@ Building each bit platform project requires specific steps that are explained pe
### bit platform Website -This website only requires the basic requirements and can be simply built by running the following command in the `Bit.Websites.Platform.Web` project folder: +This website only requires the basic requirements and can be simply built by running the following command in the `Bit.Websites.Platform.Server` project folder: ```bash dotnet build diff --git a/src/Bit.Build.props b/src/Bit.Build.props index 82980b695d..2f03c8ff89 100644 --- a/src/Bit.Build.props +++ b/src/Bit.Build.props @@ -25,7 +25,7 @@ https://github.com/bitfoundation/bitplatform https://avatars.githubusercontent.com/u/22663390 - 7.2.0 + 7.3.0 https://github.com/bitfoundation/bitplatform/releases/tag/v-$(ReleaseVersion) $(ReleaseVersion) diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.razor b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.razor index b74c21c25d..0fc97d71a7 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.razor @@ -23,7 +23,7 @@ { } - @GetText() + @GetText() } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.razor.cs index a9418a4095..abe5116391 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.razor.cs @@ -5,6 +5,7 @@ public partial class BitToggleButton private bool IsCheckedHasBeenSet; private bool isChecked; + private BitButtonSize? size; private BitButtonStyle buttonStyle = BitButtonStyle.Primary; private int? _tabIndex; @@ -117,6 +118,22 @@ public bool IsChecked /// [Parameter] public string? OnTitle { get; set; } + /// + /// The size of button, Possible values: Small | Medium | Large + /// + [Parameter] + public BitButtonSize? Size + { + get => size; + set + { + if (size == value) return; + + size = value; + ClassBuilder.Reset(); + } + } + /// /// Custom CSS styles for different parts of the BitToggleButton component. /// @@ -139,11 +156,23 @@ protected override void RegisterCssClasses() { ClassBuilder.Register(() => Classes?.Root); - ClassBuilder.Register(() => ButtonStyle == BitButtonStyle.Primary - ? $"{RootElementClass}-pri" - : $"{RootElementClass}-std"); + ClassBuilder.Register(() => IsChecked ? "bit-tgb-chk" : string.Empty); - ClassBuilder.Register(() => IsChecked ? $"{RootElementClass}-chk" : string.Empty); + ClassBuilder.Register(() => ButtonStyle switch + { + BitButtonStyle.Primary => "bit-tgb-pri", + BitButtonStyle.Standard => "bit-tgb-std", + BitButtonStyle.Text => "bit-tgb-txt", + _ => "bit-tgb-pri" + }); + + ClassBuilder.Register(() => Size switch + { + BitButtonSize.Small => "bit-tgb-sm", + BitButtonSize.Medium => "bit-tgb-md", + BitButtonSize.Large => "bit-tgb-lg", + _ => string.Empty + }); } protected override void RegisterCssStyles() diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.scss b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.scss index e023f316cb..370a1ff642 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.scss +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitToggleButton/BitToggleButton.scss @@ -2,13 +2,15 @@ .bit-tgb { cursor: pointer; - text-align: center; position: relative; - display: inline-block; + text-align: center; + align-items: center; + display: inline-flex; text-decoration: none; min-width: spacing(10); min-height: spacing(4); box-sizing: border-box; + justify-content: center; font-size: spacing(1.75); padding: spacing(0.5) spacing(2); border-width: $shape-border-width; @@ -21,74 +23,101 @@ cursor: default; pointer-events: none; color: $color-foreground-disabled; - border-color: $color-border-disabled; - background-color: $color-background-disabled; } } .bit-tgb-pri { - color: $color-primary-text; - border-color: $color-primary-main; - background-color: $color-primary-main; + color: var(--bit-tgb-pri-clr); + background-color: var(--bit-tgb-bg-clr); + border-color: var(--bit-tgb-pri-brd-clr); + --bit-tgb-bg-clr: #{$color-primary-main}; + --bit-tgb-pri-clr: #{$color-primary-text}; + --bit-tgb-pri-brd-clr: #{$color-primary-main}; + --bit-tgb-pri-hover-bg-clr: #{$color-action-hover-primary}; + --bit-tgb-pri-active-bg-clr: #{$color-action-active-primary}; + --bit-tgb-chk-bg-clr: #{$color-primary-dark}; + --bit-tgb-chk-brd-clr: #{$color-primary-dark}; @media (hover: hover) { &:hover { - border-color: $color-action-hover-primary; - background-color: $color-action-hover-primary; + border-color: var(--bit-tgb-pri-hover-bg-clr); + background-color: var(--bit-tgb-pri-hover-bg-clr); } } &:active { - border-color: $color-action-active-primary; - background-color: $color-action-active-primary; + border-color: var(--bit-tgb-pri-active-bg-clr); + background-color: var(--bit-tgb-pri-active-bg-clr); } - &.bit-tgb-chk { - border-color: $color-primary-dark; - background-color: $color-primary-dark; - - @media (hover: hover) { - &:hover { - border-color: $color-primary-dark; - background-color: $color-primary-dark; - } - } - - &:active { - border-color: $color-primary-dark; - background-color: $color-primary-dark; - } + &.bit-dis { + border-color: $color-border-disabled; + background-color: $color-background-disabled; } } .bit-tgb-std { - color: $color-secondary-text; - border-color: $color-border-primary; + color: var(--bit-tgb-sec-clr); background-color: $color-secondary-main; + border-color: var(--bit-tgb-sec-brd-clr); + --bit-tgb-sec-clr: #{$color-secondary-text}; + --bit-tgb-sec-brd-clr: #{$color-secondary-text}; + --bit-tgb-sec-hover-bg-clr: #{$color-action-hover-secondary}; + --bit-tgb-sec-active-bg-clr: #{$color-action-active-secondary}; + --bit-tgb-chk-bg-clr: #{$color-secondary-dark}; + --bit-tgb-chk-brd-clr: #{$color-secondary-text}; @media (hover: hover) { &:hover { - background-color: $color-action-hover-secondary; + background-color: var(--bit-tgb-sec-hover-bg-clr); } } &:active { - background-color: $color-action-active-secondary; + background-color: var(--bit-tgb-sec-active-bg-clr); } - &.bit-tgb-chk { - background-color: $color-secondary-dark; + &.bit-dis { + border-color: $color-border-disabled; + } +} + +.bit-tgb-txt { + border-color: transparent; + color: var(--bit-tgb-sec-clr); + background-color: transparent; + --bit-tgb-sec-clr: #{$color-secondary-text}; + --bit-tgb-sec-hover-bg-clr: #{$color-action-hover-secondary}; + --bit-tgb-sec-active-bg-clr: #{$color-action-active-secondary}; + --bit-tgb-chk-bg-clr: #{$color-secondary-dark}; + --bit-tgb-chk-brd-clr: transparent; - @media (hover: hover) { - &:hover { - background-color: $color-secondary-dark; - } + @media (hover: hover) { + &:hover { + background-color: var(--bit-tgb-sec-hover-bg-clr); } + } + + &:active { + background-color: var(--bit-tgb-sec-active-bg-clr); + } +} + +.bit-tgb-chk { + border-color: var(--bit-tgb-chk-brd-clr); + background-color: var(--bit-tgb-chk-bg-clr); - &:active { - background-color: $color-secondary-dark; + @media (hover: hover) { + &:hover { + border-color: var(--bit-tgb-chk-brd-clr); + background-color: var(--bit-tgb-chk-bg-clr); } } + + &:active { + border-color: var(--bit-tgb-chk-brd-clr); + background-color: var(--bit-tgb-chk-bg-clr); + } } .bit-tgb-con { @@ -104,6 +133,20 @@ } } -.bit-tgb-txt { +.bit-tgb-btx { display: block; } + +.bit-tgb-sm { + min-width: spacing(6); + min-height: spacing(3); + font-size: spacing(1.5); + padding: spacing(0.3) spacing(1.5); +} + +.bit-tgb-lg { + min-width: spacing(10); + min-height: spacing(5); + font-size: spacing(2); + padding: spacing(0.7) spacing(2.5); +} diff --git a/src/BlazorUI/Demo/Client/App/Bit.BlazorUI.Demo.Client.App.csproj b/src/BlazorUI/Demo/Client/App/Bit.BlazorUI.Demo.Client.App.csproj index bd2f92a58e..3373e7ed0a 100644 --- a/src/BlazorUI/Demo/Client/App/Bit.BlazorUI.Demo.Client.App.csproj +++ b/src/BlazorUI/Demo/Client/App/Bit.BlazorUI.Demo.Client.App.csproj @@ -77,7 +77,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Client/App/MauiProgram.cs b/src/BlazorUI/Demo/Client/App/MauiProgram.cs index 463e730796..1c584d8547 100644 --- a/src/BlazorUI/Demo/Client/App/MauiProgram.cs +++ b/src/BlazorUI/Demo/Client/App/MauiProgram.cs @@ -24,11 +24,10 @@ public static MauiAppBuilder CreateMauiAppBuilder() #endif var builder = MauiApp.CreateBuilder(); - var assembly = typeof(MainLayout).GetTypeInfo().Assembly; builder .UseMauiApp() - .Configuration.AddJsonFile(new EmbeddedFileProvider(assembly), "appsettings.json", optional: false, false); + .Configuration.AddClientConfigurations(); var services = builder.Services; @@ -37,11 +36,12 @@ public static MauiAppBuilder CreateMauiAppBuilder() services.AddBlazorWebViewDeveloperTools(); #endif + Uri.TryCreate(builder.Configuration.GetApiServerAddress(), UriKind.Absolute, out var apiServerAddress); services.AddScoped(sp => { HttpClient httpClient = new(sp.GetRequiredService()) { - BaseAddress = new Uri(sp.GetRequiredService().GetApiServerAddress()) + BaseAddress = apiServerAddress }; return httpClient; diff --git a/src/BlazorUI/Demo/Client/Core/Bit.BlazorUI.Demo.Client.Core.csproj b/src/BlazorUI/Demo/Client/Core/Bit.BlazorUI.Demo.Client.Core.csproj index a90feec10e..c1a77e70eb 100644 --- a/src/BlazorUI/Demo/Client/Core/Bit.BlazorUI.Demo.Client.Core.csproj +++ b/src/BlazorUI/Demo/Client/Core/Bit.BlazorUI.Demo.Client.Core.csproj @@ -26,12 +26,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/BlazorUI/Demo/Client/Core/Extensions/IConfigurationBuilderExtensions.cs b/src/BlazorUI/Demo/Client/Core/Extensions/IConfigurationBuilderExtensions.cs new file mode 100644 index 0000000000..fdd3341ce0 --- /dev/null +++ b/src/BlazorUI/Demo/Client/Core/Extensions/IConfigurationBuilderExtensions.cs @@ -0,0 +1,12 @@ +using System.Reflection; + +namespace Microsoft.Extensions.Configuration; + +public static class IConfigurationBuilderExtensions +{ + public static void AddClientConfigurations(this IConfigurationBuilder builder) + { + var assembly = Assembly.Load("Bit.BlazorUI.Demo.Client.Core"); + builder.AddJsonStream(assembly.GetManifestResourceStream("Bit.BlazorUI.Demo.Client.Core.appsettings.json")!); + } +} diff --git a/src/BlazorUI/Demo/Client/Core/Extensions/IConfigurationExtensions.cs b/src/BlazorUI/Demo/Client/Core/Extensions/IConfigurationExtensions.cs index fd648e9afe..e88b29bed5 100644 --- a/src/BlazorUI/Demo/Client/Core/Extensions/IConfigurationExtensions.cs +++ b/src/BlazorUI/Demo/Client/Core/Extensions/IConfigurationExtensions.cs @@ -1,12 +1,11 @@ -namespace Microsoft.Extensions.Configuration; +//-:cnd:noEmit +namespace Microsoft.Extensions.Configuration; public static class IConfigurationExtensions { public static string GetApiServerAddress(this IConfiguration configuration) { -#if BlazorWebAssembly - return "api/"; -#else - return configuration.GetValue("ApiServerAddress") ?? throw new InvalidOperationException("Could not find ApiServerAddress config"); -#endif + var apiServerAddress = configuration.GetValue("ApiServerAddress", defaultValue: "api/")!; + + return Uri.TryCreate(apiServerAddress, UriKind.RelativeOrAbsolute, out _) ? apiServerAddress : throw new InvalidOperationException($"Api server address {apiServerAddress} is invalid"); } } diff --git a/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor b/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor index 2466d9353e..799ba506c2 100644 --- a/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor +++ b/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor @@ -10,8 +10,12 @@ ComponentParameters="componentParameters" ComponentSubClasses="componentSubClasses" ComponentSubEnums="componentSubEnums"> - + +
+ The ToggleButton offers three style options: Primary (default), Standard, and Text. +
+
@@ -20,53 +24,63 @@ OffIconName="@BitIconName.Microphone" OnIconName="@BitIconName.MicOff" ButtonStyle="BitButtonStyle.Standard" /> - +
- + -
Style & Class:
+
+ Primary buttons are attention-grabbing, featuring a filled appearance. They're designed for essential actions at the core of your application. +

-
- + + +
+
+
- + + +
+ Standard buttons offer a moderate level of emphasis, suitable for important actions that aren't central to the application. They serve as a middle ground between Text buttons and the more prominent Primary buttons, providing flexibility in emphasis.
-

-
Styles & Classes:

-
- - - + + ButtonStyle="BitButtonStyle.Standard" /> +
- + -
-
Visible: [ Visible toggle button ]
-
Hidden: [ Hidden toggle button ]
-
Collapsed: [ Collapsed toggle button ]
+
+ Text buttons are best suited for understated actions, serving as a less prominent choice in various interface elements. +
+
+
+ +
- + +
+ Explore default checked state, two-way binding, and handling change events for a customizable user experience. +
+
DefaultIsChecked:

@@ -78,19 +92,93 @@
Two-way bound:

- - + +



OnChange:

- - Check status is: @example32Value + Check status is: @example52Value +
+ + + + + +
+ Varying sizes for buttons tailored to meet diverse design needs, ensuring flexibility and visual hierarchy within your interface. +
+
+
+
+ Small + Medium + Large +
+
+ Small + Medium + Large +
+
+ Small + Medium + Large +
+
+
+
+ + + +
+ Empower customization by overriding default styles and classes, allowing tailored design modifications to suit specific UI requirements. +
+
+
Component's Style & Class:
+
+
+ + + +
+

+
Styles & Classes:
+
+
+ + + +
+
+
+ + + +
+ You can control the display of buttons with three settings, 'Visible' for full display, 'Hidden' for concealing buttons without altering layout, and 'Collapsed' to remove the button and its space. +
+
+
+
Visible: [ Visible toggle button ]
+
Hidden: [ Hidden toggle button ]
+
Collapsed: [ Collapsed toggle button ]
diff --git a/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor.cs b/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor.cs index e4a6ec6cd2..33cff510e3 100644 --- a/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor.cs @@ -120,6 +120,15 @@ public partial class BitToggleButtonDemo Description = "The title of the BitToggleButton when it is checked.", }, new() + { + Name = "Size", + Type = "BitButtonSize", + LinkType = LinkType.Link, + Href = "#button-size-enum", + DefaultValue = "null", + Description = "The size of button, Possible values: Small | Medium | Large.", + }, + new() { Name = "Styles", Type = "BitToggleButtonClassStyles?", @@ -204,14 +213,47 @@ public partial class BitToggleButtonDemo Name= "Standard", Description="The button with black text on a white background.", Value="1", + }, + new() + { + Name= "Text", + Description="The button for less-pronounced actions.", + Value="2", + } + } + }, + new() + { + Id = "button-size-enum", + Name = "BitButtonSize", + Description = "", + Items = new() + { + new() + { + Name= "Small", + Description="The small size button.", + Value="0", + }, + new() + { + Name= "Medium", + Description="The medium size button.", + Value="1", + }, + new() + { + Name= "Large", + Description="The large size button.", + Value="2", } } } }; - private bool example31Value; - private bool example32Value; + private bool example51Value; + private bool example52Value; private readonly string example1RazorCode = @" @@ -222,10 +264,59 @@ public partial class BitToggleButtonDemo OffIconName=""@BitIconName.Microphone"" OnIconName=""@BitIconName.MicOff"" ButtonStyle=""BitButtonStyle.Standard"" /> -"; - private readonly string example1CsharpCode = @""; +"; private readonly string example2RazorCode = @" + +"; + + private readonly string example3RazorCode = @" + +"; + + private readonly string example4RazorCode = @" + +"; + + private readonly string example5RazorCode = @" + + + + + + example52Value = v"" + OffText=""Unmute"" OnText=""Mute"" + OffIconName=""@BitIconName.Microphone"" OnIconName=""@BitIconName.MicOff"" /> +Check status is: @example52Value"; + private readonly string example5CsharpCode = @" +private bool example51Value; +private bool example52Value;"; + + private readonly string example6RazorCode = @" +Small +Medium +Large + +Small +Medium +Large + +Small +Medium +Large"; + + private readonly string example7RazorCode = @" + @@ -257,34 +349,15 @@ public partial class BitToggleButtonDemo + Styles=""@(new() { Container = ""font-size: 18px;"", Icon = ""color: red;"", Text = ""color: blue;"" })"" /> "; - private readonly string example2CsharpCode = @""; + Classes=""@(new() { Container = ""custom-container"", Icon = ""custom-icon"", Text = ""custom-text"" })"" />"; - private readonly string example3RazorCode = @" + private readonly string example8RazorCode = @" Visible: [ Visible toggle button ] Hidden: [ Hidden toggle button ] Collapsed: [ Collapsed toggle button ]"; - - private readonly string example4RazorCode = @" - - - - - - example32Value = v"" - OffText=""Unmute"" OnText=""Mute"" - OffIconName=""@BitIconName.Microphone"" OnIconName=""@BitIconName.MicOff"" /> -Check status is: @example32Value"; - private readonly string example4CsharpCode = @" -private bool example31Value; -private bool example32Value;"; } diff --git a/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor.scss b/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor.scss index 24175ce582..83ab080adb 100644 --- a/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor.scss +++ b/src/BlazorUI/Demo/Client/Core/Pages/Components/Buttons/BitToggleButtonDemo.razor.scss @@ -11,6 +11,18 @@ } } +.buttons-container { + gap: 0.5rem; + display: flex; + flex-flow: row wrap; + align-items: flex-start; +} + +.buttons-container-grid { + gap: 0.5rem; + display: grid; +} + ::deep { .custom-class { color: aqua; diff --git a/src/BlazorUI/Demo/Client/Web/Bit.BlazorUI.Demo.Client.Web.csproj b/src/BlazorUI/Demo/Client/Web/Bit.BlazorUI.Demo.Client.Web.csproj index 86bbb2c779..e41e6ce6c4 100644 --- a/src/BlazorUI/Demo/Client/Web/Bit.BlazorUI.Demo.Client.Web.csproj +++ b/src/BlazorUI/Demo/Client/Web/Bit.BlazorUI.Demo.Client.Web.csproj @@ -34,9 +34,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Client/Web/Extensions/HttpRequestExtensions.cs b/src/BlazorUI/Demo/Client/Web/Extensions/HttpRequestExtensions.cs index 0f62030960..ad186f2799 100644 --- a/src/BlazorUI/Demo/Client/Web/Extensions/HttpRequestExtensions.cs +++ b/src/BlazorUI/Demo/Client/Web/Extensions/HttpRequestExtensions.cs @@ -4,6 +4,20 @@ namespace Microsoft.AspNetCore.Http; public static class HttpRequestExtensions { + /// + /// https://blog.elmah.io/how-to-get-base-url-in-asp-net-core/ + /// + public static string GetBaseUrl(this HttpRequest req) + { + var uriBuilder = new UriBuilder(req.Scheme, req.Host.Host, req.Host.Port ?? -1); + if (uriBuilder.Uri.IsDefaultPort) + { + uriBuilder.Port = -1; + } + + return uriBuilder.Uri.AbsoluteUri; + } + public static bool ShouldRenderStaticMode(this HttpRequest request) { var agent = GetLoweredUserAgent(request); diff --git a/src/BlazorUI/Demo/Client/Web/Program.BlazorElectron.cs b/src/BlazorUI/Demo/Client/Web/Program.BlazorElectron.cs index a6c765401b..10be3413f0 100644 --- a/src/BlazorUI/Demo/Client/Web/Program.BlazorElectron.cs +++ b/src/BlazorUI/Demo/Client/Web/Program.BlazorElectron.cs @@ -10,7 +10,7 @@ public partial class Program public static WebApplication CreateHostBuilder(string[] args) { var builder = WebApplication.CreateBuilder(args); - builder.Configuration.AddJsonStream(typeof(Core.Shared.MainLayout).Assembly.GetManifestResourceStream("Bit.BlazorUI.Demo.Client.Core.appsettings.json")!); + builder.Configuration.AddClientConfigurations(); builder.WebHost.UseElectron(args); builder.Services.AddElectron(); diff --git a/src/BlazorUI/Demo/Client/Web/Program.BlazorServer.cs b/src/BlazorUI/Demo/Client/Web/Program.BlazorServer.cs index b04e87ae9f..167780e6ad 100644 --- a/src/BlazorUI/Demo/Client/Web/Program.BlazorServer.cs +++ b/src/BlazorUI/Demo/Client/Web/Program.BlazorServer.cs @@ -6,7 +6,7 @@ public partial class Program public static WebApplication CreateHostBuilder(string[] args) { var builder = WebApplication.CreateBuilder(args); - builder.Configuration.AddJsonStream(typeof(Core.Shared.MainLayout).Assembly.GetManifestResourceStream("Bit.BlazorUI.Demo.Client.Core.appsettings.json")!); + builder.Configuration.AddClientConfigurations(); #if DEBUG if (OperatingSystem.IsWindows()) diff --git a/src/BlazorUI/Demo/Client/Web/Program.BlazorWebAssembly.cs b/src/BlazorUI/Demo/Client/Web/Program.BlazorWebAssembly.cs index 7699599182..eddfd42865 100644 --- a/src/BlazorUI/Demo/Client/Web/Program.BlazorWebAssembly.cs +++ b/src/BlazorUI/Demo/Client/Web/Program.BlazorWebAssembly.cs @@ -10,11 +10,16 @@ public partial class Program public static WebAssemblyHost CreateHostBuilder(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(); - builder.Configuration.AddJsonStream(typeof(Core.Shared.MainLayout).Assembly.GetManifestResourceStream("Bit.BlazorUI.Demo.Client.Core.appsettings.json")!); + builder.Configuration.AddClientConfigurations(); var apiServerAddressConfig = builder.Configuration.GetApiServerAddress(); - var apiServerAddress = new Uri($"{builder.HostEnvironment.BaseAddress}{apiServerAddressConfig}"); + Uri.TryCreate(builder.Configuration.GetApiServerAddress(), UriKind.RelativeOrAbsolute, out var apiServerAddress); + + if (apiServerAddress.IsAbsoluteUri is false) + { + apiServerAddress = new Uri($"{builder.HostEnvironment.BaseAddress}{apiServerAddress}"); + } builder.Services.AddSingleton(sp => new HttpClient(sp.GetRequiredService()) { BaseAddress = apiServerAddress }); builder.Services.AddScoped(); diff --git a/src/BlazorUI/Demo/Client/Web/Startup/Services.cs b/src/BlazorUI/Demo/Client/Web/Startup/Services.cs index 14a8530709..787189b395 100644 --- a/src/BlazorUI/Demo/Client/Web/Startup/Services.cs +++ b/src/BlazorUI/Demo/Client/Web/Startup/Services.cs @@ -8,11 +8,12 @@ public static class Services { public static void Add(IServiceCollection services, IConfiguration configuration) { + Uri.TryCreate(configuration.GetApiServerAddress(), UriKind.Absolute, out var apiServerAddress); services.AddScoped(sp => { HttpClient httpClient = new(sp.GetRequiredService()) { - BaseAddress = new Uri(sp.GetRequiredService().GetApiServerAddress()) + BaseAddress = apiServerAddress }; return httpClient; diff --git a/src/BlazorUI/Demo/Client/Web/wwwroot/service-worker.js b/src/BlazorUI/Demo/Client/Web/wwwroot/service-worker.js index 4d94884cf4..331d4effbc 100644 --- a/src/BlazorUI/Demo/Client/Web/wwwroot/service-worker.js +++ b/src/BlazorUI/Demo/Client/Web/wwwroot/service-worker.js @@ -1,4 +1,4 @@ -// bit version: 7.2.0 +// bit version: 7.3.0 // https://github.com/bitfoundation/bitplatform/tree/develop/src/Bswup // Make sure to apply all changes you make here to the service-worker.published.js file too (if required). diff --git a/src/BlazorUI/Demo/Client/Web/wwwroot/service-worker.published.js b/src/BlazorUI/Demo/Client/Web/wwwroot/service-worker.published.js index 7147b3952b..fcfa95e832 100644 --- a/src/BlazorUI/Demo/Client/Web/wwwroot/service-worker.published.js +++ b/src/BlazorUI/Demo/Client/Web/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 7.2.0 +// bit version: 7.3.0 // https://github.com/bitfoundation/bitplatform/tree/develop/src/Bswup self.assetsExclude = [ diff --git a/src/BlazorUI/Demo/Directory.Build.props b/src/BlazorUI/Demo/Directory.Build.props index 2244c857c7..16b34f62a0 100644 --- a/src/BlazorUI/Demo/Directory.Build.props +++ b/src/BlazorUI/Demo/Directory.Build.props @@ -1,4 +1,4 @@ - + diff --git a/src/BlazorUI/Demo/Server/Api/Bit.BlazorUI.Demo.Server.Api.csproj b/src/BlazorUI/Demo/Server/Api/Bit.BlazorUI.Demo.Server.Api.csproj index cc3149c7c4..09a27c2478 100644 --- a/src/BlazorUI/Demo/Server/Api/Bit.BlazorUI.Demo.Server.Api.csproj +++ b/src/BlazorUI/Demo/Server/Api/Bit.BlazorUI.Demo.Server.Api.csproj @@ -13,11 +13,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Server/Api/Program.cs b/src/BlazorUI/Demo/Server/Api/Program.cs index bc36f5862a..050af97eef 100644 --- a/src/BlazorUI/Demo/Server/Api/Program.cs +++ b/src/BlazorUI/Demo/Server/Api/Program.cs @@ -1,5 +1,9 @@ var builder = WebApplication.CreateBuilder(args); +#if BlazorWebAssembly +builder.Configuration.AddClientConfigurations(); +#endif + #if DEBUG if (OperatingSystem.IsWindows()) { diff --git a/src/BlazorUI/Demo/Server/Api/Startup/Services.cs b/src/BlazorUI/Demo/Server/Api/Startup/Services.cs index df3d99ba8c..bc392337f7 100644 --- a/src/BlazorUI/Demo/Server/Api/Startup/Services.cs +++ b/src/BlazorUI/Demo/Server/Api/Startup/Services.cs @@ -30,8 +30,12 @@ public static void Add(IServiceCollection services, IWebHostEnvironment env, ICo .ConfigurePrimaryHttpMessageHandler() .ConfigureHttpClient((sp, httpClient) => { - NavigationManager navManager = sp.GetRequiredService().HttpContext!.RequestServices.GetRequiredService(); - httpClient.BaseAddress = new Uri($"{navManager.BaseUri}api/"); + Uri.TryCreate(configuration.GetApiServerAddress(), UriKind.RelativeOrAbsolute, out var apiServerAddress); + if (apiServerAddress!.IsAbsoluteUri is false) + { + apiServerAddress = new Uri($"{sp.GetRequiredService().HttpContext!.Request.GetBaseUrl()}{apiServerAddress}"); + } + httpClient.BaseAddress = apiServerAddress; }); services.AddScoped(); @@ -43,7 +47,6 @@ public static void Add(IServiceCollection services, IWebHostEnvironment env, ICo // for other usages of http client, for example calling 3rd party apis, either use services.AddHttpClient("NamedHttpClient") or services.AddHttpClient(); }); services.AddRazorPages(); - services.AddMvcCore(); #endif services.AddCors(); diff --git a/src/BlazorUI/Demo/Shared/Bit.BlazorUI.Demo.Shared.csproj b/src/BlazorUI/Demo/Shared/Bit.BlazorUI.Demo.Shared.csproj index fd544c0e8a..87ebc7d134 100644 --- a/src/BlazorUI/Demo/Shared/Bit.BlazorUI.Demo.Shared.csproj +++ b/src/BlazorUI/Demo/Shared/Bit.BlazorUI.Demo.Shared.csproj @@ -5,11 +5,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js index e03cbb1bf5..c0ee5e09ac 100644 --- a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js +++ b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js @@ -1,4 +1,4 @@ -// bit version: 7.2.0 +// bit version: 7.3.0 self.assetsExclude = [/\.scp\.css$/, /weather\.json$/]; self.caseInsensitiveUrl = true; diff --git a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js index 22eea148a7..149175f193 100644 --- a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js +++ b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 7.2.0 +// bit version: 7.3.0 self.assetsExclude = [/\.scp\.css$/, /weather\.json$/]; self.caseInsensitiveUrl = true; diff --git a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts index 232da0b4f8..fe2d649719 100644 --- a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts +++ b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts @@ -1,4 +1,4 @@ -window['bit-bswup.progress version'] = '7.2.0'; +window['bit-bswup.progress version'] = '7.3.0'; ; (function () { (window as any).startBswupProgress = (autoReload: boolean, diff --git a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts index 36438cb1b4..f5d1db1c66 100644 --- a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts +++ b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts @@ -1,4 +1,4 @@ -self['bit-bswup.sw version'] = '7.2.0'; +self['bit-bswup.sw version'] = '7.3.0'; interface Window { clients: any diff --git a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts index cc477effff..f1498c5772 100644 --- a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts +++ b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts @@ -1,4 +1,4 @@ -window['bit-bswup version'] = '7.2.0'; +window['bit-bswup version'] = '7.3.0'; declare const Blazor: any; diff --git a/src/Bswup/FullDemo/Client/wwwroot/service-worker.js b/src/Bswup/FullDemo/Client/wwwroot/service-worker.js index 5dc698f6e7..fa56e8abdd 100644 --- a/src/Bswup/FullDemo/Client/wwwroot/service-worker.js +++ b/src/Bswup/FullDemo/Client/wwwroot/service-worker.js @@ -1,4 +1,4 @@ -// bit version: 7.2.0 +// bit version: 7.3.0 // In development, always fetch from the network and do not enable offline support. // This is because caching would make development more difficult (changes would not diff --git a/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js b/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js index d344e1729c..5dd9f62f48 100644 --- a/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js +++ b/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 7.2.0 +// bit version: 7.3.0 self.assetsInclude = []; self.assetsExclude = [/\.scp\.css$/, /weather\.json$/]; diff --git a/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts b/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts index 0709302ee1..6a71d5ba1a 100644 --- a/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts +++ b/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts @@ -1,4 +1,4 @@ -window['bit-bup.progress version'] = '7.2.0'; +window['bit-bup.progress version'] = '7.3.0'; ; (function () { (window as any).startBupProgress = (showLogs: boolean, showAssets: boolean, appContainerSelector: string, hideApp: boolean, autoHide: boolean) => { diff --git a/src/Bup/Bit.Bup/Scripts/bit-bup.ts b/src/Bup/Bit.Bup/Scripts/bit-bup.ts index 822766dcb5..8a75489b5b 100644 --- a/src/Bup/Bit.Bup/Scripts/bit-bup.ts +++ b/src/Bup/Bit.Bup/Scripts/bit-bup.ts @@ -1,4 +1,4 @@ -window['bit-bup version'] = '7.2.0'; +window['bit-bup version'] = '7.3.0'; declare const Blazor: any; diff --git a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj index 7431a32c4c..50e95c9040 100644 --- a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj +++ b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj @@ -1,4 +1,4 @@ - + @@ -15,14 +15,14 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj index 16e7022cbb..d61615e49f 100644 --- a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj +++ b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj @@ -1,4 +1,4 @@ - + @@ -18,14 +18,14 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/.github/workflows/cd.yml b/src/Templates/BlazorWeb/Bit.BlazorWeb/.github/workflows/cd.yml index 4949d7a6b4..f9b3680db7 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/.github/workflows/cd.yml +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/.github/workflows/cd.yml @@ -35,13 +35,6 @@ jobs: - name: Install wasm run: cd src && dotnet workload install wasm-tools wasm-experimental - - - name: Update appsettings.json api server address - uses: microsoft/variable-substitution@v1 - with: - files: 'src/BlazorWeb.Client/appsettings.json' - env: - ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} - name: Generate CSS/JS files run: dotnet build src/BlazorWeb.Client/BlazorWeb.Client.csproj -t:BeforeBuildTasks --no-restore diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/BlazorWeb.Client.csproj b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/BlazorWeb.Client.csproj index 45aefa1c47..edf9425fb8 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/BlazorWeb.Client.csproj +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/BlazorWeb.Client.csproj @@ -30,17 +30,17 @@ - - - + + + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Categories/AddOrEditCategoryPage.razor b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Categories/AddOrEditCategoryPage.razor index da726dec3f..7f950be30a 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Categories/AddOrEditCategoryPage.razor +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Categories/AddOrEditCategoryPage.razor @@ -54,8 +54,8 @@
@Localizer[nameof(AppStrings.Color)] -
- @foreach (var color in new[] { "#FFCD56", "#FF6384", "#4BC0C0", "#FF9124", "#2B88D8", "#C7E0F4" }) +
+ @foreach (var color in new[] { "#FFCD56", "#FF6384", "#4BC0C0", "#FF9124", "#2B88D8", "#C7E0F4" }) {
- + @Localizer[nameof(AppStrings.Save)] - +
diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/EditProfilePage.razor b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/EditProfilePage.razor index 485b9c625b..47e58e3d58 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/EditProfilePage.razor +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/EditProfilePage.razor @@ -37,11 +37,11 @@
@if (_user.ProfileImageName is not null) { - + @Localizer[nameof(AppStrings.Remove)] - + } @Localizer[nameof(AppStrings.ProfileImage)] @@ -92,13 +92,13 @@
- + @Localizer[nameof(AppStrings.Save)] - + } diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/EmailConfirmationPage.razor b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/EmailConfirmationPage.razor index e942ee887d..fee2629740 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/EmailConfirmationPage.razor +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/EmailConfirmationPage.razor @@ -37,14 +37,14 @@ @Localizer[nameof(AppStrings.InvalidConfirmationLinkMessage)]
- + @Localizer[nameof(AppStrings.ResendEmail)] - + }
diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/ForgotPasswordPage.razor b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/ForgotPasswordPage.razor index 6d5b8e77b5..26b5abfc12 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/ForgotPasswordPage.razor +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/ForgotPasswordPage.razor @@ -30,13 +30,13 @@ - + @Localizer[nameof(AppStrings.Submit)] - + \ No newline at end of file diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/ResetPasswordPage.razor b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/ResetPasswordPage.razor index cd865b42d5..90a6200435 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/ResetPasswordPage.razor +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/ResetPasswordPage.razor @@ -35,13 +35,13 @@ - + @Localizer[nameof(AppStrings.ResetPassword)] - + diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/SignInPage.razor b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/SignInPage.razor index 8efdfd89bb..e2390cda67 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/SignInPage.razor +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/SignInPage.razor @@ -3,54 +3,54 @@ @Localizer[nameof(AppStrings.SignInTitle)] -
- - - - @if (string.IsNullOrEmpty(_signInMessage) is false) - { - - @_signInMessage - - } - -

@Localizer[nameof(AppStrings.SignInTitle)]

- -
- - -
- -
- - -
- - - @Localizer[nameof(AppStrings.SignIn)] - - -
- @Localizer[nameof(AppStrings.ForgotPasswordLink)] +
+ + + + @if (string.IsNullOrEmpty(_signInMessage) is false) + { + + @_signInMessage + + } + +

@Localizer[nameof(AppStrings.SignInTitle)]

+ +
+ +
-
- @Localizer[nameof(AppStrings.DontHaveAccountMessage)] @Localizer[nameof(AppStrings.SignUp)] +
+ +
- -
+ + + @Localizer[nameof(AppStrings.SignIn)] + + +
+ @Localizer[nameof(AppStrings.ForgotPasswordLink)] +
+ +
+ @Localizer[nameof(AppStrings.DontHaveAccountMessage)] @Localizer[nameof(AppStrings.SignUp)] +
+
+
diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/SignUpPage.razor b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/SignUpPage.razor index b40cd9fee4..f6383c7aef 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/SignUpPage.razor +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Identity/SignUpPage.razor @@ -35,14 +35,14 @@
- @Localizer[nameof(AppStrings.Or)] -
- + @Localizer[nameof(AppStrings.ResendEmail)] - +
@Localizer[nameof(AppStrings.SignIn)] @@ -81,14 +81,14 @@
- + @Localizer[nameof(AppStrings.SignUp)] - +
@Localizer[nameof(AppStrings.AlreadyHaveAccountMessage)] @Localizer[nameof(AppStrings.SignIn)] diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Products/AddOrEditProductModal.razor b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Products/AddOrEditProductModal.razor index 94c3d51440..9a55d7e176 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Products/AddOrEditProductModal.razor +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Products/AddOrEditProductModal.razor @@ -53,9 +53,9 @@
- + @Localizer[nameof(AppStrings.Save)] - +
\ No newline at end of file diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Todo/TodoPage.razor b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Todo/TodoPage.razor index 353d13acbf..65174660df 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Todo/TodoPage.razor +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Client/Pages/Todo/TodoPage.razor @@ -3,28 +3,28 @@ @Localizer[nameof(AppStrings.TodoTitle)] -
-
- -
+
+
+ +
-
-

@Localizer[nameof(AppStrings.TodoTitle)]

+
+

@Localizer[nameof(AppStrings.TodoTitle)]

- + @Localizer[nameof(AppStrings.Add)] - +
@@ -61,7 +61,7 @@
@Localizer[nameof(AppStrings.NoTodos)] -
+
} else { diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Server/BlazorWeb.Server.csproj b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Server/BlazorWeb.Server.csproj index 5fb80b47b4..4a4ff5c536 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Server/BlazorWeb.Server.csproj +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Server/BlazorWeb.Server.csproj @@ -12,11 +12,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Shared/BlazorWeb.Shared.csproj b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Shared/BlazorWeb.Shared.csproj index 218ce24b10..5f9c238110 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Shared/BlazorWeb.Shared.csproj +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/BlazorWeb.Shared/BlazorWeb.Shared.csproj @@ -6,11 +6,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/Directory.Build.props b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/Directory.Build.props index 8480a62102..e3f5374167 100644 --- a/src/Templates/BlazorWeb/Bit.BlazorWeb/src/Directory.Build.props +++ b/src/Templates/BlazorWeb/Bit.BlazorWeb/src/Directory.Build.props @@ -1,4 +1,4 @@ - + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/.github/workflows/cd.yml b/src/Templates/Boilerplate/Bit.Boilerplate/.github/workflows/cd.yml index a31752aede..5652a4f4e0 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/.github/workflows/cd.yml +++ b/src/Templates/Boilerplate/Bit.Boilerplate/.github/workflows/cd.yml @@ -35,6 +35,13 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + + - name: Update appsettings.json api server address + uses: microsoft/variable-substitution@v1 + with: + files: 'src/Client/Core/appsettings.json' + env: + ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} - name: Switch to blazor web assembly run: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' src/Client/Web/Boilerplate.Client.Web.csproj diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/App/Boilerplate.Client.App.csproj b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/App/Boilerplate.Client.App.csproj index 723dbba68f..ffd57b3c7b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/App/Boilerplate.Client.App.csproj +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/App/Boilerplate.Client.App.csproj @@ -85,14 +85,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/App/MauiProgram.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/App/MauiProgram.cs index 44ad66e307..3eeb182265 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/App/MauiProgram.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/App/MauiProgram.cs @@ -19,7 +19,7 @@ public static MauiApp CreateMauiApp() builder .UseMauiApp() - .Configuration.AddJsonFile(new EmbeddedFileProvider(assembly), "appsettings.json", optional: false, false); + .Configuration.AddClientConfigurations(); var services = builder.Services; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Boilerplate.Client.Core.csproj b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Boilerplate.Client.Core.csproj index d9783ca2ff..2a36dc7b14 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Boilerplate.Client.Core.csproj +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Boilerplate.Client.Core.csproj @@ -19,17 +19,17 @@ - - - + + + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Categories/AddOrEditCategoryPage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Categories/AddOrEditCategoryPage.razor index da726dec3f..7f950be30a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Categories/AddOrEditCategoryPage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Categories/AddOrEditCategoryPage.razor @@ -54,8 +54,8 @@
@Localizer[nameof(AppStrings.Color)] -
- @foreach (var color in new[] { "#FFCD56", "#FF6384", "#4BC0C0", "#FF9124", "#2B88D8", "#C7E0F4" }) +
+ @foreach (var color in new[] { "#FFCD56", "#FF6384", "#4BC0C0", "#FF9124", "#2B88D8", "#C7E0F4" }) {
- + @Localizer[nameof(AppStrings.Save)] - +
diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/EditProfilePage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/EditProfilePage.razor index 485b9c625b..47e58e3d58 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/EditProfilePage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/EditProfilePage.razor @@ -37,11 +37,11 @@
@if (_user.ProfileImageName is not null) { - + @Localizer[nameof(AppStrings.Remove)] - + } @Localizer[nameof(AppStrings.ProfileImage)] @@ -92,13 +92,13 @@
- + @Localizer[nameof(AppStrings.Save)] - + } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/EmailConfirmationPage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/EmailConfirmationPage.razor index e942ee887d..fee2629740 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/EmailConfirmationPage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/EmailConfirmationPage.razor @@ -37,14 +37,14 @@ @Localizer[nameof(AppStrings.InvalidConfirmationLinkMessage)]
- + @Localizer[nameof(AppStrings.ResendEmail)] - + }
diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/ForgotPasswordPage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/ForgotPasswordPage.razor index 6d5b8e77b5..26b5abfc12 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/ForgotPasswordPage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/ForgotPasswordPage.razor @@ -30,13 +30,13 @@
- + @Localizer[nameof(AppStrings.Submit)] - +
\ No newline at end of file diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/ResetPasswordPage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/ResetPasswordPage.razor index cd865b42d5..90a6200435 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/ResetPasswordPage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/ResetPasswordPage.razor @@ -35,13 +35,13 @@ - + @Localizer[nameof(AppStrings.ResetPassword)] - + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/SignInPage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/SignInPage.razor index 8efdfd89bb..e2390cda67 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/SignInPage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/SignInPage.razor @@ -3,54 +3,54 @@ @Localizer[nameof(AppStrings.SignInTitle)] -
- - - - @if (string.IsNullOrEmpty(_signInMessage) is false) - { - - @_signInMessage - - } - -

@Localizer[nameof(AppStrings.SignInTitle)]

- -
- - -
- -
- - -
- - - @Localizer[nameof(AppStrings.SignIn)] - - -
- @Localizer[nameof(AppStrings.ForgotPasswordLink)] +
+ + + + @if (string.IsNullOrEmpty(_signInMessage) is false) + { + + @_signInMessage + + } + +

@Localizer[nameof(AppStrings.SignInTitle)]

+ +
+ +
-
- @Localizer[nameof(AppStrings.DontHaveAccountMessage)] @Localizer[nameof(AppStrings.SignUp)] +
+ +
- -
+ + + @Localizer[nameof(AppStrings.SignIn)] + + +
+ @Localizer[nameof(AppStrings.ForgotPasswordLink)] +
+ +
+ @Localizer[nameof(AppStrings.DontHaveAccountMessage)] @Localizer[nameof(AppStrings.SignUp)] +
+
+
diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/SignUpPage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/SignUpPage.razor index b40cd9fee4..f6383c7aef 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/SignUpPage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Identity/SignUpPage.razor @@ -35,14 +35,14 @@
- @Localizer[nameof(AppStrings.Or)] -
- + @Localizer[nameof(AppStrings.ResendEmail)] - +
@Localizer[nameof(AppStrings.SignIn)] @@ -81,14 +81,14 @@
- + @Localizer[nameof(AppStrings.SignUp)] - +
@Localizer[nameof(AppStrings.AlreadyHaveAccountMessage)] @Localizer[nameof(AppStrings.SignIn)] diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Products/AddOrEditProductModal.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Products/AddOrEditProductModal.razor index 94c3d51440..9a55d7e176 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Products/AddOrEditProductModal.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Products/AddOrEditProductModal.razor @@ -53,9 +53,9 @@
- + @Localizer[nameof(AppStrings.Save)] - +
\ No newline at end of file diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Todo/TodoPage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Todo/TodoPage.razor index 34976c0b87..c0ba7d1ec9 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Todo/TodoPage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Core/Pages/Todo/TodoPage.razor @@ -3,28 +3,28 @@ @Localizer[nameof(AppStrings.TodoTitle)] -
-
- -
+
+
+ +
-
-

@Localizer[nameof(AppStrings.TodoTitle)]

+
+

@Localizer[nameof(AppStrings.TodoTitle)]

- + @Localizer[nameof(AppStrings.Add)] - +
@@ -61,7 +61,7 @@
@Localizer[nameof(AppStrings.NoTodos)] -
+
} else { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/Boilerplate.Client.Web.csproj b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/Boilerplate.Client.Web.csproj index d7c5d72c56..7ec3c585d4 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/Boilerplate.Client.Web.csproj +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/Boilerplate.Client.Web.csproj @@ -38,13 +38,13 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/Program.BlazorWebAssembly.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/Program.BlazorWebAssembly.cs index c6ee280df7..73ec17227d 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/Program.BlazorWebAssembly.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/Program.BlazorWebAssembly.cs @@ -14,7 +14,7 @@ public static WebAssemblyHost CreateHostBuilder(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(); - builder.Configuration.AddClientConfigurations(); + builder.Configuration.AddClientConfigurations(); Uri.TryCreate(builder.Configuration.GetApiServerAddress(), UriKind.RelativeOrAbsolute, out var apiServerAddress); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/wwwroot/service-worker.js b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/wwwroot/service-worker.js index 87573276a2..45306d2c17 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/wwwroot/service-worker.js +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/wwwroot/service-worker.js @@ -1,4 +1,4 @@ -// bit version: 7.2.0 +// bit version: 7.3.0 // https://github.com/bitfoundation/bitplatform/tree/develop/src/Bswup // Make sure to apply all changes you make here to the service-worker.published.js file too (if required). diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/wwwroot/service-worker.published.js b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/wwwroot/service-worker.published.js index debc670500..062a48f521 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/wwwroot/service-worker.published.js +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Web/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 7.2.0 +// bit version: 7.3.0 // https://github.com/bitfoundation/bitplatform/tree/develop/src/Bswup self.assetsInclude = []; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props index 003405c26d..2240638255 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props @@ -1,4 +1,4 @@ - + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Api/Boilerplate.Server.Api.csproj b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Api/Boilerplate.Server.Api.csproj index 45c7e81ec2..f617d71afe 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Api/Boilerplate.Server.Api.csproj +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Api/Boilerplate.Server.Api.csproj @@ -16,11 +16,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Boilerplate.Shared.csproj b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Boilerplate.Shared.csproj index ac574e303b..51d78886a7 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Boilerplate.Shared.csproj +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Boilerplate.Shared.csproj @@ -6,11 +6,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Api/Bit.Websites.Careers.Api.csproj b/src/Websites/Careers/src/Bit.Websites.Careers.Api/Bit.Websites.Careers.Api.csproj index 54f216a60e..ffb5600dda 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Api/Bit.Websites.Careers.Api.csproj +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Api/Bit.Websites.Careers.Api.csproj @@ -13,11 +13,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj b/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj index a6472df717..3e827a2de5 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj @@ -4,11 +4,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Web/Bit.Websites.Careers.Web.csproj b/src/Websites/Careers/src/Bit.Websites.Careers.Web/Bit.Websites.Careers.Web.csproj index 07d362d88c..670c82aa3f 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Web/Bit.Websites.Careers.Web.csproj +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Web/Bit.Websites.Careers.Web.csproj @@ -29,16 +29,16 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Careers/src/Directory.Build.props b/src/Websites/Careers/src/Directory.Build.props index aae49cf9fd..735274b44c 100644 --- a/src/Websites/Careers/src/Directory.Build.props +++ b/src/Websites/Careers/src/Directory.Build.props @@ -1,4 +1,4 @@ - + BlazorServer diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj index 6ab0a9edaa..d6adf013e3 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj @@ -26,14 +26,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor index caf9a0e68e..172b2a0775 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor @@ -43,7 +43,7 @@ Placeholder="Enter your message" /> - Send + Send
diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor index 46b48d6637..079e959dcf 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor @@ -143,7 +143,7 @@ Placeholder="Enter your message" /> - Send + Send } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/CreateProjectPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/CreateProjectPage.razor index d7602c397e..fa0172ae60 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/CreateProjectPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/CreateProjectPage.razor @@ -21,8 +21,8 @@ 1. Install the project templates from the NuGet package manager with one of the following commands:
-dotnet new install Bit.Boilerplate::7.1.0
-dotnet new install Bit.BlazorWeb::7.1.0
+dotnet new install Bit.Boilerplate::7.2.0 +dotnet new install Bit.BlazorWeb::7.2.0
2. Create a new project using dotnet new command or Visual Studio create new project wizard:
diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj b/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj index ec96cac86f..8730b169ed 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj @@ -11,11 +11,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj b/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj index 9bf0ab6acf..68afc2a4c7 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj @@ -6,11 +6,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Platform/src/Directory.Build.props b/src/Websites/Platform/src/Directory.Build.props index dd6cc240f5..7b82393d9f 100644 --- a/src/Websites/Platform/src/Directory.Build.props +++ b/src/Websites/Platform/src/Directory.Build.props @@ -1,4 +1,4 @@ - + enable diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Api/Bit.Websites.Sales.Api.csproj b/src/Websites/Sales/src/Bit.Websites.Sales.Api/Bit.Websites.Sales.Api.csproj index 4e6237a86e..1d5972f7bc 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Api/Bit.Websites.Sales.Api.csproj +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Api/Bit.Websites.Sales.Api.csproj @@ -18,11 +18,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Api/Program.cs b/src/Websites/Sales/src/Bit.Websites.Sales.Api/Program.cs index 9a3e290a81..1dda232810 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Api/Program.cs +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Api/Program.cs @@ -1,5 +1,9 @@ var builder = WebApplication.CreateBuilder(args); +#if BlazorWebAssembly +builder.Configuration.AddClientConfigurations(); +#endif + Bit.Websites.Sales.Api.Startup.Services.Add(builder.Services, builder.Environment, builder.Configuration); var app = builder.Build(); diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Api/Startup/Services.cs b/src/Websites/Sales/src/Bit.Websites.Sales.Api/Startup/Services.cs index 7bf088762c..b9426c506e 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Api/Startup/Services.cs +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Api/Startup/Services.cs @@ -28,8 +28,12 @@ public static void Add(IServiceCollection services, IWebHostEnvironment env, ICo .ConfigurePrimaryHttpMessageHandler() .ConfigureHttpClient((sp, httpClient) => { - NavigationManager navManager = sp.GetRequiredService().HttpContext!.RequestServices.GetRequiredService(); - httpClient.BaseAddress = new Uri($"{navManager.BaseUri}api/"); + Uri.TryCreate(configuration.GetApiServerAddress(), UriKind.RelativeOrAbsolute, out var apiServerAddress); + if (apiServerAddress!.IsAbsoluteUri is false) + { + apiServerAddress = new Uri($"{sp.GetRequiredService().HttpContext!.Request.GetBaseUrl()}{apiServerAddress}"); + } + httpClient.BaseAddress = apiServerAddress; }); services.AddScoped(); @@ -41,7 +45,6 @@ public static void Add(IServiceCollection services, IWebHostEnvironment env, ICo // for other usages of httpclient, for example calling 3rd party apis, either use services.AddHttpClient("NamedHttpClient") or services.AddHttpClient(); }); services.AddRazorPages(); - services.AddMvcCore(); #endif services.AddHttpClient(); services.AddScoped(); diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj b/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj index 3bea4d49f5..de502d087b 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj @@ -4,11 +4,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Bit.Websites.Sales.Web.csproj b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Bit.Websites.Sales.Web.csproj index 0dd9b78e82..6a69f1104b 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Bit.Websites.Sales.Web.csproj +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Bit.Websites.Sales.Web.csproj @@ -30,16 +30,16 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/HttpRequestExtensions.cs b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/HttpRequestExtensions.cs index 0f62030960..ad186f2799 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/HttpRequestExtensions.cs +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/HttpRequestExtensions.cs @@ -4,6 +4,20 @@ namespace Microsoft.AspNetCore.Http; public static class HttpRequestExtensions { + /// + /// https://blog.elmah.io/how-to-get-base-url-in-asp-net-core/ + /// + public static string GetBaseUrl(this HttpRequest req) + { + var uriBuilder = new UriBuilder(req.Scheme, req.Host.Host, req.Host.Port ?? -1); + if (uriBuilder.Uri.IsDefaultPort) + { + uriBuilder.Port = -1; + } + + return uriBuilder.Uri.AbsoluteUri; + } + public static bool ShouldRenderStaticMode(this HttpRequest request) { var agent = GetLoweredUserAgent(request); diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/IConfigurationBuilderExtensions.cs b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/IConfigurationBuilderExtensions.cs new file mode 100644 index 0000000000..ad04cef8df --- /dev/null +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/IConfigurationBuilderExtensions.cs @@ -0,0 +1,12 @@ +using System.Reflection; + +namespace Microsoft.Extensions.Configuration; + +public static class IConfigurationBuilderExtensions +{ + public static void AddClientConfigurations(this IConfigurationBuilder builder) + { + var assembly = Assembly.Load("Bit.Websites.Sales.Web"); + builder.AddJsonStream(assembly.GetManifestResourceStream("Bit.Websites.Sales.Web.appsettings.json")!); + } +} diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/IConfigurationExtensions.cs b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/IConfigurationExtensions.cs index f3e0fe69bb..e88b29bed5 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/IConfigurationExtensions.cs +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Extensions/IConfigurationExtensions.cs @@ -1,8 +1,11 @@ -namespace Microsoft.Extensions.Configuration; +//-:cnd:noEmit +namespace Microsoft.Extensions.Configuration; public static class IConfigurationExtensions { public static string GetApiServerAddress(this IConfiguration configuration) { - return configuration.GetValue("ApiServerAddress") ?? throw new InvalidOperationException("Could not find ApiServerAddress config"); + var apiServerAddress = configuration.GetValue("ApiServerAddress", defaultValue: "api/")!; + + return Uri.TryCreate(apiServerAddress, UriKind.RelativeOrAbsolute, out _) ? apiServerAddress : throw new InvalidOperationException($"Api server address {apiServerAddress} is invalid"); } } diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Program.BlazorServer.cs b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Program.BlazorServer.cs index ca995a1f2a..76df29a68d 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Program.BlazorServer.cs +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Program.BlazorServer.cs @@ -10,7 +10,7 @@ public static WebApplication CreateHostBuilder(string[] args) { var builder = WebApplication.CreateBuilder(args); - builder.Configuration.AddJsonStream(typeof(MainLayout).Assembly.GetManifestResourceStream("Bit.Websites.Sales.Web.appsettings.json")!); + builder.Configuration.AddClientConfigurations(); Startup.Services.Add(builder.Services, builder.Configuration); diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Program.BlazorWebAssembly.cs b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Program.BlazorWebAssembly.cs index c7e0fc2b4d..c26ccd7836 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Program.BlazorWebAssembly.cs +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Program.BlazorWebAssembly.cs @@ -10,12 +10,9 @@ public partial class Program public static WebAssemblyHost CreateHostBuilder(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(); - builder.Configuration.AddJsonStream(typeof(MainLayout).Assembly.GetManifestResourceStream("Bit.Websites.Sales.Web.appsettings.json")); + builder.Configuration.AddClientConfigurations(); - if (Uri.TryCreate(builder.Configuration.GetApiServerAddress(), UriKind.RelativeOrAbsolute, out var apiServerAddress) is false) - { - throw new InvalidOperationException("Api server address is invalid"); - } + Uri.TryCreate(builder.Configuration.GetApiServerAddress(), UriKind.RelativeOrAbsolute, out var apiServerAddress); if (apiServerAddress.IsAbsoluteUri is false) { diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Shared/ContactForm.razor b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Shared/ContactForm.razor index c622b3d30f..25b17b00c3 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Shared/ContactForm.razor +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Shared/ContactForm.razor @@ -26,8 +26,8 @@ @**@
@*
- - + +
*@ @@ -35,14 +35,14 @@ - + Send - + diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Startup/Services.cs b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Startup/Services.cs index e5deb5220f..45cc98dde0 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Web/Startup/Services.cs +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Web/Startup/Services.cs @@ -8,11 +8,12 @@ public static class Services { public static void Add(IServiceCollection services, IConfiguration configuration) { + Uri.TryCreate(configuration.GetApiServerAddress(), UriKind.Absolute, out var apiServerAddress); services.AddScoped(sp => { HttpClient httpClient = new(sp.GetRequiredService()) { - BaseAddress = new Uri(sp.GetRequiredService().GetApiServerAddress()) + BaseAddress = apiServerAddress }; return httpClient; diff --git a/src/Websites/Sales/src/Directory.Build.props b/src/Websites/Sales/src/Directory.Build.props index d3f00d3814..4b16bd56aa 100644 --- a/src/Websites/Sales/src/Directory.Build.props +++ b/src/Websites/Sales/src/Directory.Build.props @@ -1,4 +1,4 @@ - + BlazorServer