Skip to content

Commit 6354cf1

Browse files
authored
Merge pull request #2094 from TechnologyEnhancedLearning/Develop/Fixes/TD-1766-RemovedHyphenFromAllClasses
TD-1766 Added the condition to check the customisation name everywhere in the application
2 parents b221a31 + 36b9c2d commit 6354cf1

17 files changed

+24
-17
lines changed

DigitalLearningSolutions.Data/Models/CourseCompletion/CourseCompletion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int sectionCount
3838
)
3939
{
4040
Id = id;
41-
CourseTitle = $"{applicationName} - {customisationName}";
41+
CourseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
4242
Completed = completed;
4343
Evaluated = evaluated;
4444
MaxPostLearningAssessmentAttempts = maxPostLearningAssessmentAttempts;

DigitalLearningSolutions.Data/Models/CourseContent/CourseContent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ bool passwordSubmitted
4444
)
4545
{
4646
Id = id;
47-
Title = $"{applicationName} - {customisationName}";
47+
Title = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
4848
Description = applicationInfo;
4949
AverageDuration = averageDuration;
5050
CentreName = centreName;

DigitalLearningSolutions.Data/Models/DiagnosticAssessment/DiagnosticAssessment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public DiagnosticAssessment(
5555
bool passwordSubmitted
5656
)
5757
{
58-
CourseTitle = $"{applicationName} - {customisationName}";
58+
CourseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
5959
CourseDescription = applicationInfo;
6060
SectionName = sectionName;
6161
DiagnosticAttempts = diagAttempts;

DigitalLearningSolutions.Data/Models/DiagnosticAssessment/DiagnosticContent.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace DigitalLearningSolutions.Data.Models.DiagnosticAssessment
22
{
3+
using System;
34
using System.Collections.Generic;
45

56
public class DiagnosticContent
@@ -22,7 +23,7 @@ public DiagnosticContent(
2223
int currentVersion
2324
)
2425
{
25-
CourseTitle = $"{applicationName} - {customisationName}";
26+
CourseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
2627
SectionName = sectionName;
2728
DiagnosticAssessmentPath = diagAssessPath;
2829
CanSelectTutorials = diagObjSelect;

DigitalLearningSolutions.Data/Models/PostLearningAssessment/PostLearningAssessment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public PostLearningAssessment(
4747
bool passwordSubmitted
4848
)
4949
{
50-
CourseTitle = $"{applicationName} - {customisationName}";
50+
CourseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
5151
CourseDescription = applicationInfo;
5252
SectionName = sectionName;
5353
PostLearningScore = bestScore;

DigitalLearningSolutions.Data/Models/PostLearningAssessment/PostLearningContent.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace DigitalLearningSolutions.Data.Models.PostLearningAssessment
22
{
3+
using System;
34
using System.Collections.Generic;
45

56
public class PostLearningContent
@@ -20,7 +21,7 @@ public PostLearningContent(
2021
int currentVersion
2122
)
2223
{
23-
CourseTitle = $"{applicationName} - {customisationName}";
24+
CourseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
2425
SectionName = sectionName;
2526
PostLearningAssessmentPath = plAssessPath;
2627
PassThreshold = plaPassThreshold;

DigitalLearningSolutions.Data/Models/TutorialContent/TutorialVideo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
namespace DigitalLearningSolutions.Data.Models.TutorialContent
22
{
33
using DigitalLearningSolutions.Data.Exceptions;
4+
using System;
45

56
public class TutorialVideo
67
{
@@ -19,7 +20,7 @@ public TutorialVideo(
1920
{
2021
TutorialName = tutorialName;
2122
SectionName = sectionName;
22-
CourseTitle = $"{applicationName} - {customisationName}";
23+
CourseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
2324

2425
VideoPath = videoPath ?? throw new VideoNotFoundException();
2526
}

DigitalLearningSolutions.Web.Tests/ViewModels/LearningMenu/ContentViewerViewModelTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using FluentAssertions;
77
using Microsoft.Extensions.Configuration;
88
using NUnit.Framework;
9+
using System;
910

1011
public class ContentViewerViewModelTests
1112
{
@@ -213,7 +214,7 @@ public void Content_viewer_should_have_courseTitle()
213214
);
214215

215216
// Then
216-
var courseTitle = $"{applicationName} - {customisationName}";
217+
var courseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
217218
contentViewerViewModel.CourseTitle.Should().BeEquivalentTo(courseTitle);
218219
}
219220

DigitalLearningSolutions.Web.Tests/ViewModels/LearningMenu/CourseCompletionViewModelTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void CourseCompletion_should_have_courseTitle()
5151
var courseCompletionViewModel = new CourseCompletionViewModel(config, expectedCourseCompletion, ProgressId);
5252

5353
// Then
54-
var courseTitle = $"{applicationName} - {customisationName}";
54+
var courseTitle = !String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName;
5555
courseCompletionViewModel.CourseTitle.Should().BeEquivalentTo(courseTitle);
5656
}
5757

DigitalLearningSolutions.Web.Tests/ViewModels/LearningMenu/DiagnosticAssessmentViewModelTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void Diagnostic_assessment_should_have_title()
2929
new DiagnosticAssessmentViewModel(diagnosticAssessment, CustomisationId, SectionId);
3030

3131
// Then
32-
diagnosticAssessmentViewModel.CourseTitle.Should().Be($"{applicationName} - {customisationName}");
32+
diagnosticAssessmentViewModel.CourseTitle.Should().Be(!String.IsNullOrEmpty(customisationName) ? $"{applicationName} - {customisationName}" : applicationName);
3333
}
3434

3535
[Test]

0 commit comments

Comments
 (0)