@kitconcept/volto-light-theme 1.0.0-rc.7 → 1.0.0-rc.8
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/.eslintrc +48 -0
- package/CHANGELOG.md +13 -0
- package/Makefile +3 -4
- package/README.md +187 -7
- package/dockerfiles/docker-compose.yml +2 -0
- package/package.json +11 -1
- package/src/components/Theme/EventView.jsx +11 -11
- package/src/customizations/volto/components/theme/View/FileView.jsx +1 -1
- package/src/theme/_content.scss +33 -0
- package/.eslintrc.local.js +0 -50
package/.eslintrc
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["react-app", "prettier", "plugin:jsx-a11y/recommended"],
|
|
3
|
+
"plugins": ["prettier", "react-hooks", "jsx-a11y"],
|
|
4
|
+
"env": {
|
|
5
|
+
"es6": true,
|
|
6
|
+
"browser": true,
|
|
7
|
+
"node": true,
|
|
8
|
+
"mocha": true,
|
|
9
|
+
"jasmine": true
|
|
10
|
+
},
|
|
11
|
+
"parser": "babel-eslint",
|
|
12
|
+
"parserOptions": {
|
|
13
|
+
"ecmaVersion": 6,
|
|
14
|
+
"sourceType": "module",
|
|
15
|
+
"ecmaFeatures": {
|
|
16
|
+
"legacyDecorators": true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"rules": {
|
|
20
|
+
"import/no-unresolved": 0,
|
|
21
|
+
"no-alert": 1,
|
|
22
|
+
"no-console": 1,
|
|
23
|
+
"no-debugger": 1,
|
|
24
|
+
"prettier/prettier": [
|
|
25
|
+
"error",
|
|
26
|
+
{ "trailingComma": "all", "singleQuote": true }
|
|
27
|
+
],
|
|
28
|
+
"react-hooks/rules-of-hooks": "error",
|
|
29
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
30
|
+
"react/react-in-jsx-scope": "off"
|
|
31
|
+
},
|
|
32
|
+
"globals": {
|
|
33
|
+
"root": true,
|
|
34
|
+
"__DEVELOPMENT__": true,
|
|
35
|
+
"__CLIENT__": true,
|
|
36
|
+
"__SERVER__": true,
|
|
37
|
+
"__DISABLE_SSR__": true,
|
|
38
|
+
"__DEVTOOLS__": true,
|
|
39
|
+
"__DEBUG__": true,
|
|
40
|
+
"__SSR__": true,
|
|
41
|
+
"__SENTRY__": true,
|
|
42
|
+
"cy": true,
|
|
43
|
+
"Cypress": true,
|
|
44
|
+
"jest": true,
|
|
45
|
+
"socket": true,
|
|
46
|
+
"webpackIsomorphicTools": true
|
|
47
|
+
}
|
|
48
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,19 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- towncrier release notes start -->
|
|
10
10
|
|
|
11
|
+
## 1.0.0-rc.8 (2023-07-14)
|
|
12
|
+
|
|
13
|
+
### Bugfix
|
|
14
|
+
|
|
15
|
+
- Fix Image content type @iRohitSingh [#18](https://github.com/kitconcept/volto-light-theme/pull/18)
|
|
16
|
+
- Fix a11y issues in EventView @steffenri [#147](https://github.com/kitconcept/volto-light-theme/pull/147)
|
|
17
|
+
- Remove typo in fileview @steffenri [#148](https://github.com/kitconcept/volto-light-theme/pull/148)
|
|
18
|
+
|
|
19
|
+
### Documentation
|
|
20
|
+
|
|
21
|
+
- Documentation on local docker development - local ESlint working @sneridagh [#144](https://github.com/kitconcept/volto-light-theme/pull/144)
|
|
22
|
+
|
|
23
|
+
|
|
11
24
|
## 1.0.0-rc.7 (2023-07-13)
|
|
12
25
|
|
|
13
26
|
### Bugfix
|
package/Makefile
CHANGED
|
@@ -135,7 +135,6 @@ status-test-acceptance-server: ## Status of Acceptance Server (for use it while
|
|
|
135
135
|
debug-frontend: ## Run bash in the Frontend container (for debug infrastructure purposes)
|
|
136
136
|
${DEV_COMPOSE} run --entrypoint bash addon-dev
|
|
137
137
|
|
|
138
|
-
.PHONY:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
mv .eslintrc.local.js .eslintrc.js
|
|
138
|
+
.PHONY: pull-backend-image
|
|
139
|
+
pull-backend-image: ## Pulls and updates the backend image (for use it while developing)
|
|
140
|
+
docker pull ghcr.io/kitconcept/voltolighttheme:latest
|
package/README.md
CHANGED
|
@@ -98,11 +98,68 @@ These main rules spec applies to the theme:
|
|
|
98
98
|
- Separator-Block (https://www.npmjs.com/package/@kitconcept/volto-separator-block)
|
|
99
99
|
- Heading-Block (https://www.npmjs.com/package/@kitconcept/volto-heading-block)
|
|
100
100
|
- Introduction-Block (https://www.npmjs.com/package/@kitconcept/volto-introduction-block)
|
|
101
|
+
- Accordion-Block (https://www.npmjs.com/package/@eeacms/volto-accordion-block)
|
|
101
102
|
|
|
102
103
|
and the following add-ons:
|
|
103
104
|
|
|
104
105
|
- DSGVO-Banner (https://www.npmjs.com/package/@kitconcept/volto-dsgvo-banner)
|
|
105
106
|
|
|
107
|
+
## Installation
|
|
108
|
+
|
|
109
|
+
It is recommended that your project or policy add-on `package.json` include the aforementioned add-ons.
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
"dependencies": {
|
|
113
|
+
"@eeacms/volto-accordion-block": "9.0.0",
|
|
114
|
+
"@kitconcept/volto-button-block": "2.1.0",
|
|
115
|
+
"@kitconcept/volto-dsgvo-banner": "1.3.0",
|
|
116
|
+
"@kitconcept/volto-heading-block": "2.2.0",
|
|
117
|
+
"@kitconcept/volto-introduction-block": "1.0.0",
|
|
118
|
+
"@kitconcept/volto-light-theme": "1.0.0",
|
|
119
|
+
"@kitconcept/volto-separator-block": "3.2.0",
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
This theme won't install them for you, as they are declared as `peerDependencies`.
|
|
124
|
+
This is because the theme won't have to force you to use any specific add-on version, and avoids package hoisting issues.
|
|
125
|
+
|
|
126
|
+
In your project or policy add-on `package.json` you should declare all of them as Volto add-ons
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
"addons": [
|
|
130
|
+
"@eeacms/volto-accordion-block",
|
|
131
|
+
"@kitconcept/volto-button-block",
|
|
132
|
+
"@kitconcept/volto-heading-block",
|
|
133
|
+
"@kitconcept/volto-introduction-block",
|
|
134
|
+
"@kitconcept/volto-highlight-block",
|
|
135
|
+
"@kitconcept/volto-separator-block",
|
|
136
|
+
"@kitconcept/volto-light-theme",
|
|
137
|
+
"your_policy_addon_here"
|
|
138
|
+
],
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Make sure your policy add-on is the last one, as you would want that its configuration has priority over all the others. Make sure also that `@kitconcept/volto-light-theme` is the one before your policy add-on.
|
|
142
|
+
|
|
143
|
+
Then, declare the theme in your project `package.json`:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
"theme": "@kitconcept/volto-light-theme",
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Alternativelly, you can also declare it in your project's `volto.config.js`:
|
|
150
|
+
|
|
151
|
+
```js
|
|
152
|
+
const addons = [];
|
|
153
|
+
const theme = '@kitconcept/volto-light-theme';
|
|
154
|
+
|
|
155
|
+
module.exports = {
|
|
156
|
+
addons,
|
|
157
|
+
theme,
|
|
158
|
+
};
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
You can specify your project add-ons in `volto.config.js`, but sometimes is better to have them all in one place (in your policy add-on) for portability.
|
|
162
|
+
|
|
106
163
|
## Development Setup
|
|
107
164
|
|
|
108
165
|
This theme works under Volto 17 alpha 16 onwards.
|
|
@@ -110,24 +167,147 @@ Compatibility with Volto 16 might be achieved, but it has to be at customization
|
|
|
110
167
|
specific project add-on.
|
|
111
168
|
This is mainly due to the `RenderBlocks` customization that is based in the one in 17 because of the Grid block in core and the autogrouping feature.
|
|
112
169
|
See more information about the other dependencies in `peerDependencies` in `package.json`.
|
|
170
|
+
It is possible to develop this add-on using docker containers and the provided convenience Makefile commands.
|
|
171
|
+
Run `make help` to list the available commands.
|
|
172
|
+
|
|
173
|
+
````text
|
|
174
|
+
build-backend Build
|
|
175
|
+
start-backend Starts Docker backend
|
|
176
|
+
stop-backend Stop Docker backend
|
|
177
|
+
build-live Build Addon live
|
|
178
|
+
build-addon Build Addon dev
|
|
179
|
+
start-dev Starts Dev container
|
|
180
|
+
dev Develop the addon
|
|
181
|
+
help Show this help.
|
|
182
|
+
i18n Sync i18n
|
|
183
|
+
format Format codebase
|
|
184
|
+
lint Lint Codebase
|
|
185
|
+
test Run unit tests
|
|
186
|
+
test-ci Run unit tests in CI
|
|
187
|
+
install-acceptance Install Cypress, build acceptance containers
|
|
188
|
+
start-test-acceptance-server Start acceptance server (for use it in while developing)
|
|
189
|
+
start-test-acceptance-server-prod Start acceptance server in prod (used by CI)
|
|
190
|
+
test-acceptance Start Cypress (for use it while developing)
|
|
191
|
+
test-acceptance-headless Run cypress tests in CI
|
|
192
|
+
stop-test-acceptance-server Stop acceptance server (for use it while finished developing)
|
|
193
|
+
status-test-acceptance-server Status of Acceptance Server (for use it while developing)
|
|
194
|
+
debug-frontend Run bash in the Frontend container (for debug infrastructure purposes)
|
|
195
|
+
pull-backend-image Pulls and updates the backend image (for use it while developing)
|
|
196
|
+
````
|
|
113
197
|
|
|
114
198
|
### Prerequisites
|
|
115
199
|
|
|
116
200
|
- Docker
|
|
117
201
|
- Node 18 (e.g. via nvm)
|
|
118
202
|
|
|
119
|
-
###
|
|
203
|
+
### Development environment Setup
|
|
204
|
+
|
|
205
|
+
Run once
|
|
206
|
+
|
|
207
|
+
```shell
|
|
208
|
+
make dev
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
which will build and launch the backend and frontend containers.
|
|
212
|
+
There's no need to build them again after doing it the first time unless something has changed from the container setup.
|
|
213
|
+
|
|
214
|
+
In order to make the local IDE play well with this setup, is it required to run once `yarn` to install locally the required packages (ESlint, Prettier, Stylelint).
|
|
120
215
|
|
|
121
216
|
Run
|
|
122
217
|
|
|
123
|
-
|
|
218
|
+
```shell
|
|
219
|
+
yarn
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Build the containers manually
|
|
223
|
+
|
|
224
|
+
Run
|
|
225
|
+
|
|
226
|
+
```shell
|
|
227
|
+
make build-backend
|
|
228
|
+
make build-addon
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Run the containers
|
|
232
|
+
|
|
233
|
+
Run
|
|
234
|
+
|
|
235
|
+
```shell
|
|
124
236
|
make start-dev
|
|
125
|
-
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
This will start both the frontend and backend containers.
|
|
126
240
|
|
|
127
241
|
### Stop Backend (Docker)
|
|
128
242
|
|
|
129
|
-
|
|
243
|
+
After developing, in order to stop the running backend, don't forget to run:
|
|
130
244
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
245
|
+
Run
|
|
246
|
+
|
|
247
|
+
```shell
|
|
248
|
+
make stop-backend
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Linting
|
|
252
|
+
|
|
253
|
+
Run
|
|
254
|
+
|
|
255
|
+
```shell
|
|
256
|
+
make lint
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Formatting
|
|
260
|
+
|
|
261
|
+
Run
|
|
262
|
+
|
|
263
|
+
```shell
|
|
264
|
+
make format
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### i18n
|
|
268
|
+
|
|
269
|
+
Run
|
|
270
|
+
|
|
271
|
+
```shell
|
|
272
|
+
make i18n
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Unit tests
|
|
276
|
+
|
|
277
|
+
Run
|
|
278
|
+
|
|
279
|
+
```shell
|
|
280
|
+
make test
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Acceptance tests
|
|
284
|
+
|
|
285
|
+
Run once
|
|
286
|
+
|
|
287
|
+
```shell
|
|
288
|
+
make install-acceptance
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
For starting the servers
|
|
292
|
+
|
|
293
|
+
Run
|
|
294
|
+
|
|
295
|
+
```shell
|
|
296
|
+
make start-test-acceptance-server
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
The frontend is run in dev mode, so development while writing tests is possible.
|
|
300
|
+
|
|
301
|
+
Run
|
|
302
|
+
|
|
303
|
+
```shell
|
|
304
|
+
make test-acceptance
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
To run Cypress tests afterwards.
|
|
308
|
+
|
|
309
|
+
When finished, don't forget to shutdown the backend server.
|
|
310
|
+
|
|
311
|
+
```shell
|
|
312
|
+
make stop-test-acceptance-server
|
|
313
|
+
```
|
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.8",
|
|
4
4
|
"description": "Volto Light Theme by kitconcept",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -33,6 +33,16 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@plone/scripts": "^3.0.0",
|
|
36
|
+
"babel-eslint": "10.1.0",
|
|
37
|
+
"eslint": "6.8.0",
|
|
38
|
+
"eslint-config-prettier": "6.11.0",
|
|
39
|
+
"eslint-config-react-app": "5.2.1",
|
|
40
|
+
"eslint-plugin-flowtype": "4.7.0",
|
|
41
|
+
"eslint-plugin-import": "2.20.2",
|
|
42
|
+
"eslint-plugin-jsx-a11y": "6.2.3",
|
|
43
|
+
"eslint-plugin-prettier": "3.1.3",
|
|
44
|
+
"eslint-plugin-react": "7.20.0",
|
|
45
|
+
"eslint-plugin-react-hooks": "4.0.2",
|
|
36
46
|
"postcss-scss": "4.0.6",
|
|
37
47
|
"prettier": "2.0.5",
|
|
38
48
|
"razzle-plugin-scss": "4.2.18",
|
|
@@ -224,21 +224,21 @@ const EventView = (props) => {
|
|
|
224
224
|
</div>
|
|
225
225
|
</Grid.Column>
|
|
226
226
|
<div className="event-button">
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
>
|
|
227
|
+
<a
|
|
228
|
+
className="ics-download"
|
|
229
|
+
target="_blank"
|
|
230
|
+
rel="noreferrer"
|
|
231
|
+
href={`${expandToBackendURL(
|
|
232
|
+
content['@id'],
|
|
233
|
+
)}/ics_view`}
|
|
234
|
+
>
|
|
235
|
+
<Button className="event-btn">
|
|
236
236
|
<FormattedMessage
|
|
237
237
|
id="ICS-Download"
|
|
238
238
|
defaultMessage="ICS Download"
|
|
239
239
|
/>
|
|
240
|
-
</
|
|
241
|
-
</
|
|
240
|
+
</Button>
|
|
241
|
+
</a>
|
|
242
242
|
</div>
|
|
243
243
|
</Grid.Row>
|
|
244
244
|
</Grid>
|
|
@@ -30,7 +30,7 @@ const FileView = ({ content }) => (
|
|
|
30
30
|
</h1>
|
|
31
31
|
<div className="file-detail">
|
|
32
32
|
{content.description && (
|
|
33
|
-
<p className="documentDescription">{content.description}
|
|
33
|
+
<p className="documentDescription">{content.description}</p>
|
|
34
34
|
)}
|
|
35
35
|
{content.file?.download && (
|
|
36
36
|
<>
|
package/src/theme/_content.scss
CHANGED
|
@@ -145,3 +145,36 @@
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
+
.contenttype-image {
|
|
149
|
+
.content-area {
|
|
150
|
+
max-width: var(--default-container-width) !important;
|
|
151
|
+
margin-right: auto;
|
|
152
|
+
margin-bottom: 0;
|
|
153
|
+
margin-left: auto;
|
|
154
|
+
.documentFirstHeading {
|
|
155
|
+
@media only screen and (max-width: 769px) {
|
|
156
|
+
margin-bottom: 60px;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
figure {
|
|
160
|
+
img {
|
|
161
|
+
aspect-ratio: $aspect-ratio;
|
|
162
|
+
}
|
|
163
|
+
figcaption {
|
|
164
|
+
margin-top: 20px;
|
|
165
|
+
margin-bottom: 0;
|
|
166
|
+
.title {
|
|
167
|
+
margin-bottom: 5px;
|
|
168
|
+
}
|
|
169
|
+
.description div {
|
|
170
|
+
margin-bottom: 5px;
|
|
171
|
+
}
|
|
172
|
+
.credits {
|
|
173
|
+
padding-bottom: 20px;
|
|
174
|
+
margin-bottom: 0;
|
|
175
|
+
color: #0066cc;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
package/.eslintrc.local.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const projectRootPath = __dirname;
|
|
4
|
-
const packageJson = require(path.join(projectRootPath, 'package.json'));
|
|
5
|
-
|
|
6
|
-
let voltoPath = './node_modules/@plone/volto';
|
|
7
|
-
|
|
8
|
-
let configFile;
|
|
9
|
-
if (fs.existsSync(`${this.projectRootPath}/tsconfig.json`))
|
|
10
|
-
configFile = `${this.projectRootPath}/tsconfig.json`;
|
|
11
|
-
else if (fs.existsSync(`${this.projectRootPath}/jsconfig.json`))
|
|
12
|
-
configFile = `${this.projectRootPath}/jsconfig.json`;
|
|
13
|
-
|
|
14
|
-
if (configFile) {
|
|
15
|
-
const jsConfig = require(configFile).compilerOptions;
|
|
16
|
-
const pathsConfig = jsConfig.paths;
|
|
17
|
-
if (pathsConfig['@plone/volto'])
|
|
18
|
-
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
|
|
22
|
-
const reg = new AddonConfigurationRegistry(__dirname);
|
|
23
|
-
|
|
24
|
-
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
|
|
25
|
-
const addonAliases = Object.keys(reg.packages).map((o) => [
|
|
26
|
-
o,
|
|
27
|
-
reg.packages[o].modulePath,
|
|
28
|
-
]);
|
|
29
|
-
|
|
30
|
-
module.exports = {
|
|
31
|
-
extends: `${voltoPath}/.eslintrc`,
|
|
32
|
-
settings: {
|
|
33
|
-
'import/resolver': {
|
|
34
|
-
alias: {
|
|
35
|
-
map: [
|
|
36
|
-
['@plone/volto', '@plone/volto/src'],
|
|
37
|
-
['@plone/volto-slate', '@plone/volto/packages/volto-slate/src'],
|
|
38
|
-
...addonAliases,
|
|
39
|
-
['@package', `${__dirname}/src`],
|
|
40
|
-
['@root', `${__dirname}/src`],
|
|
41
|
-
['~', `${__dirname}/src`],
|
|
42
|
-
],
|
|
43
|
-
extensions: ['.js', '.jsx', '.json'],
|
|
44
|
-
},
|
|
45
|
-
'babel-plugin-root-import': {
|
|
46
|
-
rootPathSuffix: 'src',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
};
|