Skip to content

Commit c1be81c

Browse files
Merge pull request #13 from microting/master
Master changes
2 parents 0f30c44 + 27df762 commit c1be81c

File tree

54 files changed

+427
-192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+427
-192
lines changed

.github/workflows/dotnet-core-master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ jobs:
235235
- name: Setup .NET Core
236236
uses: actions/setup-dotnet@v3
237237
with:
238-
dotnet-version: 9.0.x
238+
dotnet-version: 10.0.x
239239
- name: Build
240240
run: dotnet build eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn.sln
241241
- name: Unit Tests

.github/workflows/dotnet-core-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ jobs:
220220
- name: Setup .NET Core
221221
uses: actions/setup-dotnet@v3
222222
with:
223-
dotnet-version: 9.0.x
223+
dotnet-version: 10.0.x
224224
- name: Build
225225
run: dotnet build eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn.sln
226226
- name: Unit Tests

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ COPY eform-angular-frontend/eform-client ./
55
RUN yarn install
66
RUN npm run build
77

8-
FROM mcr.microsoft.com/dotnet/sdk:9.0-noble AS build-env
8+
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS build-env
99
WORKDIR /app
1010
ARG GITVERSION
1111
ARG PLUGINVERSION
@@ -26,7 +26,7 @@ RUN dotnet publish TimePlanning.Pn -o TimePlanning.Pn/out /p:Version=$PLUGIN5VER
2626
RUN dotnet publish BackendConfiguration.Pn -o BackendConfiguration.Pn/out /p:Version=$PLUGIN4VERSION --runtime linux-x64 --configuration Release
2727

2828
# Build runtime image
29-
FROM mcr.microsoft.com/dotnet/aspnet:9.0-noble
29+
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble
3030
WORKDIR /app
3131
COPY --from=build-env /app/eFormAPI.Web/out .
3232
RUN mkdir -p ./Plugins/ItemsPlanning.Pn

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn.Integration.Test/BackendConfiguration.Pn.Integration.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
1414
<PackageReference Include="NSubstitute" Version="5.3.0" />
1515
<PackageReference Include="NUnit" Version="4.4.0" />
1616
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn.Test/BackendConfiguration.Pn.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<IsPublishable>false</IsPublishable>
77
<IsPublishable>false</IsPublishable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
1212
<PackageReference Include="NSubstitute" Version="5.3.0" />
1313
<PackageReference Include="NUnit" Version="4.4.0" />
1414
<PackageReference Include="NUnit.Analyzers" Version="4.11.2">

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/BackendConfiguration.Pn.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ServerGarbageCollection>false</ServerGarbageCollection>
66
</PropertyGroup>
77

@@ -216,17 +216,17 @@
216216

217217
<ItemGroup>
218218
<PackageReference Include="ChemicalsBase" Version="8.0.21" />
219-
<PackageReference Include="Google.Apis.Sheets.v4" Version="1.70.0.3819" />
219+
<PackageReference Include="Google.Apis.Sheets.v4" Version="1.72.0.3966" />
220220
<PackageReference Include="HtmlToOpenXml.dll" Version="3.2.8" />
221-
<PackageReference Include="Ical.Net" Version="5.1.1" />
222-
<PackageReference Include="Microting.eForm" Version="9.0.70" />
223-
<PackageReference Include="Microting.EformAngularFrontendBase" Version="9.0.58" />
221+
<PackageReference Include="Ical.Net" Version="5.1.2" />
222+
<PackageReference Include="Microting.eForm" Version="9.0.72" />
223+
<PackageReference Include="Microting.EformAngularFrontendBase" Version="9.0.59" />
224224
<PackageReference Include="Microting.eFormApi.BasePn" Version="9.0.62" />
225225
<PackageReference Include="McMaster.NETCore.Plugins" Version="2.0.0" />
226-
<PackageReference Include="Microting.EformBackendConfigurationBase" Version="9.0.4" />
227-
<PackageReference Include="Microting.eFormCaseTemplateBase" Version="8.0.120" />
228-
<PackageReference Include="Microting.ItemsPlanningBase" Version="8.0.120" />
229-
<PackageReference Include="Microting.TimePlanningBase" Version="9.0.63" />
226+
<PackageReference Include="Microting.EformBackendConfigurationBase" Version="9.0.5" />
227+
<PackageReference Include="Microting.eFormCaseTemplateBase" Version="8.0.121" />
228+
<PackageReference Include="Microting.ItemsPlanningBase" Version="8.0.121" />
229+
<PackageReference Include="Microting.TimePlanningBase" Version="9.0.64" />
230230
<PackageReference Include="QuestPDF" Version="2025.7.4" />
231231
<PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="8.3.1.2" />
232232
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.119.1" />

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/EformBackendConfigurationPlugin.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,24 @@ private static async void SeedEForms(IServiceCollection services)
603603
Console.WriteLine(ex.Message);
604604
SentrySdk.CaptureException(ex);
605605
}
606+
607+
var compliancesForProperty = await backendConfigurationPnDbContext.Compliances
608+
.Where(x => x.PropertyId == property.Id)
609+
.Where(x => x.PlanningCaseSiteId == 0)
610+
.Where(x => x.WorkflowState != Microting.eForm.Infrastructure.Constants.Constants.WorkflowStates.Removed)
611+
.ToListAsync();
612+
613+
foreach (var complianceForProperty in compliancesForProperty)
614+
{
615+
var planningCaseSite =
616+
await itemsPlanningContext.PlanningCaseSites.FirstOrDefaultAsync(x =>
617+
x.MicrotingSdkCaseId == complianceForProperty.MicrotingSdkCaseId);
618+
if (planningCaseSite != null)
619+
{
620+
complianceForProperty.PlanningCaseSiteId = planningCaseSite.PlanningCaseId;
621+
await complianceForProperty.Update(backendConfigurationPnDbContext).ConfigureAwait(false);
622+
}
623+
}
606624
}
607625

