mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
Merge pull request #2103 from dimofte/feature/datatables-i18n-search
datatable: add i18n for the search field
This commit is contained in:
commit
b36209938d
2 changed files with 15 additions and 2 deletions
|
@ -113,16 +113,28 @@ registerComponent('Datatable', Datatable, withCurrentUser);
|
|||
DatatableAbove Component
|
||||
|
||||
*/
|
||||
const DatatableAbove = (props) => {
|
||||
const DatatableAbove = (props, { intl }) => {
|
||||
const { collection, currentUser, showSearch, showNew, canInsert, value, updateQuery, options, newFormOptions } = props;
|
||||
|
||||
return (
|
||||
<div className="datatable-above">
|
||||
{showSearch && <input className="datatable-search form-control" placeholder="Search…" type="text" name="datatableSearchQuery" value={value} onChange={updateQuery} />}
|
||||
{showSearch && (
|
||||
<input
|
||||
className="datatable-search form-control"
|
||||
placeholder={`${intl.formatMessage({ id: 'datatable.search', defaultMessage: 'Search' })}…`}
|
||||
type="text"
|
||||
name="datatableSearchQuery"
|
||||
value={value}
|
||||
onChange={updateQuery}
|
||||
/>
|
||||
)}
|
||||
{showNew && canInsert && <Components.NewButton collection={collection} currentUser={currentUser} mutationFragmentName={options && options.fragmentName} {...newFormOptions}/>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
DatatableAbove.contextTypes = {
|
||||
intl: intlShape,
|
||||
};
|
||||
registerComponent('DatatableAbove', DatatableAbove);
|
||||
|
||||
/*
|
||||
|
|
|
@ -131,6 +131,7 @@ addStrings('en', {
|
|||
'cards.edit': 'Edit',
|
||||
'datatable.new': 'New',
|
||||
'datatable.edit': 'Edit',
|
||||
'datatable.search': 'Search',
|
||||
|
||||
'admin': 'Admin',
|
||||
'notifications': 'Notifications',
|
||||
|
|
Loading…
Add table
Reference in a new issue