update required libraries
This commit is contained in:
+17
-18
@@ -4,36 +4,35 @@
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@types/async-lock": "^1.1.1",
|
||||
"@types/jest": "26.0.20",
|
||||
"@types/lokijs": "^1.5.3",
|
||||
"@types/node": "14.14.21",
|
||||
"@types/react": "17.0.0",
|
||||
"@types/react-dom": "17.0.0",
|
||||
"@types/react-helmet": "^6.1.0",
|
||||
"@types/jest": "26.0.23",
|
||||
"@types/lokijs": "^1.5.4",
|
||||
"@types/node": "15.6.1",
|
||||
"@types/react": "17.0.8",
|
||||
"@types/react-dom": "17.0.5",
|
||||
"@types/react-helmet": "^6.1.1",
|
||||
"@types/react-html-parser": "^2.0.1",
|
||||
"@types/react-router-dom": "^5.1.7",
|
||||
"@types/react-router-hash-link": "^1.2.1",
|
||||
"@types/xregexp": "^4.3.0",
|
||||
"async-lock": "^1.2.8",
|
||||
"@types/react-router-hash-link": "^2.4.0",
|
||||
"async-lock": "^1.3.0",
|
||||
"axios": "^0.21.1",
|
||||
"lokijs": "^1.5.11",
|
||||
"lokijs": "^1.5.12",
|
||||
"moment": "^2.29.1",
|
||||
"rc-tree": "^4.1.1",
|
||||
"react": "^17.0.1",
|
||||
"rc-tree": "^4.1.5",
|
||||
"react": "^17.0.2",
|
||||
"react-app-polyfill": "^2.0.0",
|
||||
"react-cookie": "^4.0.3",
|
||||
"react-dom": "^17.0.1",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-ga": "^3.3.0",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-html-parser": "^2.0.2",
|
||||
"react-image-lightbox": "^5.1.1",
|
||||
"react-overlays": "^4.1.1",
|
||||
"react-overlays": "^5.0.1",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-router-hash-link": "^2.3.1",
|
||||
"react-scripts": "4.0.1",
|
||||
"react-router-hash-link": "^2.4.3",
|
||||
"react-scripts": "4.0.3",
|
||||
"react-spinner-material": "^1.1.3",
|
||||
"typescript": "4.1.3",
|
||||
"xregexp": "^4.4.1"
|
||||
"typescript": "4.3.2",
|
||||
"xregexp": "^5.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
|
||||
@@ -27,10 +27,10 @@ const D3Forum = (props: Props) => {
|
||||
</Helmet>
|
||||
<Switch>
|
||||
<Route exact path={'/' + name} render={() => <D3ForumTop {...props} />} />
|
||||
<Route exact path={'/' + name + '/category/:id'} render={(props: RouteComponentProps<{ id: string }>) => <D3ForumCategory lang={lang} name={name} {...props} />} />
|
||||
<Route exact path={'/' + name + '/forum/:id'} render={(props: RouteComponentProps<{ id: string }>) => <D3ForumForum lang={lang} name={name} {...props} />} />
|
||||
<Route exact path={'/' + name + '/topic/:id'} render={(props: RouteComponentProps<{ id: string }>) => <D3ForumTopic lang={lang} name={name} {...props} />} />
|
||||
<Route exact path={'/' + name + '/post/:id'} render={(props: RouteComponentProps<{ id: string }>) => <D3ForumPost lang={lang} name={name} {...props} />} />
|
||||
<Route exact path={'/' + name + '/category/:id'} render={(props: RouteComponentProps<{ id?: string }>) => <D3ForumCategory lang={lang} name={name} {...props} />} />
|
||||
<Route exact path={'/' + name + '/forum/:id'} render={(props: RouteComponentProps<{ id?: string }>) => <D3ForumForum lang={lang} name={name} {...props} />} />
|
||||
<Route exact path={'/' + name + '/topic/:id'} render={(props: RouteComponentProps<{ id?: string }>) => <D3ForumTopic lang={lang} name={name} {...props} />} />
|
||||
<Route exact path={'/' + name + '/post/:id'} render={(props: RouteComponentProps<{ id?: string }>) => <D3ForumPost lang={lang} name={name} {...props} />} />
|
||||
<Route component={PageNotFound} />
|
||||
</Switch>
|
||||
</>
|
||||
|
||||
@@ -15,7 +15,7 @@ import D3ForumUtils, { D3ForumCategoryData, D3ForumForumData } from './lib/D3For
|
||||
import PostIcon from './lib/PostIcon';
|
||||
|
||||
interface Params {
|
||||
id: string;
|
||||
id?: string;
|
||||
}
|
||||
interface Props extends RouteComponentProps<Params> {
|
||||
lang: MultiLang;
|
||||
@@ -143,10 +143,10 @@ const D3ForumCategoryForum = (props: D3ForumCategoryProps) => {
|
||||
const D3ForumCategory = (props: Props) => {
|
||||
const { lang, name } = props;
|
||||
const params = props.match.params;
|
||||
if (params.id === '') {
|
||||
if (typeof params.id === 'undefined') {
|
||||
return <PageNotFound lang={lang} />;
|
||||
}
|
||||
const catId = parseInt(props.match.params.id, 10);
|
||||
const catId = parseInt(params.id, 10);
|
||||
const category = D3ForumUtils.getCategory(name, catId);
|
||||
if (category === null) {
|
||||
return <PageNotFound lang={lang} />;
|
||||
|
||||
@@ -19,7 +19,7 @@ import D3ForumUtils, { D3ForumPostData, D3ForumPostSortOrder, D3ForumTopicData }
|
||||
import PostIcon from './lib/PostIcon';
|
||||
|
||||
interface Params {
|
||||
id: string;
|
||||
id?: string;
|
||||
}
|
||||
interface Props extends RouteComponentProps<Params> {
|
||||
lang: MultiLang;
|
||||
@@ -29,10 +29,10 @@ interface Props extends RouteComponentProps<Params> {
|
||||
const D3ForumForum = (props: Props) => {
|
||||
const { lang, name } = props;
|
||||
const params = props.match.params;
|
||||
if (params.id === '') {
|
||||
if (typeof params.id === 'undefined') {
|
||||
return <PageNotFound lang={lang} />;
|
||||
}
|
||||
const forumId = parseInt(props.match.params.id, 10);
|
||||
const forumId = parseInt(params.id, 10);
|
||||
const forum = D3ForumUtils.getForum(name, forumId);
|
||||
if (forum === null) {
|
||||
return <PageNotFound lang={lang} />;
|
||||
|
||||
@@ -11,7 +11,7 @@ import Post from './lib/Post';
|
||||
import PostsTree from './lib/PostsTree';
|
||||
|
||||
interface Params {
|
||||
id: string;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
interface Props extends RouteComponentProps<Params> {
|
||||
@@ -22,10 +22,10 @@ interface Props extends RouteComponentProps<Params> {
|
||||
const D3ForumPost = (props: Props) => {
|
||||
const { lang, name } = props;
|
||||
const params = props.match.params;
|
||||
if (params.id === '') {
|
||||
if (typeof params.id === 'undefined') {
|
||||
return <PageNotFound lang={lang} />;
|
||||
}
|
||||
const postId = parseInt(props.match.params.id, 10);
|
||||
const postId = parseInt(params.id, 10);
|
||||
const post = D3ForumUtils.getPost(name, postId);
|
||||
if (post === null) {
|
||||
return <PageNotFound lang={lang} />;
|
||||
|
||||
@@ -12,7 +12,7 @@ import Post from './lib/Post';
|
||||
import PostsTree from './lib/PostsTree';
|
||||
|
||||
interface Params {
|
||||
id: string;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
interface Props extends RouteComponentProps<Params> {
|
||||
@@ -47,7 +47,7 @@ class D3ForumTopic extends Component<Props, State> {
|
||||
|
||||
static getDerivedStateFromProps(nextProps: Props, prevState: State) {
|
||||
const params = new URLSearchParams(nextProps.location.search);
|
||||
const topicId = parseInt(nextProps.match.params.id, 10);
|
||||
const topicId = typeof nextProps.match.params.id === 'undefined' ? 0 : parseInt(nextProps.match.params.id, 10);
|
||||
const order_ = params.get('order');
|
||||
const order = (order_ !== null && order_.match(/(0|1|2)/)) ? parseInt(order_, 10) as D3ForumPostSortOrder : D3ForumPostSortOrder.TREE;
|
||||
if (nextProps.name !== prevState.name || prevState.topicId !== topicId || prevState.order !== order) {
|
||||
|
||||
@@ -26,14 +26,14 @@ const Database = (props: Props) => {
|
||||
</Helmet>
|
||||
<Switch>
|
||||
<Route exact path="/database" render={(props: RouteComponentProps) => <DatabaseTop lang={lang} {...props} />} />
|
||||
<Route exact path="/database/item/:id" render={(props: RouteComponentProps<{ id: string; doi: string }>) => <DatabaseDetailItem lang={lang} {...props} />} />
|
||||
<Route exact path="/database/item/id/:doi" render={(props: RouteComponentProps<{ id: string; doi: string }>) => <DatabaseDetailItem lang={lang} {...props} />} />
|
||||
<Route exact path="/database/item/:id" render={(props: RouteComponentProps<{ id: string }>) => <DatabaseDetailItem lang={lang} {...props} />} />
|
||||
<Route exact path="/database/item/id/:doi" render={(props: RouteComponentProps<{ doi: string }>) => <DatabaseDetailItem lang={lang} {...props} />} />
|
||||
<Route exact path="/database/advanced" render={(props: RouteComponentProps) => <DatabaseAdvancedSearch lang={lang} {...props} />} />
|
||||
<Route exact path="/database/list" render={(props: RouteComponentProps<{ id: string }>) => <DatabaseSearchByIndexId lang={lang} {...props} />} />
|
||||
<Route exact path="/database/list" render={(props: RouteComponentProps) => <DatabaseSearchByIndexId lang={lang} {...props} />} />
|
||||
<Route exact path="/database/list/:id" render={(props: RouteComponentProps<{ id: string }>) => <DatabaseSearchByIndexId lang={lang} {...props} />} />
|
||||
<Route exact path="/database/search" render={(props: RouteComponentProps) => <DatabaseSearchByKeyword lang={lang} {...props} />} />
|
||||
<Route exact path="/database/search/advanced" render={(props: RouteComponentProps) => <DatabaseSearchByAdvancedKeyword lang={lang} {...props} />} />
|
||||
<Route exact path="/database/search/itemtype/:itemType" render={(props: RouteComponentProps<{ itemType: string; subItemType: string }>) => <DatabaseSearchByItemType lang={lang} {...props} />} />
|
||||
<Route exact path="/database/search/itemtype/:itemType" render={(props: RouteComponentProps<{ itemType: string }>) => <DatabaseSearchByItemType lang={lang} {...props} />} />
|
||||
<Route exact path="/database/search/itemtype/:itemType/:subItemType" render={(props: RouteComponentProps<{ itemType: string; subItemType: string }>) => <DatabaseSearchByItemType lang={lang} {...props} />} />
|
||||
<Route component={PageNotFound} />
|
||||
</Switch>
|
||||
|
||||
@@ -9,8 +9,8 @@ import ItemType from './item-type';
|
||||
import ItemUtil, { Item } from './lib/ItemUtil';
|
||||
|
||||
interface Params {
|
||||
id: string;
|
||||
doi: string;
|
||||
id?: string;
|
||||
doi?: string;
|
||||
}
|
||||
|
||||
interface Props extends RouteComponentProps<Params> {
|
||||
@@ -78,7 +78,7 @@ class DatabaseDetailItem extends Component<Props, State> {
|
||||
<Helmet>
|
||||
<title>{Functions.mlang(this.state.item.title, lang)} - {Functions.mlang('[en]Database[/en][ja]データベース[/ja]', lang)} - {Functions.siteTitle(lang)}</title>
|
||||
</Helmet>
|
||||
<h3>{Functions.mlang('[en]Detail[/en][ja]詳細[/ja]', lang)}</h3>
|
||||
<h3>{Functions.mlang('[en]Item Detail[/en][ja]アイテム詳細[/ja]', lang)}</h3>
|
||||
<br />
|
||||
<ItemType.Detail lang={lang} item={this.state.item} />
|
||||
</>
|
||||
|
||||
@@ -11,7 +11,7 @@ import IndexUtil, { Index, INDEX_ID_PUBLIC } from './lib/IndexUtil';
|
||||
import ItemUtil, { SearchCallbackFunc, SortCondition } from './lib/ItemUtil';
|
||||
|
||||
interface Params {
|
||||
id: string;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export interface Props extends RouteComponentProps<Params> {
|
||||
@@ -68,9 +68,10 @@ class DatabaseSearchByIndexId extends Component<Props, State> {
|
||||
const pIndexes = IndexUtil.getParents(this.state.indexId);
|
||||
const parents = pIndexes.map((value: Index) => {
|
||||
const url: string = IndexUtil.getUrl(value.id);
|
||||
return <Fragment key={value.id}>/ <Link to={url}>{value.title}</Link> </Fragment>;
|
||||
const title = Functions.mlang(value.title, lang);
|
||||
return <Fragment key={value.id}>/ <Link to={url}>{title}</Link> </Fragment>;
|
||||
});
|
||||
const title = pIndexes.map((value) => { return '/' + value.title; }).join('');
|
||||
const title = pIndexes.map((value) => { return '/' + Functions.mlang(value.title, lang); }).join('');
|
||||
return (
|
||||
<div className="list">
|
||||
<Helmet>
|
||||
|
||||
@@ -7,7 +7,7 @@ import ItemUtil, { SearchCallbackFunc, SortCondition } from './lib/ItemUtil';
|
||||
|
||||
interface Params {
|
||||
itemType: string;
|
||||
subItemType: string;
|
||||
subItemType?: string;
|
||||
}
|
||||
|
||||
interface Props extends RouteComponentProps<Params> {
|
||||
|
||||
+2
-1
@@ -17,7 +17,8 @@
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "preserve"
|
||||
"jsx": "react-jsx",
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
|
||||
Reference in New Issue
Block a user