From fd30112ee8a7ae4b0f3d50666e483096eef6a10a Mon Sep 17 00:00:00 2001 From: Leigh Pointer Date: Sat, 1 Jul 2023 14:41:03 +0200 Subject: [PATCH 1/5] Removed RazorLangVersion tag from Client project files as to discussion #2965 --- Oqtane.Client/Oqtane.Client.csproj | 1 - .../External/Client/[Owner].Module.[Module].Client.csproj | 1 - .../External/Client/[Owner].Theme.[Theme].Client.csproj | 1 - 3 files changed, 3 deletions(-) diff --git a/Oqtane.Client/Oqtane.Client.csproj b/Oqtane.Client/Oqtane.Client.csproj index 9ea4853c..19f19354 100644 --- a/Oqtane.Client/Oqtane.Client.csproj +++ b/Oqtane.Client/Oqtane.Client.csproj @@ -3,7 +3,6 @@ net7.0 Exe - 3.0 Debug;Release 4.0.0 Oqtane diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/[Owner].Module.[Module].Client.csproj b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/[Owner].Module.[Module].Client.csproj index 98abe0e7..68e4160c 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/[Owner].Module.[Module].Client.csproj +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/[Owner].Module.[Module].Client.csproj @@ -2,7 +2,6 @@ net7.0 - 3.0 1.0.0 [Owner] [Owner] diff --git a/Oqtane.Server/wwwroot/Themes/Templates/External/Client/[Owner].Theme.[Theme].Client.csproj b/Oqtane.Server/wwwroot/Themes/Templates/External/Client/[Owner].Theme.[Theme].Client.csproj index 8655320d..0799ae41 100644 --- a/Oqtane.Server/wwwroot/Themes/Templates/External/Client/[Owner].Theme.[Theme].Client.csproj +++ b/Oqtane.Server/wwwroot/Themes/Templates/External/Client/[Owner].Theme.[Theme].Client.csproj @@ -2,7 +2,6 @@ net7.0 - 3.0 1.0.0 [Owner] [Owner] From b7de4b81a625921c9e7a3308befc0e71f4abc84e Mon Sep 17 00:00:00 2001 From: vnetonline Date: Wed, 5 Jul 2023 15:58:35 +1000 Subject: [PATCH 2/5] [ENHANCE] - Added IsRead property to Notifications Fixed Version to Tenant.04.00.01.01 and reverted the Program.cs back to the way it was This reverts commit 82fef82c4f29115a3c9f2ffefbae355ce24605e6. [ENHANCE] - Added API to get Count of New Notifications based on IsRead Fixed Typo in Notification Controller [ENHANCE] - Added API to get Notifications by Count and IsRead --- .../Modules/Admin/UserProfile/Index.razor | 84 ++++++++++++++----- .../Modules/Admin/UserProfile/View.razor | 3 + .../Interfaces/INotificationService.cs | 21 +++++ Oqtane.Client/Services/NotificationService.cs | 14 ++++ .../Controllers/NotificationController.cs | 69 +++++++++++++++ .../Tenant/04000101_AddNotificationIsRead.cs | 35 ++++++++ .../Interfaces/INotificationRepository.cs | 2 + .../Repository/NotificationRepository.cs | 46 ++++++++++ Oqtane.Shared/Models/Notification.cs | 5 ++ 9 files changed, 257 insertions(+), 22 deletions(-) create mode 100644 Oqtane.Server/Migrations/Tenant/04000101_AddNotificationIsRead.cs diff --git a/Oqtane.Client/Modules/Admin/UserProfile/Index.razor b/Oqtane.Client/Modules/Admin/UserProfile/Index.razor index e1eabc2c..76002925 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/Index.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/Index.razor @@ -159,22 +159,41 @@ else - @context.FromDisplayName - @context.Subject - @string.Format("{0:dd-MMM-yyyy HH:mm:ss}", @context.CreatedOn) + + @if (context.IsRead) + { + @context.FromDisplayName + @context.Subject + @string.Format("{0:dd-MMM-yyyy HH:mm:ss}", @context.CreatedOn) + } + else + { + @context.FromDisplayName + @context.Subject + @string.Format("{0:dd-MMM-yyyy HH:mm:ss}", @context.CreatedOn) + } @{ - string input = "___"; - if (context.Body.Contains(input)) - { - context.Body = context.Body.Split(input)[0]; - context.Body = context.Body.Replace("\n", ""); - context.Body = context.Body.Replace("\r", ""); - } } - @(context.Body.Length > 100 ? (context.Body.Substring(0, 97) + "...") : context.Body) + string input = "___"; + if (context.Body.Contains(input)) + { + context.Body = context.Body.Split(input)[0]; + context.Body = context.Body.Replace("\n", ""); + context.Body = context.Body.Replace("\r", ""); + } + notificationSummary = context.Body.Length > 100 ? (context.Body.Substring(0, 97) + "...") : context.Body; + } + @if (context.IsRead) + { + @notificationSummary + } + else + { + @notificationSummary + } @@ -192,22 +211,42 @@ else - @context.ToDisplayName - @context.Subject - @string.Format("{0:dd-MMM-yyyy HH:mm:ss}", @context.CreatedOn) + + @if (context.IsRead) + { + @context.ToDisplayName + @context.Subject + @string.Format("{0:dd-MMM-yyyy HH:mm:ss}", @context.CreatedOn) + } + else + { + @context.ToDisplayName + @context.Subject + @string.Format("{0:dd-MMM-yyyy HH:mm:ss}", @context.CreatedOn) + } + @{ - string input = "___"; - if (context.Body.Contains(input)) - { - context.Body = context.Body.Split(input)[0]; - context.Body = context.Body.Replace("\n", ""); - context.Body = context.Body.Replace("\r", ""); - } } - @(context.Body.Length > 100 ? (context.Body.Substring(0, 97) + "...") : context.Body) + string input = "___"; + if (context.Body.Contains(input)) + { + context.Body = context.Body.Split(input)[0]; + context.Body = context.Body.Replace("\n", ""); + context.Body = context.Body.Replace("\r", ""); + } + notificationSummary = context.Body.Length > 100 ? (context.Body.Substring(0, 97) + "...") : context.Body; + } + @if (context.IsRead) + { + @notificationSummary + } + else + { + @notificationSummary + } @@ -246,6 +285,7 @@ else private string category = string.Empty; private string filter = "to"; private List notifications; + private string notificationSummary = string.Empty; public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.View; diff --git a/Oqtane.Client/Modules/Admin/UserProfile/View.razor b/Oqtane.Client/Modules/Admin/UserProfile/View.razor index 947a6c7b..58a3d211 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/View.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/View.razor @@ -118,6 +118,9 @@ Notification notification = await NotificationService.GetNotificationAsync(notificationid); if (notification != null) { + notification.IsRead = true; + notification = await NotificationService.UpdateNotificationAsync(notification); + int userid = -1; if (notification.ToUserId == PageState.User.UserId) { diff --git a/Oqtane.Client/Services/Interfaces/INotificationService.cs b/Oqtane.Client/Services/Interfaces/INotificationService.cs index d1be32a2..a831dd5d 100644 --- a/Oqtane.Client/Services/Interfaces/INotificationService.cs +++ b/Oqtane.Client/Services/Interfaces/INotificationService.cs @@ -18,6 +18,27 @@ namespace Oqtane.Services /// Task> GetNotificationsAsync(int siteId, string direction, int userId); + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task> GetNotificationsAsync(int siteId, string direction, int userId, int count, bool isRead); + + /// + /// + /// + /// + /// + /// + /// + /// + Task GetNotificationCountAsync(int siteId, string direction, int userId, bool isRead); + /// /// Returns a specific notifications /// diff --git a/Oqtane.Client/Services/NotificationService.cs b/Oqtane.Client/Services/NotificationService.cs index 3368ff0b..f6fd1585 100644 --- a/Oqtane.Client/Services/NotificationService.cs +++ b/Oqtane.Client/Services/NotificationService.cs @@ -22,6 +22,20 @@ namespace Oqtane.Services return notifications.OrderByDescending(item => item.CreatedOn).ToList(); } + public async Task> GetNotificationsAsync(int siteId, string direction, int userId, int count, bool isRead) + { + var notifications = await GetJsonAsync>($"{Apiurl}/read?siteid={siteId}&direction={direction.ToLower()}&userid={userId}&count={count}&isread={isRead}"); + + return notifications.OrderByDescending(item => item.CreatedOn).ToList(); + } + + public async Task GetNotificationCountAsync(int siteId, string direction, int userId, bool isRead) + { + var notificationCount = await GetJsonAsync($"{Apiurl}/read-count?siteid={siteId}&direction={direction.ToLower()}&userid={userId}&isread={isRead}"); + + return notificationCount; + } + public async Task GetNotificationAsync(int notificationId) { return await GetJsonAsync($"{Apiurl}/{notificationId}"); diff --git a/Oqtane.Server/Controllers/NotificationController.cs b/Oqtane.Server/Controllers/NotificationController.cs index dfdba5f1..95621a47 100644 --- a/Oqtane.Server/Controllers/NotificationController.cs +++ b/Oqtane.Server/Controllers/NotificationController.cs @@ -9,6 +9,9 @@ using Oqtane.Repository; using Oqtane.Security; using System.Net; using System.Reflection.Metadata; +using Microsoft.Extensions.Localization; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using System.Linq; namespace Oqtane.Controllers { @@ -30,6 +33,72 @@ namespace Oqtane.Controllers _alias = tenantManager.GetAlias(); } + // GET: api//read?siteid=x&direction=to&userid=1&count=5&isread=false + [HttpGet("read")] + [Authorize(Roles = RoleNames.Registered)] + public IEnumerable Get(string siteid, string direction, string userid, string count, string isread) + { + IEnumerable notifications = null; + + int SiteId; + int UserId; + int Count; + bool IsRead; + if (int.TryParse(siteid, out SiteId) && SiteId == _alias.SiteId && int.TryParse(userid, out UserId) && int.TryParse(count, out Count) && bool.TryParse(isread, out IsRead) && IsAuthorized(UserId)) + { + if (direction == "to") + { + notifications = _notifications.GetNotifications(SiteId, -1, UserId, Count, IsRead); + } + else + { + notifications = _notifications.GetNotifications(SiteId, UserId, -1, Count, IsRead); + } + } + else + { + _logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized Notification Get Attempt {SiteId} {Direction} {UserId} {Count} {isRead}", siteid, direction, userid, count, isread); + HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden; + notifications = null; + } + + + return notifications; + } + + // GET: api//read?siteid=x&direction=to&userid=1&count=5&isread=false + [HttpGet("read-count")] + [Authorize(Roles = RoleNames.Registered)] + public int Get(string siteid, string direction, string userid, string isread) + { + int notificationsCount = 0; + + int SiteId; + int UserId; + bool IsRead; + if (int.TryParse(siteid, out SiteId) && SiteId == _alias.SiteId && int.TryParse(userid, out UserId) && bool.TryParse(isread, out IsRead) && IsAuthorized(UserId)) + { + if (direction == "to") + { + notificationsCount = _notifications.GetNotificationCount(SiteId, -1, UserId, IsRead); + } + else + { + notificationsCount = _notifications.GetNotificationCount(SiteId, UserId, -1, IsRead); + } + } + else + { + _logger.Log(LogLevel.Error, this, LogFunction.Security, "Unauthorized Notification Get Attempt {SiteId} {Direction} {UserId} {isRead}", siteid, direction, userid, isread); + HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden; + notificationsCount = 0; + } + + + return notificationsCount; + } + + // GET: api/?siteid=x&type=y&userid=z [HttpGet] [Authorize(Roles = RoleNames.Registered)] diff --git a/Oqtane.Server/Migrations/Tenant/04000101_AddNotificationIsRead.cs b/Oqtane.Server/Migrations/Tenant/04000101_AddNotificationIsRead.cs new file mode 100644 index 00000000..8b97308c --- /dev/null +++ b/Oqtane.Server/Migrations/Tenant/04000101_AddNotificationIsRead.cs @@ -0,0 +1,35 @@ +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Oqtane.Databases.Interfaces; +using Oqtane.Migrations.EntityBuilders; +using Oqtane.Repository; +using Oqtane.Shared; + +namespace Oqtane.Migrations.Tenant +{ + [DbContext(typeof(TenantDBContext))] + [Migration("Tenant.04.00.01.01")] + public class AddNotificationIsRead : MultiDatabaseMigration + { + + public AddNotificationIsRead(IDatabase database) : base(database) + { + } + + protected override void Up(MigrationBuilder migrationBuilder) + { + var notificationEntityBuilder = new NotificationEntityBuilder(migrationBuilder, ActiveDatabase); + notificationEntityBuilder.AddBooleanColumn("IsRead", false); + notificationEntityBuilder.UpdateColumn("IsRead", "1", "bool", ""); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + var notificationEntityBuilder = new NotificationEntityBuilder(migrationBuilder, ActiveDatabase); + notificationEntityBuilder.DropColumn("IsPublic"); + } + + } + + +} diff --git a/Oqtane.Server/Repository/Interfaces/INotificationRepository.cs b/Oqtane.Server/Repository/Interfaces/INotificationRepository.cs index 34fb58be..948d7b53 100644 --- a/Oqtane.Server/Repository/Interfaces/INotificationRepository.cs +++ b/Oqtane.Server/Repository/Interfaces/INotificationRepository.cs @@ -6,6 +6,8 @@ namespace Oqtane.Repository public interface INotificationRepository { IEnumerable GetNotifications(int siteId, int fromUserId, int toUserId); + IEnumerable GetNotifications(int siteId, int fromUserId, int toUserId, int count, bool isRead); + int GetNotificationCount(int siteId, int fromUserId, int toUserId, bool isRead); Notification AddNotification(Notification notification); Notification UpdateNotification(Notification notification); Notification GetNotification(int notificationId); diff --git a/Oqtane.Server/Repository/NotificationRepository.cs b/Oqtane.Server/Repository/NotificationRepository.cs index 7596ee94..42eff7cd 100644 --- a/Oqtane.Server/Repository/NotificationRepository.cs +++ b/Oqtane.Server/Repository/NotificationRepository.cs @@ -33,6 +33,52 @@ namespace Oqtane.Repository .ToList(); } + public IEnumerable GetNotifications(int siteId, int fromUserId, int toUserId, int count, bool isRead) + { + if (toUserId == -1 && fromUserId == -1) + { + return _db.Notification + .Where(item => item.SiteId == siteId) + .Where(item => item.IsDelivered == false && item.IsDeleted == false) + .Where(item => item.SendOn == null || item.SendOn < System.DateTime.UtcNow) + .Where(item => item.IsRead == isRead) + .ToList() + .Take(count); + } + + return _db.Notification + .Where(item => item.SiteId == siteId) + .Where(item => item.ToUserId == toUserId || toUserId == -1) + .Where(item => item.FromUserId == fromUserId || fromUserId == -1) + .Where(item => item.IsRead == isRead) + .ToList() + .Take(count); + } + + public int GetNotificationCount(int siteId, int fromUserId, int toUserId, bool isRead) + { + if (toUserId == -1 && fromUserId == -1) + { + return _db.Notification + .Where(item => item.SiteId == siteId) + .Where(item => item.IsDelivered == false && item.IsDeleted == false) + .Where(item => item.SendOn == null || item.SendOn < System.DateTime.UtcNow) + .Where(item => item.IsRead == isRead) + .ToList() + .Count(); + + } + + return _db.Notification + .Where(item => item.SiteId == siteId) + .Where(item => item.ToUserId == toUserId || toUserId == -1) + .Where(item => item.FromUserId == fromUserId || fromUserId == -1) + .Where(item => item.IsRead == isRead) + .ToList() + .Count(); + } + + public Notification AddNotification(Notification notification) { _db.Notification.Add(notification); diff --git a/Oqtane.Shared/Models/Notification.cs b/Oqtane.Shared/Models/Notification.cs index 975b28c8..d7e08c01 100644 --- a/Oqtane.Shared/Models/Notification.cs +++ b/Oqtane.Shared/Models/Notification.cs @@ -94,6 +94,10 @@ namespace Oqtane.Models /// public DateTime? SendOn { get; set; } + /// + /// If it has been read. See also + /// + public bool IsRead { get; set; } // constructors public Notification() {} @@ -174,6 +178,7 @@ namespace Oqtane.Models } IsDelivered = false; DeliveredOn = null; + IsRead = false; } } From 40459defa4687ba4d8f256d6d3db968994d021bb Mon Sep 17 00:00:00 2001 From: vnetonline Date: Thu, 6 Jul 2023 15:28:11 +1000 Subject: [PATCH 3/5] Cosmetic change to more the filter drop down to top of the notifications tab --- Oqtane.Client/Modules/Admin/UserProfile/Index.razor | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/UserProfile/Index.razor b/Oqtane.Client/Modules/Admin/UserProfile/Index.razor index 76002925..2dd1303d 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/Index.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/Index.razor @@ -144,6 +144,11 @@ else @if (notifications != null) { + +


