-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added search box view component #4145
Conversation
@@ -40,4 +40,8 @@ | |||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Widgets\Volo.Abp.AspNetCore.Mvc.UI.Widgets.csproj" /> | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<_ContentIncludedByDefault Remove="Pages\Shared\Components\AbpPageToolbar\AbpPageSearchBox\Default.cshtml" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is _ContentIncludedByDefault?
} | ||
} | ||
|
||
public class SearchBoxViewModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to its own file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you remove parameters then this class can be removed.
{ | ||
public string PlaceHolder { get; set; } | ||
|
||
public async Task<IViewComponentResult> InvokeAsync( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to parameters, just use standard names.
@@ -0,0 +1,11 @@ | |||
| |||
<form method="post" class="searchForm"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use kebab-case
for CSS class names.
Rename to page-search-form
(search-form
is too general)
| ||
<form method="post" class="searchForm"> | ||
<div class="input-group"> | ||
<input class="form-control filterText" placeholder="Search"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Rename
filterText
topage-search-filter-text
- Make placeholder localized
{ | ||
public async Task<IViewComponentResult> InvokeAsync() | ||
{ | ||
return await Task.FromResult(View("~/Pages/Shared/Components/AbpPageSearchBox/Default.cshtml")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to make async if you simply return the view:
public IViewComponentResult Invoke()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public IViewComponentResult Invoke()
should work (exactly like that, not public IViewComponentResult InvokeAsync()
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it, you can check it
|
||
<form method="post" class="page-search-form"> | ||
<div class="input-group"> | ||
<input class="form-control page-search-filter-text" placeholder="@Model.PlaceHolder"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've wrtitten that it should be LOCALIZED, not "it should be parametric".
@@ -0,0 +1,7 @@ | |||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageSearchBox | |||
{ | |||
public class AbpSearchBoxViewModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this class! We don't want that parameter. It should be a standard text, but localized in the current language.
@@ -1,30 +1,30 @@ | |||
{ | |||
"culture": "de", | |||
"texts": { | |||
"InternalServerErrorMessage": "W�hrend Ihrer Anfrage ist ein interner Fehler aufgetreten!", | |||
"ValidationErrorMessage": "Ihre Anfrage ist nicht g�ltig!", | |||
"InternalServerErrorMessage": "W�hrend Ihrer Anfrage ist ein interner Fehler aufgetreten!", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a problem here. I see bad chars.
{ | ||
public class AbpPageSearchBoxViewComponent : AbpViewComponent | ||
{ | ||
public IViewComponentResult Invoke(string placeHolder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still has placeHolder
!
No description provided.