Browse Source
Merge pull request #13406 from abpframework/editor-parameters-optional
made `editorWidgetName` is optional
pull/13407/head
Enis Necipoglu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
18 additions and
16 deletions
-
modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs
-
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/AddWidgetModal.cshtml
-
modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Contents/CmsKitContentWidgetOptions.cs
|
|
@ -156,7 +156,7 @@ public class CmsKitWebUnifiedModule : AbpModule |
|
|
|
|
|
|
|
|
Configure<CmsKitContentWidgetOptions>(options => |
|
|
Configure<CmsKitContentWidgetOptions>(options => |
|
|
{ |
|
|
{ |
|
|
options.AddWidget("ExComment", "CommentDate", "DecisionCommentDate"); |
|
|
options.AddWidget("ExComment", "CommentDate"); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -20,23 +20,25 @@ |
|
|
<abp-modal-body> |
|
|
<abp-modal-body> |
|
|
<div class="container"> |
|
|
<div class="container"> |
|
|
@if (Model.Widgets.Count() > 1) |
|
|
@if (Model.Widgets.Count() > 1) |
|
|
{ |
|
|
{ |
|
|
|
|
|
<abp-select asp-for="ViewModel.Widget" /> |
|
|
<abp-select asp-for="ViewModel.Widget" /> |
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in Model.ViewModel.Details) |
|
|
foreach (var item in Model.ViewModel.Details) |
|
|
|
|
|
{ |
|
|
|
|
|
if (item.EditorComponentName is not null) |
|
|
|
|
|
{ |
|
|
|
|
|
<div hidden id="editor-@item.Name"> |
|
|
|
|
|
<form data-check-form-on-close="false"> |
|
|
|
|
|
@await Component.InvokeAsync(@item.EditorComponentName) |
|
|
|
|
|
</form> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
{ |
|
|
{ |
|
|
<div hidden id="editor-@item.Name"> |
|
|
<p>@L["PleaseConfigureWidgets"].Value</p> |
|
|
<form data-check-form-on-close="false"> |
|
|
|
|
|
@await Component.InvokeAsync(@item.EditorComponentName) |
|
|
|
|
|
</form> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
<p>@L["PleaseConfigureWidgets"].Value</p> |
|
|
|
|
|
} |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</abp-modal-body> |
|
|
</abp-modal-body> |
|
|
<abp-modal-footer> |
|
|
<abp-modal-footer> |
|
|
|
|
|
@ -11,7 +11,7 @@ public class CmsKitContentWidgetOptions |
|
|
WidgetConfigs = new(); |
|
|
WidgetConfigs = new(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void AddWidget(string widgetKey, string widgetName, string editorWidgetName) |
|
|
public void AddWidget(string widgetKey, string widgetName, string editorWidgetName = null) |
|
|
{ |
|
|
{ |
|
|
var config = new ContentWidgetConfig(widgetName, editorWidgetName); |
|
|
var config = new ContentWidgetConfig(widgetName, editorWidgetName); |
|
|
WidgetConfigs.Add(widgetKey, config); |
|
|
WidgetConfigs.Add(widgetKey, config); |
|
|
|