Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,22 @@ public IActionResult DownloadSelfAssessmentReport(int selfAssessmentId)
}
[HttpGet]
[Route("TableauCompetencyDashboard")]
public IActionResult TableauCompetencyDashboard()
public async Task<IActionResult> TableauCompetencyDashboardAsync()
{
var userEmail = User.GetUserPrimaryEmail();
var adminId = User.GetAdminId();
var jwt = tableauConnectionHelper.GetTableauJwt();
var tableauFlag = await featureManager.IsEnabledAsync(FeatureFlags.TableauSelfAssessmentDashboards);
var tableauQueryOverride = string.Equals(Request.Query["tableaulink"], "true", StringComparison.OrdinalIgnoreCase);
var showTableauLink = tableauFlag || tableauQueryOverride;
ViewBag.Email = userEmail;
ViewBag.AdminId = adminId;
ViewBag.SiteName = tableauSiteName;
ViewBag.TableauServerUrl = tableauUrl;
ViewBag.WorkbookName = workbookName;
ViewBag.ViewName = viewName;
ViewBag.JwtToken = jwt;

ViewBag.ShowTableauLink = showTableauLink;
return View();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
@model SelfAssessmentReportsViewModel
@{
ViewData["Title"] = "Self assessment reports";
var routeData = new Dictionary<string, string>();

if (string.Equals(Context.Request.Query["tableaulink"], "true", StringComparison.OrdinalIgnoreCase))
{
routeData["tableaulink"] = "true";
}
}
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-one-quarter">
Expand All @@ -21,7 +27,8 @@
</h1>
@if (Model.ShowTableauLink && Model.SelfAssessmentSelects.Any())
{
<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" />
<vc:action-link asp-controller="SelfAssessmentReports"
asp-all-route-data="routeData" asp-action="TableauCompetencyDashboard" link-text="View Tableau supervised self assessments dashboard" />
}
<h2>Excel learner activity reports</h2>
<p class="nhsuk-lede-text">Download Excel competency self assessments activity reports for your centre.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
</div>
<h1>@ViewData["Title"]</h1>
<vc:inset-text css-class="" text="Use the full screen button below the Tableau dashboard (next to 'Share') for the best experience." />
<feature name="@(FeatureFlags.TableauSelfAssessmentDashboards)">
@if (ViewBag.ShowTableauLink)
{
<tableau-viz id='tableau-viz'
src='@srcUrl' token='@jwtToken' toolbar='bottom'>
If the dashboard doesn't appear after a few seconds, <a href="#">reload the page</a>
Expand All @@ -32,8 +33,10 @@
<script type="module" src="@tableauServerUrl/javascripts/api/tableau.embedding.3.latest.min.js"></script>
<script src="@Url.Content("~/js/trackingSystem/tableaureports.js")" asp-append-version="true"></script>
}
</feature>
<feature name="@(FeatureFlags.TableauSelfAssessmentDashboards)" negate="true">
}
else
{
<h2>Oops! We are still working on this area of the site</h2>
<p class="nhsuk-lede-text">This feature is under development and should be available soon.</p>
</feature>
}

Loading