Add versioning, content, and chat presence/notifications services
- SOR.Versioning: version.check handler, ClientRelease entity + admin UI - SOR.Content: incremental card sync (DefinitionVersion cursor via Postgres trigger), content.sync / content.sets / content.card handlers - Chat: presence (account_presence) + notifications with unread count and mark-read - CardDefinition: DefinitionVersion bigint (trigger-assigned) + IsRetired soft-delete - 3 migrations applied to pg-forge-01 (Identity, Chat, Catalog) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -63,6 +63,11 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link text-white" href="/versioning/releases" Match="NavLinkMatch.All">
|
||||
<i class="bi bi-phone me-2"></i>Client Versions
|
||||
</NavLink>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<NavLink class="nav-link text-white" href="/content/ai-assets" Match="NavLinkMatch.All">
|
||||
<i class="bi bi-robot me-2"></i>AI Art Tracker
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
@page "/versioning/releases/new"
|
||||
@page "/versioning/releases/{Id:guid}"
|
||||
@using SOR.Database.Contexts
|
||||
@using SOR.Database.Entities.Identity
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@inject SorIdentityDbContext IdentityDb
|
||||
@inject NavigationManager Nav
|
||||
|
||||
<PageTitle>@(_isNew ? "New Release" : "Edit Release") — SOR Admin</PageTitle>
|
||||
|
||||
<div class="d-flex align-items-center mb-3 gap-2">
|
||||
<a href="/versioning/releases" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left me-1"></i>Back
|
||||
</a>
|
||||
<h4 class="mb-0">@(_isNew ? "New Client Release" : $"Edit Release — {_release.Platform} {_release.Version}")</h4>
|
||||
</div>
|
||||
|
||||
@if (_release == null)
|
||||
{
|
||||
<p class="text-muted">Loading...</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="card bg-dark border-secondary" style="max-width:600px;">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Platform</label>
|
||||
<select @bind="_release.Platform" class="form-select bg-dark text-white border-secondary">
|
||||
<option value="">— select —</option>
|
||||
<option value="android">Android</option>
|
||||
<option value="ios">iOS</option>
|
||||
<option value="pc">PC</option>
|
||||
<option value="web">Web</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Version <span class="text-muted small">(semver, e.g. 1.2.3)</span></label>
|
||||
<input @bind="_release.Version" type="text" class="form-control bg-dark text-white border-secondary"
|
||||
placeholder="1.0.0" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Released At</label>
|
||||
<input @bind="_release.ReleasedAt" type="datetime-local" class="form-control bg-dark text-white border-secondary" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Download URL</label>
|
||||
<input @bind="_release.DownloadUrl" type="url" class="form-control bg-dark text-white border-secondary"
|
||||
placeholder="https://..." />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Release Notes</label>
|
||||
<textarea @bind="_release.ReleaseNotes" class="form-control bg-dark text-white border-secondary"
|
||||
rows="4" placeholder="What's new in this release..."></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-check mb-2">
|
||||
<input @bind="_release.IsRequired" type="checkbox" class="form-check-input" id="required" />
|
||||
<label class="form-check-label text-danger fw-bold" for="required">
|
||||
<i class="bi bi-exclamation-triangle me-1"></i>Update Required
|
||||
<span class="text-muted fw-normal small ms-1">(blocks clients on older versions)</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check mb-3">
|
||||
<input @bind="_release.IsActive" type="checkbox" class="form-check-input" id="active" />
|
||||
<label class="form-check-label" for="active">Active</label>
|
||||
</div>
|
||||
|
||||
@if (_error != null)
|
||||
{
|
||||
<div class="alert alert-danger py-2 small">@_error</div>
|
||||
}
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button class="btn btn-primary" @onclick="SaveAsync">
|
||||
<i class="bi bi-floppy me-1"></i>Save
|
||||
</button>
|
||||
@if (!_isNew)
|
||||
{
|
||||
<button class="btn btn-outline-danger" @onclick="DeleteAsync">
|
||||
<i class="bi bi-trash me-1"></i>Delete
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid? Id { get; set; }
|
||||
|
||||
private ClientRelease _release = new() { ReleasedAt = DateTimeOffset.UtcNow, IsActive = true };
|
||||
private bool _isNew = true;
|
||||
private string? _error;
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
if (Id.HasValue)
|
||||
{
|
||||
var existing = await IdentityDb.ClientReleases.FindAsync(Id.Value);
|
||||
if (existing != null)
|
||||
{
|
||||
_release = existing;
|
||||
_isNew = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveAsync()
|
||||
{
|
||||
_error = null;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(_release.Platform)) { _error = "Platform is required."; return; }
|
||||
if (string.IsNullOrWhiteSpace(_release.Version)) { _error = "Version is required."; return; }
|
||||
|
||||
if (_isNew)
|
||||
IdentityDb.ClientReleases.Add(_release);
|
||||
|
||||
await IdentityDb.SaveChangesAsync();
|
||||
Nav.NavigateTo("/versioning/releases");
|
||||
}
|
||||
|
||||
private async Task DeleteAsync()
|
||||
{
|
||||
IdentityDb.ClientReleases.Remove(_release);
|
||||
await IdentityDb.SaveChangesAsync();
|
||||
Nav.NavigateTo("/versioning/releases");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
@page "/versioning/releases"
|
||||
@using SOR.Database.Contexts
|
||||
@using SOR.Database.Entities.Identity
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@inject SorIdentityDbContext IdentityDb
|
||||
|
||||
<PageTitle>Client Releases — SOR Admin</PageTitle>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h4 class="mb-0"><i class="bi bi-phone me-2"></i>Client Releases</h4>
|
||||
<a href="/versioning/releases/new" class="btn btn-sm btn-primary">
|
||||
<i class="bi bi-plus-lg me-1"></i>New Release
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@if (_releases == null)
|
||||
{
|
||||
<p class="text-muted">Loading...</p>
|
||||
}
|
||||
else if (_releases.Count == 0)
|
||||
{
|
||||
<p class="text-muted">No releases configured yet.</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table table-dark table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Platform</th>
|
||||
<th>Version</th>
|
||||
<th>Required</th>
|
||||
<th>Active</th>
|
||||
<th>Released</th>
|
||||
<th>Download</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var r in _releases)
|
||||
{
|
||||
<tr>
|
||||
<td><span class="badge bg-secondary text-uppercase">@r.Platform</span></td>
|
||||
<td class="fw-bold">@r.Version</td>
|
||||
<td>
|
||||
@if (r.IsRequired)
|
||||
{
|
||||
<span class="badge bg-danger">Required</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-muted small">Optional</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (r.IsActive)
|
||||
{
|
||||
<i class="bi bi-check-circle-fill text-success"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="bi bi-x-circle text-muted"></i>
|
||||
}
|
||||
</td>
|
||||
<td class="text-muted small">@r.ReleasedAt.ToString("yyyy-MM-dd")</td>
|
||||
<td class="small">
|
||||
@if (r.DownloadUrl != null)
|
||||
{
|
||||
<span class="text-muted font-monospace" title="@r.DownloadUrl">
|
||||
@(r.DownloadUrl.Length > 40 ? r.DownloadUrl[..40] + "…" : r.DownloadUrl)
|
||||
</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<a href="/versioning/releases/@r.Id" class="btn btn-sm btn-outline-secondary">
|
||||
Edit
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
|
||||
@code {
|
||||
private List<ClientRelease>? _releases;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_releases = await IdentityDb.ClientReleases
|
||||
.OrderByDescending(r => r.ReleasedAt)
|
||||
.ThenBy(r => r.Platform)
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user