-
Notifications
You must be signed in to change notification settings - Fork 334
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
Skip ‘empty’ tasks in the task list #5046
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for f4d86bd |
Rendered HTML changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/components/task-list/template-with-empty-values.html b/packages/govuk-frontend/dist/govuk/components/task-list/template-with-empty-values.html
new file mode 100644
index 000000000..df3fad6b0
--- /dev/null
+++ b/packages/govuk-frontend/dist/govuk/components/task-list/template-with-empty-values.html
@@ -0,0 +1,27 @@
+
+<ul class="govuk-task-list">
+
+
+ <li class="govuk-task-list__item govuk-task-list__item--with-link">
+ <div class="govuk-task-list__name-and-hint">
+ <a class="govuk-link govuk-task-list__link" href="#" aria-describedby="task-list-3-status">
+ Task A
+ </a>
+ </div>
+ <div class="govuk-task-list__status" id="task-list-3-status">
+ Completed
+ </div>
+ </li>
+
+
+ <li class="govuk-task-list__item govuk-task-list__item--with-link">
+ <div class="govuk-task-list__name-and-hint">
+ <a class="govuk-link govuk-task-list__link" href="#" aria-describedby="task-list-6-status">
+ Task B
+ </a>
+ </div>
+ <div class="govuk-task-list__status" id="task-list-6-status">
+ Completed
+ </div>
+ </li>
+</ul>
Action run for f4d86bd |
Other changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/components/task-list/fixtures.json b/packages/govuk-frontend/dist/govuk/components/task-list/fixtures.json
index bb64665d6..7688bf944 100644
--- a/packages/govuk-frontend/dist/govuk/components/task-list/fixtures.json
+++ b/packages/govuk-frontend/dist/govuk/components/task-list/fixtures.json
@@ -547,6 +547,40 @@
"previewLayoutModifiers": [],
"screenshot": false,
"html": "<ul class=\"govuk-task-list\">\n <li class=\"govuk-task-list__item govuk-task-list__item--with-link\">\n <div class=\"govuk-task-list__name-and-hint\">\n <a class=\"govuk-link govuk-task-list__link\" href=\"#\" aria-describedby=\"my-custom-id-1-hint my-custom-id-1-status\">\n <strong>Linked Title</strong>\n </a>\n <div id=\"my-custom-id-1-hint\" class=\"govuk-task-list__hint\">\n <strong>Hint</strong>\n </div>\n </div>\n <div class=\"govuk-task-list__status\" id=\"my-custom-id-1-status\">\n <strong>Status</strong>\n </div>\n </li>\n <li class=\"govuk-task-list__item\">\n <div class=\"govuk-task-list__name-and-hint\">\n <div>\n <strong>Unlinked Title</strong>\n </div>\n </div>\n <div class=\"govuk-task-list__status\" id=\"my-custom-id-2-status\">\n <strong class=\"govuk-tag\">\n <strong>Tag</strong>\n </strong>\n </div>\n </li>\n</ul>"
+ },
+ {
+ "name": "with empty values",
+ "options": {
+ "items": [
+ null,
+ null,
+ {
+ "title": {
+ "text": "Task A"
+ },
+ "href": "#",
+ "status": {
+ "text": "Completed"
+ }
+ },
+ false,
+ "",
+ {
+ "title": {
+ "text": "Task B"
+ },
+ "href": "#",
+ "status": {
+ "text": "Completed"
+ }
+ }
+ ]
+ },
+ "hidden": false,
+ "description": "",
+ "previewLayoutModifiers": [],
+ "screenshot": false,
+ "html": "<ul class=\"govuk-task-list\">\n\n\n <li class=\"govuk-task-list__item govuk-task-list__item--with-link\">\n <div class=\"govuk-task-list__name-and-hint\">\n <a class=\"govuk-link govuk-task-list__link\" href=\"#\" aria-describedby=\"task-list-3-status\">\n Task A\n </a>\n </div>\n <div class=\"govuk-task-list__status\" id=\"task-list-3-status\">\n Completed\n </div>\n </li>\n\n\n <li class=\"govuk-task-list__item govuk-task-list__item--with-link\">\n <div class=\"govuk-task-list__name-and-hint\">\n <a class=\"govuk-link govuk-task-list__link\" href=\"#\" aria-describedby=\"task-list-6-status\">\n Task B\n </a>\n </div>\n <div class=\"govuk-task-list__status\" id=\"task-list-6-status\">\n Completed\n </div>\n </li>\n</ul>"
}
]
}
Action run for f4d86bd |
Looking good! thanks. |
18 tasks
This allows users to e.g. guard individual tasks with an `if` statement without empty rows displaying. Closes #4968
romaricpascal
force-pushed
the
task-list-skip-falsey
branch
from
July 19, 2024 11:48
f8740b3
to
f4d86bd
Compare
romaricpascal
approved these changes
Jul 19, 2024
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.
⛵
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
This PR is stacked on top of #5045 which must be merged first.
This allows users to e.g. guard individual tasks with an
if
statement without empty rows displaying.Closes #4968