diff --git a/ui/src/authors/components/PublicationsSelectAll.tsx b/ui/src/authors/components/PublicationsSelectAll.tsx index c7c7cffc4a..143ddcdadc 100644 --- a/ui/src/authors/components/PublicationsSelectAll.tsx +++ b/ui/src/authors/components/PublicationsSelectAll.tsx @@ -1,16 +1,22 @@ import React, { useMemo } from 'react'; -import { List, Map, Set } from 'immutable'; +import { List, Set } from 'immutable'; import { Checkbox } from 'antd'; -function getRecordId(result: { getIn: (args: string[], arg?: boolean) => T }) { +function getRecordId(result: { + getIn: (args: string[], arg?: boolean) => T; +}) { return result.getIn(['metadata', 'control_number']); } -function getClaimed(result: { getIn: (args: string[], arg?: boolean) => T }) { +function getClaimed(result: { + getIn: (args: string[], arg?: boolean) => T; +}) { return result.getIn(['metadata', 'curated_relation'], false); } -function getCanClaim(result: { getIn: (args: string[], arg?: boolean) => T }) { +function getCanClaim(result: { + getIn: (args: string[], arg?: boolean) => T; +}) { return result.getIn(['metadata', 'can_claim'], false); } @@ -20,10 +26,10 @@ function PublicationsSelectAll({ onChange, disabled, }: { - publications: List, - selection: Set, - onChange: Function, - disabled: boolean, + publications: List; + selection: Set; + onChange: Function; + disabled?: boolean; }) { const checked = useMemo( () => diff --git a/ui/src/common/components/ContentBox/ContentBox.tsx b/ui/src/common/components/ContentBox/ContentBox.tsx index 88bbbe1b8b..742d1565e1 100644 --- a/ui/src/common/components/ContentBox/ContentBox.tsx +++ b/ui/src/common/components/ContentBox/ContentBox.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { Row, Col, Card } from 'antd'; +import classNames from 'classnames'; import './ContentBox.less'; @@ -11,6 +12,8 @@ const ContentBox = ({ children, subTitle, className, + fullHeight = true, + smallPadding = true, }: { title: string; leftActions: JSX.Element | JSX.Element[]; @@ -19,12 +22,26 @@ const ContentBox = ({ children: JSX.Element | JSX.Element[] | any; subTitle: string; className: string; + fullHeight?: boolean; + smallPadding?: boolean; }) => { return ( children && ( -
+
-
+
{subTitle &&

{subTitle}

}
{children}
diff --git a/ui/src/common/components/LinkLikeButton/LinkLikeButton.less b/ui/src/common/components/LinkLikeButton/LinkLikeButton.less index 017cc939a1..af1cd18602 100644 --- a/ui/src/common/components/LinkLikeButton/LinkLikeButton.less +++ b/ui/src/common/components/LinkLikeButton/LinkLikeButton.less @@ -11,7 +11,7 @@ & > *:hover { text-decoration: underline; } - } + } } &.blue { color: #0050b3; @@ -20,7 +20,7 @@ } } &.middle { - font-size: 1rem; + font-size: 1.1rem; } &.big { font-size: 1.5rem; diff --git a/ui/src/common/components/LinkLikeButton/LinkLikeButton.tsx b/ui/src/common/components/LinkLikeButton/LinkLikeButton.tsx index b81257e207..581b2cf5cb 100644 --- a/ui/src/common/components/LinkLikeButton/LinkLikeButton.tsx +++ b/ui/src/common/components/LinkLikeButton/LinkLikeButton.tsx @@ -10,19 +10,21 @@ const LinkLikeButton = ({ dataTestId, color, disabled, + className, }: { children: JSX.Element | string; onClick: MouseEventHandler; dataTestId: string; color: string; disabled: boolean; + className?: string; }) => ( + + + +
+

+ Overview +

+
+
+
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+
+
+
+ + View all + +
+ + + + + + + + +
+
+
+
+
+
diff --git a/ui/src/holdingpen/components/AuthorResultItem.tsx b/ui/src/holdingpen/components/AuthorResultItem.tsx new file mode 100644 index 0000000000..4338d202d1 --- /dev/null +++ b/ui/src/holdingpen/components/AuthorResultItem.tsx @@ -0,0 +1,83 @@ +import React from 'react'; +import { + CheckOutlined, + WarningFilled, + LoadingOutlined, + FilePdfOutlined, +} from '@ant-design/icons'; +import { Row, Col, Card, Button } from 'antd'; +import { Link } from 'react-router-dom'; + +import './ResultItem.less'; +import PublicationSelectContainer from '../../authors/containers/PublicationSelectContainer'; +import AuthorList from '../../common/components/AuthorList'; +import ResultItem from '../../common/components/ResultItem'; +import UnclickableTag from '../../common/components/UnclickableTag'; + +const AuthorResultItem = ({ item }: { item: any }) => { + return ( +
+ + + + + + + +
+
+ Author +
+ {item.get('display_name')} +
+ +
+ + + +
+

+ Completed +

+
+ This workflow has been completed. +
+
+ + + +

+ {new Date('2024-04-26T03:34:16.728144').toLocaleDateString()} +

+

submitter

+

ph19resch11003@iith.ac.in

+
+ + + +
+ hep-ph +
+
+ hep-ex +
+
+ physics +
+
+ +
+
+ ); +}; + +export default AuthorResultItem; diff --git a/ui/src/holdingpen/components/Breadcrumbs.less b/ui/src/holdingpen/components/Breadcrumbs.less new file mode 100644 index 0000000000..3488c2a634 --- /dev/null +++ b/ui/src/holdingpen/components/Breadcrumbs.less @@ -0,0 +1,17 @@ +.ant-breadcrumb { + margin: 1.2rem 0; + font-size: 1.1rem; +} + +.search-bar-small { + width: 350px; + transition: linear 0.25s; + .ant-input-group button, + .ant-input-group input { + height: 40px; + } +} + +.search-bar-small:focus-within { + width: 750px; +} diff --git a/ui/src/holdingpen/components/Breadcrumbs.tsx b/ui/src/holdingpen/components/Breadcrumbs.tsx new file mode 100644 index 0000000000..2a2c77eaf6 --- /dev/null +++ b/ui/src/holdingpen/components/Breadcrumbs.tsx @@ -0,0 +1,61 @@ +import React from 'react'; +import { Breadcrumb, Input } from 'antd'; +import { HomeOutlined } from '@ant-design/icons'; + +import './Breadcrumbs.less'; + +interface BreadcrumbItemProps { + title1: string; + href1: string; + title2?: string; + href2?: string; + dashboardPage?: boolean; +} + +const Breadcrumbs: React.FC = ({ + title1, + href1, + title2, + href2, + dashboardPage = false, +}) => { + const { Search } = Input; + + return ( +
+ + + + Inspirehep + + + + Holdingpen + + + {title1} + + {title2 && ( + + {title2} + + )} + + {!dashboardPage && ( + { + window.location.assign('/holdingpen/search'); + }} + onSearch={() => { + window.location.assign('/holdingpen/search'); + }} + className="search-bar-small" + /> + )} +
+ ); +}; + +export default Breadcrumbs; diff --git a/ui/src/holdingpen/components/ResultItem.less b/ui/src/holdingpen/components/ResultItem.less new file mode 100644 index 0000000000..8eb4df2d67 --- /dev/null +++ b/ui/src/holdingpen/components/ResultItem.less @@ -0,0 +1,33 @@ +.result-item { + .ant-card { + height: 100%; + .ant-card-body { + padding: 10px; + } + } + + .col-pub-select { + margin-right: 0.5rem; + margin-top: -3px; + } + + .col-details { + width: 55%; + } + + .col-details-2 { + width: 45%; + } + + .col-actions { + width: 29%; + } + + .col-info { + width: 18%; + } + + .col-subject { + width: 18%; + } +} diff --git a/ui/src/holdingpen/components/ResultItemWithActions.tsx b/ui/src/holdingpen/components/ResultItemWithActions.tsx new file mode 100644 index 0000000000..67caefb2e9 --- /dev/null +++ b/ui/src/holdingpen/components/ResultItemWithActions.tsx @@ -0,0 +1,158 @@ +import React from 'react'; +import { + CheckOutlined, + WarningFilled, + LoadingOutlined, + FilePdfOutlined, +} from '@ant-design/icons'; +import { Row, Col, Card, Button } from 'antd'; +import { Link } from 'react-router-dom'; + +import './ResultItem.less'; +import PublicationSelectContainer from '../../authors/containers/PublicationSelectContainer'; +import AuthorList from '../../common/components/AuthorList'; +import ResultItem from '../../common/components/ResultItem'; +import UnclickableTag from '../../common/components/UnclickableTag'; + +const ResultItemWithActions = ({ item }: { item: any }) => { + const renderActions = (item: any) => { + switch (item.get('status')) { + case 'completed': + return ( +
+

+ Completed +

+ + This workflow has been completed. +
+ ); + case 'awaiting decision': + return ( +
+

+ Automatic Decision:{' '} + CORE 0.62 +

+
+ + + +
+ +

+ References: 0/43 core, 0/43 matched +

+

1 Filtered core keywords from fulltext

+ Sigma/b +
+
+ ); + case 'error': + return ( +
+

+ Error +

+ + + This record is in error state. View the detailed record for more + information. + +
+ ); + case 'preparing': + return ( +
+

Preparing

+ + This record has not been run through the workflow yet. View the + detailed record to start it. + +
+ ); + case 'running': + return ( +
+

+ + Running +

+ This record is being processed. +
+ ); + default: + return null; + } + }; + + return ( +
+ + + + + + + + {item.get('title')} + + + + +
{item.get('abstract')}
+
+ + e-Print: 2404.15726 + +
+ + Public notes: Accepted at Robotics and Automation Magazine + (RAM) + +
+
+ + + {renderActions(item)} + + + +

+ {new Date('2024-04-26T03:34:16.728144').toLocaleDateString()} +

+

arXiv

+ + + PDF + +
+ + + +
+ Computing +
+
+ cs.CV +
+
+ cs.AI +
+
+ +
+
+ ); +}; + +export default ResultItemWithActions; diff --git a/ui/src/holdingpen/components/ResultitemWithComparison.tsx b/ui/src/holdingpen/components/ResultitemWithComparison.tsx new file mode 100644 index 0000000000..445f0dccac --- /dev/null +++ b/ui/src/holdingpen/components/ResultitemWithComparison.tsx @@ -0,0 +1,138 @@ +import React from 'react'; +import { CheckOutlined, FilePdfOutlined } from '@ant-design/icons'; +import { Row, Col, Card, Button } from 'antd'; +import { Link } from 'react-router-dom'; + +import PublicationSelectContainer from '../../authors/containers/PublicationSelectContainer'; +import AuthorList from '../../common/components/AuthorList'; +import ResultItem from '../../common/components/ResultItem'; +import UnclickableTag from '../../common/components/UnclickableTag'; + +const ResultitemWithComparison = ({ item }: { item: any }) => { + return ( +
+ + + + + + + + {item.get('title')} + + + + +
{item.get('abstract')}
+
+ + Published in: Nuclear Physics B 1004 (2024) , 116553 + +
+ + + + + + + + + +

+ {new Date('2024-04-26T03:34:16.728144').toLocaleDateString()} +

+

Elsevier

+ + + PDF + +
+ + + +
+ Phenomenology-HEP +
+
+ hep-ph +
+
+ +
+ Matches: + + + + + + + + {item.get('title')} + + + + +
{item.get('abstract')}
+
+ + Published in: Nuclear Physics B 1004 (2024) , 116553 + +
+ +
+ + + + + + + + {item.get('title')} + + + + +
{item.get('abstract')}
+
+ + Published in: Phys. Lett. (2023) , 116553 + +
+ +
+
+ ); +}; + +export default ResultitemWithComparison; diff --git a/ui/src/holdingpen/containers/DashboardPageContainer/DashboardPageContainer.less b/ui/src/holdingpen/containers/DashboardPageContainer/DashboardPageContainer.less index 323e0d280a..8c99545541 100644 --- a/ui/src/holdingpen/containers/DashboardPageContainer/DashboardPageContainer.less +++ b/ui/src/holdingpen/containers/DashboardPageContainer/DashboardPageContainer.less @@ -1,9 +1,236 @@ .__DashboardPageContainer__ { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100%; width: 100%; + + .inner-container { + display: flex; + flex-direction: column; + justify-content: center; + + .search-container { + margin: 50px auto; + padding: 15px; + max-width: 1300px; + width: 100%; + display: flex; + + .ant-input { + height: 3rem; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + + .ant-btn { + width: 3rem; + height: 3rem; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + } + + .cards-container { + margin: 50px auto; + display: flex; + justify-content: center; + flex-wrap: wrap; + max-width: 1300px; + + .ant-card { + margin: 20px 10px; + width: 300px; + border-width: 1px; + transition: ease 0.25s; + + .ant-card-head { + .ant-card-head-title p { + text-transform: uppercase; + text-wrap: wrap; + } + } + + .ant-card-body { + border-color: white; + } + } + } + } +} + +.ant-select-selection-item::first-letter, +.ant-select-item-option-content::first-letter { + text-transform: capitalize; +} + +// Color palette +.waiting { + color: #7b898a; +} +.error { + color: #e74c3c; +} +.halted { + color: #cfa90e; +} +.completed { + color: #16a085; +} +.running { + color: black; +} +.initial { + color: black; +} +.blue { + color: #2980b9; +} + +.bg-error { + background-color: #e74c3c; +} +.bg-completed { + background-color: #16a085; +} +.bg-halted { + background-color: #f39c12; +} +.bg-waiting { background-color: #f5f5f5; + font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; +} + +.font-white { + color: white; +} + +.__DashboardPageContainer__ { + .new-authors { + &:hover { + box-shadow: 0px 0px 10px 0px #3398db; + } + .ant-card-head { + color: #3398db; + } + } + + .new-publisher-harvests { + &:hover { + box-shadow: 0px 0px 10px 0px #1abc9c; + } + .ant-card-head { + color: #1abc9c; + } + } + + .publisher-updates { + &:hover { + box-shadow: 0px 0px 10px 0px #16a085; + } + .ant-card-head { + color: #16a085; + } + } + + .author-updates { + &:hover { + box-shadow: 0px 0px 10px 0px #2980b9; + } + .ant-card-head { + color: #2980b9; + } + } + + .new-arxiv-harvests { + &:hover { + box-shadow: 0px 0px 10px 0px #9c27b0; + } + .ant-card-head { + color: #9c27b0; + } + } + + .new-literature-submissions { + &:hover { + box-shadow: 0px 0px 10px 0px #e67e22; + } + .ant-card-head { + color: #e67e22; + } + } + + .arxiv-updates { + &:hover { + box-shadow: 0px 0px 10px 0px #8e44ad; + } + .ant-card-head { + color: #8e44ad; + } + } + + .all-harvests { + &:hover { + box-shadow: 0px 0px 10px 0px #829091; + } + .ant-card-head { + color: #829091; + } + } + + .merging { + &:hover { + box-shadow: 0px 0px 10px 0px #42b1b9; + } + .ant-card-head { + color: #42b1b9; + } + } + + .matching { + &:hover { + box-shadow: 0px 0px 10px 0px #5d35a7; + } + .ant-card-head { + color: #5d35a7; + } + } + + .core-selection { + &:hover { + box-shadow: 0px 0px 10px 0px #ed9b16; + } + .ant-card-head { + color: #ed9b16; + } + } + + .core-selection-approval { + &:hover { + box-shadow: 0px 0px 10px 0px #d3358c; + } + .ant-card-head { + color: #d3358c; + } + } +} + +.ant-tabs { + max-width: 1300px; + margin: 0 auto; + .ant-tabs-tab, + .ant-tabs-tab:focus-visible, + .ant-tabs-tab:active { + background: transparent !important; + border-bottom: none !important; + h3 { + margin-bottom: 0; + font-size: 1rem; + font-weight: 400; + color: black; + } + } + .ant-tabs-tab.ant-tabs-tab-active, + .ant-tabs-tab:focus-visible.ant-tabs-tab-active, + .ant-tabs-tab:active.ant-tabs-tab-active { + h3 { + color: #1890ff; + } + } } diff --git a/ui/src/holdingpen/containers/DashboardPageContainer/DashboardPageContainer.tsx b/ui/src/holdingpen/containers/DashboardPageContainer/DashboardPageContainer.tsx index 84698a4725..869caeb75f 100644 --- a/ui/src/holdingpen/containers/DashboardPageContainer/DashboardPageContainer.tsx +++ b/ui/src/holdingpen/containers/DashboardPageContainer/DashboardPageContainer.tsx @@ -1,18 +1,195 @@ import React from 'react'; +import classNames from 'classnames'; +import { + WarningOutlined, + CheckOutlined, + StopOutlined, + HourglassOutlined, + LoadingOutlined, + InfoCircleOutlined, +} from '@ant-design/icons'; +import { Card, Input, Select, Tabs } from 'antd'; +import { Link } from 'react-router-dom'; import './DashboardPageContainer.less'; +import { tasks, actions } from './mockData'; +import Breadcrumbs from '../../components/Breadcrumbs'; interface DashboardPageContainerProps { data?: any; } +const TEXT_CENTER: Record = { + textAlign: 'center', +}; + +const { Option } = Select; + +const { Search } = Input; + +const selectBefore = ( + +); + +const getIcon = (action: string) => { + switch (action.toLowerCase()) { + case 'waiting': + return ; + case 'awaiting decision': + return ; + case 'error': + return ; + case 'halted': + return ; + case 'completed': + return ; + case 'running': + return ; + case 'initial': + return ; + default: + return null; + } +}; + const DashboardPage: React.FC = () => { + const tabItems = [ + { + label:

Tasks

, + key: '1', + children: ( + <> + + View all + +
+ {tasks?.map((item: any) => ( + +

{item.title}

+

{item.total}

+ + View all + +
+ } + headStyle={TEXT_CENTER} + className={classNames( + item.title.toLowerCase().replace(/ /g, '-') + )} + key={item.title} + > + {item.actions.map((action: any) => ( + +
+

+ {getIcon(action.action)} + {action.action} +

+ {action.number} +
+
+ ))} + + ))} + + + ), + }, + { + label:

Actions

, + key: '2', + children: ( + <> + + View all + +
+ {actions?.map((item: any) => ( + +

{item.title}

+

{item.total}

+ + View all + +
+ } + headStyle={TEXT_CENTER} + className={classNames( + item.title.toLowerCase().replace(/ /g, '-') + )} + key={item.title} + > + {item.actions.map((action: any) => ( + +
+

+ {getIcon(action.action)} + {action.action} +

+ {action.number} +
+
+ ))} + + ))} + + + ), + }, + ]; + return (
- Dashboard Page + +
+

Search Holdingpen

+
+ { + window.location.assign('/holdingpen/search'); + }} + onSearch={() => { + window.location.assign('/holdingpen/search'); + }} + /> +
+

Overview

+ +
); }; diff --git a/ui/src/holdingpen/containers/DashboardPageContainer/mockData.ts b/ui/src/holdingpen/containers/DashboardPageContainer/mockData.ts new file mode 100644 index 0000000000..dd018780e9 --- /dev/null +++ b/ui/src/holdingpen/containers/DashboardPageContainer/mockData.ts @@ -0,0 +1,133 @@ +export const tasks = [ + { + title: 'new authors', + total: 1, + actions: [ + { action: 'Waiting', number: 0 }, + { action: 'Error', number: 1 }, + { action: 'Halted', number: 0 }, + { action: 'Completed', number: 0 }, + { action: 'Running', number: 0 }, + { action: 'Initial', number: 0 }, + ], + }, + { + title: 'author updates', + total: 0, + actions: [ + { action: 'Waiting', number: 0 }, + { action: 'Error', number: 0 }, + { action: 'Halted', number: 0 }, + { action: 'Completed', number: 0 }, + { action: 'Running', number: 0 }, + { action: 'Initial', number: 0 }, + ], + }, + { + title: 'new arxiv harvests', + total: 2323, + actions: [ + { action: 'Waiting', number: 0 }, + { action: 'Error', number: 1 }, + { action: 'Halted', number: 2 }, + { action: 'Completed', number: 3 }, + { action: 'Running', number: 4 }, + { action: 'Initial', number: 5 }, + ], + }, + { + title: 'Arxiv updates', + total: 329927, + actions: [ + { action: 'Waiting', number: 0 }, + { action: 'Error', number: 1 }, + { action: 'Halted', number: 2 }, + { action: 'Completed', number: 3 }, + { action: 'Running', number: 4 }, + { action: 'Initial', number: 5 }, + ], + }, + { + title: 'New literature submissions', + total: 2, + actions: [ + { action: 'Waiting', number: 0 }, + { action: 'Error', number: 1 }, + { action: 'Halted', number: 2 }, + { action: 'Completed', number: 3 }, + { action: 'Running', number: 4 }, + { action: 'Initial', number: 5 }, + ], + }, + { + title: 'New publisher harvests', + total: 756, + actions: [ + { action: 'Waiting', number: 0 }, + { action: 'Error', number: 1 }, + { action: 'Halted', number: 2 }, + { action: 'Completed', number: 3 }, + { action: 'Running', number: 4 }, + { action: 'Initial', number: 5 }, + ], + }, + { + title: 'Publisher updates', + total: 2777, + actions: [ + { action: 'Waiting', number: 0 }, + { action: 'Error', number: 1 }, + { action: 'Halted', number: 2 }, + { action: 'Completed', number: 3 }, + { action: 'Running', number: 4 }, + { action: 'Initial', number: 5 }, + ], + }, + { + title: 'all harvests', + total: 23232, + actions: [ + { action: 'Waiting', number: 0 }, + { action: 'Error', number: 1 }, + { action: 'Halted', number: 2 }, + { action: 'Completed', number: 3 }, + { action: 'Running', number: 4 }, + { action: 'Initial', number: 5 }, + ], + }, +]; + +export const actions = [ + { + title: 'merging', + total: 110, + actions: [ + { action: 'Awaiting decision', number: 21 }, + { action: 'Completed', number: 89 }, + ], + }, + { + title: 'matching', + total: 70, + actions: [ + { action: 'Awaiting decision', number: 14 }, + { action: 'Completed', number: 56 }, + ], + }, + { + title: 'core selection', + total: 33, + actions: [ + { action: 'Awaiting decision', number: 30 }, + { action: 'Completed', number: 3 }, + ], + }, + { + title: 'core selection approval', + total: 923, + actions: [ + { action: 'Awaiting decision', number: 30 }, + { action: 'Completed', number: 893 }, + ], + }, +]; diff --git a/ui/src/holdingpen/containers/DetailPageContainer/AuthorDetailPageContainer.tsx b/ui/src/holdingpen/containers/DetailPageContainer/AuthorDetailPageContainer.tsx new file mode 100644 index 0000000000..eae59c6027 --- /dev/null +++ b/ui/src/holdingpen/containers/DetailPageContainer/AuthorDetailPageContainer.tsx @@ -0,0 +1,314 @@ +import React from 'react'; +import { Row, Col, Button, Table } from 'antd'; +import { + LinkedinOutlined, + GithubOutlined, + EditOutlined, + RedoOutlined, + SyncOutlined, + CheckCircleOutlined, + CloseCircleOutlined, +} from '@ant-design/icons'; +import { List } from 'immutable'; + +import './DetailPageContainer.less'; +import Breadcrumbs from '../../components/Breadcrumbs'; +import item from '../../mocks/mockAuthorData'; +import ContentBox from '../../../common/components/ContentBox'; +import LiteratureTitle from '../../../common/components/LiteratureTitle'; +import CollapsableForm from '../../../submissions/common/components/CollapsableForm'; + +interface AuthorDetailPageContainerProps { + item: any; +} + +const OPEN_SECTIONS = ['institutions', 'projects', 'links', 'other', 'delete']; + +const columnsInstitutions = [ + { + title: 'Institution', + dataIndex: 'name', + key: 'institution', + }, + { + title: 'Start date', + dataIndex: 'start_date', + key: 'start', + }, + { + title: 'End date', + dataIndex: 'end_date', + key: 'end', + }, + { + title: 'Rank', + dataIndex: 'rank', + key: 'rank', + }, + { + title: 'Current', + dataIndex: 'current', + key: 'current', + render: (current: string) => + current === 'true' ? ( + + ) : ( + + ), + align: 'center' as const, + }, +]; + +const columnsProjects = [ + { + title: 'Project name', + dataIndex: 'name', + key: 'name', + }, + { + title: 'Current', + dataIndex: 'current', + key: 'current', + render: (current: string) => + current === 'true' ? ( + + ) : ( + + ), + align: 'center' as const, + }, + { + title: 'Start date', + dataIndex: 'start_date', + key: 'start', + }, + { + title: 'End date', + dataIndex: 'end_date', + key: 'end', + }, +]; + +const columnsSubject = [ + { + title: 'Term', + dataIndex: 'term', + key: 'term', + }, + { + title: 'Action', + key: 'action', + render: () => x, + width: '10%', + align: 'center' as const, + }, +]; + +const columnsAdvisors = [ + { + title: 'Name', + dataIndex: 'name', + key: 'name', + }, + { + title: 'Position', + dataIndex: 'position', + key: 'position', + }, + { + title: 'Action', + key: 'action', + render: () => x, + width: '10%', + align: 'center' as const, + }, +]; + +const AuthorDetailPageContainer: React.FC< + AuthorDetailPageContainerProps +> = () => { + const { Column } = Table; + return ( +
+ + + + + +
+

+ HALTED on: ‘Accept submission?’ +

+
+ +
+ + + +

+ +

+

+ Preferred name: {item.get('preferred_name')} +

+

+ Status: {item.get('status')} +

+

+ ORCID:{' '} + + {item.get('orcid')} + +

+
+ + + )?.toJS() as any[] + } + pagination={false} + size="small" + /> + + +
)?.toJS() as any[] + } + pagination={false} + size="small" + /> + + +

+ Linkedin: + rk-pradhan +

+

+ Github: + https://github.com/Rk-pradhan +

+
+ + + +

Subject areas

+
+ )?.toJS() as any[] + } + pagination={false} + size="small" + /> + + +

