@kitconcept/volto-light-theme 3.0.0-alpha.3 → 3.0.1

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.
@@ -4,7 +4,7 @@ on: [push, pull_request]
4
4
  env:
5
5
  ADDON_NAME: "@kitconcept/volto-light-theme"
6
6
  ADDON_PATH: "volto-light-theme"
7
- VOLTO_VERSION: "17.11.5"
7
+ VOLTO_VERSION: "17.15.1"
8
8
 
9
9
  jobs:
10
10
 
@@ -11,7 +11,7 @@ on:
11
11
  env:
12
12
  ENVIRONMENT: "light-theme.kitconcept.io"
13
13
  IMAGE_NAME: "ghcr.io/kitconcept/voltolighttheme-frontend"
14
- VOLTO_VERSION: "17.11.5"
14
+ VOLTO_VERSION: "17.15.1"
15
15
 
16
16
  jobs:
17
17
  meta:
package/CHANGELOG.md CHANGED
@@ -8,6 +8,34 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 3.0.1 (2024-03-04)
12
+
13
+ ### Bugfix
14
+
15
+ - Fix image gallery opacity. @robgietema [#347](https://github.com/kitconcept/volto-light-theme/pull/347)
16
+ - Fix teaser styles on add view. @davisagli [#354](https://github.com/kitconcept/volto-light-theme/pull/354)
17
+
18
+ ### Internal
19
+
20
+ - Update to Volto 17.15.1 @sneridagh [#348](https://github.com/kitconcept/volto-light-theme/pull/348)
21
+
22
+ ## 3.0.0 (2024-02-14)
23
+
24
+ ### Feature
25
+
26
+ - Add options to show intranet label and implement intranet header for intranet sites. @iFlameing [#304](https://github.com/kitconcept/volto-light-theme/pull/304)
27
+ - Add Event Metadata block @iRohitSingh [#334](https://github.com/kitconcept/volto-light-theme/pull/334)
28
+
29
+ ### Bugfix
30
+
31
+ - Fix Navigation fails html validator due to use of divs inside ul tag @iRohitSingh [#289](https://github.com/kitconcept/volto-light-theme/pull/289)
32
+ - Fixed the Caption for Images, Video Blocks etc. to use semantically correct HTML Structure @Molochem [#341](https://github.com/kitconcept/volto-light-theme/pull/341)
33
+ - Fix missing key in `Header` component @sneridagh [#345](https://github.com/kitconcept/volto-light-theme/pull/345)
34
+
35
+ ### Internal
36
+
37
+ - Support for enhanced initial blocks in config - Update to Volto 17.12.1 @sneridagh [#342](https://github.com/kitconcept/volto-light-theme/pull/342)
38
+
11
39
  ## 3.0.0-alpha.3 (2024-02-02)
12
40
 
13
41
  ### Feature
package/Makefile CHANGED
@@ -22,7 +22,7 @@ RESET=`tput sgr0`
22
22
  YELLOW=`tput setaf 3`
23
23
 
24
24
  PLONE_VERSION=6.0.9
25
- VOLTO_VERSION=17.11.5
25
+ VOLTO_VERSION=17.15.1
26
26
 
27
27
  ADDON_NAME='@kitconcept/volto-light-theme'
28
28
  ADDON_PATH='volto-light-theme'
package/README.md CHANGED
@@ -181,6 +181,40 @@ It's behind a feature flag, as opt-out:
181
181
  config.settings.enableFatMenu = true;
182
182
  ```
183
183
 
184
+ ### Show Site Label
185
+
186
+ If you want to show a label on top of site you can pass label name to `siteLabel` property.
187
+
188
+ ```js
189
+ config.settings.siteLabel = 'Plone Intranet';
190
+ ```
191
+
192
+ If you wanted a translated label then you have to define a translation object in `defineMessages` function provided by react-intl.
193
+
194
+ Here is the code snippets you have to add in your addon index.js file.
195
+ If you don't have addon, you can also add in your config.js file in root of your frontend folder.
196
+
197
+ ```js
198
+ import { defineMessages } from 'react-intl';
199
+
200
+ defineMessages({
201
+ siteLabel: {
202
+ id: 'siteLabel',
203
+ defaultMessage: ' ',
204
+ },
205
+ });
206
+
207
+ ```
208
+ Then add the translation you want in your `locale` file.
209
+
210
+ ### Show intranetHeader
211
+
212
+ We have totally different header for intranet sites. If you want that, you can enable it by passing `intranetHeader` property.
213
+
214
+ ```js
215
+ config.settings.intranetHeader = true;
216
+ ```
217
+
184
218
  ## Upgrade Guide
185
219
 
186
220
  See a detailed upgrade guide in: https://github.com/kitconcept/volto-light-theme/blob/main/UPGRADE-GUIDE.md
@@ -27,7 +27,6 @@ context('Navigation Acceptance Tests', () => {
27
27
  path: '/level-1/level-2',
28
28
  });
29
29
 
30
-
31
30
  cy.visit('/');
32
31
  cy.viewport('macbook-16');
33
32
  });
@@ -44,17 +43,12 @@ context('Navigation Acceptance Tests', () => {
44
43
  cy.get('ul.desktop-menu button').contains('Level 1').click();
45
44
  cy.get('.subitem-wrapper').findByText('Level 2').click();
46
45
  cy.get('.documentFirstHeading').should('have.text', 'Level 2');
47
-
48
46
  });
49
47
 
50
48
  it('Open 3rd level', function () {
51
49
  cy.wait('@content');
52
50
  cy.get('ul.desktop-menu button').contains('Level 1').click();
53
- cy.get('.subsubitem-wrapper li').findByText('Level 3').click();
51
+ cy.get('.subsubitem-wrapper').findByText('Level 3').click();
54
52
  cy.get('.documentFirstHeading').should('have.text', 'Level 3');
55
-
56
53
  });
57
54
  });
58
-
59
-
60
-
@@ -228,15 +228,22 @@ msgstr "Rechts"
228
228
  #: components/Blocks/Search/components/SearchInput
229
229
  #: components/Blocks/Search/TopSideFacets
230
230
  #: components/MobileNavigation/MobileNavigation
231
+ #: components/SearchWidget/IntranetSearchWidget
231
232
  #: components/SearchWidget/SearchWidget
232
233
  msgid "Search"
233
234
  msgstr "Suche"
234
235
 
235
236
  #. Default: "Search Site"
237
+ #: components/SearchWidget/IntranetSearchWidget
236
238
  #: components/SearchWidget/SearchWidget
237
239
  msgid "Search Site"
238
240
  msgstr "Seite durchsuchen"
239
241
 
242
+ #. Default: "Search for People, E-Mail Address, Phone Number, ..."
243
+ #: components/SearchWidget/IntranetSearchWidget
244
+ msgid "Search for People, E-Mail Address, Phone Number, ..."
245
+ msgstr ""
246
+
240
247
  #. Default: "Search results"
241
248
  #: components/Blocks/Search/components/SearchDetails
242
249
  msgid "Search results"
@@ -253,7 +260,6 @@ msgid "Site"
253
260
  msgstr "Seite"
254
261
 
255
262
  #. Default: "Sitemap"
256
- #: components/Header/Header
257
263
  #: index
258
264
  msgid "Sitemap"
259
265
  msgstr "Übersicht"
@@ -327,3 +333,8 @@ msgstr ""
327
333
  #: components/Blocks/Listing/ListingBody
328
334
  msgid "of"
329
335
  msgstr "von"
336
+
337
+ #. Default: ""
338
+ #: components/Header/Header
339
+ msgid "siteLabel"
340
+ msgstr ""
@@ -223,15 +223,22 @@ msgstr ""
223
223
  #: components/Blocks/Search/components/SearchInput
224
224
  #: components/Blocks/Search/TopSideFacets
225
225
  #: components/MobileNavigation/MobileNavigation
226
+ #: components/SearchWidget/IntranetSearchWidget
226
227
  #: components/SearchWidget/SearchWidget
227
228
  msgid "Search"
228
229
  msgstr ""
229
230
 
230
231
  #. Default: "Search Site"
232
+ #: components/SearchWidget/IntranetSearchWidget
231
233
  #: components/SearchWidget/SearchWidget
232
234
  msgid "Search Site"
233
235
  msgstr ""
234
236
 
237
+ #. Default: "Search for People, E-Mail Address, Phone Number, ..."
238
+ #: components/SearchWidget/IntranetSearchWidget
239
+ msgid "Search for People, E-Mail Address, Phone Number, ..."
240
+ msgstr ""
241
+
235
242
  #. Default: "Search results"
236
243
  #: components/Blocks/Search/components/SearchDetails
237
244
  msgid "Search results"
@@ -248,7 +255,6 @@ msgid "Site"
248
255
  msgstr ""
249
256
 
250
257
  #. Default: "Sitemap"
251
- #: components/Header/Header
252
258
  #: index
253
259
  msgid "Sitemap"
254
260
  msgstr ""
@@ -322,3 +328,8 @@ msgstr ""
322
328
  #: components/Blocks/Listing/ListingBody
323
329
  msgid "of"
324
330
  msgstr ""
331
+
332
+ #. Default: ""
333
+ #: components/Header/Header
334
+ msgid "siteLabel"
335
+ msgstr ""
@@ -223,15 +223,22 @@ msgstr "Direita"
223
223
  #: components/Blocks/Search/components/SearchInput
224
224
  #: components/Blocks/Search/TopSideFacets
225
225
  #: components/MobileNavigation/MobileNavigation
226
+ #: components/SearchWidget/IntranetSearchWidget
226
227
  #: components/SearchWidget/SearchWidget
227
228
  msgid "Search"
228
229
  msgstr "Buscar"
229
230
 
230
231
  #. Default: "Search Site"
232
+ #: components/SearchWidget/IntranetSearchWidget
231
233
  #: components/SearchWidget/SearchWidget
232
234
  msgid "Search Site"
233
235
  msgstr "Buscar no site"
234
236
 
237
+ #. Default: "Search for People, E-Mail Address, Phone Number, ..."
238
+ #: components/SearchWidget/IntranetSearchWidget
239
+ msgid "Search for People, E-Mail Address, Phone Number, ..."
240
+ msgstr ""
241
+
235
242
  #. Default: "Search results"
236
243
  #: components/Blocks/Search/components/SearchDetails
237
244
  msgid "Search results"
@@ -248,7 +255,6 @@ msgid "Site"
248
255
  msgstr "Site"
249
256
 
250
257
  #. Default: "Sitemap"
251
- #: components/Header/Header
252
258
  #: index
253
259
  msgid "Sitemap"
254
260
  msgstr "Mapa do Site"
@@ -322,3 +328,8 @@ msgstr "Mais informações"
322
328
  #: components/Blocks/Listing/ListingBody
323
329
  msgid "of"
324
330
  msgstr "de"
331
+
332
+ #. Default: ""
333
+ #: components/Header/Header
334
+ msgid "siteLabel"
335
+ msgstr ""
package/locales/volto.pot CHANGED
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Plone\n"
4
- "POT-Creation-Date: 2024-02-01T15:37:22.956Z\n"
4
+ "POT-Creation-Date: 2024-02-08T13:36:14.317Z\n"
5
5
  "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
6
  "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
7
  "Content-Type: text/plain; charset=utf-8\n"
@@ -225,15 +225,22 @@ msgstr ""
225
225
  #: components/Blocks/Search/components/SearchInput
226
226
  #: components/Blocks/Search/TopSideFacets
227
227
  #: components/MobileNavigation/MobileNavigation
228
+ #: components/SearchWidget/IntranetSearchWidget
228
229
  #: components/SearchWidget/SearchWidget
229
230
  msgid "Search"
230
231
  msgstr ""
231
232
 
232
233
  #. Default: "Search Site"
234
+ #: components/SearchWidget/IntranetSearchWidget
233
235
  #: components/SearchWidget/SearchWidget
234
236
  msgid "Search Site"
235
237
  msgstr ""
236
238
 
239
+ #. Default: "Search for People, E-Mail Address, Phone Number, ..."
240
+ #: components/SearchWidget/IntranetSearchWidget
241
+ msgid "Search for People, E-Mail Address, Phone Number, ..."
242
+ msgstr ""
243
+
237
244
  #. Default: "Search results"
238
245
  #: components/Blocks/Search/components/SearchDetails
239
246
  msgid "Search results"
@@ -250,7 +257,6 @@ msgid "Site"
250
257
  msgstr ""
251
258
 
252
259
  #. Default: "Sitemap"
253
- #: components/Header/Header
254
260
  #: index
255
261
  msgid "Sitemap"
256
262
  msgstr ""
@@ -324,3 +330,8 @@ msgstr ""
324
330
  #: components/Blocks/Listing/ListingBody
325
331
  msgid "of"
326
332
  msgstr ""
333
+
334
+ #. Default: ""
335
+ #: components/Header/Header
336
+ msgid "siteLabel"
337
+ msgstr ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitconcept/volto-light-theme",
3
- "version": "3.0.0-alpha.3",
3
+ "version": "3.0.1",
4
4
  "description": "Volto Light Theme by kitconcept",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -72,6 +72,6 @@
72
72
  "@kitconcept/volto-introduction-block": "^1.0.0",
73
73
  "@kitconcept/volto-separator-block": "^4.0.0",
74
74
  "@kitconcept/volto-slider-block": "^6.1.0",
75
- "@plone/volto": "^17.11.5"
75
+ "@plone/volto": "^17.15.1"
76
76
  }
77
77
  }
@@ -0,0 +1,129 @@
1
+ import React from 'react';
2
+ import { FormattedMessage, injectIntl } from 'react-intl';
3
+ import { FormattedDate } from '@plone/volto/components';
4
+ import { UniversalLink } from '@plone/volto/components';
5
+ import { expandToBackendURL } from '@plone/volto/helpers';
6
+ import Container from '../../../components/Atoms/Container/Container';
7
+ const EventMetadataView = (props) => {
8
+ const content = props.properties;
9
+ const dateOptions = {
10
+ year: 'numeric',
11
+ month: 'long',
12
+ day: 'numeric',
13
+ hour: 'numeric',
14
+ minute: 'numeric',
15
+ };
16
+
17
+ return (
18
+ <div className="block eventMetadata ">
19
+ <Container className="details-container">
20
+ <div className="content-container">
21
+ <div className="event-details">
22
+ <div className="event-title">
23
+ <span className="event-heading">
24
+ <FormattedMessage id="Start" defaultMessage="Start" />
25
+ </span>
26
+ <div className="event-detail">
27
+ {' '}
28
+ {content?.start && (
29
+ <FormattedDate date={content?.start} format={dateOptions} />
30
+ )}{' '}
31
+ {props.intl.locale === 'de' ? ' Uhr' : ''}
32
+ </div>
33
+ <div className="separator"></div>
34
+ </div>
35
+ <div className="event-title">
36
+ <span className="event-heading">
37
+ {' '}
38
+ <FormattedMessage id="End" defaultMessage="End" />
39
+ </span>
40
+ <div className="event-detail">
41
+ {' '}
42
+ {content?.end && (
43
+ <FormattedDate date={content?.end} format={dateOptions} />
44
+ )}{' '}
45
+ {props.intl.locale === 'de' ? ' Uhr' : ''}
46
+ </div>
47
+ <div className="separator"></div>
48
+ </div>
49
+ {content?.location && (
50
+ <div className="event-title">
51
+ <span className="event-heading">
52
+ <FormattedMessage id="Location" defaultMessage="Location" />
53
+ </span>
54
+ <div className="event-detail">{content?.location}</div>
55
+ </div>
56
+ )}
57
+ </div>
58
+
59
+ <div className="event-details">
60
+ {content?.event_url && (
61
+ <div className="event-title">
62
+ <span className="event-heading">
63
+ <FormattedMessage id="Website" defaultMessage="Website" />
64
+ </span>
65
+ <div className="event-detail">
66
+ <UniversalLink className="event-url" href={content.event_url}>
67
+ {content.event_url}
68
+ </UniversalLink>
69
+ </div>
70
+ <div className="separator"></div>
71
+ </div>
72
+ )}
73
+
74
+ {(content?.contact_name ||
75
+ content?.contact_email ||
76
+ content?.contact_email) && (
77
+ <div className="event-title">
78
+ <span className="event-heading">
79
+ <FormattedMessage id="Contact" defaultMessage="Contact" />
80
+ </span>
81
+ <div className="event-detail">
82
+ <div>
83
+ {content?.contact_name && <p>{content.contact_name}</p>}
84
+ {content?.contact_email && (
85
+ <p>
86
+ <a href={`mailto:${content.contact_email}`}>
87
+ {content.contact_email}
88
+ </a>
89
+ </p>
90
+ )}
91
+ {content?.contact_phone && (
92
+ <p>
93
+ <FormattedMessage id="Phone" defaultMessage="Phone" />{' '}
94
+ <a href={`tel:${content.contact_phone}`}>
95
+ {content.contact_phone}
96
+ </a>
97
+ </p>
98
+ )}
99
+ </div>
100
+ </div>
101
+ </div>
102
+ )}
103
+ </div>
104
+ </div>
105
+ <div className="event-button">
106
+ <a
107
+ className="ics-download"
108
+ target="_blank"
109
+ rel="noreferrer"
110
+ href={
111
+ content && content['@id']
112
+ ? `${expandToBackendURL(content['@id'])}/ics_view `
113
+ : ''
114
+ }
115
+ >
116
+ <button className="event-btn">
117
+ <FormattedMessage
118
+ id="ICS-Download"
119
+ defaultMessage="ICS Download"
120
+ />
121
+ </button>
122
+ </a>
123
+ </div>
124
+ </Container>
125
+ </div>
126
+ );
127
+ };
128
+
129
+ export default injectIntl(EventMetadataView);
@@ -19,15 +19,15 @@ const Caption = ({ as = 'figcaption', title, description, credit }) => {
19
19
 
20
20
  return (
21
21
  <As>
22
- {title && <div className="title">{title}</div>}
22
+ {title && <h2 className="title">{title}</h2>}
23
23
  {description && (
24
- <div className="description">
24
+ <p className="description">
25
25
  {description.split('\n').map((line, index) => (
26
- <div key={index}>{line || '\u00A0'}</div>
26
+ <p key={index}>{line || '\u00A0'}</p>
27
27
  ))}
28
- </div>
28
+ </p>
29
29
  )}
30
- {credit && <div className="credits">{credit}</div>}
30
+ {credit && <p className="credits">{credit}</p>}
31
31
  </As>
32
32
  );
33
33
  };
@@ -3,6 +3,10 @@ import PropTypes from 'prop-types';
3
3
  import { useSelector } from 'react-redux';
4
4
  import Container from '@kitconcept/volto-light-theme/components/Atoms/Container/Container';
5
5
  import MobileNavigation from '../MobileNavigation/MobileNavigation';
6
+ import { useIntl, defineMessages } from 'react-intl';
7
+ import config from '@plone/volto/registry';
8
+ import cx from 'classnames';
9
+ import IntranetSearchWidget from '../SearchWidget/IntranetSearchWidget';
6
10
 
7
11
  import {
8
12
  Anontools,
@@ -13,42 +17,126 @@ import {
13
17
  UniversalLink,
14
18
  } from '@plone/volto/components';
15
19
 
16
- const Header = (props) => {
17
- const { pathname } = props;
18
- const token = useSelector((state) => state.userSession.token);
19
- const siteAction = useSelector(
20
- (state) => state.content.data?.['@components']?.actions?.site_actions,
21
- );
20
+ const messages = defineMessages({
21
+ siteLabel: {
22
+ id: 'siteLabel',
23
+ defaultMessage: ' ',
24
+ },
25
+ });
22
26
 
27
+ const InternetHeader = ({ pathname, siteLabel, token, siteAction }) => {
23
28
  return (
24
- <header className="header-wrapper">
25
- <Container layout>
26
- <div className="header">
27
- <div className="logo-nav-wrapper">
28
- <div className="logo">
29
- <Logo />
30
- </div>
31
- <Navigation pathname={pathname} />
32
- <MobileNavigation pathname={pathname} />
33
- <div className="search-wrapper navigation-desktop">
34
- <div className="search">
35
- <SearchWidget />
36
- </div>
29
+ <>
30
+ <div className="header">
31
+ <div className="logo-nav-wrapper">
32
+ <div className="logo">
33
+ <Logo />
34
+ </div>
35
+ <Navigation pathname={pathname} />
36
+ <MobileNavigation pathname={pathname} />
37
+ <div className="search-wrapper navigation-desktop">
38
+ <div className="search">
39
+ <SearchWidget />
37
40
  </div>
38
41
  </div>
39
- <div className="tools-wrapper">
40
- <LanguageSelector />
42
+ </div>
43
+ <div className="tools-wrapper">
44
+ <LanguageSelector />
45
+
46
+ <div className="tools">
47
+ {!token && <Anontools />}
48
+ {siteAction &&
49
+ siteAction.map((item) => (
50
+ <UniversalLink key={item.url} href={item.url}>
51
+ {item.title}
52
+ </UniversalLink>
53
+ ))}
54
+ </div>
55
+ {siteLabel && (
56
+ <div className="intranet">
57
+ <p>{siteLabel}</p>
58
+ </div>
59
+ )}
60
+ </div>
61
+ </div>
62
+ </>
63
+ );
64
+ };
41
65
 
42
- <div className="tools">
43
- {!token && <Anontools />}
66
+ const IntranetHeader = ({ pathname, siteLabel, token, siteAction }) => {
67
+ return (
68
+ <>
69
+ <div className="header">
70
+ <div className="tools-wrapper">
71
+ <LanguageSelector />
44
72
 
45
- {siteAction &&
46
- siteAction.map((item) => (
47
- <UniversalLink href={item.url}>{item.title}</UniversalLink>
48
- ))}
73
+ <div className="tools">
74
+ {!token && <Anontools />}
75
+ {siteAction &&
76
+ siteAction.map((item) => (
77
+ <UniversalLink href={item.url}>{item.title}</UniversalLink>
78
+ ))}
79
+ </div>
80
+ {siteLabel && (
81
+ <div className="intranet">
82
+ <p>{siteLabel}</p>
49
83
  </div>
84
+ )}
85
+ </div>
86
+ <div className="logo-nav-wrapper">
87
+ <div className="logo">
88
+ <Logo />
50
89
  </div>
90
+ <div className="search-wrapper">
91
+ <div className="search">
92
+ <IntranetSearchWidget />
93
+ </div>
94
+ </div>
95
+ <Navigation pathname={pathname} />
96
+ <MobileNavigation pathname={pathname} />
51
97
  </div>
98
+ </div>
99
+ </>
100
+ );
101
+ };
102
+
103
+ const Header = (props) => {
104
+ const { pathname } = props;
105
+ let siteLabel = config.settings.siteLabel;
106
+ const intranetHeader = config.settings.intranetHeader;
107
+ const token = useSelector((state) => state.userSession.token);
108
+ const siteAction = useSelector(
109
+ (state) => state.content.data?.['@components']?.actions?.site_actions,
110
+ );
111
+ const intl = useIntl();
112
+ const translatedSiteLabel = intl.formatMessage(messages.siteLabel);
113
+
114
+ siteLabel =
115
+ siteLabel &&
116
+ (translatedSiteLabel !== 'siteLabel' && translatedSiteLabel !== ' '
117
+ ? translatedSiteLabel
118
+ : siteLabel);
119
+
120
+ return (
121
+ <header
122
+ className={cx('header-wrapper', { 'intranet-header': intranetHeader })}
123
+ >
124
+ <Container layout>
125
+ {intranetHeader ? (
126
+ <IntranetHeader
127
+ pathname={pathname}
128
+ siteLabel={siteLabel}
129
+ token={token}
130
+ siteAction={siteAction}
131
+ />
132
+ ) : (
133
+ <InternetHeader
134
+ pathname={pathname}
135
+ siteLabel={siteLabel}
136
+ token={token}
137
+ siteAction={siteAction}
138
+ />
139
+ )}
52
140
  </Container>
53
141
  </header>
54
142
  );