Browse Source

add filterparam name to property config.

pull/6167/head
Ilkay Ilknur 6 years ago
parent
commit
36aca102a1
  1. 1
      framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ExtensionPropertyUiLookupDto.cs
  2. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelper.cs
  3. 1
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs
  4. 8
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js
  5. 3
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs
  6. 5
      framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/ExtensionPropertyLookupConfiguration.cs
  7. 1
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/CreateModal.cshtml
  8. 1
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/EditModal.cshtml
  9. 1
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml
  10. 1
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml
  11. 1
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml
  12. 1
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/EditModal.cshtml

1
framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/ExtensionPropertyUiLookupDto.cs

@ -9,5 +9,6 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending
public string ResultListPropertyName { get; set; } public string ResultListPropertyName { get; set; }
public string DisplayPropertyName { get; set; } public string DisplayPropertyName { get; set; }
public string ValuePropertyName { get; set; } public string ValuePropertyName { get; set; }
public string FilterParamName { get; set; }
} }
} }

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

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

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

@ -106,6 +106,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
output.Attributes.Add("data-autocomplete-items-property", TagHelper.AutocompleteItemsPropertyName); output.Attributes.Add("data-autocomplete-items-property", TagHelper.AutocompleteItemsPropertyName);
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);
} }
} }

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

@ -79,14 +79,14 @@
var displayName = $(this).data("autocompleteDisplayProperty"); var displayName = $(this).data("autocompleteDisplayProperty");
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");
$select.select2({ $select.select2({
ajax: { ajax: {
url: url, url: url,
dataType: "json", dataType: "json",
data: function (params) { data: function (params) {
var query = { var query = {};
search: params.term query[filterParamName] = params.term;
};
return query; return query;
}, },
processResults: function (data) { processResults: function (data) {
@ -95,7 +95,7 @@
if (itemsPropertyName) { if (itemsPropertyName) {
items = data[itemsPropertyName]; items = data[itemsPropertyName];
} }
items.forEach(function (item, index) { items.forEach(function (item, index) {
retVal.push({ retVal.push({
id: item[displayValue], id: item[displayValue],

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

@ -148,7 +148,8 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending
Url = propertyConfig.UI.Lookup.Url, Url = propertyConfig.UI.Lookup.Url,
ResultListPropertyName = propertyConfig.UI.Lookup.ResultListPropertyName, ResultListPropertyName = propertyConfig.UI.Lookup.ResultListPropertyName,
DisplayPropertyName = propertyConfig.UI.Lookup.DisplayPropertyName, DisplayPropertyName = propertyConfig.UI.Lookup.DisplayPropertyName,
ValuePropertyName = propertyConfig.UI.Lookup.ValuePropertyName ValuePropertyName = propertyConfig.UI.Lookup.ValuePropertyName,
FilterParamName = propertyConfig.UI.Lookup.FilterParamName
} }
} }
}; };

5
framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/ExtensionPropertyLookupConfiguration.cs

@ -1,4 +1,6 @@
namespace Volo.Abp.ObjectExtending.Modularity using Microsoft.Extensions.Logging;
namespace Volo.Abp.ObjectExtending.Modularity
{ {
public class ExtensionPropertyLookupConfiguration public class ExtensionPropertyLookupConfiguration
{ {
@ -6,5 +8,6 @@
public string ResultListPropertyName { get; set; } = "items"; public string ResultListPropertyName { get; set; } = "items";
public string DisplayPropertyName { get; set; } = "text"; public string DisplayPropertyName { get; set; } = "text";
public string ValuePropertyName { get; set; } = "id"; public string ValuePropertyName { get; set; } = "id";
public string FilterParamName { get; set; } = "filter";
} }
} }

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

@ -29,6 +29,7 @@
<abp-select asp-for="Role.ExtraProperties[propertyInfo.Name]" <abp-select asp-for="Role.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-api-url="@propertyInfo.Lookup.Url" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>

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

@ -40,6 +40,7 @@
<abp-select asp-for="Role.ExtraProperties[propertyInfo.Name]" <abp-select asp-for="Role.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-api-url="@propertyInfo.Lookup.Url" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>

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

@ -34,6 +34,7 @@
<abp-select asp-for="UserInfo.ExtraProperties[propertyInfo.Name]" <abp-select asp-for="UserInfo.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-api-url="@propertyInfo.Lookup.Url" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>

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

@ -36,6 +36,7 @@
<abp-select asp-for="UserInfo.ExtraProperties[propertyInfo.Name]" <abp-select asp-for="UserInfo.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-api-url="@propertyInfo.Lookup.Url" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>

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

@ -29,6 +29,7 @@
<abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]" <abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-api-url="@propertyInfo.Lookup.Url" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>

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

@ -25,6 +25,7 @@
<abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]" <abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-api-url="@propertyInfo.Lookup.Url" autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName" autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName" autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select> autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName"></abp-select>

Loading…
Cancel
Save