diff --git a/CHANGELOG.md b/CHANGELOG.md index aa185b4f..4e630630 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - Removed customisable colour variables `$dark-grey`, `$base-font`, `$link-colour` and `$link-colour-visited` +- Removed the ability to add attributes to items, previous buttons and next buttons in pagination components ### Fixed diff --git a/src/nationalarchives/components/pagination/fixtures.json b/src/nationalarchives/components/pagination/fixtures.json index 8b7302fe..68043beb 100644 --- a/src/nationalarchives/components/pagination/fixtures.json +++ b/src/nationalarchives/components/pagination/fixtures.json @@ -22,7 +22,8 @@ { "number": 7, "current": true, - "href": "#7" + "href": "#7", + "label": "Page 7" }, { "number": 8, @@ -40,7 +41,121 @@ "href": "#next" } }, - "html": "" + "html": "" + }, + { + "name": "no numbers", + "options": { + "previous": { + "href": "#previous" + }, + "next": { + "href": "#next" + } + }, + "html": "" + }, + { + "name": "custom next and previous text", + "options": { + "previous": { + "text": "Backwards", + "href": "#backwards" + }, + "next": { + "text": "Forwards", + "href": "#forwards" + } + }, + "html": "" + }, + { + "name": "with classes", + "options": { + "previous": { + "href": "#previous" + }, + "items": [ + { + "number": 1, + "href": "#1" + }, + { + "ellipsis": true + }, + { + "number": 6, + "href": "#6" + }, + { + "number": 7, + "current": true, + "href": "#7", + "label": "Page 7" + }, + { + "number": 8, + "href": "#8" + }, + { + "ellipsis": true + }, + { + "number": 42, + "href": "#42" + } + ], + "next": { + "href": "#next" + }, + "classes": "pagination__test-class" + }, + "html": "" + }, + { + "name": "with attributes", + "options": { + "previous": { + "href": "#previous" + }, + "items": [ + { + "number": 1, + "href": "#1" + }, + { + "ellipsis": true + }, + { + "number": 6, + "href": "#6" + }, + { + "number": 7, + "current": true, + "href": "#7", + "label": "Page 7" + }, + { + "number": 8, + "href": "#8" + }, + { + "ellipsis": true + }, + { + "number": 42, + "href": "#42" + } + ], + "next": { + "href": "#next" + }, + "attributes": { + "data-testattribute": "foobar" + } + }, + "html": "" } ] } diff --git a/src/nationalarchives/components/pagination/macro-options.json b/src/nationalarchives/components/pagination/macro-options.json index fe5c71f2..e88e0efc 100644 --- a/src/nationalarchives/components/pagination/macro-options.json +++ b/src/nationalarchives/components/pagination/macro-options.json @@ -16,12 +16,6 @@ "type": "string", "required": true, "description": "" - }, - { - "name": "attributes", - "type": "object", - "required": false, - "description": "" } ] }, @@ -60,12 +54,6 @@ "type": "boolean", "required": false, "description": "Use this option if you want to specify an ellipsis at a given point between numbers. If you set this option as `true`, any other options for the item are ignored." - }, - { - "name": "attributes", - "type": "object", - "required": false, - "description": "" } ] }, @@ -86,12 +74,6 @@ "type": "string", "required": true, "description": "" - }, - { - "name": "attributes", - "type": "object", - "required": false, - "description": "" } ] },