-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add documentation for the DynamicRowsRecord UI component #5634
Add documentation for the DynamicRowsRecord UI component #5634
Conversation
An admin must run tests on this PR before it can be merged. |
1 similar comment
An admin must run tests on this PR before it can be merged. |
| Option | Description | Type | Default | | ||
| --- | --- | --- | --- | | ||
| `disabled` | Initial component's state. When set to `true`, users can't take action on the element. | Boolean | `true` | | ||
| `headerLabel` | The label of the record. It is used as a record `label` in case if the `label` option is not initialized. | String | `''` | |
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.
Does that mean that headerLabel
value is just a fallback for label
value? Are you sure that's the only purpose of this field?
Maybe it is, I'm just asking because having this flow looks a little bit weird.
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.
Hi @rogyar
Yes, it looks strange but it's how it works.
There are two places in the Magento where this option is used
https://github.com/magento/magento2/blob/2.2/app/code/Magento/Ui/view/base/web/js/dynamic-rows/record.js#L85 - here the headerLabel
option is replacing the label
option if the label
option is not configured.
https://github.com/magento/magento2/blob/2.2/app/code/Magento/Ui/view/base/web/js/dynamic-rows/record.js#L209 - here the headerLabel
option returns as a result of getLabel()
method in case if the label
argument is not a string (or label
option is not specified) or if the label
option is not configured.
@rogyar, please, let me know if I need to improve something here.
Thank you!
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.
Thank you for the clarification
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.
A few small editorial changes.
contributor_link: https://www.atwix.com/ | ||
--- | ||
|
||
The DynamicRowsRecord component is a container of record fields. The DynamicRowsRecord should be used as a child of [DynamicRows]({{ page.baseurl }}/ui_comp_guide/components/ui-dynamicrows.html) component. |
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.
The DynamicRowsRecord component is a container of record fields. The DynamicRowsRecord should be used as a child of [DynamicRows]({{ page.baseurl }}/ui_comp_guide/components/ui-dynamicrows.html) component. | |
The DynamicRowsRecord component is a container of record fields. The DynamicRowsRecord should be used as a child of the [DynamicRows]({{ page.baseurl }}/ui_comp_guide/components/ui-dynamicrows.html) component. |
|
||
| Option | Description | Type | Default | | ||
| --- | --- | --- | --- | | ||
| `disabled` | Initial component's state. When set to `true`, users can't take action on the element. | Boolean | `true` | |
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.
| `disabled` | Initial component's state. When set to `true`, users can't take action on the element. | Boolean | `true` | | |
| `disabled` | The initial state of the component. When set to `true`, users cannot take action on the element. | Boolean | `true` | |
| Option | Description | Type | Default | | ||
| --- | --- | --- | --- | | ||
| `disabled` | Initial component's state. When set to `true`, users can't take action on the element. | Boolean | `true` | | ||
| `headerLabel` | The label of the record. It is used as a record `label` in case if the `label` option is not initialized. | String | `''` | |
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.
| `headerLabel` | The label of the record. It is used as a record `label` in case if the `label` option is not initialized. | String | `''` | | |
| `headerLabel` | The label of the record. It is used as a record `label` when the `label` option is not initialized. | String | `''` | |
Also, if you haven't done so already please optimize the image by running |
@serhiyzhovnir Making sure you saw my review. |
Hi @keharper |
Hi @keharper |
running tests |
Hi @serhiyzhovnir, thank you for your contribution! |
Thanks @serhiyzhovnir |
Purpose of this pull request
This pull request (PR) adds the documentation for the DynamicRowsRecord UI component.
Affected DevDocs pages
Links to Magento source code
whatsnew
Added the documentation for the DynamicRowsRecord UI component to the UI Components Guide.