Skip to content

Commit 47bae97

Browse files
committed
add message when no results (#1034)
1 parent 21ec213 commit 47bae97

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/components/App.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -2715,6 +2715,10 @@ p.no-result {
27152715
margin: 20px 22px 0 22px;
27162716
}
27172717

2718+
.no-result.inAppSK {
2719+
font-size:14px;
2720+
}
2721+
27182722
.no-result .noR { display:block; margin-top:25px; }
27192723
.no-result .noR li:not(#a) { list-style-type: disc; margin-left:30px;margin-top:6px;}
27202724

@@ -2725,7 +2729,7 @@ p.no-result {
27252729
.no-result .reset-khmer { display:flex; align-items: baseline;}
27262730
.no-result .reset-khmer #clear-filters { display: inline-flex; }
27272731

2728-
.no-result .noR:not(.bo-x-ewts) li:last-child { display:none; }
2732+
.no-result:not(.inAppSK) .noR:not(.bo-x-ewts) li:last-child { display:none; }
27292733
#res-container .no-result .noR.bo-x-ewts li:last-child { pointer-events:auto; }
27302734
#res-container .no-result .noR.bo-x-ewts li:last-child .uri-link { margin-left:0;}
27312735
.noR.bo-x-ewts li .uri-link:not(:hover) { border-bottom:1px solid transparent; }

src/lib/searchkit/components/SearchResultsHeader.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ function SearchResultsHeader(props) {
7777
{ status != "error" && (results?.nbHits || status === "idle") && (!recent || forceSearch /*&& indexUiState.query && results?.nbHits === 0*/) &&
7878
( inner && !indexUiState.query
7979
? <h3>{I18n.t("resource.explain"+(recent&&!forceSearch?"R":""))}</h3>
80-
: <h3>{I18n.t("result.hit"+(results.query?"KW":""),{count:results?.nbHits, interpolation: {escapeValue: false}, ...results.query?{kw:results.query}:{}})}</h3>
80+
: <>
81+
<h3>{I18n.t("result.hit"+(results.query?"KW":""),{count:results?.nbHits, interpolation: {escapeValue: false}, ...results.query?{kw:results.query}:{}})}</h3>
82+
<div class={results?.nbHits === 0 ? "no-result inAppSK":""}>{ results?.nbHits === 0 && <Trans i18nKey="search.filters.generic" components={{ newline: <br />, parag: <span class={"noR"}/>, list:<li/>, ita:<i/>}} /> }</div>
83+
</>
8184
)
8285
}
8386
{ status == "error" &&

src/translations/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,8 @@
649649
"facets":" with the filters you set",
650650
"persons":"<parag>BDRC contains thousands of person records, you may want to try modifying your search to get the best results.<newline/><list>Search on a shorter string of syllables by eliminating titles, geographical names, and so on<newline/>Ex: <ita>'jam dbyangs nor bu</ita> instead of <ita>co ne sa skyong 'jam dbyangs nor bu</ita></list><list>Double check your search for typos</list><list>Try searching <lnk>in English</lnk> instead of pure Extended Wylie</list></parag>",
651651
"instances":"<parag>BDRC contains thousands of texts, you may want to try modifying your search to get the best results.<newline/><list>Search on a shorter string of syllables, preferably the core part of the title<newline/>Ex: <ita>lam rim chung ngu'i zin bris</ita> instead of <ita>lam rim chung ngu'i zin bris blo gsal rgya mtsho'i 'jug ngogs</ita></list><list>Double check your search for typos</list><list>Try searching <lnk>in English</lnk> instead of pure Extended Wylie</list></parag>",
652-
"error": "There was an error processing your search: {{keyword}} [{{language}}] {{type}}<newline/>Please check syntax or try another search"
652+
"error": "There was an error processing your search: {{keyword}} [{{language}}] {{type}}<newline/>Please check syntax or try another search",
653+
"generic":"<parag>BDRC contains thousands of records, you may want to try modifying your search to get the best results.<newline/><list>Search on a shorter string of syllables, preferably the core part of the title<newline/>Ex: <ita>lam rim chung ngu'i zin bris</ita> instead of <ita>lam rim chung ngu'i zin bris blo gsal rgya mtsho'i 'jug ngogs</ita></list><list>You can also search on a shorter string of syllables by eliminating titles, geographical names, and so on<newline/>Ex: <ita>'jam dbyangs nor bu</ita> instead of <ita>co ne sa skyong 'jam dbyangs nor bu</ita></list><list>Double check your search for typos</list></parag>"
653654
},
654655
"seeO": "See results in other data types",
655656
"backToW": "Back to Works",

0 commit comments

Comments
 (0)