FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: add section about `slotOptions` in README by adamstankiewicz · Pull Request #88 · openedx/frontend-plugin-framework · GitHub

docs: add section about slotOptions in README - #88

Open
adamstankiewicz wants to merge 1 commit into
openedx:masterfrom
adamstankiewicz:patch-1
Open

adamstankiewicz wants to merge 1 commit into
openedx:masterfrom
adamstankiewicz:patch-1

Conversation

adamstankiewicz commented Sep 12, 2024
edited
Loading

Copy link
Copy Markdown
Member

In the README, documents the slotOptions.mergeProps option to change the behavior of PluginSlot components to merge custom attributes with existing props on widgets.

Preview

Also updates existing code blocks to use javascript syntax highlighting.

codecov Bot commented Sep 12, 2024
edited
Loading

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.80%. Comparing base (f34f4df) to head (1ccfd07).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #88   +/-   ##
=======================================
  Coverage   97.80%   97.80%           
=======================================
  Files          10       10           
  Lines         228      228           
  Branches       58       58           
=======================================
  Hits          223      223           
  Misses          4        4           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Documents the `slotOptions.mergeProps` option to change the behavior of `PluginSlot` components to merge custom attributes with existing props on widgets.

brian-smith-tcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It's awesome to see more documentation like this! One little comment.

Comment thread README.rst
Comment on lines +300 to +303
``mergeProps``
''''''''''''''

When enabled, this option will merge custom/overridden attributes with existing props passed to the widget, as opposed to passing these attributes to the widget via a ``content`` prop. This is especially useful when using a ``PluginSlot`` to support any custom attributes as well as handle special cases such as merging of custom class names with existing class names.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It might be nice to have a short description of the default (mergeProps: false) behavior here. I could see someone reading this and thinking, "as opposed to what?"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is alluded to in the above "..., as opposed to passing these attributes to the widget via a content prop.". I suppose this could be more clearly communicated, though 👀

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL