@companieshouse/ch-node-utils 1.3.14 → 1.3.16
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
CHANGED
|
@@ -82,14 +82,14 @@ Available as a normal npm dependency([here on npmjs](https://www.npmjs.com/packa
|
|
|
82
82
|
A menu navigation bar component has been added to make it easier to add links pointing to new services when needed. There are two Nunjucks macros: one that adds a menu navigation bar with the provided items and another that adds a menu navigation bar with predefined items. The latter internally uses the former and currently contains links to the following services:
|
|
83
83
|
|
|
84
84
|
- Authorised agent (conditional)
|
|
85
|
-
- Your companies
|
|
85
|
+
- Your companies (conditional)
|
|
86
86
|
- Your filings
|
|
87
87
|
- Companies you follow
|
|
88
88
|
- Basket
|
|
89
89
|
- Manage account
|
|
90
90
|
- Sign out
|
|
91
91
|
|
|
92
|
-
The "Authorised agent" menu item appears conditionally if the logged user has ACSP membership.
|
|
92
|
+
The "Authorised agent" menu item appears conditionally if the logged user has ACSP membership. The "Your companies" menu items appears conditionally until the service is live.
|
|
93
93
|
|
|
94
94
|
#### Usage
|
|
95
95
|
|
|
@@ -107,6 +107,8 @@ The macro requires the following parameters:
|
|
|
107
107
|
- `chsMonitorGuiUrl`: The URL for the "Companies you follow" link
|
|
108
108
|
- `lang`: An object containing language-specific strings for localization
|
|
109
109
|
- `displayAuthorisedAgent`: A flag for displaying the "Authorised agent" menu item. If the logged user has ACSP membership, this flag should be set to `'yes'`. If your service uses i18 middleware provided in the `@companieshouse/ch-node-utils` package, then this flag will be set to the correct value automatically. If not, you can use `isAuthorisedAgent` function from `./utils/sessionUtils`.
|
|
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
|
+
- `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.
|
|
110
112
|
|
|
111
113
|
#### Localization
|
|
112
114
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mainNavbar": "Y prif far llywio",
|
|
3
|
-
"clickToExpandOrCollapse": "Cliciwch i ehangu neu gwympo",
|
|
4
|
-
"signInOrRegister": "Mewngofnodwch / Cofrestrwch",
|
|
5
|
-
"yourCompanies": "Eich cwmnïau",
|
|
6
2
|
"authorisedAgent": "Asiant awdurdodedig",
|
|
7
|
-
"yourFilings": "Eich ffeilio",
|
|
8
|
-
"companiesYouFollow": "Cwmnïau rydych yn dilyn",
|
|
9
3
|
"basket": "Basged",
|
|
4
|
+
"clickToExpandOrCollapse": "Cliciwch i ehangu neu gwympo",
|
|
5
|
+
"companiesYouFollow": "Cwmnïau rydych yn dilyn",
|
|
6
|
+
"mainNavbar": "Y prif far llywio",
|
|
10
7
|
"manageAccount": "Rheoli cyfrif",
|
|
11
|
-
"
|
|
8
|
+
"signInOrRegister": "Mewngofnodwch / Cofrestrwch",
|
|
9
|
+
"signOut": "Allgofnodi",
|
|
10
|
+
"userManagementAdmin": "Gweinyddwr rheoli defnyddwyr",
|
|
11
|
+
"yourCompanies": "Eich cwmnïau",
|
|
12
|
+
"yourFilings": "Eich ffeilio"
|
|
12
13
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mainNavbar": "Menu",
|
|
3
|
-
"clickToExpandOrCollapse": "Select to show or hide",
|
|
4
|
-
"signInOrRegister": "Sign in / Register",
|
|
5
|
-
"yourCompanies": "Your companies",
|
|
6
2
|
"authorisedAgent": "Authorised agent",
|
|
7
|
-
"yourFilings": "Your filings",
|
|
8
|
-
"companiesYouFollow": "Companies you follow",
|
|
9
3
|
"basket": "Basket",
|
|
4
|
+
"clickToExpandOrCollapse": "Select to show or hide",
|
|
5
|
+
"companiesYouFollow": "Companies you follow",
|
|
6
|
+
"mainNavbar": "Menu",
|
|
10
7
|
"manageAccount": "Manage account",
|
|
11
|
-
"
|
|
8
|
+
"signInOrRegister": "Sign in / Register",
|
|
9
|
+
"signOut": "Sign out",
|
|
10
|
+
"userManagementAdmin": "User management admin",
|
|
11
|
+
"yourCompanies": "Your companies",
|
|
12
|
+
"yourFilings": "Your filings"
|
|
12
13
|
}
|
package/package.json
CHANGED
package/templates/navbar.njk
CHANGED
|
@@ -60,11 +60,14 @@ It receives:
|
|
|
60
60
|
- chsMonitorGuiUrl: the URL for the 'Companies you follow' link
|
|
61
61
|
- lang: an object containing language-specific strings for localization
|
|
62
62
|
- displayAuthorisedAgent: a flag indicating whether to display the 'Authorised agent' menu item
|
|
63
|
+
- displayYourCompanies: a flag indicating whether to display the 'Your companies' menu item
|
|
64
|
+
- displayUserManagementAdmin: a flag indicating whether to display the 'User management admin' menu item
|
|
63
65
|
#}
|
|
64
|
-
{% macro addPredefinedNavbar(userDisplayText, chsMonitorGuiUrl, lang, displayAuthorisedAgent) %}
|
|
66
|
+
{% macro addPredefinedNavbar(userDisplayText, chsMonitorGuiUrl, lang, displayAuthorisedAgent, displayYourCompanies, displayUserManagementAdmin) %}
|
|
65
67
|
{% set menuItems = [
|
|
68
|
+
{ id: "user-management-admin", href: "/identity-verification", displayText: lang.userManagementAdmin or "User management admin" } if displayUserManagementAdmin === "yes",
|
|
66
69
|
{ id: "authorised-agent", href: "/authorised-agent", displayText: lang.authorisedAgent or "Authorised agent" } if displayAuthorisedAgent === "yes",
|
|
67
|
-
{ id: "your-companies", href: "/your-companies", displayText: lang.yourCompanies or "Your companies" },
|
|
70
|
+
{ id: "your-companies", href: "/your-companies", displayText: lang.yourCompanies or "Your companies" } if displayYourCompanies === "yes",
|
|
68
71
|
{ id: "your-filings", href: "/user/transactions", displayText: lang.yourFilings or "Your filings" },
|
|
69
72
|
{ id: "companies-you-follow", href: chsMonitorGuiUrl, displayText: lang.companiesYouFollow or "Companies you follow" },
|
|
70
73
|
{ id: "basket", href: "/basket", displayText: lang.basket or "Basket" },
|
|
@@ -74,4 +77,4 @@ It receives:
|
|
|
74
77
|
|
|
75
78
|
{{ addNavbar("/signin", menuItems, userDisplayText, lang) }}
|
|
76
79
|
|
|
77
|
-
{% endmacro %}
|
|
80
|
+
{% endmacro %}
|