@companieshouse/ch-node-utils 1.3.14 → 1.3.15

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,7 @@ 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.
110
111
 
111
112
  #### Localization
112
113
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companieshouse/ch-node-utils",
3
- "version": "1.3.14",
3
+ "version": "1.3.15",
4
4
  "author": "companieshouse",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -60,11 +60,12 @@ 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
63
64
  #}
64
- {% macro addPredefinedNavbar(userDisplayText, chsMonitorGuiUrl, lang, displayAuthorisedAgent) %}
65
+ {% macro addPredefinedNavbar(userDisplayText, chsMonitorGuiUrl, lang, displayAuthorisedAgent, displayYourCompanies) %}
65
66
  {% set menuItems = [
66
67
  { 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" },
68
+ { id: "your-companies", href: "/your-companies", displayText: lang.yourCompanies or "Your companies" } if displayYourCompanies === "yes",
68
69
  { id: "your-filings", href: "/user/transactions", displayText: lang.yourFilings or "Your filings" },
69
70
  { id: "companies-you-follow", href: chsMonitorGuiUrl, displayText: lang.companiesYouFollow or "Companies you follow" },
70
71
  { id: "basket", href: "/basket", displayText: lang.basket or "Basket" },
@@ -74,4 +75,4 @@ It receives:
74
75
 
75
76
  {{ addNavbar("/signin", menuItems, userDisplayText, lang) }}
76
77
 
77
- {% endmacro %}
78
+ {% endmacro %}