-
Notifications
You must be signed in to change notification settings - Fork 338
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
Add "deprecated" field and deprecate header navigation #5721
base: main
Are you sure you want to change the base?
Conversation
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for e3ed188 |
Other changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/components/button/macro-options.json b/packages/govuk-frontend/dist/govuk/components/button/macro-options.json
index d922bbaa1..7ae5d2975 100644
--- a/packages/govuk-frontend/dist/govuk/components/button/macro-options.json
+++ b/packages/govuk-frontend/dist/govuk/components/button/macro-options.json
@@ -3,7 +3,8 @@
"name": "element",
"type": "string",
"required": false,
- "description": "HTML element for the button component – `input`, `button` or `a`. In most cases you will not need to set this as it will be configured automatically if `href` is provided. This parameter will be removed in the next major version."
+ "description": "HTML element for the button component – `input`, `button` or `a`. In most cases you will not need to set this as it will be configured automatically if `href` is provided.",
+ "deprecated": "5.1.0"
},
{
"name": "text",
diff --git a/packages/govuk-frontend/dist/govuk/components/file-upload/macro-options.json b/packages/govuk-frontend/dist/govuk/components/file-upload/macro-options.json
index a9eff4d8c..a7902cd24 100644
--- a/packages/govuk-frontend/dist/govuk/components/file-upload/macro-options.json
+++ b/packages/govuk-frontend/dist/govuk/components/file-upload/macro-options.json
@@ -15,7 +15,8 @@
"name": "value",
"type": "string",
"required": false,
- "description": "Deprecated. Optional initial value of the input."
+ "description": "Optional initial value of the input.",
+ "deprecated": "5.7.1"
},
{
"name": "disabled",
diff --git a/packages/govuk-frontend/dist/govuk/components/header/macro-options.json b/packages/govuk-frontend/dist/govuk/components/header/macro-options.json
index d7fc417b5..5edced572 100644
--- a/packages/govuk-frontend/dist/govuk/components/header/macro-options.json
+++ b/packages/govuk-frontend/dist/govuk/components/header/macro-options.json
@@ -15,49 +15,57 @@
"name": "serviceName",
"type": "string",
"required": false,
- "description": "The name of your service, included in the header."
+ "description": "The name of your service, included in the header.",
+ "deprecated": "5.9.0"
},
{
"name": "serviceUrl",
"type": "string",
"required": false,
- "description": "URL for the service name anchor."
+ "description": "URL for the service name anchor.",
+ "deprecated": "5.9.0"
},
{
"name": "navigation",
"type": "array",
"required": false,
"description": "Can be used to add navigation to the header component.",
+ "deprecated": "5.9.0",
"params": [
{
"name": "text",
"type": "string",
"required": true,
- "description": "Text for the navigation item. If `html` is provided, the `text` option will be ignored."
+ "description": "Text for the navigation item. If `html` is provided, the `text` option will be ignored.",
+ "deprecated": "5.9.0"
},
{
"name": "html",
"type": "string",
"required": true,
- "description": "HTML for the navigation item. If `html` is provided, the `text` option will be ignored."
+ "description": "HTML for the navigation item. If `html` is provided, the `text` option will be ignored.",
+ "deprecated": "5.9.0"
},
{
"name": "href",
"type": "string",
"required": false,
- "description": "URL of the navigation item anchor."
+ "description": "URL of the navigation item anchor.",
+ "deprecated": "5.9.0"
},
{
"name": "active",
"type": "boolean",
"required": false,
- "description": "Flag to mark the navigation item as active or not."
+ "description": "Flag to mark the navigation item as active or not.",
+ "deprecated": "5.9.0"
},
{
"name": "attributes",
"type": "object",
"required": false,
- "description": "HTML attributes (for example data attributes) to add to the navigation item anchor."
+ "description": "HTML attributes (for example data attributes) to add to the navigation item anchor.",
+ "deprecated": "5.9.0"
}
]
},
@@ -65,25 +73,29 @@
"name": "navigationClasses",
"type": "string",
"required": false,
- "description": "Classes for the navigation section of the header."
+ "description": "Classes for the navigation section of the header.",
+ "deprecated": "5.9.0"
},
{
"name": "navigationLabel",
"type": "string",
"required": false,
- "description": "Text for the `aria-label` attribute of the navigation. Defaults to the same value as `menuButtonText`."
+ "description": "Text for the `aria-label` attribute of the navigation. Defaults to the same value as `menuButtonText`.",
+ "deprecated": "5.9.0"
},
{
"name": "menuButtonLabel",
"type": "string",
"required": false,
- "description": "Text for the `aria-label` attribute of the button that opens the mobile navigation, if there is a mobile navigation menu."
+ "description": "Text for the `aria-label` attribute of the button that opens the mobile navigation, if there is a mobile navigation menu.",
+ "deprecated": "5.9.0"
},
{
"name": "menuButtonText",
"type": "string",
"required": false,
- "description": "Text of the button that opens the mobile navigation menu, if there is a mobile navigation menu. There is no enforced character limit, but there is a limited display space so keep text as short as possible. By default, this is set to 'Menu'."
+ "description": "Text of the button that opens the mobile navigation menu, if there is a mobile navigation menu. There is no enforced character limit, but there is a limited display space so keep text as short as possible. By default, this is set to 'Menu'.",
+ "deprecated": "5.9.0"
},
{
"name": "containerClasses",
@@ -107,6 +119,7 @@
"name": "useTudorCrown",
"type": "boolean",
"required": false,
- "description": "Deprecated. If `true`, uses the Tudor crown from King Charles III's royal cypher. Otherwise, uses the St. Edward's crown. Default is `true`."
+ "description": "If `true`, uses the Tudor crown from King Charles III's royal cypher. Otherwise, uses the St. Edward's crown. Default is `true`.",
+ "deprecated": "5.2.0"
}
]
Action run for e3ed188 |
6db2c64
to
e13f331
Compare
e13f331
to
695ab29
Compare
695ab29
to
036d8cf
Compare
036d8cf
to
748acb1
Compare
@@ -10,7 +10,9 @@ params: | |||
- name: value | |||
type: string | |||
required: false | |||
description: Deprecated. Optional initial value of the input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially we could JUST have one field, something like: deprecated: '5.7.1'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just trying to think of a case where something isn't specifically deprecated in a version. Struggling though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it accept either a string or a boolean, and alter the output depending on whether a string is present or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing about that is that we don't seem to define a macro option schema, and this would actually only affect output on the DS website, so not very clear here what the field accepts.
I guess the answer is: Well then, define a macro option schema, doofus.
748acb1
to
32f56fe
Compare
32f56fe
to
dc3ae1c
Compare
dc3ae1c
to
f90cba4
Compare
@domoscargin Looks like there's another deprecation that slipped through: the |
Currently we have the following keys: 'name', 'type', 'required', 'description', 'isComponent' and 'params'. Add a 'deprecated' key which takes either a boolean, or the string version number it was deprecated in. This will allow us to check the option's status and display appropriate documentation
f90cba4
to
e3ed188
Compare
Ah, sneaky one @romaricpascal - ducked under my search for Nice catch, thanks! |
Adds
deprecated
field to macro options YAML schema to flag options which have been deprecated. It takes either aboolean
or a string matching a semver version (eg:'1.0.1'
).Updates macro options test to account for optional fields.