Browse Source

Merge pull request #6219 from abpframework/extra-property-autocomplete-text-field

Text Field Has Been Added To The Lookup Property
pull/6292/head
Halil İbrahim Kalkan 6 years ago
committed by GitHub
parent
commit
deaa5870c9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelper.cs
  2. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs
  3. 15
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js
  4. 3
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs
  5. 18
      framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/EntityExtensionConfiguration.cs
  6. 37
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/CreateModal.cshtml
  7. 37
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/EditModal.cshtml
  8. 37
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml
  9. 37
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml
  10. 37
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml
  11. 37
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/EditModal.cshtml

4
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelper.cs

@ -31,6 +31,10 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
public string AutocompleteFilterParamName { get; set; } public string AutocompleteFilterParamName { get; set; }
public string AutocompleteSelectedItemName { get; set; }
public string AutocompleteSelectedItemValue { get; set; }
public AbpSelectTagHelper(AbpSelectTagHelperService tagHelperService) public AbpSelectTagHelper(AbpSelectTagHelperService tagHelperService)
: base(tagHelperService) : base(tagHelperService)
{ {

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.Diagnostics;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.TagHelpers; using Microsoft.AspNetCore.Mvc.TagHelpers;
using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.AspNetCore.Razor.TagHelpers;
@ -85,6 +86,13 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
{ {
selectTagHelper.Items = GetSelectItems(context, output); selectTagHelper.Items = GetSelectItems(context, output);
} }
else
{
selectTagHelper.Items = new SelectListItem[]
{
new SelectListItem(TagHelper.AutocompleteSelectedItemName,TagHelper.AutocompleteSelectedItemValue,true)
};
}
var selectTagHelperOutput = await selectTagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag); var selectTagHelperOutput = await selectTagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag);
@ -107,6 +115,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
output.Attributes.Add("data-autocomplete-display-property", TagHelper.AutocompleteDisplayPropertyName); output.Attributes.Add("data-autocomplete-display-property", TagHelper.AutocompleteDisplayPropertyName);
output.Attributes.Add("data-autocomplete-value-property", TagHelper.AutocompleteValuePropertyName); output.Attributes.Add("data-autocomplete-value-property", TagHelper.AutocompleteValuePropertyName);
output.Attributes.Add("data-autocomplete-filter-param-name", TagHelper.AutocompleteFilterParamName); output.Attributes.Add("data-autocomplete-filter-param-name", TagHelper.AutocompleteFilterParamName);
output.Attributes.Add("data-autocomplete-selected-item-name", TagHelper.AutocompleteSelectedItemName);
output.Attributes.Add("data-autocomplete-selected-item-value", TagHelper.AutocompleteSelectedItemValue);
} }
} }

15
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js

@ -80,6 +80,18 @@
var displayValue = $(this).data("autocompleteValueProperty"); var displayValue = $(this).data("autocompleteValueProperty");
var itemsPropertyName = $(this).data("autocompleteItemsProperty"); var itemsPropertyName = $(this).data("autocompleteItemsProperty");
var filterParamName = $(this).data("autocompleteFilterParamName"); var filterParamName = $(this).data("autocompleteFilterParamName");
var selectedText = $(this).data("autocompleteSelectedItemName");
var name = $(this).attr("name");
var selectedTextInputName = name.substring(0, name.length - 1) + "_Text]";
var selectedTextInput = $('<input>', {
type: 'hidden',
id: selectedTextInputName,
name: selectedTextInputName,
});
if (selectedText != "") {
selectedTextInput.val(selectedText);
}
selectedTextInput.insertAfter($select);
$select.select2({ $select.select2({
ajax: { ajax: {
url: url, url: url,
@ -109,6 +121,9 @@
}, },
width: '100%' width: '100%'
}); });
$select.on('select2:select', function (e) {
selectedTextInput.val(e.params.data.text);
});
}); });
} }
} }

3
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs

