Răsfoiți Sursa

Merge branch 'master' into feat/page-bulk-export

Futa Arai 1 an în urmă
părinte
comite
c7eac3692d

+ 1 - 1
apps/app/package.json

@@ -205,7 +205,7 @@
     "uglifycss": "^0.0.29",
     "universal-bunyan": "^0.9.2",
     "unstated": "^2.1.1",
-    "unzip-stream": "^0.3.1",
+    "unzip-stream": "^0.3.2",
     "url-join": "^4.0.0",
     "usehooks-ts": "^2.6.0",
     "validator": "^13.7.0",

+ 0 - 36
apps/app/src/client/components/SearchForm.module.scss

@@ -1,36 +0,0 @@
-@use '@growi/core-styles/scss/bootstrap/init' as bs;
-
-.grw-search-table {
-  caption {
-    display: table-header-group;
-  }
-}
-
-@include bs.media-breakpoint-down(sm) {
-  .grw-search-table {
-    th {
-      text-align: right;
-    }
-
-    td {
-      overflow-wrap: anywhere;
-      white-space: normal !important;
-    }
-
-    @include bs.media-breakpoint-down(xs) {
-      th,
-      td {
-        display: block;
-      }
-
-      th {
-        text-align: left;
-      }
-
-      td {
-        padding-top: 0 !important;
-        border-top: none !important;
-      }
-    }
-  }
-}

+ 0 - 143
apps/app/src/client/components/SearchForm.tsx

