Skip to content

Commit

Permalink
v3.1.0
Browse files Browse the repository at this point in the history
v3.1.0
  • Loading branch information
eliselavy authored Feb 4, 2022
2 parents ffcac73 + 874ffd0 commit 82bf214
Show file tree
Hide file tree
Showing 42 changed files with 934 additions and 1,575 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ REACT_APP_TAG_EDITORIAL=editorial
REACT_APP_ENABLE_AUTH_0=false
REACT_APP_GITHUB_RELEASES_API_ENDPOINT=https://api.github.com/repos/c2dh/journal-of-digital-history/releases
REACT_APP_GITHUB_WIKI_FAQ=https://raw.githubusercontent.com/wiki/c2dh/journal-of-digital-history/FAQ.md
REACT_APP_NOTEBOOK_GUIDELINES_URL=https://journalofdigitalhistory.org/proxy-githubusercontent/C2DH/jdh-notebook/master/examples/Author_Guideline/AuthorGuideline.ipynb
REACT_APP_NOTEBOOK_CFP_BASE_URL=https://journalofdigitalhistory.org/proxy-githubusercontent/C2DH/jdh-notebook/master/cfp
REACT_APP_GITHUB_WIKI_NEWS=https://raw.githubusercontent.com/wiki/c2dh/journal-of-digital-history/News.md
51 changes: 34 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jdh",
"version": "3.0.0",
"version": "3.1.0",
"private": true,
"dependencies": {
"@auth0/auth0-react": "^1.1.0",
Expand Down Expand Up @@ -56,6 +56,7 @@
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-scrollama": "^2.2.15",
"react-slick": "^0.28.1",
"react-spring": "^9.1.2",
"react-use-gesture": "^9.1.3",
"react-window": "^1.8.5",
Expand Down
2 changes: 2 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<meta name="twitter:title" content="Journal of Digital History" data-react-helmet="true"/>
<meta name="twitter:description" content="The Journal of Digital History (JDH) is an international, academic, peer-reviewed and open-access journal. JDH will set new standards in history publishing based on the principle of multi-layered articles." data-react-helmet="true"/>
<meta name="twitter:image" content="https://journalofdigitalhistory.org/img/issues/social-media/jdh001.png" data-react-helmet="true"/>
<link rel="stylesheet" type="text/css" charset="UTF-8" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
36 changes: 21 additions & 15 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const Home = lazy(() => import('./pages/Home'))
const About = lazy(() => import('./pages/About'))
const AbstractSubmission = lazy(() => import('./pages/AbstractSubmission'))
const AbstractSubmitted = lazy(() => import('./pages/AbstractSubmitted'))
const ArticlesPage = lazy(() => import('./pages/Articles'))
const CallForPapers = lazy(() => import('./pages/CallForPapers'))
const Issue = lazy(() => import('./pages/Issue'))
const Issues = lazy(() => import('./pages/Issues'))
const Abstract = lazy(() => import('./pages/Abstract'))
Expand Down Expand Up @@ -114,9 +116,11 @@ function LangRoutes() {
<Route path={`${path}/abstract/:id`}>
<Abstract />
</Route>

<Route path={`${path}/issues`} component={Issues} />
<Route path={`${path}/issue/:id`} component={Issue} />
<Route path={`${path}/article/:pid`} component={ArticleViewer} />
<Route exact path={`${path}/articles`} component={ArticlesPage} />
<Route path={`${path}/abstract-submitted`} component={AbstractSubmitted} />
<Route exact path={`${path}/terms`} component={TermsOfUse}/>
<Route exact path={`${path}/submit`}>
Expand All @@ -141,6 +145,7 @@ function LangRoutes() {
<Route exact path={`${path}/playground`} component={Playground}/>
<Route exact path={`${path}/fingerprint`} component={Fingerprint} />
<Route exact path={`${path}/guidelines`} component={Guidelines} />
<Route exact path={`${path}/cfp/:permalink`} component={CallForPapers} />
<Route path={`${path}*`}>
<NotFound path={path}/>
</Route>
Expand All @@ -156,20 +161,21 @@ function usePageViews() {
() => {
const url = [pathname, search].join('')
console.info('pageview', url)
// based on the pathname, change the background
if (pathname.indexOf('/notebook') !== -1 || pathname.indexOf('/article') !== -1) {
changeBackgroundColor('#F4F1F8')
} else if (pathname.indexOf('/issue') !== -1) {
changeBackgroundColor('#F4F1F8')
} else if (pathname.indexOf('/submit') !== -1) {
changeBackgroundColor('var(--gray-100)')
} else if (pathname.indexOf('/about') !== -1) {
changeBackgroundColor('var(--linen)')
} else if (pathname.indexOf('/terms') !== -1) {
changeBackgroundColor('var(--peachpuff)')
} else {
changeBackgroundColor('var(--gray-100)')
}
changeBackgroundColor('var(--gray-100)')
// // based on the pathname, change the background
// if (pathname.indexOf('/notebook') !== -1 || pathname.indexOf('/article') !== -1) {
// changeBackgroundColor('#F4F1F8')
// } else if (pathname.indexOf('/issue') !== -1) {
// changeBackgroundColor('#F4F1F8')
// } else if (pathname.indexOf('/submit') !== -1) {
// changeBackgroundColor('var(--gray-100)')
// } else if (pathname.indexOf('/about') !== -1) {
// changeBackgroundColor('var(--linen)')
// } else if (pathname.indexOf('/terms') !== -1) {
// changeBackgroundColor('var(--peachpuff)')
// } else {
// changeBackgroundColor('var(--gray-100)')
// }
ReactGA.pageview(url)
},
[pathname, search, changeBackgroundColor]
Expand Down Expand Up @@ -215,7 +221,7 @@ export default function App() {
<AppRoutes />
</Suspense>
</main>
<Footer hideOnRoutes={['/article/', '/notebook-viewer/']}/>
<Footer hideOnRoutes={['/article/', '/notebook-viewer/', '/cfp/', '/guidelines/']}/>
<ScrollToTop />
</Auth0ProviderWithHistory>
</QueryParamProvider>
Expand Down
10 changes: 5 additions & 5 deletions src/components/AbstractSubmissionPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ const AbstractSubmissionPreview = ({
].join('-')

return (
<div className="p-3 shadow-sm rounded" style={{
<div className="p-3 shadow-sm rounded small" style={{
border: '1px solid var(--gray-300)'
}}>
<h3>{t('pages.abstractSubmission.preview')}</h3>
<p>{isEmpty && (<>
<Badge bg="info" pill>{t('badge.warning')}</Badge>&nbsp;
<Badge bg="secondary" pill>{t('badge.warning')}</Badge>&nbsp;
{t('labels.formSubmissionIncomplete')}
</>)}
{!isEmpty && !validatorResult.valid && (<>
<Badge bg="warning" pill>{t('badge.danger')}</Badge>&nbsp;
<Badge bg="secondary" pill>{t('badge.danger')}</Badge>&nbsp;
<span dangerouslySetInnerHTML={{
__html: t('missingStepsWithCount', { count: validatorResult.errors.length})
}} />
</>)}
{validatorResult.valid && (
<>
<Badge bg="success" pill>{t('badge.success')}</Badge>&nbsp;
<Badge bg="primary" pill>{t('badge.success')}</Badge>&nbsp;
<span dangerouslySetInnerHTML={{
__html: t('labels.formSubmissionReady')
}} />
Expand All @@ -75,7 +75,7 @@ const AbstractSubmissionPreview = ({
<span> ({t('dates.fromNow', {date: temporaryAbstractSubmission.getDateLastModified()})})</span>
<br/>
<div className="my-3 d-grid gap-2">
<Button variant="outline-danger"
<Button variant="outline-dark"
size="sm"
onClick={onReset}
>
Expand Down
5 changes: 4 additions & 1 deletion src/components/Article/ArticleBibliography.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const ArticleBilbiography = ({
className='mt-5'
}) => {
const { t } = useTranslation()

console.debug('[ArticleBilbiography] articleTree', articleTree, articleTree.bibliography)
if (!articleTree.bibliography) {
return null
}
return (
<Container className={`ArticleBilbiography ${className}`}>
<Row>
Expand Down
38 changes: 26 additions & 12 deletions src/components/Article/ArticleHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const ArticleHeader = ({
url,
bibjson,
children,
isPreview=true
isPreview=true,
ignorePublicationStatus=false
}) => {
const { t } = useTranslation()
const keywordsCleaned = keywords.reduce((acc, d) => {
Expand All @@ -35,15 +36,17 @@ const ArticleHeader = ({
<Container className={`ArticleHeader ${className}`}>
<Row>
<Col {...BootstrapColumLayout}>
<div className="mb-3">
{t(`pages.article.status.${publicationStatus}`)}
{publicationStatus === ArticleStatusPublished
? <span> &mdash; <LangLink to={`issue/${issue.pid}`}>{issue?.name}</LangLink></span>
: null}
<br/>
<b>{publicationDate.getFullYear()}</b>
</div>
<div className={`ArticleHeader_title my-3 ${variant}`}>
{!ignorePublicationStatus &&
<div className="mb-3">
{t(`pages.article.status.${publicationStatus}`)}
{publicationStatus === ArticleStatusPublished
? <span> &mdash; <LangLink to={`issue/${issue.pid}`}>{issue?.name}</LangLink></span>
: null}
<br/>
<b>{publicationDate.getFullYear()}</b>
</div>
}
<div className={`ArticleHeader_title ${ignorePublicationStatus ? 'mb-3': 'my-3'} ${variant}`}>
{title.map((paragraph, i) => (
<ArticleCellContent key={i} {...paragraph} hideIdx hideNum/>
))}
Expand All @@ -64,13 +67,13 @@ const ArticleHeader = ({
</Col>
))}
</Row>
{abstract.length
{abstract.length > 0 && !ignorePublicationStatus
? (
<Row className="mt-5">
<Col {...BootstrapColumLayout}>
<h3>{t('pages.article.abstract')}</h3>
<ArticleKeywords keywords={keywordsCleaned}/>
<ArticleCitation disabled={isPreview} bibjson={bibjson} className="my-4 w-100"/>
<ArticleCitation disabled={isPreview } bibjson={bibjson} className="my-4 w-100"/>
<div className="ArticleHeader_abstract">
{abstract.map((paragraph, i) => (
<ArticleCellContent key={i} {...paragraph} hideIdx hideNum/>
Expand All @@ -80,6 +83,17 @@ const ArticleHeader = ({
</Row>
):null
}
{abstract.length > 0 && ignorePublicationStatus && (
<Row className="mt-5">
<Col {...BootstrapColumLayout}>
<div className="ArticleHeader_abstract">
{abstract.map((paragraph, i) => (
<ArticleCellContent key={i} {...paragraph} hideIdx hideNum/>
))}
</div>
</Col>
</Row>
)}
{!!url && (
<Row>
<Col {...BootstrapColumLayout}>
Expand Down
Loading

0 comments on commit 82bf214

Please sign in to comment.