Support "in:public" search filter (#26976)
parent
2528a0721f
commit
ad44d832b8
|
@ -64,7 +64,7 @@ class Search extends PureComponent {
|
||||||
{ label: <><mark>before:</mark> <FormattedMessage id='search_popout.specific_date' defaultMessage='specific date' /></>, action: e => { e.preventDefault(); this._insertText('before:'); } },
|
{ label: <><mark>before:</mark> <FormattedMessage id='search_popout.specific_date' defaultMessage='specific date' /></>, action: e => { e.preventDefault(); this._insertText('before:'); } },
|
||||||
{ label: <><mark>during:</mark> <FormattedMessage id='search_popout.specific_date' defaultMessage='specific date' /></>, action: e => { e.preventDefault(); this._insertText('during:'); } },
|
{ label: <><mark>during:</mark> <FormattedMessage id='search_popout.specific_date' defaultMessage='specific date' /></>, action: e => { e.preventDefault(); this._insertText('during:'); } },
|
||||||
{ label: <><mark>after:</mark> <FormattedMessage id='search_popout.specific_date' defaultMessage='specific date' /></>, action: e => { e.preventDefault(); this._insertText('after:'); } },
|
{ label: <><mark>after:</mark> <FormattedMessage id='search_popout.specific_date' defaultMessage='specific date' /></>, action: e => { e.preventDefault(); this._insertText('after:'); } },
|
||||||
{ label: <><mark>in:</mark> <FormattedList type='disjunction' value={['all', 'library']} /></>, action: e => { e.preventDefault(); this._insertText('in:'); } }
|
{ label: <><mark>in:</mark> <FormattedList type='disjunction' value={['all', 'library', 'public']} /></>, action: e => { e.preventDefault(); this._insertText('in:'); } }
|
||||||
];
|
];
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
|
|
|
@ -58,6 +58,8 @@ class SearchQueryTransformer < Parslet::Transform
|
||||||
case @flags['in']
|
case @flags['in']
|
||||||
when 'library'
|
when 'library'
|
||||||
[StatusesIndex]
|
[StatusesIndex]
|
||||||
|
when 'public'
|
||||||
|
[PublicStatusesIndex]
|
||||||
else
|
else
|
||||||
[PublicStatusesIndex, StatusesIndex]
|
[PublicStatusesIndex, StatusesIndex]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue