Skip to content

Commit

Permalink
Merge pull request #5478 from dfe-analytical-services/dev
Browse files Browse the repository at this point in the history
Merge Dev into Master
  • Loading branch information
N-moh authored Dec 19, 2024
2 parents 645ca95 + f467ba9 commit df9513a
Show file tree
Hide file tree
Showing 70 changed files with 3,436 additions and 2,129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ public async Task ValidateBulkDataArchiveFiles_IndexFileMissing_ReturnsValidatio
.AssertBadRequestWithValidationErrors([
new ErrorViewModel
{
Code = ValidationMessages.BulkDataZipMustContainDatasetNamesCsv.Code,
Message = ValidationMessages.BulkDataZipMustContainDatasetNamesCsv.Message,
Code = ValidationMessages.BulkDataZipMustContainDataSetNamesCsv.Code,
Message = ValidationMessages.BulkDataZipMustContainDataSetNamesCsv.Message,
}
]);
}
Expand Down Expand Up @@ -267,8 +267,8 @@ public async Task ValidateBulkDataArchiveFiles_IndexFileHasIncorrectHeaders_Retu
.AssertBadRequestWithValidationErrors([
new ErrorViewModel
{
Code = ValidationMessages.DatasetNamesCsvIncorrectHeaders.Code,
Message = ValidationMessages.DatasetNamesCsvIncorrectHeaders.Message,
Code = ValidationMessages.DataSetNamesCsvIncorrectHeaders.Code,
Message = ValidationMessages.DataSetNamesCsvIncorrectHeaders.Message,
},
]);
}
Expand Down Expand Up @@ -319,7 +319,7 @@ public async Task ValidateBulkDataArchiveFiles_DuplicateDataSetTitlesAndFileName
.AssertLeft()
.AssertBadRequestWithValidationErrors([
ValidationMessages.GenerateErrorDataSetTitleShouldBeUnique("Duplicate title"),
ValidationMessages.GenerateErrorDatasetNamesCsvFilenamesShouldBeUnique("one"),
ValidationMessages.GenerateErrorDataSetNamesCsvFilenamesShouldBeUnique("one"),
]);
}
}
Expand All @@ -342,7 +342,7 @@ public async Task ValidateBulkDataArchiveFiles_Fail_DataSetNamesCsvFilesnamesSho
result
.AssertLeft()
.AssertBadRequestWithValidationErrors([
ValidationMessages.GenerateErrorDatasetNamesCsvFilenamesShouldNotEndDotCsv("one.csv")
ValidationMessages.GenerateErrorDataSetNamesCsvFilenamesShouldNotEndDotCsv("one.csv")
]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,9 @@ public async Task UpdateApprovalStatus_ApprovingUsingImmediateStrategy()

redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

await using (var context = InMemoryApplicationDbContext(contentDbContextId))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3600,9 +3600,9 @@ public async Task PublicationTitleOrSlugChanged()
var redirectsCacheService = new Mock<IRedirectsCacheService>(MockBehavior.Strict);
redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var service = SetupMethodologyService(contentDbContext,
redirectsCacheService: redirectsCacheService.Object);
Expand Down Expand Up @@ -3662,9 +3662,9 @@ public async Task PublicationTitleOrSlugChanged_NoMethodologyRedirectAsMethodolo
var redirectsCacheService = new Mock<IRedirectsCacheService>(MockBehavior.Strict);
redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var service = SetupMethodologyService(contentDbContext,
redirectsCacheService: redirectsCacheService.Object);
Expand Down Expand Up @@ -3745,9 +3745,9 @@ await contentDbContext.PublicationMethodologies.AddRangeAsync(
var redirectsCacheService = new Mock<IRedirectsCacheService>(MockBehavior.Strict);
redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var service = SetupMethodologyService(contentDbContext,
redirectsCacheService: redirectsCacheService.Object);
Expand Down Expand Up @@ -3847,9 +3847,9 @@ public async Task PublicationTitleOrSlugChanged_MethodologySlugIsAlternativeSlug
var redirectsCacheService = new Mock<IRedirectsCacheService>(MockBehavior.Strict);
redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var service = SetupMethodologyService(contentDbContext,
redirectsCacheService: redirectsCacheService.Object);
Expand Down Expand Up @@ -3917,9 +3917,9 @@ public async Task PublicationTitleOrSlugChanged_MethodologyIsLive()
var redirectsCacheService = new Mock<IRedirectsCacheService>(MockBehavior.Strict);
redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var service = SetupMethodologyService(contentDbContext,
redirectsCacheService: redirectsCacheService.Object);
Expand Down Expand Up @@ -4004,9 +4004,9 @@ public async Task
var redirectsCacheService = new Mock<IRedirectsCacheService>(MockBehavior.Strict);
redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var service = SetupMethodologyService(contentDbContext,
redirectsCacheService: redirectsCacheService.Object);
Expand Down Expand Up @@ -4110,9 +4110,9 @@ public async Task
var redirectsCacheService = new Mock<IRedirectsCacheService>(MockBehavior.Strict);
redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var service = SetupMethodologyService(contentDbContext,
redirectsCacheService: redirectsCacheService.Object);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1127,9 +1127,9 @@ public async Task UpdatePublication_AlreadyPublished()

redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var publicationService = BuildPublicationService(context,
methodologyService: methodologyService.Object,
Expand Down Expand Up @@ -1272,9 +1272,9 @@ public async Task UpdatePublication_TitleChangesPublicationAndMethodologySlug()

redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var publicationService = BuildPublicationService(context,
methodologyService: methodologyService.Object,
Expand Down Expand Up @@ -1579,9 +1579,9 @@ public async Task UpdatePublication_CreateRedirectIfLiveSlugChanged()
var redirectsCacheService = new Mock<IRedirectsCacheService>(Strict);
redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var publicationService = BuildPublicationService(context,
methodologyService: methodologyService.Object,
Expand Down Expand Up @@ -1678,9 +1678,9 @@ public async Task UpdatePublication_ChangeBackToPreviousLiveSlug()
var redirectsCacheService = new Mock<IRedirectsCacheService>(Strict);
redirectsCacheService.Setup(mock => mock.UpdateRedirects())
.ReturnsAsync(new RedirectsViewModel(
Publications: [],
Methodologies: [],
Releases: []));
PublicationRedirects: [],
MethodologyRedirects: [],
ReleaseRedirectsByPublicationSlug: []));

var publicationService = BuildPublicationService(context,
methodologyService: methodologyService.Object,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ public async Task<ActionResult<List<DataFileInfo>>> ReorderDataFiles(Guid releas
[RequestFormLimits(ValueLengthLimit = int.MaxValue, MultipartBodyLengthLimit = int.MaxValue)]
public async Task<ActionResult<DataFileInfo>> UploadDataSet(Guid releaseVersionId,
[FromQuery(Name = "replacingFileId")] Guid? replacingFileId,
[FromQuery(Name = "title")] string title,
[FromQuery(Name = "title")]
[MaxLength(120)]
string title,
IFormFile file,
IFormFile metaFile)
{
Expand All @@ -125,7 +127,9 @@ public async Task<ActionResult<DataFileInfo>> UploadDataSet(Guid releaseVersionI
[RequestFormLimits(ValueLengthLimit = int.MaxValue, MultipartBodyLengthLimit = int.MaxValue)]
public async Task<ActionResult<DataFileInfo>> UploadDataSetAsZip(Guid releaseVersionId,
[FromQuery(Name = "replacingFileId")] Guid? replacingFileId,
[FromQuery(Name = "title")] string title,
[FromQuery(Name = "title")]
[MaxLength(120)]
string title,
IFormFile zipFile)
{
return await _releaseDataFileService
Expand Down
Loading

0 comments on commit df9513a

Please sign in to comment.