Skip to content

Commit 78fd8ca

Browse files
committed
Order updates and deployments by version, update routes, and improve UploadUpdate layout styling
1 parent cc4e3ee commit 78fd8ca

7 files changed

Lines changed: 26 additions & 19 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEditForm_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FSourcesCache_003F3ac434135f167e39477dbad579a1e0d0343b31cc852a11c1610b03a5ed318_003FEditForm_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
23
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=c8d2e202_002Dc47f_002D441a_002Dba12_002D3e25f498d0ad/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;
34
&lt;Solution /&gt;
45
&lt;/SessionState&gt;</s:String></wpf:ResourceDictionary>

src/Admin.Api/Infrastructure/Repositories/DeploymentRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public async Task<List<Deployment>> GetAllAsync(CancellationToken cancellationTo
3030
.Include(d => d.Release)
3131
.ThenInclude(r => r.Update)
3232
.Include(d => d.Device)
33-
.OrderByDescending(d => d.CreatedAt)
33+
.OrderByDescending(d => d.Release!.Update!.Version)
3434
.ToListAsync(cancellationToken);
3535
}
3636

src/Admin.Api/Infrastructure/Repositories/UpdateRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public async Task<List<Update>> GetAllAsync(bool includeInactive = false, Cancel
3737
}
3838

3939
return await query
40-
.OrderByDescending(u => u.CreatedAt)
40+
.OrderByDescending(u => u.Version)
4141
.ToListAsync(cancellationToken);
4242
}
4343

src/Admin.Web/Pages/Updates/UploadUpdate.razor

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
@using Admin.Shared.Enums
44
@using Microsoft.AspNetCore.Components.Forms
55
@using System.Text.Json
6+
@using Microsoft.FluentUI.AspNetCore.Components
7+
@using ButtonType = Microsoft.FluentUI.AspNetCore.Components.ButtonType
8+
@using Orientation = Microsoft.FluentUI.AspNetCore.Components.Orientation
69
@inject HttpClient Http
710
@inject IConfiguration Config
811
@inject NavigationManager Navigation
@@ -13,30 +16,30 @@
1316
<FluentStack Orientation="Orientation.Vertical" Width="100%">
1417
<h2>Upload New Update</h2>
1518

16-
<EditForm Model="@model" OnValidSubmit="@HandleSubmit">
19+
<EditForm Model="@model" OnValidSubmit="@HandleSubmit" class="w-100">
1720
<FluentCard Style="max-width: 800px;">
1821
<FluentStack Orientation="Orientation.Vertical">
19-
<div class="form-group">
22+
<div class="form-group w-100">
2023
<label>Version *</label>
2124
<input type="text" class="form-control" @bind="model.Version" placeholder="1.0.0" required />
2225
</div>
2326

24-
<div class="form-group">
27+
<div class="form-group w-100">
2528
<label>Title *</label>
2629
<input type="text" class="form-control" @bind="model.Title" placeholder="Security Patch" required />
2730
</div>
2831

29-
<div class="form-group">
32+
<div class="form-group w-100">
3033
<label>Description</label>
3134
<textarea class="form-control" @bind="model.Description" placeholder="Brief description of the update..." rows="3"></textarea>
3235
</div>
3336

34-
<div class="form-group">
37+
<div class="form-group w-100">
3538
<label>Change Log</label>
3639
<textarea class="form-control" @bind="model.ChangeLog" placeholder="- Fixed bug XYZ&#10;- Added feature ABC" rows="5"></textarea>
3740
</div>
3841

39-
<div class="form-group">
42+
<div class="form-group w-100">
4043
<label>Update Type</label>
4144
<select class="form-control" @bind="model.UpdateType">
4245
<option value="@UpdateType.Security">Security</option>
@@ -46,7 +49,7 @@
4649
</select>
4750
</div>
4851

49-
<div class="form-group">
52+
<div class="form-group w-100">
5053
<label>Severity</label>
5154
<select class="form-control" @bind="model.Severity">
5255
<option value="@UpdateSeverity.Critical">Critical</option>
@@ -56,18 +59,21 @@
5659
</select>
5760
</div>
5861

59-
<div class="form-check">
62+
<div class="form-check w-100">
6063
<input type="checkbox" class="form-check-input" @bind="model.IsSecurityUpdate" id="securityCheck" />
6164
<label class="form-check-label" for="securityCheck">Is Security Update</label>
6265
</div>
6366

64-
<div class="form-group">
65-
<label>Security Fixes (one per line, e.g., CVE-2024-1234)</label>
66-
<textarea class="form-control" @bind="securityFixesInput" placeholder="CVE-2024-1234&#10;CVE-2024-5678" rows="3"></textarea>
67-
<small class="form-text text-muted">Enter CVE IDs or vulnerability descriptions, one per line</small>
68-
</div>
67+
@if (model.IsSecurityUpdate)
68+
{
69+
<div class="form-group w-100">
70+
<label>Security Fixes (one per line, e.g., CVE-2024-1234)</label>
71+
<textarea class="form-control" @bind="securityFixesInput" placeholder="CVE-2024-1234&#10;CVE-2024-5678" rows="3"></textarea>
72+
<small class="form-text text-muted">Enter CVE IDs or vulnerability descriptions, one per line</small>
73+
</div>
74+
}
6975

70-
<div class="form-group">
76+
<div class="form-group w-100 d-none">
7177
<label>Target Device Types (one per line)</label>
7278
<textarea class="form-control" @bind="targetDeviceTypesInput" placeholder="PackagingMachine&#10;QualityControlStation" rows="3"></textarea>
7379
<small class="form-text text-muted">Enter device type names, one per line</small>

src/Admin.Web/Shared/Layout/MainLayout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<FluentNavLink Href="/" Icon="@(new Icons.Regular.Size20.Home())" Match="NavLinkMatch.All">
1818
Home
1919
</FluentNavLink>
20-
<FluentNavLink Href="/upload-update" Icon="@(new Icons.Regular.Size20.CloudArrowUp())">
20+
<FluentNavLink Href="/updates/upload" Icon="@(new Icons.Regular.Size20.CloudArrowUp())">
2121
Upload Updates
2222
</FluentNavLink>
2323
<FluentNavLink Href="/manage-releases" Icon="@(new Icons.Regular.Size20.Document())">

src/ClientPortal.Web/Pages/Updates/AvailableUpdates.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Oka@page "/updates"
1+
@page "/updates"
22
@using Admin.Shared.Dto
33
@using Admin.Shared.Enums
44
@using ClientPortal.Web.Application.Services

src/ClientPortal.Web/wwwroot/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
99
<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
1010
<link href="_content/Blazored.Toast/blazored-toast.min.css" rel="stylesheet" />
11-
<link href="Vendor.Client.Web.styles.css" rel="stylesheet" />
11+
<link href="ClientPortal.Web.styles.css" rel="stylesheet" />
1212
</head>
1313

1414
<body style="background-color: var(--neutral-layer-1);">

0 commit comments

Comments
 (0)