Skip to content

Commit

Permalink
frontend, run make i18n, make format.
Browse files Browse the repository at this point in the history
Fix regression in fix for mobile labe, add htmlFor
backend: use latest plone/code-qualiry
  • Loading branch information
fredvd committed Feb 22, 2024
1 parent af39098 commit 1017b47
Show file tree
Hide file tree
Showing 19 changed files with 138 additions and 24 deletions.
2 changes: 1 addition & 1 deletion backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PLONE_VERSION=$$(cat version.txt)

BACKEND_FOLDER=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

CODE_QUALITY_VERSION=2.0.2
CODE_QUALITY_VERSION=2.1.1
ifndef LOG_LEVEL
LOG_LEVEL=INFO
endif
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/eu/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/ja/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/nl/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/pt/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/pt_BR/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
5 changes: 5 additions & 0 deletions frontend/locales/ro/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
7 changes: 6 additions & 1 deletion frontend/locales/volto.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: 2023-09-18T18:44:24.417Z\n"
"POT-Creation-Date: 2024-02-22T20:31:53.047Z\n"
"Last-Translator: Plone i18n <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -827,6 +827,11 @@ msgstr ""
msgid "link_to_description"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Center column heading on mobile
msgid "mobileStyles"
msgstr ""

#: components/Blocks/IconsAndText/Sidebar
# defaultMessage: Do not fit the columns to the available space
msgid "noAdaptColumns"
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
},
"packageManager": "[email protected]",
"volta": {
"node": "16.20.2"
"node": "16.20.2",
"yarn": "3.8.0"
}
}
6 changes: 5 additions & 1 deletion frontend/src/components/Blocks/IconsAndText/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ const Edit = (props) => {
/>
))}
</div>
<ListingLinkMore linkTitle={data.href_title} linkHref={data.href} buttonClassName="site--button-blue" />
<ListingLinkMore
linkTitle={data.href_title}
linkHref={data.href}
buttonClassName="site--button-blue"
/>
</>
);

Expand Down
50 changes: 40 additions & 10 deletions frontend/src/components/Blocks/IconsAndText/Sidebar.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Segment } from 'semantic-ui-react';
import { FormattedMessage, useIntl, injectIntl, defineMessages } from 'react-intl';
import { CheckboxWidget, ObjectListWidget, TextWidget, ObjectBrowserWidget, SelectWidget } from '@plone/volto/components';
import {
FormattedMessage,
useIntl,
injectIntl,
defineMessages,
} from 'react-intl';
import {
CheckboxWidget,
ObjectListWidget,
TextWidget,
ObjectBrowserWidget,
SelectWidget,
} from '@plone/volto/components';

import { ColorListWidget, AlignWidget } from '@package/components/Widgets';

Expand Down Expand Up @@ -67,7 +78,11 @@ const Sidebar = (props) => {
<Segment.Group raised>
<header className="header pulled">
<h2>
<FormattedMessage id="IconsAndTextBlock" defaultMessage="Icons and text block" />:
<FormattedMessage
id="IconsAndTextBlock"
defaultMessage="Icons and text block"
/>
:
</h2>
</header>
<Segment className="form">
Expand All @@ -82,7 +97,9 @@ const Sidebar = (props) => {
{ name: 'light-grey', label: intl.formatMessage(messages.grey) },
]}
value={data.bg_color ?? 'outline-white'}
onChange={(name, value) => onChangeBlock(block, { ...data, [name]: value })}
onChange={(name, value) =>
onChangeBlock(block, { ...data, [name]: value })
}
/>
<CheckboxWidget
id="fullWidth"
Expand All @@ -101,7 +118,9 @@ const Sidebar = (props) => {
{ name: 'blue', label: intl.formatMessage(messages.blue) },
]}
value={data.title_color ?? 'grey'}
onChange={(name, value) => onChangeBlock(block, { ...data, [name]: value })}
onChange={(name, value) =>
onChangeBlock(block, { ...data, [name]: value })
}
/>

<AlignWidget
Expand Down Expand Up @@ -147,7 +166,9 @@ const Sidebar = (props) => {
{...props}
id="columns"
value={data?.columns ?? []}
onChange={(id, value) => onChangeBlock(block, { ...data, [id]: value })}
onChange={(id, value) =>
onChangeBlock(block, { ...data, [id]: value })
}
schema={() => {
const columnsSchema = {
title: intl.formatMessage(messages.column),
Expand All @@ -156,13 +177,21 @@ const Sidebar = (props) => {
{
id: 'default',
title: 'Default',
fields: ['iconImage', 'iconSize', 'headerTextPosition', 'dividerPosition', 'href', 'href_title'],
fields: [
'iconImage',
'iconSize',
'headerTextPosition',
'dividerPosition',
'href',
'href_title',
],
},
],
properties: {
iconImage: {
title: intl.formatMessage(messages.icon),
description: 'The image must be a PNG or SVG. The maximum recommended size for PNG is 200x200px.',
description:
'The image must be a PNG or SVG. The maximum recommended size for PNG is 200x200px.',
widget: 'image_upload_widget',
openObjectBrowser: props.openObjectBrowser,
},
Expand Down Expand Up @@ -204,7 +233,8 @@ const Sidebar = (props) => {
},
href_title: {
title: 'Link title',
description: 'If no title is entered, and a link is selected, the link will be added to the block title.',
description:
'If no title is entered, and a link is selected, the link will be added to the block title.',
},
},

Expand Down Expand Up @@ -241,7 +271,7 @@ const Sidebar = (props) => {
/>
</Segment>
<Segment>
<label>Mobile Appearance</label>
<label htmlFor="mobileStyles">Mobile Appearance</label>

<CheckboxWidget
id="mobileStyles"
Expand Down
16 changes: 14 additions & 2 deletions frontend/src/components/Blocks/IconsAndText/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,27 @@ const View = ({ data }) => {
{(data.title || checkHasContent(data.description)) && (
<div className="block-content-header">
{data.title && <div className={cx('title')}>{data.title}</div>}
{checkHasContent(data.description) && <div className="description">{redraft(data.description, config.settings.richtextViewSettings.ToHTMLRenderers, config.settings.richtextViewSettings.ToHTMLOptions)}</div>}
{checkHasContent(data.description) && (
<div className="description">
{redraft(
data.description,
config.settings.richtextViewSettings.ToHTMLRenderers,
config.settings.richtextViewSettings.ToHTMLOptions,
)}
</div>
)}
</div>
)}
<div className="columns-wrapper">
{data?.columns?.map((numberBlock, i) => (
<ViewBlock data={numberBlock} {...data} key={i} />
))}
</div>
<ListingLinkMore linkTitle={data.href_title} linkHref={data.href} buttonClassName="site--button-blue" />
<ListingLinkMore
linkTitle={data.href_title}
linkHref={data.href}
buttonClassName="site--button-blue"
/>
</>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@
.column-head {
display: flex;
justify-content: center;

.header-text {
flex: none;
}
Expand Down
22 changes: 14 additions & 8 deletions frontend/theme/globals/site.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,24 @@ h5:last-child {
}
}

#page-document, #page-edit {

p a, ul a, ol a {
text-decoration:underline;
#page-document,
#page-edit {
p a,
ul a,
ol a {
text-decoration: underline;
text-underline-position: under;

&:hover {
text-decoration:none;
text-decoration: none;
}
}
}

#page-edit {
p a:hover, ul a:hover, ol a:hover {
text-decoration:underline;
}
p a:hover,
ul a:hover,
ol a:hover {
text-decoration: underline;
}
}

0 comments on commit 1017b47

Please sign in to comment.