Skip to content

Commit f19a52e

Browse files
authored
v5.0.3
v5.0.3
2 parents 59026a0 + 2e66238 commit f19a52e

File tree

17 files changed

+2336
-1997
lines changed

17 files changed

+2336
-1997
lines changed

.github/workflows/docker-build-publish-release.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@master
14-
- name: Fetch Prune Unshallow Tags
15-
run: git fetch --prune --unshallow --tags
16-
- name: Extract branch name
17-
shell: bash
18-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
19-
id: extract_branch
20-
- name: Extract commit hash
21-
shell: bash
22-
run: echo "##[set-output name=hash;]$(git rev-parse --short ${GITHUB_SHA})"
23-
id: extract_hash
24-
- name: Extract latest tag
25-
shell: bash
26-
run: echo "RELEASE_VERSION="$(git describe --tags --abbrev=0 ${GITHUB_SHA}) >> $GITHUB_ENV
27-
- name: Publish to Registry
28-
uses: elgohr/Publish-Docker-Github-Action@v4
29-
env:
30-
GIT_TAG: ${{ env.RELEASE_VERSION }}
31-
GIT_BRANCH: ${{ steps.extract_branch.outputs.branch }}
32-
GIT_REVISION: ${{ steps.extract_hash.outputs.hash }}
33-
with:
34-
name: c2dhunilu/journal-of-digital-history
35-
username: ${{ secrets.DOCKERHUB_USERNAME }}
36-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
37-
buildargs: GIT_TAG,GIT_BRANCH,GIT_REVISION
38-
tags: "${{ env.RELEASE_VERSION }}"
13+
- uses: actions/checkout@master
14+
- name: Fetch Prune Unshallow Tags
15+
run: git fetch --prune --unshallow --tags
16+
- name: Extract github metadata GITHUB_SHA, GIT_BRANCH, GIT_TAG
17+
shell: bash
18+
run: |
19+
echo "GIT_COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
20+
echo "GIT_REMOTE_URL=$(git config --get remote.origin.url)" >> $GITHUB_ENV
21+
echo "GIT_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
22+
echo "GIT_TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
23+
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
24+
- name: Publish to Registry
25+
uses: elgohr/Publish-Docker-Github-Action@v5
26+
env:
27+
GIT_COMMIT_SHA: ${{ env.GIT_COMMIT_SHA }}
28+
GIT_REMOTE_URL: ${{ env.GIT_REMOTE_URL }}
29+
GIT_BRANCH: ${{ env.GIT_BRANCH }}
30+
GIT_TAG: ${{ env.GIT_TAG }}
31+
BUILD_DATE: ${{ env.BUILD_DATE }}
32+
with:
33+
name: c2dhunilu/journal-of-digital-history
34+
username: ${{ secrets.DOCKERHUB_USERNAME }}
35+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
36+
buildargs: |
37+
GIT_COMMIT_SHA, GIT_REMOTE_URL, GIT_BRANCH, GIT_TAG, BUILD_DATE
38+
tags: '${{ env.GIT_TAG }}'