Advisors

+
)?.toJS() as any[] + } + pagination={false} + size="small" + /> + + + + + + + + + + +
+ + + + +
+
+ + Submitted by kumarriteshpradhan@gmail.com on{' '} + + {new Date('2024-05-20T15:30:20.467877').toLocaleDateString()} + + . + + + "Thank you for reviewing my submission“ + + + + See related ticket (#3fd9a10997dec2906fd43e871153af58) + + + +
+ + + +
+
+ + + + + + ); +}; + +export default AuthorDetailPageContainer; diff --git a/ui/src/holdingpen/containers/DetailPageContainer/DetailPageContainer.less b/ui/src/holdingpen/containers/DetailPageContainer/DetailPageContainer.less index 88fe402271..a18df981c0 100644 --- a/ui/src/holdingpen/containers/DetailPageContainer/DetailPageContainer.less +++ b/ui/src/holdingpen/containers/DetailPageContainer/DetailPageContainer.less @@ -1,9 +1,26 @@ .__DetailPageContainer__ { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100%; width: 100%; - background-color: #f5f5f5; + + .ant-collapse-content-box { + padding-bottom: 1rem; + .error-code { + white-space: pre-line; + padding: 10px 25px; + text-indent: -15px; + margin-left: 15px; + } + .ant-list-footer { + display: none; + } + } + + .__ReferenceList__ { + .ant-card { + border: none; + } + } + + .ant-switch-checked { + background-color: #16a085; + } } diff --git a/ui/src/holdingpen/containers/DetailPageContainer/DetailPageContainer.tsx b/ui/src/holdingpen/containers/DetailPageContainer/DetailPageContainer.tsx index fc3facaade..26252c5a98 100644 --- a/ui/src/holdingpen/containers/DetailPageContainer/DetailPageContainer.tsx +++ b/ui/src/holdingpen/containers/DetailPageContainer/DetailPageContainer.tsx @@ -1,18 +1,269 @@ import React from 'react'; +import Immutable, { List } from 'immutable'; +import { SyncOutlined, RedoOutlined, EditOutlined } from '@ant-design/icons'; +import { Row, Col, Button, Input, Space, Switch } from 'antd'; import './DetailPageContainer.less'; +import Breadcrumbs from '../../components/Breadcrumbs'; +import item from '../../mocks/mockDetaiPageData'; +import references from '../../mocks/mockReferencesData'; +import ContentBox from '../../../common/components/ContentBox'; +import LiteratureTitle from '../../../common/components/LiteratureTitle'; +import PublicationInfoList from '../../../common/components/PublicationInfoList'; +import Abstract from '../../../literature/components/Abstract'; +import DOIList from '../../../literature/components/DOIList'; +import CollapsableForm from '../../../submissions/common/components/CollapsableForm'; +import AuthorList from '../../../common/components/AuthorList'; +import ReferenceList from '../../../literature/components/ReferenceList'; +import UnclickableTag from '../../../common/components/UnclickableTag/UnclickableTag'; interface DetailPageContainerProps { - data?: any; + item?: any; } +const OPEN_SECTIONS = ['references', 'errors', 'delete']; + const DetailPageContainer: React.FC = () => { + const numberOfAuthors = (item.get('authors') as List)?.size || 0; return (
- Detail Page + + +
+ + +
+

+ ERROR on: Raise if a matching wf is not in completed state in + the HoldingPen. View Stack Trace +

+
+ + + + + +

+ +

+
+ + ({numberOfAuthors} authors) +
+
+ +
+ +
+ +
+ + + +

+ +

+
+ + ({numberOfAuthors} authors) +
+
+ +
+ +
+ +
+
+ + +
+ + + {}} + /> + + +
+ {item.get('error')} +
+
+ +
+ + Term + + + Source + +
+
+ Experiment-HEP + 12 +
+ + + + +
+ +
+ + Name + +
+ + Score + + + Accept + +
+
+
+ HEP +
+ 0.33 + + + + + +
+
+
+ Physics +
+ 0.33 + + + + + +
+
+
+ Quantum physics +
+ 0.33 + + + + + +
+
+ + + + +
+ + + + + +
+ + Automatic Decision:{' '} + Non-CORE 0.55 +
+
+ References: 17/60 core, 52/60 matched +
+
+ + 4 core keywords from fulltext. + +
+
+ + 1 Filtered : + +
+
+ neutrino, mass + 12 +
+
+ + Harvested on{' '} + + {new Date('2024-05-20T15:30:20.467877').toLocaleDateString()} + {' '} + from APS using + hepcrawl. + + + No SNow tickets found. + + +
+ + + +
+
+ + + + ); }; diff --git a/ui/src/holdingpen/containers/SearchPageContainer/SearchPageContainer.less b/ui/src/holdingpen/containers/SearchPageContainer/SearchPageContainer.less index 90ae47aaa7..74816159a1 100644 --- a/ui/src/holdingpen/containers/SearchPageContainer/SearchPageContainer.less +++ b/ui/src/holdingpen/containers/SearchPageContainer/SearchPageContainer.less @@ -1,9 +1,14 @@ .__SearchPageContainer__ { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 100%; width: 100%; - background-color: #f5f5f5; + max-width: 2200px; + + .facet-category { + font-size: 1rem; + margin-top: 1rem; + font-weight: 600; + } + + .ant-tag { + margin-right: 0; + } } diff --git a/ui/src/holdingpen/containers/SearchPageContainer/SearchPageContainer.tsx b/ui/src/holdingpen/containers/SearchPageContainer/SearchPageContainer.tsx index e91706d89e..bcb2e39f43 100644 --- a/ui/src/holdingpen/containers/SearchPageContainer/SearchPageContainer.tsx +++ b/ui/src/holdingpen/containers/SearchPageContainer/SearchPageContainer.tsx @@ -1,18 +1,141 @@ -import React from 'react'; +import React, { useState } from 'react'; +import { Row, Col, Card, Checkbox, Select } from 'antd'; +import { List } from 'immutable'; import './SearchPageContainer.less'; +import { data, facets } from '../../mocks/mockSearchData'; +import Breadcrumbs from '../../components/Breadcrumbs'; +import LoadingOrChildren from '../../../common/components/LoadingOrChildren'; +import { SEARCH_PAGE_GUTTER } from '../../../common/constants'; +import SearchResults from '../../../common/components/SearchResults'; +import NumberOfResults from '../../../common/components/NumberOfResults'; +import SearchPagination from '../../../common/components/SearchPagination'; +import PublicationsSelectAllContainer from '../../../authors/containers/PublicationsSelectAllContainer'; +import UnclickableTag from '../../../common/components/UnclickableTag'; +import ResultItemWithActions from '../../components/ResultItemWithActions'; +import ResultitemWithComparison from '../../components/ResultitemWithComparison'; +import AuthorResultItem from '../../components/AuthorResultItem'; +import mockAuthorData from '../../mocks/mockAuthorData'; interface SearchPageContainerProps { data?: any; } +const renderResultItem = (item: any) => { + return ; +}; + const SearchPageContainer: React.FC = () => { + const [loading, setLoading] = useState(true); + + const resolveLoading = () => { + setTimeout(() => setLoading(false), 2500); + }; + + resolveLoading(); + return (
- Search Page + + +
+ + +

Results per page

+ + {facets.map( + (facet: { + category: string; + filters: { name: string; doc_count: number }[]; + }) => ( + <> + +

+ Filter by {facet.category} +

+
+ {facet.filters.map((filter) => ( + +
+ + {filter.name} + + + + {filter.doc_count} + + + ))} + + ) + )} + + + + + + + + + + + + Action & Status + + + Submission Info + + + Subject Areas + + + + + +
+
+ + + ); }; diff --git a/ui/src/holdingpen/containers/__tests__/DashboardPageContainer.test.tsx b/ui/src/holdingpen/containers/__tests__/DashboardPageContainer.test.tsx index bae9e83cac..a5c7bcb6e4 100644 --- a/ui/src/holdingpen/containers/__tests__/DashboardPageContainer.test.tsx +++ b/ui/src/holdingpen/containers/__tests__/DashboardPageContainer.test.tsx @@ -1,15 +1,30 @@ import React from 'react'; +import { Provider } from 'react-redux'; +import { MemoryRouter } from 'react-router-dom'; import { render } from '@testing-library/react'; +import { getStore } from '../../../fixtures/store'; import DashboardPageContainer from '../DashboardPageContainer/DashboardPageContainer'; describe('DashboardPageContainer', () => { it('renders without crashing', () => { - render(); + render( + + + + + + ); }); it('renders the DashboardPage component', () => { - const { getByTestId } = render(); + const { getByTestId } = render( + + + + + + ); const dashboardPage = getByTestId('holdingpen-dashboard-page'); expect(dashboardPage).toBeInTheDocument(); }); diff --git a/ui/src/holdingpen/containers/__tests__/SearchPageContainer.test.tsx b/ui/src/holdingpen/containers/__tests__/SearchPageContainer.test.tsx index d09d95bfb5..4cfee01e59 100644 --- a/ui/src/holdingpen/containers/__tests__/SearchPageContainer.test.tsx +++ b/ui/src/holdingpen/containers/__tests__/SearchPageContainer.test.tsx @@ -1,15 +1,30 @@ import React from 'react'; +import { MemoryRouter } from 'react-router-dom'; +import { Provider } from 'react-redux'; import { render } from '@testing-library/react'; +import { getStore } from '../../../fixtures/store'; import SearchPageContainer from '../SearchPageContainer/SearchPageContainer'; describe('SearchPageContainer', () => { it('renders without crashing', () => { - render(); + render( + + + + + + ); }); it('renders the SearchPage component', () => { - const { getByTestId } = render(); + const { getByTestId } = render( + + + + + + ); const searchPage = getByTestId('holdingpen-search-page'); expect(searchPage).toBeInTheDocument(); }); diff --git a/ui/src/holdingpen/index.tsx b/ui/src/holdingpen/index.tsx index a3b4e94aa9..14b946dd73 100644 --- a/ui/src/holdingpen/index.tsx +++ b/ui/src/holdingpen/index.tsx @@ -10,6 +10,7 @@ import { HOLDINGPEN_SEARCH, } from '../common/routes'; import SafeSwitch from '../common/components/SafeSwitch'; +import AuthorDetailPageContainer from './containers/DetailPageContainer/AuthorDetailPageContainer'; import DocumentHead from '../common/components/DocumentHead'; const META_DESCRIPTION = 'Tool for curators to manage submissions and harvests'; @@ -33,6 +34,11 @@ const Holdingpen = () => { path={`${HOLDINGPEN}/:id`} component={DetailPageContainer} /> + diff --git a/ui/src/holdingpen/mocks/mockAuthorData.ts b/ui/src/holdingpen/mocks/mockAuthorData.ts new file mode 100644 index 0000000000..4399724728 --- /dev/null +++ b/ui/src/holdingpen/mocks/mockAuthorData.ts @@ -0,0 +1,75 @@ +import { List, Map } from 'immutable'; + +export default Map({ + id: 123456, + display_name: 'Doe, John Marc', + name: Map({ title: 'John Marc Doe' }), + preferred_name: 'Johnny Marc Doe', + status: 'active', + orcid: '0000-0000-0000-0000', + author_profile: Map({ + url: 'https://inspirehep.net/authors/1072974', + value: 'J.D.Siemieniuk.1', + }), + institutions: List([ + Map({ + name: 'University of Toronto', + rank: 1, + start_date: '2019', + end_date: '-', + current: 'true', + }), + Map({ + name: 'Sunnybrook Health Sciences Centre', + rank: 2, + start_date: '2007', + end_date: '2019', + current: 'false', + }), + Map({ + name: 'University of Warsaw', + rank: 3, + start_date: '1998', + end_date: '2007', + current: 'false', + }), + ]), + projects: List([ + Map({ + name: 'Project A', + start_date: '2019', + end_date: '-', + current: 'true', + }), + Map({ + name: 'Project B', + start_date: '2007', + end_date: '2019', + current: 'false', + }), + Map({ + name: 'Project C', + start_date: '1998', + end_date: '2007', + current: 'false', + }), + ]), + subject_areas: List([ + Map({ + term: 'hep-ex', + }), + Map({ + term: 'hep-ph', + }), + ]), + advisors: List([ + Map({ + name: 'Giri, Anjan', + position: 'PhD', + }), + Map({ + name: 'Gugri, Injan', + position: 'PhD', + }), + ]), +}); diff --git a/ui/src/holdingpen/mocks/mockDetaiPageData.ts b/ui/src/holdingpen/mocks/mockDetaiPageData.ts new file mode 100644 index 0000000000..c65d434264 --- /dev/null +++ b/ui/src/holdingpen/mocks/mockDetaiPageData.ts @@ -0,0 +1,81 @@ +import { List, Map } from 'immutable'; + +export default Map({ + title: Map({ title: 'Introduction to Quantum Mechanics' }), + id: 1, + abstract: Map({ + value: + ' But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure? On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee', + }), + keywords: ['quantum', 'mechanics', 'physics'], + authors: List([ + Map({ name: 'John Smith', affiliation: 'University X' }), + Map({ name: 'Emily Johnson', affiliation: 'University Y' }), + Map({ name: 'Robert Brown', affiliation: 'University Z' }), + Map({ name: 'Sarah White', affiliation: 'University W' }), + ]), + date: '2024-04-02', + publisher: 'Science Publishers Inc.', + dois: List([Map({ value: '10.1234/5678' }), Map({ value: '10.8765/4321' })]), + publicationInfo: List([ + Map({ + journal_title: 'Science Publishers Inc.', + volume: '12', + journal_issue: '4', + page_start: '123', + page_end: '456', + }), + ]), + status: 'completed', + error: `Traceback (most recent call last): + File "/usr/lib/python2.7/site-packages/workflow/engine.py", line 529, in _process + self.run_callbacks(callbacks, objects, obj) + File "/usr/lib/python2.7/site-packages/workflow/engine.py", line 465, in run_callbacks + indent + 1) + File "/usr/lib/python2.7/site-packages/workflow/engine.py", line 465, in run_callbacks + indent + 1) + File "/usr/lib/python2.7/site-packages/workflow/engine.py", line 481, in run_callbacks + self.execute_callback(callback_func, obj) + File "/usr/lib/python2.7/site-packages/workflow/engine.py", line 564, in execute_callback + callback(obj, self) + File "/code/inspirehep/modules/workflows/utils/__init__.py", line 155, in _decorator + res = func(*args, **kwargs) + File "/code/inspirehep/modules/workflows/tasks/arxiv.py", line 130, in arxiv_package_download + url=current_app.config['ARXIV_TARBALL_URL'].format(arxiv_id=arxiv_id), + File "/usr/lib/python2.7/site-packages/backoff/_sync.py", line 94, in retry + ret = target(*args, **kwargs) + File "/code/inspirehep/modules/workflows/utils/__init__.py", line 344, in download_file_to_workflow + workflow.files[name] = req.raw + File "/usr/lib/python2.7/site-packages/invenio_records_files/api.py", line 101, in wrapper + return method(self, *args, **kwargs) + File "/usr/lib/python2.7/site-packages/invenio_records_files/api.py", line 170, in __setitem__ + bucket=self.bucket, key=key, stream=stream + File "/usr/lib/python2.7/site-packages/invenio_files_rest/models.py", line 1169, in create + obj.set_contents(stream, **kwargs) + File "/usr/lib/python2.7/site-packages/invenio_files_rest/models.py", line 145, in inner + return f(self, *args, **kwargs) + File "/usr/lib/python2.7/site-packages/invenio_files_rest/models.py", line 131, in inner + res = f(self, *args, **kwargs) + File "/usr/lib/python2.7/site-packages/invenio_files_rest/models.py", line 1010, in set_contents + default_storage_class=self.bucket.default_storage_class, + File "/usr/lib/python2.7/site-packages/invenio_files_rest/models.py", line 145, in inner + return f(self, *args, **kwargs) + File "/usr/lib/python2.7/site-packages/invenio_files_rest/models.py", line 830, in set_contents + size_limit=size_limit, progress_callback=progress_callback)) + File "/usr/lib/python2.7/site-packages/invenio_xrootd/storage.py", line 111, in inner + res = f(self, *args, **kwargs) + File "/usr/lib/python2.7/site-packages/invenio_xrootd/storage.py", line 175, in save + return super(EOSFileStorage, self).save(*args, **kwargs) + File "/usr/lib/python2.7/site-packages/invenio_files_rest/storage/pyfs.py", line 99, in save + fp = self.open(mode='wb') + File "/usr/lib/python2.7/site-packages/invenio_files_rest/storage/pyfs.py", line 58, in open + return fs.open(path, mode=mode) + File "/usr/lib/python2.7/site-packages/xrootdpyfs/fs.py", line 197, in open + **kwargs + File "/usr/lib/python2.7/site-packages/xrootdpyfs/xrdfile.py", line 126, in __init__ + "instantiating file ({0})".format(path)) + File "/usr/lib/python2.7/site-packages/xrootdpyfs/xrdfile.py", line 140, in _raise_status + raise IOError(errstr) + IOError: XRootD error instantiating file (root://eospublic.cern.ch//eos/workspace/i/inspireqa/app/var/data/workflows/files/22/ac/73d1-b19d-4dcc-afa2-0edf97530a69/data?eos.bookingsize=104857600) file: [ERROR] Server responded with an error: [3021] Unable to get quota space - quota not defined or exhausted /eos/workspace/i/inspireqa/app/var/data/workflows/files/22/ac/73d1-b19d-4dcc-afa2-0edf97530a69/data; Disk quota exceeded +`, +}); diff --git a/ui/src/holdingpen/mocks/mockReferencesData.ts b/ui/src/holdingpen/mocks/mockReferencesData.ts new file mode 100644 index 0000000000..d3b224102e --- /dev/null +++ b/ui/src/holdingpen/mocks/mockReferencesData.ts @@ -0,0 +1,308 @@ +import { List, Map } from 'immutable'; + +export default List([ + Map({ + authors: List([ + Map({ + last_name: 'P.Armitage', + full_name: 'P.Armitage, N.', + first_name: 'N.', + }), + Map({ + last_name: 'J.Mele', + full_name: 'J.Mele, E.', + first_name: 'E.', + }), + Map({ + full_name: 'A.Vishwanath', + first_name: 'A.Vishwanath', + }), + ]), + publication_info: List([ + Map({ + journal_volume: '90', + artid: '015001', + year: 2018, + journal_title: 'Rev.Mod.Phys.', + }), + ]), + label: '1', + dois: List([ + Map({ + value: '10.1103/RevModPhys.90.015001', + }), + ]), + }), + Map({ + authors: List([ + Map({ + full_name: 'Z.Fang', + first_name: 'Z.Fang', + }), + ]), + publication_info: List([ + Map({ + journal_volume: '302', + artid: '92', + page_start: '92', + year: 2003, + journal_title: 'Science', + }), + ]), + label: '2', + dois: List([ + Map({ + value: '10.1126/science.1089408', + }), + ]), + }), + Map({ + authors: List([ + Map({ + full_name: 'R.Shimano', + first_name: 'R.Shimano', + }), + ]), + publication_info: List([ + Map({ + journal_volume: '95', + artid: '17002', + year: 2011, + journal_title: 'EPL', + }), + ]), + label: '3', + dois: List([ + Map({ + value: '10.1209/0295-5075/95/17002', + }), + ]), + }), + Map({ + misc: 'Nat. Commun. 7, 11788', + authors: List([ + Map({ + full_name: 'S.Itoh', + first_name: 'S.Itoh', + }), + ]), + publication_info: List([ + Map({ + year: 2016, + }), + ]), + label: '4', + dois: List([ + Map({ + value: '10.1038/ncomms11788', + }), + ]), + }), + // { + // authors: [ + // { + // full_name: "K.Jenni", + // first_name: "K.Jenni" + // } + // ], + // arxiv_eprint: [ + // { + // "value": "1902.04036" + // } + // ], + // label: "5" + // }, + // { + // authors: [ + // { + // full_name: "X.Wan", + // first_name: "X.Wan" + // } + // ], + // publication_info: [ + // { + // journal_volume: "83", + // artid: "205101", + // year: 2011, + // journal_title: "Phys.Rev.B" + // } + // ], + // label: "6", + // dois: [ + // { + // "value": "10.1103/PhysRevB.83.205101" + // } + // ] + // }, + // { + // misc: "Nat. Commun. 6, 10042", + // authors: [ + // { + // full_name: "T.Kondo", + // first_name: "T.Kondo" + // } + // ], + // publication_info: [ + // { + // year: 2015 + // } + // ], + // label: "7", + // dois: [ + // { + // "value": "10.1038/ncomms10042" + // } + // ] + // }, + // { + // misc: "Nat. Commun. 8, 15515", + // authors: [ + // { + // full_name: "K.Ueda", + // first_name: "K.Ueda" + // } + // ], + // publication_info: [ + // { + // year: 2017 + // } + // ], + // label: "8", + // dois: [ + // { + // "value": "10.1038/ncomms15515" + // } + // ] + // }, + // { + // misc: "Nat. Commun. 9, 3032", + // authors: [ + // { + // full_name: "K.Ueda", + // first_name: "K.Ueda" + // } + // ], + // publication_info: [ + // { + // year: 2018 + // } + // ], + // label: "9", + // dois: [ + // { + // "value": "10.1038/s41467-018-05530-9" + // } + // ] + // }, + // { + // misc: "Sci. Adv. 4, eaar7880", + // authors: [ + // { + // last_name: "S.Takahashi", + // full_name: "S.Takahashi, K.", + // first_name: "K." + // } + // ], + // publication_info: [ + // { + // year: 2018 + // } + // ], + // label: "10", + // dois: [ + // { + // "value": "10.1126/sciadv.aar7880" + // } + // ] + // }, + // { + // authors: [ + // { + // full_name: "H.Isobe", + // first_name: "H.Isobe" + // }, + // { + // full_name: "B.-J.Yang", + // first_name: "B.-J.Yang" + // }, + // { + // full_name: "A.Chubukov", + // first_name: "A.Chubukov" + // }, + // { + // full_name: "J.Schmalian", + // first_name: "J.Schmalian" + // }, + // { + // full_name: "N.Nagaosa", + // first_name: "N.Nagaosa" + // } + // ], + // publication_info: [ + // { + // journal_volume: "116", + // artid: "076803", + // year: 2016, + // journal_title: "Phys.Rev.Lett." + // } + // ], + // label: "11", + // dois: [ + // { + // "value": "10.1103/PhysRevLett.116.076803" + // } + // ] + // }, + // { + // authors: [ + // { + // full_name: "H.Isobe", + // first_name: "H.Isobe" + // }, + // { + // full_name: "N.Nagaosa", + // first_name: "N.Nagaosa" + // } + // ], + // publication_info: [ + // { + // journal_volume: "116", + // artid: "116803", + // year: 2016, + // journal_title: "Phys.Rev.Lett." + // } + // ], + // label: "12", + // dois: [ + // { + // "value": "10.1103/PhysRevLett.116.116803" + // } + // ] + // }, + // { + // authors: [ + // { + // full_name: "T.Morimoto", + // first_name: "T.Morimoto" + // }, + // { + // full_name: "N.Nagaosa", + // first_name: "N.Nagaosa" + // } + // ], + // publication_info: [ + // { + // journal_volume: "6", + // artid: "19853", + // year: 2016, + // journal_title: "Sci.Rep." + // } + // ], + // label: "13", + // dois: [ + // { + // "value": "10.1038/srep19853" + // } + // ] + // } +]); diff --git a/ui/src/holdingpen/mocks/mockSearchData.ts b/ui/src/holdingpen/mocks/mockSearchData.ts new file mode 100644 index 0000000000..c7f9b83dad --- /dev/null +++ b/ui/src/holdingpen/mocks/mockSearchData.ts @@ -0,0 +1,155 @@ +import { List, Map } from 'immutable'; + +export const data = List([ + Map({ + title: 'Introduction to Quantum Mechanics', + id: 1, + abstract: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec varius massa. Sed eleifend, ipsum at dignissim sollicitudin, ante odio laoreet nulla, at convallis purus ex sit amet dolor.', + keywords: ['quantum', 'mechanics', 'physics'], + authors: List([ + Map({ name: 'John Smith', affiliation: 'University X' }), + Map({ name: 'Emily Johnson', affiliation: 'University Y' }), + ]), + date: '2024-04-02', + publisher: 'Science Publishers Inc.', + status: 'completed', + }), + Map({ + title: 'Advancements in Artificial Intelligence', + id: 2, + abstract: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec varius massa. Sed eleifend, ipsum at dignissim sollicitudin, ante odio laoreet nulla, at convallis purus ex sit amet dolor.', + keywords: [ + 'artificial intelligence', + 'machine learning', + 'neural networks', + ], + authors: List([ + Map({ name: 'Michael Brown', affiliation: 'Tech University' }), + Map({ name: 'Sophia Martinez', affiliation: 'AI Research Institute' }), + ]), + date: '2024-04-02', + publisher: 'Tech Publishing Group', + status: 'awaiting decision', + }), + Map({ + title: 'Introduction to Quantum Mechanics', + id: 3, + abstract: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec varius massa. Sed eleifend, ipsum at dignissim sollicitudin, ante odio laoreet nulla, at convallis purus ex sit amet dolor.', + keywords: ['quantum', 'mechanics', 'physics'], + authors: List([ + Map({ name: 'John Smith', affiliation: 'University X' }), + Map({ name: 'Emily Johnson', affiliation: 'University Y' }), + ]), + date: '2024-04-02', + publisher: 'Science Publishers Inc.', + status: 'error', + }), + Map({ + title: 'Advancements in Artificial Intelligence', + id: 4, + abstract: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec varius massa. Sed eleifend, ipsum at dignissim sollicitudin, ante odio laoreet nulla, at convallis purus ex sit amet dolor.', + keywords: [ + 'artificial intelligence', + 'machine learning', + 'neural networks', + ], + authors: List([ + Map({ name: 'Michael Brown', affiliation: 'Tech University' }), + Map({ name: 'Sophia Martinez', affiliation: 'AI Research Institute' }), + ]), + date: '2024-04-02', + publisher: 'Tech Publishing Group', + status: 'preparing', + }), + Map({ + title: 'Introduction to Quantum Mechanics', + id: 5, + abstract: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec varius massa. Sed eleifend, ipsum at dignissim sollicitudin, ante odio laoreet nulla, at convallis purus ex sit amet dolor.', + keywords: ['quantum', 'mechanics', 'physics'], + authors: List([ + Map({ name: 'John Smith', affiliation: 'University X' }), + Map({ name: 'Emily Johnson', affiliation: 'University Y' }), + ]), + date: '2024-04-02', + publisher: 'Science Publishers Inc.', + status: 'awaiting decision', + }), + Map({ + title: 'Advancements in Artificial Intelligence', + id: 6, + abstract: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec varius massa. Sed eleifend, ipsum at dignissim sollicitudin, ante odio laoreet nulla, at convallis purus ex sit amet dolor.', + keywords: [ + 'artificial intelligence', + 'machine learning', + 'neural networks', + ], + authors: List([ + Map({ name: 'Michael Brown', affiliation: 'Tech University' }), + Map({ name: 'Sophia Martinez', affiliation: 'AI Research Institute' }), + ]), + date: '2024-04-02', + publisher: 'Tech Publishing Group', + status: 'running', + }), +]); + +export const facets = [ + { + category: 'status', + filters: [ + { name: 'complete', doc_count: 10 }, + { name: 'awaiting decision', doc_count: 23 }, + { name: 'error', doc_count: 23 }, + { name: 'preparing', doc_count: 23 }, + { name: 'running', doc_count: 23 }, + ], + }, + { + category: 'source', + filters: [ + { name: 'arXiv', doc_count: 10 }, + { name: 'CDS', doc_count: 23 }, + { name: 'APS', doc_count: 67 }, + ], + }, + { category: 'collection', filters: [{ name: 'HEP', doc_count: 54 }] }, + { + category: 'subject', + filters: [ + { name: 'physics', doc_count: 10 }, + { name: 'quantum physics', doc_count: 23 }, + { name: 'astrophysics', doc_count: 23 }, + { name: 'other', doc_count: 23 }, + ], + }, + { + category: 'decision', + filters: [ + { name: 'core', doc_count: 10 }, + { name: 'non core', doc_count: 23 }, + { name: 'rejected', doc_count: 67 }, + ], + }, + { + category: 'pending action', + filters: [ + { name: 'merging', doc_count: 10 }, + { name: 'matching', doc_count: 23 }, + { name: 'core selection', doc_count: 67 }, + ], + }, + { + category: 'journal', + filters: [ + { name: 'Phys.Rev.C4', doc_count: 10 }, + { name: 'Eur.Phys.J.C2', doc_count: 23 }, + { name: 'Phys.Rev.A', doc_count: 67 }, + ], + }, +]; diff --git a/ui/src/literature/components/DOIList.jsx b/ui/src/literature/components/DOIList.jsx index f2168fc25f..29dec210b0 100644 --- a/ui/src/literature/components/DOIList.jsx +++ b/ui/src/literature/components/DOIList.jsx @@ -19,13 +19,13 @@ class DOIList extends Component { } render() { - const { dois } = this.props; + const { dois, bold } = this.props; return ( DOI : 'DOI'} items={dois} - extractKey={doi => doi.get('value')} + extractKey={(doi) => doi.get('value')} renderItem={DOIList.renderDoiItem} /> ); diff --git a/ui/src/literature/components/ReferenceDiffInterface/__tests__/__snapshots__/ReferenceDiffInterface.test.tsx.snap b/ui/src/literature/components/ReferenceDiffInterface/__tests__/__snapshots__/ReferenceDiffInterface.test.tsx.snap index 6599ddd8d6..ae207cae01 100644 --- a/ui/src/literature/components/ReferenceDiffInterface/__tests__/__snapshots__/ReferenceDiffInterface.test.tsx.snap +++ b/ui/src/literature/components/ReferenceDiffInterface/__tests__/__snapshots__/ReferenceDiffInterface.test.tsx.snap @@ -26,7 +26,7 @@ exports[`ReferenceDiffInterface should render 1`] = ` class="ant-card-body" >
, - loading?: boolean, - query?: any, - onPageChange?: Function, - onSizeChange?: Function, - children?: any - onEditReferenceClick?: Function, - loggedIn?: boolean, - setScrollElement?: Function, + total?: number; + references?: any[]; + error?: Map; + loading?: boolean; + query?: any; + onPageChange?: Function; + onSizeChange?: Function; + children?: any; + onEditReferenceClick?: Function; + loggedIn?: boolean; + setScrollElement?: Function; + disableEdit?: boolean; }) { const renderReferenceItem = useCallback( (reference, index) => ( @@ -43,9 +45,10 @@ function ReferenceList({ onEditReferenceClick={onEditReferenceClick} loggedIn={loggedIn} setScrollElement={setScrollElement} + disableEdit={disableEdit} /> ), - [onEditReferenceClick, loggedIn, setScrollElement] + [onEditReferenceClick, loggedIn, setScrollElement, disableEdit] ); const renderList = useCallback( @@ -60,7 +63,9 @@ function ReferenceList({ page={query.page} pageSize={query.size} /> - ): <>, + ) : ( + <> + ), [ query.page, query.size, @@ -73,7 +78,7 @@ function ReferenceList({ ); return ( - + diff --git a/ui/src/literature/components/__tests__/__snapshots__/ReferenceList.test.jsx.snap b/ui/src/literature/components/__tests__/__snapshots__/ReferenceList.test.jsx.snap index f5155b4a4e..e640609b5d 100644 --- a/ui/src/literature/components/__tests__/__snapshots__/ReferenceList.test.jsx.snap +++ b/ui/src/literature/components/__tests__/__snapshots__/ReferenceList.test.jsx.snap @@ -2,7 +2,7 @@ exports[`ReferenceList does not render the list if total 0 1`] = `