digital-land / submit

0 stars 1 forks source link

390 change content in check tool #593

Closed GeorgeGoodall-GovUk closed 1 month ago

GeorgeGoodall-GovUk commented 1 month ago

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

coderabbitai[bot] commented 1 month ago

Walkthrough

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.

Changes

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.

Sequence Diagram(s)

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?

❤️ Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
github-actions[bot] commented 1 month ago

Coverage Report

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 Coverage
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%
Generated in workflow #133 for commit 5edbc0e by the Vitest Coverage Report Action
DilwoarH commented 1 month ago

@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