Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed Nov 4, 2024
2 parents 31e43c7 + 945057f commit b4b54d0
Show file tree
Hide file tree
Showing 46 changed files with 248 additions and 87 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/admin-sample.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
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 PostgreSQL --sample Admin --appInsights --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --api Standalone --notification --framework net9.0
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --api Standalone --notification --captcha reCaptcha --signalr --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'AdminPanel/src/Shared/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Core/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Web/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Web/appsettings.Production.json'
env:
ServerAddress: ${{ env.API_SERVER_ADDRESS }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
WebAppRender.BlazorMode: BlazorWebAssembly
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}
AdsPushVapid.PublicKey: ${{ secrets.ADMINPANEL_PUBLIC_VAPIDKEY }}
Expand Down Expand Up @@ -143,14 +144,15 @@ jobs:
cd src\Templates\Boilerplate && dotnet build -c Release
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 PostgreSQL --sample Admin --windows --appInsights --appCenter --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --framework net9.0
cd ..\..\..\ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --windows --appInsights --appCenter --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --captcha reCaptcha --signalr --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'AdminPanel\src\Shared\appsettings.json, AdminPanel\src\Client\AdminPanel.Client.Core\appsettings.json, AdminPanel\src\Client\AdminPanel.Client.Windows\appsettings.json'
env:
ServerAddress: ${{ env.API_SERVER_ADDRESS }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
WindowsUpdate.FilesUrl: https://windows-adminpanel.bitplatform.dev
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}

Expand Down Expand Up @@ -204,7 +206,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
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 PostgreSQL --sample Admin --appInsights --appCenter --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --framework net9.0
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --appCenter --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalr --framework net9.0
- uses: actions/setup-node@v4
with:
Expand All @@ -230,6 +232,7 @@ jobs:
files: 'AdminPanel/src/Shared/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Core/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Maui/appsettings.json'
env:
ServerAddress: ${{ env.API_SERVER_ADDRESS }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}

- name: Set app center secret
Expand Down Expand Up @@ -283,14 +286,15 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
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 PostgreSQL --sample Admin --appInsights --appCenter --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --framework net9.0
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --appCenter --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalr --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'AdminPanel/src/Shared/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Core/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Maui/appsettings.json'
env:
ServerAddress: ${{ env.API_SERVER_ADDRESS }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}

- name: Set app center secret
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/todo-sample.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
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 TodoSample --database PostgreSQL --sample Todo --appInsights --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --appInsights --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'TodoSample/src/Shared/appsettings.json, TodoSample/src/Client/TodoSample.Client.Core/appsettings.json, TodoSample/src/Client/TodoSample.Client.Web/appsettings.json, TodoSample/src/Client/TodoSample.Client.Web/appsettings.Production.json'
env:
ServerAddress: ${{ env.SERVER_ADDRESS }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
WebAppRender.BlazorMode: BlazorWebAssembly
WebAppRender.PrerenderEnabled: true
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}
Expand Down Expand Up @@ -139,14 +140,15 @@ jobs:
cd src\Templates\Boilerplate && dotnet build -c Release
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 TodoSample --database PostgreSQL --sample Todo --windows --appInsights --appCenter --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage
cd ..\..\..\ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --windows --appInsights --appCenter --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --captcha reCaptcha
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'TodoSample\src\Shared\appsettings.json, TodoSample\src\Client\TodoSample.Client.Core\appsettings.json, TodoSample\src\Client\TodoSample.Client.Windows\appsettings.json'
env:
ServerAddress: ${{ env.SERVER_ADDRESS }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
WindowsUpdate.FilesUrl: https://windows-todo.bitplatform.dev
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}

Expand Down Expand Up @@ -218,7 +220,7 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
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 TodoSample --database PostgreSQL --sample Todo --appInsights --appCenter --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --appInsights --appCenter --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha
- name: Extract Android signing key from env
uses: timheuer/[email protected]
Expand All @@ -240,6 +242,7 @@ jobs:
files: 'TodoSample/src/Shared/appsettings.json, TodoSample/src/Client/TodoSample.Client.Core/appsettings.json, TodoSample/src/Client/TodoSample.Client.Maui/appsettings.json'
env:
ServerAddress: ${{ env.SERVER_ADDRESS }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}

- name: Set app center secret
Expand Down Expand Up @@ -317,14 +320,15 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
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 TodoSample --database PostgreSQL --sample Todo --appInsights --appCenter --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --appInsights --appCenter --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'TodoSample/src/Shared/appsettings.json, TodoSample/src/Client/TodoSample.Client.Core/appsettings.json, TodoSample/src/Client/TodoSample.Client.Maui/appsettings.json'
env:
ServerAddress: ${{ env.SERVER_ADDRESS }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}

