[DE] Fix Bug 54054

This commit is contained in:
ShimaginAndrey 2021-11-24 15:45:04 +03:00
parent cea7c6c694
commit fff7a34c53
2 changed files with 6 additions and 3 deletions

View file

@ -302,5 +302,6 @@ class SearchView extends Component {
}
const SearchViewWithObserver = observer(SearchView);
const SearchSettingsViewWithObserver = observer(SearchSettingsView);
export {SearchViewWithObserver as SearchView, SearchSettingsView};
export {SearchViewWithObserver as SearchView, SearchSettingsViewWithObserver as SearchSettingsView};

View file

@ -25,6 +25,8 @@ class SearchSettings extends SearchSettingsView {
const _t = t("Settings", {returnObjects: true});
const storeAppOptions = this.props.storeAppOptions;
const isEdit = storeAppOptions.isEdit;
const storeReview = this.props.storeReview;
const displayMode = storeReview.displayMode;
const markup = (
<Page>
@ -37,7 +39,7 @@ class SearchSettings extends SearchSettingsView {
</Navbar>
<List>
<ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} />
{isEdit ? [
{isEdit && displayMode === 'markup' ? [
<ListItem key="replace" radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace}
onClick={e => this.onFindReplaceClick('replace')} />,
<ListItem key="replace-all" radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll}
@ -132,6 +134,6 @@ const Search = withTranslation()(props => {
return <DESearchView _t={_t} onSearchQuery={onSearchQuery} onchangeSearchQuery={onchangeSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} />
});
const SearchSettingsWithTranslation = inject("storeAppOptions")(observer(withTranslation()(SearchSettings)));
const SearchSettingsWithTranslation = inject("storeAppOptions", "storeReview")(observer(withTranslation()(SearchSettings)));
export {Search, SearchSettingsWithTranslation as SearchSettings}