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

Replace mojPrimaryNavigation with govukServiceNavigation #796

Merged
merged 4 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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: 0 additions & 1 deletion app/assets/sass/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ $govuk-assets-path: "/dist/govuk/assets/";
@import "overrides/moj-button-menu";
@import "overrides/moj-filter";
@import "overrides/moj-pagination";
@import "overrides/moj-primary-navigation";
@import "overrides/status-grid";
@import "overrides/summary-card";
@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 @@ -22,6 +22,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 @@ -53,7 +54,6 @@
{%- from "moj/components/filter/macro.njk" import mojFilter -%}
{%- from "moj/components/button-menu/macro.njk" import mojButtonMenu -%}
{%- from "moj/components/pagination/macro.njk" import mojPagination -%}
{%- from "moj/components/primary-navigation/macro.njk" import mojPrimaryNavigation -%}

{% block head %}
{% include "_includes/head.njk" %}
Expand Down Expand Up @@ -84,13 +84,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 @@ -102,27 +98,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 @@ -167,8 +142,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 @@ -233,17 +213,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 @@ -253,7 +229,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 @@ -286,9 +262,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
Loading