Skip to content

Commit 3ea181e

Browse files
authored
Merge pull request #3334 from TechnologyEnhancedLearning/Develop/Features/TD-5859-URLFlagOverride
TD-5859 url flag override persist to dashboard page and handle
2 parents 9929793 + c5cd891 commit 3ea181e

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

DigitalLearningSolutions.Web/Controllers/TrackingSystem/Centre/SelfAssessmentReports/SelfAssessmentReportsController.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,22 @@ public IActionResult DownloadSelfAssessmentReport(int selfAssessmentId)
9393
}
9494
[HttpGet]
9595
[Route("TableauCompetencyDashboard")]
96-
public IActionResult TableauCompetencyDashboard()
96+
public async Task<IActionResult> TableauCompetencyDashboardAsync()
9797
{
9898
var userEmail = User.GetUserPrimaryEmail();
9999
var adminId = User.GetAdminId();
100100
var jwt = tableauConnectionHelper.GetTableauJwt();
101+
var tableauFlag = await featureManager.IsEnabledAsync(FeatureFlags.TableauSelfAssessmentDashboards);
102+
var tableauQueryOverride = string.Equals(Request.Query["tableaulink"], "true", StringComparison.OrdinalIgnoreCase);
103+
var showTableauLink = tableauFlag || tableauQueryOverride;
101104
ViewBag.Email = userEmail;
102105
ViewBag.AdminId = adminId;
103106
ViewBag.SiteName = tableauSiteName;
104107
ViewBag.TableauServerUrl = tableauUrl;
105108
ViewBag.WorkbookName = workbookName;
106109
ViewBag.ViewName = viewName;
107110
ViewBag.JwtToken = jwt;
108-
111+
ViewBag.ShowTableauLink = showTableauLink;
109112
return View();
110113
}
111114
}

DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/SelfAssessmentReports/Index.cshtml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
@model SelfAssessmentReportsViewModel
55
@{
66
ViewData["Title"] = "Self assessment reports";
7+
var routeData = new Dictionary<string, string>();
8+
9+
if (string.Equals(Context.Request.Query["tableaulink"], "true", StringComparison.OrdinalIgnoreCase))
10+
{
11+
routeData["tableaulink"] = "true";
12+
}
713
}
814
<div class="nhsuk-grid-row">
915
<div class="nhsuk-grid-column-one-quarter">
@@ -21,7 +27,8 @@
2127
</h1>
2228
@if (Model.ShowTableauLink && Model.SelfAssessmentSelects.Any())
2329
{
24-
<vc:action-link asp-controller="SelfAssessmentReports" asp-action="TableauCompetencyDashboard" asp-all-route-data="@new Dictionary<string, string>();" link-text="View Tableau supervised self assessments dashboard" />
30+
<vc:action-link asp-controller="SelfAssessmentReports"
31+
asp-all-route-data="routeData" asp-action="TableauCompetencyDashboard" link-text="View Tableau supervised self assessments dashboard" />
2532
}
2633
<h2>Excel learner activity reports</h2>
2734
<p class="nhsuk-lede-text">Download Excel competency self assessments activity reports for your centre.</p>

DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/SelfAssessmentReports/TableauCompetencyDashboard.cshtml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
</div>
2121
<h1>@ViewData["Title"]</h1>
2222
<vc:inset-text css-class="" text="Use the full screen button below the Tableau dashboard (next to 'Share') for the best experience." />
23-
<feature name="@(FeatureFlags.TableauSelfAssessmentDashboards)">
23+
@if (ViewBag.ShowTableauLink)
24+
{
2425
<tableau-viz id='tableau-viz'
2526
src='@srcUrl' token='@jwtToken' toolbar='bottom'>
2627
If the dashboard doesn't appear after a few seconds, <a href="#">reload the page</a>
@@ -32,8 +33,10 @@
3233
<script type="module" src="@tableauServerUrl/javascripts/api/tableau.embedding.3.latest.min.js"></script>
3334
<script src="@Url.Content("~/js/trackingSystem/tableaureports.js")" asp-append-version="true"></script>
3435
}
35-
</feature>
36-
<feature name="@(FeatureFlags.TableauSelfAssessmentDashboards)" negate="true">
36+
}
37+
else
38+
{
3739
<h2>Oops! We are still working on this area of the site</h2>
3840
<p class="nhsuk-lede-text">This feature is under development and should be available soon.</p>
39-
</feature>
41+
}
42+

0 commit comments

Comments
 (0)