@companieshouse/ch-node-utils 1.3.21 → 1.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/package.json +1 -1
- package/templates/navbar.njk +5 -3
package/README.md
CHANGED
|
@@ -110,6 +110,7 @@ The macro requires the following parameters:
|
|
|
110
110
|
- `displayYourCompanies`: A flag for displaying the "Your companies" menu item. It should be set to `'yes` if this menu iten needs to be displayed.
|
|
111
111
|
- `displayUserManagementAdmin`: A flag for displaying the "User management admin" menu item. It should be set to `'yes` if this menu iten needs to be displayed.
|
|
112
112
|
- `pageLanguage`: The language code for the page. (e.g. `'en'` or `'cy'`). This allows the language to be kept after navigating to the new service.
|
|
113
|
+
- `accountUrl`: base URL to account service - ACCOUNT_URL
|
|
113
114
|
|
|
114
115
|
#### Localization
|
|
115
116
|
|
|
@@ -123,6 +124,6 @@ The navbar also requires the use of styles provided in the [ch.gov.uk.css](https
|
|
|
123
124
|
|
|
124
125
|
`<link href="{{ cdnHost }}/stylesheets/ch.gov.uk.css" rel="stylesheet"/>`
|
|
125
126
|
|
|
126
|
-
It also requires the [navbar.js](https://github.com/companieshouse/cdn.ch.gov.uk/blob/master/app/assets/javascripts/lib/navbar.js) script to be added to the footer to make the navbar work in mobile mode
|
|
127
|
+
It also requires the [navbar.js](https://github.com/companieshouse/cdn.ch.gov.uk/blob/master/app/assets/javascripts/lib/navbar.js) script to be added to the footer to make the navbar work in mobile mode (make sure it's the latest version).
|
|
127
128
|
|
|
128
129
|
`<script src="{{ cdnHost }}/javascripts/lib/navbar.js"></script>`
|
package/package.json
CHANGED
package/templates/navbar.njk
CHANGED
|
@@ -32,7 +32,8 @@ It receives:
|
|
|
32
32
|
<div class="js-toggle-nav" id="global-nav">
|
|
33
33
|
<nav role="navigation" class="content" aria-label="{{ lang.mainNavbar }}">
|
|
34
34
|
{% if userDisplayText %}
|
|
35
|
-
<a href="#navigation" class="js-header-toggle menu">
|
|
35
|
+
<a href="#navigation" role="button" aria-expanded="false" class="js-header-toggle menu">
|
|
36
|
+
{{ userDisplayText }}
|
|
36
37
|
<span class="govuk-visually-hidden">{{ lang.clickToExpandOrCollapse }}</span>
|
|
37
38
|
</a>
|
|
38
39
|
{% else %}
|
|
@@ -63,8 +64,9 @@ It receives:
|
|
|
63
64
|
- displayYourCompanies: a flag indicating whether to display the 'Your companies' menu item
|
|
64
65
|
- displayUserManagementAdmin: a flag indicating whether to display the 'User management admin' menu item
|
|
65
66
|
- pageLanguage: the language code for the page (e.g. 'en', 'cy')
|
|
67
|
+
- accountUrl: base URL to account service - ACCOUNT_URL
|
|
66
68
|
#}
|
|
67
|
-
{% macro addPredefinedNavbar(userDisplayText, chsMonitorGuiUrl, lang, displayAuthorisedAgent, displayYourCompanies, displayUserManagementAdmin, pageLanguage="en") %}
|
|
69
|
+
{% macro addPredefinedNavbar(userDisplayText, chsMonitorGuiUrl, lang, displayAuthorisedAgent, displayYourCompanies, displayUserManagementAdmin, pageLanguage = "en", accountUrl) %}
|
|
68
70
|
{% set menuItems = [
|
|
69
71
|
{ id: "user-management-admin", href: "/identity-verification?lang=" + pageLanguage, displayText: lang.userManagementAdmin or "User management admin" } if displayUserManagementAdmin === "yes",
|
|
70
72
|
{ id: "authorised-agent", href: "/authorised-agent?lang=" + pageLanguage, displayText: lang.authorisedAgent or "Authorised agent" } if displayAuthorisedAgent === "yes",
|
|
@@ -72,7 +74,7 @@ It receives:
|
|
|
72
74
|
{ id: "your-filings", href: "/user/transactions?lang=" + pageLanguage, displayText: lang.yourFilings or "Your filings" },
|
|
73
75
|
{ id: "companies-you-follow", href: chsMonitorGuiUrl, displayText: lang.companiesYouFollow or "Companies you follow" },
|
|
74
76
|
{ id: "basket", href: "/basket?lang=" + pageLanguage, displayText: lang.basket or "Basket" },
|
|
75
|
-
{ id: "your-details", href: "/user/account?lang=" + pageLanguage, displayText: lang.manageAccount or "Manage account" },
|
|
77
|
+
{ id: "your-details", href: accountUrl + "/user/account?lang=" + pageLanguage, displayText: lang.manageAccount or "Manage account" },
|
|
76
78
|
{ id: "user-signout", href: "/signout", displayText: lang.signOut or "Sign out" }
|
|
77
79
|
] | reject("falsy") %}
|
|
78
80
|
|