@kitconcept/volto-light-theme 1.0.0-rc.4 → 1.0.0-rc.5
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/.github/workflows/acceptance.yml +52 -0
- package/.github/workflows/deploy.yml +7 -2
- package/CHANGELOG.md +16 -0
- package/Makefile +15 -10
- package/acceptance/cypress/fixtures/halfdome2022.jpg +0 -0
- package/acceptance/cypress/support/e2e.js +4 -0
- package/acceptance/cypress/tests/basic.cy.js +23 -23
- package/acceptance/docker-compose.yml +4 -8
- package/dockerfiles/Dockerfile.acceptance +6 -0
- package/dockerfiles/docker-compose.yml +3 -2
- package/package.json +3 -3
- package/src/index.js +23 -16
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Acceptance tests
|
|
2
|
+
on: [push]
|
|
3
|
+
|
|
4
|
+
env:
|
|
5
|
+
ADDON_NAME: "@kitconcept/volto-light-theme"
|
|
6
|
+
ADDON_PATH: "volto-light-theme"
|
|
7
|
+
VOLTO_VERSION: "17.0.0-alpha.17"
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
|
|
11
|
+
acceptance:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v3
|
|
16
|
+
|
|
17
|
+
- name: Set up Docker Buildx
|
|
18
|
+
uses: docker/setup-buildx-action@v2
|
|
19
|
+
|
|
20
|
+
- name: Install Cypress
|
|
21
|
+
run: |
|
|
22
|
+
cd acceptance
|
|
23
|
+
yarn
|
|
24
|
+
|
|
25
|
+
- name: "Cypress: Acceptance tests"
|
|
26
|
+
uses: cypress-io/github-action@v5
|
|
27
|
+
env:
|
|
28
|
+
BABEL_ENV: production
|
|
29
|
+
CYPRESS_RETRIES: 2
|
|
30
|
+
with:
|
|
31
|
+
parallel: false
|
|
32
|
+
browser: chrome
|
|
33
|
+
working-directory: acceptance
|
|
34
|
+
spec: cypress/tests/*.js
|
|
35
|
+
install: false
|
|
36
|
+
start: |
|
|
37
|
+
docker compose -f ci.yml --profile prod up
|
|
38
|
+
wait-on: 'npx wait-on --httpTimeout 20000 http-get://localhost:55001/plone http://localhost:3000'
|
|
39
|
+
|
|
40
|
+
# Upload Cypress screenshots
|
|
41
|
+
- uses: actions/upload-artifact@v3
|
|
42
|
+
if: failure()
|
|
43
|
+
with:
|
|
44
|
+
name: cypress-screenshots-acceptance
|
|
45
|
+
path: acceptance/cypress/screenshots
|
|
46
|
+
|
|
47
|
+
# Upload Cypress videos
|
|
48
|
+
- uses: actions/upload-artifact@v3
|
|
49
|
+
if: failure()
|
|
50
|
+
with:
|
|
51
|
+
name: cypress-videos-acceptance
|
|
52
|
+
path: acceptance/cypress/videos
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
name: Release and deploy
|
|
2
2
|
on:
|
|
3
|
-
|
|
3
|
+
workflow_run:
|
|
4
|
+
workflows: [Acceptance Tests]
|
|
5
|
+
types:
|
|
6
|
+
- completed
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
4
9
|
workflow_dispatch:
|
|
5
10
|
|
|
6
11
|
env:
|
|
7
12
|
ENVIRONMENT: "light-theme.kitconcept.io"
|
|
8
13
|
IMAGE_NAME: "ghcr.io/kitconcept/voltolighttheme-frontend"
|
|
9
|
-
VOLTO_VERSION: "17.0.0-alpha.
|
|
14
|
+
VOLTO_VERSION: "17.0.0-alpha.17"
|
|
10
15
|
|
|
11
16
|
jobs:
|
|
12
17
|
meta:
|
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,22 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- towncrier release notes start -->
|
|
10
10
|
|
|
11
|
+
## 1.0.0-rc.5 (2023-07-11)
|
|
12
|
+
|
|
13
|
+
### Breaking
|
|
14
|
+
|
|
15
|
+
- Move the container query polyfill to an add-on profile, disabled by default @sneridagh [#137](https://github.com/kitconcept/volto-light-theme/pull/137)
|
|
16
|
+
|
|
17
|
+
### Feature
|
|
18
|
+
|
|
19
|
+
- Upgrade to Volto 17a17 as baseline @sneridagh [#136](https://github.com/kitconcept/volto-light-theme/pull/136)
|
|
20
|
+
- Add acceptance tests layer, update docker files and Makefile @sneridagh [#137](https://github.com/kitconcept/volto-light-theme/pull/137)
|
|
21
|
+
|
|
22
|
+
### Bugfix
|
|
23
|
+
|
|
24
|
+
- Check if the separator is present before enhancing it @sneridagh [#138](https://github.com/kitconcept/volto-light-theme/pull/138)
|
|
25
|
+
|
|
26
|
+
|
|
11
27
|
## 1.0.0-rc.4 (2023-07-11)
|
|
12
28
|
|
|
13
29
|
### Bugfix
|
package/Makefile
CHANGED
|
@@ -22,7 +22,7 @@ RESET=`tput sgr0`
|
|
|
22
22
|
YELLOW=`tput setaf 3`
|
|
23
23
|
|
|
24
24
|
PLONE_VERSION=6
|
|
25
|
-
VOLTO_VERSION=17.0.0-alpha.
|
|
25
|
+
VOLTO_VERSION=17.0.0-alpha.17
|
|
26
26
|
|
|
27
27
|
ADDON_NAME='@kitconcept/volto-light-theme'
|
|
28
28
|
ADDON_PATH='volto-light-theme'
|
|
@@ -103,20 +103,20 @@ test-ci: ## Run unit tests in CI
|
|
|
103
103
|
|
|
104
104
|
## Acceptance
|
|
105
105
|
.PHONY: install-acceptance
|
|
106
|
-
install-acceptance: ## Install Cypress, build containers
|
|
106
|
+
install-acceptance: ## Install Cypress, build acceptance containers
|
|
107
107
|
(cd acceptance && yarn)
|
|
108
108
|
${ACCEPTANCE} --profile dev --profile prod build
|
|
109
109
|
|
|
110
110
|
.PHONY: start-test-acceptance-server
|
|
111
|
-
start-test-acceptance-server: ## Start acceptance server
|
|
112
|
-
${ACCEPTANCE} --profile dev up
|
|
111
|
+
start-test-acceptance-server: ## Start acceptance server (for use it in while developing)
|
|
112
|
+
${ACCEPTANCE} --profile dev up
|
|
113
113
|
|
|
114
114
|
.PHONY: start-test-acceptance-server-prod
|
|
115
|
-
start-test-acceptance-server-prod: ## Start acceptance server
|
|
115
|
+
start-test-acceptance-server-prod: ## Start acceptance server in prod (used by CI)
|
|
116
116
|
${ACCEPTANCE} --profile prod up -d
|
|
117
117
|
|
|
118
118
|
.PHONY: test-acceptance
|
|
119
|
-
test-acceptance: ## Start Cypress
|
|
119
|
+
test-acceptance: ## Start Cypress (for use it while developing)
|
|
120
120
|
(cd acceptance && ./node_modules/.bin/cypress open)
|
|
121
121
|
|
|
122
122
|
.PHONY: test-acceptance-headless
|
|
@@ -124,13 +124,18 @@ test-acceptance-headless: ## Run cypress tests in CI
|
|
|
124
124
|
(cd acceptance && ./node_modules/.bin/cypress run)
|
|
125
125
|
|
|
126
126
|
.PHONY: stop-test-acceptance-server
|
|
127
|
-
stop-test-acceptance-server: ## Stop acceptance server
|
|
128
|
-
${ACCEPTANCE} down
|
|
127
|
+
stop-test-acceptance-server: ## Stop acceptance server (for use it while finished developing)
|
|
128
|
+
${ACCEPTANCE} --profile dev down
|
|
129
129
|
|
|
130
130
|
.PHONY: status-test-acceptance-server
|
|
131
|
-
status-test-acceptance-server: ## Status of Acceptance Server
|
|
131
|
+
status-test-acceptance-server: ## Status of Acceptance Server (for use it while developing)
|
|
132
132
|
${ACCEPTANCE} ps
|
|
133
133
|
|
|
134
134
|
.PHONY: debug-frontend
|
|
135
|
-
debug-frontend: ## Run bash in the Frontend container
|
|
135
|
+
debug-frontend: ## Run bash in the Frontend container (for debug infrastructure purposes)
|
|
136
136
|
${DEV_COMPOSE} run --entrypoint bash addon-dev
|
|
137
|
+
|
|
138
|
+
.PHONY: install-local
|
|
139
|
+
install-local: ## Installs essentials for developing locally (ESlint, prettier...) (for use it while developing)
|
|
140
|
+
yarn remove -A @plone/volto && yarn add @plone/volto && git co -- package.json yarn.lock
|
|
141
|
+
mv .eslintrc.local.js .eslintrc.js
|
|
Binary file
|
|
@@ -4,6 +4,10 @@ import './commands';
|
|
|
4
4
|
import { setup, teardown } from './reset-fixture';
|
|
5
5
|
|
|
6
6
|
beforeEach(function () {
|
|
7
|
+
cy.setCookie('confirm_cookies', '1');
|
|
8
|
+
cy.setCookie('confirm_tracking', '1');
|
|
9
|
+
cy.setCookie('confirm_facebook', '1');
|
|
10
|
+
cy.setCookie('confirm_youtube', '1');
|
|
7
11
|
cy.log('Setting up API fixture');
|
|
8
12
|
setup();
|
|
9
13
|
});
|
|
@@ -6,6 +6,9 @@ import {
|
|
|
6
6
|
context('Basic Acceptance Tests', () => {
|
|
7
7
|
describe('Text Block Tests', () => {
|
|
8
8
|
beforeEach(() => {
|
|
9
|
+
cy.intercept('GET', `/**/*?expand*`).as('content');
|
|
10
|
+
cy.intercept('GET', '/**/Document').as('schema');
|
|
11
|
+
|
|
9
12
|
// given a logged in editor and a page in edit mode
|
|
10
13
|
cy.autologin();
|
|
11
14
|
cy.createContent({
|
|
@@ -14,6 +17,7 @@ context('Basic Acceptance Tests', () => {
|
|
|
14
17
|
contentTitle: 'Document',
|
|
15
18
|
});
|
|
16
19
|
cy.visit('/');
|
|
20
|
+
cy.wait('@content');
|
|
17
21
|
});
|
|
18
22
|
|
|
19
23
|
it('As editor I can add a page with a text block', function () {
|
|
@@ -32,39 +36,35 @@ context('Basic Acceptance Tests', () => {
|
|
|
32
36
|
|
|
33
37
|
getSelectedSlateEditor().contains('This is the text');
|
|
34
38
|
cy.get('#toolbar-save').click();
|
|
39
|
+
cy.wait('@content');
|
|
35
40
|
cy.url().should('eq', Cypress.config().baseUrl + '/my-page');
|
|
36
41
|
});
|
|
37
42
|
|
|
38
43
|
it('As editor I can add a link to a text block', function () {
|
|
39
|
-
cy.intercept('GET', '/**/document').as('content');
|
|
40
|
-
cy.visit('/document');
|
|
41
|
-
cy.wait('@content');
|
|
42
|
-
|
|
43
44
|
cy.navigate('/document/edit');
|
|
45
|
+
cy.wait('@schema');
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
getSlateEditorAndType(
|
|
47
|
-
'.slate-editor [contenteditable=true]',
|
|
48
|
-
'Colorless green ideas sleep furiously.',
|
|
49
|
-
).setSelection('furiously');
|
|
47
|
+
cy.get('.block.inner.title .documentFirstHeading');
|
|
50
48
|
|
|
51
|
-
cy.
|
|
49
|
+
cy.log('when I create a link');
|
|
52
50
|
|
|
53
|
-
cy.
|
|
54
|
-
cy.get('#toolbar-save').click();
|
|
55
|
-
cy.url().should('eq', Cypress.config().baseUrl + '/document');
|
|
56
|
-
cy.waitForResourceToLoad('@navigation');
|
|
57
|
-
cy.waitForResourceToLoad('@breadcrumbs');
|
|
58
|
-
cy.waitForResourceToLoad('@actions');
|
|
59
|
-
cy.waitForResourceToLoad('@types');
|
|
60
|
-
cy.waitForResourceToLoad('document');
|
|
61
|
-
|
|
62
|
-
// then the page view should contain a link
|
|
63
|
-
cy.get('.ui.container p').contains(
|
|
51
|
+
cy.getSlateEditorAndType(
|
|
64
52
|
'Colorless green ideas sleep furiously.',
|
|
53
|
+
).setSlateSelection('furiously');
|
|
54
|
+
cy.clickSlateButton('Add link');
|
|
55
|
+
cy.get('.slate-toolbar .link-form-container input').type(
|
|
56
|
+
'https://google.com{enter}',
|
|
65
57
|
);
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
|
|
59
|
+
cy.get('#toolbar-save', { timeout: 10000 }).click();
|
|
60
|
+
cy.wait('@content');
|
|
61
|
+
|
|
62
|
+
cy.log('then the page view should contain a link');
|
|
63
|
+
|
|
64
|
+
cy.get('.container p').contains('Colorless green ideas sleep furiously.');
|
|
65
|
+
cy.get('.container p a')
|
|
66
|
+
.should('have.text', 'furiously')
|
|
67
|
+
.and('have.attr', 'href')
|
|
68
68
|
.and('include', 'https://google.com');
|
|
69
69
|
});
|
|
70
70
|
});
|
|
@@ -15,9 +15,11 @@ services:
|
|
|
15
15
|
environment:
|
|
16
16
|
RAZZLE_INTERNAL_API_PATH: http://backend-acceptance:55001/plone
|
|
17
17
|
RAZZLE_API_PATH: http://localhost:55001/plone
|
|
18
|
+
HOST: 0.0.0.0
|
|
18
19
|
ports:
|
|
19
20
|
- 3000:3000
|
|
20
21
|
- 3001:3001
|
|
22
|
+
tty: true
|
|
21
23
|
depends_on:
|
|
22
24
|
- backend-acceptance
|
|
23
25
|
profiles:
|
|
@@ -34,6 +36,7 @@ services:
|
|
|
34
36
|
environment:
|
|
35
37
|
RAZZLE_INTERNAL_API_PATH: http://backend-acceptance:55001/plone
|
|
36
38
|
RAZZLE_API_PATH: http://localhost:55001/plone
|
|
39
|
+
HOST: 0.0.0.0
|
|
37
40
|
ports:
|
|
38
41
|
- 3000:3000
|
|
39
42
|
depends_on:
|
|
@@ -42,14 +45,7 @@ services:
|
|
|
42
45
|
- prod
|
|
43
46
|
|
|
44
47
|
backend-acceptance:
|
|
45
|
-
image: plone/
|
|
46
|
-
command: ./bin/robot-server plone.app.robotframework.testing.VOLTO_ROBOT_TESTING
|
|
47
|
-
environment:
|
|
48
|
-
ZSERVER_HOST: 0.0.0.0
|
|
49
|
-
ZSERVER_PORT: 55001
|
|
50
|
-
ADDONS: 'plone.app.robotframework==2.0.0'
|
|
51
|
-
APPLY_PROFILES: plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage
|
|
52
|
-
CONFIGURE_PACKAGES: plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors
|
|
48
|
+
image: plone/server-acceptance:${PLONE_VERSION:-6}
|
|
53
49
|
ports:
|
|
54
50
|
- 55001:55001
|
|
55
51
|
profiles:
|
|
@@ -5,6 +5,12 @@ FROM plone/frontend-dev:${VOLTO_VERSION}
|
|
|
5
5
|
ARG ADDON_NAME
|
|
6
6
|
ARG ADDON_PATH
|
|
7
7
|
|
|
8
|
+
# Copy helper.py as /setupAddon
|
|
9
|
+
COPY dockerfiles/helper.py /setupAddon
|
|
10
|
+
|
|
11
|
+
# Copy volto.config.js
|
|
12
|
+
COPY --chown=node:node volto.config.js* /app/
|
|
13
|
+
|
|
8
14
|
COPY --chown=node:node package.json /app/src/addons/${ADDON_PATH}/
|
|
9
15
|
|
|
10
16
|
RUN <<EOT
|
|
@@ -9,12 +9,13 @@ services:
|
|
|
9
9
|
args:
|
|
10
10
|
ADDON_NAME: "${ADDON_NAME}"
|
|
11
11
|
ADDON_PATH: "${ADDON_PATH}"
|
|
12
|
-
VOLTO_VERSION: "${VOLTO_VERSION:-
|
|
12
|
+
VOLTO_VERSION: "${VOLTO_VERSION:-17}"
|
|
13
13
|
volumes:
|
|
14
14
|
- ${CURRENT_DIR}:/app/src/addons/${ADDON_PATH}/
|
|
15
15
|
environment:
|
|
16
16
|
RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone
|
|
17
17
|
RAZZLE_API_PATH: http://localhost:8080/Plone
|
|
18
|
+
HOST: 0.0.0.0
|
|
18
19
|
ports:
|
|
19
20
|
- 3000:3000
|
|
20
21
|
- 3001:3001
|
|
@@ -29,7 +30,7 @@ services:
|
|
|
29
30
|
args:
|
|
30
31
|
ADDON_NAME: "${ADDON_NAME}"
|
|
31
32
|
ADDON_PATH: "${ADDON_PATH}"
|
|
32
|
-
VOLTO_VERSION: "${VOLTO_VERSION:-
|
|
33
|
+
VOLTO_VERSION: "${VOLTO_VERSION:-17}"
|
|
33
34
|
environment:
|
|
34
35
|
RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone
|
|
35
36
|
RAZZLE_API_PATH: http://localhost:8080/Plone
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitconcept/volto-light-theme",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.5",
|
|
4
4
|
"description": "Volto Light Theme by kitconcept",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@kitconcept/volto-heading-block": "^2.2.0",
|
|
59
59
|
"@kitconcept/volto-image-block": "^1.0.1",
|
|
60
60
|
"@kitconcept/volto-introduction-block": "^1.0.0",
|
|
61
|
-
"@kitconcept/volto-separator-block": "^3.2.
|
|
61
|
+
"@kitconcept/volto-separator-block": "^3.2.2",
|
|
62
62
|
"@kitconcept/volto-slider-block": "^4.2.0",
|
|
63
|
-
"@plone/volto": "^17.0.0-alpha.
|
|
63
|
+
"@plone/volto": "^17.0.0-alpha.17"
|
|
64
64
|
}
|
|
65
65
|
}
|
package/src/index.js
CHANGED
|
@@ -126,14 +126,6 @@ const applyConfig = (config) => {
|
|
|
126
126
|
|
|
127
127
|
config.settings.slidingSearchAnimation = true;
|
|
128
128
|
|
|
129
|
-
config.settings.appExtras = [
|
|
130
|
-
...config.settings.appExtras,
|
|
131
|
-
{
|
|
132
|
-
match: '',
|
|
133
|
-
component: ContainerQueriesPolyfill,
|
|
134
|
-
},
|
|
135
|
-
];
|
|
136
|
-
|
|
137
129
|
config.blocks.blocksConfig.accordion = {
|
|
138
130
|
...config.blocks.blocksConfig.accordion,
|
|
139
131
|
mostUsed: true,
|
|
@@ -233,14 +225,17 @@ const applyConfig = (config) => {
|
|
|
233
225
|
colors: BG_COLORS,
|
|
234
226
|
};
|
|
235
227
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
config.blocks.blocksConfig.separator
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
228
|
+
// Check if the separator is present before enhancing it
|
|
229
|
+
if (config.blocks.blocksConfig.separator.id) {
|
|
230
|
+
config.blocks.blocksConfig.separator = {
|
|
231
|
+
...config.blocks.blocksConfig.separator,
|
|
232
|
+
schemaEnhancer: composeSchema(
|
|
233
|
+
config.blocks.blocksConfig.separator.schemaEnhancer,
|
|
234
|
+
defaultStylingSchema,
|
|
235
|
+
),
|
|
236
|
+
colors: BG_COLORS,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
244
239
|
|
|
245
240
|
config.blocks.blocksConfig.listing = {
|
|
246
241
|
...config.blocks.blocksConfig.listing,
|
|
@@ -260,4 +255,16 @@ const applyConfig = (config) => {
|
|
|
260
255
|
return config;
|
|
261
256
|
};
|
|
262
257
|
|
|
258
|
+
export const withContainerQueryPolyfill = (config) => {
|
|
259
|
+
config.settings.appExtras = [
|
|
260
|
+
...config.settings.appExtras,
|
|
261
|
+
{
|
|
262
|
+
match: '',
|
|
263
|
+
component: ContainerQueriesPolyfill,
|
|
264
|
+
},
|
|
265
|
+
];
|
|
266
|
+
|
|
267
|
+
return config;
|
|
268
|
+
};
|
|
269
|
+
|
|
263
270
|
export default applyConfig;
|