Skip to content

Commit 66c20bd

Browse files
authored
Merge pull request #2729 from TechnologyEnhancedLearning/Develop/Fixes/TD-4134-Issueadding'DigitalLearningSolutions-Pagenolongeravailable'texttothe'Goback'linkson'Givepagefeedback'screens
Develop/fixes/td 4134 issue adding digital learning solutions page no longer available text to the 'go back 'links on give page feedback screens
2 parents 4bd33c4 + f828fce commit 66c20bd

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

DigitalLearningSolutions.Web/Controllers/UserFeedbackController.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ public IActionResult Index(string sourceUrl, string sourcePageTitle)
5252
TaskRating = null,
5353
};
5454

55+
if(sourcePageTitle == "Digital Learning Solutions - Page no longer available")
56+
{
57+
var url = ContentUrlHelper.ReplaceUrlSegment(sourceUrl);
58+
_userFeedbackViewModel.SourceUrl = url;
59+
_userFeedbackViewModel.SourcePageTitle = "Welcome";
60+
}
61+
5562
if (_userFeedbackViewModel.UserId == null || _userFeedbackViewModel.UserId == 0)
5663
{
5764
return GuestFeedbackStart(_userFeedbackViewModel);

DigitalLearningSolutions.Web/Helpers/ContentUrlHelper.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,17 @@ public static string GetContentPath(IConfiguration config, string videoPath)
2222

2323
public static string? GetNullableContentPath(IConfiguration config, string? videoPath) =>
2424
videoPath != null ? GetContentPath(config, videoPath) : null;
25+
26+
public static string ReplaceUrlSegment(string sourceUrl)
27+
{
28+
string errorSegment = "LearningSolutions/StatusCode/410";
29+
string welcomeSegment = "Home/Welcome";
30+
31+
if (sourceUrl.Contains(errorSegment))
32+
{
33+
return sourceUrl.Replace(errorSegment, welcomeSegment);
34+
}
35+
return sourceUrl;
36+
}
2537
}
2638
}

0 commit comments

Comments
 (0)