Skip to content

[Backport] Fixed ability to set field config from layout xml #11302#17211

Merged
magento-engcom-team merged 1 commit intomagento:2.1-developfrom
mageprince:2.1-develop-PR-port-11643
Aug 1, 2018
Merged

[Backport] Fixed ability to set field config from layout xml #11302#17211
magento-engcom-team merged 1 commit intomagento:2.1-developfrom
mageprince:2.1-develop-PR-port-11643

Conversation

@mageprince
Copy link
Copy Markdown
Contributor

@mageprince mageprince commented Jul 27, 2018

Original Pull Request

#11643

Description

Config array is hardcoded to read three settings only. The patch allows reading all settings from config.

Example:

<item name="postcode" xsi:type="array">
    <item name="config" xsi:type="array">
        <item name="label" xsi:type="string">Another Label</item>
        <item name="placeholder" xsi:type="string">Field Placeholder</item>
    </item>
</item>

Manual testing scenarios

  1. Open Magento/Checkout/view/frontend/layout/checkout_index_index.xml and find postcode settings

  2. Change its settings as follows:

    <item name="postcode" xsi:type="array">
        <!-- post-code field has custom UI component -->
        <item name="component" xsi:type="string">Magento_Ui/js/form/element/post-code</item>
        <item name="validation" xsi:type="array">
            <item name="required-entry" xsi:type="string">true</item>
        </item>
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string">test label</item>
            <item name="placeholder" xsi:type="string">test placeholder</item>
        </item>
    </item>
  3. Navigate to checkout and you'll see that settings are not working.

  4. Apply the patch and settings will start working.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@mageprince mageprince changed the title [Backport] Fixed ability to set field config from layout xml #11302 [backport 2.2] [Backport] Fixed ability to set field config from layout xml #11302 Jul 27, 2018
@magento-engcom-team
Copy link
Copy Markdown
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-2587 has been created to process this Pull Request

@magento-engcom-team
Copy link
Copy Markdown
Contributor

Hi @mageprince. Thank you for your contribution.
We will aim to release these changes as part of 2.1.15.
Please check the release notes for final confirmation.

@mageprince mageprince deleted the 2.1-develop-PR-port-11643 branch August 1, 2018 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants