|
|
@@ -8,6 +8,7 @@ import { parse as parseQuerystring } from 'querystring';
|
|
|
import AppContainer from '~/client/services/AppContainer';
|
|
|
import { IFormattedSearchResult } from '~/interfaces/search';
|
|
|
import { ISelectableAll, ISelectableAndIndeterminatable } from '~/client/interfaces/selectable-all';
|
|
|
+import { useIsSearchServiceConfigured, useIsSearchServiceReachable } from '~/stores/context';
|
|
|
import { ISearchConditions, ISearchConfigurations, useSWRxFullTextSearch } from '~/stores/search';
|
|
|
|
|
|
import PaginationWrapper from './PaginationWrapper';
|
|
|
@@ -109,6 +110,9 @@ export const SearchPage = (props: Props): JSX.Element => {
|
|
|
const selectAllControlRef = useRef<ISelectableAndIndeterminatable|null>(null);
|
|
|
const searchPageBaseRef = useRef<ISelectableAll|null>(null);
|
|
|
|
|
|
+ const { data: isSearchServiceConfigured } = useIsSearchServiceConfigured();
|
|
|
+ const { data: isSearchServiceReachable } = useIsSearchServiceReachable();
|
|
|
+
|
|
|
const { data, conditions } = useSWRxFullTextSearch(keyword, {
|
|
|
limit: INITIAL_PAGIONG_SIZE,
|
|
|
...configurationsByControl,
|
|
|
@@ -245,6 +249,30 @@ export const SearchPage = (props: Props): JSX.Element => {
|
|
|
);
|
|
|
}, [conditions, configurationsByPagination?.limit, data, pagingNumberChangedHandler]);
|
|
|
|
|
|
+ if (!isSearchServiceConfigured) {
|
|
|
+ return (
|
|
|
+ <div className="grw-container-convertible">
|
|
|
+ <div className="row mt-5">
|
|
|
+ <div className="col text-muted">
|
|
|
+ <h1>Search service is not configured in this system.</h1>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!isSearchServiceReachable) {
|
|
|
+ return (
|
|
|
+ <div className="grw-container-convertible">
|
|
|
+ <div className="row mt-5">
|
|
|
+ <div className="col text-muted">
|
|
|
+ <h1>Search service occures errors. Please contact to administrators of this system.</h1>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
return (
|
|
|
<SearchPageBase
|
|
|
ref={searchPageBaseRef}
|