Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9c9b1a1
TD-3703-Changes
AnjuJose011 Mar 28, 2024
a157e64
fixes
AnjuJose011 Mar 28, 2024
21cbd8a
TD-3951:Missing back link names on few Bookmarks screens and issue wh…
Swapnamol Apr 9, 2024
bb515f9
Merge pull request #267 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Apr 9, 2024
9908007
Merge pull request #268 from TechnologyEnhancedLearning/Develop/Fixes…
OluwatobiAwe Apr 9, 2024
29446c2
TD-4009: Google Tag Manager tracking for all Non Prod Environments
Swapnamol Apr 10, 2024
f6421b6
Merge pull request #270 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Apr 10, 2024
90f59a7
TD-2959:Added hyperlinks to the existing html for certificate pdf gen…
ArunimaGeorge Apr 10, 2024
943443e
TD-4020: Edit Resource message update
ArunimaGeorge Apr 11, 2024
d54e859
Merge pull request #245 from TechnologyEnhancedLearning/Develop/Fixes…
AnjuJose011 Apr 11, 2024
1671aeb
Merge pull request #274 from TechnologyEnhancedLearning/Develop/fixes…
ArunimaGeorge Apr 11, 2024
c3a0a9d
TD-3311: Removed special characters in filename during file upload
ArunimaGeorge Apr 17, 2024
82d2c32
Merge pull request #297 from TechnologyEnhancedLearning/RC
AnjuJose011 Apr 17, 2024
8639131
Merge pull request #271 from TechnologyEnhancedLearning/Develop/fixes…
ArunimaGeorge Apr 18, 2024
37e9e28
Merge pull request #293 from TechnologyEnhancedLearning/Develop/fixes…
ArunimaGeorge Apr 18, 2024
84b219b
Merge pull request #337 from TechnologyEnhancedLearning/RC
Swapnamol May 3, 2024
9a53eed
TD-3740: added latest version check in view progress link condition
ArunimaGeorge May 7, 2024
c3eb439
Merge pull request #344 from TechnologyEnhancedLearning/Develop/fixes…
ArunimaGeorge May 7, 2024
b4cc202
TD-3736: Performance improvent implemented in Admin UI. Used stored p…
sarathlal-sarangadharan May 9, 2024
a4c92a1
Merge pull request #348 from TechnologyEnhancedLearning/Develop/Featu…
sarathlal-sarangadharan May 10, 2024
007d3aa
TD-3707: fixed question focus issue in assessments
ArunimaGeorge May 10, 2024
272c41b
Merge pull request #351 from TechnologyEnhancedLearning/Develop/fixes…
ArunimaGeorge May 13, 2024
eb64dce
Merge pull request #356 from TechnologyEnhancedLearning/RC
AnjuJose011 May 13, 2024
d375c5e
TD-3308: Keyword field only allows 50 chars which is problematic when…
Swapnamol May 21, 2024
08c3480
TD-3308: Keyword field only allows 50 chars which is problematic when…
Swapnamol May 21, 2024
fe8affb
Revert "TD-3308: Keyword field only allows 50 chars which is problema…
Swapnamol May 21, 2024
4ade7e6
Revert "TD-3308: Keyword field only allows 50 chars which is problema…
Swapnamol May 21, 2024
5b505c5
TD-3308: Keyword field only allows 50 chars which is problematic when…
Swapnamol May 21, 2024
e3c0675
TD-4023: Considering only active users IN Catalogue access request
sarathlal-sarangadharan May 31, 2024
d34a73f
Merge pull request #387 from TechnologyEnhancedLearning/Develop/Fixes…
sarathlal-sarangadharan May 31, 2024
fcf5845
TD-4205: Added user authentication check before recording Article/Ima…
ArunimaGeorge May 31, 2024
aedd97a
TD-4204: Description for html resouce is enabled
sarathlal-sarangadharan Jun 7, 2024
0b66acc
Merge pull request #373 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Jun 11, 2024
b24d347
Merge pull request #419 from TechnologyEnhancedLearning/RC
AnjuJose011 Jun 12, 2024
8e8cbcd
TD-4226 storage update
OluwatobiAwe Jun 16, 2024
66b0601
TD-4054 archive extracted content folders for html and scorm resource.
OluwatobiAwe Jun 17, 2024
ac656aa
Merge pull request #423 from TechnologyEnhancedLearning/Develop/Fixes…
OluwatobiAwe Jun 17, 2024
b97668b
Merge pull request #424 from TechnologyEnhancedLearning/Develop/Fixes…
OluwatobiAwe Jun 18, 2024
0ed131f
Merge pull request #401 from TechnologyEnhancedLearning/Develop/Fixes…
sarathlal-sarangadharan Jun 24, 2024
7725ee0
conflicts resolved
AnjuJose011 Jun 25, 2024
99872a3
changes
AnjuJose011 Jun 25, 2024
998a23b
Merge pull request #435 from TechnologyEnhancedLearning/RCTO-Scorpius
AnjuJose011 Jun 25, 2024
809431f
td-3694
AnjuJose011 Jun 25, 2024
e1ec6ee
TD-4330: Resource links in search results direct to error page
Swapnamol Jul 2, 2024
a92439b
Merge pull request #445 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Jul 2, 2024
4a8372f
Merge pull request #436 from TechnologyEnhancedLearning/Develop/Fixes…
AnjuJose011 Jul 4, 2024
c8ed837
take latest cahnges from RC
AnjuJose011 Jul 5, 2024
d05b131
Merge pull request #454 from TechnologyEnhancedLearning/MergeRc-Scopr…
AnjuJose011 Jul 5, 2024
850669f
Merge pull request #388 from TechnologyEnhancedLearning/Develop/fixes…
ArunimaGeorge Jul 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions AdminUI/LearningHub.Nhs.AdminUI/Configuration/WebSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ public class WebSettings
/// </summary>
public string AzureFileStorageConnectionString { get; set; }