@ -140,8 +140,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending
}, },
OnTable = new ExtensionPropertyUiTableDto OnTable = new ExtensionPropertyUiTableDto
{ {
IsVisible = propertyConfig.UI.OnTable.IsVisible && IsVisible = propertyConfig.UI.OnTable.IsVisible
propertyConfig.UI.Lookup.Url.IsNullOrEmpty()
}, },
Lookup = new ExtensionPropertyUiLookupDto Lookup = new ExtensionPropertyUiLookupDto
{ {

18
framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/EntityExtensionConfiguration.cs

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
using JetBrains.Annotations; using JetBrains.Annotations;
using Volo.Abp.Localization;
namespace Volo.Abp.ObjectExtending.Modularity namespace Volo.Abp.ObjectExtending.Modularity
{ {
@ -47,14 +48,29 @@ namespace Volo.Abp.ObjectExtending.Modularity
propertyName, propertyName,
() => new ExtensionPropertyConfiguration(this, propertyType, propertyName) () => new ExtensionPropertyConfiguration(this, propertyType, propertyName)
); );
configureAction?.Invoke(propertyInfo); configureAction?.Invoke(propertyInfo);
NormalizeProperty(propertyInfo); NormalizeProperty(propertyInfo);
if (!propertyInfo.UI.Lookup.Url.IsNullOrEmpty())
{
AddLookupTextProperty(propertyInfo);
propertyInfo.UI.OnTable.IsVisible = false;
propertyInfo.Api.OnGet.IsAvailable = false;
}
return this; return this;
} }
private void AddLookupTextProperty(ExtensionPropertyConfiguration propertyInfo)
{
var lookupTextPropertyName = $"{propertyInfo.Name}_Text";
var lookupTextPropertyInfo = Properties.GetOrAdd(
lookupTextPropertyName,
() => new ExtensionPropertyConfiguration(this, typeof(string), lookupTextPropertyName)
);
lookupTextPropertyInfo.DisplayName = propertyInfo.DisplayName ?? new FixedLocalizableString(propertyInfo.Name);
}
[NotNull] [NotNull]
public virtual ImmutableList<ExtensionPropertyConfiguration> GetProperties() public virtual ImmutableList<ExtensionPropertyConfiguration> GetProperties()
{ {

37
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/CreateModal.cshtml

@ -24,23 +24,28 @@
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.RoleInfoModel>()) @foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.RoleInfoModel>())
{ {
if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty()) if (!propertyInfo.Name.EndsWith("_Text"))
{ {
<abp-select asp-for="Role.ExtraProperties[propertyInfo.Name]" if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" {
autocomplete-api-url="@propertyInfo.Lookup.Url" <abp-select asp-for="Role.ExtraProperties[propertyInfo.Name]"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-selected-item-name="@Model.Role.ExtraProperties[propertyInfo.Name+"_Text"]"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-selected-item-value="@Model.Role.ExtraProperties[propertyInfo.Name]"
} autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
else autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
{ autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
<abp-input type="@propertyInfo.GetInputType()" autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>
asp-for="Role.ExtraProperties[propertyInfo.Name]" }
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" else
asp-format="@propertyInfo.GetInputFormatOrNull()" {
value="@propertyInfo.GetInputValueOrNull(Model.Role.ExtraProperties[propertyInfo.Name])" /> <abp-input type="@propertyInfo.GetInputType()"
asp-for="Role.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.Role.ExtraProperties[propertyInfo.Name])" />
}
} }
} }
</abp-modal-body> </abp-modal-body>

37
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/EditModal.cshtml

@ -35,23 +35,28 @@
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.RoleInfoModel>()) @foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.RoleInfoModel>())
{ {
if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty()) if (!propertyInfo.Name.EndsWith("_Text"))
{ {
<abp-select asp-for="Role.ExtraProperties[propertyInfo.Name]" if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" {
autocomplete-api-url="@propertyInfo.Lookup.Url" <abp-select asp-for="Role.ExtraProperties[propertyInfo.Name]"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-selected-item-name="@Model.Role.ExtraProperties[propertyInfo.Name+"_Text"]"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-selected-item-value="@Model.Role.ExtraProperties[propertyInfo.Name]"
} autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
else autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
{ autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
<abp-input type="@propertyInfo.GetInputType()" autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>
asp-for="Role.ExtraProperties[propertyInfo.Name]" }
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" else
asp-format="@propertyInfo.GetInputFormatOrNull()" {
value="@propertyInfo.GetInputValueOrNull(Model.Role.ExtraProperties[propertyInfo.Name])" /> <abp-input type="@propertyInfo.GetInputType()"
asp-for="Role.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.Role.ExtraProperties[propertyInfo.Name])" />
}
} }
} }
</abp-modal-body> </abp-modal-body>

37
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml

