Closed GeorgeGoodall-GovUk closed 1 month ago
The changes involve significant updates across multiple files, primarily focusing on the management of text constants related to the status page. The StatusPage
class now imports text constants from a dedicated module, enhancing modularity. Additionally, modifications to the PageController
and StatusController
classes introduce dynamic back link text and new properties for heading and message texts. Template files have been updated to reflect new content structures and macros, while some macros have been removed. Overall, these changes streamline text management and improve user interface interactions.
File | Change Summary |
---|---|
src/assets/js/statusPage.js |
Removed inline definitions of headingTexts , messageTexts , buttonTexts ; imported from ../../content/statusPage.js . Updated methods to use imported constants. |
src/content/statusPage.js |
Added new constants: headingTexts , messageTexts , buttonTexts , and buttonAriaLabels with key-value pairs for statuses. |
src/controllers/pageController.js |
Added conditional block in locals method to set backLinkText based on deepLinkInfo . |
src/controllers/statusController.js |
Added headingTexts and messageTexts to req.form.options from ../content/statusPage.js . |
src/utils/utils.js |
Shortened text properties in dataSets by removing "dataset" suffix from descriptions. |
src/views/check/confirmation.html |
Updated pageName and restructured content for publishing instructions. |
src/views/check/statusPage/checkingFileMacro.html |
Removed checkingFileContent macro. |
src/views/check/statusPage/fileCheckedMacro.html |
Removed fileCheckedContent macro. |
src/views/check/statusPage/status.html |
Changed imports and logic to use statusContent macro for rendering based on processing state. |
src/views/check/statusPage/statusContentMacro.html |
Added new statusContent macro for dynamic rendering. |
src/views/check/upload.html |
Enhanced file upload component with conditional button text for error states. |
src/views/layouts/main.html |
Updated back link text to use dynamic value; adjusted script block for proper execution. |
src/views/check/results/errors.html |
Updated dataset banner logic to use options.datasetName instead of options.deepLink . |
src/views/check/results/no-errors.html |
Updated dataset banner logic to use options.datasetName instead of options.deepLink . |
src/views/check/upload-method.html |
Updated dataset banner logic to use options.datasetName instead of options.deepLink . |
src/views/check/url.html |
Updated dataset banner logic to use options.datasetName instead of options.deepLink . |
src/views/components/dataset-banner.html |
Changed parameter name from params to datasetName in datasetBanner macro. |
src/views/check/geometry-type.html |
Updated dataset banner logic to use options.datasetName instead of options.deepLink . |
src/utils/datasetSlugToReadableName.js |
Introduced new file exporting datasetSlugToReadableName with error handling. |
test/unit/deepLinkController.test.js |
Updated expected value for datasetName in tests. |
test/unit/statusPage.test.js |
Updated tests to use imported constants for headingTexts and messageTexts . |
test/unit/PageController.test.js |
Added mock for datasetSlugToReadableName ; reorganised tests for datasetName and back link. |
test/unit/resultsController.test.js |
Enhanced tests with sessionModel for dataset access and refined error handling checks. |
sequenceDiagram
participant User
participant StatusPage
participant StatusController
participant PageController
User->>StatusPage: Request status update
StatusPage->>StatusController: Get status texts
StatusController->>StatusPage: Return headingTexts, messageTexts
StatusPage->>User: Display status with dynamic texts
User->>PageController: Navigate back
PageController->>User: Provide contextual back link
🐇 "In the code, a change we see,
Texts imported, oh so free!
With links that guide and macros bright,
Our pages now are pure delight!
From checking files to status grand,
A better flow, just as we planned!" 🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Status | Category | Percentage | Covered / Total |
---|---|---|---|
🔵 | Lines | 62.48% | 3574 / 5720 |
🔵 | Statements | 62.48% | 3574 / 5720 |
🔵 | Functions | 65.36% | 151 / 231 |
🔵 | Branches | 81.1% | 425 / 524 |
File | Stmts | % Branch | % Funcs | % Lines | Uncovered Lines |
---|---|---|---|---|---|
Changed Files | |||||
index.js | 0% | 0% | 0% | 0% | 1-38 |
src/assets/js/statusPage.js | 92.1% | 100% | 100% | 92.1% | 33-34, 73-76 |
src/content/statusPage.js | 100% | 100% | 100% | 100% | |
src/controllers/pageController.js | 90.27% | 81.25% | 100% | 90.27% | 18-19, 55-59 |
src/controllers/statusController.js | 90.47% | 50% | 100% | 90.47% | 16-17 |
src/filters/filters.js | 100% | 100% | 100% | 100% | |
src/utils/datasetSlugToReadableName.js | 80% | 66.66% | 66.66% | 80% | 11-13 |
src/utils/utils.js | 100% | 100% | 100% | 100% |
@GeorgeGoodall-GovUk - do you know what's happening with the playwright tests? why do they take so long to complete and why are they suddenly failing?
Same issue on #592
What type of PR is this? (check all applicable)
Description
Content changes made to check tool following the design as seen in the ticket
It also makes it so the dataset display widget doesn't need info from the deep link to work, but instead can use the selected form fields form earlier steps of the check tool
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Please replace this line with instructions on how to test your changes, a note on the devices and browsers this has been tested on, as well as any relevant images for UI changes.
Added/updated tests?
We encourage you to keep the code coverage percentage at 80% and above.
[optional] Are there any post deployment tasks we need to perform?
[optional] Are there any dependencies on other PRs or Work?
Summary by CodeRabbit
Release Notes
New Features
Improvements
Bug Fixes