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

Fix Content Drivers #15680

Merged
merged 1 commit into from
Apr 7, 2024
Merged

Fix Content Drivers #15680

merged 1 commit into from
Apr 7, 2024

Conversation

MikeAlhayek
Copy link
Member

Fix #15674

@MikeAlhayek MikeAlhayek merged commit d036104 into main Apr 7, 2024
5 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/fix-content-shapes branch April 7, 2024 23:48
Shape("ContentsTags_SummaryAdmin", contentItemViewModel).Location("SummaryAdmin", "Tags:10"),
Shape("ContentsMeta_SummaryAdmin", contentItemViewModel).Location("SummaryAdmin", "Meta:20"),
Shape("ContentsTags_SummaryAdmin", new ContentItemViewModel(contentItem)).Location("SummaryAdmin", "Tags:10"),
Shape("ContentsMeta_SummaryAdmin", new ContentItemViewModel(contentItem)).Location("SummaryAdmin", "Meta:20"),
Copy link
Member

Choose a reason for hiding this comment

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

Why you need to new up ContentItemViewModel in each call?!!

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not positive on this response. But, I believe because the VM here is a shape but rendered using a different type. For it to work correctly, each shape should be a new instance as it'll have to be built and rendered separately.

The PR #15652 caused the issue which created a single VM instead of having multiple

Copy link
Member

Choose a reason for hiding this comment

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

Seems weird

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. It's worth trying to pass a model instead of a shape to all these views. In other words, do not let ContentItemViewModel inherit from ShapeViewModel, create a single instance and pass it to all these views. This may work, but could break someone. Anyway, if it works it should reduce allocations. Feel free to try it. Otherwise, I may try it when I have time. Meanwhile this PR fixes the referenced problem while we can entertain other ways to improve.

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.

Content items actions placement in admin
2 participants