Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: custom feedback form title (v11) #752

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2094,11 +2094,6 @@ msgstr ""
msgid "feedback_form_title"
msgstr ""

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: How easy was it to use this service?
msgid "feedback_form_title_service"
msgstr ""

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: Yes
msgid "feedback_form_yes"
Expand Down
5 changes: 0 additions & 5 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2079,11 +2079,6 @@ msgstr ""
msgid "feedback_form_title"
msgstr ""

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: How easy was it to use this service?
msgid "feedback_form_title_service"
msgstr ""

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: Yes
msgid "feedback_form_yes"
Expand Down
5 changes: 0 additions & 5 deletions locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2088,11 +2088,6 @@ msgstr ""
msgid "feedback_form_title"
msgstr ""

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: How easy was it to use this service?
msgid "feedback_form_title_service"
msgstr ""

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: Yes
msgid "feedback_form_yes"
Expand Down
5 changes: 0 additions & 5 deletions locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2096,11 +2096,6 @@ msgstr ""
msgid "feedback_form_title"
msgstr ""

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: How easy was it to use this service?
msgid "feedback_form_title_service"
msgstr ""

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: Yes
msgid "feedback_form_yes"
Expand Down
5 changes: 0 additions & 5 deletions locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -2079,11 +2079,6 @@ msgstr "Grazie, il tuo parere ci aiuterà a migliorare il servizio!"
msgid "feedback_form_title"
msgstr "Quanto sono chiare le informazioni su questa pagina?"

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: How easy was it to use this service?
msgid "feedback_form_title_service"
msgstr "Quanto è stato facile usare questo servizio?"

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: Yes
msgid "feedback_form_yes"
Expand Down
7 changes: 1 addition & 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: 2024-08-06T16:50:24.401Z\n"
"POT-Creation-Date: 2024-08-29T12:09:17.914Z\n"
"Last-Translator: Plone i18n <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -2081,11 +2081,6 @@ msgstr ""
msgid "feedback_form_title"
msgstr ""

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: How easy was it to use this service?
msgid "feedback_form_title_service"
msgstr ""

#: components/ItaliaTheme/CustomerSatisfaction/FeedbackForm
# defaultMessage: Yes
msgid "feedback_form_yes"
Expand Down
21 changes: 3 additions & 18 deletions src/components/ItaliaTheme/CustomerSatisfaction/FeedbackForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ const messages = defineMessages({
id: 'feedback_form_title',
defaultMessage: 'How clear is the information on this page?',
},
service_title: {
id: 'feedback_form_title_service',
defaultMessage: 'How easy was it to use this service?',
},
yes: {
id: 'feedback_form_yes',
defaultMessage: 'Yes',
Expand Down Expand Up @@ -120,7 +116,7 @@ const messages = defineMessages({
},
});

const FeedbackForm = ({ contentType, pathname }) => {
const FeedbackForm = ({ title, pathname }) => {
const intl = useIntl();
const location = useLocation();
const path = pathname ?? location.pathname ?? '/';
Expand Down Expand Up @@ -273,18 +269,7 @@ const FeedbackForm = ({ contentType, pathname }) => {
className="title-medium-2-semi-bold mb-0"
data-element="feedback-title"
>
{/* Il validatore a quanto pare fa il check per titolo.
Il titolo da specifiche deve essere diverso per Servizi, ma loro non lo sanno
https://github.com/italia/pa-website-validator/blob/main/src/storage/municipality/feedbackComponentStructure.ts#L8
*/}
{/* {contentType === 'Servizio'
? intl.formatMessage(messages.service_title)
: intl.formatMessage(messages.title)} */}

{/* Aggiunto titolo per compatibilità modello AGID di io-cittadino */}
{contentType === 'ModelloPratica'
? intl.formatMessage(messages.service_title)
: intl.formatMessage(messages.title)}
{title || intl.formatMessage(messages.title)}
</h2>
<div className="rating-container mb-0">
<RTRating
Expand Down Expand Up @@ -455,7 +440,7 @@ const FeedbackForm = ({ contentType, pathname }) => {
};

FeedbackForm.propTypes = {
contentType: PropTypes.string,
title: PropTypes.string,
pathname: PropTypes.string,
};

Expand Down
1 change: 1 addition & 0 deletions src/config/italiaConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ export default function applyConfig(voltoConfig) {
],
},
enableFeedbackForm: true,
noFeedbackFormFor: ['ModelloPratica'],
enableFeedbackFormCaptcha: false,
enableVoltoFormBlockCaptcha: true,
splitMegamenuColumns: true, //se impostato a false, non spezza le colonne con intestazioni nel megamenu
Expand Down
20 changes: 7 additions & 13 deletions src/customizations/volto/components/theme/Footer/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,18 @@ import config from '@plone/volto/registry';
* @extends Component
*/

const Footer = ({ intl }) => {
const Footer = () => {
useGoogleAnalytics();
const currentContent = useSelector((state) => state.content?.data);
let contentType = null;
if (currentContent != null) {
contentType = currentContent?.['@type'];
}
// const NoFeedbackFormFor = ['Plone Site', 'LRF', 'Subsite'];
const NoFeedbackFormFor = [];
const contentType = currentContent ? currentContent['@type'] : null;
const noFeedbackFormFor = config.settings.siteProperties.noFeedbackFormFor || [];

let content = (
return (
<>
{contentType != null &&
NoFeedbackFormFor.indexOf(contentType) < 0 &&
{contentType &&
!noFeedbackFormFor.includes(contentType) &&
config.settings.siteProperties.enableFeedbackForm && (
<FeedbackForm contentType={contentType} />
<FeedbackForm />
)}

<SubsiteFooter />
Expand All @@ -46,8 +42,6 @@ const Footer = ({ intl }) => {
</footer>
</>
);

return content;
};

export default Footer;
Loading