Skip to content

Commit

Permalink
feat(U257): ultimate modifiche header e role picker 20241206
Browse files Browse the repository at this point in the history
  • Loading branch information
lcucuzzella committed Dec 6, 2024
1 parent dfa22a7 commit 73ea57e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
34 changes: 24 additions & 10 deletions fe-piattaforma/src/components/CardProfile/cardProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const CardProfile: React.FC<CardProfileI> = (props) => {
} = props;

const device = useAppSelector(selectDevice);
const descrizioneEstesaUpperCase = profile?.descrizioneEstesaEnte?.toUpperCase();

return (
<div
Expand Down Expand Up @@ -85,7 +86,10 @@ const CardProfile: React.FC<CardProfileI> = (props) => {
'switch-profile-titles'
)}
>
<b>{profile?.descrizioneRuolo}</b>
<b>
{profile?.descrizioneRuolo}
{profile?.descrizioneRuolo !== 'FACILITATORE' && descrizioneEstesaUpperCase ? ` ${descrizioneEstesaUpperCase}` : ''}
</b>
{device.mediaIsPhone && <br />}
{profile?.nomeEnte ? (
<div className='switch-profile-subs pr-1'>
Expand All @@ -95,19 +99,29 @@ const CardProfile: React.FC<CardProfileI> = (props) => {
</span>
</CardTitle>
<CardText
className={clsx(
activeProfile && 'primary-color-b7',
!activeProfile && 'neutral-2-color-a5',
className={clsx(
'primary-color-a12',
'switch-profile-subs'
)}
>

{/* QUI VA PROGETTO O PROGRAMMA */}

{profile?.nomeProgramma}
{profile?.nomeProgettoBreve
? `, ${profile?.nomeProgettoBreve}`
: ''}
{profile?.codiceRuolo !== 'DSCU' &&
profile?.codiceRuolo !== 'DTD' &&
profile?.codiceRuolo !== 'gestore community' &&
profile?.codiceRuolo !== 'MOD' &&
profile?.codiceRuolo !== 'Profilo UDM' && (
<>
{profile?.codiceRuolo === 'DEG' || profile?.codiceRuolo === 'REG' ? (
<>
Programma <em><b>{profile?.nomeProgramma}</b></em>
</>
) : (
<>
Progetto <em><b>{profile?.nomeProgettoBreve}</b></em>
</>
)}
</>
)}
</CardText>
</div>
</div>
Expand Down
17 changes: 3 additions & 14 deletions fe-piattaforma/src/components/Header/view/headerDesktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,7 @@ const HeaderDesktop: React.FC<HeaderI> = ({
];

console.log('USER PROFILE: ', userProfile);
const [profile, setProfile] = useState<any>(null);

useEffect(() => {
const fetchProfile = async () => {
if (userProfile?.idEnte) {
const response = await API.get(`/ente/${userProfile?.idEnte}`);
setProfile(response);
console.log('PROFILE: ', response);
}
};
fetchProfile();
}, [userProfile]);

console.log("profilo esteso: ", userProfile?.descrizioneEstesaEnte);


const userDropDown = () => (
Expand Down Expand Up @@ -124,12 +112,13 @@ const HeaderDesktop: React.FC<HeaderI> = ({
{/* <span className='h6 m-0 text-sans-serif'>
{user?.cognome}&nbsp;{user?.nome}
</span> */}
<span className='h6 font-weight-light text-nowrap pr-1'>
<span className='h6 font-weight-light text-nowrap pr-1 mb-0'>
{/*<em>{getRoleLabel(userProfile?.codiceRuolo)}</em>*/}
<b>{`${userProfile?.descrizioneRuolo}`}</b><em>{`${
userProfile?.nomeEnte ? ` ${userProfile.nomeEnte}` : ''
}`}</em>
</span>
<span>{userProfile?.descrizioneEstesaEnte}</span>
</div>
<div className='ml-2'>
<Icon
Expand Down
1 change: 1 addition & 0 deletions fe-piattaforma/src/redux/features/user/userSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface UserProfileI {
nomeEnte?: string;
nomeProgramma?: string;
nomeProgettoBreve?: string;
descrizioneEstesaEnte?: string;
}

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down

0 comments on commit 73ea57e

Please sign in to comment.