@ -29,23 +29,28 @@
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.UserInfoViewModel>()) @foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.UserInfoViewModel>())
{ {
if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty()) if (!propertyInfo.Name.EndsWith("_Text"))
{ {
<abp-select asp-for="UserInfo.ExtraProperties[propertyInfo.Name]" if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" {
autocomplete-api-url="@propertyInfo.Lookup.Url" <abp-select asp-for="UserInfo.ExtraProperties[propertyInfo.Name]"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-selected-item-name="@Model.UserInfo.ExtraProperties[propertyInfo.Name+"_Text"]"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-selected-item-value="@Model.UserInfo.ExtraProperties[propertyInfo.Name]"
} autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
else autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
{ autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
<abp-input type="@propertyInfo.GetInputType()" autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>
asp-for="UserInfo.ExtraProperties[propertyInfo.Name]" }
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" else
asp-format="@propertyInfo.GetInputFormatOrNull()" {
value="@propertyInfo.GetInputValueOrNull(Model.UserInfo.ExtraProperties[propertyInfo.Name])" /> <abp-input type="@propertyInfo.GetInputType()"
asp-for="UserInfo.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.UserInfo.ExtraProperties[propertyInfo.Name])" />
}
} }
} }
</abp-tab> </abp-tab>

37
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml

@ -31,23 +31,28 @@
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<EditModalModel.UserInfoViewModel>()) @foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<EditModalModel.UserInfoViewModel>())
{ {
if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty()) if (!propertyInfo.Name.EndsWith("_Text"))
{ {
<abp-select asp-for="UserInfo.ExtraProperties[propertyInfo.Name]" if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" {
autocomplete-api-url="@propertyInfo.Lookup.Url" <abp-select asp-for="UserInfo.ExtraProperties[propertyInfo.Name]"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-selected-item-name="@Model.UserInfo.ExtraProperties[propertyInfo.Name+"_Text"]"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-selected-item-value="@Model.UserInfo.ExtraProperties[propertyInfo.Name]"
} autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
else autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
{ autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
<abp-input type="@propertyInfo.GetInputType()" autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>
asp-for="UserInfo.ExtraProperties[propertyInfo.Name]" }
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" else
asp-format="@propertyInfo.GetInputFormatOrNull()" {
value="@propertyInfo.GetInputValueOrNull(Model.UserInfo.ExtraProperties[propertyInfo.Name])" /> <abp-input type="@propertyInfo.GetInputType()"
asp-for="UserInfo.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.UserInfo.ExtraProperties[propertyInfo.Name])" />
}
} }
} }

37
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml

@ -24,23 +24,28 @@
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.TenantInfoModel>()) @foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.TenantInfoModel>())
{ {
if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty()) if (!propertyInfo.Name.EndsWith("_Text"))
{ {
<abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]" if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" {
autocomplete-api-url="@propertyInfo.Lookup.Url" <abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-selected-item-name="@Model.Tenant.ExtraProperties[propertyInfo.Name+"_Text"]"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-selected-item-value="@Model.Tenant.ExtraProperties[propertyInfo.Name]"
} autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
else autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
{ autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
<abp-input type="@propertyInfo.GetInputType()" autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>
asp-for="Tenant.ExtraProperties[propertyInfo.Name]" }
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" else
asp-format="@propertyInfo.GetInputFormatOrNull()" {
value="@propertyInfo.GetInputValueOrNull(Model.Tenant.ExtraProperties[propertyInfo.Name])" /> <abp-input type="@propertyInfo.GetInputType()"
asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.Tenant.ExtraProperties[propertyInfo.Name])" />
}
} }
} }
</abp-modal-body> </abp-modal-body>

37
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/EditModal.cshtml

@ -20,23 +20,28 @@
<abp-input asp-for="Tenant.Name" label="@L["TenantName"].Value" /> <abp-input asp-for="Tenant.Name" label="@L["TenantName"].Value" />
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<EditModalModel.TenantInfoModel>()) @foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<EditModalModel.TenantInfoModel>())
{ {
if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty()) if (!propertyInfo.Name.EndsWith("_Text"))
{ {
<abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]" if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" {
autocomplete-api-url="@propertyInfo.Lookup.Url" <abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-selected-item-name="@Model.Tenant.ExtraProperties[propertyInfo.Name+"_Text"]"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-selected-item-value="@Model.Tenant.ExtraProperties[propertyInfo.Name]"
} autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
else autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
{ autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
<abp-input type="@propertyInfo.GetInputType()" autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>
asp-for="Tenant.ExtraProperties[propertyInfo.Name]" }
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" else
asp-format="@propertyInfo.GetInputFormatOrNull()" {
value="@propertyInfo.GetInputValueOrNull(Model.Tenant.ExtraProperties[propertyInfo.Name])" /> <abp-input type="@propertyInfo.GetInputType()"
asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.Tenant.ExtraProperties[propertyInfo.Name])" />
}
} }
} }
</abp-modal-body> </abp-modal-body>

Loading…
Cancel
Save