Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding feature flag to allow fts redirect links display #1147

Merged
merged 2 commits into from
Jan 16, 2025
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
1 change: 1 addition & 0 deletions Frontend/CO.CDP.OrganisationApp/Constants/FeatureFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ public static class FeatureFlags
{
public const string Consortium = "Consortium";
public const string AllowDynamicFtsOrigins = "AllowDynamicFtsOrigins";
public const string AllowFtsRedirectLinks = "AllowFtsRedirectLinks";
}
66 changes: 43 additions & 23 deletions Frontend/CO.CDP.OrganisationApp/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
@using CO.CDP.OrganisationApp.Constants
@using Microsoft.AspNetCore.Mvc.Localization
@using CO.CDP.Localization
@using Microsoft.FeatureManagement
@addTagHelper *, Microsoft.FeatureManagement.AspNetCore

@inject Microsoft.Extensions.Configuration.IConfiguration config
@inject IUserInfoService userInfoService
@inject ICookiePreferencesService cookiePreferencesService;
@inject IHtmlLocalizer<StaticTextResource> Localizer
@inject IFtsUrlService FtsUrlService
@inject IFeatureManager featureManager;

<!DOCTYPE html>
<html lang="@System.Globalization.CultureInfo.CurrentUICulture.Name" class="govuk-template">
Expand Down Expand Up @@ -81,9 +84,18 @@
<partial name="Shared/_LanguageSwitcher" />
</div>
<div class="app-header-layout__column">
<a href="@homeLink" class="govuk-header__link govuk-header__service-name">
@StaticTextResource.Header_ServiceName
</a>
@if (await featureManager.IsEnabledAsync(FeatureFlags.AllowFtsRedirectLinks))
{
<a href="@homeLink" class="govuk-header__link govuk-header__service-name">
@StaticTextResource.Header_ServiceName
</a>
}
else
{
<span class="govuk-header__service-name">
@StaticTextResource.Header_ServiceName
</span>
}
<nav aria-label="@StaticTextResource.Header_Menu" class="govuk-header__navigation">
<button type="button" class="govuk-header__menu-button govuk-js-header-toggle" aria-controls="navigation" hidden>
@StaticTextResource.Header_Menu
Expand All @@ -95,17 +107,19 @@
{
if (organisationId != null)
{
<!--<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="@FtsUrlService.BuildUrl("/login", organisationId, "/Search/Results")">
@StaticTextResource.Header_Search
</a>
</li>-->

<!--<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="@FtsUrlService.BuildUrl("/login", organisationId, "/dashboard")">
@StaticTextResource.Header_MyNotices
</a>
</li>-->
<feature name="@FeatureFlags.AllowFtsRedirectLinks">
<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="@FtsUrlService.BuildUrl("/login", organisationId, "/Search/Results")">
@StaticTextResource.Header_Search
</a>
</li>

<li class="govuk-header__navigation-item">
<a class="govuk-header__link" href="@FtsUrlService.BuildUrl("/login", organisationId, "/dashboard")">
@StaticTextResource.Header_MyNotices
</a>
</li>
</feature>
}

<li class="govuk-header__navigation-item">
Expand Down Expand Up @@ -180,21 +194,27 @@
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" target="_blank" href="/contact-us" )">@StaticTextResource.Footer_ContactUs</a>
</li>
<!--<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="@FtsUrlService.BuildUrl("/login", organisationId, "/Home/AccessibilityStatement")">@StaticTextResource.Footer_AccessibilityStatement</a>
</li>-->
<!--<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="@FtsUrlService.BuildUrl("/login", organisationId, "/Home/TermsAndConditions")">@StaticTextResource.Footer_TermsAndConditions</a>
</li>-->

<feature name="@FeatureFlags.AllowFtsRedirectLinks">
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="@FtsUrlService.BuildUrl("/login", organisationId, "/Home/AccessibilityStatement")">@StaticTextResource.Footer_AccessibilityStatement</a>
</li>
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="@FtsUrlService.BuildUrl("/login", organisationId, "/Home/TermsAndConditions")">@StaticTextResource.Footer_TermsAndConditions</a>
</li>
</feature>
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="https://www.gov.uk/government/publications/crown-commercial-service-privacy-notice/crown-commercial-service-privacy-notice">@StaticTextResource.Footer_PrivacyNotice</a>
</li>
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="/cookies">@StaticTextResource.Footer_Cookies</a>
</li>
<!--<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="@FtsUrlService.BuildUrl("/login", organisationId, "/Developer/Documentation")">@StaticTextResource.Footer_DataAndAPI</a>
</li>-->

<feature name="@FeatureFlags.AllowFtsRedirectLinks">
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="@FtsUrlService.BuildUrl("/login", organisationId, "/Developer/Documentation")">@StaticTextResource.Footer_DataAndAPI</a>
</li>
</feature>
</ul>
<svg aria-hidden="true"
focusable="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"Enabled": false,
"Path": ""
},
"AllowDynamicFtsOrigins": true
"AllowDynamicFtsOrigins": true,
"AllowFtsRedirectLinks": true
},
"FtsServiceAllowedOrigins": "https://www-integration.find-tender.service.gov.uk,https://www-tpp-preview.find-tender.service.gov.uk,https://www-tpp.find-tender.service.gov.uk,https://www-preview.find-tender.service.gov.uk,https://test-findtender.nqc.com,https://truk-alpha.nqc.com,https://truk-performance.nqc.com,https://truk-prod.nqc.com,https://nadeemshafi2.nqc.com,https://wallsm.nqc.com,https://humaarif.nqc.com,https://andrewtaberner.nqc.com,https://kaylemwood.nqc.com,https://davidchiu.nqc.com,https://anudeepjami.nqc.com,https://akmalnazir.nqc.com,https://martamajewska.nqc.com,https://kaichan2.nqc.com,https://stanvolcere.nqc.com"
}
3 changes: 2 additions & 1 deletion Frontend/CO.CDP.OrganisationApp/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"SharedSessions": false,
"Consortium": false,
"ContentSecurityPolicy": true,
"AllowDynamicFtsOrigins": false
"AllowDynamicFtsOrigins": false,
"AllowFtsRedirectLinks": false
},
"CompaniesHouse": {
"Url": "",
Expand Down
Loading