Skip to content

Commit

Permalink
Merge pull request #796 from DFE-Digital/use-govuk-service-navigation
Browse files Browse the repository at this point in the history
Replace mojPrimaryNavigation with govukServiceNavigation
  • Loading branch information
simonwhatley authored Dec 19, 2024
2 parents e9d239f + 3dc0f24 commit 2ebb63b
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 72 deletions.
1 change: 0 additions & 1 deletion app/assets/sass/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ $govuk-assets-path: "/dist/govuk/assets/";
@import "overrides/govuk-tag";
@import "overrides/moj-button-menu";
@import "overrides/moj-filter";
@import "overrides/moj-primary-navigation";
@import "overrides/status-grid";
@import "overrides/tabs";

Expand Down
23 changes: 0 additions & 23 deletions app/assets/sass/overrides/_moj-primary-navigation.scss

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/funding/index.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "_templates/_page.njk" %}
{% set navActive = "Funding" %}
{% set navActive = "funding" %}
{% set pageHeading = "Select an academic year to view its funding" %}

{% set backLink = "/" %}
Expand Down
2 changes: 1 addition & 1 deletion app/views/funding/payment-schedule.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "_templates/_page.njk" %}
{% set navActive = "Funding" %}
{% set navActive = "funding" %}
{% set pageHeading = navActive %}
{% set tabName = "Payment schedule " + fundingYear %}

Expand Down
2 changes: 1 addition & 1 deletion app/views/funding/trainee-summary.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "_templates/_page.njk" %}
{% set navActive = "Funding" %}
{% set navActive = "funding" %}
{% set pageHeading = navActive %}
{% set tabName = "Trainee summary " + fundingYear %}

Expand Down
54 changes: 14 additions & 40 deletions app/views/layout.njk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}
{% from "govuk/components/radios/macro.njk" import govukRadios %}
{% from "govuk/components/select/macro.njk" import govukSelect %}
{% from "govuk/components/service-navigation/macro.njk" import govukServiceNavigation %}
{% from "govuk/components/skip-link/macro.njk" import govukSkipLink %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/table/macro.njk" import govukTable %}
Expand Down Expand Up @@ -52,7 +53,6 @@
{# moj components #}
{%- from "moj/components/filter/macro.njk" import mojFilter -%}
{%- from "moj/components/button-menu/macro.njk" import mojButtonMenu -%}
{%- from "moj/components/primary-navigation/macro.njk" import mojPrimaryNavigation -%}

{% block head %}
{% include "_includes/head.njk" %}
Expand Down Expand Up @@ -83,13 +83,9 @@
containerClasses: "govuk-width-container",
navigation: [
{
href: "#1",
href: "#",
text: "Your account"
} if false,
{
href: "/select-organisation",
text: "Change organisation"
} if shouldShowOrganisationSwitchLink and false,
},
{
href: "/start-page",
text: "Sign out"
Expand All @@ -101,27 +97,6 @@
{% include "_includes/organisation-switcher.njk" %}
{% endif %}

{% set rightHandSideNavHtml %}

{% if not data.isAdmin and not data.isImpersonating | falsify and not isSupportUi %}
{% set providerName = data.settings.userActiveProvider %}

<nav class="moj-primary-navigation">
<ul class="moj-primary-navigation__list">
{% set ariaCurrent = "aria-current=page" if navActive == "provider" %}
<li class="moj-primary-navigation__item">
<a class="moj-primary-navigation__link" {{ ariaCurrent }} href="/organisations/{{activeProvider.id}}">
Organisation details
</a>
</li>

</ul>

</nav>
{% endif %}

{% endset %}

{% set navItemsUser = [
{
text: 'Home',
Expand Down Expand Up @@ -166,8 +141,13 @@
{
text: 'Funding',
href: '/funding/' + data.years.currentAcademicYearSimple + '/payment-schedule',
active: true if navActive == 'Funding'
} if data.settings.showFundingInPrimaryNav
active: true if navActive == 'funding'
} if data.settings.showFundingInPrimaryNav,
{
text: 'Organisation details',
href: '/organisations/' + activeProvider.id,
active: true if navActive == 'provider'
} if not data.isAdmin and not data.isImpersonating | falsify and not isSupportUi
] | removeEmpty %}

{% set navItemsSupport = [
Expand Down Expand Up @@ -232,17 +212,13 @@

{% if not hidePrimaryNav %}

{{ mojPrimaryNavigation({
label: 'Primary navigation',
items: navItems,
containerClasses: "app-primary-navigation--support-ui" if isSupportUi,
searchHtml: rightHandSideNavHtml
{{ govukServiceNavigation({
ariaLabel: "Primary navigation",
navigation: navItems
}) }}

{% endif %}



{% endblock %}

{% block beforeContent %}
Expand All @@ -252,7 +228,7 @@
"role": "status"
},
tag: {
text: "prototype"
text: "Prototype"
},
classes: 'govuk-!-margin-top-1',
html: 'This is a prototype of a new service – your <a href="#" class="govuk-link">feedback</a> will help us improve it'
Expand Down Expand Up @@ -285,9 +261,7 @@
<h2 class="govuk-heading-s">
Give feedback
</h2>

<p class="govuk-body govuk-!-font-size-16"><a href="/guidance" class="govuk-link govuk-footer__link">Give feedback to help us improve <span class="app-nowrap">Register trainee teachers</span></a></p>

</div>
</div>
{% endset %}
Expand Down
2 changes: 1 addition & 1 deletion app/views/organisations/organisation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Organisation – {{ provider.name }}
{% endset %}

{# {% set navActive = "provider" %} #}
{% set navActive = "provider" %}

{% set backText = "Home" %}
{% set backLink = '/home' %}
Expand Down
2 changes: 1 addition & 1 deletion app/views/organisations/token-details.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Organisation – {{ provider.name }}
{% endset %}

{# {% set navActive = "provider" %} #}
{% set navActive = "provider" %}

{% set backText = "Back" %}
{% set backLink = 'token-manage' %}
Expand Down
2 changes: 1 addition & 1 deletion app/views/organisations/token-generated.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Organisation – {{ provider.name }}
{% endset %}

{# {% set navActive = "provider" %} #}
{% set navActive = "provider" %}

{% set backText = "Back" %}
{% set backLink = 'token-details' %}
Expand Down
2 changes: 1 addition & 1 deletion app/views/organisations/token-manage.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Organisation – {{ provider.name }}
{% endset %}

{# {% set navActive = "provider" %} #}
{% set navActive = "provider" %}

{% set backText = "Back" %}
{% set backLink = 'organisation' %}
Expand Down
2 changes: 1 addition & 1 deletion app/views/support/organisations/view.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Organisation – {{ provider.name }}
{% endset %}

{# {% set navActive = "provider" %} #}
{% set navActive = "provider" %}

{% set backText = "Back" %}
{# {% set backLink = '/home' %} #}
Expand Down

0 comments on commit 2ebb63b

Please sign in to comment.