|
| 1 | +# Migration Guide from version 72.x.x to 73.0.0 |
| 2 | + |
| 3 | +# Introduction |
| 4 | + |
| 5 | +This document outlines the steps needed to migrate to version 73.0.0 of our Design System library from versions 72.x.x. This release includes several breaking-changes that may impact your projects. Please follow this guide to ensure a smooth transition. |
| 6 | + |
| 7 | +## Components |
| 8 | + |
| 9 | +This section will list all the changes that are specific to one component. |
| 10 | + |
| 11 | +### List of components |
| 12 | + |
| 13 | +- [Table of Contents](#table-of-contents) |
| 14 | +- [Hero](#hero) |
| 15 | +- [Message List](#message-list) |
| 16 | + |
| 17 | +### **_Table of Contents_** |
| 18 | + |
| 19 | +**_Renamed utility class from ons-js-toc-container to ons-js-table-of-contents-container_** |
| 20 | + |
| 21 | +[**Link to PR**](https://github.com/ONSdigital/design-system/pull/3650) |
| 22 | + |
| 23 | +- **Description of change:** The following classes have been renamed: |
| 24 | + |
| 25 | + - `ons-js-toc-container to ons-js-table-of-contents-container` |
| 26 | + |
| 27 | +- **Reason for change:** The `ons-js-toc-container` utility class has been updated to remove the toc acronym. |
| 28 | + |
| 29 | + This will be a breaking change and will require the update of the old classes name with the new one: |
| 30 | + |
| 31 | +- **Components impacted:** |
| 32 | + |
| 33 | + Table of Contents Component |
| 34 | + |
| 35 | +- **Migration steps:** |
| 36 | + |
| 37 | + 1. Locate all instances of the above classes in your codebase. |
| 38 | + 2. Replace the old class name with the new one. |
| 39 | + |
| 40 | + - <details> |
| 41 | + <summary><b>Click for example:</b></summary> |
| 42 | + |
| 43 | + ```html |
| 44 | + OLD |
| 45 | + <div class="ons-grid ons-js-toc-container"></div> |
| 46 | + |
| 47 | + NEW |
| 48 | + <div class="ons-grid ons-js-table-of-contents-container"></div> |
| 49 | + ``` |
| 50 | + |
| 51 | + </details> |
| 52 | + |
| 53 | +### **_Hero_** |
| 54 | + |
| 55 | +**Remove breadcrumbs parameter in Hero component** |
| 56 | + |
| 57 | +[**Link to PR**](https://github.com/ONSdigital/design-system/pull/3712) |
| 58 | + |
| 59 | +- **Description of change:** The `breadcrumbs` parameter has been removed from the Hero component. |
| 60 | +- **Reason for change:** Following a DAC accessibility issue, breadcrumbs are now positioned outside the Hero to ensure correct structure and semantics. |
| 61 | +- **Migration steps:** |
| 62 | + |
| 63 | + 1. Locate and Remove all instances of the breadcrumbs parameter within the Hero component. |
| 64 | + 2. Render the Breadcrumbs component separately, outside of the Hero, as shown in the example below. |
| 65 | + |
| 66 | + - <details> |
| 67 | + <summary><b>Click for example</b></summary> |
| 68 | + |
| 69 | + ```njk |
| 70 | + OLD |
| 71 | + {% from "components/hero/_macro.njk" import onsHero %} |
| 72 | + |
| 73 | + {{ |
| 74 | + onsHero({ |
| 75 | + "topic": 'Topic', |
| 76 | + "title": 'Retail Industry', |
| 77 | + "text": 'Sales by retailers', |
| 78 | + "breadcrumbs": { |
| 79 | + "ariaLabel": 'Breadcrumbs', |
| 80 | + "itemsList": [ |
| 81 | + { |
| 82 | + "url": '/', |
| 83 | + "text": 'Home' |
| 84 | + } |
| 85 | + ] |
| 86 | + }, |
| 87 | + "variants": 'pale-blue' |
| 88 | + }) |
| 89 | + }} |
| 90 | + |
| 91 | + NEW |
| 92 | + {% from "components/hero/_macro.njk" import onsHero %} |
| 93 | + {% from "components/breadcrumbs/_macro.njk" import onsBreadcrumbs %} |
| 94 | + |
| 95 | + {% block pageContent %} |
| 96 | + {{ |
| 97 | + onsBreadcrumbs({ |
| 98 | + "ariaLabel": 'Breadcrumbs', |
| 99 | + "variant": "pale-blue", |
| 100 | + "itemsList": [ |
| 101 | + { |
| 102 | + "url": '/', |
| 103 | + "text": 'Home' |
| 104 | + } |
| 105 | + ] |
| 106 | + }) |
| 107 | + }} |
| 108 | + <main id="main-content"> |
| 109 | + {{ |
| 110 | + onsHero({ |
| 111 | + "topic": 'Topic', |
| 112 | + "title": 'Retail Industry', |
| 113 | + "text": 'Sales by retailers', |
| 114 | + "variants": 'pale-blue' |
| 115 | + }) |
| 116 | + }} |
| 117 | + </main> |
| 118 | + {% endblock %} |
| 119 | + ``` |
| 120 | + |
| 121 | + </details> |
| 122 | + |
| 123 | +### **_Message List_** |
| 124 | + |
| 125 | +**Remove deprecated ariaLabelMsg parameter from MessageList Component** |
| 126 | + |
| 127 | +[**Link to PR**](https://github.com/ONSdigital/design-system/pull/3726) |
| 128 | + |
| 129 | +- **Description of change:** The deprecated `ariaLabelMsg` parameter has been removed and replaced with `bodyLabel` in the MessageList component. |
| 130 | +- **Reason for change:** Removed deprecated parameter to ensure a single clear label for message body. |
| 131 | +- **Migration steps:** |
| 132 | + |
| 133 | + 1. Locate all instances of `ariaLabelMsg` in the MessageList component within your codebase. |
| 134 | + 2. Replace `ariaLabelMsg` with `bodyLabel`. |
| 135 | + |
| 136 | + - <details> |
| 137 | + <summary><b>Click for example:</b></summary> |
| 138 | + |
| 139 | + ```njk |
| 140 | + OLD |
| 141 | + {{ |
| 142 | + onsMessageList({ |
| 143 | + "ariaLabel": "Message list for ONS Business Surveys", |
| 144 | + "ariaLabelMsg": "Body", |
| 145 | + "unreadText": "New", |
| 146 | + "fromLabel": "From", |
| 147 | + "dateLabel": "Sent", |
| 148 | + "hiddenReadLabel": "Read the message", |
| 149 | + "ariaLabelMetaData": "Message information", |
| 150 | + "messages": [ |
| 151 | + { |
| 152 | + "id": "message-list-example-1", |
| 153 | + "subject": { |
| 154 | + "url": "#0", |
| 155 | + "text": "BRES 2016 survey response query" |
| 156 | + }, |
| 157 | + "unread": true, |
| 158 | + "fromText": "ONS Business Surveys Team", |
| 159 | + "dateText": "Tue 4 Jul 2020 at 7:47", |
| 160 | + "body": "Hi Jacky. Thanks for that information. Your figures have allowed us to create more accurate…" |
| 161 | + }, |
| 162 | + { |
| 163 | + "id": "message-list-example-2", |
| 164 | + "subject":{ |
| 165 | + "url": "#0", |
| 166 | + "text": "BRES 2015 Enquiry on data" |
| 167 | + }, |
| 168 | + "fromText": "Jacky Turner", |
| 169 | + "dateText": "Mon 1 Oct 2019 at 9:52", |
| 170 | + "body": "Hi Jacky, Thank you for returning the Business Register and Employment Survey (BRES) 2016…" |
| 171 | + } |
| 172 | + ] |
| 173 | + }) |
| 174 | + }} |
| 175 | + |
| 176 | + NEW |
| 177 | + {{ |
| 178 | + onsMessageList({ |
| 179 | + "ariaLabel": "Message list for ONS Business Surveys", |
| 180 | + "bodyLabel": "Body", |
| 181 | + "unreadText": "New", |
| 182 | + "fromLabel": "From", |
| 183 | + "dateLabel": "Sent", |
| 184 | + "hiddenReadLabel": "Read the message", |
| 185 | + "ariaLabelMetaData": "Message information", |
| 186 | + "messages": [ |
| 187 | + { |
| 188 | + "id": "message-list-example-1", |
| 189 | + "subject": { |
| 190 | + "url": "#0", |
| 191 | + "text": "BRES 2016 survey response query" |
| 192 | + }, |
| 193 | + "unread": true, |
| 194 | + "fromText": "ONS Business Surveys Team", |
| 195 | + "dateText": "Tue 4 Jul 2020 at 7:47", |
| 196 | + "body": "Hi Jacky. Thanks for that information. Your figures have allowed us to create more accurate…" |
| 197 | + }, |
| 198 | + { |
| 199 | + "id": "message-list-example-2", |
| 200 | + "subject":{ |
| 201 | + "url": "#0", |
| 202 | + "text": "BRES 2015 Enquiry on data" |
| 203 | + }, |
| 204 | + "fromText": "Jacky Turner", |
| 205 | + "dateText": "Mon 1 Oct 2019 at 9:52", |
| 206 | + "body": "Hi Jacky, Thank you for returning the Business Register and Employment Survey (BRES) 2016…" |
| 207 | + } |
| 208 | + ] |
| 209 | + }) |
| 210 | + }} |
| 211 | + ``` |
| 212 | + |
| 213 | + </details> |
| 214 | + |
| 215 | +## Contact Information |
| 216 | + |
| 217 | +For further assistance, please reach out to our support team: |
| 218 | + |
| 219 | +- **Email:** ons.design.system@ons.gov.uk |
0 commit comments