.github/workflows/docker-build-publish.yml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,28 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@master
13-
- name: Fetch Prune Unshallow Tags
14-
run: git fetch --prune --unshallow --tags
15-
- name: Extract branch name
16-
shell: bash
17-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
18-
id: extract_branch
19-
- name: Extract commit hash
20-
shell: bash
21-
run: echo "##[set-output name=hash;]$(git rev-parse --short ${GITHUB_SHA})"
22-
id: extract_hash
23-
- name: Extract latest tag
24-
shell: bash
25-
run: echo "RELEASE_VERSION="$(git describe --tags --abbrev=0 ${GITHUB_SHA}) >> $GITHUB_ENV
26-
- name: Publish to Registry
27-
uses: elgohr/Publish-Docker-Github-Action@master
28-
env:
29-
GIT_TAG: ${{ env.RELEASE_VERSION }}
30-
GIT_BRANCH: ${{ steps.extract_branch.outputs.branch }}
31-
GIT_REVISION: ${{ steps.extract_hash.outputs.hash }}
32-
with:
33-
name: c2dhunilu/journal-of-digital-history
34-
username: ${{ secrets.DOCKERHUB_USERNAME }}
35-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
36-
buildargs: GIT_TAG,GIT_BRANCH,GIT_REVISION
37-
tags: "latest"
12+
- uses: actions/checkout@v4
13+
- name: Fetch Prune Unshallow Tags
14+
run: git fetch --prune --unshallow --tags
15+
- name: Extract github metadata GITHUB_SHA, GIT_BRANCH, GIT_TAG
16+
shell: bash
17+
run: |
18+
echo "GIT_COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
19+
echo "GIT_REMOTE_URL=$(git config --get remote.origin.url)" >> $GITHUB_ENV
20+
echo "GIT_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
21+
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
22+
- name: Publish to Registry
23+
uses: elgohr/Publish-Docker-Github-Action@v4
24+
env:
25+
GIT_TAG: latest
26+
GIT_COMMIT_SHA: ${{ env.GIT_COMMIT_SHA }}
27+
GIT_REMOTE_URL: ${{ env.GIT_REMOTE_URL }}
28+
GIT_BRANCH: ${{ env.GIT_BRANCH }}
29+
BUILD_DATE: ${{ env.BUILD_DATE }}
30+
with:
31+
name: c2dhunilu/journal-of-digital-history
32+
username: ${{ secrets.DOCKERHUB_USERNAME }}
33+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
34+
buildargs: |
35+
GIT_COMMIT_SHA, GIT_REMOTE_URL, GIT_BRANCH, GIT_TAG, BUILD_DATE
36+
tags: 'latest'

Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
FROM node:18.12-alpine as builder
1+
FROM node:23-alpine as builder
22

3-
ARG GIT_TAG
3+
ARG GIT_COMMIT_SHA
4+
ARG GIT_REMOTE_URL
45
ARG GIT_BRANCH
5-
ARG GIT_REVISION
6+
ARG GIT_TAG
7+
ARG BUILD_DATE
68

79
WORKDIR /jdh
810

@@ -22,9 +24,11 @@ COPY src/data/mock-api ./public/mock-api
2224
ENV NODE_ENV production
2325
ENV NODE_OPTIONS --max_old_space_size=4096
2426

25-
ENV REACT_APP_GIT_TAG=${GIT_TAG}
27+
ENV REACT_APP_GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
28+
ENV REACT_APP_GIT_REMOTE_URL=${GIT_REMOTE_URL}
2629
ENV REACT_APP_GIT_BRANCH=${GIT_BRANCH}
27-
ENV REACT_APP_GIT_REVISION=${GIT_REVISION}
30+
ENV REACT_APP_GIT_TAG=${GIT_TAG}
31+
ENV REACT_APP_BUILD_DATE=${BUILD_DATE}
2832

2933
RUN yarn build
3034
RUN yarn build-storybook

Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ COPY .env .
1919

2020
ENV REACT_APP_GIT_TAG=${GIT_TAG}
2121
ENV REACT_APP_GIT_BRANCH=${GIT_BRANCH}
22-
ENV REACT_APP_GIT_REVISION=${GIT_REVISION}
22+
ENV REACT_APP_GIT_COMMIT_SHA=${GIT_REVISION}
2323

2424
CMD ["yarn", "start"]
2525

Makefile

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,35 @@ BUILD_TAG ?= latest
22

33
run:
44
docker-compose down --remove-orphans && \
5-
GIT_TAG=$(shell git describe --tags --abbrev=0 HEAD) \
5+
GIT_COMMIT_SHA=$(shell git rev-parse HEAD) \
6+
GIT_REMOTE_URL=$(shell git config --get remote.origin.url) \
67
GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) \
7-
GIT_REVISION=$(shell git rev-parse --short HEAD) \
8-
docker-compose up --build
8+
GIT_TAG=$(shell git describe --tags --abbrev=0 HEAD) \
9+
BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \
10+
docker-compose up --build .
911

