|
@@ -1,6 +1,6 @@
|
|
|
import React, { FC } from 'react';
|
|
import React, { FC } from 'react';
|
|
|
|
|
|
|
|
-import { UserPicture, PageListMeta } from '@growi/ui';
|
|
|
|
|
|
|
+import { UserPicture, PageListMeta, PagePathLabel } from '@growi/ui';
|
|
|
import { DevidedPagePath } from '@growi/core';
|
|
import { DevidedPagePath } from '@growi/core';
|
|
|
|
|
|
|
|
import loggerFactory from '~/utils/logger';
|
|
import loggerFactory from '~/utils/logger';
|
|
@@ -15,7 +15,6 @@ type Props ={
|
|
|
lastUpdateUser: any
|
|
lastUpdateUser: any
|
|
|
elasticSearchResult: {
|
|
elasticSearchResult: {
|
|
|
snippet: string,
|
|
snippet: string,
|
|
|
- highlightedPath: string
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onClickInvoked: (data: string) => void,
|
|
onClickInvoked: (data: string) => void,
|
|
@@ -29,6 +28,7 @@ const SearchResultListItem: FC<Props> = (props:Props) => {
|
|
|
const pageId = `#${page._id}`;
|
|
const pageId = `#${page._id}`;
|
|
|
|
|
|
|
|
const dPagePath = new DevidedPagePath(page.path, false, true);
|
|
const dPagePath = new DevidedPagePath(page.path, false, true);
|
|
|
|
|
+ const pagePathElem = <PagePathLabel page={page} isFormerOnly />;
|
|
|
|
|
|
|
|
// TODO : send cetain length of body (revisionBody) from elastisearch by adding some settings to the query and
|
|
// TODO : send cetain length of body (revisionBody) from elastisearch by adding some settings to the query and
|
|
|
// when keyword is not in page content, display revisionBody.
|
|
// when keyword is not in page content, display revisionBody.
|
|
@@ -58,8 +58,7 @@ const SearchResultListItem: FC<Props> = (props:Props) => {
|
|
|
{/* page path */}
|
|
{/* page path */}
|
|
|
<small className="mb-1">
|
|
<small className="mb-1">
|
|
|
<i className="icon-fw icon-home"></i>
|
|
<i className="icon-fw icon-home"></i>
|
|
|
- {/* eslint-disable-next-line react/no-danger */}
|
|
|
|
|
- <div dangerouslySetInnerHTML={{ __html: page.elasticSearchResult.highlightedPath }}></div>
|
|
|
|
|
|
|
+ {pagePathElem}
|
|
|
</small>
|
|
</small>
|
|
|
<div className="d-flex my-1 align-items-center">
|
|
<div className="d-flex my-1 align-items-center">
|
|
|
{/* page title */}
|
|
{/* page title */}
|