Skip to content

Commit

Permalink
Release UAT
Browse files Browse the repository at this point in the history
  • Loading branch information
OraldoDoci authored Dec 2, 2024
2 parents 05fb78f + 4f069b9 commit 0d2f6ac
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .devops/code-review-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#

variables:
NODE_VERSION: '16.10.0'
NODE_VERSION: '20.18.1'
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
# Execute agents (jobs) on latest Ubuntu version.
vmImageNameDefault: 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion .devops/deploy-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parameters:
default: minor

variables:
NODE_VERSION: '16.10.0'
NODE_VERSION: '20.18.1'
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
# Execute agents (jobs) on latest Ubuntu version.
vmImageNameDefault: 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion .devops/pnpg-code-review-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#

variables:
NODE_VERSION: '16.10.0'
NODE_VERSION: '20.18.1'
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
# Execute agents (jobs) on latest Ubuntu version.
vmImageNameDefault: 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion .devops/pnpg-deploy-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parameters:
default: minor

variables:
NODE_VERSION: '16.10.0'
NODE_VERSION: '20.18.1'
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
# Execute agents (jobs) on latest Ubuntu version.
vmImageNameDefault: 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.10.0
20.18.1
3 changes: 2 additions & 1 deletion src/locale/it.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export default {
customAlert: {
message:
'Per migliorare la tua esperienza e offrirti una gestione più mirata, vedrai solo le informazioni e i prodotti di cui sei amministratore.',
'Aggiungi il tuo numero di cellulare di lavoro, o se non disponibile un fisso. Ci permetterà di contattarti in caso di necessità.',
button: 'Aggiungi',
},
session: {
expired: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import AssignmentIcon from '@mui/icons-material/Assignment';
import ViewSidebarIcon from '@mui/icons-material/ViewSidebar';
import DnsIcon from '@mui/icons-material/Dns';
import EuroSymbolIcon from '@mui/icons-material/EuroSymbol';
import PeopleAlt from '@mui/icons-material/PeopleAlt';
import SupervisedUserCircle from '@mui/icons-material/SupervisedUserCircle';
import ViewSidebarIcon from '@mui/icons-material/ViewSidebar';
import { Grid, List } from '@mui/material';
import {
useErrorDispatcher,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboardOverview/DashboardOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const DashboardOverview = ({ party, products }: Props) => {
setOpen={setOpen}
canUploadLogo={canUploadLogo}
/>
<WelcomeDashboard setOpen={setOpen} />
<WelcomeDashboard setOpen={setOpen} party={party} />

<Grid item xs={12} mb={2} mt={5}>
{canSeeActiveProductsList && <ActiveProductsSection products={products} party={party} />}
Expand Down
10 changes: 8 additions & 2 deletions src/pages/dashboardOverview/__tests__/DashboardOverview.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import i18n from '@pagopa/selfcare-common-frontend/lib/locale/locale-utils';
import { fireEvent, screen } from '@testing-library/react';
import React from 'react';
import '../../../locale';
import { mockedParties } from '../../../services/__mocks__/partyService';
import { mockedPartyProducts } from '../../../services/__mocks__/productService';
import { renderWithProviders } from '../../../utils/test-utils';
import DashboardOverview from '../DashboardOverview';
import i18n from '@pagopa/selfcare-common-frontend/lib/locale/locale-utils';

beforeAll(() => {
i18n.changeLanguage('it');
Expand Down Expand Up @@ -75,6 +75,10 @@ test('should render component DashboardOverview with institutionType AS and Prod
<DashboardOverview party={mockedInsuranceCompany} products={mockedPartyProducts} />
);

const addMobilePhoneButton = await screen.queryByText('Aggiungi');

expect(addMobilePhoneButton).not.toBeInTheDocument();

// Avaible products section is not visible for AS
expect(screen.queryByText('Prodotti disponibili')).not.toBeInTheDocument();
});
Expand All @@ -94,7 +98,9 @@ test('should render component DashboardOverview with no geoTaxonomy', async () =

fireEvent.click(geoTaxModal);

const modifyButton = await screen.findByText('Aggiungi');
const addButtons = await screen.findAllByText('Aggiungi');

const modifyButton = addButtons[0];

expect(modifyButton).toBeInTheDocument();
fireEvent.click(modifyButton);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import EditIcon from '@mui/icons-material/Edit';
import { Box, Button, Grid } from '@mui/material';
import { CustomAlert } from '@pagopa/selfcare-common-frontend/lib';
import { Alert, Box, Button, Grid } from '@mui/material';
import { ButtonNaked } from '@pagopa/mui-italia';
import TitleBox from '@pagopa/selfcare-common-frontend/lib/components/TitleBox';
import { resolvePathVariables } from '@pagopa/selfcare-common-frontend/lib/utils/routes-utils';
import { storageUserOps } from '@pagopa/selfcare-common-frontend/lib/utils/storage';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
import { ENV } from '../../../../utils/env';
import { Party } from '../../../../model/Party';

type Props = {
setOpen: (open: boolean) => void;
party: Party;
};

export default function WelcomeDashboard({ setOpen }: Props) {
export default function WelcomeDashboard({ setOpen, party }: Readonly<Props>) {
const { t } = useTranslation();
const history = useHistory();
const title = t('overview.title');
const subTitle = t('overview.subTitle');

Expand Down Expand Up @@ -51,9 +58,34 @@ export default function WelcomeDashboard({ setOpen }: Props) {
</Box>
</Grid>
</Grid>
<Grid item xs={12}>
<CustomAlert sx={{ mt: 5 }} text={t('customAlert.message')} />
</Grid>
{party.userRole === 'ADMIN' && (
<Grid item xs={12}>
<Alert
sx={{ mt: 5 }}
severity="info"
variant="standard"
action={
<ButtonNaked
component={Button}
onClick={() =>
history.push(
resolvePathVariables(`${ENV.ROUTES.USERS}/:userId/edit`, {
partyId: party.partyId,
userId: storageUserOps.read()?.uid ?? '',
}) + '?activeField=mobilePhone'
)
}
color="primary"
sx={{ fontSize: 'fontSize', fontWeight: 'fontWeightBold' }}
>
{t('customAlert.button')}
</ButtonNaked>
}
>
{t('customAlert.message')}
</Alert>
</Grid>
)}
</>
);
}

0 comments on commit 0d2f6ac

Please sign in to comment.