@if (filter == "to") @@ -256,11 +261,6 @@ else
} -

- }
From f7338bf00e928fc66945d790bada4780c099bb74 Mon Sep 17 00:00:00 2001 From: vnetonline Date: Fri, 7 Jul 2023 10:21:22 +1000 Subject: [PATCH 4/5] Update GetNotifications (read) to retrieve descending oder by CreatedOn at repository level --- Oqtane.Server/Repository/NotificationRepository.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Oqtane.Server/Repository/NotificationRepository.cs b/Oqtane.Server/Repository/NotificationRepository.cs index 42eff7cd..43f9b386 100644 --- a/Oqtane.Server/Repository/NotificationRepository.cs +++ b/Oqtane.Server/Repository/NotificationRepository.cs @@ -42,6 +42,7 @@ namespace Oqtane.Repository .Where(item => item.IsDelivered == false && item.IsDeleted == false) .Where(item => item.SendOn == null || item.SendOn < System.DateTime.UtcNow) .Where(item => item.IsRead == isRead) + .OrderByDescending(item => item.CreatedOn) .ToList() .Take(count); } @@ -51,6 +52,7 @@ namespace Oqtane.Repository .Where(item => item.ToUserId == toUserId || toUserId == -1) .Where(item => item.FromUserId == fromUserId || fromUserId == -1) .Where(item => item.IsRead == isRead) + .OrderByDescending(item => item.CreatedOn) .ToList() .Take(count); } From 9a3b458c451ef393cd3e02bbff6085679a668feb Mon Sep 17 00:00:00 2001 From: sbwalker Date: Sun, 9 Jul 2023 08:36:14 -0400 Subject: [PATCH 5/5] Package enhancements for Marketplace --- Oqtane.Client/Modules/Controls/Section.razor | 7 +++++-- Oqtane.Client/Services/Interfaces/IPackageService.cs | 11 +++++++++++ Oqtane.Client/Services/PackageService.cs | 7 ++++++- Oqtane.Server/Controllers/FolderController.cs | 2 +- Oqtane.Server/Controllers/PackageController.cs | 4 ++-- Oqtane.Server/Controllers/PageController.cs | 6 ------ .../Repository/ModuleDefinitionRepository.cs | 1 + Oqtane.Server/Repository/ThemeRepository.cs | 1 + Oqtane.Shared/Models/Package.cs | 10 ++++++++++ 9 files changed, 37 insertions(+), 12 deletions(-) diff --git a/Oqtane.Client/Modules/Controls/Section.razor b/Oqtane.Client/Modules/Controls/Section.razor index 115e352d..928f1edc 100644 --- a/Oqtane.Client/Modules/Controls/Section.razor +++ b/Oqtane.Client/Modules/Controls/Section.razor @@ -17,7 +17,10 @@
- @ChildContent + @if (ChildContent != null) + { + @ChildContent + }
@code { @@ -26,7 +29,7 @@ private string _show = string.Empty; [Parameter] - public RenderFragment ChildContent { get; set; } + public RenderFragment ChildContent { get; set; } = null; [Parameter] public string Name { get; set; } // required - the name of the section diff --git a/Oqtane.Client/Services/Interfaces/IPackageService.cs b/Oqtane.Client/Services/Interfaces/IPackageService.cs index f8617439..4ace8cc8 100644 --- a/Oqtane.Client/Services/Interfaces/IPackageService.cs +++ b/Oqtane.Client/Services/Interfaces/IPackageService.cs @@ -27,6 +27,17 @@ namespace Oqtane.Services /// Task> GetPackagesAsync(string type, string search, string price, string package); + /// + /// Returns a list of packages matching the given parameters + /// + /// + /// + /// + /// + /// + /// + Task> GetPackagesAsync(string type, string search, string price, string package, string sort); + /// /// Returns a specific package /// diff --git a/Oqtane.Client/Services/PackageService.cs b/Oqtane.Client/Services/PackageService.cs index a45c73e6..78752d38 100644 --- a/Oqtane.Client/Services/PackageService.cs +++ b/Oqtane.Client/Services/PackageService.cs @@ -23,7 +23,12 @@ namespace Oqtane.Services public async Task> GetPackagesAsync(string type, string search, string price, string package) { - return await GetJsonAsync>($"{Apiurl}?type={type}&search={WebUtility.UrlEncode(search)}&price={price}&package={package}"); + return await GetPackagesAsync(type, search, price, package, ""); + } + + public async Task> GetPackagesAsync(string type, string search, string price, string package, string sort) + { + return await GetJsonAsync>($"{Apiurl}?type={type}&search={WebUtility.UrlEncode(search)}&price={price}&package={package}&sort={sort}"); } public async Task GetPackageAsync(string packageId, string version) diff --git a/Oqtane.Server/Controllers/FolderController.cs b/Oqtane.Server/Controllers/FolderController.cs index 6914aac7..b95f97f8 100644 --- a/Oqtane.Server/Controllers/FolderController.cs +++ b/Oqtane.Server/Controllers/FolderController.cs @@ -80,7 +80,7 @@ namespace Oqtane.Controllers public Folder GetByPath(int siteId, string path) { var folderPath = WebUtility.UrlDecode(path).Replace("\\", "/"); - if (!folderPath.EndsWith("/")) + if (!folderPath.EndsWith("/") && folderPath != "") { folderPath += "/"; } diff --git a/Oqtane.Server/Controllers/PackageController.cs b/Oqtane.Server/Controllers/PackageController.cs index d4ba5c21..fe2ad700 100644 --- a/Oqtane.Server/Controllers/PackageController.cs +++ b/Oqtane.Server/Controllers/PackageController.cs @@ -34,7 +34,7 @@ namespace Oqtane.Controllers // GET: api/?type=x&search=y&price=z&package=a [HttpGet] - public async Task> Get(string type, string search, string price, string package) + public async Task> Get(string type, string search, string price, string package, string sort) { // get packages List packages = new List(); @@ -44,7 +44,7 @@ namespace Oqtane.Controllers { client.DefaultRequestHeaders.Add("Referer", HttpContext.Request.Scheme + "://" + HttpContext.Request.Host.Value); client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(Constants.PackageId, Constants.Version)); - packages = await GetJson>(client, Constants.PackageRegistryUrl + $"/api/registry/packages/?id={_configManager.GetInstallationId()}&type={type.ToLower()}&version={Constants.Version}&search={search}&price={price}&package={package}"); + packages = await GetJson>(client, Constants.PackageRegistryUrl + $"/api/registry/packages/?id={_configManager.GetInstallationId()}&type={type.ToLower()}&version={Constants.Version}&search={search}&price={price}&package={package}&sort={sort}"); } } return packages; diff --git a/Oqtane.Server/Controllers/PageController.cs b/Oqtane.Server/Controllers/PageController.cs index f22f7467..73bacb34 100644 --- a/Oqtane.Server/Controllers/PageController.cs +++ b/Oqtane.Server/Controllers/PageController.cs @@ -7,14 +7,8 @@ using System.Linq; using Oqtane.Security; using System.Net; using Oqtane.Enums; -using Oqtane.Extensions; using Oqtane.Infrastructure; using Oqtane.Repository; -using Oqtane.Modules.Admin.Users; -using System.IO; -using Oqtane.Services; -using Oqtane.UI; -using System; namespace Oqtane.Controllers { diff --git a/Oqtane.Server/Repository/ModuleDefinitionRepository.cs b/Oqtane.Server/Repository/ModuleDefinitionRepository.cs index a82cce99..93d0f7f4 100644 --- a/Oqtane.Server/Repository/ModuleDefinitionRepository.cs +++ b/Oqtane.Server/Repository/ModuleDefinitionRepository.cs @@ -101,6 +101,7 @@ namespace Oqtane.Repository ModuleDefinition.IsPortable = moduleDefinition.IsPortable; ModuleDefinition.Resources = moduleDefinition.Resources; ModuleDefinition.IsEnabled = moduleDefinition.IsEnabled; + ModuleDefinition.PackageName = moduleDefinition.PackageName; } return ModuleDefinition; diff --git a/Oqtane.Server/Repository/ThemeRepository.cs b/Oqtane.Server/Repository/ThemeRepository.cs index 02e4a9c0..d34d2f31 100644 --- a/Oqtane.Server/Repository/ThemeRepository.cs +++ b/Oqtane.Server/Repository/ThemeRepository.cs @@ -89,6 +89,7 @@ namespace Oqtane.Repository Theme.Containers = theme.Containers; Theme.ThemeSettingsType = theme.ThemeSettingsType; Theme.ContainerSettingsType = theme.ContainerSettingsType; + Theme.PackageName = theme.PackageName; Themes.Add(Theme); } diff --git a/Oqtane.Shared/Models/Package.cs b/Oqtane.Shared/Models/Package.cs index 1a57e7bc..1e424744 100644 --- a/Oqtane.Shared/Models/Package.cs +++ b/Oqtane.Shared/Models/Package.cs @@ -32,6 +32,11 @@ namespace Oqtane.Models /// public string Description { get; set; } + /// + /// logo + /// + public int? LogoFileId { get; set; } + /// /// License for the Package. /// @@ -62,6 +67,11 @@ namespace Oqtane.Models /// public string PackageUrl { get; set; } + /// + /// The direct Url for getting support for the product + /// + public string SupportUrl { get; set; } + /// /// Indicates if any known security vulnerabilities exist ///