mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
Compare commits
3
Commits
7d524fcdcd
...
ece6efaf58
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ece6efaf58 | ||
|
|
091831bc97 | ||
|
|
416f631d3f |
No files matched your search
@@ -92,7 +92,7 @@ namespace WotBlitzStatisticsPro.Blazor.Tests.Services
|
||||
players.Should().NotBeNull();
|
||||
players.Should().NotBeEmpty();
|
||||
_findPlayersQueryMock.Verify(q => q.ExecuteAsync(expectedSearch, expectedRealm, It.IsAny<RequestLanguage>(), It.IsAny<CancellationToken>()), Times.Once);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>()), Times.Never);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()), Times.Never);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -107,7 +107,7 @@ namespace WotBlitzStatisticsPro.Blazor.Tests.Services
|
||||
|
||||
players.Should().BeNull();
|
||||
_findPlayersQueryMock.Verify(q => q.ExecuteAsync(expectedSearch, expectedRealm, It.IsAny<RequestLanguage>(), It.IsAny<CancellationToken>()), Times.Once);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>()), Times.Once);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()), Times.Once);
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace WotBlitzStatisticsPro.Blazor.Tests.Services
|
||||
clans.Should().NotBeNull();
|
||||
clans.Should().NotBeEmpty();
|
||||
_findClanQueryMock.Verify(q => q.ExecuteAsync(expectedSearch, expectedRealm, It.IsAny<RequestLanguage>(), It.IsAny<CancellationToken>()), Times.Once);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>()), Times.Never);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()), Times.Never);
|
||||
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace WotBlitzStatisticsPro.Blazor.Tests.Services
|
||||
|
||||
players.Should().BeNull();
|
||||
_findClanQueryMock.Verify(q => q.ExecuteAsync(expectedSearch, expectedRealm, It.IsAny<RequestLanguage>(), It.IsAny<CancellationToken>()), Times.Once);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>()), Times.Once);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()), Times.Once);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -156,7 +156,7 @@ namespace WotBlitzStatisticsPro.Blazor.Tests.Services
|
||||
playerInfoResponse.achievementsBySection.Should().NotBeEmpty();
|
||||
|
||||
_playerQueryMock.Verify(q => q.ExecuteAsync(CurrentAccountId, expectedRealm, It.IsAny<RequestLanguage>(), It.IsAny<CancellationToken>()), Times.Once);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>()), Times.Never);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()), Times.Never);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -172,7 +172,7 @@ namespace WotBlitzStatisticsPro.Blazor.Tests.Services
|
||||
playerInfoResponse.achievementsBySection.Should().BeNull();
|
||||
|
||||
_playerQueryMock.Verify(q => q.ExecuteAsync(CurrentAccountId, expectedRealm, It.IsAny<RequestLanguage>(), It.IsAny<CancellationToken>()), Times.Once);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>()), Times.Once);
|
||||
_notificationServiceMock.Verify(n => n.ReportError(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()), Times.Once);
|
||||
}
|
||||
|
||||
private async Task SetUpFindPlayers()
|
||||
|
||||
@@ -86,6 +86,112 @@ namespace WotBlitzStatisticsPro.Blazor
|
||||
new TankTreeRowMap(7953, 1), // Jagdtiger (9)
|
||||
new TankTreeRowMap(14865, 7), // Leopard Prototyp A (9)
|
||||
|
||||
// usa
|
||||
new TankTreeRowMap(1825, 2), // First tank in a tree
|
||||
|
||||
new TankTreeRowMap(10273, 1), // M8A1 (4)
|
||||
new TankTreeRowMap(5409, 2), // M7 (4)
|
||||
|
||||
new TankTreeRowMap(3361, 2), // T1 Heavy Tank (5)
|
||||
new TankTreeRowMap(1057, 4), // M4 Sherman (5)
|
||||
|
||||
new TankTreeRowMap(11553, 0), // M18 Hellcat (6)
|
||||
new TankTreeRowMap(7201, 1), // M36 Jackson (6)
|
||||
new TankTreeRowMap(1313, 4), // M4A3E8 Sherman 6)
|
||||
new TankTreeRowMap(16673, 5), // T37 (6)
|
||||
new TankTreeRowMap(9761, 6), // M24 Chaffee (6)
|
||||
|
||||
new TankTreeRowMap(3873, 2), // T29 (7)
|
||||
new TankTreeRowMap(23585, 3), // M-VII-Yoh (7)
|
||||
|
||||
new TankTreeRowMap(8225, 1), // T28 (8)
|
||||
|
||||
new TankTreeRowMap(2593, 0), // T30 (9)
|
||||
new TankTreeRowMap(20001, 6), // T92E1 (9)
|
||||
new TankTreeRowMap(15393, 5), // T54E1 (9)
|
||||
|
||||
// france
|
||||
new TankTreeRowMap(15937, 1), // First tank in a tree
|
||||
|
||||
new TankTreeRowMap(9793, 0), // Somua SAu 40 (4)
|
||||
new TankTreeRowMap(1089, 1), // B1 (4)
|
||||
|
||||
new TankTreeRowMap(6721, 1), // BDR G1 B (5)
|
||||
new TankTreeRowMap(14145, 2), // AMX ELC bis (5)
|
||||
|
||||
// ussr
|
||||
new TankTreeRowMap(4609, 2), // First tank in a tree
|
||||
new TankTreeRowMap(3329, 0), // МС-1 обр. 1
|
||||
|
||||
new TankTreeRowMap(6913, 1), // СУ-85Б (4)
|
||||
new TankTreeRowMap(2049, 2), // А-20 (4)
|
||||
|
||||
new TankTreeRowMap(11777, 2), // КВ-1 (5)
|
||||
new TankTreeRowMap(1, 5), // Т-34 (5)
|
||||
|
||||
new TankTreeRowMap(2817, 2), // КВ-1С (6)
|
||||
new TankTreeRowMap(10497, 3), // КВ-2 (6)
|
||||
new TankTreeRowMap(2561, 4), // Т-34-85 6)
|
||||
new TankTreeRowMap(16641, 6), // МТ-25 (6)
|
||||
|
||||
new TankTreeRowMap(2305, 0), // СУ-152 (7)
|
||||
new TankTreeRowMap(10241, 1), // СУ-100М1 (7)
|
||||
new TankTreeRowMap(513, 2), // ИС (7)
|
||||
new TankTreeRowMap(5889, 3), // КВ-3 (7)
|
||||
new TankTreeRowMap(18433, 5), // ЛТТБ (7)
|
||||
new TankTreeRowMap(24065, 6), // ЛТГ (7)
|
||||
|
||||
new TankTreeRowMap(18177, 6), // Т-54 обл. (8)
|
||||
|
||||
new TankTreeRowMap(7937, 5), // Т-54 (9)
|
||||
new TankTreeRowMap(23809, 6), // Объект 84 (9)
|
||||
|
||||
new TankTreeRowMap(16897, 4), // Объект 140 (10)
|
||||
new TankTreeRowMap(13825, 5), // Т-62А (10)
|
||||
|
||||
// china
|
||||
new TankTreeRowMap(2353, 1), // First tank in a tree
|
||||
|
||||
new TankTreeRowMap(7729, 0), // WZ-131G FT (6)
|
||||
new TankTreeRowMap(5169, 1), // Type 58 (6)
|
||||
|
||||
new TankTreeRowMap(3633, 1), // IS-2 (7)
|
||||
new TankTreeRowMap(1073, 2), // T-34-1 (7)
|
||||
|
||||
// uk
|
||||
new TankTreeRowMap(6993, 2), // First tank in a tree
|
||||
|
||||
new TankTreeRowMap(9041, 0), // Alecto (4)
|
||||
new TankTreeRowMap(849, 3), // Matilda (4)
|
||||
|
||||
new TankTreeRowMap(2129, 2), // Crusader (5)
|
||||
new TankTreeRowMap(2897, 4), // Churchill I (5)
|
||||
|
||||
new TankTreeRowMap(593, 1), // Sherman Firefly (6)
|
||||
new TankTreeRowMap(1105, 2), // Cromwell (6)
|
||||
|
||||
new TankTreeRowMap(18257, 1), // Challenger (7)
|
||||
new TankTreeRowMap(5457, 2), // Comet (7)
|
||||
|
||||
new TankTreeRowMap(5969, 2), // Centurion Mk. I (8)
|
||||
new TankTreeRowMap(20049, 3), // FV301 (8)
|
||||
|
||||
// japan
|
||||
new TankTreeRowMap(865, 2), // First tank in a tree
|
||||
|
||||
new TankTreeRowMap(1377, 1), // Type 3 Chi-Nu (5)
|
||||
new TankTreeRowMap(5473, 2), // Mitsu 108 (5)
|
||||
|
||||
new TankTreeRowMap(5217, 0), // Chi-To SPG (7)
|
||||
new TankTreeRowMap(1121, 1), // Type 5 Chi-Ri (7)
|
||||
|
||||
// european
|
||||
new TankTreeRowMap(2689, 1), // First tank in a tree
|
||||
|
||||
new TankTreeRowMap(3713, 0), // Strv 74 (6)
|
||||
new TankTreeRowMap(8065, 1), // 40TP Habicha (6)
|
||||
new TankTreeRowMap(1409, 2), // P.43 bis 6)
|
||||
new TankTreeRowMap(6529, 3), // Škoda T 25 (6)
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
+12
-6
@@ -11,18 +11,24 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl
|
||||
{
|
||||
return serializedValue switch
|
||||
{
|
||||
"NONE" => MarkOfMastery.None, "RANK3" => MarkOfMastery.Rank3, "RANK2" => MarkOfMastery.Rank2, "RANK1" => MarkOfMastery.Rank1, "MASTER" => MarkOfMastery.Master, _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
"NONE" => MarkOfMastery.None,
|
||||
"RANK3" => MarkOfMastery.Rank3,
|
||||
"RANK2" => MarkOfMastery.Rank2,
|
||||
"RANK1" => MarkOfMastery.Rank1,
|
||||
"MASTER" => MarkOfMastery.Master,
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
|
||||
public global::System.Object Format(global::System.Object? runtimeValue)
|
||||
{
|
||||
return runtimeValue switch
|
||||
{
|
||||
MarkOfMastery.None => "NONE", MarkOfMastery.Rank3 => "RANK3", MarkOfMastery.Rank2 => "RANK2", MarkOfMastery.Rank1 => "RANK1", MarkOfMastery.Master => "MASTER", _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
MarkOfMastery.None => "NONE",
|
||||
MarkOfMastery.Rank3 => "RANK3",
|
||||
MarkOfMastery.Rank2 => "RANK2",
|
||||
MarkOfMastery.Rank1 => "RANK1",
|
||||
MarkOfMastery.Master => "MASTER",
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-6
@@ -11,18 +11,22 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl
|
||||
{
|
||||
return serializedValue switch
|
||||
{
|
||||
"RU" => RealmType.Ru, "EU" => RealmType.Eu, "NA" => RealmType.Na, "ASIA" => RealmType.Asia, _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
"RU" => RealmType.Ru,
|
||||
"EU" => RealmType.Eu,
|
||||
"NA" => RealmType.Na,
|
||||
"ASIA" => RealmType.Asia,
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
|
||||
public global::System.Object Format(global::System.Object? runtimeValue)
|
||||
{
|
||||
return runtimeValue switch
|
||||
{
|
||||
RealmType.Ru => "RU", RealmType.Eu => "EU", RealmType.Na => "NA", RealmType.Asia => "ASIA", _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
RealmType.Ru => "RU",
|
||||
RealmType.Eu => "EU",
|
||||
RealmType.Na => "NA",
|
||||
RealmType.Asia => "ASIA",
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-6
@@ -11,18 +11,20 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl
|
||||
{
|
||||
return serializedValue switch
|
||||
{
|
||||
"RU" => RequestLanguage.Ru, "EN" => RequestLanguage.En, "DE" => RequestLanguage.De, _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
"RU" => RequestLanguage.Ru,
|
||||
"EN" => RequestLanguage.En,
|
||||
"DE" => RequestLanguage.De,
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
|
||||
public global::System.Object Format(global::System.Object? runtimeValue)
|
||||
{
|
||||
return runtimeValue switch
|
||||
{
|
||||
RequestLanguage.Ru => "RU", RequestLanguage.En => "EN", RequestLanguage.De => "DE", _ => throw new global::StrawberryShake.GraphQLClientException()}
|
||||
|
||||
;
|
||||
RequestLanguage.Ru => "RU",
|
||||
RequestLanguage.En => "EN",
|
||||
RequestLanguage.De => "DE",
|
||||
_ => throw new global::StrawberryShake.GraphQLClientException()};
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-6
@@ -13,18 +13,16 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl.State
|
||||
global::System.String __typename = obj.GetProperty("__typename").GetString()!;
|
||||
return __typename switch
|
||||
{
|
||||
"Achievement" => ParseAchievementEntityId(obj, __typename), _ => throw new global::System.NotSupportedException()}
|
||||
|
||||
;
|
||||
"Achievement" => ParseAchievementEntityId(obj, __typename),
|
||||
_ => throw new global::System.NotSupportedException()};
|
||||
}
|
||||
|
||||
public global::System.String Format(global::StrawberryShake.EntityId entityId)
|
||||
{
|
||||
return entityId.Name switch
|
||||
{
|
||||
"Achievement" => FormatAchievementEntityId(entityId), _ => throw new global::System.NotSupportedException()}
|
||||
|
||||
;
|
||||
"Achievement" => FormatAchievementEntityId(entityId),
|
||||
_ => throw new global::System.NotSupportedException()};
|
||||
}
|
||||
|
||||
private global::StrawberryShake.EntityId ParseAchievementEntityId(global::System.Text.Json.JsonElement obj, global::System.String type)
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ namespace WotBlitzStatisticsPro.Blazor.GraphQl.State
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.2.0")]
|
||||
public partial class WotBlitzStatisticsProClientStoreAccessor : global::StrawberryShake.StoreAccessor
|
||||
{
|
||||
public WotBlitzStatisticsProClientStoreAccessor(global::StrawberryShake.IOperationStore operationStore, global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer entityIdSerializer, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory> requestFactories, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory> resultDataFactories): base(operationStore, entityStore, entityIdSerializer, requestFactories, resultDataFactories)
|
||||
public WotBlitzStatisticsProClientStoreAccessor(global::StrawberryShake.IOperationStore operationStore, global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer entityIdSerializer, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory> requestFactories, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory> resultDataFactories) : base(operationStore, entityStore, entityIdSerializer, requestFactories, resultDataFactories)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Notifications.ReportError("Can not get data from backend", e.Message);
|
||||
Notifications.ReportError("Can not get data from backend", e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
|
||||
{
|
||||
TreeItems.Clear();
|
||||
Connections.Clear();
|
||||
var vehiclesTree = VehiclesLibrary.Where(v => v.IsPremium == false).ToList();
|
||||
var vehiclesTree = VehiclesLibrary?.Where(v => v != null && v.IsPremium == false).ToList();
|
||||
for (int tier = 1; tier < 11; tier++)
|
||||
{
|
||||
var vehiclesByTier = vehiclesTree.Where(v => v.Tier == tier).ToList();
|
||||
@@ -279,7 +279,7 @@ namespace WotBlitzStatisticsPro.Blazor.Pages
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Notifications.ReportError("Can not get data from backend", e.Message);
|
||||
Notifications.ReportError("Can not get data from backend", e.Message, e.StackTrace);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,70 @@
|
||||
@inherits PlayerInfoTanksTreeBase;
|
||||
@using WotBlitzStatisticsPro.Blazor.Helpers
|
||||
@using System.Linq
|
||||
@inherits PlayerInfoTanksTreeBase;
|
||||
<div class="d-flex flex-column">
|
||||
<div class="d-flex flex-row mb-3">
|
||||
@foreach (var nationForFilter in NationsFilter)
|
||||
{
|
||||
<img src="@nationForFilter.ItemName" class="@NationFilterStyle(nationForFilter.ItemId)" @onclick="@(async (e) => { await ApplyNationFilter(e, nationForFilter.ItemId); })" />
|
||||
}
|
||||
</div>
|
||||
<div style="overflow-y: auto; overflow-x: auto;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
height="@((CardWidth + 40) * 10)"
|
||||
width="@FrameHeigth">
|
||||
|
||||
<TankListItem [email protected]()></TankListItem>
|
||||
<!-- Background -->
|
||||
@for (int i = 0; i < 10; i++)
|
||||
{
|
||||
<rect x="0"
|
||||
y="@(i * (CardWidth + 40))"
|
||||
width="@FrameHeigth"
|
||||
height="@(CardWidth + 40)"
|
||||
fill="@(i % 2 == 0 ? "#464A5D" : "#3A3D4B")">
|
||||
</rect>
|
||||
}
|
||||
|
||||
@if (TreeItems != null)
|
||||
{
|
||||
@for (int tier = 1; tier < 11; tier++)
|
||||
{
|
||||
@foreach (var tank in TreeItems.Where(t => t.Tier == tier).OrderBy(t => t.Row).ToList())
|
||||
{
|
||||
<!-- Tank card svg-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
x="@(tank.Row * (CardHeigth + 20) + 20)"
|
||||
y="@(((10 - tier)) * (CardWidth + 40) + 20)"
|
||||
height="@CardWidth"
|
||||
width="@CardHeigth">
|
||||
<g>
|
||||
<!--Rect fill = #275950 - researched, #2E353B - unresearched, #66502b - prem-->
|
||||
<rect x="0"
|
||||
y="0"
|
||||
height="@CardWidth"
|
||||
width="@CardHeigth"
|
||||
rx="10"
|
||||
ry="10"
|
||||
fill="@(tank.IsResearched ? (tank.IsPremium ? "#66502b" : "#275950") : "#2E353B")">
|
||||
</rect>
|
||||
|
||||
<!--Tank type-->
|
||||
<image x="5" y="7" width="25" height="25" href="@tank.TankTypeId.TankTypeAsset(tank.IsPremium)" />
|
||||
<!--Tank tier-->
|
||||
<text x="30" y="4" fill="@(tank.IsPremium ? Constants.ClanTagColor : "white")" text-anchor="start" alignment-baseline="before-edge" font-family="Segoe UI" font-size="19">
|
||||
@tank.Tier.RomanNumber()
|
||||
</text>
|
||||
<!--TankImage-->
|
||||
<image x="@((CardHeigth - 95) / 2)" y="5" width="95" height="70" href="@tank.PreviewImage" />
|
||||
<!--TankName-->
|
||||
<text x="5" y="80" fill="@(tank.IsPremium ? Constants.ClanTagColor : "white")" text-anchor="start" alignment-baseline="before-edge" font-family="Segoe UI" font-size="14">
|
||||
@tank.Name
|
||||
</text>
|
||||
|
||||
</g>
|
||||
</svg>
|
||||
}
|
||||
}
|
||||
}
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
.nation-filter-flag {
|
||||
width: 35px;
|
||||
height: 23px;
|
||||
border-radius: 4px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.filter-selected {
|
||||
border-width: 1px;
|
||||
border-color: #f5aa3b;
|
||||
border-style: solid;
|
||||
}
|
||||
@@ -55,11 +55,11 @@ namespace WotBlitzStatisticsPro.Blazor
|
||||
//var useMock = Environment.GetEnvironmentVariable("USE_GRAPH_QL_MOCK");
|
||||
//if (useMock != null && useMock == "true")
|
||||
//{
|
||||
//builder.Services.AddTransient<IGraphQlBackendService, GraphQlBackendMockService>();
|
||||
builder.Services.AddTransient<IGraphQlBackendService, GraphQlBackendMockService>();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
builder.Services.AddTransient<IGraphQlBackendService, GraphQlBackendService>();
|
||||
//builder.Services.AddTransient<IGraphQlBackendService, GraphQlBackendService>();
|
||||
//}
|
||||
|
||||
var host = builder.Build();
|
||||
|
||||
@@ -132,6 +132,10 @@ namespace WotBlitzStatisticsPro.Blazor.Services
|
||||
{
|
||||
messages.Add(message.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
messages.Add(realError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,7 +144,7 @@ namespace WotBlitzStatisticsPro.Blazor.Services
|
||||
|
||||
if (messages.Count > 0)
|
||||
{
|
||||
_notificationsService.ReportError("Backend error",string.Join(";", messages));
|
||||
_notificationsService.ReportError("Backend error",string.Join(";", messages), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,6 @@ namespace WotBlitzStatisticsPro.Blazor.Services
|
||||
|
||||
void ReportInfo(string summary, string message);
|
||||
void ReportWarning(string summary, string message);
|
||||
void ReportError(string summary, string message);
|
||||
void ReportError(string summary, string message, string? stacktrace);
|
||||
}
|
||||
}
|
||||
@@ -39,13 +39,14 @@ namespace WotBlitzStatisticsPro.Blazor.Services
|
||||
_jsRuntime.InvokeVoidAsync("console.warn", summary, message);
|
||||
}
|
||||
|
||||
public void ReportError(string summary, string message)
|
||||
public void ReportError(string summary, string message, string? stacktrace)
|
||||
{
|
||||
Type = NotificationType.Error;
|
||||
Message = message;
|
||||
Summary = summary;
|
||||
MessageArrived?.Invoke();
|
||||
_jsRuntime.InvokeVoidAsync("console.error", summary, message);
|
||||
Console.WriteLine(message);
|
||||
_jsRuntime.InvokeVoidAsync("console.error", summary, string.IsNullOrEmpty(stacktrace) ? message : $"{message}; {stacktrace}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,10 +42,10 @@ namespace WotBlitzStatisticsPro.Logic.Mappers
|
||||
CreateMap<IVehiclesDictionary, VehicleResponse>()
|
||||
.ForMember(v => v.Name,
|
||||
o => o.MapFrom((src, dest, destMember, context) =>
|
||||
src.Name.FirstOrDefault(l => l.Language == (RequestLanguage) context.Items["language"])?.Value))
|
||||
src.Name.FirstOrDefault(l => l.Language == (RequestLanguage) context.Items["language"])?.Value ?? string.Empty))
|
||||
.ForMember(v => v.Description,
|
||||
o => o.MapFrom((src, dest, destMember, context) =>
|
||||
src.Description.FirstOrDefault(l => l.Language == (RequestLanguage) context.Items["language"])?.Value))
|
||||
src.Description.FirstOrDefault(l => l.Language == (RequestLanguage) context.Items["language"])?.Value ?? string.Empty))
|
||||
.ForMember(v => v.NexTanksInTree,
|
||||
o => o.MapFrom(src => src.NexTanksInTree.Select(t => t.TankId).ToList()))
|
||||
;
|
||||
|
||||
Reference in new issue
Block a user