Skip to content

Media tracking prototype#6843

Merged
bergmania merged 13 commits intov8/feature/media-trackingfrom
v8/feature/AB2462-media-tracking
Oct 29, 2019
Merged

Media tracking prototype#6843
bergmania merged 13 commits intov8/feature/media-trackingfrom
v8/feature/AB2462-media-tracking

Conversation

@Shazwazza
Copy link
Copy Markdown
Contributor

@Shazwazza Shazwazza commented Oct 25, 2019

This is still part of a larger work in progress for media (and other entity) tracking.

Changes in this PR (work will continue in another branch):

  • New Relation Types including migrations
  • Changes to Relation Types - which now allow NULL values for child/parent entity types - these values are not actually used for anything. Well, they were but unecessarily, they were used to resolve the IEntity for an ID and the entity type which was silly since we can just get the entity type for the ID to look it up ... which we do now. The only API 'breaking changes' is that the Guid is now Guid? for parent/child object types on IRelationType and the RelationType ctor has been updated to be useful, it was not really working before
  • IRelation now returns the actual parent/child object types
  • No need to keep allocating new RelationFactory, all mappings are just static
  • Content, media and member repositories now all auto-track relations based on the relations returned by property editors
  • Fixes the relation type angular editor, before it was hacking the planet to try to resolve the relations for that type since apparently the c# implementation was simply not finished. So it all works now without hacking things and it supports nullable child/parent object types
  • Some code has been moved around
  • A few TODO notes added which well need to review when we're further along with the prototype
  • Unit tests added

Testing

Only the RTE has been updated to return references right now, so you can have any content item with an RTE, add some images to it via the image picker and create some internal links to other documents, save it, then go see that relation type (Related Media and Related Documents) unders settings and click on the 'relations' app and it will show you the relations created. You can also remove/change those items in the RTE and those relations will be removed/updated.

…operty editors and relation service into the base content repositories
… returned reference but have discovered a gotcha for relations, so next step is to resolve that.
…ation to return the actual object types for the ID references, now relations can be more flexible without being strangely tied to specific object types based on the relation type.
Copy link
Copy Markdown
Member

@bergmania bergmania left a comment

Choose a reason for hiding this comment

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

Only added small comments

Comment thread src/Umbraco.Core/Migrations/Upgrade/V_8_5_0/AddNewRelationTypes.cs Outdated
private Guid? _childObjectType;

public RelationType(Guid childObjectType, Guid parentObjectType, string alias)
//TODO: Should we put back the broken ctors with obsolete attributes?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good question.. I think we need to have an overview of the total amount of breaking changes before we can decide..

Comment thread src/Umbraco.Core/Models/Relation.cs Outdated
Comment thread src/Umbraco.Core/Persistence/Dtos/RelationTypeDto.cs
ClearEntityTags(entity, _tagRepository);
}

PersistRelations(entity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm in doubt about whether this should be here or in a event.. Is this consistent with the rest of the code base?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should be using an event at all since we aren't doing that anywhere else with the repositories in the code base. I've decided to explicitly call this base method from each inherited repository just to make it explicit, however, we could easily add this to the base classes methods of PersistUpdatedItem and PersistNewItem to have this automatically taken care of. I just thought for now to make it explicit but we can change if we like.

Comment thread src/Umbraco.Core/Persistence/Repositories/Implement/RelationRepository.cs Outdated
Comment thread src/Umbraco.Core/PropertyEditors/DataEditor.cs Outdated
@bergmania
Copy link
Copy Markdown
Member

When I add a link to a media item, it is put under "Related documents". I would expect it as related media.

image

Comment thread src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs Outdated
@bergmania bergmania merged commit df1f0bd into v8/feature/media-tracking Oct 29, 2019
@bergmania bergmania deleted the v8/feature/AB2462-media-tracking branch October 29, 2019 09:32
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