- name: Set app center secret
Expand Down
4 changes: 2 additions & 2 deletions src/BlazorUI/Bit.BlazorUI/Components/Inputs/BitInputBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected BitInputBase()
/// <summary>
/// Gets or sets a collection of additional attributes that will be applied to the created element.
/// </summary>
[Parameter] public IReadOnlyDictionary<string, object>? InputHtmlAttributes { get; set; }
[Parameter] public Dictionary<string, object>? InputHtmlAttributes { get; set; }

/// <summary>
/// Gets or sets the name of the element.
Expand Down Expand Up @@ -152,7 +152,7 @@ public override Task SetParametersAsync(ParameterView parameters)
break;

case nameof(InputHtmlAttributes):
InputHtmlAttributes = (IReadOnlyDictionary<string, object>?)parameter.Value;
InputHtmlAttributes = (Dictionary<string, object>?)parameter.Value;
parametersDictionary.Remove(parameter.Key);
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
name="@Name"
id="@_inputId"
rows="@(Rows ?? 3)"
tabindex="@TabIndex"
readonly="@ReadOnly"
required="@Required"
style="@Styles?.Input"
Expand Down Expand Up @@ -81,6 +82,7 @@
type="@_inputType"
readonly="@ReadOnly"
required="@Required"
tabindex="@TabIndex"
style="@Styles?.Input"
autofocus="@AutoFocus"
maxlength="@MaxLength"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ public partial class BitTextField : BitTextInputBase<string?>
/// </summary>
[Parameter] public RenderFragment? SuffixTemplate { get; set; }

/// <summary>
/// The value of the tabindex html attribute of the input element.
/// </summary>
[Parameter] public string? TabIndex { get; set; }

/// <summary>
/// Specifies whether to remove any leading or trailing whitespace from the value.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public partial class AppInitializer : AppComponentBase
[AutoInject] private ILogger<AppInitializer> logger = default!;
[AutoInject] private AuthenticationManager authManager = default!;
[AutoInject] private CultureInfoManager cultureInfoManager = default!;
[AutoInject] private ILogger<AuthenticationManager> authLogger = default!;
[AutoInject] private IBitDeviceCoordinator bitDeviceCoordinator = default!;

protected override async Task OnInitAsync()
Expand Down Expand Up @@ -68,6 +69,11 @@ private async void AuthenticationStateChanged(Task<AuthenticationState> task)
TelemetryContext.UserId = user.IsAuthenticated() ? user.GetUserId() : null;
TelemetryContext.UserSessionId = user.IsAuthenticated() ? user.GetSessionId() : null;

using var scope = authLogger.BeginScope(TelemetryContext.ToDictionary());
{
authLogger.LogInformation("Authentication state changed.");
}

//#if (signalr == true)
if (InPrerenderSession is false)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ private void CreateNavItems()
Text = Localizer[nameof(AppStrings.Settings)],
IconName = BitIconName.Equalizer,
Url = Urls.SettingsPage,
AdditionalUrls =
[
$"{Urls.SettingsPage}/{Urls.SettingsSections.Profile}",
$"{Urls.SettingsPage}/{Urls.SettingsSections.Account}",
$"{Urls.SettingsPage}/{Urls.SettingsSections.Tfa}",
$"{Urls.SettingsPage}/{Urls.SettingsSections.Sessions}",
]
},
//#if (offlineDb == true)
new()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
<BitToggle OnChange="ToggleTheme" Value="currentTheme == AppThemeType.Light" ValueChanged="v => {}" />
</BitStack>

<BitActionButton IconName="@BitIconName.Equalizer" Href="@Urls.SettingsPage" FullWidth OnClick="() => isOpen=false">
@Localizer[nameof(AppStrings.Settings)]
<BitActionButton IconName="@BitIconName.Contact" Href="@($"{Urls.SettingsPage}/{Urls.SettingsSections.Profile}")" FullWidth OnClick="() => isOpen=false">
@Localizer[nameof(AppStrings.ProfileTitle)]
</BitActionButton>

<BitActionButton IconName="@BitIconName.SignOut" FullWidth OnClick="() => { showSignOut=true; isOpen=false; }">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inherits AppComponentBase

<BitAccordion OnClick="HandleOnClick" IsExpanded="Value == Index"
<BitAccordion OnClick="HandleOnClick" IsExpanded="Value == Name"
Classes="@(new() { Header=BitCss.Class.Color.Background.Secondary })">