/// <summary>
/// Gets or sets the AzureSourceFileStorageConnectionString.
/// </summary>
public string AzureSourceArchiveStorageConnectionString { get; set; }

/// <summary>
/// Gets or sets the AzurePurgedFileStorageConnectionString.
/// </summary>
public string AzureContentArchiveStorageConnectionString { get; set; }

/// <summary>
/// Gets or sets the azure file storage resource share name.
/// </summary>
Expand Down
14 changes: 14 additions & 0 deletions AdminUI/LearningHub.Nhs.AdminUI/Controllers/ResourceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,27 @@ public class ResourceController : BaseController
/// </summary>
private IResourceService resourceService;

/// <summary>
/// Defines the _fileService.
/// </summary>
private IFileService fileService;

/// <summary>
/// Initializes a new instance of the <see cref="ResourceController"/> class.
/// </summary>
/// <param name="hostingEnvironment">The hostingEnvironment<see cref="IWebHostEnvironment"/>.</param>
/// <param name="config">The config<see cref="IOptions{WebSettings}"/>.</param>
/// <param name="logger">The logger<see cref="ILogger{HomeController}"/>.</param>
/// <param name="resourceService">The resourceService<see cref="IResourceService"/>.</param>
/// <param name="fileService">The fileService<see cref="IResourceService"/>.</param>
/// /// <param name="websettings">The websettings<see cref="IOptions{WebSettings}"/>.</param>
/// <param name="featureManager">The featureManager<see cref="IFeatureManager"/>.</param>
public ResourceController(
IWebHostEnvironment hostingEnvironment,
IOptions<WebSettings> config,
ILogger<HomeController> logger,
IResourceService resourceService,
IFileService fileService,
IOptions<WebSettings> websettings,
IFeatureManager featureManager)
: base(hostingEnvironment)
Expand All @@ -76,6 +83,7 @@ public ResourceController(
this.websettings = websettings;
this.config = config.Value;
this.resourceService = resourceService;
this.fileService = fileService;
this.featureManager = featureManager;
}