608626
var parentFolderTranslations =

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Helpers/BackendConfigurationAssignmentWorkerServiceHelper.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,24 @@ public static async Task<OperationResult> UpdateDeviceUser(DeviceUserModel devic
287287
return new OperationDataResult<int>(false, "EmailIsAlreadyInUse");
288288
}
289289
var fullName = deviceUserModel.UserFirstName + " " + deviceUserModel.UserLastName;
290+
291+
if (string.IsNullOrEmpty(deviceUserModel.WorkerEmail) || !deviceUserModel.WorkerEmail.Contains("@") && deviceUserModel.TimeRegistrationEnabled == false)
292+
{
293+
// generate a fake email
294+
deviceUserModel.WorkerEmail = $"user_{worker.Id}_{siteDto.SiteId}@microting.invalid".ToLower();
295+
// return new OperationResult(false, "EmailIsNotValid");
296+
}
290297
var isUpdated = await core.SiteUpdate(deviceUserModel.SiteMicrotingUid, fullName, deviceUserModel.UserFirstName,
291-
deviceUserModel.UserLastName, worker.Email, deviceUserModel.LanguageCode).ConfigureAwait(false);
298+
deviceUserModel.UserLastName, deviceUserModel.WorkerEmail, deviceUserModel.LanguageCode).ConfigureAwait(false);
292299

293300
if (deviceUserModel.PinCode != "****") {
294301
worker.PinCode = deviceUserModel.PinCode;
295302
}
296303
worker.EmployeeNo = deviceUserModel.EmployeeNo;
297304
worker.Email = deviceUserModel.WorkerEmail;
298305
worker.PhoneNumber = deviceUserModel.PhoneNumber;
306+
worker.Resigned = deviceUserModel.Resigned;
307+
worker.ResignedAtDate = deviceUserModel.ResignedAtDate;
299308
await worker.Update(sdkDbContext).ConfigureAwait(false);
300309

301310
var user = await userService.GetByUsernameAsync(oldEmail).ConfigureAwait(false);

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Models/AssignmentWorker/PropertyWorkersFiltrationModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ namespace BackendConfiguration.Pn.Infrastructure.Models.AssignmentWorker;
66
public class PropertyWorkersFiltrationModel : FilterAndSortModel
77
{
88
public List<int> PropertyIds { get; set; }
9+
public bool ShowResigned { get; set; }
910
}

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Models/Compliances/CompliancesStatsModel.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
13
namespace BackendConfiguration.Pn.Controllers;
24

35
public class CompliancesStatsModel
@@ -13,4 +15,10 @@ public class CompliancesStatsModel
1315
public int ThreeMonthsCount { get; set; }
1416
public int SixMonthsCount { get; set; }
1517
public int MoreThanSixMonthsCount { get; set; }
18+
public int NumberOfPlannedTasks { get; set; }
19+
public DateTime? DateOfOldestPlannedTask { get; set; }
20+
public int NumberOfPlannedEnvironmentInspectionTagTasks { get; set; }
21+
public DateTime? DateOfOldestEnvironmentInspectionTagPlannedTask { get; set; }
22+
public int NumberOfAdHocTasks { get; set; }
23+
public DateTime? DateOfOldestAdHocTask { get; set; }
1624
}

0 commit comments

Comments
 (0)