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
Dynamic form fields based on choice of attribute-group field (attribute form) #36027
base: develop
Are you sure you want to change the base?
Dynamic form fields based on choice of attribute-group field (attribute form) #36027
Conversation
mattgoud
commented
Apr 25, 2024
Questions | Answers |
---|---|
Branch? | develop |
Description? | related #35591 - bug 3 : Attribute value list doesn't adapt itself if the attribute type changes |
Type? | bug fix |
Category? | BO |
BC breaks? | no |
Deprecations? | no |
How to test? | Indicate how to verify that this change works as expected. |
UI Tests | Please run UI tests and paste here the link to the run. Read this page to know why and how to use this tool.. |
Fixed issue or discussion? | Fixes #36010 |
Related PRs | If theme, autoupgrade or other module change is needed to make this change work, provide a link to related PRs here. |
Sponsor company | Your company or customer's name goes here (if applicable). |
…attribute type for creating new values
Hello @mattgoud! This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community! |
Hi, thanks for this contribution! I found some issues with the Pull Request description:
Would you mind having a look at it? This will help us understand how interesting your contribution is, thank you very much! About linked issuesPlease consider opening an issue before submitting a Pull Request:
(Note: this is an automated message, but answering it will reach a real human) |
…dd classes in form-map.ts and create toggleDisplay function)
sorry @matthieu-rolland I pushed a new commit (refacto js) which canceled your review, if you could take a look thanks |
@@ -106,17 +106,21 @@ public function buildForm(FormBuilderInterface $builder, array $options) | |||
'help' => $this->trans('Your internal name for this attribute.', 'Admin.Catalog.Help') | |||
. ' ' . $this->trans('Invalid characters:', 'Admin.Notifications.Info') | |||
. ' ' . TypedRegexValidator::CATALOG_CHARS, | |||
]); | |||
|
|||
if ($hasAttributeGroupId === true && $attributeGroup->group_type === AttributeGroupType::ATTRIBUTE_GROUP_TYPE_COLOR) { |
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.
I added this check in my recent PR (https://github.com/PrestaShop/PrestaShop/pull/35865/files#diff-010f6eb7f9b60c2911e7db12103d0575cdacdcb29f4da24cfb67be0bbf1fd996R111). Are you sure that we can remove it?
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.
I think it's required if we want to toggle the fields dynamically
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.
Thanks @mattgoud
@@ -106,17 +106,21 @@ public function buildForm(FormBuilderInterface $builder, array $options) | |||
'help' => $this->trans('Your internal name for this attribute.', 'Admin.Catalog.Help') | |||
. ' ' . $this->trans('Invalid characters:', 'Admin.Notifications.Info') | |||
. ' ' . TypedRegexValidator::CATALOG_CHARS, | |||
]); | |||
|
|||
if ($hasAttributeGroupId === true && $attributeGroup->group_type === AttributeGroupType::ATTRIBUTE_GROUP_TYPE_COLOR) { |
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.
I think it's required if we want to toggle the fields dynamically