+
+
@@ -80,7 +83,8 @@
localAudioDetail: { resourceVersionId: 0 } as AudioResourceModel,
additionalInformation: '' as string,
uploadingFile: null as File,
- uploadingTranscriptFile: null as File
+ uploadingTranscriptFile: null as File,
+ contributeResourceAVFlag: true
};
},
computed: {
@@ -95,10 +99,14 @@
},
fileUpdated(): ResourceFileModel {
return this.$store.state.fileUpdated;
+ },
+ audioVideoUnavailableView(): string {
+ return this.$store.state.getAVUnavailableView;
}
},
created() {
this.setInitialValues();
+ this.getContributeResAVResourceFlag();
EventBus.$on('deleteFile', (fileTypeToBeDeleted: number) => {
this.processDeleteFile(fileTypeToBeDeleted);
});
@@ -112,6 +120,11 @@
changeFile() {
this.$emit('filechanged');
},
+ getContributeResAVResourceFlag() {
+ resourceData.getContributeAVResourceFlag().then(response => {
+ this.contributeResourceAVFlag = response;
+ });
+ },
changeTranscriptFile() {
$('#transcriptFileUpload').val(null);
$('#transcriptFileUpload').click();
diff --git a/LearningHub.Nhs.WebUI/Services/FileService.cs b/LearningHub.Nhs.WebUI/Services/FileService.cs
index 1aa8078e8..0e6fce092 100644
--- a/LearningHub.Nhs.WebUI/Services/FileService.cs
+++ b/LearningHub.Nhs.WebUI/Services/FileService.cs
@@ -7,11 +7,9 @@
using System.Threading.Tasks;
using Azure.Storage.Files.Shares;
using Azure.Storage.Files.Shares.Models;
- using LearningHub.Nhs.Models.Enums;
using LearningHub.Nhs.Models.Resource;
using LearningHub.Nhs.WebUI.Configuration;
using LearningHub.Nhs.WebUI.Interfaces;
- using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.Options;
@@ -23,6 +21,7 @@ public class FileService : IFileService
private readonly Settings settings;
private ShareClient shareClient;
private ShareClient archiveShareClient;
+ private ShareClient contentArchiveShareClient;
///
/// Initializes a new instance of the class.
@@ -59,21 +58,21 @@ private ShareClient OutputArchiveShareClient
{
get
{
- if (this.archiveShareClient == null)
+ if (this.contentArchiveShareClient == null)
{
var options = new ShareClientOptions();
options.Retry.MaxRetries = 3;
options.Retry.Delay = TimeSpan.FromSeconds(10);
- this.archiveShareClient = new ShareClient(this.settings.AzureContentArchiveStorageConnectionString, this.settings.AzureFileStorageResourceShareName, options);
+ this.contentArchiveShareClient = new ShareClient(this.settings.AzureContentArchiveStorageConnectionString, this.settings.AzureFileStorageResourceShareName, options);
- if (!this.archiveShareClient.Exists())
+ if (!this.contentArchiveShareClient.Exists())
{
throw new Exception($"Unable to access azure content archive file storage resource {this.settings.AzureFileStorageResourceShareName}");
}
}
- return this.archiveShareClient;
+ return this.contentArchiveShareClient;
}
}
@@ -89,7 +88,7 @@ private ShareClient InputArchiveShareClient
this.archiveShareClient = new ShareClient(this.settings.AzureSourceArchiveStorageConnectionString, this.settings.AzureFileStorageResourceShareName, options);
- if (!this.shareClient.Exists())
+ if (!this.archiveShareClient.Exists())
{
throw new Exception($"Unable to access azure file storage resource {this.settings.AzureFileStorageResourceShareName}");
}
@@ -130,6 +129,7 @@ public async Task DeleteChunkDirectory(string directoryRef, int chunks)
public async Task DownloadFileAsync(string filePath, string fileName)
{
var directory = this.ShareClient.GetDirectoryClient(filePath);
+ var sourceDirectory = this.InputArchiveShareClient.GetDirectoryClient(filePath);
if (await directory.ExistsAsync())
{
@@ -140,6 +140,15 @@ public async Task DownloadFileAsync(string filePath, stri
return await file.DownloadAsync();
}
}
+ else if (await sourceDirectory.ExistsAsync())
+ {
+ var file = sourceDirectory.GetFileClient(fileName);
+
+ if (await file.ExistsAsync())
+ {
+ return await file.DownloadAsync();
+ }
+ }
return null;
}
@@ -221,50 +230,10 @@ public async Task PurgeResourceFile(ResourceVersionExtendedViewModel vm = null,
{
allContentPath.Add(vm.ScormDetails.ContentFilePath);
}
- else if (vm.GenericFileDetails != null && !string.IsNullOrWhiteSpace(vm.GenericFileDetails.File.FilePath))
- {
- allFilePath.Add(vm.GenericFileDetails.File.FilePath);
- }
else if (vm.HtmlDetails != null && !string.IsNullOrWhiteSpace(vm.HtmlDetails.ContentFilePath))
{
allContentPath.Add(vm.HtmlDetails.ContentFilePath);
}
- else if (vm.ImageDetails != null && !string.IsNullOrWhiteSpace(vm.ImageDetails.File?.FilePath))
- {
- allFilePath.Add(vm.ImageDetails.File?.FilePath);
- }
- else if (vm.ArticleDetails != null)
- {
- var files = vm.ArticleDetails.Files.ToList();
- if (files.Any())
- {
- foreach (var file in files)
- {
- allFilePath.Add(file.FilePath);
- }
- }
- }
- else if (vm.CaseDetails != null)
- {
- var blockCollection = vm.CaseDetails.BlockCollection;
- foreach (var entry in blockCollection.Blocks)
- {
- if (entry.ImageCarouselBlock != null)
- {
- foreach (var item in entry.ImageCarouselBlock?.ImageBlockCollection?.Blocks)
- {
- allFilePath.Add(item?.MediaBlock?.Image?.File.FilePath);
- }
- }
- else if (entry.WholeSlideImageBlock != null)
- {
- foreach (var item in entry.WholeSlideImageBlock.WholeSlideImageBlockItems)
- {
- allFilePath.Add(item?.WholeSlideImage?.File.FilePath);
- }
- }
- }
- }
// audio and video to be added
await this.MoveInPutDirectoryToArchive(allFilePath);
@@ -388,6 +357,7 @@ private async Task DeleteSubdirectory(string pathDirectory)
{
var sourceFileClient = sourceDirectory.GetFileClient(fileDirectory.Name);
await this.DeleteSubdirectory(sourceFileClient.Path);
+ await sourceFileClient.DeleteIfExistsAsync();
}
else
{
@@ -405,6 +375,20 @@ private async Task MoveInPutDirectoryToArchive(List allDirectoryRef)
{
var directory = this.ShareClient.GetDirectoryClient(directoryRef);
var archiveDirectory = this.InputArchiveShareClient.GetDirectoryClient(directoryRef);
+ if (!directory.Exists())
+ {
+ continue;
+ }
+
+ if (directory.Exists())
+ {
+ var inputCheck = directory.GetFilesAndDirectories();
+ if (inputCheck.Count() > 1)
+ {
+ await this.MoveOutPutDirectoryToArchive(new List { directoryRef });
+ continue;
+ }
+ }
await foreach (var fileItem in directory.GetFilesAndDirectoriesAsync())
{
diff --git a/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/bookmark.scss b/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/bookmark.scss
index bc8bac3c9..6378eae15 100644
--- a/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/bookmark.scss
+++ b/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/bookmark.scss
@@ -29,7 +29,7 @@ a.cancel-link:visited {
}
}
-.folder-title {
+div.folder-title {
font-weight: bold;
}
diff --git a/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/catalogue.scss b/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/catalogue.scss
index 4aba85b35..22ffd1a18 100644
--- a/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/catalogue.scss
+++ b/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/catalogue.scss
@@ -29,6 +29,13 @@ textarea {
}
}
+@media(min-width: 40.0625em) {
+ .folder-title {
+ font-size: 24px;
+ font-size: 1.5rem;
+ }
+}
+
.folder-title_empty {
display: flex;
@@ -91,9 +98,13 @@ textarea {
padding: 20px 0 32px 0;
border-bottom: 1px solid $nhsuk-grey-light;
- p, h3 {
+ p, h2, h3 {
margin: 0;
}
+
+ h2.nhsuk-u-reading-width {
+ font-size: x-large;
+ }
}
.personal-details-table {
diff --git a/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/search.scss b/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/search.scss
index 9e800942d..c43713aaa 100644
--- a/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/search.scss
+++ b/LearningHub.Nhs.WebUI/Styles/nhsuk/pages/search.scss
@@ -156,6 +156,10 @@
.search-filter-items {
border-top: 1px $nhsuk-grey-light solid;
background-color: $nhsuk-grey-white;
+
+ h2 {
+ font-size: larger;
+ }
}
}
diff --git a/LearningHub.Nhs.WebUI/Views/Catalogue/Catalogues.cshtml b/LearningHub.Nhs.WebUI/Views/Catalogue/Catalogues.cshtml
index d184442fb..6eda29434 100644
--- a/LearningHub.Nhs.WebUI/Views/Catalogue/Catalogues.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Catalogue/Catalogues.cshtml
@@ -76,7 +76,7 @@
}