Enhance app management with 'IsRecommended' feature
- Added 'IsRecommended' property to app-related data models, allowing apps to be marked as recommended. - Updated API endpoints for creating and updating apps to include 'IsRecommended' in request bodies. - Modified database schema to accommodate the new 'IsRecommended' field. - Enhanced frontend components to display recommended apps with a star icon and updated forms to manage this property. - Improved sorting logic in app listings to prioritize recommended apps. - Updated documentation to reflect changes in API and data models.
This commit is contained in:
@@ -7,9 +7,17 @@ public sealed record ClientAppDto(
|
||||
string Name,
|
||||
string DownloadUrl,
|
||||
string? Description,
|
||||
string? IconUrl
|
||||
string? IconUrl,
|
||||
bool IsRecommended
|
||||
)
|
||||
{
|
||||
public static ClientAppDto FromDomain(ClientApp app) =>
|
||||
new(app.Id, app.Name, app.DownloadUrl.ToString(), app.Description, app.IconUrl);
|
||||
new(
|
||||
app.Id,
|
||||
app.Name,
|
||||
app.DownloadUrl.ToString(),
|
||||
app.Description,
|
||||
app.IconUrl,
|
||||
app.IsRecommended
|
||||
);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ public sealed class ListAppsQueryHandler(IAppDbContext dbContext)
|
||||
var apps = await dbContext
|
||||
.ClientApps.AsNoTracking()
|
||||
.Where(a => a.IsEnabled)
|
||||
.OrderBy(a => a.SortOrder)
|
||||
.OrderByDescending(a => a.IsRecommended)
|
||||
.ThenBy(a => a.SortOrder)
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
var grouped = apps.GroupBy(a => a.OperatingSystem)
|
||||
|
||||
Reference in New Issue
Block a user