Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PPANTT-129] feat: Update associate and dissociate CI-Station relation #673

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
639ab06
[VAS-418] feat: Align tos page with design (#579)
svariant Jun 24, 2024
e839daf
Bump to version 1.26.0-1-next
pagopa-github-bot Jun 24, 2024
11830e5
merge
jacopocarlini Jun 24, 2024
084cce1
Merge branch 'next' of https://github.com/pagopa/pagopa-selfcare-fron…
jacopocarlini Jun 24, 2024
3fb8c45
fix: PaymentNoticesDetailPage.tsx posteAuth (#577)
alessio-cialini Jun 24, 2024
cf7c06b
Bump to version 1.26.0-2-next
pagopa-github-bot Jun 24, 2024
80762b8
fix github.head_ref in the action
jacopocarlini Jun 24, 2024
702eac5
Merge branch 'next' of https://github.com/pagopa/pagopa-selfcare-fron…
jacopocarlini Jun 24, 2024
b667c10
feat: Review channel flow (#573)
gioelemella Jun 25, 2024
305195d
Bump to version 1.26.0-3-next
pagopa-github-bot Jun 25, 2024
8cdb629
[VAS-1123] feat: Remove unused Station and Channel API (#574)
gioelemella Jun 25, 2024
b23b17a
Bump to version 1.26.0-4-next
pagopa-github-bot Jun 25, 2024
1012f3c
[VAS-1104] feat: New bundle status for available but expired bundles …
svariant Jun 26, 2024
e65267f
Bump to version 1.26.0-5-next
pagopa-github-bot Jun 26, 2024
a6667b0
[VAS-1103] feat: Add new field pspBusinessName to bundle details (#583)
svariant Jun 26, 2024
f0d30ec
Bump to version 1.26.0-6-next
pagopa-github-bot Jun 26, 2024
ad8b5d5
[VAS-1095] feat: e2e PSP's & CI's actions on private bundle (#570)
svariant Jun 26, 2024
420daf0
Bump to version 1.26.0-7-next
pagopa-github-bot Jun 26, 2024
c36523a
chore: Merge main into next (#585)
svariant Jun 26, 2024
cb5c707
Bump to version 1.26.1-1-next
pagopa-github-bot Jun 26, 2024
ae6d1fd
[VAS-1133] feat: Add new api key for printPaymentsNotice product (#584)
svariant Jun 27, 2024
17a5ff4
Bump to version 1.26.1-2-next
pagopa-github-bot Jun 27, 2024
82ea22b
fix: Updated AddEditCommissionBundleForm.tsx to call brokerDelegation…
alessio-cialini Jul 1, 2024
d4b6c8a
Bump to version 1.26.1-3-next
pagopa-github-bot Jul 1, 2024
a27f297
Merge branch 'refs/heads/main' into next
jacopocarlini Jul 1, 2024
c331f88
[VAS-1070] feat; Change station and channel detail view on pending up…
gioelemella Jul 2, 2024
5753706
Bump to version 1.26.3-1-next
pagopa-github-bot Jul 2, 2024
2e2e0a7
Merge branch 'refs/heads/main' into next
jacopocarlini Jul 2, 2024
37b5a92
notify
jacopocarlini Jul 3, 2024
b6d5e03
fix missing translate (#596)
gioelemella Jul 4, 2024
9e2c2e3
Bump to version 1.26.4-1-next
pagopa-github-bot Jul 4, 2024
517895d
fix: Bugs found before release (#597)
svariant Jul 5, 2024
e318a92
Bump to version 1.26.4-2-next
pagopa-github-bot Jul 5, 2024
1defddd
[VAS-1146] feat: Implement new boolean "cart" for bundles (#605)
svariant Jul 10, 2024
0a8e85f
Bump to version 1.26.4-3-next
pagopa-github-bot Jul 10, 2024
ae6f7b7
Merge branch 'refs/heads/main' into next
jacopocarlini Jul 15, 2024
3fef2d6
build(deps): Bump axios from 0.28.1 to 1.7.2 (#599)
dependabot[bot] Jul 15, 2024
b84a046
Bump to version 1.27.0-1-next
pagopa-github-bot Jul 15, 2024
6355881
build(deps): Bump @types/node from 20.10.1 to 20.14.10 (#600)
dependabot[bot] Jul 15, 2024
07c0740
Bump to version 1.27.0-2-next
pagopa-github-bot Jul 15, 2024
2b4c6f9
build(deps): Bump @mui/icons-material from 5.15.9 to 5.16.1 (#608)
dependabot[bot] Jul 15, 2024
038b7d3
Bump to version 1.27.0-3-next
pagopa-github-bot Jul 15, 2024
a8bef9a
[VAS-1166] feat: add tos and privacy pages (#607)
alessio-cialini Jul 18, 2024
de60128
Bump to version 1.27.0-4-next
pagopa-github-bot Jul 18, 2024
bffd3e7
Merge branch 'refs/heads/main' into next
jacopocarlini Jul 19, 2024
ce966f6
fix: errorBoundary labels (#619)
alessio-cialini Jul 23, 2024
c612110
Bump to version 1.28.1-1-next
pagopa-github-bot Jul 23, 2024
2591b33
[VAS-785] feat: Introduce new flags "standIn" & "aca" for CI-station …
svariant Jul 29, 2024
72768d2
Bump to version 1.28.1-2-next
pagopa-github-bot Jul 29, 2024
2fc5bd6
[VAS-1204] feat: Change "I miei enti" to "Enti gestiti" (#625)
svariant Jul 30, 2024
7c88dc1
Bump to version 1.28.1-3-next
pagopa-github-bot Jul 30, 2024
a6054b6
[PPANTT-41] feat: Station's maintenance list page (#627)
svariant Jul 31, 2024
3a660f5
Bump to version 1.28.1-4-next
pagopa-github-bot Jul 31, 2024
5624fe8
Bump to version 1.28.1-5-next [skip ci]
pagopa-github-bot Jul 31, 2024
c2b9a33
[PPANTT-42] feat: Station maintenances create/edit/details page (#628)
svariant Aug 5, 2024
b1f0066
Bump to version 1.28.1-8-next
pagopa-github-bot Aug 5, 2024
1694399
Merge main next 1.29.3 (#635)
svariant Aug 6, 2024
a28b8f5
Bump to version 1.29.3-1-next
pagopa-github-bot Aug 6, 2024
77efb34
Merge branch 'main' into next
svariant Aug 6, 2024
d4a6904
Merge remote-tracking branch 'origin/main' into next
alessio-cialini Aug 21, 2024
1dab427
[PPANTT-93] feat: Add api key ACA (#645)
svariant Aug 23, 2024
9611ccc
Bump to version 1.30.3-3-next [skip ci]
pagopa-github-bot Aug 23, 2024
99fcce0
[PPANTT-9] feat: e2e delegations' page (#643)
svariant Aug 23, 2024
1b0ba28
Bump to version 1.30.3-4-next
pagopa-github-bot Aug 23, 2024
d0ddc21
[PPANTT-26] feat: Changed bundle's channel list autocomplete from cli…
svariant Aug 23, 2024
631bec3
Bump to version 1.30.3-5-next
pagopa-github-bot Aug 23, 2024
835c3d4
Bump to version 1.30.3-6-next [skip ci]
pagopa-github-bot Aug 23, 2024
d69ea11
[PPANTT-99] feat: New filters PSP bundles' list (#649)
svariant Aug 30, 2024
0957d7a
Bump to version 1.30.3-8-next
pagopa-github-bot Aug 30, 2024
0273239
Bump to version 1.30.3-9-next [skip ci]
pagopa-github-bot Sep 2, 2024
4233d75
fix: SideMenu station maintenances link for PT users (#650)
svariant Sep 2, 2024
d628150
Bump to version 1.30.3-10-next
pagopa-github-bot Sep 2, 2024
76773c4
Bump to version 1.30.3-11-next [skip ci]
pagopa-github-bot Sep 2, 2024
3e3d95d
Merge branch 'main' into next
svariant Sep 2, 2024
af67320
fix: Unit tests api keys
svariant Sep 2, 2024
ec16668
Merge branch 'main' into next
svariant Sep 10, 2024
c17cc22
[PPANTT-129] updated associate and disassociate CI-Station API wiht n…
gioelemella Sep 19, 2024
fc13667
[PPANTT-129] fix: Limit table list & loading dissociate EC
svariant Sep 20, 2024
f38de8d
[PPANTT-129] chore: Clean code StationECTable & columns
svariant Sep 20, 2024
6d13300
[PPANTT-129] chore: Disabled datagrid virtualization
svariant Sep 20, 2024
b784ac7
[PPANTT-129] chore: Clean & improve ConfirmModal
svariant Sep 20, 2024
06045b9
[PPANTT-129] feat: Update unit test StationECTable
svariant Sep 20, 2024
71f1467
[PPANTT-129] fix: Unit tests
svariant Sep 20, 2024
aaad120
Merge branch 'main' into PPANTT-129-authorizer-api-key-with-segregati…
gioelemella Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"clean:api-portal": "rimraf src/api/generated/portal && rimraf openApi/generated",
"generate:api-portal": "wget https://raw.githubusercontent.com/pagopa/pagopa-selfcare-ms-backoffice-backend/main/openapi/openapi.json -O ./openApi/portal-api-docs.json && npm run generate:client",
"generate:api-portal-next": "wget https://raw.githubusercontent.com/pagopa/pagopa-selfcare-ms-backoffice-backend/next/openapi/openapi.json -O ./openApi/portal-api-docs.json && npm run generate:client",
"generate:api-portal-pr": "wget https://raw.githubusercontent.com/pagopa/pagopa-selfcare-ms-backoffice-backend/next/openapi/openapi.json -O ./openApi/portal-api-docs.json && npm run generate:client",
"generate:api-portal-pr": "wget https://raw.githubusercontent.com/pagopa/pagopa-selfcare-ms-backoffice-backend/PPANTT-129-bo-authorizer-api-key-with-segregation-codes/openapi/openapi.json -O ./openApi/portal-api-docs.json && npm run generate:client",
"generate:api-portal-local": "npm run generate:client",
"generate:client": "jq 'walk(if type == \"object\" and has(\"parameters\") then .parameters |= map(select(.name != \"X-Request-Id\")) else . end)' ./openApi/portal-api-docs.json > ./openApi/portal-api-docs.json.temp && mv ./openApi/portal-api-docs.json.temp ./openApi/portal-api-docs.json && yarn run clean:api-portal && mkdirp openApi/generated && gen-api-models --api-spec openApi/portal-api-docs.json --out-dir src/api/generated/portal --no-strict --request-types --response-decoders --client && node openApi/scripts/api-portal_fixPostGen.js"
},
Expand Down
12 changes: 9 additions & 3 deletions src/api/BackofficeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,9 @@ export const BackofficeApi = {

associateEcToStation: async (
ecCode: string,
station: CreditorInstitutionStationDto
station: CreditorInstitutionStationDto,
institutionId: string,
brokerTaxCode: string,
): Promise<CreditorInstitutionStationEditResource | ProblemJson> => {
const result = await backofficeClient.associateStationToCreditorInstitution({
'ci-tax-code': ecCode,
Expand All @@ -612,13 +614,15 @@ export const BackofficeApi = {
aca: station.aca,
stand_in: station.stand_in,
},
institutionId,
brokerTaxCode
});
return extractResponse(result, 201, onRedirectToLogin);
},

updateEcAssociationToStation: async (
ecCode: string,
station: CreditorInstitutionStationDto
station: CreditorInstitutionStationDto,
): Promise<CreditorInstitutionStationEditResource | ProblemJson> => {
const result = await backofficeClient.updateStationAssociationToCreditorInstitution({
'ci-tax-code': ecCode,
Expand All @@ -634,10 +638,12 @@ export const BackofficeApi = {
return extractResponse(result, 200, onRedirectToLogin);
},

dissociateECfromStation: async (ecCode: string, stationcode: string): Promise<void> => {
dissociateECfromStation: async (ecCode: string, stationcode: string, institutionId: string, brokerTaxCode: string,): Promise<void> => {
const result = await backofficeClient.deleteCreditorInstitutionStationRelationship({
'ci-tax-code': ecCode,
'station-code': stationcode,
institutionId,
brokerTaxCode
});
return extractResponse(result, 200, onRedirectToLogin);
},
Expand Down
1 change: 1 addition & 0 deletions src/components/Table/TableDataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export default function TableDataGrid({
className="CustomDataGrid"
columnBuffer={5}
columns={columns}
disableVirtualization
components={{
Pagination: () =>
handleChangePage && rows.length > 0 ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ChevronRightIcon from '@mui/icons-material/ChevronRight';
import { GridColDef, GridRenderCellParams } from '@mui/x-data-grid';
import { TFunction, useTranslation } from 'react-i18next';
import { generatePath } from 'react-router-dom';
import { Euro } from '@mui/icons-material';
import GridLinkAction from '../../../components/Table/GridLinkAction';
import ROUTES from '../../../routes';
import { bundleDetailsActions } from '../../../redux/slices/bundleDetailsSlice';
Expand Down
121 changes: 54 additions & 67 deletions src/pages/components/ConfirmModal.tsx
Original file line number Diff line number Diff line change
@@ -1,77 +1,64 @@
import React, {MouseEventHandler} from 'react';
import {Box, Button, Typography} from '@mui/material';
import React, { MouseEventHandler } from 'react';
import { Box, Button, Typography } from '@mui/material';
import GenericModal from '../../components/Form/GenericModal';
import {useUserRole} from "../../hooks/useUserRole";

type Props = {
title: string;
message: any;
openConfirmModal: boolean;
onConfirmLabel: string;
onCloseLabel: string;
handleCloseConfirmModal: MouseEventHandler;
handleConfrimSubmit: MouseEventHandler;
title: string;
message: any;
openConfirmModal: boolean;
onConfirmLabel: string;
onCloseLabel: string;
handleCloseConfirmModal: MouseEventHandler;
handleConfrimSubmit: MouseEventHandler;
};

const ConfirmModal = ({
title,
message,
openConfirmModal,
onConfirmLabel,
onCloseLabel,
handleCloseConfirmModal,
handleConfrimSubmit,
}: Props) => {
const {userIsPagopaOperator} = useUserRole();
const renderContent = () => (
<>
<Typography variant="h6">{title}</Typography>
<Typography variant="body1" sx={{my: 2}}>
{message}
</Typography>
<Box
sx={{
display: 'grid',
gridTemplateColumns: 'repeat(6, 1fr)',
gridTemplateRows: 'auto',
}}
>
<Button
variant="outlined"
sx={
userIsPagopaOperator
? {gridColumn: 'span 5', justifySelf: 'end', mr: 4}
: {gridColumn: 'span 5', justifySelf: 'end', mr: 2}
}
onClick={handleCloseConfirmModal}
data-testid="cancel-button-modal-test"
>
{onCloseLabel}
</Button>
<Button
variant="contained"
sx={{gridColumn: 'span 1', justifySelf: 'end'}}
onClick={handleConfrimSubmit}
data-testid="confirm-button-modal-test"
>
{onConfirmLabel}
</Button>
</Box>
</>
);
title,
message,
openConfirmModal,
onConfirmLabel,
onCloseLabel,
handleCloseConfirmModal,
handleConfrimSubmit,
}: Props) => {
const renderContent = () => (
<>
<Typography variant="h6">{title}</Typography>
<Typography variant="body1" sx={{ my: 2 }}>
{message}
</Typography>
<Box display="flex" justifyContent={'flex-end'}>
<Button
variant="outlined"
sx={{ mr: 3 }}
onClick={handleCloseConfirmModal}
data-testid="cancel-button-modal-test"
>
{onCloseLabel}
</Button>
<Button
variant="contained"
onClick={handleConfrimSubmit}
data-testid="confirm-button-modal-test"
>
{onConfirmLabel}
</Button>
</Box>
</>
);

return (
<GenericModal
title={title}
message={message}
openModal={openConfirmModal}
onConfirmLabel={onConfirmLabel}
onCloseLabel={onCloseLabel}
handleCloseModal={handleCloseConfirmModal}
handleConfirm={handleConfrimSubmit}
renderContent={renderContent}
/>
);
return (
<GenericModal
title={title}
message={message}
openModal={openConfirmModal}
onConfirmLabel={onConfirmLabel}
onCloseLabel={onCloseLabel}
handleCloseModal={handleCloseConfirmModal}
handleConfirm={handleConfrimSubmit}
renderContent={renderContent}
/>
);
};

export default ConfirmModal;
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const DelegationStationsTable = ({ciTaxCode, filterByStationCode}: Props) => {
setShowDisassociateStationModal(undefined);
setLoading(true);

dissociateECfromStation(ciTaxCode, stationCode)
dissociateECfromStation(ciTaxCode, stationCode, selectedParty?.partyId ?? '', selectedParty?.fiscalCode ?? '')
.catch((reason) => (
addError({
id: 'STATION_DELETE_RELATIONSHIP',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ describe('<StationMaintenancesTable />', () => {
<MemoryRouter initialEntries={[`/station-maintenances`]}>
<Route path="/station-maintenances">
<ThemeProvider theme={theme}>
<StationMaintenancesTable setAlertMessage={alertFn} />
<StationMaintenancesTable setAlertMessage={alertFn} hoursRemaining={''} getHoursSummary={function (): void {
throw new Error('Function not implemented.');
} } />
</ThemeProvider>
</Route>
</MemoryRouter>
Expand Down Expand Up @@ -145,7 +147,9 @@ describe('<StationMaintenancesTable />', () => {
<MemoryRouter initialEntries={[`/station-maintenances`]}>
<Route path="/station-maintenances">
<ThemeProvider theme={theme}>
<StationMaintenancesTable setAlertMessage={alertFn} />
<StationMaintenancesTable setAlertMessage={alertFn} hoursRemaining={''} getHoursSummary={function (): void {
throw new Error('Function not implemented.');
} } />
</ThemeProvider>
</Route>
</MemoryRouter>
Expand Down Expand Up @@ -195,7 +199,9 @@ describe('<StationMaintenancesTable />', () => {
<MemoryRouter initialEntries={[`/station-maintenances`]}>
<Route path="/station-maintenances">
<ThemeProvider theme={theme}>
<StationMaintenancesTable setAlertMessage={alertFn} />
<StationMaintenancesTable setAlertMessage={alertFn} hoursRemaining={''} getHoursSummary={function (): void {
throw new Error('Function not implemented.');
} } />
</ThemeProvider>
</Route>
</MemoryRouter>
Expand Down Expand Up @@ -226,7 +232,9 @@ describe('<StationMaintenancesTable />', () => {
<MemoryRouter initialEntries={[`/station-maintenances`]}>
<Route path="/station-maintenances">
<ThemeProvider theme={theme}>
<StationMaintenancesTable setAlertMessage={alertFn} />
<StationMaintenancesTable setAlertMessage={alertFn} hoursRemaining={''} getHoursSummary={function (): void {
throw new Error('Function not implemented.');
} } />
</ThemeProvider>
</Route>
</MemoryRouter>
Expand All @@ -250,7 +258,9 @@ describe('<StationMaintenancesTable />', () => {
<MemoryRouter initialEntries={[`/station-maintenances`]}>
<Route path="/station-maintenances">
<ThemeProvider theme={theme}>
<StationMaintenancesTable setAlertMessage={alertFn} />
<StationMaintenancesTable setAlertMessage={alertFn} hoursRemaining={''} getHoursSummary={function (): void {
throw new Error('Function not implemented.');
} } />
</ThemeProvider>
</Route>
</MemoryRouter>
Expand Down Expand Up @@ -298,7 +308,9 @@ describe('<StationMaintenancesTable />', () => {
<MemoryRouter initialEntries={[`/station-maintenances`]}>
<Route path="/station-maintenances">
<ThemeProvider theme={theme}>
<StationMaintenancesTable setAlertMessage={alertFn} />
<StationMaintenancesTable setAlertMessage={alertFn} hoursRemaining={''} getHoursSummary={function (): void {
throw new Error('Function not implemented.');
} } />
</ThemeProvider>
</Route>
</MemoryRouter>
Expand Down
20 changes: 10 additions & 10 deletions src/pages/stations/stationAssociateEC/StationAssociateECPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import Button from '@mui/material/Button';
import FormControl from '@mui/material/FormControl';
import Grid from '@mui/material/Grid';
import Paper from '@mui/material/Paper';
import { useEffect, useState } from 'react';
import {
FormControlLabel,
InputLabel,
Expand All @@ -12,21 +7,29 @@ import {
Select,
Switch,
} from '@mui/material';
import Button from '@mui/material/Button';
import FormControl from '@mui/material/FormControl';
import Grid from '@mui/material/Grid';
import Paper from '@mui/material/Paper';
import Stack from '@mui/material/Stack';
import Typography from '@mui/material/Typography';
import { Box } from '@mui/system';
import { theme } from '@pagopa/mui-italia';
import { useErrorDispatcher, useLoading } from '@pagopa/selfcare-common-frontend';
import { useFormik } from 'formik';
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { generatePath, useHistory, useParams } from 'react-router-dom';
import { AvailableCodes } from '../../../api/generated/portal/AvailableCodes';
import { CreditorInstitutionInfo } from '../../../api/generated/portal/CreditorInstitutionInfo';
import { CreditorInstitutionInfoResource } from '../../../api/generated/portal/CreditorInstitutionInfoResource';
import { CreditorInstitutionResource } from '../../../api/generated/portal/CreditorInstitutionResource';
import { CreditorInstitutionStationDto } from '../../../api/generated/portal/CreditorInstitutionStationDto';
import ECSelection from '../../../components/Form/ECSelection';
import { StationECAssociateActionType } from '../../../model/Station';
import { useAppSelector, useAppSelectorWithRedirect } from '../../../redux/hooks';
import { partiesSelectors } from '../../../redux/slices/partiesSlice';
import { stationCISelectors } from '../../../redux/slices/stationCISlice';
import ROUTES from '../../../routes';
import { getAvailableCreditorInstitutionsForStation } from '../../../services/creditorInstitutionService';
import {
Expand All @@ -39,9 +42,6 @@ import {
LOADING_TASK_EC_AVAILABLE,
LOADING_TASK_SEGREGATION_CODES_AVAILABLE,
} from '../../../utils/constants';
import { StationECAssociateActionType } from '../../../model/Station';
import { stationCISelectors } from '../../../redux/slices/stationCISlice';
import { CreditorInstitutionResource } from '../../../api/generated/portal/CreditorInstitutionResource';

const availableEcEmptyState: CreditorInstitutionInfoResource = {
creditor_institution_info_list: [],
Expand Down Expand Up @@ -187,11 +187,11 @@ function StationAssociateECPage() {
selectedEC;

const submit = (values: CreditorInstitutionStationDto) => {
if (selectedEC && selectedEC.ciTaxCode) {
if (selectedEC && selectedEC.ciTaxCode && selectedParty?.partyId && selectedParty?.fiscalCode) {
setLoading(true);
const promise = isEditMode
? updateEcAssociationToStation(selectedEC.ciTaxCode, { ...values, stationCode: stationId })
: associateEcToStation(selectedEC.ciTaxCode, { ...values, stationCode: stationId });
: associateEcToStation(selectedEC.ciTaxCode, { ...values, stationCode: stationId }, selectedParty.partyId, selectedParty.fiscalCode);
promise
.then((_) => {
history.push(generatePath(ROUTES.STATION_EC_LIST, { stationId }), {
Expand Down
Loading
Loading