@eeacms/volto-slate-footnote 6.1.2 → 6.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/DEVELOP.md +56 -0
- package/Dockerfile +14 -0
- package/Jenkinsfile +25 -0
- package/Makefile +122 -40
- package/README.md +18 -1
- package/cypress/e2e/01-slate-footnote-block.cy.js +23 -0
- package/docker-compose.yml +32 -0
- package/locales/de/LC_MESSAGES/volto.po +32 -0
- package/locales/en/LC_MESSAGES/volto.po +32 -0
- package/locales/it/LC_MESSAGES/volto.po +32 -0
- package/locales/ro/LC_MESSAGES/volto.po +32 -0
- package/locales/volto.pot +34 -0
- package/package.json +13 -11
- package/src/Blocks/Footnote/FootnotesBlockView.jsx +12 -18
- package/src/editor/render.jsx +5 -4
- package/src/editor/utils.js +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,32 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [6.1.4](https://github.com/eea/volto-slate-footnote/compare/6.1.3...6.1.4) - 1 September 2023
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: force footnotes to open in the same tab - refs #257251 [dobri1408 - [`20bb988`](https://github.com/eea/volto-slate-footnote/commit/20bb988534413a837786ab10cc09244498dbcb7e)]
|
|
12
|
+
|
|
13
|
+
#### :hammer_and_wrench: Others
|
|
14
|
+
|
|
15
|
+
- increase code coverage [Dobricean Ioan Dorian - [`3ba3ef3`](https://github.com/eea/volto-slate-footnote/commit/3ba3ef3187b1119d7be96ac2f952a36368163b97)]
|
|
16
|
+
### [6.1.3](https://github.com/eea/volto-slate-footnote/compare/6.1.2...6.1.3) - 30 August 2023
|
|
17
|
+
|
|
18
|
+
#### :bug: Bug Fixes
|
|
19
|
+
|
|
20
|
+
- fix: metadata block error - refs #256758 [dobri1408 - [`90cbf4b`](https://github.com/eea/volto-slate-footnote/commit/90cbf4bfdcc19efa8fc316d8a01387813b6768ac)]
|
|
21
|
+
|
|
22
|
+
#### :house: Documentation changes
|
|
23
|
+
|
|
24
|
+
- docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`64077a5`](https://github.com/eea/volto-slate-footnote/commit/64077a55200a3d35048867ed1816ef1544b86af9)]
|
|
25
|
+
- docs: add docker backend [valentinab25 - [`72280e8`](https://github.com/eea/volto-slate-footnote/commit/72280e87274f52ecfb513d8d7853e2a1a57df6a4)]
|
|
26
|
+
|
|
27
|
+
#### :hammer_and_wrench: Others
|
|
28
|
+
|
|
29
|
+
- increase code covreage [Dobricean Ioan Dorian - [`d61c883`](https://github.com/eea/volto-slate-footnote/commit/d61c883df33355c8c79abd1dc2b9e55590f2542b)]
|
|
30
|
+
- test: Fix package.json scripts to use makefile [Alin Voinea - [`e2a4d77`](https://github.com/eea/volto-slate-footnote/commit/e2a4d77e2d750bd1a35b470e7731ccca59c5bbc4)]
|
|
31
|
+
- i18n: Add en [Alin Voinea - [`8a48917`](https://github.com/eea/volto-slate-footnote/commit/8a489177b3a5f11aa742d5213442a67f9cb6b2e9)]
|
|
32
|
+
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`86ea0e1`](https://github.com/eea/volto-slate-footnote/commit/86ea0e1034d4b3c8be08a43cf7daf393675898de)]
|
|
7
33
|
### [6.1.2](https://github.com/eea/volto-slate-footnote/compare/6.1.1...6.1.2) - 24 July 2023
|
|
8
34
|
|
|
9
35
|
### [6.1.1](https://github.com/eea/volto-slate-footnote/compare/6.1.0...6.1.1) - 12 June 2023
|
package/DEVELOP.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
## Develop
|
|
4
4
|
|
|
5
|
+
1. Make sure you have `docker` and `docker compose` installed and running on your machine:
|
|
6
|
+
|
|
7
|
+
```Bash
|
|
8
|
+
git clone https://github.com/eea/volto-slate-footnote.git
|
|
9
|
+
cd volto-slate-footnote
|
|
10
|
+
git checkout -b bugfix-123456 develop
|
|
11
|
+
make
|
|
12
|
+
make start
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
1. Wait for `Volto started at 0.0.0.0:3000` meesage
|
|
16
|
+
|
|
17
|
+
1. Go to http://localhost:3000
|
|
18
|
+
|
|
19
|
+
1. Happy hacking!
|
|
20
|
+
|
|
21
|
+
```Bash
|
|
22
|
+
cd src/addons/volto-slate-footnote/
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Or add @eeacms/volto-slate-footnote to your Volto project
|
|
26
|
+
|
|
5
27
|
Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
|
|
6
28
|
|
|
7
29
|
1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
|
|
@@ -51,3 +73,37 @@ Before starting make sure your development environment is properly set. See [Vol
|
|
|
51
73
|
1. Happy hacking!
|
|
52
74
|
|
|
53
75
|
cd src/addons/volto-slate-footnote/
|
|
76
|
+
|
|
77
|
+
## Cypress
|
|
78
|
+
|
|
79
|
+
To run cypress locally, first make sure you don't have any Volto/Plone running on ports `8080` and `3000`.
|
|
80
|
+
|
|
81
|
+
You don't have to be in a `clean-volto-project`, you can be in any Volto Frontend
|
|
82
|
+
project where you added `volto-slate-footnote` to `mrs.developer.json`
|
|
83
|
+
|
|
84
|
+
Go to:
|
|
85
|
+
|
|
86
|
+
```BASH
|
|
87
|
+
cd src/addons/volto-slate-footnote/
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Start:
|
|
91
|
+
|
|
92
|
+
```Bash
|
|
93
|
+
make
|
|
94
|
+
make start
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-slate-footnote` block installed.
|
|
98
|
+
|
|
99
|
+
Open Cypress Interface:
|
|
100
|
+
|
|
101
|
+
```Bash
|
|
102
|
+
make cypress-open
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Or run it:
|
|
106
|
+
|
|
107
|
+
```Bash
|
|
108
|
+
make cypress-run
|
|
109
|
+
```
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1
|
|
2
|
+
ARG VOLTO_VERSION
|
|
3
|
+
FROM plone/frontend-builder:${VOLTO_VERSION}
|
|
4
|
+
|
|
5
|
+
ARG ADDON_NAME
|
|
6
|
+
ARG ADDON_PATH
|
|
7
|
+
|
|
8
|
+
COPY --chown=node:node ./ /app/src/addons/${ADDON_PATH}/
|
|
9
|
+
|
|
10
|
+
RUN /setupAddon
|
|
11
|
+
RUN yarn install
|
|
12
|
+
|
|
13
|
+
ENTRYPOINT ["yarn"]
|
|
14
|
+
CMD ["start"]
|
package/Jenkinsfile
CHANGED
|
@@ -197,6 +197,31 @@ pipeline {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
+
stage('SonarQube compare to master') {
|
|
201
|
+
when {
|
|
202
|
+
allOf {
|
|
203
|
+
environment name: 'CHANGE_ID', value: ''
|
|
204
|
+
branch 'develop'
|
|
205
|
+
not { changelog '.*^Automated release [0-9\\.]+$' }
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
steps {
|
|
209
|
+
node(label: 'docker') {
|
|
210
|
+
script {
|
|
211
|
+
sh '''docker pull eeacms/gitflow'''
|
|
212
|
+
sh '''echo "Error" > checkresult.txt'''
|
|
213
|
+
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
|
214
|
+
sh '''set -o pipefail; docker run -i --rm --name="$BUILD_TAG-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt'''
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: "Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed",
|
|
218
|
+
text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
|
|
219
|
+
detailsURL: "${env.BUILD_URL}display/redirect"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
200
225
|
stage('Pull Request') {
|
|
201
226
|
when {
|
|
202
227
|
not {
|
package/Makefile
CHANGED
|
@@ -1,49 +1,131 @@
|
|
|
1
|
-
|
|
1
|
+
##############################################################################
|
|
2
|
+
# Run:
|
|
3
|
+
# make
|
|
4
|
+
# make start
|
|
5
|
+
#
|
|
6
|
+
# Go to:
|
|
7
|
+
#
|
|
8
|
+
# http://localhost:3000
|
|
9
|
+
#
|
|
10
|
+
# Cypress:
|
|
11
|
+
#
|
|
12
|
+
# make cypress-open
|
|
13
|
+
#
|
|
14
|
+
##############################################################################
|
|
15
|
+
# SETUP MAKE
|
|
16
|
+
#
|
|
17
|
+
## Defensive settings for make: https://tech.davis-hansson.com/p/make/
|
|
18
|
+
SHELL:=bash
|
|
19
|
+
.ONESHELL:
|
|
20
|
+
# for Makefile debugging purposes add -x to the .SHELLFLAGS
|
|
21
|
+
.SHELLFLAGS:=-eu -o pipefail -O inherit_errexit -c
|
|
22
|
+
.SILENT:
|
|
23
|
+
.DELETE_ON_ERROR:
|
|
24
|
+
MAKEFLAGS+=--warn-undefined-variables
|
|
25
|
+
MAKEFLAGS+=--no-builtin-rules
|
|
2
26
|
|
|
27
|
+
# Colors
|
|
28
|
+
# OK=Green, warn=yellow, error=red
|
|
29
|
+
ifeq ($(TERM),)
|
|
30
|
+
# no colors if not in terminal
|
|
31
|
+
MARK_COLOR=
|
|
32
|
+
OK_COLOR=
|
|
33
|
+
WARN_COLOR=
|
|
34
|
+
ERROR_COLOR=
|
|
35
|
+
NO_COLOR=
|
|
36
|
+
else
|
|
37
|
+
MARK_COLOR=`tput setaf 6`
|
|
38
|
+
OK_COLOR=`tput setaf 2`
|
|
39
|
+
WARN_COLOR=`tput setaf 3`
|
|
40
|
+
ERROR_COLOR=`tput setaf 1`
|
|
41
|
+
NO_COLOR=`tput sgr0`
|
|
42
|
+
endif
|
|
43
|
+
|
|
44
|
+
##############################################################################
|
|
45
|
+
# SETTINGS AND VARIABLE
|
|
3
46
|
DIR=$(shell basename $$(pwd))
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
47
|
+
NODE_MODULES?="../../../node_modules"
|
|
48
|
+
PLONE_VERSION?=6
|
|
49
|
+
VOLTO_VERSION?=16
|
|
50
|
+
ADDON_PATH="${DIR}"
|
|
51
|
+
ADDON_NAME="@eeacms/${ADDON_PATH}"
|
|
52
|
+
DOCKER_COMPOSE=PLONE_VERSION=${PLONE_VERSION} VOLTO_VERSION=${VOLTO_VERSION} ADDON_NAME=${ADDON_NAME} ADDON_PATH=${ADDON_PATH} docker compose
|
|
53
|
+
|
|
54
|
+
# Top-level targets
|
|
55
|
+
.PHONY: all
|
|
56
|
+
all: clean install
|
|
57
|
+
|
|
58
|
+
.PHONY: clean
|
|
59
|
+
clean: ## Cleanup development environment
|
|
60
|
+
${DOCKER_COMPOSE} down --volumes --remove-orphans
|
|
61
|
+
|
|
62
|
+
.PHONY: install
|
|
63
|
+
install: ## Build and install development environment
|
|
64
|
+
echo "Running: ${DOCKER_COMPOSE} build"
|
|
65
|
+
${DOCKER_COMPOSE} pull
|
|
66
|
+
${DOCKER_COMPOSE} build
|
|
67
|
+
|
|
68
|
+
.PHONY: start
|
|
69
|
+
start: ## Start development environment
|
|
70
|
+
echo "Running: ${DOCKER_COMPOSE} up"
|
|
71
|
+
${DOCKER_COMPOSE} up
|
|
72
|
+
|
|
73
|
+
.PHONY: shell
|
|
74
|
+
shell: ## Start a shell in the frontend container
|
|
75
|
+
echo "Running: ${DOCKER_COMPOSE} run frontend bash"
|
|
76
|
+
${DOCKER_COMPOSE} run --entrypoint=bash frontend
|
|
77
|
+
|
|
78
|
+
.PHONY: cypress-open
|
|
79
|
+
cypress-open: ## Open cypress integration tests
|
|
80
|
+
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open
|
|
81
|
+
|
|
82
|
+
.PHONY: cypress-run
|
|
83
|
+
cypress-run: ## Run cypress integration tests
|
|
84
|
+
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run
|
|
36
85
|
|
|
37
86
|
.PHONY: test
|
|
38
|
-
test:
|
|
39
|
-
|
|
40
|
-
docker run -it --rm -e NAMESPACE="@eeacms" -e GIT_NAME="${DIR}" -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/${DIR}" -e CI="true" plone/volto-addon-ci:alpha
|
|
87
|
+
test: ## Run jest tests
|
|
88
|
+
${DOCKER_COMPOSE} run -e CI=1 frontend test
|
|
41
89
|
|
|
42
90
|
.PHONY: test-update
|
|
43
|
-
test-update:
|
|
44
|
-
|
|
45
|
-
|
|
91
|
+
test-update: ## Update jest tests snapshots
|
|
92
|
+
${DOCKER_COMPOSE} run -e CI=1 frontend test -u
|
|
93
|
+
|
|
94
|
+
.PHONY: stylelint
|
|
95
|
+
stylelint: ## Stylelint
|
|
96
|
+
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'
|
|
97
|
+
|
|
98
|
+
.PHONY: stylelint-overrides
|
|
99
|
+
stylelint-overrides:
|
|
100
|
+
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'
|
|
101
|
+
|
|
102
|
+
.PHONY: stylelint-fix
|
|
103
|
+
stylelint-fix: ## Fix stylelint
|
|
104
|
+
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix
|
|
105
|
+
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix
|
|
106
|
+
|
|
107
|
+
.PHONY: prettier
|
|
108
|
+
prettier: ## Prettier
|
|
109
|
+
$(NODE_MODULES)/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'
|
|
110
|
+
|
|
111
|
+
.PHONY: prettier-fix
|
|
112
|
+
prettier-fix: ## Fix prettier
|
|
113
|
+
$(NODE_MODULES)/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'
|
|
114
|
+
|
|
115
|
+
.PHONY: lint
|
|
116
|
+
lint: ## ES Lint
|
|
117
|
+
$(NODE_MODULES)/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'
|
|
118
|
+
|
|
119
|
+
.PHONY: lint-fix
|
|
120
|
+
lint-fix: ## Fix ES Lint
|
|
121
|
+
$(NODE_MODULES)/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'
|
|
122
|
+
|
|
123
|
+
.PHONY: i18n
|
|
124
|
+
i18n: ## i18n
|
|
125
|
+
rm -rf build/messages
|
|
126
|
+
NODE_ENV=development $(NODE_MODULES)/.bin/i18n --addon
|
|
46
127
|
|
|
47
128
|
.PHONY: help
|
|
48
|
-
help:
|
|
129
|
+
help: ## Show this help.
|
|
49
130
|
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
|
|
131
|
+
head -n 14 Makefile
|
package/README.md
CHANGED
|
@@ -31,9 +31,26 @@ This version requires: `@plone/volto >= 16.0.0.alpha.15` (`volto-slate` part of
|
|
|
31
31
|
|
|
32
32
|
## Getting started
|
|
33
33
|
|
|
34
|
+
### Try volto-slate-footnote with Docker
|
|
35
|
+
|
|
36
|
+
git clone https://github.com/eea/volto-slate-footnote.git
|
|
37
|
+
cd volto-slate-footnote
|
|
38
|
+
make
|
|
39
|
+
make start
|
|
40
|
+
|
|
41
|
+
Go to http://localhost:3000
|
|
42
|
+
|
|
34
43
|
### Add volto-slate-footnote to your Volto project
|
|
35
44
|
|
|
36
|
-
1.
|
|
45
|
+
1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
|
|
46
|
+
|
|
47
|
+
```Bash
|
|
48
|
+
docker compose up backend
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
1. Start Volto frontend
|
|
52
|
+
|
|
53
|
+
- If you already have a volto project, just update `package.json`:
|
|
37
54
|
|
|
38
55
|
```JSON
|
|
39
56
|
"addons": [
|
|
@@ -41,6 +41,29 @@ describe('Slate citations', () => {
|
|
|
41
41
|
cy.get('span.citation-item').contains('Colorless green');
|
|
42
42
|
cy.contains('Footnotes');
|
|
43
43
|
cy.contains('Citation');
|
|
44
|
+
cy.get('[aria-label="Back to content"]').first().click();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('Test cancel Button', () => {
|
|
48
|
+
cy.getSlateEditorAndType('Colorless green ideas sleep furiously.')
|
|
49
|
+
.type('{selectAll}')
|
|
50
|
+
.dblclick();
|
|
51
|
+
|
|
52
|
+
// Footnote
|
|
53
|
+
cy.setSlateCursor('Colorless').dblclick();
|
|
54
|
+
cy.setSlateSelection('Colorless', 'green');
|
|
55
|
+
cy.clickSlateButton('Footnote');
|
|
56
|
+
|
|
57
|
+
cy.get('.sidebar-container .field-wrapper-footnote .react-select-container')
|
|
58
|
+
.click()
|
|
59
|
+
.type('Citation{enter}');
|
|
60
|
+
|
|
61
|
+
//click on the cancel button
|
|
62
|
+
cy.get('.sidebar-container .form .header button').first().next().click();
|
|
63
|
+
|
|
64
|
+
// Save
|
|
65
|
+
cy.get('#toolbar-save').click();
|
|
66
|
+
cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');
|
|
44
67
|
});
|
|
45
68
|
|
|
46
69
|
it('Add Footnotes block and create multiple citations', () => {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
services:
|
|
3
|
+
backend:
|
|
4
|
+
image: eeacms/plone-backend
|
|
5
|
+
ports:
|
|
6
|
+
- "8080:8080"
|
|
7
|
+
environment:
|
|
8
|
+
SITE: "Plone"
|
|
9
|
+
PROFILES: "eea.kitkat:testing"
|
|
10
|
+
|
|
11
|
+
frontend:
|
|
12
|
+
build:
|
|
13
|
+
context: ./
|
|
14
|
+
dockerfile: ./Dockerfile
|
|
15
|
+
args:
|
|
16
|
+
ADDON_NAME: "${ADDON_NAME}"
|
|
17
|
+
ADDON_PATH: "${ADDON_PATH}"
|
|
18
|
+
VOLTO_VERSION: ${VOLTO_VERSION:-16}
|
|
19
|
+
ports:
|
|
20
|
+
- "3000:3000"
|
|
21
|
+
- "3001:3001"
|
|
22
|
+
depends_on:
|
|
23
|
+
- backend
|
|
24
|
+
volumes:
|
|
25
|
+
- ./:/app/src/addons/${ADDON_PATH}
|
|
26
|
+
environment:
|
|
27
|
+
CI: "true"
|
|
28
|
+
NODE_ENV: "development"
|
|
29
|
+
RAZZLE_JEST_CONFIG: "src/addons/${ADDON_PATH}/jest-addon.config.js"
|
|
30
|
+
RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
|
|
31
|
+
RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
|
|
32
|
+
HOST: "0.0.0.0"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
#: editor/index
|
|
15
|
+
# defaultMessage: Edit footnote
|
|
16
|
+
msgid "Edit footnote"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#: editor/MultiSelectSearchWidget
|
|
20
|
+
# defaultMessage: No options
|
|
21
|
+
msgid "No options"
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#: editor/index
|
|
25
|
+
# defaultMessage: Remove footnote
|
|
26
|
+
msgid "Remove footnote"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#: editor/MultiSelectSearchWidget
|
|
30
|
+
# defaultMessage: Select…
|
|
31
|
+
msgid "Select…"
|
|
32
|
+
msgstr ""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
#: editor/index
|
|
15
|
+
# defaultMessage: Edit footnote
|
|
16
|
+
msgid "Edit footnote"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#: editor/MultiSelectSearchWidget
|
|
20
|
+
# defaultMessage: No options
|
|
21
|
+
msgid "No options"
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#: editor/index
|
|
25
|
+
# defaultMessage: Remove footnote
|
|
26
|
+
msgid "Remove footnote"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#: editor/MultiSelectSearchWidget
|
|
30
|
+
# defaultMessage: Select…
|
|
31
|
+
msgid "Select…"
|
|
32
|
+
msgstr ""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
#: editor/index
|
|
15
|
+
# defaultMessage: Edit footnote
|
|
16
|
+
msgid "Edit footnote"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#: editor/MultiSelectSearchWidget
|
|
20
|
+
# defaultMessage: No options
|
|
21
|
+
msgid "No options"
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#: editor/index
|
|
25
|
+
# defaultMessage: Remove footnote
|
|
26
|
+
msgid "Remove footnote"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#: editor/MultiSelectSearchWidget
|
|
30
|
+
# defaultMessage: Select…
|
|
31
|
+
msgid "Select…"
|
|
32
|
+
msgstr ""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
#: editor/index
|
|
15
|
+
# defaultMessage: Edit footnote
|
|
16
|
+
msgid "Edit footnote"
|
|
17
|
+
msgstr ""
|
|
18
|
+
|
|
19
|
+
#: editor/MultiSelectSearchWidget
|
|
20
|
+
# defaultMessage: No options
|
|
21
|
+
msgid "No options"
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
#: editor/index
|
|
25
|
+
# defaultMessage: Remove footnote
|
|
26
|
+
msgid "Remove footnote"
|
|
27
|
+
msgstr ""
|
|
28
|
+
|
|
29
|
+
#: editor/MultiSelectSearchWidget
|
|
30
|
+
# defaultMessage: Select…
|
|
31
|
+
msgid "Select…"
|
|
32
|
+
msgstr ""
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: Plone\n"
|
|
4
|
+
"POT-Creation-Date: 2023-08-29T17:14:46.877Z\n"
|
|
5
|
+
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
|
+
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
|
+
"MIME-Version: 1.0\n"
|
|
8
|
+
"Content-Type: text/plain; charset=utf-8\n"
|
|
9
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
10
|
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
11
|
+
"Language-Code: en\n"
|
|
12
|
+
"Language-Name: English\n"
|
|
13
|
+
"Preferred-Encodings: utf-8\n"
|
|
14
|
+
"Domain: volto\n"
|
|
15
|
+
|
|
16
|
+
#: editor/index
|
|
17
|
+
# defaultMessage: Edit footnote
|
|
18
|
+
msgid "Edit footnote"
|
|
19
|
+
msgstr ""
|
|
20
|
+
|
|
21
|
+
#: editor/MultiSelectSearchWidget
|
|
22
|
+
# defaultMessage: No options
|
|
23
|
+
msgid "No options"
|
|
24
|
+
msgstr ""
|
|
25
|
+
|
|
26
|
+
#: editor/index
|
|
27
|
+
# defaultMessage: Remove footnote
|
|
28
|
+
msgid "Remove footnote"
|
|
29
|
+
msgstr ""
|
|
30
|
+
|
|
31
|
+
#: editor/MultiSelectSearchWidget
|
|
32
|
+
# defaultMessage: Select…
|
|
33
|
+
msgid "Select…"
|
|
34
|
+
msgstr ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-slate-footnote",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.4",
|
|
4
4
|
"description": "volto-slate-footnote: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -27,19 +27,21 @@
|
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"release": "release-it",
|
|
30
|
+
"release-major-beta": "release-it major --preRelease=beta",
|
|
31
|
+
"release-beta": "release-it --preRelease=beta",
|
|
30
32
|
"bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
|
|
31
33
|
"test": "make test",
|
|
32
34
|
"test:fix": "make test-update",
|
|
33
35
|
"pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
|
|
34
|
-
"stylelint": "
|
|
35
|
-
"stylelint:overrides": "
|
|
36
|
-
"stylelint:fix": "
|
|
37
|
-
"prettier": "
|
|
38
|
-
"prettier:fix": "
|
|
39
|
-
"lint": "
|
|
40
|
-
"lint:fix": "
|
|
41
|
-
"i18n": "
|
|
42
|
-
"cypress:run": "
|
|
43
|
-
"cypress:open": "
|
|
36
|
+
"stylelint": "make stylelint",
|
|
37
|
+
"stylelint:overrides": "make stylelint-overrides",
|
|
38
|
+
"stylelint:fix": "make stylelint-fix",
|
|
39
|
+
"prettier": "make prettier",
|
|
40
|
+
"prettier:fix": "make prettier-fix",
|
|
41
|
+
"lint": "make lint",
|
|
42
|
+
"lint:fix": "make lint-fix",
|
|
43
|
+
"i18n": "make i18n",
|
|
44
|
+
"cypress:run": "make cypress-run",
|
|
45
|
+
"cypress:open": "make cypress-open"
|
|
44
46
|
}
|
|
45
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import {
|
|
3
3
|
openAccordionIfContainsFootnoteReference,
|
|
4
4
|
getAllBlocksAndSlateFields,
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
} from '@eeacms/volto-slate-footnote/editor/utils';
|
|
8
8
|
import './less/public.less';
|
|
9
9
|
|
|
10
|
+
import { UniversalLink } from '@plone/volto/components';
|
|
11
|
+
|
|
10
12
|
const alphabet = 'abcdefghijklmnopqrstuvwxyz';
|
|
11
13
|
|
|
12
14
|
/**
|
|
@@ -20,18 +22,10 @@ const alphabet = 'abcdefghijklmnopqrstuvwxyz';
|
|
|
20
22
|
const FootnotesBlockView = (props) => {
|
|
21
23
|
const { data, properties } = props;
|
|
22
24
|
const { title, global, placeholder = 'Footnotes' } = data;
|
|
23
|
-
const [notesObj, setNodesObjs] = useState(null);
|
|
24
25
|
const metadata = props.metadata ? props.metadata : properties;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const globalMetadata = global ? metadata : properties;
|
|
29
|
-
const blocks = getAllBlocksAndSlateFields(globalMetadata);
|
|
30
|
-
const notesObjResult = makeFootnoteListOfUniqueItems(blocks);
|
|
31
|
-
|
|
32
|
-
setNodesObjs(notesObjResult);
|
|
33
|
-
}
|
|
34
|
-
}, [properties]); // eslint-disable-line
|
|
26
|
+
const globalMetadata = global ? metadata : properties;
|
|
27
|
+
const blocks = getAllBlocksAndSlateFields(globalMetadata);
|
|
28
|
+
const notesObj = makeFootnoteListOfUniqueItems(blocks);
|
|
35
29
|
|
|
36
30
|
return (
|
|
37
31
|
<div className="footnotes-listing-block">
|
|
@@ -62,7 +56,7 @@ const FootnotesBlockView = (props) => {
|
|
|
62
56
|
id={`cite_ref-${refsList[0]}`}
|
|
63
57
|
key={`indice-${refsList[0]}`}
|
|
64
58
|
>
|
|
65
|
-
<
|
|
59
|
+
<UniversalLink
|
|
66
60
|
href={`#ref-${parentUid || uid}`}
|
|
67
61
|
aria-label="Back to content"
|
|
68
62
|
onClick={() =>
|
|
@@ -72,12 +66,12 @@ const FootnotesBlockView = (props) => {
|
|
|
72
66
|
}
|
|
73
67
|
>
|
|
74
68
|
{alphabet[0]}
|
|
75
|
-
</
|
|
69
|
+
</UniversalLink>{' '}
|
|
76
70
|
</sup>
|
|
77
71
|
{/** following refs will have the uid of the one that references it*/}
|
|
78
72
|
{refsList.slice(1).map((ref, index) => (
|
|
79
73
|
<sup id={`cite_ref-${ref}`} key={`indice-${ref}`}>
|
|
80
|
-
<
|
|
74
|
+
<UniversalLink
|
|
81
75
|
href={`#ref-${ref}`}
|
|
82
76
|
aria-label="Back to content"
|
|
83
77
|
onClick={() =>
|
|
@@ -87,14 +81,14 @@ const FootnotesBlockView = (props) => {
|
|
|
87
81
|
}
|
|
88
82
|
>
|
|
89
83
|
{alphabet[index + 1]}
|
|
90
|
-
</
|
|
84
|
+
</UniversalLink>{' '}
|
|
91
85
|
</sup>
|
|
92
86
|
))}
|
|
93
87
|
</>
|
|
94
88
|
) : (
|
|
95
89
|
<sup id={`cite_ref-${uid}`}>
|
|
96
90
|
{/** some footnotes are never parent so we need the parent to reference */}
|
|
97
|
-
<
|
|
91
|
+
<UniversalLink
|
|
98
92
|
href={`#ref-${parentUid || uid}`}
|
|
99
93
|
aria-label="Back to content"
|
|
100
94
|
onClick={() =>
|
|
@@ -104,7 +98,7 @@ const FootnotesBlockView = (props) => {
|
|
|
104
98
|
}
|
|
105
99
|
>
|
|
106
100
|
↵
|
|
107
|
-
</
|
|
101
|
+
</UniversalLink>{' '}
|
|
108
102
|
</sup>
|
|
109
103
|
)}
|
|
110
104
|
</li>
|
package/src/editor/render.jsx
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from './utils';
|
|
9
9
|
import { isEmpty } from 'lodash';
|
|
10
10
|
import { useSelector } from 'react-redux';
|
|
11
|
+
import { UniversalLink } from '@plone/volto/components';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Removes '<?xml version="1.0"?>' from footnote
|
|
@@ -110,7 +111,7 @@ export const FootnoteElement = (props) => {
|
|
|
110
111
|
<Popup.Content>
|
|
111
112
|
<List divided relaxed selection>
|
|
112
113
|
<List.Item
|
|
113
|
-
as=
|
|
114
|
+
as={UniversalLink}
|
|
114
115
|
href={`#footnote-${citationRefId}`}
|
|
115
116
|
onClick={() =>
|
|
116
117
|
openAccordionIfContainsFootnoteReference(
|
|
@@ -132,7 +133,7 @@ export const FootnoteElement = (props) => {
|
|
|
132
133
|
{data.extra &&
|
|
133
134
|
data.extra.map((item) => (
|
|
134
135
|
<List.Item
|
|
135
|
-
as=
|
|
136
|
+
as={UniversalLink}
|
|
136
137
|
href={`#footnote-${item.zoteroId || item.uid}`}
|
|
137
138
|
onClick={() =>
|
|
138
139
|
openAccordionIfContainsFootnoteReference(
|
|
@@ -174,7 +175,7 @@ export const FootnoteElement = (props) => {
|
|
|
174
175
|
<Popup.Content>
|
|
175
176
|
<List divided relaxed selection>
|
|
176
177
|
<List.Item
|
|
177
|
-
as=
|
|
178
|
+
as={UniversalLink}
|
|
178
179
|
href={`#footnote-${citationRefId}`}
|
|
179
180
|
onClick={() =>
|
|
180
181
|
openAccordionIfContainsFootnoteReference(
|
|
@@ -196,7 +197,7 @@ export const FootnoteElement = (props) => {
|
|
|
196
197
|
{data.extra &&
|
|
197
198
|
data.extra.map((item) => (
|
|
198
199
|
<List.Item
|
|
199
|
-
as=
|
|
200
|
+
as={UniversalLink}
|
|
200
201
|
href={`#footnote-${item.zoteroId || item.uid}`}
|
|
201
202
|
onClick={() =>
|
|
202
203
|
openAccordionIfContainsFootnoteReference(
|
package/src/editor/utils.js
CHANGED
|
@@ -31,8 +31,7 @@ export const openAccordionIfContainsFootnoteReference = (footnoteId) => {
|
|
|
31
31
|
|
|
32
32
|
const blockTypesOperations = {
|
|
33
33
|
metadataSection: (block, properties) => {
|
|
34
|
-
const fields = block
|
|
35
|
-
|
|
34
|
+
const fields = block?.fields || [];
|
|
36
35
|
return fields
|
|
37
36
|
.filter((field) => field?.field?.widget === 'slate')
|
|
38
37
|
.reduce((accumulator, currentField) => {
|
|
@@ -48,8 +47,7 @@ const blockTypesOperations = {
|
|
|
48
47
|
}, []);
|
|
49
48
|
},
|
|
50
49
|
metadata: (block, properties) => {
|
|
51
|
-
const fId = block
|
|
52
|
-
|
|
50
|
+
const fId = block?.data?.id;
|
|
53
51
|
return block?.data?.widget === 'slate'
|
|
54
52
|
? [
|
|
55
53
|
{
|