@@ -1,143 +0,0 @@
-import React, {
-  FC, forwardRef, ForwardRefRenderFunction, useImperativeHandle,
-  useRef, useState,
-} from 'react';
-
-import { useTranslation } from 'next-i18next';
-
-import { IFocusable } from '~/client/interfaces/focusable';
-import { TypeaheadProps } from '~/client/interfaces/react-bootstrap-typeahead';
-import { IPageWithSearchMeta } from '~/interfaces/search';
-
-import SearchTypeahead from './SearchTypeahead';
-
-import styles from './SearchForm.module.scss';
-
-
-type SearchFormHelpProps = {
-  isReachable: boolean,
-}
-
-const SearchFormHelp: FC<SearchFormHelpProps> = React.memo((props: SearchFormHelpProps) => {
-  const { t } = useTranslation();
-
-  const { isReachable } = props;
-
-  if (!isReachable) {
-    return (
-      <>
-        <h5 className="text-danger">Error occured on Search Service</h5>
-        Try to reconnect from management page.
-      </>
-    );
-  }
-
-  return (
-    <table className={`${styles['grw-search-table']} table grw-search-table search-help m-0`}>
-      <caption className="text-start text-primary p-2">
-        <h5 className="h6"><span className="material-symbols-outlined">search</span>{ t('search_help.title') }</h5>
-      </caption>
-      <tbody>
-        <tr>
-          <th className="py-2">
-            <code>word1</code> <code>word2</code><br></br>
-            <small>({ t('search_help.and.syntax help') })</small>
-          </th>
-          <td><h6 className="m-0">{ t('search_help.and.desc', { word1: 'word1', word2: 'word2' }) }</h6></td>
-        </tr>
-        <tr>
-          <th className="py-2">
-            <code>&quot;This is GROWI&quot;</code><br></br>
-            <small>({ t('search_help.phrase.syntax help') })</small>
-          </th>
-          <td><h6 className="m-0">{ t('search_help.phrase.desc', { phrase: 'This is GROWI' }) }</h6></td>
-        </tr>
-        <tr>
-          <th className="py-2"><code>-keyword</code></th>
-          <td><h6 className="m-0">{ t('search_help.exclude.desc', { word: 'keyword' }) }</h6></td>
-        </tr>
-        <tr>
-          <th className="py-2"><code>prefix:/user/</code></th>
-          <td><h6 className="m-0">{ t('search_help.prefix.desc', { path: '/user/' }) }</h6></td>
-        </tr>
-        <tr>
-          <th className="py-2"><code>-prefix:/user/</code></th>
-          <td><h6 className="m-0">{ t('search_help.exclude_prefix.desc', { path: '/user/' }) }</h6></td>
-        </tr>
-        <tr>
-          <th className="py-2"><code>tag:wiki</code></th>
-          <td><h6 className="m-0">{ t('search_help.tag.desc', { tag: 'wiki' }) }</h6></td>
-        </tr>
-        <tr>
-          <th className="py-2"><code>-tag:wiki</code></th>
-          <td><h6 className="m-0">{ t('search_help.exclude_tag.desc', { tag: 'wiki' }) }</h6></td>
-        </tr>
-      </tbody>
-    </table>
-  );
-});
-
-SearchFormHelp.displayName = 'SearchFormHelp';
-
-
-type Props = TypeaheadProps & {
-  isSearchServiceReachable: boolean,
-
-  keywordOnInit?: string,
-  disableIncrementalSearch?: boolean,
-  onChange?: (data: IPageWithSearchMeta[]) => void,
-  onSubmit?: (input: string) => void,
-};
-
-
-const SearchForm: ForwardRefRenderFunction<IFocusable, Props> = (props: Props, ref) => {
-  const { t } = useTranslation();
-  const {
-    isSearchServiceReachable,
-    keywordOnInit,
-    disableIncrementalSearch,
-    dropup, onChange, onBlur, onFocus, onSubmit, onInputChange,
-  } = props;
-
-  const [searchError, setSearchError] = useState<Error | null>(null);
-
-  const searchTyheaheadRef = useRef<IFocusable>(null);
-
-  // publish focus()
-  useImperativeHandle(ref, () => ({
-    focus() {
-      const instance = searchTyheaheadRef?.current;
-      if (instance != null) {
-        instance.focus();
-      }
-    },
-  }));
-
-  const placeholder = isSearchServiceReachable
-    ? 'Search ...'
-    : 'Error on Search Service';
-
-  const emptyLabel = (searchError != null)
-    ? 'Error on searching.'
-    : t('search.search page bodies');
-
-  return (
-    <SearchTypeahead
-      ref={searchTyheaheadRef}
-      dropup={dropup}
-      emptyLabel={emptyLabel}
-      placeholder={placeholder}
-      onChange={onChange}
-      onSubmit={onSubmit}
-      onInputChange={onInputChange}
-      onSearchError={err => setSearchError(err)}
-      onBlur={onBlur}
-      onFocus={onFocus}
-      keywordOnInit={keywordOnInit}
-      disableIncrementalSearch={disableIncrementalSearch}
-      helpElement={<SearchFormHelp isReachable={isSearchServiceReachable} />}
-    />
-  );
-};
-
-export default forwardRef(SearchForm);

+ 4 - 4
yarn.lock

@@ -18712,10 +18712,10 @@ untildify@^4.0.0:
   resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b"
   integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==
 
-unzip-stream@^0.3.1:
-  version "0.3.1"
-  resolved "https://registry.yarnpkg.com/unzip-stream/-/unzip-stream-0.3.1.tgz#2333b5cd035d29db86fb701ca212cf8517400083"
-  integrity sha512-RzaGXLNt+CW+T41h1zl6pGz3EaeVhYlK+rdAap+7DxW5kqsqePO8kRtWPaCiVqdhZc86EctSPVYNix30YOMzmw==
+unzip-stream@^0.3.2:
+  version "0.3.2"
+  resolved "https://registry.yarnpkg.com/unzip-stream/-/unzip-stream-0.3.2.tgz#e7bfd887f4c9a284b46978693ba54e0d4f5095df"
+  integrity sha512-oWhfqwjx36ULFG+krfkbtbrc/BeEzaYrlqdEWa5EPNd6x6RerzuNW8aSTM0TtNtrOfUKYdO0TwrlkzrXAE6Olg==
   dependencies:
     binary "^0.3.0"
     mkdirp "^0.5.1"