Skip to content

Commit

Permalink
Version 1.62 (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
NomisNostab authored Nov 11, 2024
2 parents bcf3cdd + 46f0d5d commit 80c6476
Show file tree
Hide file tree
Showing 10 changed files with 434 additions and 309 deletions.
10 changes: 7 additions & 3 deletions Model/Approvals/GetApprovalsRestulModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Achievement_Meta
public string branch { get; set; } = string.Empty;
public int stage { get; set; }
public string stream { get; set; } = string.Empty;
public string sia_area { get; set; } = string.Empty;
}

public class Submission
Expand All @@ -40,9 +41,12 @@ public class Submission

public class Actioned_By
{
public string id { get; set; } = string.Empty;
public string first_name { get; set; } = string.Empty;
public string last_name { get; set; } = string.Empty;
public string member_id { get; set; } = string.Empty;
public string member_first_name { get; set; } = string.Empty;
public string member_last_name { get; set; } = string.Empty;
public string outcome { get; set; } = string.Empty;
public DateTime time{ get; set; }
public string date_awarded { get; set; }

Check warning on line 49 in Model/Approvals/GetApprovalsRestulModel.cs

View workflow job for this annotation

GitHub Actions / deploy-to-github-pages

Non-nullable property 'date_awarded' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
}

public class Unit_Permissions
Expand Down
1 change: 1 addition & 0 deletions Model/Wallchart/WallchartItemModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
public class WallchartItemModel
{
public string MemberName { get; set; } = string.Empty;
public string MemberId { get; set; } = string.Empty;
public string MemberPatrol { get; set; } = string.Empty;
public DateTime? IntroToScouting { get; set; }
public DateTime? IntroToSection { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Services/ReportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,7 @@ public IWorkbook GenerateWallchartWorkbook(List<WallchartItemModel> wallchartEnt
sheet.Range[rowNumber, 43].Text = " PEAK AWARD";
sheet.SetRowHeight(rowNumber, 120);

foreach (var wallchartEntry in templatAnswerGroup)
foreach (var wallchartEntry in templatAnswerGroup.OrderBy(x => x.MemberName))
{
rowNumber++;
sheet.Range[rowNumber, 1].Text = wallchartEntry.MemberName;
Expand Down
2 changes: 1 addition & 1 deletion Topo/Controller/ApprovalsBackupController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected override void OnInitialized()
NavigationManager.NavigateTo("index");

model.Units = _storageService.Units;
if (_storageService.UnitId != null)
if (!string.IsNullOrEmpty(_storageService.UnitId))
{
model.SelectedUnitId = _storageService.UnitId;
model.SelectedUnitName = _storageService.UnitName;
Expand Down
4 changes: 2 additions & 2 deletions Topo/Controller/ApprovalsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected override void OnInitialized()
model.Units = _storageService.Units;
model.ApprovalSearchFromDate = DateTime.Now.AddMonths(-2);
model.ApprovalSearchToDate = DateTime.Now;
if (_storageService.UnitId != null)
if (!string.IsNullOrEmpty(_storageService.UnitId))
{
model.UnitId = _storageService.UnitId;
model.UnitName = _storageService.UnitName;
Expand All @@ -70,7 +70,7 @@ internal async Task RefreshApprovalsClick()
model.Approvals = await _approvalsService.GetApprovalListItems(_storageService.UnitId);
model.Approvals = model.Approvals?.Where(a => a.submission_date >= model.ApprovalSearchFromDate && a.submission_date <= model.ApprovalSearchToDate.AddDays(1)).ToList() ?? new List<ApprovalsListModel>();
if (model.ToBePresented)
model.Approvals = model.Approvals.Where(a => !string.IsNullOrEmpty(a.submission_outcome) && !a.presented_date.HasValue).ToList();
model.Approvals = model.Approvals.Where(a => a.submission_type == "Award" && !a.presented_date.HasValue).ToList();
if (model.IsPresented)
model.Approvals = model.Approvals.Where(a => a.presented_date.HasValue && a.presented_date != a.awarded_date).ToList();
if (!model.ShowRejected)
Expand Down
13 changes: 4 additions & 9 deletions Topo/Pages/Approvals/Approvals.razor
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,23 @@
<div class="col-sm-3">
<button type="submit" name="button" class="btn btn-primary" @onclick="RefreshApprovalsClick">Refresh list</button>
</div>
<div class="col-sm-3">
<a href="approvals/backup" class="btn btn-primary">Backup/Restore</a>
</div>
<div class="col-sm-4">
<div class="col-sm-7">
</div>
</div>

<SfGrid @ref="GridInstance" DataSource="@model.Approvals" AllowGrouping="true" AllowFiltering="true">
<GridGroupSettings Columns="@(new string[] {"achievement_name"})"></GridGroupSettings>
<GridFilterSettings Type="FilterType.Excel"></GridFilterSettings>
<GridEditSettings AllowEditing="true" Mode="EditMode.Normal">
<GridEditSettings AllowEditing="false" Mode="EditMode.Normal">
</GridEditSettings>
<GridEvents OnActionBegin="ActionBeginHandler" TValue="Model.Approvals.ApprovalsListModel"></GridEvents>
@* <GridEvents OnActionBegin="ActionBeginHandler" TValue="Model.Approvals.ApprovalsListModel"></GridEvents> *@
<GridColumns>
<GridColumn Field="achievement_id" HeaderText="Name" IsPrimaryKey="true" Visible="false"></GridColumn>
<GridColumn Field="member_display_name" HeaderText="Name" AllowEditing="false"></GridColumn>
<GridColumn Field="achievement_name" HeaderText="Achievement" AllowEditing="false" AllowFiltering="false"></GridColumn>
<GridColumn Field="submission_type" HeaderText="Type" AllowEditing="false" AllowFiltering="false" AllowGrouping="false"></GridColumn>
<GridColumn Field="submission_outcome" HeaderText="Outcome" AllowEditing="false" AllowFiltering="false" AllowGrouping="false"></GridColumn>
<GridColumn Field="submission_status" HeaderText="Status" AllowEditing="false" AllowFiltering="true" AllowGrouping="false"></GridColumn>
<GridColumn Field="awarded_date" HeaderText="Awarded" Format="dd/MM/yyyy" EditType="EditType.DatePickerEdit" Type="ColumnType.Date" AllowEditing="false" AllowFiltering="false" AllowGrouping="false"></GridColumn>
<GridColumn Field="presented_date" HeaderText="Presented" Format="dd/MM/yyyy" EditType="EditType.DatePickerEdit" Type="ColumnType.Date" AllowEditing="true" AllowFiltering="false" AllowGrouping="false" EditorSettings="@DateEditParams"></GridColumn>
<GridColumn Field="presented_date" HeaderText="Presented" Format="dd/MM/yyyy" EditType="EditType.DatePickerEdit" Type="ColumnType.Date" AllowEditing="false" AllowFiltering="false" AllowGrouping="false"></GridColumn>
</GridColumns>
</SfGrid>

Expand Down
Loading

0 comments on commit 80c6476

Please sign in to comment.