Browse Source

lookup property fix.

pull/6573/head
Ilkay Ilknur 6 years ago
parent
commit
3ad30f972b
  1. 11
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpSelectTagHelperService.cs
  2. 1
      framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/EntityExtensionConfiguration.cs
  3. 8
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/CreateModal.cshtml
  4. 7
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/EditModal.cshtml
  5. 8
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml
  6. 10
      modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml
  7. 7
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml
  8. 7
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/EditModal.cshtml

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

@ -86,12 +86,13 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
{ {
selectTagHelper.Items = GetSelectItems(context, output); selectTagHelper.Items = GetSelectItems(context, output);
} }
else else if(!TagHelper.AutocompleteSelectedItemName.IsNullOrEmpty())
{ {
selectTagHelper.Items = new SelectListItem[] selectTagHelper.Items = new[]
{ {
new SelectListItem(TagHelper.AutocompleteSelectedItemName,TagHelper.AutocompleteSelectedItemValue,true) new SelectListItem(TagHelper.AutocompleteSelectedItemName,
}; TagHelper.AutocompleteSelectedItemValue, false)
};
} }
var selectTagHelperOutput = await selectTagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag); var selectTagHelperOutput = await selectTagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag);

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

@ -56,7 +56,6 @@ namespace Volo.Abp.ObjectExtending.Modularity
{ {
AddLookupTextProperty(propertyInfo); AddLookupTextProperty(propertyInfo);
propertyInfo.UI.OnTable.IsVisible = false; propertyInfo.UI.OnTable.IsVisible = false;
propertyInfo.Api.OnGet.IsAvailable = false;
} }
return this; return this;
} }

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

@ -1,11 +1,13 @@
@page @page
@using Microsoft.AspNetCore.Mvc.Localization @using Microsoft.AspNetCore.Mvc.Localization
@using Microsoft.Extensions.Localization @using Microsoft.Extensions.Localization
@using Microsoft.Extensions.Logging
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Abp.Identity.Localization @using Volo.Abp.Identity.Localization
@using Volo.Abp.Identity.Web.Pages.Identity.Roles @using Volo.Abp.Identity.Web.Pages.Identity.Roles
@using Volo.Abp.Localization @using Volo.Abp.Localization
@using Volo.Abp.ObjectExtending @using Volo.Abp.ObjectExtending
@using Volo.Abp.Data
@model CreateModalModel @model CreateModalModel
@inject IHtmlLocalizer<IdentityResource> L @inject IHtmlLocalizer<IdentityResource> L
@inject IStringLocalizerFactory StringLocalizerFactory @inject IStringLocalizerFactory StringLocalizerFactory
@ -31,8 +33,8 @@
<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-selected-item-name="@Model.Role.ExtraProperties[propertyInfo.Name+"_Text"]" autocomplete-selected-item-name="@Model.Role.GetProperty(propertyInfo.Name+"_Text")"
autocomplete-selected-item-value="@Model.Role.ExtraProperties[propertyInfo.Name]" autocomplete-selected-item-value="@Model.Role.GetProperty(propertyInfo.Name)"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" 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"
@ -44,7 +46,7 @@
asp-for="Role.ExtraProperties[propertyInfo.Name]" asp-for="Role.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()" asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.Role.ExtraProperties[propertyInfo.Name])" /> value="@Model.Role.GetProperty(propertyInfo.Name)" />
} }
} }
} }

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

@ -6,6 +6,7 @@
@using Volo.Abp.Identity.Web.Pages.Identity.Roles @using Volo.Abp.Identity.Web.Pages.Identity.Roles
@using Volo.Abp.Localization @using Volo.Abp.Localization
@using Volo.Abp.ObjectExtending @using Volo.Abp.ObjectExtending
@using Volo.Abp.Data
@model EditModalModel @model EditModalModel
@inject IHtmlLocalizer<IdentityResource> L @inject IHtmlLocalizer<IdentityResource> L
@inject IStringLocalizerFactory StringLocalizerFactory @inject IStringLocalizerFactory StringLocalizerFactory
@ -42,8 +43,8 @@
<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-selected-item-name="@Model.Role.ExtraProperties[propertyInfo.Name+"_Text"]" autocomplete-selected-item-name="@Model.Role.GetProperty(propertyInfo.Name+"_Text")"
autocomplete-selected-item-value="@Model.Role.ExtraProperties[propertyInfo.Name]" autocomplete-selected-item-value="@Model.Role.GetProperty(propertyInfo.Name)"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" 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"
@ -55,7 +56,7 @@
asp-for="Role.ExtraProperties[propertyInfo.Name]" asp-for="Role.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()" asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.Role.ExtraProperties[propertyInfo.Name])" /> value="@Model.Role.GetProperty(propertyInfo.Name)" />
} }
} }
} }

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

@ -6,9 +6,11 @@
@using Volo.Abp.Identity.Web.Pages.Identity.Users @using Volo.Abp.Identity.Web.Pages.Identity.Users
@using Volo.Abp.Localization @using Volo.Abp.Localization
@using Volo.Abp.ObjectExtending @using Volo.Abp.ObjectExtending
@using Volo.Abp.Data
@model CreateModalModel @model CreateModalModel
@inject IHtmlLocalizer<IdentityResource> L @inject IHtmlLocalizer<IdentityResource> L
@inject IStringLocalizerFactory StringLocalizerFactory @inject IStringLocalizerFactory StringLocalizerFactory
@{ @{
Layout = null; Layout = null;
} }
@ -36,8 +38,8 @@
<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-selected-item-name="@Model.UserInfo.ExtraProperties[propertyInfo.Name+"_Text"]" autocomplete-selected-item-name="@Model.UserInfo.GetProperty(propertyInfo.Name+"_Text")"
autocomplete-selected-item-value="@Model.UserInfo.ExtraProperties[propertyInfo.Name]" autocomplete-selected-item-value="@Model.UserInfo.GetProperty(propertyInfo.Name)"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" 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"
@ -49,7 +51,7 @@
asp-for="UserInfo.ExtraProperties[propertyInfo.Name]" asp-for="UserInfo.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()" asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.UserInfo.ExtraProperties[propertyInfo.Name])" /> value="@Model.UserInfo.GetProperty(propertyInfo.Name)" />
} }
} }
} }

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

