Skip to content

Commit

Permalink
fix: review giulia
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Nov 8, 2023
1 parent 6c5e36b commit 92bae0a
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* BandoAreaResponsabile component used in BandoView.
*/
import React from 'react';
import PropTypes from 'prop-types';
import { defineMessages, useIntl } from 'react-intl';
Expand Down
14 changes: 5 additions & 9 deletions src/components/ItaliaTheme/View/Commons/CuredBy.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* CuredBy component class, used in `NewsItemACuraDi` component.
*/

import { defineMessages, useIntl } from 'react-intl';
import React from 'react';
import PropTypes from 'prop-types';
Expand All @@ -24,15 +28,7 @@ const messages = defineMessages({
},
});

/**
* CuredBy view component class.
* @function CuredBy
* @params {object} content: Content object.
* @params {string} office_field: field where office is related
* @params {string} office_field: field where people is related
* @returns {string} Markup of the component.
*/
const CuredBy = ({ office, people, title }) => {
const CuredBy = ({ office, people }) => {
const intl = useIntl();
return (
<RichTextSection
Expand Down
4 changes: 2 additions & 2 deletions src/components/ItaliaTheme/View/Commons/GenericCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const GenericCard = ({
)}
</>
);
const cooked_image_field =
image_field || (item.preview_image ? 'preview_image' : 'image');
const cooked_image_field = image_field || item.image_field;
// (item.preview_image ? 'preview_image' : 'image');
const image =
showimage &&
item &&
Expand Down
4 changes: 1 addition & 3 deletions src/components/ItaliaTheme/View/Commons/LocationItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
* Component used to display a location item (luoghi_correlati)
* in VenueDescription, subcomponents of VenueView (luogo)
*/
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import React from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { UniversalLink } from '@plone/volto/components';
import PropTypes from 'prop-types';
import { getContent, resetContent } from '@plone/volto/actions';
import { flattenToAppURL } from '@plone/volto/helpers';
import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
import config from '@plone/volto/registry';
Expand Down
1 change: 0 additions & 1 deletion src/components/ItaliaTheme/View/Commons/OfficeCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import config from '@plone/volto/registry';
*/
const OfficeCard = ({
office,
load_data = true,
icon,
children,
margin_bottom = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const RelatedArticles = ({
<OfficeCard
key={item['@id']}
office={item}
load_data={false}
show_contacts={false}
showimage={showimage}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ItaliaTheme/View/Commons/Sponsors.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const Sponsor = ({ item }) => {
});
return item ? (
<div className="sponsor-item">
<a href={item.remoteUrl} alt="" target="_blank" rel="noopener noreferrer">
<UniversalLink href={item.remoteUrl}>
{image ? image : item.title}
</a>
</UniversalLink>
</div>
) : null;
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/ItaliaTheme/View/Commons/VenuesSmall.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Location = ({ location, show_icon }) => {
<div className="card card-teaser shadow border-left-card mt-3 rounded">
{show_icon && <Icon icon={'it-pin'} />}
<div className="card-body">
<h5 className="card-title h5">{location.title}</h5>
<div className="card-title h5">{location.title}</div>
<div className="card-text">
{(location.street || location.zip_code) && (
<p>
Expand Down
12 changes: 2 additions & 10 deletions src/components/ItaliaTheme/View/IncaricoView/IncaricoView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ const IncaricoView = (props) => {
title={intl.formatMessage(messages.ufficio)}
>
{content.unita_organizzativa?.map((item) => (
<OfficeCard
key={flattenToAppURL(item['@id'])}
office={item}
load_data={false}
/>
<OfficeCard key={flattenToAppURL(item['@id'])} office={item} />
))}
</RichTextSection>
)}
Expand All @@ -142,11 +138,7 @@ const IncaricoView = (props) => {
title={intl.formatMessage(messages.responsabile)}
>
{content.responsabile_struttura?.map((item) => (
<OfficeCard
key={flattenToAppURL(item['@id'])}
office={item}
load_data={false}
/>
<OfficeCard key={flattenToAppURL(item['@id'])} office={item} />
))}
</RichTextSection>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/*
* NewsItemACuraDi component class, used in `NewsItemView`.
*/
import React from 'react';
import PropTypes from 'prop-types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ const PaginaArgomentoView = ({ content }) => {
<div className="image-container me-3">
<Image
item={uo_object}
imageField={
uo_object.preview_image
? 'preview_image'
: 'image'
}
alt=""
title={alt}
responsive={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const ServizioAccedi = ({ content }) => {
<OfficeCard
key={canale['@id']}
office={canale}
load_data={false}
data-element="service-generic-access"
/>
</div>
Expand All @@ -62,11 +61,7 @@ const ServizioAccedi = ({ content }) => {
key={dove['@id']}
className="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal"
>
<OfficeCard
office={dove}
load_data={false}
data-element="service-generic-access"
/>
<OfficeCard office={dove} data-element="service-generic-access" />
</div>
))}
<RichText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const ServizioContatti = ({ content }) => {
<OfficeCard
key={item['@id']}
office={item}
load_data={false}
data-element="service-area"
/>
))}
Expand All @@ -49,7 +48,6 @@ const ServizioContatti = ({ content }) => {
<OfficeCard
key={item['@id']}
office={item}
load_data={false}
data-element="service-area"
/>
))}
Expand Down
8 changes: 1 addition & 7 deletions src/components/ItaliaTheme/View/UOView/UOStructure.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ const UOStructure = ({ content }) => {
<OfficeCard
key={content.uo_parent['@id']}
office={content.uo_parent}
load_data={false}
show_contacts={false}
/>
</div>
Expand All @@ -88,7 +87,6 @@ const UOStructure = ({ content }) => {
<OfficeCard
key={uo['@id']}
office={uo}
load_data={false}
show_contacts={false}
/>
);
Expand All @@ -104,11 +102,7 @@ const UOStructure = ({ content }) => {
</h3>
<div className="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal mb-3">
{content.legami_con_altre_strutture.map((item, _i) => (
<OfficeCard
key={item['@id']}
office={item}
load_data={false}
/>
<OfficeCard key={item['@id']} office={item} />
))}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const VenueContacts = ({ content }) => {
//STRUTTURE RESPONSABILI CORRELATE
<div className="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal">
{content?.struttura_responsabile_correlati?.map((item, i) => (
<OfficeCard key={item['@id']} office={item} load_data={false} />
<OfficeCard key={item['@id']} office={item} />
))}
</div>
) : (
Expand Down

0 comments on commit 92bae0a

Please sign in to comment.