From 736ac8072fc9d263b5dd2cfa81c898bff9a40c5a Mon Sep 17 00:00:00 2001 From: Arturo Buono Date: Tue, 30 Jan 2024 17:09:57 +0100 Subject: [PATCH] fix(allineamento): updates 20240130 --- .../cardCommunity.scss} | 0 .../cardCommunity.tsx} | 26 +- .../src/components/Comments/comment.tsx | 18 +- .../components/Comments/commentSection.tsx | 2 +- .../DocumentDetail/sectionDetail.tsx | 20 +- .../src/components/MocksWave3/Mocks.tsx | 2 +- .../src/components/ReportCard/ReportCard.tsx | 8 +- .../searchBarOptionsCitizen.tsx | 40 +- fe-piattaforma/src/components/index.ts | 2 + .../src/consts/monthsMapForFiscalCode.ts | 27 +- .../Surveys/components/jsonFormRender.tsx | 2 +- .../Entities/modals/Category/categoryForm.tsx | 2 +- .../Entities/modals/manageComment.tsx | 4 +- .../Entities/modals/manageReport.tsx | 2 +- .../Entities/modals/manageTopic.tsx | 8 +- .../forum.scss => Community/community.scss} | 0 .../forum.tsx => Community/community.tsx} | 11 +- .../communityDetails.tsx} | 22 +- .../pages/common/HomeSearch/homeSearch.tsx | 5 +- .../NotificationIcon/NotificationIcon.tsx | 10 +- .../components/Notifications/notification.tsx | 4 +- .../userPublishedContentsPage.tsx | 5 +- .../pages/facilitator/Categories/category.tsx | 6 +- .../communityWidget.tsx} | 24 +- .../src/pages/facilitator/Home/home.tsx | 4 +- .../src/pages/facilitator/Survey/survey.tsx | 6 +- .../pages/forms/formForum/formCreateTopic.tsx | 2 +- .../formProjects/formProjectGeneralInfo.tsx | 2 +- .../formServices/ExistingCitizenInfo.tsx | 3 +- .../formServices/formServiceCitizenFull.tsx | 26 +- .../models/newUserValuesFormCitizen.model.ts | 23 +- .../services/servicesThunk.ts | 13 +- .../administrativeArea/user/userThunk.ts | 4 + .../forum/categories/categoriesThunk.ts | 2 +- .../src/redux/features/forum/forumThunk.ts | 52 +- .../src/redux/features/user/userSlice.ts | 7 + .../src/redux/features/user/userThunk.ts | 19 +- fe-piattaforma/src/routes/index.tsx | 14 +- .../src/styles/common/_components.scss | 2 +- fe-piattaforma/src/styles/main.scss | 2 +- fe-piattaforma/src/utils/common.ts | 2 +- fe-piattaforma/src/utils/mockHelper.ts | 184 +- fe-piattaforma/src/utils/sessionHelper.ts | 4 +- fe-piattaforma/webpack/webpack.common.js | 8 +- .../repdgt/surveymgmt/dto/CittadinoDto.java | 2 + .../surveymgmt/mapper/ServizioMapper.java | 26 +- .../projection/CittadinoProjection.java | 5 +- .../projection/GetCittadinoProjection.java | 16 +- .../repository/CittadinoRepository.java | 156 +- .../repository/ServizioSqlRepository.java | 438 +++-- .../ServizioXCittadinoRepository.java | 22 +- .../ConsensoTrattamentoDatiRequest.java | 4 + .../service/CittadiniServizioService.java | 1547 +++++++++-------- .../service/QuestionarioCompilatoService.java | 7 +- .../service/ServizioSqlService.java | 325 ++-- 55 files changed, 1600 insertions(+), 1577 deletions(-) rename fe-piattaforma/src/components/{CardForum/cardForum.scss => CardCommunity/cardCommunity.scss} (100%) rename fe-piattaforma/src/components/{CardForum/cardForum.tsx => CardCommunity/cardCommunity.tsx} (82%) rename fe-piattaforma/src/pages/common/{Forum/forum.scss => Community/community.scss} (100%) rename fe-piattaforma/src/pages/common/{Forum/forum.tsx => Community/community.tsx} (96%) rename fe-piattaforma/src/pages/common/{Forum/forumDetails.tsx => Community/communityDetails.tsx} (91%) rename fe-piattaforma/src/pages/facilitator/Home/components/{ForumWidget/forumWidget.tsx => CommunityWidget/communityWidget.tsx} (87%) diff --git a/fe-piattaforma/src/components/CardForum/cardForum.scss b/fe-piattaforma/src/components/CardCommunity/cardCommunity.scss similarity index 100% rename from fe-piattaforma/src/components/CardForum/cardForum.scss rename to fe-piattaforma/src/components/CardCommunity/cardCommunity.scss diff --git a/fe-piattaforma/src/components/CardForum/cardForum.tsx b/fe-piattaforma/src/components/CardCommunity/cardCommunity.tsx similarity index 82% rename from fe-piattaforma/src/components/CardForum/cardForum.tsx rename to fe-piattaforma/src/components/CardCommunity/cardCommunity.tsx index 6c6219d00..a185d29fc 100644 --- a/fe-piattaforma/src/components/CardForum/cardForum.tsx +++ b/fe-piattaforma/src/components/CardCommunity/cardCommunity.tsx @@ -2,13 +2,13 @@ import clsx from 'clsx'; import { CardText, CardTitle, Col, Icon } from 'design-react-kit'; import React, { memo } from 'react'; import Heart from '/public/assets/img/hollow-grey-heart.png'; -import './cardForum.scss'; +import './cardCommunity.scss'; import { useNavigate } from 'react-router-dom'; import PublishingAuthority from '../CardDocument/PublishingAuthority'; import { formatDate } from '../../utils/datesHelper'; import { ForumCardsI } from '../CardShowcase/cardShowcase'; -const CardForum: React.FC = (props) => { +const CardCommunity: React.FC = (props) => { const { id, title, @@ -23,14 +23,14 @@ const CardForum: React.FC = (props) => { const navigate = useNavigate(); const navigateTo = () => { - navigate(`/forum/${id}`); + navigate(`/community/${id}`); }; return (
= (props) => { > {category_label ? ( -
+
{category_label} {/*  —  */} @@ -66,13 +66,13 @@ const CardForum: React.FC = (props) => { {title ? ( {title} ) : null} {description ? ( - + {description} ) : null} @@ -87,7 +87,7 @@ const CardForum: React.FC = (props) => { 'align-items-center' )} > - + {date && formatDate(date, 'shortDate')}
@@ -106,7 +106,7 @@ const CardForum: React.FC = (props) => { aria-label='Likes' aria-hidden /> - {likes} + {likes}
= (props) => { aria-label='Comments' aria-hidden /> - {comment_count} + + {comment_count} +
= (props) => { aria-label='Views' aria-hidden /> - {views} + {views}
@@ -141,4 +143,4 @@ const CardForum: React.FC = (props) => { ); }; -export default memo(CardForum); +export default memo(CardCommunity); diff --git a/fe-piattaforma/src/components/Comments/comment.tsx b/fe-piattaforma/src/components/Comments/comment.tsx index 3677c4804..79c42b20f 100644 --- a/fe-piattaforma/src/components/Comments/comment.tsx +++ b/fe-piattaforma/src/components/Comments/comment.tsx @@ -44,7 +44,7 @@ export interface CommentI { isAnswer?: boolean; thread?: boolean; noBorder?: boolean; - section: 'board' | 'forum' | 'documents'; + section: 'board' | 'community' | 'documents'; onDeleteComment?: () => void; onEditComment?: () => void; reported: 0 | 1; @@ -134,7 +134,7 @@ const Comment: React.FC = (props) => { hasUserPermission([ section === 'board' ? 'del.news' - : section === 'forum' + : section === 'community' ? 'del.topic' : section === 'documents' ? 'del.doc' @@ -148,7 +148,7 @@ const Comment: React.FC = (props) => { hasUserPermission([ section === 'board' ? 'upd.news' - : section === 'forum' + : section === 'community' ? 'upd.topic' : section === 'documents' ? 'upd.doc' @@ -162,7 +162,7 @@ const Comment: React.FC = (props) => { hasUserPermission([ section === 'board' ? 'rprt.news' - : section === 'forum' + : section === 'community' ? 'rprt.topic' : section === 'documents' ? 'rprt.doc' @@ -327,20 +327,20 @@ const Comment: React.FC = (props) => { replies={ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - section === 'forum' && replies !== '[]' + section === 'community' && replies !== '[]' ? replies?.length : undefined } - views={section === 'forum' ? views : undefined} + views={section === 'community' ? views : undefined} onShowReplies={ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - section === 'forum' && replies !== '[]' && replies?.length + section === 'community' && replies !== '[]' && replies?.length ? () => setShowReplies((prev) => !prev) : undefined } isReply={isReply} - showReplies={section === 'forum' ? showReplies : undefined} + showReplies={section === 'community' ? showReplies : undefined} likes={likes} user_like={user_like} onLike={async () => { @@ -355,7 +355,7 @@ const Comment: React.FC = (props) => { } }} onComment={ - section === 'forum' + section === 'community' ? () => dispatch( openModal({ diff --git a/fe-piattaforma/src/components/Comments/commentSection.tsx b/fe-piattaforma/src/components/Comments/commentSection.tsx index 2ec288e15..814b21739 100644 --- a/fe-piattaforma/src/components/Comments/commentSection.tsx +++ b/fe-piattaforma/src/components/Comments/commentSection.tsx @@ -8,7 +8,7 @@ import SectionTitle from '../SectionTitle/sectionTitle'; import Comment from './comment'; interface commentSectionI { - section: 'board' | 'forum' | 'documents'; + section: 'board' | 'community' | 'documents'; } const CommentSection: React.FC = ({ section }) => { diff --git a/fe-piattaforma/src/components/DocumentDetail/sectionDetail.tsx b/fe-piattaforma/src/components/DocumentDetail/sectionDetail.tsx index 51610ca3b..25b9d367e 100644 --- a/fe-piattaforma/src/components/DocumentDetail/sectionDetail.tsx +++ b/fe-piattaforma/src/components/DocumentDetail/sectionDetail.tsx @@ -48,7 +48,7 @@ export interface CardDocumentDetailI { user_like?: boolean; likes?: number; views?: number; - section?: 'forum' | 'documents'; + section?: 'community' | 'documents'; isDocument?: boolean | undefined; onDeleteClick?: () => void; onEditClick?: () => void; @@ -138,7 +138,7 @@ const SectionDetail: React.FC = (props) => { hasUserPermission([ section === 'documents' || isDocument ? 'del.doc' - : section === 'forum' + : section === 'community' ? 'del.topic' : 'hidden', ]) || @@ -146,7 +146,7 @@ const SectionDetail: React.FC = (props) => { hasUserPermission([ section === 'documents' || isDocument ? 'new.doc' - : section === 'forum' + : section === 'community' ? 'new.topic' : 'hidden', ])) @@ -157,7 +157,7 @@ const SectionDetail: React.FC = (props) => { hasUserPermission([ section === 'documents' || isDocument ? 'upd.doc' - : section === 'forum' + : section === 'community' ? 'upd.topic' : 'hidden', ]) || @@ -165,7 +165,7 @@ const SectionDetail: React.FC = (props) => { hasUserPermission([ section === 'documents' || isDocument ? 'new.doc' - : section === 'forum' + : section === 'community' ? 'new.topic' : 'hidden', ])) @@ -176,7 +176,7 @@ const SectionDetail: React.FC = (props) => { hasUserPermission([ section === 'documents' || isDocument ? 'rprt.doc' - : section === 'forum' + : section === 'community' ? 'rprt.topic' : 'hidden', ]) @@ -392,7 +392,7 @@ const SectionDetail: React.FC = (props) => {
) : null} = (props) => { downloads={downloads} user_like={user_like} onLike={ - section === 'forum' + section === 'community' ? async () => { if (id) { if (user_like as boolean) { @@ -422,7 +422,7 @@ const SectionDetail: React.FC = (props) => { }) ); } - userId && dispatch(GetItemDetail(id, userId, 'forum')); + userId && dispatch(GetItemDetail(id, userId, 'community')); } } : undefined @@ -434,7 +434,7 @@ const SectionDetail: React.FC = (props) => { payload: { title: 'Aggiungi commento', action: 'comment', - entity: section === 'forum' ? 'forum' : 'document', + entity: section === 'community' ? 'community' : 'document', category: category_label || category, textLabel: 'Digita qui sotto il testo', }, diff --git a/fe-piattaforma/src/components/MocksWave3/Mocks.tsx b/fe-piattaforma/src/components/MocksWave3/Mocks.tsx index 10a034e5f..11b4f31d3 100644 --- a/fe-piattaforma/src/components/MocksWave3/Mocks.tsx +++ b/fe-piattaforma/src/components/MocksWave3/Mocks.tsx @@ -10,7 +10,7 @@ export const DocumentCardMock = { comment: 12, }; -export const ForumPropsMock = [ +export const CommunityPropsMock = [ { title: 'La Digital Skills and Jobs Platform: un anno da festeggiare', description: diff --git a/fe-piattaforma/src/components/ReportCard/ReportCard.tsx b/fe-piattaforma/src/components/ReportCard/ReportCard.tsx index c6ef1e78f..71506169f 100644 --- a/fe-piattaforma/src/components/ReportCard/ReportCard.tsx +++ b/fe-piattaforma/src/components/ReportCard/ReportCard.tsx @@ -34,7 +34,7 @@ interface ReportCardI { comment_post_date?: string; item_id: string; item_title?: string; - item_type: 'board_item' | 'forum_item' | 'document_item'; + item_type: 'board_item' | 'community_item' | 'document_item'; reason: string; date: string; } @@ -91,7 +91,7 @@ const ReportCard: React.FC = ({ switch (item_type) { case 'board_item': return short ? 'news' : 'la news'; - case 'forum_item': + case 'community_item': return short ? 'topic' : 'il topic'; case 'document_item': return short ? 'documento' : 'il documento'; @@ -264,8 +264,8 @@ const ReportCard: React.FC = ({ case 'board_item': navigate(`/bacheca/${item_id}`); break; - case 'forum_item': - navigate(`/forum/${item_id}`); + case 'community_item': + navigate(`/community/${item_id}`); break; case 'document_item': navigate(`/documenti/${item_id}`); diff --git a/fe-piattaforma/src/components/SearchBarOptionsCitizen/searchBarOptionsCitizen.tsx b/fe-piattaforma/src/components/SearchBarOptionsCitizen/searchBarOptionsCitizen.tsx index 7bee96d23..5a753164f 100644 --- a/fe-piattaforma/src/components/SearchBarOptionsCitizen/searchBarOptionsCitizen.tsx +++ b/fe-piattaforma/src/components/SearchBarOptionsCitizen/searchBarOptionsCitizen.tsx @@ -10,8 +10,9 @@ import Input from '../Form/input'; import { setCitizenSearchResults } from '../../redux/features/citizensArea/citizensAreaSlice'; import { SearchValue } from '../../pages/forms/models/searchValue.model'; import { Buffer } from 'buffer'; -import { mappaMesi } from '../../consts/monthsMapForFiscalCode'; import { emitNotify } from '../../redux/features/notification/notificationSlice'; +import moment from 'moment'; +import { Parser, Validator } from '@marketto/codice-fiscale-utils'; interface SearchBarOptionsI { setCurrentStep: (value: string) => void; @@ -45,20 +46,7 @@ const SearchBarOptionsCitizen: React.FC = ({ const [mustValidateCf, setMustValidateCf] = useState(true); const isMaggiorenne = useCallback((cf: string): boolean => { - const today: Date = new Date(); - const rangeCentury: number = parseInt( - today.getFullYear().toString().substring(2) - ); - const isFemale: boolean = cf.charAt(9) >= '4'; - const dayOfBirth: number = - parseInt(cf.substring(9, 11)) - (isFemale ? 40 : 0); - const century: number = parseInt(cf.substring(6, 8)); - const yearOfBirth: number = - century <= rangeCentury ? 2000 + century : 1900 + century; - const month: number = mappaMesi.get(cf.charAt(8).toUpperCase()) as number; - const dateOfBirth: Date = new Date(yearOfBirth, month, dayOfBirth); - const age: number = today.getFullYear() - dateOfBirth.getFullYear(); - return age > 18; + return moment().diff(Parser.cfToBirthDate(cf), 'years', false) >= 18; }, []); const dispatchNotify = useCallback( @@ -72,9 +60,20 @@ const SearchBarOptionsCitizen: React.FC = ({ const isValidFiscalCode = useCallback( (query: string) => { - const isValid: boolean = - /^[A-Z]{6}[0-9]{2}[A-Z][0-9]{2}[A-Z][0-9]{3}[A-Z]$/i.test(query); - if (isValid) { + const fiscalCodeValid = Validator.codiceFiscale(query).valid; + const fiscalCodeLengthCorrect = query.length === 16; + + if (!fiscalCodeValid && fiscalCodeLengthCorrect) { + dispatchNotify( + 1, + 'ERRORE', + 'error', + 'Il codice fiscale inserito non è valido', + 'medium' + ); + return false; + } + if (fiscalCodeValid) { const isAdult = isMaggiorenne(query); if (!isAdult) { dispatchNotify( @@ -87,9 +86,10 @@ const SearchBarOptionsCitizen: React.FC = ({ } return isAdult; } - return isValid; + + return false; }, - [dispatch, isMaggiorenne] + [dispatchNotify, isMaggiorenne] ); const onRadioChange = useCallback( diff --git a/fe-piattaforma/src/components/index.ts b/fe-piattaforma/src/components/index.ts index d46a84477..6aac3f5ff 100644 --- a/fe-piattaforma/src/components/index.ts +++ b/fe-piattaforma/src/components/index.ts @@ -1,5 +1,6 @@ import Accordion from './Accordion/accordion'; import Card from './Card/card'; +import CardCommunity from './CardCommunity/cardCommunity'; import CardCounter from './CardCounter/cardCounter'; import CardProfile from './CardProfile/cardProfile'; import CardStatusAction from './CardStatusAction/cardStatusAction'; @@ -47,6 +48,7 @@ export { Breadcrumb, ButtonsBar, Card, + CardCommunity, CardCounter, CardProfile, CardStatusAction, diff --git a/fe-piattaforma/src/consts/monthsMapForFiscalCode.ts b/fe-piattaforma/src/consts/monthsMapForFiscalCode.ts index 86b3f5174..e1b85e6ad 100644 --- a/fe-piattaforma/src/consts/monthsMapForFiscalCode.ts +++ b/fe-piattaforma/src/consts/monthsMapForFiscalCode.ts @@ -1,14 +1,15 @@ export const mappaMesi = new Map([ - ['A', 1], - ['B', 2], - ['C', 3], - ['D', 4], - ['E', 5], - ['H', 6], - ['L', 7], - ['M', 8], - ['P', 9], - ['R', 10], - ['S', 11], - ['T', 12], -]); + ['A', 1], + ['B', 2], + ['C', 3], + ['D', 4], + ['E', 5], + ['H', 6], + ['L', 7], + ['M', 8], + ['P', 9], + ['R', 10], + ['S', 11], + ['T', 12], + ]); + \ No newline at end of file diff --git a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/Surveys/components/jsonFormRender.tsx b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/Surveys/components/jsonFormRender.tsx index d389aa7be..257cc7edb 100644 --- a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/Surveys/components/jsonFormRender.tsx +++ b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/Surveys/components/jsonFormRender.tsx @@ -257,7 +257,7 @@ const JsonFormRender: React.FC = (props) => { ? 'ml-2 mb-3' : '' } - customMandatoryText='* Selezionare almeno una risposta' + customMandatoryText='Rispondere ad almeno una delle seguenti domande' >
= (props) => { label='Sezione' options={[ { label: 'Bacheca', value: 'board_categories' }, - { label: 'Forum', value: 'forum_categories' }, + { label: 'Forum', value: 'community_categories' }, { label: 'Documenti', value: 'document_categories' }, ]} placeholder='Seleziona la sezione' diff --git a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageComment.tsx b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageComment.tsx index 3e89bafa1..66342c950 100644 --- a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageComment.tsx +++ b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageComment.tsx @@ -60,7 +60,7 @@ const ManageComment: React.FC = ({ // @ts-ignore if (res) { userId && - dispatch(GetItemDetail(id, userId, payload.entity || 'forum')); + dispatch(GetItemDetail(id, userId, payload.entity || 'community')); dispatch( ActionTracker({ target: 'tnd', @@ -68,7 +68,7 @@ const ManageComment: React.FC = ({ event_type: payload.entity === 'board' ? 'NEWS' - : payload.entity === 'forum' + : payload.entity === 'community' ? 'TOPIC' : 'DOCUMENTI', category: payload.category_label || payload.category, diff --git a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageReport.tsx b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageReport.tsx index 0e081a1c1..35f21f62e 100644 --- a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageReport.tsx +++ b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageReport.tsx @@ -43,7 +43,7 @@ const ManageReport: React.FC = ({ if (newReport.trim() !== '' && payload) { switch (payload.entity) { case 'board': - case 'forum': + case 'community': case 'document': if (id && userId) { await dispatch(CreateItemReport(id, newReport)); diff --git a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageTopic.tsx b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageTopic.tsx index f9e0af2ab..30a0f6b60 100644 --- a/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageTopic.tsx +++ b/fe-piattaforma/src/pages/administrator/AdministrativeArea/Entities/modals/manageTopic.tsx @@ -95,13 +95,13 @@ const ManageTopic: React.FC = ({ // @ts-ignore !newFormValues?.attachment?.data, }, - 'forum' + 'community' ) ); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore if (res) { - userId && dispatch(GetItemDetail(id, userId, 'forum')); + userId && dispatch(GetItemDetail(id, userId, 'community')); setNewFormValues({}); setStep('confirm'); } @@ -120,7 +120,7 @@ const ManageTopic: React.FC = ({ ? 'Ente gestore di programma' : '-', }, - 'forum' + 'community' ) ); // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -170,7 +170,7 @@ const ManageTopic: React.FC = ({ onClick: () => { resetModal(); dispatch(closeModal()); - newNodeId && navigate(`/forum/${newNodeId}`); + newNodeId && navigate(`/community/${newNodeId}`); }, }, secondaryCTA: null, diff --git a/fe-piattaforma/src/pages/common/Forum/forum.scss b/fe-piattaforma/src/pages/common/Community/community.scss similarity index 100% rename from fe-piattaforma/src/pages/common/Forum/forum.scss rename to fe-piattaforma/src/pages/common/Community/community.scss diff --git a/fe-piattaforma/src/pages/common/Forum/forum.tsx b/fe-piattaforma/src/pages/common/Community/community.tsx similarity index 96% rename from fe-piattaforma/src/pages/common/Forum/forum.tsx rename to fe-piattaforma/src/pages/common/Community/community.tsx index 31679fa14..75be1cde4 100644 --- a/fe-piattaforma/src/pages/common/Forum/forum.tsx +++ b/fe-piattaforma/src/pages/common/Community/community.tsx @@ -2,7 +2,7 @@ import clsx from 'clsx'; import {Container} from 'design-react-kit'; import React, {useEffect, useState} from 'react'; import {useDispatch} from 'react-redux'; -import {EmptySection, Paginator} from '../../../components'; +import {EmptySection, Paginator, CardCommunity} from '../../../components'; import {DropdownFilterI, FilterI,} from '../../../components/DropdownFilter/dropdownFilter'; import ForumLayout from '../../../components/ForumLayout/ForumLayout'; import {setPublishedContent} from '../../../redux/features/app/appSlice'; @@ -20,14 +20,13 @@ import {openModal} from '../../../redux/features/modal/modalSlice'; import {useAppSelector} from '../../../redux/hooks'; import ManageTopic from '../../administrator/AdministrativeArea/Entities/modals/manageTopic'; /* import { ForumPropsMock } from '../../facilitator/Home/components/ForumWidget/forumWidget'; */ -import './forum.scss'; +import './community.scss'; import { selectEntityPagination, setEntityPagination, } from '../../../redux/features/administrativeArea/administrativeAreaSlice'; import {formFieldI} from '../../../utils/formHelper'; import useGuard from '../../../hooks/guard'; -import CardForum from '../../../components/CardForum/cardForum'; // for dropdown filters, don't change const categoryDropdownLabel = 'categories'; @@ -37,7 +36,7 @@ const TopicCta = { iconCta: 'it-plus', }; -const Forum = () => { +const Community = () => { const topicsList = useAppSelector(selectTopicsList); const filtersList = useAppSelector(selectFilters); const dropdownFilterOptions = useAppSelector(selectFilterOptions); @@ -190,7 +189,7 @@ community.' 'align-cards' )} > - +
)) ) : ( @@ -217,4 +216,4 @@ community.' ); }; -export default Forum; +export default Community; diff --git a/fe-piattaforma/src/pages/common/Forum/forumDetails.tsx b/fe-piattaforma/src/pages/common/Community/communityDetails.tsx similarity index 91% rename from fe-piattaforma/src/pages/common/Forum/forumDetails.tsx rename to fe-piattaforma/src/pages/common/Community/communityDetails.tsx index b92935414..44c7e003d 100644 --- a/fe-piattaforma/src/pages/common/Forum/forumDetails.tsx +++ b/fe-piattaforma/src/pages/common/Community/communityDetails.tsx @@ -31,7 +31,7 @@ import { setInfoIdsBreadcrumb } from '../../../redux/features/app/appSlice'; import DeleteForumModal from '../../../components/General/DeleteForumEntity/DeleteForumEntity'; import { Loader } from '../../../components'; -const ForumDetails = () => { +const CommunityDetails = () => { const navigate = useNavigate(); const dispatch = useDispatch(); const topicDetails = useAppSelector(selectTopicDetail); @@ -41,7 +41,7 @@ const ForumDetails = () => { const getItemDetails = async () => { if (id && userId) { - const res = await dispatch(GetItemDetail(id, userId, 'forum')); + const res = await dispatch(GetItemDetail(id, userId, 'community')); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore if (res) { @@ -62,7 +62,7 @@ const ForumDetails = () => { }) ); } else { - navigate('/forum', { replace: true }); + navigate('/community', { replace: true }); } } }; @@ -86,7 +86,7 @@ const ForumDetails = () => { const backButton = (