Skip to content

Commit

Permalink
chore : upgrade (#326)
Browse files Browse the repository at this point in the history
* feat : upgrade

* chore : upgrade

* reactor :  Use RealDisplayName

* chore : upgrade
  • Loading branch information
wzh425 authored Jul 17, 2023
1 parent 32b4df1 commit 0737fbb
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<MasaFrameworkPackageVersion>1.0.0-rc.4.2</MasaFrameworkPackageVersion>
<MasaFrameworkPackageVersion>1.0.0-rc.4.4</MasaFrameworkPackageVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ public async Task HandleAsync(HandleAlarmHistoryCommand command)

if (handle.WebHookId == default)
{
remark = currentUser.StaffDisplayName ?? currentUser?.DisplayName;
remark = currentUser.RealDisplayName;
}
else
{
var handlerUser = await _authClient.UserService.GetByIdAsync(handle.Handler);
var handlerDisplayName = handlerUser?.StaffDisplayName ?? handlerUser?.DisplayName;
remark = $"{currentUser.StaffDisplayName}{_i18n.T("AllocationProcessor")}:{handlerDisplayName}";
var handlerDisplayName = handlerUser?.RealDisplayName;
remark = $"{currentUser.RealDisplayName}{_i18n.T("AllocationProcessor")}:{handlerDisplayName}";
}

entity.HandleAlarm(handle, currentUser.Id, remark);
Expand Down Expand Up @@ -88,7 +88,7 @@ public async Task ChangeHandlerAsync(ChangeHandlerAlarmHistoryCommand command)
var handlerUser = await _authClient.UserService.GetByIdAsync(command.Handler);
MasaArgumentException.ThrowIfNull(handlerUser, _i18n.T("HandlerNotExist"));

string remark = $"{_i18n.T("AllocationProcessor")}:{handlerUser?.StaffDisplayName ?? handlerUser?.DisplayName}";
string remark = $"{_i18n.T("AllocationProcessor")}:{handlerUser.RealDisplayName}";
entity.ChangeHandler(command.Handler, remark);
await _repository.UpdateAsync(entity);
}
Expand All @@ -100,7 +100,7 @@ public async Task CompletedAsync(HandleCompletedAlarmHistoryCommand command)

MasaArgumentException.ThrowIfNull(entity, _i18n.T("AlarmHistory"));
var user = await _authClient.UserService.GetByIdAsync(entity.Handle.Handler);
var handlerDisplayName = user?.StaffDisplayName ?? user?.DisplayName ?? string.Empty;
var handlerDisplayName = user?.RealDisplayName ?? string.Empty;
entity.Completed(entity.Handle.Handler, handlerDisplayName);

await _repository.UpdateAsync(entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private async Task FillAlarmHistoryDtos(List<AlarmHistoryDto> dtos)
foreach (var item in dtos)
{
var handler = userInfos.FirstOrDefault(x => x.Id == item.Handle.Handler);
item.Handle.HandlerName = handler?.StaffDisplayName ?? handler?.DisplayName ?? string.Empty;
item.Handle.HandlerName = handler?.RealDisplayName ?? string.Empty;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private async Task FillAlarmRuleDtos(List<AlarmRuleDto> dtos)
foreach (var item in dtos)
{
var modifier = userInfos.FirstOrDefault(x => x.Id == item.Modifier);
item.ModifierName = modifier?.StaffDisplayName ?? modifier?.DisplayName ?? string.Empty;
item.ModifierName = modifier?.RealDisplayName ?? string.Empty;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private async Task FillWebHookDtos(List<WebHookDto> dtos)
foreach (var item in dtos)
{
var modifier = userInfos.FirstOrDefault(x => x.Id == item.Modifier);
item.ModifierName = modifier?.StaffDisplayName ?? modifier?.DisplayName ?? string.Empty;
item.ModifierName = modifier?.RealDisplayName ?? string.Empty;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<PackageReference Include="Masa.Contrib.Globalization.I18n.AspNetCore" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.Contrib.StackSdks.Isolation" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.Contrib.StackSdks.Pm" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.Contrib.StackSdks.Tsc.OpenTelemetry" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.8">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="Masa.Contrib.Data.Mapping.Mapster" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.Contrib.StackSdks.Tsc.OpenTelemetry" Version="$(MasaFrameworkPackageVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 0 additions & 14 deletions src/Web/Masa.Alert.Web.Admin.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@
});
}

builder.Services.AddObservable(builder.Logging, () =>
{
return new MasaObservableOptions
{
ServiceNameSpace = builder.Environment.EnvironmentName,
ServiceVersion = masaStackConfig.Version,
ServiceName = masaStackConfig.GetWebId(MasaStackProject.Alert),
Layer = masaStackConfig.Namespace,
ServiceInstanceId = builder.Configuration.GetValue<string>("HOSTNAME")
};
}, () =>
{
return masaStackConfig.OtlpUrl;
}, true);
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Masa.Alert.Web.Admin/Masa.Alert.Web.Admin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="Mapster" Version="7.3.0" />
<PackageReference Include="Masa.BuildingBlocks.Authentication.Identity" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.Stack.Components" Version="0.0.409" />
<PackageReference Include="Masa.Stack.Components" Version="0.0.413" />
<PackageReference Include="Masa.Utils.Data.Elasticsearch" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Masa.Contrib.StackSdks.Tsc" Version="$(MasaFrameworkPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.3" />
Expand Down

0 comments on commit 0737fbb

Please sign in to comment.