Skip to content
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

Gutenberg entity usage improvements #1389

Merged
merged 4 commits into from
Aug 7, 2023

Conversation

chindris
Copy link
Contributor

@chindris chindris commented Jul 3, 2023

Package(s) involved

silverback_gutenberg

Description of changes

Adds two entity usage plugins:

  • one that tracks the linked content (coming from html link tags)
  • one that tracks the referenced content from arbitrary gutenberg blocks, which have a uuid, and optionally an entityType, attribute. For example, if the project defines a custom/link-item block which has a gutenberg link control and stores the uuid and the entity type into the uuid and entityType attributes, them the plugin is able to track the usage of that content.

Related Issue(s)

#1382

How has this been tested?

  • Kernel tests
  • Unit tests

@chindris chindris requested review from pmelab and Leksat July 3, 2023 13:00
Copy link
Member

@Leksat Leksat left a comment

Choose a reason for hiding this comment

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

Tested on silverback-template. Works great! But only for nodes.

For media we need to investigate more. This is what I saw in the database when tried to link a node and a media:

<!-- wp:paragraph -->
<p>a link to <a href="/node/6c0ac38d-ab7d-452d-b4d2-a98814fde715" data-type="Content: Basic page" data-id="6c0ac38d-ab7d-452d-b4d2-a98814fde715" data-entity-type="node">page</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>a link to <a href="/media/5" data-type="Media: Document" data-id="0d00d8a2-65eb-4496-8e36-294e18b044ec">media</a></p>
<!-- /wp:paragraph -->

For media:

  • href is not transformed to uuid - can cause issues with content export
  • data-entity-type is missing - probably that's why it's not tracked

Could you take a look at the media? Maybe it's easy to fix. Or let's merge this one and create follow-ups for media.

@chindris
Copy link
Contributor Author

Hi @Leksat !

I fixed the media issue with the last commit: 52b1a5c (when you test on silverback-template, make sure to just resave the Media matcher config, from the Linkit profile).

Copy link
Member

@Leksat Leksat left a comment

Choose a reason for hiding this comment

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

@chindris I won't test it manually this time. The changes look good! Let's merge and enable it in the template?

@chindris chindris merged commit 5baf2da into development Aug 7, 2023
4 checks passed
@chindris chindris deleted the gutenberg_entity_usage_improvements branch August 7, 2023 12:35
@chindris
Copy link
Contributor Author

chindris commented Aug 7, 2023

Hi @Leksat !
PR merged, this can be tested now in the template.

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.

None yet

2 participants