<HeaderTemplate>
Expand All @@ -12,7 +12,7 @@
</BitText>
</BitStack>

<BitIcon IconName="@(Value == Index ? BitIconName.ChevronUp : BitIconName.ChevronDown)" Color="BitColor.Tertiary" />
<BitIcon IconName="@(Value == Name ? BitIconName.ChevronUp : BitIconName.ChevronDown)" Color="BitColor.Tertiary" />
</BitStack>
</HeaderTemplate>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

public partial class Accordion
{
[Parameter] public int Index { get; set; }
[Parameter] public string? Name { get; set; }

[Parameter] public int Value { get; set; }
[Parameter] public EventCallback<int> ValueChanged { get; set; }
[Parameter] public string? Value { get; set; }
[Parameter] public EventCallback<string?> ValueChanged { get; set; }

[Parameter] public string? Title { get; set; }
[Parameter] public string? Subtitle { get; set; }
Expand All @@ -15,7 +15,7 @@ public partial class Accordion

private async Task HandleOnClick()
{
Value = Value == Index ? 0 : Index;
Value = Value == Name ? null : Name;
await ValueChanged.InvokeAsync(Value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private async Task ChangeEmail()
{
await userController.ChangeEmail(changeModel, CurrentCancellationToken);

NavigationManager.NavigateTo(Urls.SettingsPage, forceLoad: true);
NavigationManager.NavigateTo($"{Urls.SettingsPage}/{Urls.SettingsSections.Account}", forceLoad: true);
}
catch (KnownException e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private async Task ChangePhoneNumber()
{
await userController.ChangePhoneNumber(changeModel, CurrentCancellationToken);

NavigationManager.NavigateTo(Urls.SettingsPage, forceLoad: true);
NavigationManager.NavigateTo($"{Urls.SettingsPage}/{Urls.SettingsSections.Account}", forceLoad: true);
}
catch (KnownException e)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@*+:cnd:noEmit*@
@attribute [Route(Urls.SettingsPage)]
@attribute [Route("{culture?}" + Urls.SettingsPage)]
@attribute [Route(Urls.SettingsPage + "/{Section?}")]
@attribute [Route("{culture?}" + Urls.SettingsPage + "/{Section?}")]
@attribute [Authorize]
@inherits AppPageBase

Expand All @@ -12,13 +12,13 @@

<section>
<BitStack Class="stack">
<Accordion Index="1" @bind-Value="openedAccordion"
<Accordion Name="@Urls.SettingsSections.Profile" @bind-Value="@openedAccordion"
Title="@Localizer[nameof(AppStrings.ProfileTitle)]"
Subtitle="@Localizer[nameof(AppStrings.ProfileSubtitle)]">
<ProfileSection Loading="isLoading" User="user" />
</Accordion>

<Accordion Index="2" @bind-Value="openedAccordion"
<Accordion Name="@Urls.SettingsSections.Account" @bind-Value="@openedAccordion"
Title="@Localizer[nameof(AppStrings.AccountTitle)]"
Subtitle="@Localizer[nameof(AppStrings.AccountSubtitle)]">
<BitPivot Alignment="BitAlignment.Center">
Expand All @@ -28,19 +28,24 @@
<BitPivotItem HeaderText="@Localizer[nameof(AppStrings.Phone)]">
<ChangePhoneNumberSection PhoneNumber="@user?.PhoneNumber" />
</BitPivotItem>
<BitPivotItem HeaderText="@Localizer[nameof(AppStrings.Delete)]">
<DeleteAccountSection />
<BitPivotItem>
<Header>
<BitText Color="BitColor.Error">@Localizer[nameof(AppStrings.Delete)]</BitText>
</Header>
<Body>
<DeleteAccountSection />
</Body>
</BitPivotItem>
</BitPivot>
</Accordion>

<Accordion Index="3" @bind-Value="openedAccordion"
<Accordion Name="@Urls.SettingsSections.Tfa" @bind-Value="@openedAccordion"
Title="@Localizer[nameof(AppStrings.TfaTitle)]"
Subtitle="@Localizer[nameof(AppStrings.TfaSubtitle)]">
<TwoFactorSection />
</Accordion>

<Accordion Index="4" @bind-Value="openedAccordion"
<Accordion Name="@Urls.SettingsSections.Sessions" @bind-Value="@openedAccordion"
Title="@Localizer[nameof(AppStrings.SessionsTitle)]"
Subtitle="@Localizer[nameof(AppStrings.SessionsSubtitle)]">
<SessionsSection />
Expand Down
Loading

0 comments on commit b4b54d0

Please sign in to comment.