Add some information about Full-text search being disabled in search popout (#26756)

lolsob-rspec
Claire 2023-09-06 17:23:58 +02:00 committed by GitHub
parent bd83df7fd1
commit 1e8b335d70
2 changed files with 15 additions and 12 deletions

View File

@ -8,7 +8,7 @@ import classNames from 'classnames';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { Icon } from 'mastodon/components/icon'; import { Icon } from 'mastodon/components/icon';
import { searchEnabled } from 'mastodon/initial_state'; import { domain, searchEnabled } from 'mastodon/initial_state';
import { HASHTAG_REGEX } from 'mastodon/utils/hashtags'; import { HASHTAG_REGEX } from 'mastodon/utils/hashtags';
const messages = defineMessages({ const messages = defineMessages({
@ -354,18 +354,20 @@ class Search extends PureComponent {
</> </>
)} )}
{searchEnabled && ( <h4><FormattedMessage id='search_popout.options' defaultMessage='Search options' /></h4>
<>
<h4><FormattedMessage id='search_popout.options' defaultMessage='Search options' /></h4>
<div className='search__popout__menu'> {searchEnabled ? (
{this.defaultOptions.map(({ key, label, action }, i) => ( <div className='search__popout__menu'>
<button key={key} onMouseDown={action} className={classNames('search__popout__menu__item', { selected: selectedOption === (options.length + i) })}> {this.defaultOptions.map(({ key, label, action }, i) => (
{label} <button key={key} onMouseDown={action} className={classNames('search__popout__menu__item', { selected: selectedOption === (options.length + i) })}>
</button> {label}
))} </button>
</div> ))}
</> </div>
) : (
<div className='search__popout__menu__message'>
<FormattedMessage id='search_popout.full_text_search_disabled_message' defaultMessage='Not available on {domain}.' values={{ domain }} />
</div>
)} )}
</div> </div>
</div> </div>

View File

@ -590,6 +590,7 @@
"search.quick_action.open_url": "Open URL in Mastodon", "search.quick_action.open_url": "Open URL in Mastodon",
"search.quick_action.status_search": "Posts matching {x}", "search.quick_action.status_search": "Posts matching {x}",
"search.search_or_paste": "Search or paste URL", "search.search_or_paste": "Search or paste URL",
"search_popout.full_text_search_disabled_message": "Not available on {domain}.",
"search_popout.language_code": "ISO language code", "search_popout.language_code": "ISO language code",
"search_popout.options": "Search options", "search_popout.options": "Search options",
"search_popout.quick_actions": "Quick actions", "search_popout.quick_actions": "Quick actions",