Skip to content

Commit

Permalink
Merge pull request neozhu#725 from neozhu/improvement
Browse files Browse the repository at this point in the history
bugfix
  • Loading branch information
neozhu authored Aug 15, 2024
2 parents 501edcd + 5710557 commit 5298cd8
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/Server.UI/Pages/Identity/Users/Components/UserForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

</MudItem>
<MudItem xs="12" sm="6">
<MudTextField For="@(() => Model.DisplayName)" @bind-Value="Model.DisplayName" Label="@L["Ful Name"]" Variant="Variant.Text"></MudTextField>
<MudTextField For="@(() => Model.DisplayName)" @bind-Value="Model.DisplayName" Label="@L["Full Name"]" Variant="Variant.Text"></MudTextField>
</MudItem>
<MudItem xs="12" sm="6">
<MudTextField For="@(() => Model.Email)" @bind-Value="Model.Email" Label="@L["E-mail"]" Variant="Variant.Text" Required="true"></MudTextField>
Expand Down Expand Up @@ -172,8 +172,9 @@
var filename = file.Name;
var fi = new FileInfo(filename);
var ext = fi.Extension;
var result = await UploadService.UploadAsync(new UploadRequest(Guid.NewGuid() + ext, UploadType.ProfilePicture, outStream.ToArray()));
var result = await UploadService.UploadAsync(new UploadRequest($"{Model.Id}_{DateTime.UtcNow.Ticks}.png", UploadType.ProfilePicture, outStream.ToArray()));
Model.ProfilePictureDataUrl = result;

//Do your validations here
Snackbar.Add(ConstantString.UploadSuccess, Severity.Info);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Server.UI/Pages/Identity/Users/Profile.razor
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ else

private async Task LoadOrgData()
{

var list = await UserManager.Users.Include(x => x.UserRoles).ThenInclude(x => x.Role).Include(x => x.Superior).ToListAsync();

foreach (var item in list)
Expand Down Expand Up @@ -235,7 +235,7 @@ else
var user = await UserManager.FindByNameAsync(model.UserName) ?? throw new NotFoundException($"The application user [{model.UserName}] was not found.");
image.Mutate(i => i.Resize(new ResizeOptions { Mode = ResizeMode.Crop, Size = new Size(128, 128) }));
image.Save(outStream, PngFormat.Instance);
var result = await UploadService.UploadAsync(new UploadRequest(user.Id + ".png", UploadType.ProfilePicture, outStream.ToArray(), true));
var result = await UploadService.UploadAsync(new UploadRequest($"{user.Id}_{DateTime.UtcNow.Ticks}.png", UploadType.ProfilePicture, outStream.ToArray(), true));
model.ProfilePictureDataUrl = result;
user.ProfilePictureDataUrl = model.ProfilePictureDataUrl;
await UserManager.UpdateAsync(user);
Expand Down
2 changes: 1 addition & 1 deletion src/Server.UI/Pages/Identity/Users/Users.razor
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
@if (_canSearch)
{
<MudStack Row="true" AlignItems="AlignItems.Stretch">
<MudSelect T="string" Placeholder="Search for role name" Value="@_searchRole" Clearable="true" ValueChanged="@(OnSearchRole)" Style="width:150px">
<MudSelect T="string" Placeholder="@L["Search by role name"]" Value="@_searchRole" Clearable="true" ValueChanged="@(OnSearchRole)" Style="width:150px">
@foreach (var str in _roles)
{
<MudSelectItem Value="@str">@str</MudSelectItem>
Expand Down
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.ca-ES.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="Send Reset Password Email" xml:space="preserve">
<value>Envieu un correu electrònic de restabliment de la contrasenya</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>No hi ha cap funció disponible per a aquest llogater.</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>Cerca per nom de rol</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="Send Reset Password Email" xml:space="preserve">
<value>E-Mail zum Zurücksetzen des Passworts senden</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>Für diesen Mandanten sind keine Rollen verfügbar.</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>Suche nach Rollennamen</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="Send Reset Password Email" xml:space="preserve">
<value>Send Reset Password Email</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>No roles available for this tenant.</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>Search by role name</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.es-ES.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="Send Reset Password Email" xml:space="preserve">
<value>Enviar correo electrónico para restablecer contraseña</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>No hay roles disponibles para este inquilino.</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>Buscar por nombre de rol</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="Send Reset Password Email" xml:space="preserve">
<value>Envoyer un e-mail de réinitialisation du mot de passe</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>Aucun rôle n'est disponible pour ce locataire.</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>Recherche par nom de rôle</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.ja-JP.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="Send Reset Password Email" xml:space="preserve">
<value>パスワードリセットメールを送信</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>このテナントに使用できるロールはありません。</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>役割名で検索</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.km-KH.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="Send Reset Password Email" xml:space="preserve">
<value>ផ្ញើអ៊ីមែលកំណត់ពាក្យសម្ងាត់ឡើងវិញ</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>មិនមានតួនាទីសម្រាប់ភតិកៈនេះទេ។</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>ស្វែងរកតាមឈ្មោះតួនាទី</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.ko-KR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="Send Reset Password Email" xml:space="preserve">
<value>비밀번호 재설정 이메일 보내기</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>이 테넌트에 대한 역할이 없습니다.</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>역할 이름으로 검색</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="No permission to change status." xml:space="preserve">
<value>No permission to change status.</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>No roles available for this tenant.</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>Search by role name</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="Send Reset Password Email" xml:space="preserve">
<value>Отправить электронное письмо для сброса пароля</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>Для этого арендатора нет доступных ролей.</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>Поиск по названию роли</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/Server.UI/Resources/Pages/Identity/Users/Users.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="Send Reset Password Email" xml:space="preserve">
<value>发送重置密码电子邮件</value>
</data>
<data name="No roles available for this tenant." xml:space="preserve">
<value>该租户没有可用的角色。</value>
</data>
<data name="Search by role name" xml:space="preserve">
<value>按角色名称搜索</value>
</data>
</root>

0 comments on commit 5298cd8

Please sign in to comment.