Skip to content

Commit

Permalink
Revert "fe-sprint1"
Browse files Browse the repository at this point in the history
This reverts commit 6b740d2.
  • Loading branch information
a-buono committed Nov 17, 2023
1 parent aa6d2aa commit 693ef07
Show file tree
Hide file tree
Showing 31 changed files with 1,539 additions and 4,326 deletions.
27 changes: 0 additions & 27 deletions fe-piattaforma/.env.local

This file was deleted.

1 change: 1 addition & 0 deletions fe-piattaforma/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cypress*
# Log files
*.log
*.eslintcache
.env*
.editorconfig

../.DS_Store
Expand Down
4,670 changes: 1,156 additions & 3,514 deletions fe-piattaforma/package-lock.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions fe-piattaforma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@reduxjs/toolkit": "^1.8.0",
"axios": "^0.26.1",
"bootstrap-italia": "^1.6.3",
"crypto-js": "^4.2.0",
"cypress-axe": "^0.14.0",
"design-react-kit": "^4.0.2",
"draft-js": "^0.11.7",
Expand Down Expand Up @@ -54,7 +53,6 @@
"@commitlint/config-conventional": "^17.0.2",
"@commitlint/format": "^16.2.1",
"@svgr/webpack": "^6.2.1",
"@types/crypto-js": "^4.2.1",
"@types/draftjs-to-html": "^0.8.1",
"@types/html-webpack-plugin": "^3.2.6",
"@types/lodash.isempty": "^4.4.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const AccordionRow: React.FC<AccordionRowI> = ({
) : null}
</>
) : null}
<span className='font-weight-semibold ' >{title}</span>
<span className='font-weight-semibold'>{title}</span>
</div>
<div className={clsx(device.mediaIsPhone && 'd-flex flex-row')}>
{clickEditAction ? (
Expand Down
2 changes: 1 addition & 1 deletion fe-piattaforma/src/components/DetailsRow/detailsRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface DetailsRowI {

const statusCases = {
SENT: 'INVIATO',
NOT_FILLED: 'NON COMPILATO',
NOT_SENT: 'NON INVIATO',
FILLED_OUT: 'COMPILATO',
};

Expand Down
14 changes: 3 additions & 11 deletions fe-piattaforma/src/components/SearchBar/searchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ interface SearchBarI extends Omit<SelectI, 'onInputChange'> {
tooltip?: boolean;
tooltipText?: string;
infoText?: string;
onQueryChange?: (query: string) => void;
disableSubmit?: boolean;
}

const SearchBar: React.FC<SearchBarI> = (props) => {
Expand Down Expand Up @@ -91,7 +89,6 @@ const SearchBar: React.FC<SearchBarI> = (props) => {
};

const handleOnSubmit = () => {
if (props.disableSubmit) return;
if (!autocomplete && onSubmit) {
onSubmit(searchValue);
setSearchValue(searchValue);
Expand Down Expand Up @@ -161,11 +158,6 @@ const SearchBar: React.FC<SearchBarI> = (props) => {

const device = useAppSelector(selectDevice);

const onInputQueryChange = useCallback((search) => {
setSearchValue((search ?? '').toString());
if (props.onQueryChange) props.onQueryChange(search ? search.toString(): '');
}, [props.onQueryChange]);

return (
<div className={clsx(className, 'search-bar-custom')}>
{!device.mediaIsPhone && search ? (
Expand Down Expand Up @@ -209,7 +201,9 @@ const SearchBar: React.FC<SearchBarI> = (props) => {
device.mediaIsPhone && 'pl-0'
)}
field={id}
onInputChange={onInputQueryChange}
onInputChange={(search) =>
setSearchValue((search || '').toString())
}
placeholder={device.mediaIsPhone ? '' : placeholder}
value={searchValue}
withLabel={false}
Expand Down Expand Up @@ -281,7 +275,6 @@ const SearchBar: React.FC<SearchBarI> = (props) => {
className='border-0'
onClick={handleOnSubmit}
color='primary'
disabled={props.disableSubmit}
>
Cerca
</Button>
Expand All @@ -290,7 +283,6 @@ const SearchBar: React.FC<SearchBarI> = (props) => {
className='border-0'
onClick={handleOnSubmit}
aria-label='Avvia ricerca'
disabled={props.disableSubmit}
>
<Icon
icon='it-search'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react';
import React from 'react';
import SearchBar from '../SearchBar/searchBar';
import { Form } from '..';
import { FormGroup, Label } from 'design-react-kit';
Expand All @@ -15,7 +15,6 @@ interface SearchBarOptionsI {
currentStep: string | undefined;
steps: { [key: string]: string };
alreadySearched?: (param: boolean) => void;
setSearchValue: (param: { type: string; value: string }) => void;
resetModal?: () => void;
}

Expand All @@ -25,7 +24,6 @@ const SearchBarOptionsCitizen: React.FC<SearchBarOptionsI> = ({
currentStep,
steps,
alreadySearched,
setSearchValue,
resetModal,
}) => {
const { t } = useTranslation();
Expand All @@ -36,26 +34,6 @@ const SearchBarOptionsCitizen: React.FC<SearchBarOptionsI> = ({
if (resetModal) resetModal();
};

const [canSubmit, setCanSubmit] = useState<boolean>(false);
const [query, setQuery] = useState<string>('');
const [mustValidateCf, setMustValidateCf] = useState<boolean>(true);

const isValidFiscalCode = useCallback((query: string) => {
return /^[A-Z]{6}[0-9]{2}[A-Z][0-9]{2}[A-Z][0-9]{3}[A-Z]$/i.test(query);
}, []);

const onRadioChange = useCallback((value: string) => {
setCurrentStep(value);
setRadioFilter(value);
setMustValidateCf(value === 'codiceFiscale');
setCanSubmit(value !== 'codiceFiscale' || isValidFiscalCode(query));
}, [setCurrentStep, setRadioFilter, query]);

const onQueryChange = useCallback(((query: string) => {
setCanSubmit(mustValidateCf ? isValidFiscalCode(query) : true);
setQuery(query);
}), [isValidFiscalCode, mustValidateCf]);

return (
<div
className={clsx(
Expand All @@ -70,17 +48,19 @@ const SearchBarOptionsCitizen: React.FC<SearchBarOptionsI> = ({
<Form id='form-searchbar-opt' className='m-3' showMandatory={false}>
<FormGroup check className='justify-content-around'>
{Object.keys(steps).map((item, index) => (
<div key={item} className='d-flex align-items-center'>
<div key={index} className='d-flex align-items-center'>
<Input
name='docType'
type='radio'
id={`current-step-${index}`}
checked={currentStep === steps[item]}
onClick={() => {
onRadioChange(steps[item]);
setCurrentStep(steps[item]);
setRadioFilter(steps[item]);
}}
onInputChange={() => {
onRadioChange(steps[item]);
setCurrentStep(steps[item]);
setRadioFilter(steps[item]);
}}
/>
<Label check htmlFor={`current-step-${index}`}>
Expand All @@ -96,21 +76,13 @@ const SearchBarOptionsCitizen: React.FC<SearchBarOptionsI> = ({
onSubmit={(data) => {
if (resetModal) resetModal();
if (data) {
const crypted = AES.encrypt(data, process?.env?.KEY_SECRET as string).toString();
const searchValue: SearchValue = {
type: currentStep as string,
value: data,
};
setSearchValue(searchValue);
dispatch(
GetEntitySearchResult(crypted, currentStep ? currentStep : '')
GetEntitySearchResult(data, currentStep ? currentStep : '')
);
if (alreadySearched) alreadySearched(true);
}
}}
onReset={handleSearchReset}
onQueryChange={onQueryChange}
disableSubmit={!canSubmit}
/>
</div>
);
Expand Down
5 changes: 2 additions & 3 deletions fe-piattaforma/src/components/Table/view/tableMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ const TableMobile: React.FC<MobileTableI> = ({
} = item;

return {
title: id ,
/*title: cognome
title: cognome
? cognome + ' ' + nome
: nome || nome || label || name || attributo,*/
: nome || nome || label || name || attributo,
status,
id,
actions,
Expand Down
14 changes: 0 additions & 14 deletions fe-piattaforma/src/consts/monthsMapForFiscalCode.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const CitizensList: React.FC = () => {
};

const buttons: ButtonInButtonsBar[] = [
/*{
{
text: 'Carica lista cittadini',
outline: true,
iconForButton: 'it-upload',
Expand All @@ -254,7 +254,7 @@ const CitizensList: React.FC = () => {
},
})
),
},*/
},
{
text: 'Aggiungi cittadino',
color: 'primary',
Expand Down Expand Up @@ -309,7 +309,7 @@ const CitizensList: React.FC = () => {
isDetail
citizenList={true}
tooltip
tooltiptext='Cerca cittadino per codice fiscale o numero documento'
tooltiptext='Cerca cittadino per nome, cognome, codice fiscale o numero documento'
>
{(citizens?.cittadini || []).map((citizen: CitizenI, i: number) => (
<DetailsRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
DeleteService,
GetCitizenListServiceDetail,
GetServicesDetail,
//GetServicesDetailFilters,
//SendSurveyToAll,
GetServicesDetailFilters,
SendSurveyToAll,
} from '../../../../../redux/features/administrativeArea/services/servicesThunk';
import { useLocation, useNavigate, useParams } from 'react-router-dom';
import DetailLayout from '../../../../../components/DetailLayout/detailLayout';
Expand Down Expand Up @@ -254,7 +254,7 @@ const ServicesDetails = () => {
'_blank'
),
},
/*{
{
size: 'xs',
color: 'primary',
text: 'Invia questionario a tutti',
Expand Down Expand Up @@ -286,7 +286,7 @@ const ServicesDetails = () => {
dispatch(GetCitizenListServiceDetail(serviceId));
dispatch(GetServicesDetailFilters(serviceId));
},
},*/
},
];

const onConfirmDelete = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { CRUDActionsI, CRUDActionTypes } from '../../../../../utils/common';
import { formFieldI } from '../../../../../utils/formHelper';
import PageTitle from '../../../../../components/PageTitle/pageTitle';
import IconNote from '/public/assets/img/it-note-primary.png';
import moment from "moment";

const entity = 'citizensArea';
const siteDropdownLabel = 'idsSedi';
Expand Down Expand Up @@ -105,7 +104,7 @@ const Citizens = () => {
autocomplete: false,
onHandleSearch: handleOnSearch,
placeholder:
'Inserisci il codice fiscale o il numero documento del cittadino',
'Inserisci il cognome e/o il nome, oppure l’ID o il codice fiscale dell’utente',
isClearable: true,
title: 'Cerca cittadino',
};
Expand Down Expand Up @@ -140,7 +139,6 @@ const Citizens = () => {
name: td.cognome + ' ' + td.nome,
numeroServizi: td.numeroServizi,
numeroQuestionariCompilati: td.numeroQuestionariCompilati,
dataOraAggiornamento: moment(td.dataOraAggiornamento).format('YYYY-MM-DD HH:mm:ss')
}))
);
return table;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import FormCitizen from '../../../../forms/formCitizen';
import DetailLayout from '../../../../../components/DetailLayout/detailLayout';
import {
closeModal,
//openModal,
openModal,
} from '../../../../../redux/features/modal/modalSlice';
import ManageCitizens from '../../../AdministrativeArea/Entities/modals/manageCitizens';
//import { formTypes } from '../../../AdministrativeArea/Entities/utils';
import { formTypes } from '../../../AdministrativeArea/Entities/utils';
import { setInfoIdsBreadcrumb } from '../../../../../redux/features/app/appSlice';
import CitizenServices from './CitizenServices';

Expand Down Expand Up @@ -43,7 +43,7 @@ const CitizensDetail: React.FC = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

/*const citizenButtons = [
const citizenButtons = [
{
color: 'primary',
text: 'Modifica',
Expand All @@ -58,21 +58,23 @@ const CitizensDetail: React.FC = () => {
})
),
},
];*/
];

return (
<div className='container pb-3'>
<DetailLayout
titleInfo={{
title:
citizen?.dettaglioCittadino?.id as string,
citizen?.dettaglioCittadino?.cognome +
' ' +
citizen?.dettaglioCittadino?.nome,
status: '',
upperTitle: { icon: 'it-user', text: 'Cittadino' },
}}
buttonsPosition='BOTTOM'
goBackTitle='I miei cittadini'
goBackPath='/area-cittadini'
//formButtons={citizenButtons}
formButtons={citizenButtons}
>
<FormCitizen legend='form cittadino' formDisabled />
</DetailLayout>
Expand Down
Loading

0 comments on commit 693ef07

Please sign in to comment.