Skip to content

Commit 991c06b

Browse files
YuvalYuval
authored andcommitted
refactor: rename WebApplication1 to GroundShareAPI and update related files
1 parent 58d1994 commit 991c06b

8 files changed

Lines changed: 59 additions & 42 deletions

File tree

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
# an explicit RID produced an assets file that didn't satisfy
6161
# `publish -r linux-x64 --no-restore`.
6262
- name: Publish (linux-x64, framework-dependent)
63-
run: dotnet publish WebApplication1.csproj -c Release -r linux-x64 --self-contained false -o ./publish-linux
63+
run: dotnet publish GroundShareAPI.csproj -c Release -r linux-x64 --self-contained false -o ./publish-linux
6464

6565
# Zip on Linux so path separators are forward slashes. Paired with
6666
# WEBSITE_RUN_FROM_PACKAGE=1 on the App Service, the deploy mounts the

02-Server/Controllers/ComparisonsController.cs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,26 @@ private async Task<GisFeatures> FetchGisFeatures(double lat, double lng)
228228

229229
await Task.WhenAll(tasks.Values);
230230

231-
bool anyLayerResponded = tasks.Values.Any(t => t.Result >= 0);
231+
// Await each completed task to surface results without resorting
232+
// to .Result (matches the pattern used in GeoController.cs).
233+
int construction = await tasks["construction"];
234+
int permits = await tasks["permits"];
235+
int nightWork1 = await tasks["nightWork1"];
236+
int nightWork2 = await tasks["nightWork2"];
237+
int roadWork1 = await tasks["roadWork1"];
238+
int roadWork2 = await tasks["roadWork2"];
239+
int cityPlans = await tasks["cityPlans"];
240+
241+
bool anyLayerResponded = new[] { construction, permits, nightWork1, nightWork2, roadWork1, roadWork2, cityPlans }
242+
.Any(v => v >= 0);
232243

233244
var gis = new GisFeatures
234245
{
235-
ConstructionSiteCount = Math.Max(0, tasks["construction"].Result),
236-
PermitCount = Math.Max(0, tasks["permits"].Result),
237-
NightWorkCount = Math.Max(0, tasks["nightWork1"].Result) + Math.Max(0, tasks["nightWork2"].Result),
238-
RoadWorkCount = Math.Max(0, tasks["roadWork1"].Result) + Math.Max(0, tasks["roadWork2"].Result),
239-
CityPlanCount = Math.Max(0, tasks["cityPlans"].Result),
246+
ConstructionSiteCount = Math.Max(0, construction),
247+
PermitCount = Math.Max(0, permits),
248+
NightWorkCount = Math.Max(0, nightWork1) + Math.Max(0, nightWork2),
249+
RoadWorkCount = Math.Max(0, roadWork1) + Math.Max(0, roadWork2),
250+
CityPlanCount = Math.Max(0, cityPlans),
240251
HasGisData = anyLayerResponded,
241252
};
242253

02-Server/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
1919
WORKDIR /src
2020

2121
# Copy csproj first for layer caching on restore
22-
COPY WebApplication1.csproj .
22+
COPY GroundShareAPI.csproj .
2323
RUN dotnet restore
2424

2525
# Copy everything else and publish
@@ -43,4 +43,4 @@ EXPOSE 8080
4343
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
4444
CMD curl -f http://localhost:8080/api/health || exit 1
4545

46-
ENTRYPOINT ["dotnet", "WebApplication1.dll"]
46+
ENTRYPOINT ["dotnet", "GroundShareAPI.dll"]
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
2-
3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
</PropertyGroup>
8-
9-
<ItemGroup>
10-
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.5.0" />
11-
<PackageReference Include="Azure.Identity" Version="1.21.0" />
12-
<PackageReference Include="Azure.Storage.Blobs" Version="12.27.0" />
13-
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
14-
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.1" />
15-
<PackageReference Include="Google.Apis.Auth" Version="1.73.0" />
16-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
17-
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.3" />
18-
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
19-
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="5.0.0" />
20-
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
21-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
22-
</ItemGroup>
23-
24-
</Project>
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<AssemblyName>GroundShareAPI</AssemblyName>
8+
<RootNamespace>GroundShareAPI</RootNamespace>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.5.0" />
13+
<PackageReference Include="Azure.Identity" Version="1.21.0" />
14+
<PackageReference Include="Azure.Storage.Blobs" Version="12.27.0" />
15+
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
16+
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.1" />
17+
<PackageReference Include="Google.Apis.Auth" Version="1.73.0" />
18+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
19+
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.3" />
20+
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
21+
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="5.0.0" />
22+
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
23+
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
24+
</ItemGroup>
25+
26+
</Project>

02-Server/GroundShareAPI.http

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@GroundShareAPI_HostAddress = http://localhost:5227
2+
3+
GET {{GroundShareAPI_HostAddress}}/api/health
4+
Accept: application/json
5+
6+
###
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio Version 17
33
VisualStudioVersion = 17.5.2.0
44
MinimumVisualStudioVersion = 10.0.40219.1
5-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplication1", "WebApplication1.csproj", "{19317912-AC4B-45A3-1276-85453B678B5B}"
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GroundShareAPI", "GroundShareAPI.csproj", "{19317912-AC4B-45A3-1276-85453B678B5B}"
66
EndProject
77
Global
88
GlobalSection(SolutionConfigurationPlatforms) = preSolution

02-Server/WebApplication1.http

Lines changed: 0 additions & 6 deletions
This file was deleted.

03-Client/src/app/components/address-search/AddressInfoPanel.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ export function AddressInfoPanel({
9090
// Fetch initial favorite & notification state
9191
useEffect(() => {
9292
if (!locationId) return;
93-
api.checkFavorite(locationId).then((res) => setFavActive(res.is_Favorited)).catch(() => {});
94-
api.checkNotification(locationId).then((res) => setBellActive(res.is_Subscribed)).catch(() => {});
93+
api.checkFavorite(locationId)
94+
.then((res) => setFavActive(res.is_Favorited))
95+
.catch((err) => console.warn("[AddressInfoPanel] checkFavorite failed", err));
96+
api.checkNotification(locationId)
97+
.then((res) => setBellActive(res.is_Subscribed))
98+
.catch((err) => console.warn("[AddressInfoPanel] checkNotification failed", err));
9599
}, [locationId]);
96100

97101
// Minimize signal from parent

0 commit comments

Comments
 (0)