diff --git a/CHANGELOG.md b/CHANGELOG.md index 26bc667..5ad9827 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,26 @@ Records breaking changes from major version bumps. ## Unreleased +Upgrade Digital Marketplace Frontend to v2.0.0 + +🆕 New features: + + Add macros for the following components: + + | Component name | Macro name | + |-------------------------------------|-----------------------------------------------------| + | Question list multiquestion | `digitalmarketplaceQuestionListMultiquestion` | + | Summary content text | `digitalmarketplaceSummaryContentText` | + | Summary content list | `digitalmarketplaceSummaryContentList` | + | Summary content upload | `digitalmarketplaceSummaryContentUpload` | + | Summary content service ID | `digitalmarketplaceSummaryContentServiceId` | + | Summary content radios | `digitalmarketplaceSummaryContentRadios` | + | Summary content boolean | `digitalmarketplaceSummaryContentBoolean` | + | Summary content number | `digitalmarketplaceSummaryContentNumber` | + | Summary content checkbox tree | `digitalmarketplaceSummaryContentCheckboxTree` | + | Summary content multiquestion | `digitalmarketplaceSummaryContentMultiquestion` | + | Summary content list multiquestion | `digitalmarketplaceSummaryContentListMultiquestion` | + ## 2.11.0 Replace `setup.py` with `pyproject.toml` diff --git a/digitalmarketplace_frontend_jinja/templates/components/question-list-multiquestion/macro.html b/digitalmarketplace_frontend_jinja/templates/components/question-list-multiquestion/macro.html index 5cd48f0..ec28f0a 100644 --- a/digitalmarketplace_frontend_jinja/templates/components/question-list-multiquestion/macro.html +++ b/digitalmarketplace_frontend_jinja/templates/components/question-list-multiquestion/macro.html @@ -1,79 +1,95 @@ {% macro digitalmarketplaceQuestionListMultiquestion(params) %} {%- from "govuk_frontend_jinja/components/fieldset/macro.html" import govukFieldset -%} {%- from "govuk_frontend_jinja/components/button/macro.html" import govukButton -%} +{%- from "govuk_frontend_jinja/components/error-message/macro.html" import govukErrorMessage -%} {%- from "digitalmarketplace_frontend_jinja/components/question/macro.html" import digitalmarketplaceQuestion -%} +{% set name = params.question.id %} +{% if params.errors and params.errors[name] %} + {% set errorMessage = { "text": params.errors[name]["message"] } %} +{% endif %} + {% if params.question.questions -%} - {% call govukFieldset({ - "legend": { - "text": params.question.question, - "classes": 'govuk-fieldset__legend--m' - }, - "attributes": { - 'data-module': "dm-question-list-multiquestion", - 'data-max-number-of-items': params.max_number_of_items - } - }) %} - {% if params.question.question_advice %} -
{{ multi_question.name }}
+{{ multi_question.name if multi_question.name else multi_question.question }}
{{ digitalmarketplaceSummaryContentMultiquestion({ "value": multi_question.value }) }} diff --git a/package-lock.json b/package-lock.json index d395e5f..04d944b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "license": "MIT", "devDependencies": { - "digitalmarketplace-frontend": "^2.0.0-beta.0" + "digitalmarketplace-frontend": "^2.0.0" } }, "node_modules/accessible-autocomplete": { @@ -28,9 +28,9 @@ } }, "node_modules/digitalmarketplace-frontend": { - "version": "2.0.0-beta.0", - "resolved": "https://registry.npmjs.org/digitalmarketplace-frontend/-/digitalmarketplace-frontend-2.0.0-beta.0.tgz", - "integrity": "sha512-ezeLrf3yCgfcNdqszNkZxmuBHWm1zsMpHKtn2jI7i6S2zWtlxXWQKGtasq4x0qmWxko+UXWvEJ5udDRLZINh+g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/digitalmarketplace-frontend/-/digitalmarketplace-frontend-2.0.0.tgz", + "integrity": "sha512-XFk9fC62lcRzk/grAOQYjm9VFFZXkRY+yUuMjjyvYB4DqPFUHAP/jSGc+Mn9WZvIoOeeAa2DgdSSD9e3f6pM/g==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 6634d3a..6e6217c 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,6 @@ "author": "CCS", "license": "MIT", "devDependencies": { - "digitalmarketplace-frontend": "^2.0.0-beta.0" + "digitalmarketplace-frontend": "^2.0.0" } }