@ -6,6 +6,7 @@
@using Volo.Abp.Identity.Web.Pages.Identity.Users @using Volo.Abp.Identity.Web.Pages.Identity.Users
@using Volo.Abp.Localization @using Volo.Abp.Localization
@using Volo.Abp.ObjectExtending @using Volo.Abp.ObjectExtending
@using Volo.Abp.Data
@model EditModalModel @model EditModalModel
@inject IHtmlLocalizer<IdentityResource> L @inject IHtmlLocalizer<IdentityResource> L
@inject IStringLocalizerFactory StringLocalizerFactory @inject IStringLocalizerFactory StringLocalizerFactory
@ -17,8 +18,7 @@
<abp-modal-header title="@L["Edit"].Value"></abp-modal-header> <abp-modal-header title="@L["Edit"].Value"></abp-modal-header>
<abp-modal-body> <abp-modal-body>
<abp-tabs name="create-user-modal-tabs"> <abp-tabs name="create-user-modal-tabs">
<abp-tab title="@L["UserInformations"].Value"> <abp-tab title="@L["UserInformations"].Value">
@* TODO: Can we use dynamic form? *@
<input asp-for="UserInfo.Id" /> <input asp-for="UserInfo.Id" />
<input asp-for="UserInfo.ConcurrencyStamp" /> <input asp-for="UserInfo.ConcurrencyStamp" />
<abp-input asp-for="UserInfo.UserName" /> <abp-input asp-for="UserInfo.UserName" />
@ -38,8 +38,8 @@
<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-selected-item-name="@Model.UserInfo.ExtraProperties[propertyInfo.Name+"_Text"]" autocomplete-selected-item-name="@Model.UserInfo.GetProperty(propertyInfo.Name+"_Text")"
autocomplete-selected-item-value="@Model.UserInfo.ExtraProperties[propertyInfo.Name]" autocomplete-selected-item-value="@Model.UserInfo.GetProperty(propertyInfo.Name)"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" 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"
@ -51,7 +51,7 @@
asp-for="UserInfo.ExtraProperties[propertyInfo.Name]" asp-for="UserInfo.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()" asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.UserInfo.ExtraProperties[propertyInfo.Name])" /> value="@Model.UserInfo.GetProperty(propertyInfo.Name)" />
} }
} }
} }

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

@ -6,6 +6,7 @@
@using Volo.Abp.ObjectExtending @using Volo.Abp.ObjectExtending
@using Volo.Abp.TenantManagement.Localization @using Volo.Abp.TenantManagement.Localization
@using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants @using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
@using Volo.Abp.Data
@model CreateModalModel @model CreateModalModel
@inject IHtmlLocalizer<AbpTenantManagementResource> L @inject IHtmlLocalizer<AbpTenantManagementResource> L
@inject IStringLocalizerFactory StringLocalizerFactory @inject IStringLocalizerFactory StringLocalizerFactory
@ -31,8 +32,8 @@
<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-selected-item-name="@Model.Tenant.ExtraProperties[propertyInfo.Name+"_Text"]" autocomplete-selected-item-name="@Model.Tenant.GetProperty(propertyInfo.Name+"_Text")"
autocomplete-selected-item-value="@Model.Tenant.ExtraProperties[propertyInfo.Name]" autocomplete-selected-item-value="@Model.Tenant.GetProperty(propertyInfo.Name)"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" 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"
@ -44,7 +45,7 @@
asp-for="Tenant.ExtraProperties[propertyInfo.Name]" asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()" asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.Tenant.ExtraProperties[propertyInfo.Name])" /> value="@Model.Tenant.GetProperty(propertyInfo.Name)" />
} }
} }
} }

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

@ -6,6 +6,7 @@
@using Volo.Abp.ObjectExtending @using Volo.Abp.ObjectExtending
@using Volo.Abp.TenantManagement.Localization @using Volo.Abp.TenantManagement.Localization
@using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants @using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
@using Volo.Abp.Data
@model EditModalModel @model EditModalModel
@inject IHtmlLocalizer<AbpTenantManagementResource> L @inject IHtmlLocalizer<AbpTenantManagementResource> L
@inject IStringLocalizerFactory StringLocalizerFactory @inject IStringLocalizerFactory StringLocalizerFactory
@ -27,8 +28,8 @@
<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-selected-item-name="@Model.Tenant.ExtraProperties[propertyInfo.Name+"_Text"]" autocomplete-selected-item-name="@Model.Tenant.GetProperty(propertyInfo.Name+"_Text")"
autocomplete-selected-item-value="@Model.Tenant.ExtraProperties[propertyInfo.Name]" autocomplete-selected-item-value="@Model.Tenant.GetProperty(propertyInfo.Name)"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName" 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"
@ -40,7 +41,7 @@
asp-for="Tenant.ExtraProperties[propertyInfo.Name]" asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()" asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.Tenant.ExtraProperties[propertyInfo.Name])" /> value="@Model.Tenant.GetProperty(propertyInfo.Name)" />
} }
} }
} }

Loading…
Cancel
Save