mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-06 05:10:20 +03:00
fix: improve not found label
This commit is contained in:
parent
625f68ae30
commit
86b87d93ac
|
@ -57,6 +57,6 @@ describe('Search', () => {
|
|||
it('should show proper message when no search results are found', () => {
|
||||
getSearchResults().should('not.exist');
|
||||
getSearchInput().type('xzss', {force: true});
|
||||
getSearchResults().should('exist').should('contain', 'No results found!');
|
||||
getSearchResults().should('exist').should('contain', 'No results found');
|
||||
})
|
||||
});
|
||||
|
|
|
@ -16,6 +16,7 @@ import {
|
|||
SearchResultsBox,
|
||||
SearchWrap,
|
||||
} from './styled.elements';
|
||||
import { l } from '../../services/Labels';
|
||||
|
||||
export interface SearchBoxProps {
|
||||
search: SearchStore<string>;
|
||||
|
@ -171,8 +172,9 @@ export class SearchBox extends React.PureComponent<SearchBoxProps, SearchBoxStat
|
|||
</SearchResultsBox>
|
||||
</PerfectScrollbarWrap>
|
||||
)}
|
||||
{(this.state.term) && this.state.noResults ? <SearchResultsBox data-role="search:results">No results found!</SearchResultsBox> : null
|
||||
}
|
||||
{this.state.term && this.state.noResults ? (
|
||||
<SearchResultsBox data-role="search:results">{l('noResultsFound')}</SearchResultsBox>
|
||||
) : null}
|
||||
</SearchWrap>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ export interface LabelsConfig {
|
|||
arrayOf: string;
|
||||
webhook: string;
|
||||
const: string;
|
||||
noResultsFound: string;
|
||||
}
|
||||
|
||||
export type LabelsConfigRaw = Partial<LabelsConfig>;
|
||||
|
@ -26,6 +27,7 @@ const labels: LabelsConfig = {
|
|||
arrayOf: 'Array of ',
|
||||
webhook: 'Event',
|
||||
const: 'Value',
|
||||
noResultsFound: 'No results found',
|
||||
};
|
||||
|
||||
export function setRedocLabels(_labels?: LabelsConfigRaw) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user