10-
run-dev:
11-
REACT_APP_GIT_TAG=$(shell git describe --tags --abbrev=0 HEAD) \
12+
run-dev:
13+
REACT_APP_GIT_COMMIT_SHA=$(shell git rev-parse HEAD) \
14+
REACT_APP_GIT_REMOTE_URL=$(shell git config --get remote.origin.url) \
1215
REACT_APP_GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) \
13-
REACT_APP_GIT_REVISION=$(shell git rev-parse --short HEAD) \
16+
REACT_APP_GIT_TAG=${BUILD_TAG}
17+
REACT_APP_BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \
1418
yarn start
1519

1620
run-build:
17-
REACT_APP_GIT_TAG=$(shell git describe --tags --abbrev=0 HEAD) \
21+
REACT_APP_GIT_COMMIT_SHA=$(shell git rev-parse HEAD) \
22+
REACT_APP_GIT_REMOTE_URL=$(shell git config --get remote.origin.url) \
1823
REACT_APP_GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) \
19-
REACT_APP_GIT_REVISION=$(shell git rev-parse --short HEAD) \
24+
REACT_APP_GIT_TAG=${BUILD_TAG} \
25+
REACT_APP_BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \
2026
yarn build
2127

2228
run-build-netlify:
23-
REACT_APP_GIT_TAG=$(shell git describe --tags --abbrev=0 HEAD) \
29+
REACT_APP_GIT_COMMIT_SHA=$(shell git rev-parse HEAD) \
30+
REACT_APP_GIT_REMOTE_URL=$(shell git config --get remote.origin.url) \
2431
REACT_APP_GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) \
25-
REACT_APP_GIT_REVISION=$(shell git rev-parse --short HEAD) \
32+
REACT_APP_GIT_TAG=${BUILD_TAG} \
33+
REACT_APP_BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \
2634
yarn build && \
2735
cp _redirects build/ && \
2836
netlify deploy --alias=${BUILD_TAG} --dir=build
@@ -33,6 +41,8 @@ run-deploy-netlify:
3341

3442
build-docker-image:
3543
docker build -t c2dhunilu/journal-of-digital-history:${BUILD_TAG} \
44+
--build-arg GIT_COMMIT_SHA=$(shell git rev-parse HEAD) \
45+
--build-arg GIT_REMOTE_URL=$(shell git config --get remote.origin.url) \
3646
--build-arg GIT_TAG=$(shell git describe --tags --abbrev=0 HEAD) \
3747
--build-arg GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) \
38-
--build-arg GIT_REVISION=$(shell git rev-parse --short HEAD) .
48+
--build-arg BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") .

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Makefile contains a couple of useful commands that inject local environmental va
2020
run-dev:
2121
REACT_APP_GIT_TAG=$(shell git describe --tags --abbrev=0 HEAD) \
2222
REACT_APP_GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) \
23-
REACT_APP_GIT_REVISION=$(shell git rev-parse --short HEAD) \
23+
REACT_APP_GIT_COMMIT_SHA=$(shell git rev-parse --short HEAD) \
2424
yarn start
2525

