From 90c2451521956b78e7bf3278652112907ac64b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Curda?= Date: Tue, 14 May 2024 11:33:49 +0200 Subject: [PATCH] BREAKING CHANGE(web-twig): ID prop is required for all Form components #DS-885 --- packages/web-twig/DEPRECATIONS-v3.md | 16 ---------------- .../Resources/components/Checkbox/Checkbox.twig | 7 +------ .../__tests__/__fixtures__/checkboxDefault.twig | 10 +++++----- .../__snapshots__/checkboxDefault.twig.snap.html | 14 ++++++-------- .../src/Resources/components/Radio/Radio.twig | 2 +- .../src/Resources/components/Select/Select.twig | 2 +- 6 files changed, 14 insertions(+), 37 deletions(-) diff --git a/packages/web-twig/DEPRECATIONS-v3.md b/packages/web-twig/DEPRECATIONS-v3.md index cd3ed48510..4dd7c68913 100644 --- a/packages/web-twig/DEPRECATIONS-v3.md +++ b/packages/web-twig/DEPRECATIONS-v3.md @@ -8,22 +8,6 @@ Following deprecations will be removed in version 3 of the _spirit-web-twig_ pac ## Deprecations -### Required `id` Prop For Form Components - -The `id` prop will be required for all form components. - -Related components: - -- `Checkbox` -- `HelperText` -- `Radio` -- `Select` -- `ValidationText` - -#### Migration Guide - -Add `id` prop to the form components. - ### Dropdown `id` Prop The `id` prop will be mandatory for the `Dropdown` component. diff --git a/packages/web-twig/src/Resources/components/Checkbox/Checkbox.twig b/packages/web-twig/src/Resources/components/Checkbox/Checkbox.twig index 96103840db..15b7c12aaa 100644 --- a/packages/web-twig/src/Resources/components/Checkbox/Checkbox.twig +++ b/packages/web-twig/src/Resources/components/Checkbox/Checkbox.twig @@ -1,7 +1,7 @@ {# API #} {%- set props = props | default([]) -%} {%- set _helperText = props.helperText | default(null) -%} -{%- set _id = props.id | default(null) -%} +{%- set _id = props.id -%} {%- set _inputProps = props.inputProps | default([]) -%} {%- set _isChecked = props.isChecked | default(false) -%} {%- set _isDisabled = props.isDisabled | default(false) -%} @@ -44,11 +44,6 @@ {%- set _mainPropsWithoutId = props | filter((value, prop) => prop is not same as('id')) -%} {%- set _allowedInputAttributes = [ 'autocomplete' ] -%} -{# Deprecations #} -{% if not _id %} - {% deprecated 'Checkbox: The "id" property will be required starting from the next major version.' %} -{% endif %} -