Expand Down Expand Up @@ -298,11 +306,17 @@ public async Task<IActionResult> TransferResourceOwnership(int resourceId, strin
[HttpPost]
public async Task<IActionResult> Unpublish(int resourceVersionId, string details)
{
var associatedFile = await this.resourceService.GetResourceVersionExtendedViewModelAsync(resourceVersionId);
var vr = await this.resourceService.UnpublishResourceVersionAsync(resourceVersionId, details);
await this.resourceService.CreateResourceVersionEvent(resourceVersionId, Nhs.Models.Enums.ResourceVersionEventTypeEnum.UnpublishedByAdmin, "Unpublish using Admin UI", 0);

if (vr.IsValid)
{
if (associatedFile.ScormDetails != null || associatedFile.HtmlDetails != null)
{
_ = Task.Run(async () => { await this.fileService.PurgeResourceFile(associatedFile, null); });
}

return this.Json(new
{
success = true,
Expand Down
70 changes: 40 additions & 30 deletions AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IFileService.cs
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
namespace LearningHub.Nhs.AdminUI.Interfaces
{
using System.IO;
using System.Threading.Tasks;
using Azure.Storage.Files.Shares.Models;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Azure.Storage.Files.Shares.Models;
using LearningHub.Nhs.Models.Resource;

/// <summary>
/// Defines the <see cref="IFileService" />.
/// </summary>
public interface IFileService
{
/// <summary>
/// The DeleteChunkDirectory.
/// Defines the <see cref="IFileService" />.
/// </summary>
/// <param name="directoryRef">Directory ref.</param>
/// <param name="chunks">Chunks.</param>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
Task DeleteChunkDirectory(string directoryRef, int chunks);
public interface IFileService
{
/// <summary>
/// The DeleteChunkDirectory.
/// </summary>
/// <param name="directoryRef">Directory ref.</param>
/// <param name="chunks">Chunks.</param>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
Task DeleteChunkDirectory(string directoryRef, int chunks);

/// <summary>
/// The DownloadFileAsync.
/// </summary>
/// <param name="filePath">File path.</param>
/// <param name="fileName">File name.</param>
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
Task<ShareFileDownloadInfo> DownloadFileAsync(string filePath, string fileName);
/// <summary>
/// The DownloadFileAsync.
/// </summary>
/// <param name="filePath">File path.</param>
/// <param name="fileName">File name.</param>
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
Task<ShareFileDownloadInfo> DownloadFileAsync(string filePath, string fileName);

/// <summary>
/// The ProcessFile.
/// </summary>
/// <param name="fileBytes">The fileBytes<see cref="Stream"/>.</param>
/// <param name="fileName">The fileName<see cref="string"/>.</param>
/// <param name="directoryRef">The directoryRef<see cref="string"/>.</param>
/// <param name="originalFileName">The originalFileName<see cref="string"/>.</param>
/// <returns>The <see cref="string"/>.</returns>
Task<string> ProcessFile(Stream fileBytes, string fileName, string directoryRef = "", string originalFileName = null);
}
/// <summary>
/// The ProcessFile.
/// </summary>
/// <param name="fileBytes">The fileBytes<see cref="Stream"/>.</param>
/// <param name="fileName">The fileName<see cref="string"/>.</param>
/// <param name="directoryRef">The directoryRef<see cref="string"/>.</param>
/// <param name="originalFileName">The originalFileName<see cref="string"/>.</param>
/// <returns>The <see cref="string"/>.</returns>
Task<string> ProcessFile(Stream fileBytes, string fileName, string directoryRef = "", string originalFileName = null);

/// <summary>
/// The PurgeResourceFile.
/// </summary>
/// <param name="vm">The vm.<see cref="ResourceVersionExtendedViewModel"/>.</param>
/// <param name="filePaths">.</param>
/// <returns>The <see cref="Task"/>.</returns>
Task PurgeResourceFile(ResourceVersionExtendedViewModel vm = null, List<string> filePaths = null);
}
}
Loading