CMS Kit: Add commenting widget as content widget#24110
Merged
Conversation
Updated addWidgetModal.js to exclude properties with default or empty values when generating widgetText. This prevents unnecessary attributes from being added to the widget markup.
enisn
approved these changes
Nov 5, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for conditional widget registration based on global features and introduces a new comment configuration widget with read-only support.
- Adds
AddWidgetIfFeatureEnabledmethod to register widgets conditionally based on global features - Introduces a new comment configuration widget (
CmsKitCommentConfiguration) with read-only mode support - Updates JavaScript logic to skip empty/default widget parameter values
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| en.json | Adds localization for the "IsReadOnly" field |
| CmsKitContentWidgetOptions.cs | Adds new method to conditionally register widgets based on global features |
| CmsKitCommentConfigurationViewModel.cs | New view model for comment configuration with EntityType, EntityId, and IsReadOnly properties |
| CmsKitCommentConfigurationViewComponent.cs | New view component for rendering comment configuration UI |
| CmsKitCommentConfiguration.cshtml | New view for comment configuration with input fields |
| CmsKitCommonWebModule.cs | Registers the comment widget using the new conditional registration method |
| addWidgetModal.js | Enhances widget text generation to skip empty/default parameter values |
| dynamic-widget.md | Updates documentation with details about the new conditional registration method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...it/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/CmsKitContentWidgetOptions.cs
Outdated
Show resolved
Hide resolved
...it/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/CmsKitContentWidgetOptions.cs
Outdated
Show resolved
Hide resolved
...lo.CmsKit.Common.Web/Pages/CmsKit/Components/Comments/CmsKitCommentConfigurationViewModel.cs
Outdated
Show resolved
Hide resolved
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/addWidgetModal.js
Outdated
Show resolved
Hide resolved
…ntry to the all languages
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
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.
Description
Related to https://github.com/volosoft/volo/issues/20587 (@enisn also created a PR for the pro side in our repository, you can review these 2 PR from there, if you want)
Checklist