mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01: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
|
DatatableAbove Component
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const DatatableAbove = (props) => {
|
const DatatableAbove = (props, { intl }) => {
|
||||||
const { collection, currentUser, showSearch, showNew, canInsert, value, updateQuery, options, newFormOptions } = props;
|
const { collection, currentUser, showSearch, showNew, canInsert, value, updateQuery, options, newFormOptions } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="datatable-above">
|
<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}/>}
|
{showNew && canInsert && <Components.NewButton collection={collection} currentUser={currentUser} mutationFragmentName={options && options.fragmentName} {...newFormOptions}/>}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
DatatableAbove.contextTypes = {
|
||||||
|
intl: intlShape,
|
||||||
|
};
|
||||||
registerComponent('DatatableAbove', DatatableAbove);
|
registerComponent('DatatableAbove', DatatableAbove);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -131,6 +131,7 @@ addStrings('en', {
|
||||||
'cards.edit': 'Edit',
|
'cards.edit': 'Edit',
|
||||||
'datatable.new': 'New',
|
'datatable.new': 'New',
|
||||||
'datatable.edit': 'Edit',
|
'datatable.edit': 'Edit',
|
||||||
|
'datatable.search': 'Search',
|
||||||
|
|
||||||
'admin': 'Admin',
|
'admin': 'Admin',
|
||||||
'notifications': 'Notifications',
|
'notifications': 'Notifications',
|
||||||
|
|
Loading…
Add table
Reference in a new issue