2626
In development environment, to add a PROXY api different than `http://localhost` add the REACT_APP_PROXY as env variable (it can be stored in a local `.env.development` file)

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jdh",
3-
"version": "5.0.2",
3+
"version": "5.0.3",
44
"private": true,
55
"dependencies": {
66
"@auth0/auth0-react": "^1.1.0",
@@ -15,15 +15,15 @@
1515
"@testing-library/react": "^13.4.0",
1616
"@testing-library/user-event": "^13.5.0",
1717
"@types/jest": "^26.0.9",
18-
"@types/node": "^14.0.27",
19-
"@types/react": "^16.9.46",
20-
"@types/react-dom": "^16.9.8",
18+
"@types/node": "^20.14.12",
19+
"@types/react": "^18.3.3",
20+
"@types/react-dom": "^18.3.0",
2121
"@u-wave/react-vimeo": "^0.9.8",
2222
"@visx/axis": "^1.3.0",
2323
"@visx/curve": "^1.0.0",
2424
"@visx/shape": "^1.3.0",
2525
"array-move": "^3.0.1",
26-
"axios": "^1.6.8",
26+
"axios": "^1.7.7",
2727
"bootstrap": "^5.2.3",
2828
"citation-js": "0.6.4",
2929
"codemirror": "5",
@@ -75,7 +75,7 @@
7575
"source-map-explorer": "^2.4.2",
7676
"thebe-core": "^0.4.2",
7777
"thebe-react": "^0.4.2",
78-
"typescript": "^3.9.7",
78+
"typescript": "^5.5.4",
7979
"universal-cookie": "^4.0.4",
8080
"use-query-params": "^1.2.2",
8181
"webfontloader": "^1.6.28",

src/components/ArticleV3/Article.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import ArticleCellObserver from './ArticleCellObserver'
1111
import ArticleHeader from '../Article/ArticleHeader'
1212
import Footer from '../Footer'
1313
import ArticleBibliography from '../Article/ArticleBibliography'
14-
import { CellTypeCode, LayerData } from '../../constants'
14+
import { CellTypeCode, DisplayLayerSectionBibliography, LayerData } from '../../constants'
1515
import { WithWindowSize } from '../../hooks/windowSize'
1616

1717
import '../../styles/components/ArticleV3/Article.scss'
@@ -50,30 +50,30 @@ const Article = ({
5050
console.debug('[Article]', url, 'is rendering. \n - kernelName:', kernelName)
5151
const setSelectedCellIdx = useArticleStore((state) => state.setSelectedCellIdx)
5252
const setSelectedDataHref = useArticleStore((state) => state.setSelectedDataHref)
53-
54-
const onNumClickHandler = (e,{ idx}) => {
53+
54+
const onNumClickHandler = (e, { idx }) => {
5555
console.debug('[Article] onNumClickHandler', idx)
5656
setSelectedCellIdx(idx)
5757
}
5858

59-
const onCellClickHandler =(e) => {
59+
const onCellClickHandler = (e) => {
6060
if (e.target.hasAttribute('data-href')) {
6161
const dataHref = e.target.getAttribute('data-href')
6262
console.info('[Article] onCellClickHandler', dataHref)
6363
setSelectedDataHref(dataHref)
6464
}
6565

6666
if (e.target.hasAttribute('data-idx')) {
67-
e.preventDefault();
68-
setSelectedCellIdx(e.target.getAttribute('data-idx'));
67+
e.preventDefault()
68+
setSelectedCellIdx(e.target.getAttribute('data-idx'))
6969
}
7070
}
7171

7272
return (
7373
<div className="Article ArticleV3 page">
7474
<ArticleLayers />
7575
<ArticleScrollTo />
76-
<ArticleNoteManager bibliography={bibliography}/>
76+
<ArticleNoteManager bibliography={bibliography} />
7777
<ArticleToC
7878
plainTitle={plainTitle}
7979
paragraphs={paragraphs}
@@ -135,17 +135,26 @@ const Article = ({
135135
)
136136
})}
137137

138-
<ArticleBibliography articleTree={{ bibliography }} noAnchor className="mt-0" />
138+
<ArticleCellObserver
139+
style={{ minHeight: 200 }}
140+
cell={{
141+
idx: DisplayLayerSectionBibliography,
142+
}}
143+
>
144+
<div data-cell-idx={DisplayLayerSectionBibliography}>
145+
{bibliography ? (
146+
<ArticleBibliography articleTree={{ bibliography }} noAnchor className="mt-0" />
147+
) : null}
148+
</div>
149+
</ArticleCellObserver>
139150
<Footer />
140151
</div>
141152
)
142153
}
143154

144155
function ArticleWithContent({ url, ipynb, kernelName, ...props }) {
145-
const { paragraphs, headingsPositions, executables, bibliography, citations, sections } = useNotebook(
146-
url,
147-
ipynb,
148-
)
156+
const { paragraphs, headingsPositions, executables, bibliography, citations, sections } =
157+
useNotebook(url, ipynb)
149158
const initExecutionScope = useExecutionScope((state) => state.initialise)
150159

151160
useEffect(() => {

0 commit comments

Comments
 (0)