Skip to content

Commit

Permalink
add setting to show or not show description field
Browse files Browse the repository at this point in the history
  • Loading branch information
jackahl committed Dec 18, 2023
1 parent 113f45e commit 8df2417
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 21 deletions.
10 changes: 5 additions & 5 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/Logo/schema
# defaultMessage: Description
msgid "Description"
msgstr "Beschreibung"

#: components/Logo/schema
# defaultMessage: It is advised to use a svg graphic.
msgid "It is advised to use a svg graphic."
Expand All @@ -36,8 +41,3 @@ msgstr "Bitte wählen Sie ein Logo als Quelle für dieses Element"
# defaultMessage: Title
msgid "Title"
msgstr "Titel"

#: components/Logo/schema
# defaultMessage: description
msgid "description"
msgstr "Beschreibung"
10 changes: 5 additions & 5 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/Logo/schema
# defaultMessage: Description
msgid "Description"
msgstr ""

#: components/Logo/schema
# defaultMessage: It is advised to use a svg graphic.
msgid "It is advised to use a svg graphic."
Expand All @@ -36,8 +41,3 @@ msgstr "Please choose a logo as source for this element"
# defaultMessage: Title
msgid "Title"
msgstr ""

#: components/Logo/schema
# defaultMessage: description
msgid "description"
msgstr "description"
12 changes: 6 additions & 6 deletions 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-12-11T12:47:09.894Z\n"
"POT-Creation-Date: 2023-12-18T15:12:47.088Z\n"
"Last-Translator: Plone i18n <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand All @@ -13,6 +13,11 @@ msgstr ""
"Preferred-Encodings: utf-8\n"
"Domain: volto\n"

#: components/Logo/schema
# defaultMessage: Description
msgid "Description"
msgstr ""

#: components/Logo/schema
# defaultMessage: It is advised to use a svg graphic.
msgid "It is advised to use a svg graphic."
Expand All @@ -38,8 +43,3 @@ msgstr ""
# defaultMessage: Title
msgid "Title"
msgstr ""

#: components/Logo/schema
# defaultMessage: description
msgid "description"
msgstr ""
1 change: 1 addition & 0 deletions news/1.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix link element being rendered even when no link is set @jackahl
1 change: 1 addition & 0 deletions news/1.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add setting to show or not show description field @jackahl
1 change: 0 additions & 1 deletion news/1.minor

This file was deleted.

4 changes: 3 additions & 1 deletion src/components/Logo/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { flattenToAppURL } from '@plone/volto/helpers';
import { UniversalLink } from '@plone/volto/components';
import { Message } from 'semantic-ui-react';
import { defineMessages, useIntl } from 'react-intl';
import config from '@plone/volto/registry';
import imageBlockSVG from '@plone/volto/components/manage/Blocks/Image/block-image.svg';

const messages = defineMessages({
Expand Down Expand Up @@ -45,7 +46,8 @@ const View = (props) => {
))}

<h3 className="logo-heading headline">{data.heading}</h3>
{data.description && <p>{data.description}</p>}
{config.blocks.blocksConfig.logo.showDescriptionField &&
data.description && <p>{data.description}</p>}
</div>
);
};
Expand Down
12 changes: 9 additions & 3 deletions src/components/Logo/schema.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineMessages } from 'react-intl';
import config from '@plone/volto/registry';

const messages = defineMessages({
logo: {
Expand All @@ -10,8 +11,8 @@ const messages = defineMessages({
defaultMessage: 'Title',
},
description: {
id: 'description',
defaultMessage: 'description',
id: 'Description',
defaultMessage: 'Description',
},
logoBlock: {
id: 'Logo',
Expand All @@ -35,7 +36,12 @@ export const LogoBlockSchema = (props) => {
{
id: 'default',
title: 'Default',
fields: ['logo', 'heading', 'link'],
fields: [
'logo',
'heading',
config.blocks.blocksConfig.logo.showDescriptionField && 'description',
'link',
],
},
],
properties: {
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const applyConfig = (config) => {
restricted: true,
mostUsed: true,
sidebarTab: 1,
showDescriptionField: false,
};
config.blocks.blocksConfig.logos = {
...config.blocks.blocksConfig.gridBlock,
Expand Down

0 comments on commit 8df2417

Please sign in to comment.