Skip to content

Commit

Permalink
fb/fix-issue-formatter-layout-bug (#174)
Browse files Browse the repository at this point in the history
* Add camp without Geo to help debug Exception

* Raise Db ms threshold, at 500 it fires too often

* Fix layout bug in Issue Formatter

* Script updates version to 1.1.5

---------

Co-authored-by: Daniel Gorin <[email protected]>
  • Loading branch information
github-actions[bot] and dgor82 authored Aug 17, 2024
1 parent 48d9ac6 commit 01d9620
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<ApplicationId>com.CheckMadeOrga.CheckMade-Mobile</ApplicationId>
<ApplicationVersion>58</ApplicationVersion>
<ApplicationDisplayVersion>1.1.4</ApplicationDisplayVersion>
<ApplicationVersion>59</ApplicationVersion>
<ApplicationDisplayVersion>1.1.5</ApplicationDisplayVersion>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<Configurations>Debug_Non_iOS;Debug_All;No_Build;Release</Configurations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public static UiString FormatOperationalInfo<T>(
UiNewLines(1),
Ui("<b>Reported by:</b> {0} ",
$"{issue.ReportedBy.ByUser.FirstName} {issue.ReportedBy.ByUser.LastName}"),
Ui("in their role as "), glossary.GetUi(issue.ReportedBy.RoleType.GetType()));
// UiNewLines(1),
Ui("in their role as "), glossary.GetUi(issue.ReportedBy.RoleType.GetType()),
UiNewLines(1));
// Ui("<b>Currently handled by:</b> "), issue.HandledBy.IsSome
// ? UiConcatenate(UiIndirect(
// $"{issue.HandledBy.GetValueOrThrow().ByUser.FirstName} " +
Expand Down
2 changes: 1 addition & 1 deletion Src/CheckMade.Common.Persistence/DbExecutionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ await dbCommandRetryPolicy.ExecuteAsync(async () =>
await executeDbOperations(db, transaction);
stopwatch.Stop();
const int currentWarningThreshold = 500;
const int currentWarningThreshold = 750;
if (stopwatch.ElapsedMilliseconds > currentWarningThreshold)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,20 @@ new_sphere2_saniclean_at_X2024 AS (
ON CONFLICT (live_event_id, name) DO NOTHING
),

new_sphere3_siteclean_at_X2024 AS (
new_sphere3_saniclean_nogeo__at_X2024 AS (
INSERT INTO spheres_of_action (name, trade, live_event_id, details, status)
VALUES ('Camp3-NoGeo',
'DX3KFI',
(SELECT id FROM new_live_event_X2024),
'{
"AvailableFacilities": ["D55BLT"],
"AvailableConsumables": ["DSTP1N"]
}',
1)
ON CONFLICT (live_event_id, name) DO NOTHING
),

new_sphere4_siteclean_at_X2024 AS (
INSERT INTO spheres_of_action (name, trade, live_event_id, details, status)
VALUES ('Zone1',
'DSIL7M',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async Task GetAsync_ReturnsCorrectLiveEventObjectGraph_ForX2024TestEvent(

Assert.Contains(Sphere1_AtX2024.Name, allSphereNames);
Assert.Contains(Sphere2_AtX2024.Name, allSphereNames);
Assert.Contains(Sphere3_AtX2024.Name, allSphereNames);
Assert.Contains(Sphere4_AtX2024.Name, allSphereNames);

Assert.Equal(3, allSphereNames.Count);

Expand All @@ -52,9 +52,9 @@ public async Task GetAsync_ReturnsCorrectLiveEventObjectGraph_ForX2024TestEvent(
.First(s => s.Name == Sphere2_AtX2024.Name)
.GetTradeType());
Assert.Equal(
Sphere3_AtX2024.GetTradeType(),
Sphere4_AtX2024.GetTradeType(),
liveEventGraph.DivIntoSpheres
.First(s => s.Name == Sphere3_AtX2024.Name)
.First(s => s.Name == Sphere4_AtX2024.Name)
.GetTradeType());

Assert.Equivalent(
Expand All @@ -70,7 +70,7 @@ public async Task GetAsync_ReturnsCorrectLiveEventObjectGraph_ForX2024TestEvent(
Assert.Equivalent(
Option<Geo>.None(),
liveEventGraph.DivIntoSpheres
.First(s => s.Name == Sphere3_AtX2024.Name)
.First(s => s.Name == Sphere4_AtX2024.Name)
.Details.GeoCoordinates);

List<DomainTerm> expectedFacilitiesAtX2024Sphere1 =
Expand Down
18 changes: 16 additions & 2 deletions Src/CheckMade.Tests/Utils/TestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,21 @@ internal static class TestData
Dt(ConsumablesItem.ToiletPaper)
}));

internal static readonly SphereOfAction<SiteCleanTrade> Sphere3_AtX2024 =
internal static readonly SphereOfAction<SanitaryTrade> Sphere3_AtX2024 =
new("Camp3-NoGeo",
new SanitaryCampDetails(
Option<Geo>.None(),
new List<DomainTerm>
{
Dt(typeof(GeneralMisc))
}
.ToImmutableReadOnlyCollection(),
new List<DomainTerm>
{
Dt(ConsumablesItem.ToiletPaper)
}));

internal static readonly SphereOfAction<SiteCleanTrade> Sphere4_AtX2024 =
new("Zone1",
new SiteCleaningZoneDetails(
Option<Geo>.None(),
Expand All @@ -221,7 +235,7 @@ internal static class TestData
Venue1,
new List<ISphereOfAction>
{
Sphere1_AtX2024, Sphere2_AtX2024, Sphere3_AtX2024
Sphere1_AtX2024, Sphere2_AtX2024, Sphere4_AtX2024
});

internal static readonly LiveEvent Y2024 = new(
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.4
1.1.5

0 comments on commit 01d9620

Please sign in to comment.