Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-core-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test: [a,b,c,d,e,f,g]
test: [a,b,c,d,e,f,g,h]
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-core-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test: [a,b,c,d,e,f,g]
test: [a,b,c,d,e,f,g,h]
steps:
- uses: actions/checkout@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,6 @@ await dbContext.PlanRegistrations.AsNoTracking()
var planningModel = new TimePlanningPlanningPrDayModel
{
Id = planRegistration.Id,
PlanChangedByAdmin = planRegistration.PlanChangedByAdmin,
SiteName = site.Name,
Date = midnight,
PlanText = planRegistration.PlanText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,4 @@ public class TimePlanningPlanningPrDayModel
public DateTime? Pause5StoppedAt { get; set; }
public double NettoHoursOverride { get; set; }
public bool NettoHoursOverrideActive { get; set; }
public bool PlanChangedByAdmin { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -280,21 +280,19 @@ public async Task<OperationDataResult<TimePlanningPlanningModel>> IndexByCurrent
await baseDbContext.SaveChangesAsync();
}

var worker = await sdkDbContext.Workers
.Include(x => x.SiteWorkers)
.ThenInclude(x => x.Site)
var fullName = currentUser.FirstName.Trim() + " " + currentUser.LastName.Trim();

var site = await sdkDbContext.Sites
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
.FirstOrDefaultAsync(x => x.Email == currentUser.Email);
.FirstOrDefaultAsync(x => x.Name.Replace(" ", "") == fullName.Replace(" ", ""));

if (worker == null)
if (site == null)
{
return new OperationDataResult<TimePlanningPlanningModel>(
false,
localizationService.GetString("SiteNotFound"));
}

var site = worker.SiteWorkers.First().Site;

var dbAssignedSite = await dbContext.AssignedSites
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
.FirstOrDefaultAsync(x => x.SiteId == site.MicrotingUid);
Expand Down Expand Up @@ -920,7 +918,7 @@ await dbContext.PlanRegistrations.AsNoTracking()

return new OperationResult(
true,
localizationService.GetString("SuccessfullyCreateOrUpdatePlanning"));
localizationService.GetString("SuccessfullyUpdatedPlanning"));
}
catch (Exception e)
{
Expand All @@ -943,24 +941,21 @@ public async Task<OperationResult> UpdateByCurrentUserNam(
var currentUserAsync = await userService.GetCurrentUserAsync();
var currentUser = baseDbContext.Users
.Single(x => x.Id == currentUserAsync.Id);
var worker = await sdkDbContext.Workers
.Include(x => x.SiteWorkers)
.ThenInclude(x => x.Site)
var fullName = currentUser.FirstName.Trim() + " " + currentUser.LastName.Trim();
var sdkSite = await sdkDbContext.Sites
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
.FirstOrDefaultAsync(x => x.Email == currentUser.Email);
.FirstOrDefaultAsync(x => x.Name.Replace(" ", "") == fullName.Replace(" ", ""));

if (worker == null)
if (sdkSite == null)
{
return new OperationDataResult<TimePlanningPlanningModel>(
false,
localizationService.GetString("SiteNotFound"));
}

var mcrotingUid = worker.SiteWorkers.First().Site.MicrotingUid;

var assignedSite = await dbContext.AssignedSites
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
.FirstOrDefaultAsync(x => x.SiteId == mcrotingUid);
.FirstOrDefaultAsync(x => x.SiteId == sdkSite.MicrotingUid);

if (assignedSite == null)
{
Expand Down Expand Up @@ -1383,7 +1378,7 @@ await dbContext.PlanRegistrations.AsNoTracking()

return new OperationResult(
true,
localizationService.GetString("SuccessfullyCreateOrUpdatePlanning"));
localizationService.GetString("SuccessfullyUpdatedPlanning"));
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,20 +356,16 @@ planRegistrationForToday is
var currentUserAsync = await userService.GetCurrentUserAsync();
var currentUser = baseDbContext.Users
.Single(x => x.Id == currentUserAsync.Id);

var worker = await sdkContext.Workers
.Include(x => x.SiteWorkers)
.ThenInclude(x => x.Site)
var fullName = currentUser.FirstName.Trim() + " " + currentUser.LastName.Trim();
var sdkSite = await sdkContext.Sites
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
.FirstOrDefaultAsync(x => x.Email == currentUser.Email);
.FirstOrDefaultAsync(x => x.Name.Replace(" ", "") == fullName.Replace(" ", ""));

if (worker == null)
if (sdkSite == null)
{
return new OperationDataResult<Infrastructure.Models.Settings.AssignedSite>(false, "Site not found");
}

var sdkSite = worker.SiteWorkers.First().Site;

Infrastructure.Models.Settings.AssignedSite dbAssignedSite = await dbContext.AssignedSites
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
.AsNoTracking()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public async Task<OperationDataResult<List<TimePlanningWorkingHoursModel>>> Inde

var lastPlanning = dbContext.PlanRegistrations
.AsNoTracking()
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
.Where(x => x.Date < model.DateFrom)
.Where(x => x.SdkSitId == model.SiteId).OrderBy(x => x.Date).LastOrDefault();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ExcelDataReader" Version="3.8.0" />
<PackageReference Include="ExcelDataReader" Version="3.7.0" />
<PackageReference Include="Google.Apis.Sheets.v4" Version="1.70.0.3819" />
<PackageReference Include="Microting.eForm" Version="9.0.56" />
<PackageReference Include="Microting.EformAngularFrontendBase" Version="9.0.46" />
<PackageReference Include="Microting.eFormApi.BasePn" Version="9.0.51" />
<PackageReference Include="Microting.eForm" Version="9.0.52" />
<PackageReference Include="Microting.EformAngularFrontendBase" Version="9.0.44" />
<PackageReference Include="Microting.eFormApi.BasePn" Version="9.0.49" />
<PackageReference Include="McMaster.NETCore.Plugins" Version="2.0.0" />
<PackageReference Include="Microting.TimePlanningBase" Version="9.0.51" />
<PackageReference Include="Sentry" Version="5.15.1" />
<PackageReference Include="Microting.TimePlanningBase" Version="9.0.50" />
<PackageReference Include="Sentry" Version="5.14.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading