chore(deps): Upgrade RME for improved doc search results

This commit is contained in:
Tom Moor
2020-09-24 19:35:28 -07:00
parent bb7fcd1b67
commit a43cc9c5a9
4 changed files with 22 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
// @flow
import distanceInWordsToNow from "date-fns/distance_in_words_to_now";
import invariant from "invariant";
import { observable } from "mobx";
import { observer, inject } from "mobx-react";
@@ -77,9 +78,13 @@ class DataLoader extends React.Component<Props> {
const slug = parseDocumentSlug(term);
try {
const document = await this.props.documents.fetch(slug);
const time = distanceInWordsToNow(document.updatedAt, {
addSuffix: true,
});
return [
{
title: document.title,
subtitle: `Updated ${time}`,
url: document.url,
},
];
@@ -96,10 +101,16 @@ class DataLoader extends React.Component<Props> {
return results
.filter((result) => result.document.title)
.map((result) => ({
title: result.document.title,
url: result.document.url,
}));
.map((result) => {
const time = distanceInWordsToNow(result.document.updatedAt, {
addSuffix: true,
});
return {
title: result.document.title,
subtitle: `Updated ${time}`,
url: result.document.url,
};
});
};
onCreateLink = async (title: string) => {

View File

@@ -140,7 +140,7 @@
"react-portal": "^4.0.0",
"react-router-dom": "^5.1.2",
"react-waypoint": "^9.0.2",
"rich-markdown-editor": "^11.0.0-7",
"rich-markdown-editor": "^11.0.0-8",
"semver": "^7.3.2",
"sequelize": "^6.3.4",
"sequelize-cli": "^6.2.0",

View File

@@ -139,6 +139,7 @@ export const light = {
listItemHoverBackground: colors.warmGrey,
toolbarHoverBackground: colors.black,
toolbarBackground: colors.lightBlack,
toolbarInput: colors.white10,
toolbarItem: colors.white,
@@ -193,6 +194,7 @@ export const dark = {
listItemHoverBackground: colors.black50,
toolbarHoverBackground: colors.slate,
toolbarBackground: colors.white,
toolbarInput: colors.black10,
toolbarItem: colors.lightBlack,

View File

@@ -9887,10 +9887,10 @@ retry-as-promised@^3.2.0:
dependencies:
any-promise "^1.3.0"
rich-markdown-editor@^11.0.0-7:
version "11.0.0-7"
resolved "https://registry.yarnpkg.com/rich-markdown-editor/-/rich-markdown-editor-11.0.0-7.tgz#2e7501cd37d921eb0e914e02ab076f1acb975b14"
integrity sha512-/17u4wwTv5FqWQf2NG+YhY4nbmrJl/dy//7ToGSBe8dSVcb01B8mLGqwDZ2D3PgmZqtUxbblOF2Q4E8QpQalTQ==
rich-markdown-editor@^11.0.0-8:
version "11.0.0-8"
resolved "https://registry.yarnpkg.com/rich-markdown-editor/-/rich-markdown-editor-11.0.0-8.tgz#542a33963147077a3c01ba2f689f67714056bbb9"
integrity sha512-TTMVMr33CFlk+AkHKE2/nOZ4VRSwq0aOLodCYotztSwGAQ1a01znZmue1gn/VbIrF7/AtxZ/cnIs3p2hJr82bw==
dependencies:
copy-to-clipboard "^3.0.8"
lodash "^4.17.11"