Skip to content

Commit f828fce

Browse files
TD-4134 Issue adding 'Digital Learning Solutions-Page no longer available' text to the 'Go back' links on 'Give page feedback' screens
1 parent 698ac7b commit f828fce

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)