-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Mobile] Use link picker in Image block #27292
Merged
Merged
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c7cf587
Use LinkSettingsNavigation in Image block
mkevins 763848c
Revert mapping url attribute in link settings
mkevins a33ccd8
Map url -> href attribute for link picker in image block
mkevins 32361ef
Don't overwrite mapped attribute when undefined
mkevins 13828c4
Fix lint
mkevins 7637a1d
Merge branch 'master' into rnmobile/try/image-block-link-picker
mkevins cd94a5e
Conditionally render link options in link settings
mkevins 419cef4
Move link settings panel in image block settings
mkevins cd662f2
Auto-hide "Open in new tab" in rich text link settings
mkevins 2637e02
Merge branch 'master' into rnmobile/try/image-block-link-picker
mkevins 281d46f
Merge branch 'master' into rnmobile/try/image-block-link-picker
mkevins 99d8724
Merge branch 'master' into rnmobile/try/image-block-link-picker
mkevins f40b256
Revert "Update tt1 blocks references. (#27770)"
mkevins aaa54c0
Revert "Revert "Update tt1 blocks references. (#27770)""
mkevins 4ea04ca
Fix assertion count in multi-entity-saving test
mkevins 3038887
Merge branch 'master' into rnmobile/try/image-block-link-picker
mkevins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 link settings sets the attribute named
url
, but Image block'surl
attribute is the URL of the image itself, and instead uses the attribute namedhref
to represent the link URL.Originally, to work around this, I used dynamic properties in
LinkSettings
to allow the consumer to customize the attribute name to be set.Here, I reverted those changes to
LinkSettings
, and instead map the attibutes inImageEdit
. As the link picker is used in more places, it might make sense to re-evaluate this pattern, depending on the commonality of the possible attribute names (e.g.url
,href
). WDYT?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 like the dynamic properties approach. It seems fairly clean. The code ^ is a bit harder for me to understand. But I think this could be done as part of a larger refactor.
One thing that I noticed is that we always seem to set the options such as labels etc.
I think we could really benefit from having a default name for labels. so that we only pass in the options that are different from the default.
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.
Exactly my thoughts! I think we can refactor during the iteration for further consolidation described here. I think with the refactor we should have the opportunity to both reduce the surface area of the interface, and also make the components appropriately general (in particular, decoupled from particular attribute names and even
setAttributes
).